First Commit
This commit is contained in:
1 parent
5eb9dd037d
commit
2e62c0e60b
11877 files changed
+2035312
No files matched your search
@@ -0,0 +1,120 @@
|
||||
<?php
|
||||
require_once("include/globals.php");
|
||||
|
||||
if (SessionActive() != 1 || ! UserLoggedIn()) {
|
||||
header("Location: /");
|
||||
exit();
|
||||
}
|
||||
|
||||
|
||||
?>
|
||||
<p><b><span id='paymentAmountText'></span></b></p>
|
||||
<form method='post' action='/' id='acctOrdersForm'>
|
||||
<table width='900' class='content-table'>
|
||||
<tr>
|
||||
<td align='left' valign='top' class='heading'><?php displayLanguageText('TEXT-ORDER-NUMBER'); ?></td>
|
||||
<td align='left' valign='top' class='heading'><?php displayLanguageText('TEXT-SCHEDULE-TITLE'); ?></td>
|
||||
<td width='70' align='right' valign='top' class='heading'><?php displayLanguageText('TEXT-ORDER-TOTAL'); ?></td>
|
||||
<td width='70' align='right' valign='top' class='heading'><?php displayLanguageText('TEXT-AMOUNT-PAID'); ?></td>
|
||||
<td width='70' align='right' valign='top' class='heading'><?php displayLanguageText('TEXT-BALANCE'); ?></td>
|
||||
<td width='70' align='right' valign='top' class='heading'><?php displayLanguageText('TEXT-AMOUNT'); ?></td>
|
||||
<td width='100' align='center' valign='top' class='heading'><?php displayLanguageText('TEXT-ORDER-STATUS'); ?></td>
|
||||
</tr>
|
||||
<?php
|
||||
// Get set of people associated with this account
|
||||
$people = array();
|
||||
$plist = "";
|
||||
$results = db_query("SELECT * FROM people WHERE school_num = $base_school_num AND user_num = $user_num");
|
||||
while ($row = db_fetch_assoc($results)) {
|
||||
$pnum = $row['record_num'];
|
||||
$people[$pnum] = $row;
|
||||
if (strlen($plist)) $plist .= ", ";
|
||||
$plist .= $pnum;
|
||||
}
|
||||
|
||||
// Get set of orders
|
||||
$debit_trx = db_query("SELECT * FROM user_account WHERE school_num = $school_num AND user_num = $user_num AND transaction_amount > 0 AND transaction_status = 'Open' AND deleted != 'Y' ORDER BY transaction_datetime,record_num");
|
||||
$count = 0;
|
||||
while ($row = db_fetch_assoc($debit_trx)) {
|
||||
extract($row);
|
||||
$ua_rnum = $record_num;
|
||||
|
||||
switch ($transaction_type) {
|
||||
case 'Order':
|
||||
$record_num = $order_num;
|
||||
|
||||
$onum = "#$record_num - " . $people[$people_num]['first_name'] . ' ' . $people[$people_num]['last_name'];
|
||||
$sname = db_getVal("SELECT schedule_name FROM hotlunch_schedules WHERE school_num = $school_num AND record_num = $schedule_num");
|
||||
|
||||
$results = db_query("SELECT * FROM hotlunch_order_header WHERE school_num = $school_num AND ordered_by_num = $people_num AND record_num = $order_num");
|
||||
$order = db_fetch_assoc($results);
|
||||
|
||||
if ($order['status'] == 'Paid' || $order['status'] == 'Complimentary') {
|
||||
db_query("UPDATE user_account SET transaction_status = 'Closed' WHERE school_num = $school_num AND user_num = $user_num AND record_num = $ua_rnum");
|
||||
break;
|
||||
}
|
||||
|
||||
$amount_paid = $order['amount_paid'];
|
||||
$status = $order['status'];
|
||||
break;
|
||||
|
||||
default:
|
||||
$onum = $transaction_type;
|
||||
$sname = "";
|
||||
$status = 'Unpaid';
|
||||
if ($transaction_amount == $amount_paid) $status = 'Paid';
|
||||
break;
|
||||
}
|
||||
|
||||
// Format amounts
|
||||
$trx_amt = $currencySymbol . number_format($transaction_amount,2);
|
||||
$opaid = $currencySymbol . number_format($amount_paid,2);
|
||||
$balance = $transaction_amount - $amount_paid;
|
||||
$obal = $currencySymbol . number_format($balance,2);
|
||||
|
||||
$bgclass = "data-even";
|
||||
if ($count % 2) $bgclass = "data-odd";
|
||||
$count++;
|
||||
?>
|
||||
<tr>
|
||||
<td align='left' class='<?php echo($bgclass) ?>'><?php echo($onum) ?></td>
|
||||
<td align='left' class='<?php echo($bgclass) ?>'><?php echo($sname) ?></td>
|
||||
<td align='right' class='<?php echo($bgclass) ?>'><?php echo($trx_amt) ?></td>
|
||||
<td align='right' class='<?php echo($bgclass) ?>'><?php echo($opaid) ?></td>
|
||||
<td align='right' class='<?php echo($bgclass) ?>'><?php echo($obal) ?></td>
|
||||
<td align='right' class='<?php echo($bgclass) ?>'>
|
||||
<input type='text' name='amount_<?php echo($record_num) ?>' id='amount_<?php echo($record_num) ?>' rnum='<?php echo($record_num) ?>' tabindex='<?php echo($count) ?>' class='paymt' size='8' style='text-align: right; float: right;'>
|
||||
<input type='hidden' name='balance_<?php echo($record_num) ?>' id='balance_<?php echo($record_num) ?>' value='<?php echo($balance) ?>'>
|
||||
</td>
|
||||
<td align='center' class='<?php echo($bgclass) ?>'>
|
||||
<?php if ($transaction_type == 'Order') { ?>
|
||||
<select name='order_status_<?php echo($record_num) ?>' id='order_status_<?php echo($record_num) ?>' class='order-status'>
|
||||
<?php BuildFileList("order_status.txt",$status) ?>
|
||||
</select>
|
||||
<input type='hidden' name='order_ostatus_<?php echo($record_num) ?>' id='order_ostatus_<?php echo($record_num) ?>' value='<?php echo($status) ?>'>
|
||||
<?php } else { ?>
|
||||
|
||||
<?php } ?>
|
||||
</td>
|
||||
</tr>
|
||||
<?php
|
||||
}
|
||||
|
||||
$bgclass = "data-even";
|
||||
if ($count % 2) $bgclass = "data-odd";
|
||||
?>
|
||||
<tr>
|
||||
<td align='right' colspan='5' class='<?php echo($bgclass) ?>'><b><?php displayLanguageText('TEXT-TOTAL'); ?></b></td>
|
||||
<td align='right' class='<?php echo($bgclass) ?>'><b><span id='paymentTotal'></span></b></td>
|
||||
<td align='left' class='<?php echo($bgclass) ?>'> </td>
|
||||
</table>
|
||||
<br>
|
||||
<button id='submitPaymentDetails' class='btn btn--outline btn--xsmall'> <?php displayLanguageText('TEXT-UPDATE'); ?> </button>
|
||||
<span id='formMessage'><b><?php displayLanguageText('TEXT-USER-ACCT-ORDERS-MESSAGE'); ?></b></span>
|
||||
<br>
|
||||
<br>
|
||||
<br>
|
||||
<br>
|
||||
<br>
|
||||
<br>
|
||||
</form>
|
||||
Reference in new issue
Block a user