Esempio n. 1
0
 if (!empty($_POST['userid'])) {
     if (!empty($_POST['password'])) {
         $pass = hash('sha256', $_POST['password']);
         $result = $db->query("select * from Users where Users.UserID = '{$_POST['userid']}' and Users.password = '******' and Users.access_level >= 0");
         $rows = $result->num_rows;
         if ($rows < 1) {
             show_header();
             echo "User ID and password do not match. Please enter again. You may have been removed from the system</br>";
             get_info();
             show_end();
         } else {
             $row = $result->fetch_array();
             $info = new A2User($row['UserID'], $row['password'], $row['psid'], $row['email'], $row['last_name'], $row['first_name'], $row['access_level']);
             if ($info->getAccess() == 0) {
                 $_SESSION['option'] = "logged_on";
                 $result = $db->query("select * from Courses where Courses.psid = " . $info->getPsid());
                 $rows = $result->num_rows;
                 $studentCourseList = array();
                 for ($i = 0; $i < $rows; $i++) {
                     $course = $result->fetch_array();
                     $studentCourse = new Course($course['Term'], $course['Department'], $course['Class_Number'], $course['Grade'], $course['GPA']);
                     $studentCourseList[$i] = $studentCourse;
                 }
                 $info->addCourses($studentCourseList);
                 $coursesTaken = show_classes($info);
                 show_requirements($coursesTaken);
                 log_out();
                 //if we matched, and we are an advisor. show the info and search option
             } elseif ($info->getAccess() == 1) {
                 echo "Search For a Student: <br/><br/>";
                 $_SESSION['option'] = "searchstudent";
Esempio n. 2
0
     	$course = $result->fetch_array();
     
     	$studentCourse = new Course($course['Term'], $course['Department'], $course['Class_Number'], $course['Grade'], $course['GPA'] );
     	$studentCourseList[$i] = $studentCourse;
     
     
     }
     $info->addCourses( $studentCourseList );
     $infoString = serialize($info);
     
     
     $coursesTaken = show_classes( $info );
     show_requirements( $coursesTaken );
     log_out();
     */
     $psid = $info->getPsid();
     $access = $info->getAccess();
     $_SESSION['psid'] = $psid;
     $_SESSION['access'] = $access;
     header("Location: A3Main.php");
     //if we matched, and we are an advisor. show the info and search option
 } elseif ($info->getAccess() == 1) {
     //echo "Search For a Student: <br/><br/>";
     $_SESSION['option'] = "searchstudent";
     //student_search();
     $psid = $info->getPsid();
     $access = $info->getAccess();
     $_SESSION['psid'] = $psid;
     $_SESSION['access'] = $access;
     header("Location: A3Main.php");
 } elseif ($info->getAccess() == 2) {