echo $school->name; ?> </a></span> <a href="#statusesBox" role="button" class="btn-mini pull-right" data-toggle="modal"> <i class="icon-large icon-comment"></i> Statuses </a> <?php if ($session->is_logged_in()) { echo ' <a href="#invitationBox" role="button" class="btn-mini pull-right" data-toggle="modal"> <i class="icon-large icon-comment"></i> Invite Students </a> '; if ($loggeduser->is_super_admin() || BatchUser::amIAdmin($loggeduser->id, $batch->id)) { echo ' <a href="updatebatch.php?id=' . $batch->id . '" class="btn-mini pull-right"> <i class="icon-large icon-pencil"></i> Edit </a> '; } $loggedbatchuser = BatchUser::getUser($session->user_id, $batch->id); if ($loggedbatchuser == null) { echo ' <button role="button" class="btn-mini btn-link pull-right" onclick="join(); return false;"> <i class="icon-large icon-envelope"></i> Join </button> '; } else { if ($loggedbatchuser != null) {
<?php require_once "../initialize.php"; $sectionsselect = null; if (isset($_GET["batchid"])) { if (is_numeric($_GET["batchid"])) { $batch = Batch::get_by_id($_GET["batchid"]); if (SchoolUser::amIAdmin($session->user_id, $batch->schoolid) || BatchUser::amIAdmin($session->user_id, $batch->id)) { $sections = Section::get_all_by_batchid($batch->id); if (count($sections) > 0) { foreach ($sections as $section) { $sectionsselect .= "<option value='" . $section->id . "'>" . $section->name . "</option>"; } if (User::get_by_id($session->user_id)->is_super_admin()) { $sectionsselect .= "<option value='NOTHING'>NOTHING</option>"; } } else { $sectionsselect .= "<option value='0'>NO SECTIONS YET</option>"; } } else { $sectionadmins = SectionUser::getSectionsIAdminInBatch($session->user_id, $_GET["batchid"]); if (count($sectionadmins) > 0) { foreach ($sectionadmins as $sectionadmin) { $section = Section::get_by_id($sectionadmin->sectionid); $sectionsselect .= "<option value='" . $section->id . "'>" . $section->name . "</option>"; } if (User::get_by_id($session->user_id)->is_super_admin()) { $sectionsselect .= "<option value='NOTHING'>NOTHING</option>"; } } else { $sectionsselect .= "<option value='0'>NO SECTIONS YET</option>";
} else { $school = School::get_by_id($object->schoolid); //$batchname = $school->name." ".$object->get_batchyear(); $batchname = $object->get_batchyear(); } } else { header("location: index.php?negative"); } if (!$session->is_logged_in()) { header("location: index.php?negative"); } else { $user = User::get_by_id($session->user_id); if ($user->enabled == DISABLED) { header("location: index.php?disabled"); } if (!BatchUser::amIAdmin($session->user_id, $object->id) && !SchoolUser::amIAdmin($session->user_id, $object->schoolid) && !$user->is_super_admin()) { header("location: index.php?negative"); } } $pathinfo = pathinfo($_SERVER["PHP_SELF"]); $basename = $pathinfo["basename"]; $currentFile = str_replace(".php", "", $basename); ?> <div class="container-fluid"> <div class="row-fluid"> <div class="span1"></div> <div class="span9"> <form id="theform" class="form-horizontal" method="post" action="#" enctype="multipart/form-data"> <fieldset> <legend> Update Batch: <?php
if (BatchUser::amIAdmin($session->user_id, $batch->id) || SchoolUser::amIAdmin($session->user_id, $batch->schoolid) || $user->is_super_admin()) { echo ' <li class="divider"></li> <li><a href="updatebatch.php?id=' . $batch->id . '"><i class="icon-large icon-pencil"></i> Edit Batch</a></li> <li><a href="editor.php?id=' . $batch->id . '"><i class="icon-large icon-pencil"></i> Edit Yearbook</a></li> <li class="divider"></li>'; } $sectionsInBatch = Section::get_all_by_batchid($batch->id); if (count($sectionsInBatch) > 0) { foreach ($sectionsInBatch as $section) { echo ' <li class="dropdown-submenu"> <a tabindex="-1" href="section.php?id=' . $section->id . '"> ' . $section->name . ' </a> <ul class="dropdown-menu"> <li><a href="section.php?id=' . $section->id . '"><i class="icon-large icon-play"></i> View</a></li>'; if (SectionUser::amIAdmin($session->user_id, $section->id) || BatchUser::amIAdmin($session->user_id, $section->batchid) || SchoolUser::amIAdmin($session->user_id, $section->schoolid) || $user->is_super_admin()) { echo '<li><a href="updatesection.php?id=' . $section->id . '"><i class="icon-large icon-pencil"></i> Edit</a></li>'; } echo ' </ul> </li> '; } } echo ' </ul> </li> '; } } } else {