Revize 869
Přidáno uživatelem Jiří Sviták před více než 13 roky(ů)
freenetis/branches/testing/application/i18n/cs_CZ/texts.php | ||
---|---|---|
'after you\'ve done that, you can continue' => 'Poté, co tak učiníte, můžete pokračovat.',
|
||
'agree' => 'Souhlas',
|
||
'all' => 'Všichni',
|
||
'all accounts now have correct balances, %d accounts had incorrect balances' => 'Všechny účty teď mají správné zůstatky, %d účtů mělo chybné zůstatky.',
|
||
'all accounts now have correct balances, %d accounts had incorrect balances, list of ids of corrected accounts: %s' => 'Všechny účty teď mají správné zůstatky, %d účtů mělo chybné zůstatky, seznam ID opravených účtů: %s',
|
||
'all ip addresses of member' => 'všem IP adresám člena',
|
||
'all redirected' => 'Všichni přesměrovaní',
|
||
'all transfers' => 'Všechny převody',
|
||
... | ... | |
'your work has been rejected' => 'Vaše práce byla zamítnuta',
|
||
'your work has been updated' => 'Vaše práce byla aktualizována',
|
||
'zip code' => 'PSČ'
|
||
);
|
||
);
|
||
|
freenetis/branches/testing/application/models/account.php | ||
---|---|---|
");
|
||
// create update sql query
|
||
$sql = "UPDATE accounts SET balance = CASE id ";
|
||
// incorrect balances
|
||
$incorrect_balances = 0;
|
||
// array of ids to change
|
||
$ids = array();
|
||
foreach ($accounts as $account)
|
||
{
|
||
if ($account->balance != $account->calculated_balance)
|
||
{
|
||
$incorrect_balances++;
|
||
$sql .= "WHEN $account->id THEN $account->calculated_balance ";
|
||
$ids[] = $account->id;
|
||
}
|
||
}
|
||
// are there some accounts with incorrect balances? save correct balances
|
||
if ($incorrect_balances > 0)
|
||
if (count($ids) > 0)
|
||
{
|
||
$ids_with_commas = implode(',', $ids);
|
||
$sql .= "END WHERE id IN ($ids_with_commas)";
|
||
$db = new Database();
|
||
$db->query($sql);
|
||
}
|
||
return $incorrect_balances;
|
||
// returns array of ids of corrected accounts
|
||
return $ids;
|
||
}
|
||
|
||
/**
|
||
... | ... | |
$balance = $account_model->get_account_balance($account_id);
|
||
return $this->db->query("UPDATE accounts SET balance = '$balance' WHERE id = $account_id");
|
||
}
|
||
|
||
|
||
}
|
||
|
||
?>
|
freenetis/branches/testing/application/controllers/phone_invoices.php | ||
---|---|---|
return $user_number_cache[$number];
|
||
}
|
||
|
||
}
|
||
}
|
freenetis/branches/testing/application/controllers/accounts.php | ||
---|---|---|
Controller::error(ACCESS);
|
||
// get all accounts with their own and calculated balances
|
||
$account_model = new Account_Model();
|
||
$incorrect_balances = $account_model->recalculate_account_balances();
|
||
$this->session->set_flash('message', url_lang::lang('texts.All accounts now have correct balances, %d accounts had incorrect balances.', $incorrect_balances));
|
||
// recalculates balances and returns array of ids of incorrect accounts
|
||
$incorrect_accounts = $account_model->recalculate_account_balances();
|
||
$this->session->set_flash('message', url_lang::lang('texts.All accounts now have correct balances, %d accounts had incorrect balances, list of IDs of corrected accounts: %s', array(0 => count($incorrect_accounts), 1 => implode(", ", $incorrect_accounts))));
|
||
url::redirect(url_lang::base().'accounts/show_all');
|
||
}
|
||
|
||
}
|
||
?>
|
Také k dispozici: Unified diff
Uprava vysledne statistiky po manualnim prepocitavani zustatku na uctech. merge do testingu, puvodne jsem omylem odeslal do trunku