0 && $_REQUEST['type'] == 'deleted') {
$TitleText = "Deleted $TitleText";
}
// Start the template and output buffering
startTemplate();
$templatePageTitle = $TitleText;
// Ensure that only valid user types have access to this module
if (!in_array($_SESSION['UserInfo']['type'],array('SuperUser','System Administrator','Application Administrator','Administration Team','Schedule Team','Financial','Financial Team'))) {
echo("
\n");
$error_message = getLanguageText('ERRORMSG-ACCESS-DENIED');
include "form.messages.php";
return;
}
$school_num = $school_record['record_num'];
?>
0) {
?>
Click on the word "Error" to post transactions that need to be posted.
Do not post "Pending" transactions.
-
0) $mc_gross = "$" . number_format($mc_gross,2);
if ($mc_fee > 0) $mc_fee = "$" . number_format($mc_fee,2);
// Add info tips
if ($payment_status == 'Pending') {
$span_id = "status_$record_num";
$otipSpans .= "" . $otipTABLE .
sprintf($otipROW2,'Pending Reason:',$pending_reason) . "
\n";
$otipSpanIDs[] = $span_id;
$payment_status = "Pending";
}
// Unknown posting results
if ($posting_result == '') {
$results = db_query("SELECT * FROM user_account WHERE school_num = $school_num AND payment_reference = '$txn_id'");
if (db_num_rows($results) > 0) {
$posting_result = 'Posted';
}
else {
$posting_result = 'Error';
}
}
// Error postings
if ($posting_result == 'Error') {
$span_id = "result_$record_num";
$unum = intval($user_num);
if (strlen($posting_message) == 0) $posting_message = "Unknown Posting Error";
if ($unum > 0) {
$otipSpans .= "" . $otipTABLE .
sprintf($otipROW2,'Posting Error:',$posting_message) . "\n";
}
else {
$otipSpans .= "" . $otipTABLE .
sprintf($otipROW2,'Posting Error:',$posting_message) . " -- No User Number\n";
}
$otipSpanIDs[] = $span_id;
$onClick = "onClick='return confirm(\"This will post the transaction to the user account. Only post if the transaction has cleared.\");'";
if ($unum > 0) $posting_result = "Error";
else {
$posting_result = "Error";
}
}
// Successful postings
if ($posting_result == 'Posted') {
$span_id = "result_$record_num";
$results = db_query("SELECT * FROM user_account WHERE school_num = $school_num AND payment_reference = '$txn_id'");
if (db_num_rows($results) > 0) {
$otipSpanIDs[] = $span_id;
$otipSpans .= "" . $otipTABLE;
$otipSpans .= sprintf($otipROW2,"Transaction Num:",$trx_num);
$otipSpans .= sprintf($otipROW2,"Item:",$item_name);
$otipSpans .= sprintf($otipROW2,"Business:",$business);
$otipSpans .= sprintf($otipROW2,"Receiver:",$receiver_email);
$row = db_fetch_array($results);
$otipSpans .= sprintf($otipROW2,"User Acct TRX:",$record_num);
$order_payments = $row['order_payments'];
$orders = explode("|",$order_payments);
for ($i = 0; $i < count($orders); $i++) {
$order_num = preg_replace('/\{(\d+):\d+.\d+\}/','{$1}',$orders[$i]);
if (!is_numeric($order_num)) continue;
// Get order info
$results = db_query("SELECT * FROM hotlunch_order_header WHERE school_num = $school_num AND record_num = $order_num");
$row = db_fetch_array($results);
// Get schedule info
$schedule_num = $row['schedule_num'];
$schedule_name = "Unknown";
if (is_numeric($schedule_num) && $schedule_num > 0) {
$schedule_name = db_getVal("SELECT schedule_name FROM hotlunch_schedules WHERE school_num = $school_num AND record_num = $schedule_num");
}
// Get person info
$person_num = $row['ordered_by_num'];
$oname = "Unknown";
if (is_numeric($person_num) && $person_num > 0) {
$oname = db_getVal("SELECT concat(first_name,' ',last_name) FROM people WHERE school_num = $base_school_num AND record_num = $person_num");
}
$otipSpans .= "
|
\n";
$otipSpans .= sprintf($otipROW2,"Order Number: ",$order_num);
$otipSpans .= sprintf($otipROW2,"Ordered By: ",$oname);
$otipSpans .= sprintf($otipROW2,"Order Schedule: ",$schedule_name);
// $otipSpans .= sprintf($otipROW2,"Order Status: ",$row['status']);
$otipSpans .= sprintf($otipROW2,"Order Date: ",$row['added_date']);
// $otipSpans .= sprintf($otipROW2,"Last Updated: ",$row['updated_date']);
}
$otipSpans .= "\n";
$posting_result = "Posted";
}
else {
if ($row['payment_status'] != 'Pending') {
$otipSpanIDs[] = $span_id;
$otipSpans .= "" . $otipTABLE;
$otipSpans .= sprintf($otipROW2,"Transaction Num:",$trx_num);
$otipSpans .= "
|
\n";
$otipSpans .= "Unable to locate the user account transaction for this PayPal payment |
\n";
$otipSpans .= "\n";
$posting_result = "" .
"Warning";
}
else {
$posting_result = "Pending";
}
}
}
// Format name
$name = "$first_name $last_name";
if (is_numeric($user_num) && $user_num > 0) {
$results = db_query("SELECT * FROM users WHERE record_num = $user_num");
$row = db_fetch_array($results);
$span_id = "user_$user_num";
if (!in_array($span_id,$otipSpanIDs)) {
$user_balance = db_getVal("select sum(transaction_amount) as balance from user_account where school_num = $school_num and user_num = $user_num AND (deleted != 'Y' OR deleted IS NULL)");
$user_balance = floatval($user_balance);
$otipSpans .= "" . $otipTABLE .
sprintf($otipROW2,"User ID: ",$row['userid']) .
sprintf($otipROW2,"User Type: ",$row['type']) .
sprintf($otipROW2,"Name: ",$row['first_name'] . ' ' . $row['last_name']) .
sprintf($otipROW2,"Email: ",$row['email']) .
sprintf($otipROW2,"Phone: ",$row['home_phone']) .
sprintf($otipROW2,'' . getLanguageText('TEXT-CURRENT-BALANCE') . ': ',$currencySymbol . number_format($user_balance,2)) .
"\n";
$otipSpanIDs[] = $span_id;
}
$name = "$name";
$payer_email = "$payer_email";
}
$msg = getLanguageText('TEXT-CONFIRM-STATUS-CHANGE');
$msg .= "\\n\\n" . getLanguageText('TEXT-WILL-NOT-POST-TRANSACTION');
if ($error_handled == 'N') $command = "$delete_icon";
else $command = "$change_icon";
?>
|
|
|
|
|
|
|
|
|
|
\n");
displayLanguageText('ERRORMSG-NO-RECORDS');
echo("
\n");
}
if ($numErrors > 0) {
?>
|
|
|
|