Psst.. new poll here.
Psst.. new forums here.
Microsoft is blocking us again (TY IP Reputation!) so just use oauth login instead. :)
Paste
Pasted as PHP by fire111 ( 14 years ago )
<?php
$MOD_TITLE='accounts';
$MOD_GROUP='general';
$MOD_VISIBLE=true;
$MOD_CLASS='AccountsModule';
$MOD_LOGIN=false;
$MOD_SYSTEM=1;
if(!class_exists($MOD_CLASS)) {
class AccountsModule extends Module {
private $accounts;
private $additional;
function init() {
global $MOD_TITLE,$MOD_GROUP,$MOD_VISIBLE, $CONF_PATH;
parent::init($MOD_TITLE,$MOD_GROUP,$MOD_VISIBLE);
if(isset($_GET['new_int_status_acc'])) {
if($_GET['new_int_status_acc'] == 1 || $_GET['new_int_status_acc'] == 0) {
$this->urfa->call(-0x4049);
$this->urfa->put_int($_GET['acc_id']);
$this->urfa->put_int($_GET['new_int_status_acc']);
$this->urfa->send();
$this->urfa->finish();
$this->urfa->close_session(false);
$this->urfa->disconnect();
header("Location: ".$CONF_PATH."?module=accounts");
die;
}
}
$this->accounts = array();
$this->urfa->call(-0x4050);
$this->urfa->send();
$count = $this->urfa->get_int();
for($i = 0; $i < $count; $i++) {
$tmp = array();
$account_id = $this->urfa->get_int();
$tmp['balance'] = roundDouble($this->urfa->get_double());
$tmp['credit'] = roundDouble($this->urfa->get_double());
$tmp['int_status'] = $this->urfa->get_int();
$tmp['block_status'] = $this->urfa->get_int();
$tmp['vat_rate'] = $this->urfa->get_double();
$tmp['link'] = resolveIntStatusForAccount($tmp['int_status'], $account_id);
$this->accounts[$account_id] = $tmp;
}
$this->urfa->finish();
$this->urfa->call(-0x403b);
$this->urfa->send();
$this->additional = $this->urfa->get_int();
$this->urfa->finish();
}
function ssblock() {
if ($tmp['block_status'] == '0') {
$ssblock = 'усе ок, босс';
} elseif ($tmp['block_status'] == '16') {
$ssblock = 'system block';
} elseif ($tmp['block_status'] == '256') {
$ssblock = 'admin block';
} else {
$ssblock = 'хз';
return $ssblock;
}
}
function writeBody() {
if(isset($_GET["result_pp"])){
echo resolvePP($_GET["result_pp"]);
echo "<br>";
echo "<br>";
}
if(isset($_GET["result_ff"])){
echo resolveFF($_GET["result_ff"]);
echo "<br>";
echo "<br>";
}
if(isset($_GET["result_vs"])){
echo resolveVS($_GET["result_vs"]);
echo "<br>";
echo "<br>";
}
$promised_payments = 1;
$voluntary_block = 2;
$funds_flow = 4;
$primary_acc = true;
foreach($this->accounts as $id => $acc) {
$table = new Table();
if($primary_acc){
$table->setCaption('primary_account');
$primary_acc = false;
} else {
$table->setCaption('secondary_account');
}
$table->addColumn('parameter', 'right');
$table->addColumn('value', 'left');
$table->addRow(array(langGet('account_id'), $id));
$table->addRow(array(langGet('balance'), $acc['balance']));
$table->addRow(array(langGet('credit'), $acc['credit']));
$table->addRow(array(langGet('vat_rate'), $acc['vat_rate']));
//$table->addRow(array(langGet('block_status'), $acc['block_status']));
$table->addRow(array(langGet('block_status'), $this->ssblock()));
$table->addRow(array(langGet('int_status'), $acc['link']));
if($this->additional & $promised_payments){
$table->addRow(array(langGet('promised_payment'), getLinkToPromisedPayment($id)));
}
if($this->additional & $voluntary_block){
$table->addRow(array(langGet('voluntary_suspension'), getLinkToVoluntarySuspension($id)));
}
if(($this->additional & $funds_flow) && (sizeof($this->accounts) > 1) && ($acc['balance'] > 0)){
$table->addRow(array(langGet('funds_flow'), getLinkToFundsFlow($id)));
}
$table->writeHtml();
echo '<br>';
}
}
}
}
?>
Revise this Paste