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

213 lines
10 KiB
PHP

<?php
if (SessionActive() != 1 || ! UserLoggedIn()) {
// header("Location: /");
exit();
}
$width = "150";
// Check for custom instruction document
include "parent-instructions.php";
$currentStatus = $_SESSION['UserInfo']['status'];
$unum = $_SESSION['UserInfo']['record_num'];
// Determine if there are any photo galleries defined
$numGalleries = db_getVal("SELECT count(*) FROM photo_galleries WHERE school_num = $school_num AND active = 'Y'");
// Number of documents
$numDocuments = db_getVal("select count(*) from documents where school_num = $school_num");
?>
<ul>
<li id="home" class="up-level"><a href='/?action=home'><?php echo($spanOn) ?><?php displayLanguageText('MENUTAB-HOME') ?><?php echo($spanOff) ?></a>
<?php include "menu.submenus.php"; ?>
</li>
<?php if ($school_record['status'] != 'Linked') { ?>
<li id="account" class="up-level"><a href='/?action=account'><?php echo($spanOn) ?><?php displayLanguageText('MENUTAB-PROFILE') ?><?php echo($spanOff) ?></a>
<ul>
<li><a href='/?action=account'><?php displayLanguageText('MENU-VIEW-PROFILE') ?></a></li>
<li><a href='/?action=account&naction=edit'><?php displayLanguageText('MENU-EDIT-PROFILE') ?></a></li>
<?php if ($school_record['display_class_lists'] == 'Y' || $school_record['display_class_lists'] == 'A' || $school_record['school_directory_permission'] == 'Y') { ?>
<li><a href='/?action=contacts'><?php displayLanguageText('MENU-CONTACT-INFO') ?></a></li>
<?php } ?>
<li><a href='/?action=students-list'><?php displayLanguageText($GlobalText['ManageStudentsCode']) ?></a></li>
<?php if ($school_record['enable_customers'] == 'Y') { ?>
<li><a href='/?action=customers'><?php displayLanguageText('TEXT-CUSTOMERS'); ?></a></li>
<?php } ?>
</ul>
</li>
<?php } ?>
<li id="orders" class="up-level"><a href='/?action=order-list'><?php echo($spanOn) ?><?php displayLanguageText('MENUTAB-ORDERS') ?><?php echo($spanOff) ?></a>
<ul>
<li><a href='/?action=order-list'><?php displayLanguageText($GlobalText['StudentOrdersCode']) ?></a></li>
<li><a href='/?action=user-account'><?php displayLanguageText('MENU-ACCOUNT-TRX') ?></a></li>
<?php if ($school_record['allow_account_deposits'] == 'Y') { ?>
<li><a href='/?action=account-deposit'><?php displayLanguageText('TEXT-ACCOUNT-DEPOSIT') ?></a></li>
<?php } ?>
<?php
$balance = db_getVal("select sum(transaction_amount) as balance from user_account where school_num = $school_num and user_num = $unum AND (deleted != 'Y' OR deleted IS NULL)");
if ($balance > 0 && $school_record['display_remittance_button'] == 'Y') {
?>
<li><a href='/?action=print-remittance-form'><?php displayLanguageText('MENU-REMITTANCE-FORM') ?></a></li>
<?php
}
if ($school_record['enable_volunteer_signup'] == 'Y') {
?>
<li><a href='/?action=volunteer-signup'><?php displayLanguageText('MENU-VOLUNTEER-SIGNUP') ?></a></li>
<?php
}
?>
<?php
if ($school_record['enable_substution_requests'] == 'Y') {
?>
<li><a href='/?action=substitution-request'><?php displayLanguageText('TEXT-SUBSTITUTION-REQUEST') ?></a></li>
<?php
}
?>
</ul>
</li>
<?php if (($school_record['display_class_lists'] == 'Y' && $school_record['status'] != 'Linked') ||
$numDocuments > 0 ||
$school_record['display_pac_info'] == 'Y' ||
$school_record['display_staff_list'] == 'Y' ||
$school_record['classified_ads'] == 'Y' ||
$school_record['event_calendar'] == 'Y' ||
($school_record['photo_gallery'] == 'Y' && $numGalleries > 0) ||
$school_record['math_worksheets'] == 'Y') { ?>
<li id="info" class="up-level"><a href='/?action=lists'><?php echo($spanOn) ?><?php displayLanguageText('MENUTAB-INFORMATION') ?><?php echo($spanOff) ?></a>
<ul>
<?php
$pages = db_query("SELECT * FROM formatted_content WHERE school_num = $school_num AND content_id IN ('Council Information')");
echo("<!-- SELECT * FROM formatted_content WHERE school_num = $school_num AND content_title IN ('Council Information') -->");
if (db_num_rows($pages) > 0) {
while ($row = db_fetch_assoc($pages)) {
$rnum = $row['record_num'];
$title = $row['content_id'];
$link = $row['page_link'];
if (strlen($link) > 0) {
echo(" <li><a href='?$link'>$title</a></li>\n");
}
else {
echo(" <li><a href='?action=view-page&rnum=$rnum'>$title</a></li>\n");
}
}
}
if ($school_record['status'] != 'Linked') {
if ($school_record['display_class_lists'] == 'Y') {
$class_list_text = getLanguageText('MENU-CLASS-LIST');
if ($currentStatus == 'Active') {
$query = "select * from people " .
"where school_num = $base_school_num " .
"and user_num = $unum " .
"and people_type = 'Student' " .
"and display = 'Y' " .
"order by first_name";
$results = db_query($query);
if (db_num_rows($results) > 0) {
while ($row = db_fetch_array($results)) {
$snum = $row['record_num'];
$name = $row['first_name'];
echo(" <li><a href='/?action=class-list&student_num=$snum'>$class_list_text - $name</a></li>\n");
}
}
}
}
if ($school_record['display_class_lists'] == 'A') {
?>
<li><a href='/?action=list-classes'><?php displayLanguageText('TEXT-VIEW-CLASS-LISTS'); ?></a></li>
<?php } ?>
<?php } ?>
<?php if ($school_record['display_pac_info'] == 'Y') { ?>
<li><a href='/?action=contact-info'><?php echo($school_record['pac_name']) ?></a></li>
<?php } ?>
<?php if ($school_record['display_staff_list'] == 'Y') { ?>
<li><a href='/?action=staff-list'><?php displayLanguageText('MENU-STAFF-LIST') ?></a></li>
<?php } ?>
<li><a href='/?action=view-documents'><?php displayLanguageText('MENU-ONLINE-DOCUMENTS') ?></a></li>
<?php if ($school_record['status'] != 'Linked') { ?>
<?php if ($school_record['other_modules'] == 'Y') { ?>
<?php if ($school_record['classified_ads'] == 'Y') { ?>
<li><a href='/?action=classified'><?php displayLanguageText('MENU-CLASSIFIED-ADS') ?></a></li>
<?php } ?>
<?php if ($school_record['event_calendar'] == 'Y') { ?>
<li><a href='/?action=events-calendar'><?php displayLanguageText('MENU-EVENTS') ?></a></li>
<?php } ?>
<?php if ($school_record['photo_gallery'] == 'Y' && $numGalleries > 0) { ?>
<li><a href='/?action=photo-gallery'><?php displayLanguageText('MENU-PHOTO-GALLERY') ?></a></li>
<?php } ?>
<?php } ?>
<?php if ($school_record['math_worksheets'] == 'Y') { ?>
<li><a href='/?action=math-worksheets'><?php displayLanguageText('MENU-MATH-WORKSHEETS') ?></a></li>
<?php } ?>
<?php } ?>
</ul>
</li>
<?php } ?>
<?php
// Check if there are tabs defined
if (db_tableExists("content_tabs")) {
$numTabs = db_getVal("SELECT count(*) FROM content_tabs WHERE school_num = $school_num AND visible_to_parents = 'Y'");
$pwhere = "";
if (in_array($_SESSION['UserInfo']['type'],array('Parent','Guest','Staff'))) $pwhere = "AND public_page = 'Y'";
if ($numTabs && $school_record['implement_page_tabs'] == 'Y') {
// Get tabs
$tabs = db_query("SELECT * FROM content_tabs WHERE school_num = $school_num AND visible_to_parents = 'Y' ORDER BY sequence LIMIT 0,3");
$num = db_num_rows($tabs);
while ($row = db_fetch_assoc($tabs)) {
$tab_title = strtoupper($row['tab_title']);
$tab_num = $row['record_num'];
$pages = db_query("SELECT * FROM formatted_content WHERE school_num = $school_num AND tab_num = $tab_num $pwhere ORDER BY sequence");
if (db_num_rows($pages)) {
echo(" <li id='additional' class='up-level'><a href='#'>$spanOn$tab_title$spanOff</a>\n");
echo(" <ul>\n");
while ($row = db_fetch_assoc($pages)) {
$rnum = $row['record_num'];
$title = $row['content_id'];
$link = $row['page_link'];
if (strlen($link) > 0) {
echo(" <li><a href='?$link'>$title</a></li>\n");
}
else {
echo(" <li><a href='?action=view-page&rnum=$rnum'>$title</a></li>\n");
}
}
echo(" </ul>\n");
echo(" </li>\n");
}
}
}
}
?>
<li id="help" class="up-level"><a href='#'><?php echo($spanOn) ?><?php displayLanguageText('MENUTAB-HELP') ?><?php echo($spanOff) ?></a>
<ul>
<li id="help"><a href='/?action=view-faqs'><?php displayLanguageText('MENU-FAQS') ?></a></li>
<?php if ($school_record['display_parent_instructions'] != 'N') { ?>
<li id="help"><a href='view-doc.php?dn=<?php echo($parentInstructions) ?>'><?php displayLanguageText('MENU-PARENT-INSTRUCTION-GUIDE'); ?></a></li>
<?php } ?>
<?php if ($school_record['support_email'] > '') { ?>
<li><a href='/?action=support-request'><?php displayLanguageText('MENU-SUPPORT') ?></a></li>
<?php } ?>
<li><a href='/?action=privacy-policy'><?php displayLanguageText('TEXT-PRIVACY-POLICY'); ?></a></li>
</ul>
</li>
<?php if ($school_record['status'] != 'Linked') { ?>
<li id="password" class="up-level"><a href='/?action=change-password'><?php echo($spanOn) ?><?php displayLanguageText('MENUTAB-PASSWORD') ?><?php echo($spanOff) ?></a></li>
<?php } ?>
<li id="logout" class="up-level"><a href='/?action=logout'><?php echo($spanOn) ?><?php displayLanguageText('MENUTAB-LOGOUT') ?><?php echo($spanOff) ?></a></li>
</ul>