function has_enough($amount, $curr_type) { $uid = user_id(); sync_to_bitcoin($uid); $query = "\n SELECT 1\n FROM purses\n WHERE uid='{$uid}' AND type='{$curr_type}' AND amount >= '{$amount}'\n LIMIT 1;\n "; $result = do_query($query); return has_results($result); }
require_once '../../util.php'; if (count($argv) < 3) { echo "fix_badref [bank statement ID (bid)] [deposref]\n"; exit(-1); } $bid = $argv[1]; $deposref = $argv[2]; $query = "\n SELECT entry\n FROM bank_statement\n WHERE\n bid='{$bid}'\n AND reqid IS NULL\n AND status='BADREF'\n "; $result = do_query($query); if (!has_results($result)) { echo "No results found for bank statement {$bid}...\n"; exit(-1); } $row = get_row($result); $entry = $row['entry']; $entry = split(',', $entry); $amount = $entry[6]; $amount = numstr_to_internal($amount); $query = "\n SELECT uid\n FROM users\n WHERE deposref='{$deposref}'\n "; $result = do_query($query); if (!has_results($result)) { echo "No user found with deposref of {$deposref}...\n"; exit(-1); } $row = get_row($result); $uid = $row['uid']; $query = "\n INSERT INTO requests (\n req_type,\n uid,\n amount,\n curr_type\n ) VALUES (\n 'DEPOS',\n {$uid},\n {$amount},\n '" . CURRENCY . "'\n )"; do_query($query); $query = "\n UPDATE bank_statement\n SET\n reqid=LAST_INSERT_ID(),\n status='FINAL'\n WHERE\n bid='{$bid}'\n AND reqid is NULL\n AND status='BADREF'\n "; do_query($query); echo "Done.\n";
<?php require_once '../util.php'; if (count($argv) < 2) { echo "need account name to synchronise\n"; exit(-1); } $uid = cleanup_string($argv[1]); # check they actually exist $query = "SELECT 1 FROM users WHERE uid='{$uid}'"; $result = do_query($query); if (has_results($result)) { sync_to_bitcoin($uid); echo "Done.\n"; } else { echo "User {$uid} doesn't exist.\n"; }
function deposref_exists($deposref) { $query = "\n SELECT 1\n FROM\n users\n WHERE\n deposref='{$deposref}'\n LIMIT 1\n "; $result = do_query($query); return has_results($result); }
echo "<tr><td class='nobborder' colspan='9'>WARNING: NOT MATCHING EVENT</td></tr>"; } } print "</table>"; if (is_dir($config["searches_dir"]) && isset($export) && $export != "noExport") { fclose($outfile); $logs = ""; foreach ($logarr as $key => $val) { $logs .= $key . "\n"; } fputs($loglist, $logs); fclose($loglist); } } // FROM: if (has_results()) { if (!has_results($num_lines)) { echo '<table align="center" width="100%" style="background:transparent"><tr> <td class="noborder" style="color:red;font-size:14px">' . _("No Data Found Matching Your Criteria") . '</td> <td width="150px" class="nobborder" style="text-align:right;" nowrap>' . _("Parsing time") . ': <b>' . $totaltime . '</b> ' . _("seconds") . '</td> </tr> </table>'; } else { ?> <center> <?php if ($from_remote) { echo _("Showing ") . "<b>" . ($offset + 1) . "</b> - <b>" . ($offset + $top) . "</b>" . _(" <b>first</b> events") . _(" for <b>each server</b>") . " (<b>" . ($offset * $num_servers + 1) . "</b> - <b>" . ($offset * $num_servers + count($result)) . "</b> total)"; ?> . <?php } else {