예제 #1
0
 public function executeSearchByInstructor(sfWebRequest $request)
 {
     $conn = Propel::getConnection();
     $today = getdate();
     $this->searchType = searchActions::SEARCH_BY_INSTRUCTOR;
     $rawInstrList = InstructorPeer::getAll($conn);
     $this->instructorList = array();
     foreach ($rawInstrList as $obj) {
         $this->instructorList[$obj->getId()] = $obj->getLastName() . ", " . $obj->getFirstName();
     }
     if ($request->hasParameter("instructor")) {
         $this->instructorId = $request->getParameter("instructor");
         if (helperFunctions::isMaliciousString($this->instructorId)) {
             $this->forward404();
         }
         // get result set
         $instrObj = InstructorPeer::retrieveByPK($this->instructorId, $conn);
         $this->resultTitle = "Results for " . $instrObj->getLastName() . ", " . $instrObj->getFirstName();
         $this->results = CoursePeer::findCoursesByInstructorId($this->instructorId, $conn);
     } else {
         $this->instructorId = $rawInstrList[0]->getId();
     }
 }