Exemplo n.º 1
0
 /**
  * Passenger update ajax3(pop up)
  * CODE: passenger_create
  */
 public function executeUpdate3Ajax(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 'yes3';
     } else {
         $passenger = new Passenger();
     }
     $this->form3 = new PassengerPopUpForm3($passenger);
     $this->sub_title = 'Add New Passenger';
     if ($request->isMethod('post')) {
         $this->referer = $request->getReferer();
         $this->form3->bind($request->getParameter('pass_popup3'));
         if ($this->form3->isValid()) {
             $passenger->setReleasingPhysician($request->getParameter('pass_popup3[releasing_physician]'));
             $passenger->setReleasingPhone($request->getParameter('pass_popup3[releasing_phone]'));
             $passenger->setReleasingFax1($request->getParameter('pass_popup3[releasing_fax1]'));
             $passenger->setReleasingFax1Comment($request->getParameter('pass_popup3[releasing_fax1_comment]'));
             $passenger->setReleasingEmail($request->getParameter('pass_popup3[releasing_email]'));
             $passenger->setNeedMedicalRelease($request->getParameter('pass_popup3[need_medical_release]'));
             $passenger->setMedicalReleaseRequested($request->getParameter('pass_popup3[medical_release_requested]'));
             $passenger->setMedicalReleaseReceived($request->getParameter('pass_popup3[medical_release_received]'));
             //Treating
             $passenger->setTreatingPhysician($request->getParameter('pass_popup3[treating_physician]'));
             $passenger->setTreatingPhone($request->getParameter('pass_popup3[treating_phone]'));
             $passenger->setTreatingFax1($request->getParameter('pass_popup3[treating_fax1]'));
             $passenger->setTreatingFax1Comment($request->getParameter('pass_popup3[treating_fax1_comment]'));
             $passenger->setTreatingEmail($request->getParameter('pass_popup3[treating_email]'));
             //$this->getUser()->setAttribute('pop_pass', $passenger);
             $this->getUser()->setAttribute('pop_pass', serialize($passenger));
             return $this->redirect('passenger/update4Ajax');
         } else {
         }
     } else {
         # Set referer URL
         $this->referer = $request->getReferer() ? $request->getReferer() : '@passenger/update2Ajax';
     }
 }