function accounting_select() { global $_STATE; accounting_list(); //restore the record list if (!array_key_exists(strval($_POST["selAccounting"]), $_STATE->records)) { throw_the_bum_out(NULL, "Evicted(" . __LINE__ . "): invalid accounting id " . $_POST["selAccounting"]); //we're being spoofed } $_STATE->record_id = intval($_POST["selAccounting"]); }
function accounting_select($ID = -1) { global $_DB, $_STATE; if ($ID < 0) { //not yet selected accounting_list(); //restore the record list if (!array_key_exists(strval($_POST["selAccounting"]), $_STATE->records)) { throw_the_bum_out(NULL, "Evicted(" . __LINE__ . "): invalid accounting id " . $_POST["selAccounting"]); //we're being spoofed } $ID = intval($_POST["selAccounting"]); } $_STATE->accounting_id = $ID; $sql = "SELECT name FROM " . $_DB->prefix . "a20_accounting\n\t\t\tWHERE accounting_id=" . $_STATE->accounting_id . ";"; $_STATE->accounting = $_DB->query($sql)->fetchObject()->name; }