\n"; // Handle selected date ranges $start_date = date("Y-m-d 00:00:00",time()); $end_date = date("Y-m-d 23:59:59",time()); $summarize_by = 'PayMethod'; if (array_key_exists('summarize_by',$_POST) && strlen($_POST['summarize_by']) > 0) $summarize_by = $_POST['summarize_by']; if (array_key_exists('start_date',$_POST) && strlen($_POST['start_date']) > 0) $start_date = date("Y-m-d 00:00:00",strtotime($_POST['start_date'])); if (array_key_exists('end_date',$_POST) && strlen($_POST['end_date']) > 0) { $end_date = $_POST['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); $twhere = "AND transaction_datetime BETWEEN '$start_date' AND '$end_date' "; if (!isset($uwhere)) $uwhere = ''; // View only selected payment methods unset($selected_payment_method); if (array_key_exists('selected_payment_method',$_POST) && strlen($_POST['selected_payment_method']) > 0) { $selected_payment_method = $_POST['selected_payment_method']; $uwhere .= "AND payment_method = '$selected_payment_method' "; $report_title .= "$selected_payment_method Transactions "; } // View only selected schedule $selected_schedule_num = 0; if (array_key_exists('selected_schedule_num',$_POST) && strlen($_POST['selected_schedule_num']) > 0) { $selected_schedule_num = intval($_POST['selected_schedule_num']); $uwhere .= "AND schedule_num = '$selected_schedule_num' "; } if (!isset($selected_payment_method)) $selected_payment_method = ''; $message_width = 400; include "form.messages.php"; ?>
\n- " . $ColumnTitle . " -"; } else { $query = "SELECT substr(transaction_datetime,1,10) as col1,sum(transaction_amount) as amount " . "FROM user_account " . "WHERE school_num = $school_num " . "AND transaction_type = 'Payment' " . $uwhere . $twhere . "AND (deleted != 'Y' OR deleted IS NULL) " . "GROUP BY 1 " . "ORDER BY transaction_type"; $transactions = db_query($query); $ColumnTitle = getLanguageText('TEXT-PAYMENT-DATE'); $report_title .= "$sdate - $edate
|
|