Ejemplo n.º 1
0
 public function index()
 {
     $post = XMLPost2Array($this->input->post());
     $post['Debug'] = $this->input->post('Debug');
     if (isset($post['DocID'])) {
         $post['HBooking'] = $post['DocID'];
         unset($post['DocID']);
     }
     $a_post = $this->cancel_model->getSplitHBooking($post);
     unset($post);
     $a_logs = array();
     try {
         $isCancelled = 'False';
         foreach ($a_post as $idx => &$post) {
             $this->cancel_model->getRequest($post);
             $post['response'] = httpcurl($post['request'], $this->url, $this->option);
             if ($this->cancel_model->checkCancel($post) === TRUE) {
                 $isCancelled = 'True';
             }
             $a_logs['request'][$idx] = $post['request'];
             $a_logs['response'][$idx] = $post['response'];
         }
         $xmlResponse = array("ResNo" => $a_post[0]['ResNo'], "Hbooking" => $a_post[0]['HBooking'], "ErrorDescription" => '', "CancelResult" => 'True');
     } catch (Exception $ex) {
         log_message('INFO', 'ERROR MSG => ' . $ex->getMessage() . '; LINE => ' . $ex->getLine() . '; FILE => ' . $ex->getFile());
         $xmlResponse = array("ResNo" => $a_post[0]['ResNo'], "Hbooking" => $a_post[0]['HBooking'], "ErrorDescription" => $ex->getMessage(), "CancelResult" => 'False');
     }
     $this->load->view('travflex/cancel_response', array('xmlResponse' => $xmlResponse));
     xmllog21s('CancelRSVN', $a_logs);
 }
Ejemplo n.º 2
0
 function index()
 {
     $a_post = convertXMLPOSTBooking($this->input->post());
     $this->load->model('travflex/search_model');
     $service_name = 'Booking';
     try {
         $arrCompleteServ = array();
         foreach ($a_post as &$post) {
             if ($post['OrgResId'] != '' and $post['OrgHBId'] != '') {
                 $service_name = 'Amend Booking';
             }
             $this->searchProduct($post);
             $this->bookingProduct($post);
             $data = $this->postBookingProduct($post);
             if ($data === FALSE) {
                 continue;
             }
             $arrCompleteServ[] = $data;
         }
         //check hotel and period was same ...do concat!!
         if ($this->postbook_model->checkCompletedService($arrCompleteServ) === TRUE) {
             if ($a_post[0]['isConcatHBID'] == 'TRUE') {
                 $this->postbook_model->concatBookId($arrCompleteServ);
             }
         }
         $abooking = array("ResNo" => randomID(), "Status" => $arrCompleteServ[0]['Status'], "PaxPassport" => $post['PaxPassport'], "OSRefNo" => $post['OSRefNo'], "FinishBook" => $post['FinishBook'], "RPCurrency" => $arrCompleteServ[0]["RPCurrency"], "CompleteService" => $arrCompleteServ, "UnCompleteService" => array());
     } catch (Exception $ex) {
         log_message('INFO', 'ERROR MSG => ' . $ex->getMessage() . '; LINE => ' . $ex->getLine());
         $abooking['errors']['error'] = $ex->getMessage();
     }
     $this->load->view('travflex/book_response', array('bookInfo' => $abooking));
     xmllog21s($service_name, $this->log_21);
 }
Ejemplo n.º 3
0
 public function index()
 {
     $post = XMLPost2Array($this->input->post());
     $post['Debug'] = $this->input->post('Debug');
     //if request from B2B.
     if (!isset($post['HotelId']) and $post['HotelCode'] != '') {
         $post['HotelId'] = $post['HotelCode'];
     }
     $query = 'SELECT SpHotelName FROM ' . _SUPPLIERCODE . '_sitec_products WHERE SpHotelCode = "' . $post['HotelId'] . '"';
     $rs = $this->db->query($query);
     if ($rs === FALSE) {
         $hotelname = '';
     }
     $hotelname = @array_shift($rs->result_object())->SpHotelName;
     $rs->free_result();
     $Exdates = datediffST(date('Y-m-d'), $post['FromDt']);
     $Policies[0] = array('BFType' => 'NONE', 'RoomCatgCode' => 'NONE', 'RoomCatgName' => 'NONE', 'FromDate' => date('Y-m-d'), 'ToDate' => $post['FromDt'], 'ExCancelDays' => $Exdates, 'ChargeType' => 'Percent', 'ChargeRate' => '100', 'Description' => 'Full charge, No refund.', 'Currency' => '');
     $data['arrViewCancelPolicy'] = array("HotelId" => $post['HotelId'], "HotelName" => $hotelname, "Policies" => $Policies);
     if ($post['Debug'] == 1) {
         print_r($post + $data);
     }
     $this->load->view('travflex/policy_response', $data);
     $post['request'] = '';
     $post['response'] = '';
     xmllog21s('ViewCancelPolicy', $post);
 }
Ejemplo n.º 4
0
 public function index()
 {
     $a_post = convertXMLPOSTBooking($this->input->post());
     $this->load->model('travflex/search_model');
     $this->load->model('travflex/book/prebook_model');
     $this->load->model('travflex/book/postbook_model');
     $this->load->helper(array('view', 'tools'));
     $this->load->library('Httpcurl');
     $arrCompleteServices = array();
     $err = array();
     foreach ($a_post as $idx => &$post) {
         try {
             $this->searchHotel($post);
             $this->temp_log['request']['searchHotel'][$idx] = 'query from db.';
             $this->temp_log['response']['searchHotel'][$idx] = $post['response'];
             $this->prebookHotel($post);
             $this->temp_log['request']['bookHotel'][$idx] = $post['request'];
             $this->temp_log['response']['bookHotel'][$idx] = $post['response'];
             $arrCompleteServices[] = $this->postbookHotel($post);
             $is_error = 'FALSE';
         } catch (Exception $ex) {
             $is_error = 'TRUE';
             log_message('NOTICE', 'Exception : ' . $ex->getMessage() . '; LINE : ' . $ex->getLine() . '; FILE : ' . $ex->getFile());
             $err['response']['errors'][$idx] = $ex->getMessage();
         }
     }
     //concat room category when :::
     //1. same hotel(HOTEL,XML) and same period(XML)
     if ($a_post[0]['isConcatHBID'] == 'TRUE' && $is_error == 'FALSE') {
         $id = '';
         $ref = '';
         foreach ($arrCompleteServices as $item) {
             $id .= $item['Id'] . '#|#';
             $ref .= $item['RefHBId'] . '#|#';
         }
         foreach ($arrCompleteServices as &$fill) {
             $fill['Id'] = substr($id, 0, -3);
             $fill['RefHBId'] = substr($ref, 0, -3);
         }
     }
     @$this->load->view('travflex/book_responseV2', array('post' => $a_post, 'arrCompleteServices' => $arrCompleteServices, 'err' => $err));
     xmllog21s('BookingHotel', $this->temp_log);
 }
Ejemplo n.º 5
0
 public function index()
 {
     $post = XMLPost2Array($this->input->post());
     $post['Debug'] = $this->input->post('Debug');
     if (isset($post['LoginName'])) {
         $post['Username'] = $post['LoginName'];
         unset($post['LoginName']);
     }
     $a_post = $this->cancel_model->getSplitHBooking($post);
     $query = 'SELECT SpHotelName FROM ' . _SUPPLIERCODE . '_sitec_products WHERE SpHotelCode = "' . $a_post[0]['HotelId'] . '"';
     $rs = $this->db->query($query);
     if ($rs === FALSE) {
         $hotelname = '';
     }
     $hotelname = @array_shift($rs->result_object())->SpHotelName;
     $rs->free_result();
     $Exdates = datediffST(date('Y-m-d'), $a_post[0]['FromDt']);
     $Policies[0] = array('BFType' => 'NONE', 'RoomCatgCode' => 'NONE', 'RoomCatgName' => 'NONE', 'FromDate' => date('Y-m-d'), 'ToDate' => $a_post[0]['FromDt'], 'ExCancelDays' => $Exdates, 'ChargeType' => 'Percent', 'ChargeRate' => '100', 'Description' => 'Full charge, No refund.', 'Currency' => '');
     $this->temp_log['request'] = $a_post;
     $arrMakePolicyXML = array("ResNo" => $post['ResNo'], "HBooking" => $post['HBooking'], "HotelId" => $a_post[0]['HotelId'], "HotelName" => $hotelname, "arrPolicy" => $Policies);
     $this->temp_log['response'] = $arrMakePolicyXML;
     $this->load->view('travflex/policy_response', array('getpolicy' => $arrMakePolicyXML));
     xmllog21s('GetCancelPolicy', $this->temp_log);
 }