//============================================================================================ // Session, configuration file, localization constructor //============================================================================================ require '../includes/php/bootstrap.php'; $SESSION = new \Zend_Session_Namespace('internal', true); if (!isset($SESSION->lang)) { $SESSION->lang = DEFAULT_LANGUAGE; } \Locale::setDefault($SESSION->lang); $l10n->setLanguage($SESSION->lang); //============================================================================================ // MODEL //============================================================================================ $profile = new Profile($dbo); $model = new Accommodation($dbo); $follow = new FollowUps($dbo); $courses = new Courses($dbo); if (isset($_GET['student_num']) && ctype_digit($_GET['student_num'])) { $studentProfile = $profile->getProfile($_GET['student_num']); } //============================================================================================ // Load the content //============================================================================================ if (!isset($_GET['page'])) { $render = true; if (!empty($studentProfile)) { $thisPage = 'acc'; $followupcount = $follow->fetchFollowUpsCountStudent($_GET['student_num']); $poccount = $profile->countUnlockedPOC($_GET['student_num']); $semester = \Ventus\Utilities\Functions::fetchSemester();
function viewTable($data, $count) { $accommodation = new Accommodation(); $paginations = new Paginations(); $paginations->setLimit(10); $paginations->setPage($_REQUEST['page']); $paginations->setJSCallback("viewAccommodation"); $paginations->setTotalPages($count); $paginations->makePagination(); ?> <div class="mws-panel-header"> <span class="mws-i-24 i-table-1">View Accommodation</span> </div> <div class="mws-panel-body"> <table cellpadding="0" cellspacing="0" border="0" class="mws-datatable-fn mws-table"> <thead> <tr> <th>Accommodation Name</th> <th></th> <th></th> </tr> </thead> <tbody> <?php if (count($data) > 0) { ?> <?php for ($i = 0; $i < count($data); $i++) { $accommodation->extractor($data, $i); ?> <tr id="row_<?php echo $accommodation->accommodationId(); ?> "> <td><?php echo $accommodation->accommodationName(); ?> </td> <td class="center"> <a onclick="loadGUIContent('accommodation','edit','<?php echo $accommodation->accommodationId(); ?> ')">Edit</a> <a onclick="deleteAccommodation(<?php echo $accommodation->accommodationId(); ?> )" class="toggle">Delete</a> </td> <td></td> </tr> <?php } ?> <?php } ?> </tbody> </table> </div> <?php $paginations->drawPagination(); }