protected function sectionstudentvalidate()
 {
     $required = array("section" => "Section", "student_id" => "Student");
     global $user;
     if ($user->checkAdmin() == true) {
         if (isset($_POST)) {
             foreach ($required as $key => $value) {
                 if (!isset($_POST[$key]) || $_POST[$key] == '' || $_POST[$key] == 'select') {
                     echo $value . ' is Required<br/>';
                     return;
                 }
             }
             echo 'Saving...';
             global $objPDO;
             require_once $_SERVER['DOCUMENT_ROOT'] . '/cloud/model/student_section_class.php';
             $section = new Studentsection($objPDO);
             $section->setSectionId($_POST['section']);
             $section->setStudentId($_POST['student_id']);
             $section->save();
         }
     } else {
         header('Location:http://localhost/cloud');
     }
 }
Beispiel #2
0
 public static function getStudentSec($stu)
 {
     global $objPDO;
     require_once $_SERVER['DOCUMENT_ROOT'] . '/cloud/model/student_section_class.php';
     $section = new Studentsection($objPDO);
     if ($section->getByStudentId($stu) == true) {
         return true;
     } else {
         return false;
     }
 }
 protected function mark()
 {
     $section = $_GET['uid'];
     $date = NULL;
     if (isset($_GET['ref'])) {
         $date = $_GET['ref'];
     }
     global $user;
     global $objPDO;
     $student = new student($objPDO, $user->getuserId());
     $headMenu = array("username" => $student->getName());
     if ($user->checkAdmin() == true || $student->checkTeacher()) {
         include $_SERVER['DOCUMENT_ROOT'] . '/cloud/model/student_section_class.php';
         include $_SERVER['DOCUMENT_ROOT'] . '/cloud/model/student_profile_class.php';
         include $_SERVER['DOCUMENT_ROOT'] . '/cloud/model/attendence_class.php';
         $stusec = new Studentsection($objPDO);
         $stupro = new StudentProfile($objPDO);
         $att = new Attendence($objPDO);
         $stu = $stusec->getBySectionId($section);
         $students = array();
         foreach ($stu as $key => $value) {
             $stupro->setID($value['student_id']);
             $stupro->load();
             $students[] = $stupro->getAsArray();
         }
         $marked = $att->getBySectionDateArray($section, $date);
         require_once $_SERVER['DOCUMENT_ROOT'] . '/cloud/view/student_attendence_view.php';
     } else {
         header('Location:http://localhost/cloud');
     }
 }