Files
HotLunches/account-deposit.php
2026-10-19 15:22:52 -07:00

75 lines
1.9 KiB
PHP

<?php
require_once("include/globals.php");
if (SessionActive() != 1 || ! UserLoggedIn()) {
header("Location: /");
exit();
}
// Get possible deposit amounts
$query = "SELECT * FROM account_deposit_amounts WHERE school_num = $school_num ORDER BY amount ASC";
$amounts = db_query($query);
if (db_num_rows($amounts) == 0) {
header("Location: /");
exit();
}
// Start the template and output buffering
startTemplate();
$templatePageTitle = getLanguageText('TEXT-ACCOUNT-DEPOSIT');
echo("<br>\n");
$message_width = 500;
include "form.messages.php";
unset($naction);
if (array_key_exists('naction',$_POST)) $naction = $_POST['naction'];
if (!isset($naction) || $naction != 'deposit') {
?>
<form method='post'>
<table width='300' class='content-table'>
<tr>
<td colspan='2' align='center' class='heading'><?php displayLanguageText('TEXT-SELECT-DEPOSIT-AMOUNT') ?></td>
</tr>
<?php
$count = 0;
$checked = " checked='checked'";
while ($row = db_fetch_assoc($amounts)) {
extract($row);
$bgclass = 'data-even';
if ($count % 2) $bgclass = 'data-odd';
$count++;
?>
<tr class='<?php echo($bgclass) ?>'>
<td align='center'><?php echo($currencySymbol . $amount) ?></td>
<td align='center'><input type='radio' name='selected_amount' class='selected-amount' value="<?php echo($amount) ?>"<?php echo($checked) ?>></td>
</tr>
<?php
$checked = "";
}
?>
<tr>
<td align='center' colspan='2'>
<br>
<input type='submit' class='btn btn--primary' value="<?php displayLanguageText('TEXT-DEPOSIT-SELECTED-AMOUNT'); ?>">
<br>
<br>
</td>
</tr>
</table>
<input type='hidden' name='action' value='account-deposit'>
<input type='hidden' name='naction' value='deposit'>
</form>
<br>
<?php
}
else include "payment_form.php";
endTemplate();
?>