Files
HotLunches/recalc.user_detail.php
T
2026-10-19 15:22:52 -07:00

64 lines
1.8 KiB
PHP

<?php
require_once("include/globals.php");
if (SessionActive() != 1 || ! UserLoggedIn()) {
header("Location: /");
exit();
}
// Ensure that only valid user types have access to this module
$AllowedUserTypes = array('SuperUser','System Administrator','Application Volunteer','Financial','Financial Team','Administration Team');
if (checkPermission($AllowedUserTypes) != 1) {
$error_message = getLanguageText('ERRORMSG-ACCESS-DENIED');
include "form.messages.php";
endTemplate();
exit();
}
// Start the template and output buffering
startTemplate();
$templatePageTitle = getLanguageText('TEXT-USER-PAYMENT-DETAIL-UPDATE');
?>
<br>
<p><?php displayLanguageText('TEXT-LENGTHY-UPDATE'); ?></p>
<p id='button'><span class='btn btn--primary' id='recalc'><?php displayLanguageText('TEXT-UPDATE'); ?></span></p>
<span id='start-span'></span><br>
<span id='end-span'></span><br>
<script>
$(document).ready(function(){
<?php include "include/ajax.Setup.php" ?>
$("#recalc").click(function() {
$("#button").hide();
$.getJSON( "ajax.ServerTime.php",
{
school_num: <?php echo($school_num) ?>
},
function(results) {
var start = "<?php displayLanguageText('TEXT-START-TIME'); ?>";
$("#start-span").html(start+': '+results.school);
$("#end-span").html("<p><img src='images/spinner.gif'></p>");
$.getJSON( "ajax.RecalcUserDetail.php",
{
school_num: <?php echo($school_num) ?>
},
function(results) {
$("#end-span").html("<?php displayLanguageText('TEXT-COMPLETED'); ?>: "+results.completed);
}
);
}
);
});
});
</script>
<?php
endTemplate();
?>