0) $start_date = date("Y-m-d 00:00:00",strtotime($_REQUEST['start_date']));
if (array_key_exists('end_date',$_REQUEST) && strlen($_REQUEST['end_date']) > 0) {
$end_date = $_REQUEST['end_date'];
if ($end_date < substr($start_date,0,10)) {
$end_date = substr($start_date,0,10);
$error_message = getLanguageText('ERRORMSG-INVALID-DATE-RANGE');
}
$end_date = date("Y-m-d 23:59:59",strtotime($end_date));
}
$sdate = substr($start_date,0,10);
$edate = substr($end_date,0,10);
if (!isset($twhere)) $twhere = '';
if (!isset($print_cmd)) $print_cmd = '';
$twhere .= "AND transaction_datetime BETWEEN '$start_date' AND '$end_date' ";
$print_cmd .= "&start_date=$sdate&end_date=$edate";
// View only selected schedule
$swhere = "";
$uwhere = "";
$selected_schedule_num = 0;
if (array_key_exists('selected_schedule_num',$_REQUEST) && strlen($_REQUEST['selected_schedule_num']) > 0) {
$selected_schedule_num = intval($_REQUEST['selected_schedule_num']);
$uwhere .= "AND ua.schedule_num = $selected_schedule_num ";
$print_cmd .= "&selected_schedule_num=$selected_schedule_num";
}
// Set query sort order
$order_by = "ORDER BY transaction_datetime,record_num";
$sort = "Date";
if (array_key_exists('sort',$_REQUEST) && strlen($_REQUEST['sort'])) {
$sort = $_REQUEST['sort'];
if ($sort == 'Name') $order_by = "ORDER BY last_name,first_name,transaction_datetime,record_num";
}
$print_cmd .= "&sort=$sort";
$message_width = 600;
include "form.messages.php";
?>
0 " .
$uwhere . $twhere . $swhere .
$order_by;
writeLog($query);
$transactions = db_query($query);
if (db_num_rows($transactions)) {
$q = urlencode($query);
?>
\n");
echo(" | $userid | \n");
echo(" $trx_date | \n");
echo(" $transaction_type | \n");
echo(" $transaction_status | \n");
echo(" $currencySymbol$transaction_amount | \n");
$total_amount += $transaction_amount;
$query = "SELECT * FROM user_account_detail WHERE school_num = $school_num AND user_num = $user_num AND posted_to_transaction = $record_num";
$details = db_query($query);
if (db_num_rows($details)) {
$dnum = 0;
while ($row = db_fetch_assoc($details)) {
$ptrxNum = $row['transaction_num'];
$pAmt = number_format(abs($row['posted_amount']),2);
if (abs($pAmt) < 0.01) continue;
$method = db_getVal("SELECT payment_method FROM user_account WHERE school_num = $school_num AND record_num = $ptrxNum");
if (strlen($method) == 0 || !$method) $method = db_getVal("SELECT transaction_type FROM user_account WHERE school_num = $school_num AND record_num = $ptrxNum");
if (isset($payment_totals[$method])) $payment_totals[$method] += $row['posted_amount'];
else $payment_totals[$method] = $row['posted_amount'];
$total_payment += $row['posted_amount'];
if ($dnum == 0) {
echo(" $method | \n");
echo(" -$currencySymbol$pAmt | \n");
}
else {
// $class = 'data-even';
// if ($count % 2) $class = 'data-odd';
// $count++;
echo(" \n");
echo(" | \n");
echo(" | \n");
echo(" | \n");
echo(" | \n");
echo(" | \n");
echo(" $method | \n");
echo(" -$currencySymbol$pAmt | \n");
}
$dnum++;
}
}
else {
echo(" | \n");
echo(" | \n");
}
echo("
\n");
}
?>
$value) {
$method = $key;
$pAmt = number_format(abs($value),2);
$class = 'data-even';
if ($count % 2) $class = 'data-odd';
$count++;
echo(" \n");
echo(" | $method | \n");
echo(" -$currencySymbol$pAmt | \n");
echo("
\n");
}
?>