|
|
|
@ -328,16 +328,25 @@ switch ($VARS['action']) {
|
|
|
|
|
break;
|
|
|
|
|
case "transactionsearch":
|
|
|
|
|
header("Content-Type: application/json");
|
|
|
|
|
if (!is_empty($VARS['q'])) {
|
|
|
|
|
$where = [];
|
|
|
|
|
if (!empty($VARS['q'])) {
|
|
|
|
|
$where["AND"]["OR"] = [
|
|
|
|
|
"txid" => $VARS['q'],
|
|
|
|
|
"name[~]" => $VARS['q'],
|
|
|
|
|
"email[~]" => $VARS['q'],
|
|
|
|
|
"phone[~]" => $VARS['q']
|
|
|
|
|
];
|
|
|
|
|
} else {
|
|
|
|
|
exit(json_encode(["status" => "ERROR", "transactions" => false]));
|
|
|
|
|
}
|
|
|
|
|
$start = date('Y-m-d H:i:s', 946684800); // Jan 1 2000
|
|
|
|
|
$end = date('Y-m-d H:i:s');
|
|
|
|
|
if (!empty($VARS['start']) && strtotime($VARS['start']) !== FALSE) {
|
|
|
|
|
$start = date('Y-m-d H:i:s', strtotime($VARS['start']));
|
|
|
|
|
}
|
|
|
|
|
if (!empty($VARS['end']) && strtotime($VARS['end']) !== FALSE) {
|
|
|
|
|
$end = date('Y-m-d H:i:s', strtotime($VARS['end']));
|
|
|
|
|
}
|
|
|
|
|
$where["AND"]['txdate[>=]'] = $start;
|
|
|
|
|
$where["AND"]['txdate[<=]'] = $end;
|
|
|
|
|
$where["LIMIT"] = 50;
|
|
|
|
|
|
|
|
|
|
$transactions = $database->select('transactions', [
|
|
|
|
|