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); }
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); }
public function index() { $post = XMLPost2Array($this->input->post()); $post['Debug'] = $this->input->post('Debug'); try { $this->search_model->fetchProducts($post); $post['response'] = $this->search_model->reArrange($post); } catch (Exception $ex) { log_message('INFO', 'ERROR MSG => ' . $ex->getMessage() . '; LINE => ' . $ex->getLine() . '; FILE => ' . $ex->getFile()); $post['response']['errors']['error'] = $ex->getMessage(); } $this->load->view('travflex/search_response', array('post' => $post)); }
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); }
<?php if (isset($post['Debug']) and $post['Debug'] == 1) { print_r($post); } if (!isset($CI)) { $CI =& getInstance(); } $CI->output->setContentType('xml'); if (!isset($post)) { $post = XMLPost2Array($CI->input->post()); } //if not request compress data,set output as xml. $Accesspage = ''; if (isset($post['Compress']) and strtoupper($post['Compress']) == 'TRUE') { $Accesspage = 'B2B'; } if (isset($post['response']['errors'])) { $msg = ''; foreach ($post['response']['errors'] as $err) { $msg .= $err; } $RP = f_error_Please_send_requestXML('Service_SearchHotel', 'SearchHotel_Response', $msg); } else { $arrRP = f_create_text_rp_searchhotels($post, $CI->input->get()); $RP = RPSearch($arrRP); } //Last response for search. // if RP variable is not set, i guess their come from exception error....understand? echo compressXML($post['Compress'], $RP, $Accesspage);