예제 #1
0
 function createSessionBookingCityTour($data, $step = 1)
 {
     $this->clearSessionBYStep($step);
     $session_step = new Zend_Session_Namespace('bookcitytour');
     if ($step == 1) {
         $session_step->package_id = $data;
         $session_step->package_name = $this->getPackageCityTourById($data);
         $session_step->max_hour = $this->getMaxHourByPackageId($data);
         //to show max hour in front
         $session_step->step1 = 1;
         $session_step->step2 = 0;
         $session_step->step3 = 0;
         $session_step->step4 = 0;
         $session_step->point_step = 1;
     } elseif ($step == 2) {
         $session_step->point_step = 2;
         $data['return_date'] = $data['pickup_date'];
         $session_step->pickup_date = empty($data['pickup_date']) ? null : $data['pickup_date'];
         $session_step->pickup_time = empty($data['pickup_time']) ? null : $data['pickup_time'];
         $session_step->pickup_mins = empty($data['pickup_mins']) ? null : $data['pickup_mins'];
         $session_step->step2 = 1;
         $session_step->return_date = empty($data['return_date']) ? null : $data['return_date'];
         $session_step->return_time = empty($data['return_time']) ? null : $data['return_time'];
         $session_step->return_mins = empty($data['return_mins']) ? null : $data['return_mins'];
         $db = new Application_Model_DbTable_DbGlobal();
         $session_step->vehiclevaliable = $db->getAllAvailableVehicle($data);
     } elseif ($step == 3) {
         $session_step->point_step = 3;
         $session_step->step3 = 1;
         $session_step->vehicle_id = $data;
         //$data get parram store value only not array
         $session_step->price = $this->getPriceBYPackageandVehicle($data, $session_step->package_id);
         $db = new Application_Model_DbTable_DbGlobal();
         $array = array('pickup_date' => $session_step->pickup_date, 'return_date' => $session_step->pickup_date, 'return_time' => $session_step->pickup_time . ":" . $session_step->pickup_mins);
         $session_step->guideavaliable = $db->getAvailableDriver($array);
         $row = $db->geVehicleById($data);
         $session_step->vehicle_name = $row["make"] . " " . $row["model"] . " " . $row["sub_model"];
         $session_step->reff = $row["reffer"];
     } elseif ($step == 4) {
         $session_step->point_step = 4;
         $session_step->step4 = 1;
         if (!empty($data)) {
             //if select guide/
             $row = $this->getGuideNormalPrice($data);
             $guideprice = $row['c_normalprice'];
             $guidename = $row['first_name'] . '-' . $row['last_name'];
             $guide_id = $row["id"];
             //$session_step->guide_id =$guide_id;
         } else {
             $guideprice = 0;
             $guidename = 'None';
             $guide_id = 'None';
         }
         $session_step->guidename = $guidename;
         $session_step->guideprice = $guideprice;
         $session_step->guideid = $guide_id;
     } elseif ($step == 5) {
         $session_step->point_step = 5;
         $session_step->step5 = 1;
     } elseif ($step == 6) {
         $session_step->point_step = 6;
         $session_step->step6 = 1;
     }
     return true;
     // 		if(!empty($session_step_one->step2)){
     // 			$session_step_one->vehicle_id=$data['vehicle_id'];
     // 		}
     // 		$session_step_one->step2 = null;
     // 		$session_step_one->step3 = null;
 }
예제 #2
0
 public function vehicleAction()
 {
     $id = $this->getRequest()->getParam("id");
     $db = new Application_Model_DbTable_DbGlobal();
     $data = $db->geVehicleById($id);
     $this->view->showdata = $data;
     $this->view->rows = $db->getallSemilarVehicle();
 }
예제 #3
0
 function createSessionTaxiBooking($data, $step = 1)
 {
     // 		$this->clearSessionBYStep($step);
     $session = new Zend_Session_Namespace('taxibooking');
     if ($step == 1) {
         $session->point_step = 1;
         $session->step1 = 1;
         $session->step2 = 0;
         $session->step3 = 0;
         $session->step4 = 0;
         $data['return_date'] = $data['pickup_date'];
         // 			$data['return_time']=$data['pickup_time'].":".$data['pickup_mins'];//must get max hour plus with pick up
         $session->pickup_date = empty($data['pickup_date']) ? null : $data['pickup_date'];
         $session->pickup_time = empty($data['pickup_time']) ? null : $data['pickup_time'];
         $session->pickup_mins = empty($data['pickup_mins']) ? null : $data['pickup_mins'];
         $session->return_date = empty($data['return_date']) ? null : $data['return_date'];
         $session->return_time = empty($data['return_time']) ? null : $data['return_time'];
         // 			$session->return_mins =empty($data['return_mins'])? null : $data['return_mins'];
         $session->from_location = empty($data['from_location']) ? 0 : $data['from_location'];
         $session->to_location = empty($data['to_location']) ? 0 : $data['to_location'];
         $session->trip_way = $data['trip_way'];
         $session->from_locationname = $this->getLocationNameById($data['from_location']);
         $session->to_locationname = $this->getLocationNameById($data['to_location']);
         $db = new Application_Model_DbTable_DbGlobal();
         $session->vehiclevaliable = $db->getAllAvailableVehicle($data);
     } elseif ($step == 2) {
         $session->point_step = 2;
         $session->step2 = 1;
         $session->vehicle_id = $data;
         //$data get parram store value only not array
         $row = $this->getTaxiPriceByLocation($data, $session->from_location, $session->to_location);
         if ($session->trip_way == 1) {
             $taxiprice = $row['price'] + $row['price'] * $row['tax'] / 100;
         } else {
             $taxiprice = $row['round_trip'] + $row['round_trip'] * $row['tax'] / 100;
         }
         $session->taxi_price = $taxiprice;
         $db = new Application_Model_DbTable_DbGlobal();
         $array = array('pickup_date' => $session->pickup_date, 'return_date' => $session->pickup_date, 'return_time' => $session->pickup_time . ":" . $session->pickup_mins);
         $session->guideavaliable = $db->getAvailableDriver($array);
         $row = $db->geVehicleById($data);
         $session->vehicle_name = $row["make"] . " " . $row["model"] . " " . $row["sub_model"] . "(" . $row["reffer"] . ")";
         $session->time = $this->getTimeArrived($data, $session->from_location, $session->to_location);
     } elseif ($step == 3) {
         $session->point_step = 3;
         $session->step3 = 1;
         $session_user = new Zend_Session_Namespace('customer');
         $session->user_id = $session_user->customer_id;
         $session->user_name = $session_user->customer_name;
     } elseif ($step == 4) {
         $session->point_step = 4;
         $session->step4 = 1;
     }
     return true;
 }