/** * Display a listing of the resource. * GET /overview * * @return Response */ public function index() { //check applications for high or medium risk $overview = DB::table('applications')->join('application_version', 'applications.id', '=', 'application_version.application_id')->join('versions', 'application_version.version_id', '=', 'versions.id')->select('applications.name', 'applications.id', 'applications.url', 'versions.risk')->where('versions.risk', '>', '1')->paginate('5'); //make view and return it to the user return View::make('admin.overview')->with(['totalapps' => Application::all()->count(), 'totalplugins' => Plugin::all()->count(), 'overview' => $overview]); }
} // order if (!empty($_REQUEST['order'])) { $filter['order'] = $_REQUEST['order']; if (!empty($_REQUEST['by'])) { $filter['by'] = $_REQUEST['by']; } } // limit+offset if (!empty($_REQUEST['limit'])) { $filter['limit'] = (int) $_REQUEST['limit']; } if (!empty($_REQUEST['page'])) { $filter['page'] = (int) $_REQUEST['page']; } $applications = Application::all(null, $filter); header('Content-type: Application/json'); echo json_encode($applications); exit; } break; default: if ($_SESSION['id_pelajar']) { include_once ACTION . '/student_view_application.php'; } elseif ($_SESSION['id_admin']) { include_once ACTION . '/admin_view_application.php'; } else { include_once ACTION . "/index_authenticate.php"; } } if ($action == 'print') {
$application = new Application(); $application->id_pelajar = (int) $_POST['id_pelajar']; $application->id_sekolah = (int) $_POST['sekolah']; $application->id_subjek = (int) $_POST['subjek']; if ($application->submit()) { $_SESSION['success'] = 'Permohonan Di Hantar!'; header('Location: index.php?module=student'); exit; } else { $_SESSION['error'] = 'Permohonan Gagal!'; } } ob_start(); $pelajar = Student::findById($_SESSION['id_pelajar']); $sekolahs = School::senaraiSekolah(); $application = Application::all($_SESSION['id_pelajar'], array('status' => 1)); ?> <div> <div> <h1>Permohonan Baru</h1> <hr /> </div> <?php if (count($application) > 0) { ?> <div class="alert alert-info"> <i class="fa fa-info-circle"></i> Permohonan baru tidak di benarkan kerana permohonan terdahulu anda masih dalam proses semakan. </div> <?php
<?php ob_start(); $applications = Application::all($_SESSION['id_pelajar']); //$student = Student ?> <div> <div> <h1>Permohonan</h1> <hr /> </div> <?php if (empty($applications)) { ?> <div class="alert alert-warning"> <i class="fa fa-warning"></i> Tiada Permohonan di Hantar! </div> <?php } else { ?> <div class="list-group"> <div class="list-group-item"> <div class="row"> <div class="col-md-6 col-sm-6 col-xs-12"> <div class="row"> <div class="col-md-2 col-md-2 col-xs-1">#</div> <div class="col-md-5 col-md-5 col-xs-11">Sekolah</div> <div class="col-md-5 col-md-5 col-xs-12">Status</div> </div> </div>