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

106 lines
6.6 KiB
PHP

<?php
require_once("include/globals.php");
if (SessionActive() != 1 || ! UserLoggedIn()) {
header("Location: /");
exit();
}
//
// Handle additional options
//
if (array_key_exists('current_class_num',$_GET)) $current_class_num = intval($_GET['current_class_num']);
if (array_key_exists('current_class_num',$_POST)) $current_class_num = intval($_POST['current_class_num']);
$opts = "";
if ($action == 'class-students') $opts = "&current_class_num=$current_class_num";
$numStaff = db_getVal("SELECT count(*) FROM people WHERE school_num = $base_school_num AND people_type = 'Staff'");
$numCustomers = db_getVal("SELECT count(*) FROM people WHERE school_num = $base_school_num AND people_type = 'Customer'");
?>
<table cellspacing='1' cellpadding='2' border='0'>
<tr>
<td align='center'><a href='#' id='insert-new' class='btn btn--outline btn--xsmall'><?php displayLanguageText('TEXT-ADD-NEW'); ?></a></td>
<td align='center'><a href='#' id='view-all-participants' class='btn btn--outline btn--xsmall'><?php displayLanguageText('TEXT-VIEW-ALL'); ?></a></td>
<td align='center'><a href='#' id='view-unverified-participants' class='btn btn--outline btn--xsmall'><?php displayLanguageText('TEXT-UNVERIFIED'); ?></a></td>
<td align='center'><a href='#' id='view-inactive-participants' class='btn btn--outline btn--xsmall'><?php displayLanguageText('TEXT-INACTIVE'); ?></a></td>
<?php if ($school_record['participant_grouping'] != 'None') { ?>
<td align='center'><a href='#' id='view-unassigned' class='btn btn--outline btn--xsmall'><?php displayLanguageText('BUTTON-STUDENTS-WITH-NO-CLASS-NUM'); ?></a></td>
<?php } ?>
<?php if ($school_record['collect_student_number'] == 'Y') { ?>
<td align='center'><a href='#' id='view-missing-student-number' class='btn btn--outline btn--xsmall'><?php displayLanguageText('TEXT-STUDENTS-WITH-NO-STUDENT-NUM'); ?></a></td>
<?php } ?>
<td align='center'><a href='#' id='view-students' class='btn btn--outline btn--xsmall'><?php displayLanguageText('TEXT-STUDENTS'); ?></a></td>
<?php if ($numStaff > 0) { ?>
<td align='center'><a href='#' id='view-staff' class='btn btn--outline btn--xsmall'><?php displayLanguageText('TEXT-STAFF'); ?></a></td>
<?php } ?>
<?php if ($numCustomers > 0) { ?>
<td align='center'><a href='#' id='view-customers' class='btn btn--outline btn--xsmall'><?php displayLanguageText('TEXT-CUSTOMER'); ?></a></td>
<?php } ?>
<td align='center'><a href='#' id='clear-screen' class='btn btn--outline btn--xsmall'><?php displayLanguageText('TEXT-CLEAR-SCREEN'); ?></a></td>
</tr>
</table>
<table cellspacing='1' cellpadding='2' border='0'>
<tr>
<?php if ($school_record['implement_meal_locations'] != 'N') { ?>
<?php db_query("UPDATE people SET meal_location = class_num WHERE school_num = $school_num AND people_type = 'Student' AND (meal_location = 0 OR meal_location IS NULL)"); ?>
<td align='center'><a href='#' id='view-meal-locations' class='btn btn--outline btn--xsmall'><?php displayLanguageText('TEXT-ALTERNATE-LOCATIONS'); ?></a></td>
<?php } ?>
<?php if (in_array($_SESSION['UserInfo']['type'],array('SuperUser','System Administrator'))) { ?>
<!-- <td align='center'><a href='#' id='view-added-dates' class='btn btn--outline btn--xsmall'><?php displayLanguageText('TEXT-DATE-ADDED'); ?></a></td> -->
<!-- <td align='center'><a href='#' id='upload-form' class='btn btn--outline btn--xsmall'><?php displayLanguageText('BUTTON-UPLOAD'); ?></a></td> -->
<td align='center'><a href='#' id='students-update' class='btn btn--outline btn--xsmall'><?php displayLanguageText('TEXT-UPDATE'); ?></a></td>
<?php if ($naction == 'upload-form') { ?>
<td align='center'><a href='#' id='people-relationships' class='btn btn--outline btn--xsmall'><?php displayLanguageText('TEXT-RELATIONSHIPS'); ?></a></td>
<?php } ?>
<?php if ($school_record['special_item_prices'] == 'Y') { ?>
<td align='center'><a href='#' cat='Special 1' class='view-special-pricing btn btn--outline btn--xsmall'><?php echo($Special1_Title) ?></a></td>
<td align='center'><a href='#' cat='Special 2' class='view-special-pricing btn btn--outline btn--xsmall'><?php echo($Special2_Title) ?></a></td>
<td align='center'><a href='#' cat='Special 3' class='view-special-pricing btn btn--outline btn--xsmall'><?php echo($Special3_Title) ?></a></td>
<?php } ?>
<?php if ($school_record['implement_multiple_item_prices'] == 'Y') { ?>
<td align='center'><a href='#' id='view-flex-pricing' class='btn btn--outline btn--xsmall'><?php displayLanguageText('TEXT-FLEX-PRICING'); ?></a></td>
<?php } ?>
<?php } ?>
</tr>
</table>
<br>
<table cellpadding=5 style='background-color: #f8f8f8; border: 1px solid #404040;'>
<tr>
<td align='left'>
<b><label for='user-search-field'><?php echo($GlobalText['Students']) ?></label>:</b><br>
<input type='text' name='student-search-field' id='student-search-field' size='40' placeholder="<?php displayLanguageText('TEXT-SEARCH'); ?>" class="form-field form-search-field text ui-widget-content ui-corner-all">
<button id='view-matching-students' class='btn btn--outline btn--xsmall'><?php displayLanguageText('TEXT-VIEW'); ?></button>
<br>
<br>
<b><label for='selected-class'><?php displayLanguageText('TEXT-SELECT-GROUP-TO-VIEW'); ?></label>:</b><br>
<select id='selected-class' class='ui-widget-content ui-corner-all'>
<option value='0'><?php displayLanguageText('TEXT-CLASS-SELECT'); ?></option>
<?php if ($numStaff > 0 || $numCustomers > 0) { ?>
<optgroup label="<?php displayLanguageText('TEXT-PEOPLE'); ?>">
<?php if ($numStaff > 0) { ?>
<option value='Staff'><?php displayLanguageText('TEXT-ALL-STAFF'); ?></option>
<?php } ?>
<?php if ($numCustomers > 0) { ?>
<option value='Customer'><?php displayLanguageText('TEXT-CUSTOMERS'); ?></option>
<?php } ?>
</optgroup>
<optgroup label="<?php echo($GlobalText['Classes']) ?>">
<?php } ?>
<?php
$results = db_query("SELECT * FROM classes WHERE school_num = $school_num ORDER BY sequence");
$num = db_num_rows($results);
while ($row = db_fetch_assoc($results)) {
$class_num = $row['record_num'];
$class = getClassInfo($class_num);
if (strlen($class) > 50) $class = substr($class, 0, 45)."...";
echo(" <option value='$class_num'>$class</option>\n");
}
?>
</select>
<button id='view-class-students' class='btn btn--outline btn--xsmall'><?php displayLanguageText('TEXT-VIEW'); ?></button>
</td>
</tr>
</table>