当前位置: 首页>>代码示例>>PHP>>正文


PHP StudentFactory::getStudentByBannerId方法代码示例

本文整理汇总了PHP中StudentFactory::getStudentByBannerId方法的典型用法代码示例。如果您正苦于以下问题:PHP StudentFactory::getStudentByBannerId方法的具体用法?PHP StudentFactory::getStudentByBannerId怎么用?PHP StudentFactory::getStudentByBannerId使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在StudentFactory的用法示例。


在下文中一共展示了StudentFactory::getStudentByBannerId方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: __construct

 /**
  * Constructor.
  * Requires a Checkin object to get started.
  *
  * @param Checkin $checkin
  */
 public function __construct(Checkin $checkin)
 {
     $this->checkin = $checkin;
     $this->bannerId = $this->checkin->getBannerId();
     $this->term = $this->checkin->getTerm();
     $this->student = StudentFactory::getStudentByBannerId($this->bannerId, $this->term);
     // Lookup the student's housing application
     $this->application = HousingApplicationFactory::getAppByStudent($this->student, $this->term);
     // Create a dummy application if a real one doesn't exist
     if (!isset($this->application)) {
         $this->application = new HousingApplication();
     }
     // Get the hall, floor, and room from the checkin's bed
     $this->bed = new HMS_Bed($this->checkin->getBedId());
     $this->room = $this->bed->get_parent();
     $this->floor = $this->room->get_parent();
     $this->hall = $this->floor->get_parent();
     // Get the damages at check-in time
     $this->checkinDamages = RoomDamageFactory::getDamagesBefore($this->room, $this->checkin->getCheckinDate() + Checkin::CHECKIN_TIMEOUT);
     if (sizeof($this->checkinDamages) <= 0) {
         $this->checkinDamages = array();
     }
     // Get the damages at check-out time
     $this->checkoutDamages = RoomDamageFactory::getDamagesByRoom($this->room);
     if (sizeof($this->checkoutDamages) <= 0) {
         $this->checkoutDamages = array();
     }
 }
开发者ID:jlbooker,项目名称:homestead,代码行数:34,代码来源:InfoCard.php

示例2: execute

 public function execute(CommandContext $context)
 {
     PHPWS_Core::initModClass('hms', 'RoomDamageFactory.php');
     PHPWS_Core::initModClass('hms', 'StudentFactory.php');
     PHPWS_Core::initModClass('hms', 'HMS_Email.php');
     PHPWS_Core::initModClass('hms', 'CheckinFactory.php');
     PHPWS_Core::initModClass('hms', 'HMS_Bed.php');
     $term = Term::getSelectedTerm();
     // Get the total damages assessed for each student
     $damages = RoomDamageFactory::getAssessedDamagesStudentTotals($term);
     foreach ($damages as $dmg) {
         $student = StudentFactory::getStudentByBannerId($dmg['banner_id'], $term);
         // Get the student's last checkout
         // (NB: the damages may be for multiple check-outs,
         // but we'll just take the last one)
         $checkout = CheckinFactory::getLastCheckoutForStudent($student);
         $bed = new HMS_Bed($checkout->getBedId());
         $room = $bed->get_parent();
         $floor = $room->get_parent();
         $hall = $floor->get_parent();
         $coordinators = $hall->getCoordinators();
         if ($coordinators != null) {
             $coordinatorName = $coordinators[0]->getDisplayName();
             $coordinatorEmail = $coordinators[0]->getEmail();
         } else {
             $coordinatorName = '(No coordinator set for this hall.)';
             $coordinatorEmail = '(No coordinator set for this hall.)';
         }
         HMS_Email::sendDamageNotification($student, $term, $dmg['sum'], $coordinatorName, $coordinatorEmail);
     }
     // Show a success message and redirect back to the main admin menu
     NQ::simple('hms', hms\NotificationView::SUCCESS, 'Room damage noties sent.');
     $cmd = CommandFactory::getCommand('ShowAdminMaintenanceMenu');
     $cmd->redirect();
 }
开发者ID:jlbooker,项目名称:homestead,代码行数:35,代码来源:SendRoomDamageNotificationsCommand.php

示例3: show

 public function show()
 {
     $tpl = array();
     // Check for an empty array of requests
     if (sizeof($this->requests) == 0) {
         $tpl['NO_REQUESTS'] = 'No pending requests found.';
         return PHPWS_Template::process($tpl, 'hms', 'admin/roomChangeListView.tpl');
     }
     javascriptMod('hms', 'livestamp');
     $tpl['REQUESTS'] = array();
     foreach ($this->requests as $request) {
         $row = array();
         $participants = $request->getParticipants();
         $participantNames = array();
         foreach ($participants as $p) {
             $student = StudentFactory::getStudentByBannerId($p->getBannerId(), $this->term);
             $participantNames[] = $student->getName();
         }
         $row['participants'] = implode(', ', $participantNames);
         $mgmtCmd = CommandFactory::getCommand('ShowManageRoomChange');
         $mgmtCmd->setRequestId($request->getId());
         $row['manage'] = $mgmtCmd->getURI();
         $row['last_updated_timestamp'] = $request->getLastUpdatedTimestamp();
         $row['last_updated_date'] = date("M j @ g:ia", $request->getLastUpdatedTimestamp());
         $tpl['REQUESTS'][] = $row;
     }
     return PHPWS_Template::process($tpl, 'hms', 'admin/roomChangeListView.tpl');
 }
开发者ID:jlbooker,项目名称:homestead,代码行数:28,代码来源:RoomChangeListView.php

示例4: execute

 public function execute()
 {
     PHPWS_Core::initModClass('hms', 'StudentFactory.php');
     if (!isset($this->term) || is_null($this->term)) {
         throw new InvalidArgumentException('Missing term.');
     }
     $db = new PHPWS_DB('hms_new_application');
     $db->addColumn('banner_id');
     $db->addColumn('username');
     $db->addWhere('term', $this->term);
     $results = $db->select();
     if (empty($results)) {
         return;
     } elseif (PEAR::isError($results)) {
         throw new DatabaseException($results->toString());
     }
     $twentyFiveYearsAgo = strtotime("-25 years");
     foreach ($results as $student) {
         try {
             $sf = StudentFactory::getStudentByBannerId($student['banner_id'], $this->term);
             $dob = $sf->getDOB();
             if (strtotime($dob) > $twentyFiveYearsAgo) {
                 continue;
             }
             $student['dob'] = $dob;
             $student['full_name'] = $sf->getFullName();
             $this->all_rows[] = $student;
         } catch (Exception $e) {
             $student['dob'] = $student['full_name'] = null;
             $this->problems[] = $student['banner_id'];
         }
     }
 }
开发者ID:jlbooker,项目名称:homestead,代码行数:33,代码来源:TwentyFive.php

示例5: execute

 public function execute(CommandContext $context)
 {
     // Check permissions
     if (!Current_User::allow('hms', 'checkin')) {
         PHPWS_Core::initModClass('hms', 'exception/PermissionException.php');
         throw new PermissionException('You do not have permission to checkin students.');
     }
     $term = Term::getSelectedTerm();
     $bannerId = $context->get('bannerId');
     $hallId = $context->get('hallId');
     $errorCmd = CommandFactory::getCommand('ShowCheckinStart');
     if (!isset($bannerId) || is_null($bannerId) || $bannerId == '') {
         NQ::simple('hms', hms\NotificationView::ERROR, 'Missing Banner ID.');
         $errorCmd->redirect();
     }
     if (!isset($hallId)) {
         NQ::simple('hms', hms\NotificationView::ERROR, 'Missing residence hall ID.');
         $errorCmd->redirect();
     }
     // Check the Banner ID
     if (preg_match("/[\\d]{9}/", $bannerId) == false) {
         NQ::simple('hms', hms\NotificationView::ERROR, 'Imporperly formatted Banner ID.');
         $errorCmd->redirect();
     }
     // Try to lookup the student in Banner
     try {
         $student = StudentFactory::getStudentByBannerId($bannerId, $term);
     } catch (StudentNotFoundException $e) {
         NQ::simple('hms', hms\NotificationView::ERROR, 'Could not locate a student with that Banner ID.');
         $errorCmd->redirect();
     }
     // Make sure the student is assigned in the current term
     $assignment = HMS_Assignment::getAssignmentByBannerId($bannerId, $term);
     if (!isset($assignment) || is_null($assignment)) {
         NQ::simple('hms', hms\NotificationView::ERROR, $student->getName() . ' is not assigned for ' . Term::toString($term) . '. Please contact the University Housing Assignments Office at 828-262-6111.');
         $errorCmd->redirect();
     }
     // Make sure the student's assignment matches the hall the user selected
     $bed = $assignment->get_parent();
     $room = $bed->get_parent();
     $floor = $room->get_parent();
     $hall = $floor->get_parent();
     if ($hallId != $hall->getId()) {
         NQ::simple('hms', hms\NotificationView::ERROR, 'Wrong hall! ' . $student->getName() . ' is assigned to ' . $assignment->where_am_i());
         $errorCmd->redirect();
     }
     // Load any existing check-in
     $checkin = CheckinFactory::getLastCheckinByBannerId($bannerId, $term);
     // If there is a checkin for the same bed, and the difference between the current time and the checkin time is
     // greater than 48 hours, then show an error.
     if (!is_null($checkin)) {
         $checkoutDate = $checkin->getCheckoutDate();
         if ($checkin->getBedId() == $bed->getId() && !isset($checkoutDate) && time() - $checkin->getCheckinDate() > Checkin::CHECKIN_TIMEOUT) {
             NQ::simple('hms', hms\NotificationView::ERROR, $student->getName() . ' has already checked in to ' . $assignment->where_am_i());
             $errorCmd->redirect();
         }
     }
     $view = new CheckinFormView($student, $assignment, $hall, $floor, $room, $checkin);
     $context->setContent($view->show());
 }
开发者ID:jlbooker,项目名称:homestead,代码行数:60,代码来源:ShowCheckinFormCommand.php

示例6: __construct

 /**
  *
  * @param RoomChangeParticipant $participant The RoomChangeParticipant this view represents
  * @param RoomChangeRequest $request
  * @param array<RoomChangeParticipant> $participants All participants on this request
  */
 public function __construct(RoomChangeParticipant $participant, RoomChangeRequest $request, array $participants)
 {
     $this->participant = $participant;
     $this->request = $request;
     $this->participants = $participants;
     $this->student = StudentFactory::getStudentByBannerId($this->participant->getBannerId(), Term::getSelectedTerm());
 }
开发者ID:jlbooker,项目名称:homestead,代码行数:13,代码来源:RoomChangeParticipantView.php

示例7: execute

 public function execute()
 {
     PHPWS_Core::initModClass('hms', 'HMS_Util.php');
     $db = PdoFactory::getPdoInstance();
     $query = 'SELECT hms_new_application.username, hms_new_application.banner_id, hms_lottery_application.early_release FROM hms_new_application JOIN hms_lottery_application ON hms_new_application.id = hms_lottery_application.id WHERE (hms_new_application.term = :term AND hms_lottery_application.early_release IS NOT NULL) ORDER BY hms_lottery_application.early_release ASC, hms_new_application.username ASC';
     $stmt = $db->prepare($query);
     $stmt->execute(array('term' => $this->term));
     $results = $stmt->fetchAll(PDO::FETCH_ASSOC);
     foreach ($results as $row) {
         $this->total++;
         if ($row['early_release'] == 'transfer') {
             $row['early_release'] = 'Transferring to another university';
             $this->transferTotal++;
         } else {
             if ($row['early_release'] == 'grad') {
                 $row['early_release'] = 'Graduating in December';
                 $this->gradTotal++;
             } else {
                 if ($row['early_release'] == 'student_teaching') {
                     $row['early_release'] = 'Student Teaching';
                     $this->teachingTotal++;
                 } else {
                     if ($row['early_release'] == 'internship') {
                         $row['early_release'] = 'Internship';
                         $this->internTotal++;
                     } else {
                         if ($row['early_release'] == 'withdraw') {
                             $row['early_release'] = 'Withdrawal';
                             $this->withdrawTotal++;
                         } else {
                             if ($row['early_release'] == 'marriage') {
                                 $row['early_release'] = 'Getting Married';
                                 $this->marriageTotal++;
                             } else {
                                 if ($row['early_release'] == 'study_abroad') {
                                     $row['early_release'] = 'Studying abroad for the Spring';
                                     $this->abroadTotal++;
                                 } else {
                                     if ($row['early_release'] == 'intl_exchange') {
                                         $row['early_release'] = 'International Exchange Ending';
                                         $this->internationalTotal++;
                                     }
                                 }
                             }
                         }
                     }
                 }
             }
         }
         $row['name'] = StudentFactory::getStudentByBannerId($row['banner_id'], $this->term)->getFullName();
         $this->data[] = $row;
     }
 }
开发者ID:jlbooker,项目名称:homestead,代码行数:53,代码来源:EarlyRelease.php

示例8: execute

 public function execute(CommandContext $context)
 {
     PHPWS_Core::initModClass('hms', 'StudentFactory.php');
     PHPWS_Core::initModClass('hms', 'HMS_Assignment.php');
     PHPWS_Core::initModClass('hms', 'CheckinFactory.php');
     PHPWS_Core::initModClass('hms', 'RoomDamageFactory.php');
     PHPWS_Core::initModClass('hms', 'HMS_Residence_Hall.php');
     PHPWS_Core::initModClass('hms', 'HMS_Bed.php');
     PHPWS_Core::initModClass('hms', 'BedFactory.php');
     $term = Term::getCurrentTerm();
     $bannerId = $context->get('bannerId');
     $hallId = $context->get('hallId');
     $errorCmd = CommandFactory::getCommand('ShowCheckoutStart');
     if (!isset($bannerId) || is_null($bannerId) || $bannerId == '') {
         NQ::simple('hms', hms\NotificationView::ERROR, 'Missing student ID.');
         $errorCmd->redirect();
     }
     if (!isset($hallId)) {
         NQ::simple('hms', hms\NotificationView::ERROR, 'Missing residence hall ID.');
         $errorCmd->redirect();
     }
     // If search string is all numeric, make sure it looks like a valid Banner ID
     if (is_numeric($bannerId) && preg_match("/[\\d]{9}/", $bannerId) == false) {
         NQ::simple('hms', hms\NotificationView::ERROR, 'Imporperly formatted Banner ID.');
         $errorCmd->redirect();
     }
     // Try to lookup the student in Banner
     try {
         // If it's all numeric assume it's a student ID, otherwise assume it's a username
         if (is_numeric($bannerId) && strlen((string) $bannerId) == 9) {
             $student = StudentFactory::getStudentByBannerId($bannerId, $term);
         } else {
             $student = StudentFactory::getStudentByUsername($bannerId, $term);
         }
     } catch (StudentNotFoundException $e) {
         NQ::simple('hms', hms\NotificationView::ERROR, 'Could not locate a student with that Banner ID.');
         $errorCmd->redirect();
     }
     // Find the earliest checkin that matches hall the user selected
     $hall = new HMS_Residence_Hall($hallId);
     $checkin = CheckinFactory::getPendingCheckoutForStudentByHall($student, $hall);
     if (!isset($checkin)) {
         NQ::simple('hms', hms\NotificationView::ERROR, "Sorry, we couldn't find a matching check-in at {$hall->getHallName()} for this student to check-out of.");
         $errorCmd->redirect();
     }
     $bed = BedFactory::getBedByPersistentId($checkin->getBedPersistentId(), $term);
     $room = $bed->get_parent();
     // Get the damages for this student's room
     $damages = RoomDamageFactory::getDamagesByRoom($room);
     PHPWS_Core::initModClass('hms', 'CheckoutFormView.php');
     $view = new CheckoutFormView($student, $hall, $room, $bed, $damages, $checkin);
     $context->setContent($view->show());
 }
开发者ID:jlbooker,项目名称:homestead,代码行数:53,代码来源:ShowCheckoutFormCommand.php

示例9: execute

 public function execute()
 {
     PHPWS_Core::initModClass('hms', 'HousingApplicationFactory.php');
     PHPWS_Core::initModClass('hms', 'HMS_Assignment.php');
     PHPWS_Core::initModClass('hms', 'StudentFactory.php');
     $db = new PHPWS_DB('hms_new_application');
     $db->addColumn('hms_new_application.*');
     $db->addWhere('term', $this->term);
     $db->addWhere('cancelled', 0);
     $term = Term::getTermSem($this->term);
     if ($term == TERM_FALL) {
         $db->addJoin('LEFT', 'hms_new_application', 'hms_fall_application', 'id', 'id');
         $db->addColumn('hms_fall_application.*');
     } else {
         if ($term == TERM_SUMMER1 || $term == TERM_SUMMER2) {
             $db->addJoin('LEFT', 'hms_new_application', 'hms_summer_application', 'id', 'id');
             $db->addColumn('hms_summer_application.*');
         }
     }
     $result = $db->select();
     $app = array();
     foreach ($result as $app) {
         $username = $app['username'];
         $bannerId = $app['banner_id'];
         $type = $app['student_type'];
         $cellPhone = $app['cell_phone'];
         $date = date('n/j/Y', $app['created_on']);
         $assignment = HMS_Assignment::getAssignmentByBannerId($bannerId, $this->term);
         if (!is_null($assignment)) {
             $room = $assignment->where_am_i();
         } else {
             $room = '';
         }
         $student = StudentFactory::getStudentByBannerId($bannerId, $this->term);
         $first = $student->getFirstName();
         $middle = $student->getMiddleName();
         $last = $student->getLastName();
         $gender = $student->getPrintableGender();
         $birthday = date("m/d/Y", $student->getDobDateTime()->getTimestamp());
         $address = $student->getAddress(NULL);
         if ($term == TERM_SPRING || $term == TERM_FALL) {
             $lifestyle = $app['lifestyle_option'] == 1 ? 'Single Gender' : 'Co-Ed';
         } else {
             $lifestyle = $app['room_type'] == 1 ? 'Single Room' : 'Double Room';
         }
         if (!is_null($address) && $address !== false) {
             $this->rows[] = array($username, $bannerId, $first, $middle, $last, $gender, $type, $cellPhone, $room, $date, $address->line1, $address->line2, $address->line3, $address->city, $address->state, $address->zip, $birthday, $lifestyle);
         } else {
             $this->rows[] = array($username, $bannerId, $first, $middle, $last, '', $type, $cellPhone, $room, $date, '', '', '', '', '', '', $lifestyle);
         }
     }
 }
开发者ID:jlbooker,项目名称:homestead,代码行数:52,代码来源:AppliedStudentData.php

示例10: show

 public function show()
 {
     $term = Term::getCurrentTerm();
     $student = StudentFactory::getStudentByBannerId($this->checkin->getBannerId(), $term);
     $bed = new HMS_Bed($this->checkin->getBedId());
     $tpl = array();
     $tpl['NAME'] = $student->getName();
     $tpl['ASSIGNMENT'] = $bed->where_am_i();
     $pdfCmd = CommandFactory::getCommand('GenerateInfoCard');
     $pdfCmd->setCheckinId($this->checkin->getId());
     $tpl['INFO_CARD_LINK'] = $pdfCmd->getLink('Resident Information Card', '_blank');
     return PHPWS_Template::process($tpl, 'hms', 'admin/checkinComplete.tpl');
 }
开发者ID:jlbooker,项目名称:homestead,代码行数:13,代码来源:CheckinDocumentView.php

示例11: execute

 public function execute(CommandContext $context)
 {
     // Get input
     $requestId = $context->get('requestId');
     $participantId = $context->get('participantId');
     // Command for showing the request, redirected to on success/error
     $cmd = CommandFactory::getCommand('ShowManageRoomChange');
     $cmd->setRequestId($requestId);
     // Load the request
     $request = RoomChangeRequestFactory::getRequestById($requestId);
     // Load the participant
     $participant = RoomChangeParticipantFactory::getParticipantById($participantId);
     // Load the Student
     $student = StudentFactory::getStudentByBannerId($participant->getBannerId(), $request->getTerm());
     // Check permissions. Must be the participant or an admin
     if (UserStatus::getUsername() != $student->getUsername() && !Current_User::allow('hms', 'admin_approve_room_change')) {
         throw new PermissionException('You do not have permission to appove this room change.');
     }
     // Check for CAPTCHA if this is the student; admins don't need a CAPTCHA
     $captchaResult = Captcha::verify(true);
     if (UserStatus::getUsername() == $student->getUsername() && $captchaResult === false) {
         // Failed the captcha
         NQ::simple('hms', hms\NotificationView::ERROR, "You didn't type the magic words correctly. Please try again.");
         $cmd = CommandFactory::getCommand('ShowRoomChangeRequestApproval');
         $cmd->redirect();
     }
     // If there was a captcha, then log the activity
     if ($captchaResult !== false) {
         HMS_Activity_Log::log_activity(UserStatus::getUsername(), ACTIVITY_ROOM_CHANGE_AGREED, UserStatus::getUsername(FALSE), 'Request id: ' . $requestId . ' Captcha: ' . $captchaResult);
     }
     // Transition to StudentApproved state
     $participant->transitionTo(new ParticipantStateStudentApproved($participant, time(), null, UserStatus::getUsername()));
     // If all students have approved, notify RDs
     if ($request->isApprovedByAllParticipants()) {
         HMS_Email::sendRoomChangeCurrRDNotice($request);
     }
     // If the student is logged in, redirect to the main menu, other wise go back to the room change management view
     if (UserStatus::getUsername() == $student->getUsername()) {
         NQ::simple('hms', hms\NotificationView::SUCCESS, 'You have agreed to the room change request. You will be notified by email when the reqeust is approved or denied.');
         $menuCmd = CommandFactory::getCommand('ShowStudentMenu');
         $menuCmd->redirect();
     } else {
         $cmd->redirect();
     }
 }
开发者ID:jlbooker,项目名称:homestead,代码行数:45,代码来源:RoomChangeStudentApproveCommand.php

示例12: execute

    public function execute()
    {
        $db = new PHPWS_DB();
        $query = <<<EOF
SELECT
        assign.banner_id,
        assign.asu_username,
        bed.bed_letter,
        bed.bedroom_label,
        room.room_number,
        floor.floor_number,
        hall.hall_name

FROM
        hms_assignment as assign
        LEFT JOIN hms_bed as bed on assign.bed_id=bed.id
        LEFT JOIN hms_room as room on bed.room_id=room.id
        LEFT JOIN hms_floor as floor on room.floor_id=floor.id
        LEFT JOIN hms_residence_hall as hall on floor.residence_hall_id=hall.id
WHERE
        assign.term = '{$this->term}'
ORDER BY
        hall.hall_name,
        floor.floor_number,
        room.room_number,
        bed.bedroom_label,
        bed.bed_letter
EOF;
        $result = $db->select(null, $query);
        if (PEAR::isError($result)) {
            throw new DatabaseException($result->toString());
        }
        $final_rows = array();
        foreach ($result as $row) {
            $hall_name = $row['hall_name'];
            $student = StudentFactory::getStudentByBannerId($row['banner_id'], $this->term);
            $row['name'] = $student->getFullName();
            $row['dob'] = $student->getDOB();
            $row['year'] = $student->getClass();
            $row['gender'] = HMS_Util::formatGender($student->getGender());
            $final_rows[$hall_name][] = $row;
        }
        $this->rows =& $final_rows;
    }
开发者ID:jlbooker,项目名称:homestead,代码行数:44,代码来源:FloorRoster.php

示例13: execute

 public function execute()
 {
     PHPWS_Core::initModClass('hms', 'StudentFactory.php');
     $this->data = array();
     $query = "SELECT hms_assignment.id, hms_assignment.banner_id, hms_assignment.asu_username, hms_new_application.cell_phone, hms_room.room_number, hms_floor.floor_number, hms_residence_hall.hall_name FROM hms_assignment LEFT JOIN (SELECT username, MAX(term) AS mterm FROM hms_new_application GROUP BY username) AS a ON hms_assignment.asu_username = a.username LEFT JOIN hms_new_application ON a.username = hms_new_application.username AND a.mterm = hms_new_application.term LEFT JOIN hms_bed ON hms_assignment.bed_id = hms_bed.id LEFT JOIN hms_room ON hms_bed.room_id = hms_room.id LEFT JOIN hms_floor ON hms_room.floor_id = hms_floor.id LEFT JOIN hms_residence_hall ON hms_floor.residence_hall_id = hms_residence_hall.id WHERE ( hms_assignment.term = {$this->term}) ORDER BY hms_residence_hall.id ASC";
     $results = PHPWS_DB::getAll($query);
     if (PHPWS_Error::logIfError($results)) {
         throw new DatabaseException($results->toString());
     }
     foreach ($results as $result) {
         try {
             $student = StudentFactory::getStudentByBannerId($result['banner_id'], $this->term);
         } catch (Exception $e) {
             $this->data[] = array($result['hall_name'], $result['floor_number'], $result['room_number'], 'ERROR', 'ERROR', 'ERROR', $result['cell_phone'], $result['asu_username'] . "@appstate.edu");
             continue;
         }
         $this->data[] = array($result['hall_name'], $result['floor_number'], $result['room_number'], $student->getLastName(), $student->getFirstName(), $result['banner_id'], $result['cell_phone'], $result['asu_username'] . "@appstate.edu");
     }
 }
开发者ID:jlbooker,项目名称:homestead,代码行数:19,代码来源:PackageDeskExport.php

示例14: show

 public function show()
 {
     $terms = HousingApplication::getAvailableApplicationTermsForStudent($this->student);
     $applications = HousingApplication::getAllApplicationsForStudent($this->student);
     $tpl = array();
     foreach ($terms as $t) {
         # If the student has a withdrawn application,
         # then show a message instead of the normal menu block.
         if (isset($applications[$t['term']]) && $applications[$t['term']]->isCancelled()) {
             $termBlock = new StudentMenuWithdrawnTermBlock($this->student, $t['term']);
         } else {
             // Look up the student again in each term, because student type can change depending on which term we ask about
             $student = StudentFactory::getStudentByBannerId($this->student->getBannerId(), $t['term']);
             $termBlock = new StudentMenuTermBlock($student, $t['term']);
         }
         $tpl['TERMBLOCK'][] = array('TERMBLOCK_CONTENT' => $termBlock->show());
     }
     Layout::addPageTitle("Main Menu");
     return PHPWS_Template::process($tpl, 'hms', 'student/freshmenMenu.tpl');
 }
开发者ID:jlbooker,项目名称:homestead,代码行数:20,代码来源:FreshmenMainMenuView.php

示例15: execute

 public function execute(CommandContext $context)
 {
     if (!Current_User::allow('hms', 'lottery_admin')) {
         PHPWS_Core::initModClass('hms', 'exception/PermissionException.php');
         throw new PermissionException('You do not have permission to administer re-application features.');
     }
     PHPWS_Core::initModClass('hms', 'HousingApplicationFactory.php');
     PHPWS_Core::initModClass('hms', 'StudentFactory.php');
     $bannerIds = $context->get('banner_ids');
     $term = Term::getSelectedTerm();
     $bannerIds = explode("\n", $bannerIds);
     foreach ($bannerIds as $bannerId) {
         // Trim any excess whitespace
         $bannerId = trim($bannerId);
         // Skip blank lines
         if ($bannerId == '') {
             continue;
         }
         $student = StudentFactory::getStudentByBannerId($bannerId, $term);
         try {
             $application = HousingApplicationFactory::getAppByStudent($student, $term);
         } catch (StudentNotFoundException $e) {
             NQ::simple('hms', hms\NotificationView::ERROR, "No matching student was found for: {$bannerId}");
             continue;
         }
         if (is_null($application)) {
             NQ::simple('hms', hms\NotificationView::ERROR, "No housing application for: {$bannerId}");
             continue;
         }
         $application->magic_winner = 1;
         try {
             $application->save();
         } catch (Exception $e) {
             NQ::simple('hms', hms\NotificationView::ERROR, "Error setting flag for: {$bannerId}");
             continue;
         }
         NQ::simple('hms', hms\NotificationView::SUCCESS, "Magic flag set for: {$bannerId}");
     }
     $viewCmd = CommandFactory::getCommand('ShowLotteryAutoWinners');
     $viewCmd->redirect();
 }
开发者ID:jlbooker,项目名称:homestead,代码行数:41,代码来源:LotteryAdminSetWinnerCommand.php


注:本文中的StudentFactory::getStudentByBannerId方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。