예제 #1
0
 public function reviewAction()
 {
     // get params from session
     $tripID = $this->_getCustomerNS()->tripID;
     $seatCountYouWant = $this->_getCustomerNS()->seatCountYouWant;
     $selectedSeatNumbers = $this->_getCustomerNS()->selectedSeatNumbers;
     // get trip info
     $tripModel = new Customer_Model_Trip();
     $trip = $tripModel->getTripInfo($tripID);
     if ($trip == null) {
         throw new Exception('You can\'t reach here');
     }
     // prepare for "review" view
     $this->view->from_city = $trip['from_city'];
     $this->view->to_city = $trip['to_city'];
     $this->view->departure_time = $trip['departure_time'];
     $this->view->boarding_point = $trip['boarding_point'];
     $this->view->fare = $trip['fare'];
     $this->view->seatCountYouWant = $seatCountYouWant;
     $this->view->selectedSeatNumbers = $selectedSeatNumbers;
     // create captcha form
     $bookingFinishForm = new Customer_Form_BookingFinish();
     $bookingFinishForm->setAction('/orders/review')->setMethod('post');
     $fromCustomerEnterInfo = $this->_request->getParam('fromCustomerEnterInfo');
     // check if previous page is customer/enter-info
     if ($fromCustomerEnterInfo) {
         // empty
     } else {
         if ($this->_request->isPost() && $bookingFinishForm->isValid($_POST)) {
             return $this->_forward('create', 'orders', 'customer');
         }
     }
     $this->view->bookingFinishForm = $bookingFinishForm;
 }
예제 #2
0
 public function receiveCodeAction()
 {
     // get params from session
     $tripID = $this->_getCustomerNS()->tripID;
     $seatCountYouWant = $this->_getCustomerNS()->seatCountYouWant;
     $selectedSeatNumbers = $this->_getCustomerNS()->selectedSeatNumbers;
     $code = $this->_getCustomerNS()->code;
     // get trip info
     $tripModel = new Customer_Model_Trip();
     $trip = $tripModel->getTripInfo($tripID);
     if ($trip == null) {
         throw new Exception('You can\'t reach here');
     }
     // assign params to view
     $this->view->from_city = $trip['from_city'];
     $this->view->to_city = $trip['to_city'];
     $this->view->departure_time = $trip['departure_time'];
     $this->view->boarding_point = $trip['boarding_point'];
     $this->view->fare = $trip['fare'];
     $this->view->code = $code;
     $this->view->seatCountYouWant = $seatCountYouWant;
     $this->view->selectedSeatNumbers = $selectedSeatNumbers;
 }