Ejemplo n.º 1
0
 public static function run()
 {
     $class = get_called_class();
     TEST($class, "{$class}.construct", function ($class) {
         $data = ['education' => [['school' => 'Yale University', 'class' => '2017', 'degree' => 'BS', 'dates' => ['start' => strtotime('August 2013')]]], 'experience' => [['title' => 'Intern', 'company' => 'Random Company', 'dates' => ['start' => strtotime('March 2017')]]], 'extracurriculars' => [['title' => 'Captain', 'organization' => 'Random Club', 'dates' => ['start' => strtotime('April 2012')]]], 'awards' => [['name' => 'random award']], 'projects' => [['name' => 'Random Project']]];
         $studentId = new MongoId();
         $student = new StudentProfile($studentId, $data);
         EQ($studentId, $student->getStudentId());
         EQ(null, $student->getEducation(1));
         $education = $student->getEducation(0);
         $educationStart = $education['dates']['start']->toDateTime()->getTimeStamp();
         EQ(strtotime('August 2013'), $educationStart);
     });
 }
Ejemplo n.º 2
0
 protected function addparent()
 {
     global $user;
     global $objPDO;
     $student = new student($objPDO, $user->getuserId());
     $headMenu = array("username" => $student->getName());
     if ($user->checkAdmin() == true && isset($_GET['uid'])) {
         global $objPDO;
         $studentProfile = new StudentProfile($objPDO);
         $studentProfile->loadByUserId($_GET['uid']);
         include $_SERVER['DOCUMENT_ROOT'] . '/cloud/view/addparent.php';
     } else {
         header('Location:http://localhost/cloud');
     }
 }
Ejemplo n.º 3
0
 private static function getStudentProfile(MongoId $studentId)
 {
     $name = StudentModel::getName($studentId);
     $profile = StudentProfile::getProfile($studentId)->getData();
     if (is_null($profile)) {
         $profile = [];
     }
     $profile['name'] = $name;
     return $profile;
 }
 public function execute(CommandContext $context)
 {
     if (!Current_User::allow('hms', 'search')) {
         PHPWS_Core::initModClass('hms', 'exception/PermissionException.php');
         throw new PermissionException('You do not have permission to search for students.');
     }
     PHPWS_Core::initModClass('hms', 'StudentFactory.php');
     PHPWS_Core::initModClass('hms', 'StudentProfile.php');
     $username = $context->get('username');
     $bannerId = $context->get('bannerId');
     $term = Term::getSelectedTerm();
     try {
         if (isset($bannerId)) {
             $student = StudentFactory::getStudentByBannerId($bannerId, $term);
         } else {
             $student = StudentFactory::getStudentByUsername($username, $term);
         }
     } catch (InvalidArgumentException $e) {
         NQ::simple('hms', hms\NotificationView::ERROR, $e->getMessage());
         /*
          $cmd = CommandFactory::getCommand('ShowStudentSearch');
         $cmd->setUsername($userid);
         $cmd->redirect();
         */
         $context->goBack();
     } catch (StudentNotFoundException $e) {
         NQ::simple('hms', hms\NotificationView::ERROR, $e->getMessage());
         /*
          $cmd = CommandFactory::getCommand('ShowStudentSearch');
         $cmd->setUsername($userid);
         $cmd->redirect();
         */
         $context->goBack();
     }
     $profile = new StudentProfile($student, $term);
     $context->setContent($profile->getProfileView()->show());
 }
Ejemplo n.º 5
0
namespace Ventus\Student;

//============================================================================================
// Session, config
//============================================================================================
require '../includes/php/bootstrap.php';
$SESSION = new \Zend_Session_Namespace('student', true);
if (!isset($SESSION->logged_in)) {
    header('location: index.php?next=' . $_SERVER['PHP_SELF'] . '?' . $_SERVER['QUERY_STRING']);
    die;
}
//============================================================================================
// Load the Model and L10N
//============================================================================================
$model = new Dashboard($dbo);
$profile = new StudentProfile($dbo);
$exams = new ExamRequests($dbo);
if (\Ventus\Utilities\I18n\Translate::isAllowedLanguage($SESSION->corr_lang)) {
    $l10n->setLanguage($SESSION->corr_lang);
    \Locale::setDefault($SESSION->corr_lang);
}
$l10n->addResource(FS_L10N . '/header-external.json');
//============================================================================================
// Load the page requested by the user
//============================================================================================
$this_page = "dashboard";
if (!isset($_GET['page'])) {
    $count_pending_follow_ups = $model->fetchCountPendingFollowUps($SESSION->student_num);
    $count_upcoming_appointments = $model->fetchCountUpcomingAppointments($SESSION->student_num);
    $upcoming_exams = $model->fetchUpcomingExams($SESSION->student_num);
    foreach ($upcoming_exams as &$ueas) {
Ejemplo n.º 6
0
 public static function createOrUpdate(MongoId $studentId, array $profileData)
 {
     $profile = new StudentProfile($studentId, $profileData);
     StudentModel::setProfile($studentId, $profile->getData());
 }
Ejemplo n.º 7
0
// Session, config
//============================================================================================
require '../includes/php/bootstrap.php';
$SESSION = new \Zend_Session_Namespace('student', true);
if (!isset($SESSION->logged_in)) {
    header('location: index.php?next=' . $_SERVER['PHP_SELF'] . '?' . $_SERVER['QUERY_STRING']);
    die;
}
//============================================================================================
// Load the Model and L10N
//============================================================================================
$model = new ExamRequests($dbo);
$requests = new \Ventus\Exams\Requests($dbo);
$examFiles = new \Ventus\Exams\ExamFiles($dbo);
$dashboard = new Dashboard($dbo);
$profile = new StudentProfile($dbo);
if (\Ventus\Utilities\I18n\Translate::isAllowedLanguage($SESSION->corr_lang)) {
    $l10n->setLanguage($SESSION->corr_lang);
    \Locale::setDefault($SESSION->corr_lang);
}
$l10n->addResource(FS_L10N . '/header-external.json');
//============================================================================================
// Load the page requested by the user
//============================================================================================
$this_page = "erequest";
if (!isset($_GET['page'])) {
    $l10n->addResource(__DIR__ . '/l10n/header.json');
    $l10n->addResource(__DIR__ . '/l10n/exam-requests.json');
    //Exams within a certain range have separate deadlines
    $blackout_dates = unserialize(PROFESSOR_NOE_SUBMISSION_BLACKOUT);
    $count_pending_follow_ups = $dashboard->fetchCountPendingFollowUps($SESSION->student_num);
Ejemplo n.º 8
0
 public static function submitWithStudentProfile(MongoId $applicationId, StudentProfile $studentProfile)
 {
     $update = (new DBUpdateQuery(self::$collection))->queryForId($applicationId)->toUpdate('submitted', true)->toUpdate('profile', $studentProfile->getData());
     $update->run();
 }
Ejemplo n.º 9
0
namespace Ventus\Student;

//============================================================================================
// Session, config
//============================================================================================
require '../includes/php/bootstrap.php';
$SESSION = new \Zend_Session_Namespace('student', true);
if (!isset($SESSION->logged_in) && $_GET['source'] !== "specialist") {
    header('location: index.php?next=' . $_SERVER['PHP_SELF'] . '?' . $_SERVER['QUERY_STRING']);
    die;
}
//============================================================================================
// Load the Model and L10N
//============================================================================================
$model = new StudentProfile($dbo);
$dashboard = new Dashboard($dbo);
$letters = new \Ventus\Specialist\EmailLetterGenerator();
if (\Ventus\Utilities\I18n\Translate::isAllowedLanguage($SESSION->corr_lang)) {
    $l10n->setLanguage($SESSION->corr_lang);
    \Locale::setDefault($SESSION->corr_lang);
}
$l10n->addResource(FS_L10N . '/header-external.json');
//============================================================================================
// Load the page requested by the user
//============================================================================================
$this_page = "profile";
if (!isset($_GET['page'])) {
    $count_pending_follow_ups = $dashboard->fetchCountPendingFollowUps($SESSION->student_num);
    $all_student_info = $model->fetchStudentInfo($SESSION->student_num);
    $all_student_disabilities = $model->fetchAllStudentDisabilities($SESSION->student_num);
Ejemplo n.º 10
0
<?php

namespace Ventus\Student;

//============================================================================================
// Session, config
//============================================================================================
require '../includes/php/bootstrap.php';
$SESSION = new \Zend_Session_Namespace('student', true);
//============================================================================================
// Load the Model and L10N
//============================================================================================
$model = new StudentProfile($dbo);
$intake_form = new IntakeForm($dbo);
if (\Ventus\Utilities\I18n\Translate::isAllowedLanguage($SESSION->corr_lang)) {
    $l10n->setLanguage($SESSION->corr_lang);
    \Locale::setDefault($SESSION->corr_lang);
}
$l10n->addResource(FS_L10N . '/header-external.json');
//============================================================================================
// Direct the course of what the user will see
//============================================================================================
if (!isset($_GET['page'])) {
    //If the user already has a session take them to the dashboard
    if (isset($SESSION->logged_in)) {
        header('location:dashboard.php');
        die;
    } else {
        $l10n->addResource(__DIR__ . '/l10n/login.json');
        require_once FS_PHP . '/header-external.php';
        require_once 'views/login.php';
 protected function ajaxsearch()
 {
     global $objPDO;
     $search = NULL;
     if (isset($_GET['uid'])) {
         $search = $_GET['uid'];
     }
     if ($search == NULL) {
         return false;
     }
     require_once $_SERVER['DOCUMENT_ROOT'] . '/cloud/model/student_profile_class.php';
     $stu = new StudentProfile($objPDO);
     $res1 = array();
     $res2 = array();
     $res1 = $stu->searchByRollNo($search);
     $res2 = $stu->searchByName($search);
     foreach ($res1 as $key => $value) {
         echo '<div class="ajax_search_elem" id="<' . $value['email'] . '>">' . $value['roll_no'] . '</div>';
     }
     foreach ($res2 as $key => $value) {
         echo '<div class="ajax_search_elem" id="<' . $value['email'] . '>">' . $value['name'] . '</div>';
     }
 }
Ejemplo n.º 12
0
<?php

namespace Ventus\Student;

/**
 * This controller will either grant or refuse a read-only session request to a user
 */
// Session, config
require '../includes/php/bootstrap.php';
$SESSION = new \Zend_Session_Namespace('internal', true);
// Kill existing student session if one exists
\Zend_Session::namespaceUnset('student');
//Models
$model = new StudentProfile($dbo);
$module = \Ventus\Utilities\Functions::getModuleNameFromURL($_SERVER['HTTP_REFERER']);
$module === 'specialist' ? $url = URL_SPECIALIST : ($url = URL_ACCESS_RECEPTION);
//We first check if the employee has a valid session and is authorized to access the Specialist module
\Ventus\Utilities\Authentication::isAuthenticated($SESSION, 'internal');
\Ventus\Utilities\Authentication::isAuthorized($SESSION, 'https://' . $url);
//Check and decrypt read only session key
if (empty($_GET['key']) || empty($_GET['iv'])) {
    //No key exists...we have a problem
    $loggers['audit']->error('Attempted access to student read-only session without key.');
    header('location: https://' . URL_PHP . '/error-external.php?eid=R9001');
    exit;
}
$student = mcrypt_decrypt(MCRYPT_BLOWFISH, hash('md5', HASH_GENERATION_RANDOM_STRING), base64_decode($_GET['key']), MCRYPT_MODE_ECB, base64_decode($_GET['iv']));
$student = unserialize($student);
$log_in = $model->validateUserForReadOnlySession($student);
if (!$log_in) {
    //No student found...we have a problem
Ejemplo n.º 13
0
 protected function report()
 {
     global $user;
     global $objPDO;
     $student = new student($objPDO, $user->getuserId());
     $headMenu = array("username" => $student->getName());
     if ($user->checkAdmin() == true || $student->checkTeacher() || $student->checkStudent()) {
         $role = $student->getacctType();
         $sid = NULL;
         if ($student->checkStudent()) {
             include_once $_SERVER['DOCUMENT_ROOT'] . '/cloud/model/student_profile_class.php';
             $sid = $student->getID();
         } else {
             if (isset($_GET['uid'])) {
                 $sid = $_GET['uid'];
             }
         }
         if ($sid) {
             include_once $_SERVER['DOCUMENT_ROOT'] . '/cloud/model/student_profile_class.php';
             include_once $_SERVER['DOCUMENT_ROOT'] . '/cloud/model/attendence_class.php';
             include_once $_SERVER['DOCUMENT_ROOT'] . '/cloud/model/student_section_class.php';
             include_once $_SERVER['DOCUMENT_ROOT'] . '/cloud/model/section_class.php';
             $stu = new StudentProfile($objPDO);
             $stu->loadByUserId($sid);
             $roll_number = $stu->getRollNo();
             $name = $stu->getName();
             $section = new StudentSection($objPDO);
             $section_id = $section->getByStudentId($sid);
             $sec = new Section($objPDO, $section_id);
             $section_name = $sec->getCode();
             $att = new Attendence($objPDO);
             $total_days = $att->getBySectionId($section_id);
             $attendance = $att->getByStudentId($stu->getID());
             $present = 0;
             $absent = 0;
             foreach ($attendance as $key => $value) {
                 if ($value['presence'] == 1) {
                     $present++;
                 } else {
                     if ($value['presence'] == 0) {
                         $absent++;
                     }
                 }
             }
             include $_SERVER['DOCUMENT_ROOT'] . '/cloud/view/report_view.php';
         } else {
             echo 'error';
         }
     } else {
         header('Location:http://localhost/cloud');
     }
 }
Ejemplo n.º 14
0
 public function post_profile()
 {
     $object_profile = StudentProfile::get_instance();
     $return = $object_profile->post_profile('students', 'stu_id', 'Student');
     return $return;
 }
Ejemplo n.º 15
0
 public static function submit(MongoId $applicationId)
 {
     $applicationData = ApplicationModel::getById($applicationId);
     $application = new ApplicationStudent($applicationData);
     // We need to attach the student profile. If resume is not set, we cannot
     // submit.
     $studentId = $application->getStudentId();
     $studentProfile = StudentProfile::getProfile($studentId);
     if (empty($studentProfile->getData()) || empty($studentProfile->getResume())) {
         return false;
     }
     // Mark the application as submitted.
     ApplicationModel::submitWithStudentProfile($applicationId, $studentProfile);
     self::saveStudentAnswers($application);
     return true;
 }
Ejemplo n.º 16
0
 protected function sectionview()
 {
     global $user;
     global $objPDO;
     $student = new Student($objPDO, $user->getuserId());
     if ($student->checkStudent()) {
         include $_SERVER['DOCUMENT_ROOT'] . '/cloud/model/student_section_class.php';
         include $_SERVER['DOCUMENT_ROOT'] . '/cloud/model/student_profile_class.php';
         $role = $student->getacctType();
         $stu_pro = new StudentProfile($objPDO);
         $stu_pro->loadByUserId($student->getID());
         $sec = new StudentSection($objPDO);
         $class = $sec->getByStudentId($stu_pro->getID());
     } else {
         $class = $_GET['uid'];
     }
     $student = new student($objPDO, $user->getuserId());
     $headMenu = array("username" => $student->getName());
     if ($user->checkAdmin() == true || $student->checkTeacher() || $student->checkStudent()) {
         include $_SERVER['DOCUMENT_ROOT'] . '/cloud/model/timetable_settings_class.php';
         $sett = new TimetableSettings($objPDO);
         $slots = $sett->getAllSlots();
         if (!isset($slots)) {
             $num_slots = 0;
         } else {
             $num_slots = count($slots);
         }
         include_once $_SERVER['DOCUMENT_ROOT'] . '/cloud/model/subject_class.php';
         include_once $_SERVER['DOCUMENT_ROOT'] . '/cloud/model/section_teacher_subject_class.php';
         include_once $_SERVER['DOCUMENT_ROOT'] . '/cloud/model/timetable_class.php';
         $rel = new SectionTeacherSubjectRelations($objPDO);
         $teasubrel = $rel->getByClass($class);
         $subjects = array();
         for ($i = 0; $i < count($teasubrel); $i++) {
             $subjects[$teasubrel[$i]['subject_id']] = Subject::getSubjectName($teasubrel[$i]['subject_id']);
         }
         $tt = new Timetable($objPDO);
         $timetable = $tt->getBySection($class);
         $total = 0;
         $count = array();
         foreach ($timetable as $key => $value) {
             $total++;
             if (array_key_exists($value, $count)) {
                 $count[$value]++;
             } else {
                 $count[$value] = 1;
             }
         }
         include $_SERVER['DOCUMENT_ROOT'] . '/cloud/view/section_timetable_view_template.php';
     } else {
         header('Location:http://localhost/cloud');
     }
 }
Ejemplo n.º 17
0
 protected function subjectreportlist()
 {
     global $user;
     global $objPDO;
     $student = new student($objPDO, $user->getuserId());
     $headMenu = array("username" => $student->getName());
     if (($user->checkAdmin() == true || $student->checkTeacher()) && isset($_POST['exam_id']) && isset($_POST['section']) && isset($_POST['subject'])) {
         $role = $student->getacctType();
         include $_SERVER['DOCUMENT_ROOT'] . '/cloud/model/student_section_class.php';
         include $_SERVER['DOCUMENT_ROOT'] . '/cloud/model/examination_section_subject_class.php';
         include $_SERVER['DOCUMENT_ROOT'] . '/cloud/model/marks_splitup_class.php';
         include $_SERVER['DOCUMENT_ROOT'] . '/cloud/model/student_profile_class.php';
         include $_SERVER['DOCUMENT_ROOT'] . '/cloud/model/exam_marks_class.php';
         $rel = new ExaminationSectionSubject($objPDO);
         $exam_id = $_POST['exam_id'];
         $section_id = $_POST['section'];
         $subject_id = $_POST['subject'];
         $rel->setExaminationId($exam_id);
         $rel->setSectionId($section_id);
         $rel->setSubjectId($subject_id);
         $id = $rel->getIDByElems();
         $mark = new ExamMarks($objPDO);
         $mark_list = $mark->getByExamSubjectId($id);
         $rel->setID($id);
         $rel->load();
         $total_marks = $rel->getTotalMarks();
         $sec = new StudentSection($objPDO);
         $student = array();
         $student = $sec->getBySectionId($section_id);
         $students = array();
         $stupro = new StudentProfile($objPDO);
         $roll_numbers = array();
         foreach ($student as $key => $value) {
             $stupro->setID($value['student_id']);
             $stupro->load();
             $students[$value['student_id']] = $stupro->getName();
             $roll_numbers[$value['student_id']] = $stupro->getRollNo();
         }
         $split = new MarksSplitup($objPDO);
         $split_ups = $split->getByExamSubjectId($id);
         include $_SERVER['DOCUMENT_ROOT'] . '/cloud/view/section_subject_report_view.php';
     } else {
         header('Location:http://localhost/cloud');
     }
 }
Ejemplo n.º 18
0
 /**
  * Retrieves the exam/transcription accommodations for which a student has at the time of the exam
  * @param int $exam_request_id The request ID of the exam
  * @return array
  */
 public function fetchAvailableAccommodations($exam_request_id)
 {
     global $SESSION;
     if (!ctype_digit($exam_request_id) && !is_int($exam_request_id)) {
         throw new \InvalidArgumentException('Invalid exam request ID');
     }
     $sql = "SELECT e.official_evaluation_starttime, p.session, p.course_code, p.course_section\n                  FROM ventus_exam_requests AS e\n             LEFT JOIN ventus_professor_exam_requests AS p\n                    ON e.professor_exam_request_id = p.exam_request_id\n                 WHERE e.request_id = :request_id\n                   AND p.deleted = 0;";
     $result = $this->db->query($sql, array('request_id' => $exam_request_id))->fetch();
     $profile = new StudentProfile($this->db);
     return $profile->fetchAllStudentActiveExamAndTranscriptionAccommodations($SESSION->student_num, $result['official_evaluation_starttime'], $result['course_code'], $result['course_section'], $result['session']);
 }