示例#1
0
     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";
         student_search();
     } elseif ($info->getAccess() == 2) {
         echo "Search For a Student: <br/><br/>";
         $_SESSION['option'] = "searchstudent";
         student_search();
         add_remove();
     } else {
         echo "You have been removed from the system. Contact the admin</br>";
         session_destroy();
示例#2
0
					</form>
					<?php 
                    $info = unserialize($_SESSION['info']);
                    $infoString = serialize($info);
                    $_SESSION['info'] = $infoString;
                }
            }
        } else {
            echo "Error occured try again<br/>";
            advisor_action();
        }
    } elseif (strcmp($option, 'studentinfo') == 0) {
        $info = unserialize($_SESSION['info']);
        $student = $info->getStudent();
        $access = $student->getAccess();
        $coursesTaken = show_classes($student);
        show_requirements($coursesTaken);
        advisor_action();
    } elseif (strcmp($option, 'reviewnotes') == 0) {
        if (isset($_POST['rdochoice'])) {
            $fileName = $_POST['rdochoice'] . ".txt";
            if (file_exists("notes/{$fileName}")) {
                $notes = file("notes/{$fileName}");
                for ($i = 0; $i < count($notes); $i++) {
                    echo "{$notes[$i]}<br/>";
                }
            } else {
                echo "No notes have been logged about this session<br/>";
            }
        } else {
            echo "No selection made<br/>";
示例#3
0
					<?php 
                } elseif ($actionvalue == 3) {
                    $_SESSION['option'] = "addnotes";
                    //go to add notes
                } else {
                    $_SESSION['option'] = "reviewnotes";
                    //go to review notes
                }
            }
        } else {
            echo "Error occured try again<br/>";
            advisor_action();
        }
    } elseif (strcmp($option, 'studentinfo') == 0) {
        $info = unserialize($_SESSION['student']);
        $coursesTaken = show_classes($info->getPsid());
        show_requirements($coursesTaken);
        advisor_action();
    } elseif (strcmp($option, 'reviewnotes') == 0) {
        if (isset($_POST['rdochoice'])) {
            $radiovalue = $_POST['rdochoice'];
            $studentSessions = unserialize($_SESSION['sessions']);
            $fileName = $studentSessions[$radiovalue];
            if (file_exists("notes/{$fileName}.txt")) {
                $notes = file("notes/{$fileName}.txt");
                for ($i = 0; $i < count($notes); $i++) {
                    echo "{$notes[$i]}<br/>";
                }
            } else {
                echo "No notes have been logged about this session<br/>";
            }