Files
HotLunches/students.display.row.php
2026-10-19 15:22:52 -07:00

96 lines
3.9 KiB
PHP

<?php
require_once("include/globals.php");
if (SessionActive() != 1 || ! UserLoggedIn()) {
header("Location: /");
exit();
}
// Check if there is a current schedule
$today = date("Y-m-d",time());
$now = date("Y-m-d H:i:s",time());
$school_num = $school_record['record_num'];
$query = "select * from hotlunch_schedules " .
"where school_num = $school_num " .
"and start_order_datetime <= '$now' " .
"and schedule_end_date >= '$today' " .
"and status = 'Active' " .
"order by $scheduleSortOrder " .
"limit 0,1";
$schedules = db_query($query);
unset($schedule_num);
if (db_num_rows($schedules) > 0) {
$row = db_fetch_array($schedules);
$schedule_num = $row['record_num'];
$schedule_name = $row['schedule_name'];
}
$mcommand = "";
if ($_SESSION['mode'] == 'parent') $mcommand = "&mode=parent";
$numClasses = db_getVal("SELECT count(*) FROM classes WHERE school_num = $base_school_num");
// Get the delete confirmation message
$delete_msg = getLanguageText('TEXT-CONFIRM-DELETE');
?>
<tr class='<?php echo($bgclass) ?>'>
<td colspan='3'>&nbsp;</td>
</tr>
<tr class='<?php echo($bgclass) ?>'>
<td align='right'><?php displayLanguageText('TEXT-NAME'); ?>: &nbsp;&nbsp;</td>
<td align='left'><b><?php echo("$last_name, $first_name") ?></b></td>
<td align='right' valign='middle'>
<?php if ($school_record['allow_parents_to_edit_students'] != 'N') { ?>
<a href='?action=<?php echo($action) ?>&naction=edit&record_num=<?php echo("$record_num$mcommand") ?>' class='btn btn--primary btn--xsmall'><span><?php displayLanguageText('BUTTON-EDIT'); ?></span></a>
<a href='?action=<?php echo($action) ?>&naction=delete-confirmed&record_num=<?php echo("$record_num$mcommand") ?>' onClick='return confirm("<?php echo($delete_msg) ?>");' class='btn btn--primary btn--xsmall'><span><?php displayLanguageText('BUTTON-DELETE'); ?></span></a>
<?php if ($numClasses > 0 && $school_record['display_class_lists'] == 'Y' && $display == 'Y') { ?>
<a href='?action=class-list&student_num=<?php echo("$record_num$mcommand") ?>' class='btn btn--primary btn--xsmall'><span><?php displayLanguageText('MENU-CLASS-LIST'); ?></span></a>
<?php } ?>
<?php } ?>
&nbsp;
</td>
</tr>
<?php if ($school_record['participant_grouping'] != 'None') { ?>
<tr class='<?php echo($bgclass) ?>'>
<td align='right'><?php displayLanguageText('TEXT-STATUS'); ?>: &nbsp;&nbsp;</td>
<td colspan='2' align='left'><b>
<?php if ($action == 'teacher-students' || $naction == 'list-unverified') { ?>
<select name='status_<?php echo($record_num) ?>'>
<?php BuildFileList("student_status.txt",$status) ?>
</select>
<input type='hidden' name='sids[]' value='<?php echo($record_num) ?>'>
<?php
}
else {
echo($status);
}
?>
</b>
</td>
</tr>
<?php if ($numClasses > 0) { ?>
<?php if ($school_record['display_class_lists'] == 'Y') { ?>
<tr class='<?php echo($bgclass) ?>'>
<td align='right' valign='top'><nobr><?php displayLanguageText('TEXT-STUDENT-INCLUDE-CLASS-LIST'); ?>: &nbsp;&nbsp;</nobr></td>
<td colspan='2' align='left' valign='top'><b><?php echo(($display == 'Y') ? 'Yes' : 'No') ?></b></td>
</tr>
<?php } ?>
<tr class='<?php echo($bgclass) ?>'>
<td align='right' valign='top'><?php displayLanguageText('TEXT-CLASS'); ?>: &nbsp;&nbsp;</td>
<td colspan='2' align='left' valign='top'><b><?php echo($class_info) ?></b></td>
</tr>
<?php } ?>
<?php } ?>
<tr class='<?php echo($bgclass) ?>'>
<td colspan='3' align='center'>
<?php
include "students.display.orders.php";
?>
</td>
</tr>
<tr class='<?php echo($bgclass) ?>'>
<td colspan='3'>&nbsp;</td>
</tr>