示例#1
0
 /**
  * Passenger update ajax2(pop up)
  * CODE: passenger_create
  */
 public function executeUpdate2Ajax(sfWebRequest $request)
 {
     $this->setLayout(false);
     if (!$this->getUser()->getAttribute('pop_pass')) {
         return $this->forward('passenger', 'update1Ajax');
     } else {
         $pass_pop_session = unserialize($this->getUser()->getAttribute('pop_pass'));
     }
     //@include_once("/opt/httpd-builtin-5.0.0.1/afids/web/krumo/class.krumo.php");
     ///(print_r($pass_pop_session));
     if (isset($pass_pop_session)) {
         $passenger = $pass_pop_session;
         //echo 'yes2';
     } else {
         $passenger = new Passenger();
     }
     $this->form2 = new PassengerPopUpForm2($passenger);
     //$this->form2 = new PassengerPopUpForm2();
     $this->sub_title = 'Add New Passenger';
     if ($request->isMethod('post')) {
         $this->referer = $request->getReferer();
         $this->form2->bind($request->getParameter('pass_popup2'));
         if ($this->form2->isValid()) {
             $passenger->setPublicConsiderations($request->getParameter('pass_popup2[public_considerations]'));
             $passenger->setPrivateConsiderations($request->getParameter('pass_popup2[private_considerations]'));
             $passenger->setGroundTransportationComment($request->getParameter('pass_popup2[ground_transportation_comment]'));
             $passenger->setTravelHistoryNotes($request->getParameter('pass_popup2[travel_history_notes]'));
             //$this->getUser()->setAttribute('pop_pass', $passenger);
             $this->getUser()->setAttribute('pop_pass', serialize($passenger));
             return $this->redirect('passenger/update3Ajax');
         }
     } else {
         # Set referer URL
         $this->referer = $request->getReferer() ? $request->getReferer() : '@passenger/update1Ajax';
     }
 }