コード例 #1
0
ファイル: booking_view.php プロジェクト: bogiesoft/bookitnow
<!--right side wrap start here-->
<div class="col-sm-3" style="font-weight: normal;">	
	<?php 
$dscode = $fobj['@attributes']['depapt'];
$ascode = $fobj['@attributes']['arrapt'];
$ascode_con = @trim(explode('-', $arrivals[(string) $ascode])[1]);
$ascode = $ascode_con != '' ? $ascode_con : trim(explode('-', @$arrivals[(string) $ascode])[0]);
$dscode = trim(explode('-', @$departures[(string) $dscode])[0]);
//print_r($fobj);exit;
$dept_start_time = substr(explode(' ', $fobj['@attributes']['outdep'])[1], 0, -3);
$dept_arr_time = substr(explode(' ', $fobj['@attributes']['outarr'])[1], 0, -3);
$return_start_time = substr(explode(' ', $fobj['@attributes']['indep'])[1], 0, -3);
$return_arr_time = substr(explode(' ', $fobj['@attributes']['inarr'])[1], 0, -3);
//echo '<pre>';print_r($return_start_time);exit;
$this->load->helper('common');
$dept_images = dept_images();
?>
	<div class="deals">	<h2>Your Selections	</h2></div>
	<div class="bg_grey">											
        <div>
      		<div class="left">Flights</div>
		    <div class="right" style="text-align: right;">&#163;<?php 
echo ($seg[0]['num_adults'] + $seg[0]['num_children']) * $fobj['@attributes']['sellpricepp'];
?>
</div>
        </div>
		<div style="margin-bottom: 5px; margin-top: 5px;    line-height: 20px;">
             <strong style="color: rgba(241, 113, 19, 0.98);"><i aria-hidden="true" class="icon-calendar"></i>&nbsp;Depart:</strong>
             <br>
                <!--<div style="position: relative;" class="clearfix">
                   <div class="left">
コード例 #2
0
ファイル: Extras.php プロジェクト: bogiesoft/bookitnow
    public function book_flight()
    {
        $data = array();
        $data['is_laststep'] = true;
        $tot_sel = 0;
        $data['controller'] = $this;
        $data['form_type'] = 'flight_only';
        if (!empty($row = $this->UserSearch->fetch_a_search(array('type_search' => 'flight_hotel', 'url_hash' => $this->uri->segment(2))))) {
            $data['seg'] = $row;
            //If already booked redirect to home page
            $this->load->model('BookingInfo');
            $b_row = $this->BookingInfo->fetch_a_search(array('base_id' => $data['seg'][0]['id']));
            if (!empty($b_row)) {
                redirect(base_url());
            }
            //End
            //If Did not select flights redirect to flight search page
            $data['hobjs'] = json_decode($row[0]['pack_info'], true);
            if (empty($data['hobjs'])) {
                redirect(base_url() . 'available/' . $this->uri->segment(2));
            }
            $tot_sel = $data['hobjs']['@attributes']['sellpricepp'];
            $data['res_sel_price'] = $tot_sel / count($data['hobjs']);
            $departures = $this->fetch_departures();
            $arrivals = $this->fetch_arrivals();
            //$this->load->model('PhaseFlightOrHotel');
            $selected_info = $row;
            //print_r($selected_info);exit;
            $flight_obj = json_decode($selected_info[0]['pack_info'], true);
            $dscode = $flight_obj['@attributes']['depapt'];
            //echo $dscode;exit;
            $ascode = $flight_obj['@attributes']['arrapt'];
            $ascode_con = @trim(explode('-', $arrivals[(string) $ascode])[1]);
            $ascode = $ascode_con != '' ? $ascode_con : trim(explode('-', $arrivals[(string) $ascode])[0]);
            $dscode = trim(explode('-', $departures[(string) $dscode])[0]);
            //print_r($flight_obj);exit;
            $dept_start_time = substr(explode(' ', $flight_obj['@attributes']['outdep'])[1], 0, -3);
            $dept_arr_time = substr(explode(' ', $flight_obj['@attributes']['outarr'])[1], 0, -3);
            $return_start_time = substr(explode(' ', $flight_obj['@attributes']['indep'])[1], 0, -3);
            $return_arr_time = substr(explode(' ', $flight_obj['@attributes']['inarr'])[1], 0, -3);
            $this->load->helper('common');
            $dept_images = dept_images();
            $type_s = 'full_flight';
            $cry = $this->uri->segment(2);
            //echo "<pre>";print_r($row);exit;
            $data['seleted_info'] = '<div class="deals"><h2>Your Selections</h2></div>
				<div class="bg_grey">
					<div>
			      		<div class="left">Flights</div>
					    <div class="right" style="text-align: right;">&#163;' . ($row[0]['num_adults'] + max($row[0]['num_children'], 0)) * $flight_obj['@attributes']['sellpricepp'] . '</div>
			        </div>
					<div style="margin-bottom: 5px; margin-top: 5px;    line-height: 20px;">
			             	<strong style="color: rgba(241, 113, 19, 0.98);"><i aria-hidden="true" class="icon-calendar"></i>&nbsp;Depart:</strong>
			             <br>
			                <!--<div style="position: relative;" class="clearfix">
			                   <div class="left">
			                        <img src="' . $dept_images[$flight_obj['@attributes']['suppcode']] . '" style="width: 70px; height: 16px;">
			                    </div>
			                    <div class="right">
			                        <span class="txt_color_2"></span>
			                    </div>
			                </div>-->
			             <small>' . $dscode . ' to ' . $ascode . '<br>' . date('d M Y', $this->cvtDt(str_date(explode(' ', $flight_obj['@attributes']['outdep'])[0]))) . ' : ' . $dept_start_time . '/' . $dept_arr_time . '</small><br>
			             <span class="txt_color_2"></span>			                
			        </div>         		
			        <div style="margin-bottom: 5px;line-height: 20px;">
			          	<strong style="color: rgba(241, 113, 19, 0.98);"><i aria-hidden="true" class="icon-calendar"></i>&nbsp;Return:</strong><br>
			             <!--<div style="position: relative;" class="clearfix">
			                  <div class="left">
			                      <img src="' . $dept_images[$flight_obj['@attributes']['suppcode']] . '" style="width: 70px; height: 16px;">
			                  </div>
			              </div>-->
					   	 <small>' . $ascode . ' to ' . $dscode . '<br>' . date('d M Y', $this->cvtDt(str_date(explode(' ', $flight_obj['@attributes']['indep'])[0]))) . ' : ' . $return_start_time . '/' . $return_arr_time . '</small><br>
					     <span class="txt_color_2"></span>
			        </div>	
		   	 		<div style="position: relative;" class="clearfix">
			             <div>
			                 <small>
			                      <span> Persons : ' . ($row[0]['num_adults'] + max($row[0]['num_children'], 0)) . ' x &#163;' . $flight_obj['@attributes']['sellpricepp'] . '</span>
			                 </small>
			                 <span style="float:right;">
			        	        <small>
			                       <a href="' . base_url() . 'available/' . $this->uri->segment(2) . '" title="Change Flight">Change</a>
								</small>
							</span>
						 </div>						              
					</div>								           
		      	</div>
			    <div class="bg_grey">	
			          <div>
							<div class="left">Atol Protection</div>
				           <div class="right" style="text-align: right;">&#163;' . ($row[0]['num_adults'] + max($row[0]['num_children'], 0)) * 2.5 . '</div>
			          </div>
			          <div style="margin-top: 10px;" class="clearfix">
			               <small>' . ($row[0]['num_adults'] + max($row[0]['num_children'], 0)) . ' x &#163;2.50</small>
			               <span style="float:right;">
						        <small><a class="toggle_atol">What\'s this?</a></small>
						   </span>
			          </div>			        					
				</div>
			               		
			               		
			               		
			               		
			               		
			    <div class="bg_grey" style="margin-bottom:10px;">
     				<div>
						<div class="left">TOTAL</div>
				        <div class="right" style="text-align: right;">&#163;' . (($row[0]['num_adults'] + max($row[0]['num_children'], 0)) * $flight_obj['@attributes']['sellpricepp'] + ($row[0]['num_adults'] + max($row[0]['num_children'], 0)) * 2.5) . '</span></div>
			        </div>
					<div style="margin-bottom: 15px; margin-top: 5px;    line-height: 20px;">            
			             <small>Per Person: &#163;<span id="pprice">' . (($row[0]['num_adults'] + max($row[0]['num_children'], 0)) * $flight_obj['@attributes']['sellpricepp'] + ($row[0]['num_adults'] + max($row[0]['num_children'], 0)) * 2.5) / ($row[0]['num_adults'] + max($row[0]['num_children'], 0)) . '</span>  X ' . ($row[0]['num_adults'] + max($row[0]['num_children'], 0)) . '</small>             
			         </div>        
				</div>';
            /**************total*******************************/
            //For change search poopulations
            $departures = new SimpleXMLElement($this->download_page('http://87.102.127.86:8005/search/websearch.exe?pageid=1&compid=1'));
            foreach ($departures as $departure) {
                $code = (array) $departure->attributes()->code;
                $name = (array) $departure->attributes()->name;
                $data['filtered_departures'] = seperatorFlights($code[0], $name[0]);
                $data['departures'][$code[0]] = $name[0];
            }
            $parts = parse_url($row[0]['service_url']);
            parse_str($parts['query'], $query);
            $data['change_search_info']['query'] = $query;
            $data['change_search_info']['row'] = $row[0];
            $data['controller'] = $this;
            $data['fcls'] = '';
            $data['bcls'] = 'current';
            $data['f_done'] = 'done';
            //End
            /**************end*******************************/
            $this->layouts->add_include(array('css/bootstrap-responsive.min.css', 'css/font-awesome.min.css', 'css/google_font.css', 'css/custom.css', 'css/responsive.css', 'css/inner-page.css', 'css/menu.css', 'css/bxslider/jquery.bxslider.css', 'css/jquery.fancybox.css', 'css/jquery-ui.css', 'css/customeffects.css', 'js/jquery.blockUI.js', 'js/responsee.js', 'js/responsiveslides.min.js', 'js/bxslider/jquery.bxslider.js', 'js/jquery-ui.js', 'js/jquery.fancybox.pack.js', 'js/script-hotels.js'));
            if ($this->input->post()) {
                $this->load->library('form_validation');
                $this->form_validation->set_error_delimiters('<small style="font-weight:100;" class="text-danger">', '</small>');
                foreach ($this->input->post() as $key => $val) {
                    if (strpos($key, 'adult_title') !== false) {
                        $this->form_validation->set_rules($key, 'Title', 'required|callback_cardTypeValidation');
                    } else {
                        if (strpos($key, 'adult_fname') !== false) {
                            $this->form_validation->set_rules($key, 'First Name', 'trim|required|callback_alpha_dash_space');
                        } else {
                            if (strpos($key, 'adult_dob') !== false) {
                                $this->form_validation->set_rules($key, 'DOB', 'trim|required');
                            } else {
                                if (strpos($key, 'adult_lname') !== false) {
                                    $this->form_validation->set_rules($key, 'Last Name', 'trim|required|callback_alpha_dash_space');
                                } else {
                                    if (strpos($key, 'child_title') !== false) {
                                        $this->form_validation->set_rules($key, 'Title', 'required|callback_cardTypeValidation');
                                    } else {
                                        if (strpos($key, 'child_fname') !== false) {
                                            $this->form_validation->set_rules($key, 'First Name', 'trim|required|callback_alpha_dash_space');
                                        } else {
                                            if (strpos($key, 'child_dob') !== false) {
                                                $this->form_validation->set_rules($key, 'DOB', 'trim|required');
                                            } else {
                                                if (strpos($key, 'child_lname') !== false) {
                                                    $this->form_validation->set_rules($key, 'Last Name', 'trim|required|callback_alpha_dash_space');
                                                }
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
                $this->form_validation->set_rules('email', 'Email', 'trim|required|valid_email|matches[confirm_email]');
                $this->form_validation->set_rules('address_1', 'Address', 'required');
                $this->form_validation->set_rules('city', 'city', 'required|callback_alpha_dash_space');
                $this->form_validation->set_rules('post_code', 'postcode', 'required|numeric|max_length[8]');
                $this->form_validation->set_rules('confirm_email', ' Confirm Email', 'trim|required|valid_email');
                $this->form_validation->set_rules('home_tel', 'Phone Number', 'required|numeric|max_length[10]|min_length[10]');
                $this->form_validation->set_rules('mobile', 'Mobile Number', 'required|numeric|max_length[10]|min_length[10]');
                $this->form_validation->set_rules('card_number', 'Card Number', 'required|numeric|max_length[16]|min_length[16]');
                $this->form_validation->set_rules('name_card', 'Card Name', 'required|callback_alpha_dash_space');
                $this->form_validation->set_rules('card_type', 'Card type', 'required|callback_cardTypeValidation');
                $this->form_validation->set_rules('valid_to_yr', 'valid to date', 'required|callback_dateTypeValidation');
                $this->form_validation->set_rules('valid_to_mth', 'valid to date', 'required|callback_dateTypeValidation');
                $this->form_validation->set_rules('cvv_number', 'CVV Number', 'required|numeric|max_length[3]|min_length[3]');
                if ($this->input->post('have_diff_add')) {
                    $this->form_validation->set_rules('city2', 'city2', 'required|callback_alpha_dash_space');
                    $this->form_validation->set_rules('post_code2', 'postcode', 'required|numeric|max_length[8]');
                    $this->form_validation->set_rules('address_2', 'Address', 'required');
                }
                if (!$this->form_validation->run()) {
                } else {
                    if ($this->booking_submition()) {
                        $this->session->set_flashdata('submited', 'yes');
                    } else {
                        $this->session->set_flashdata('submited', 'no');
                    }
                }
            }
            $this->layouts->set_title('Book Hotel');
            $this->layouts->view('book_flight_view', $data);
        } else {
            redirect(base_url());
        }
    }
コード例 #3
0
ファイル: Hotel.php プロジェクト: bogiesoft/bookitnow
    public function full_available_hotels()
    {
        $data = array();
        $results = array();
        if ($this->uri->segment(2) != '') {
            $this->load->model('FullSearch');
            $this->load->model('PhaseFlightOrHotel');
            $rows = $this->FullSearch->fetch_a_search(array('url_hash' => $this->uri->segment(2)));
            $flight_row = $this->PhaseFlightOrHotel->fetch_a_search(array('type_search' => 'full_flight_date', 'full_pack_id' => $rows[0]['id']));
            if (empty($flight_row)) {
                redirect(base_url() . 'flightsAvailability/' . $this->uri->segment(2));
            }
            $data['row'] = $rows;
            $data['fselected_date'] = $flight_row[0]['flight_selected_date'];
            if (!empty($rows)) {
                if ($rows[0]['pax'] != '') {
                    $service_url_arr = explode(',', substr($rows[0]['service_url'], 0, -1));
                    $offers = array();
                    $n = 0;
                    foreach ($service_url_arr as $service_url) {
                        $parts = parse_url($service_url);
                        parse_str($parts['query'], $query);
                        //echo $query['pax'];
                        $url = "http://87.102.127.86:8005/search/websearch.exe?pageid=6&compid=1&minstay=" . $query['minstay'] . "&maxstay=" . $query['maxstay'] . "&depdate=" . $flight_row[0]['flight_selected_date'] . "&flex=0&countryid=" . $query['countryid'] . "&regionid=" . $query['regionid'] . "&areaid=" . $query['areaid'] . "&resortid=&boards=&rating=&pax=" . $query['pax'] . "&offersperday=200";
                        if ($results = $this->loadHotelDataFun($url, $flight_row[0]['flight_selected_date'])) {
                            $temp = array();
                            $this->format_array_fun($results['offer'], count($results['offer']), $temp);
                            $offers[] = $temp;
                        }
                    }
                    $data['offers'] = $this->filter_pax_based_fun($offers, 0, count($offers), $offers[0]['filter_data']);
                    if (empty(@$data['offers']['filter_data'])) {
                        redirect(base_url() . "notavailable");
                    }
                    $data['content'] = $this->hotels_html($data['offers']['filter_data'], 9, 0, $this->uri->segment(2), 'pack_hotel');
                    $myser_URL = $service_url_arr[0];
                    //echo $myser_URL;exit;
                } else {
                    $parts = parse_url($rows[0]['service_url']);
                    parse_str($parts['query'], $query);
                    $url = "http://87.102.127.86:8005/search/websearch.exe?pageid=6&compid=1&minstay=" . $query['minstay'] . "&maxstay=" . $query['maxstay'] . "&depdate=" . $flight_row[0]['flight_selected_date'] . "&flex=0&countryid=" . $query['countryid'] . "&regionid=" . $query['regionid'] . "&areaid=" . $query['areaid'] . "&resortid=&boards=&rating=&pax=" . $query['pax'] . "&offersperday=200";
                    if ($results = $this->loadHotelDataFun($url, $flight_row[0]['flight_selected_date'])) {
                        $this->format_array_fun($results['offer'], count($results['offer']), $data['offers']);
                        if (empty($data['offers'])) {
                            redirect(base_url() . "notavailable");
                        }
                        //echo "<pre>";print_r($data['offers']);exit;
                        $data['content'] = $this->hotels_html($data['offers']['filter_data'], 9, 0, $this->uri->segment(2), 'pack_hotel');
                    }
                    $myser_URL = $rows[0]['service_url'];
                }
                $departures = $this->fetch_departures();
                $arrivals = $this->fetch_arrivals();
                $this->load->model('PhaseFlightOrHotel');
                $selected_info = $this->PhaseFlightOrHotel->fetch_a_search(array('type_search' => 'full_flight_date', 'full_pack_id' => $rows[0]['id']));
                $flight_obj = json_decode($selected_info[0]['pack_info'], true);
                $dscode = $flight_obj['@attributes']['depapt'];
                //echo $dscode;exit;
                $ascode = $flight_obj['@attributes']['arrapt'];
                $ascode_con = @trim(explode('-', $arrivals[(string) $ascode])[1]);
                $ascode = $ascode_con != '' ? $ascode_con : trim(explode('-', $arrivals[(string) $ascode])[0]);
                $dscode = trim(explode('-', $departures[(string) $dscode])[0]);
                //print_r($flight_obj);exit;
                $dept_start_time = substr(explode(' ', $flight_obj['@attributes']['outdep'])[1], 0, -3);
                $dept_arr_time = substr(explode(' ', $flight_obj['@attributes']['outarr'])[1], 0, -3);
                $return_start_time = substr(explode(' ', $flight_obj['@attributes']['indep'])[1], 0, -3);
                $return_arr_time = substr(explode(' ', $flight_obj['@attributes']['inarr'])[1], 0, -3);
                $this->load->helper('common');
                $dept_images = dept_images();
                $type_s = 'full_flight';
                $cry = $this->uri->segment(2);
                $data['seleted_info'] = '<div class="deals">
											<h2>Your Selections	</h2>
										  </div>
	               						  <div class="bg_grey">											
					            			<div>
					                			<div class="left">Flights</div>
								                <div class="right" style="text-align: right;">&#163;' . ($rows[0]['num_adults'] + $rows[0]['num_children']) * $flight_obj['@attributes']['sellpricepp'] . '</div>
			           						 </div>
								             <div style="margin-bottom: 5px; margin-top: 5px;    line-height: 20px;">
								                <strong style="color: rgba(241, 113, 19, 0.98);"><i aria-hidden="true" class="icon-calendar"></i>&nbsp;Depart:</strong>
								                <br>
								                <!-- <div style="position: relative;" class="clearfix">
								                   <div class="left">
								                        <img src="' . $dept_images[$flight_obj['@attributes']['suppcode']] . '" style="width: 70px; height: 16px;">
								                    </div>
								                    <div class="right">
								                        <span class="txt_color_2"></span>
								                    </div>
								                </div>-->
								                        		
								               <small>' . $dscode . ' to ' . $ascode . '<br>' . date('d M Y', $this->cvtDt(str_date($selected_info[0]['flight_selected_date']))) . ' : ' . $dept_start_time . '-' . $dept_arr_time . '</small><br>
								                <span class="txt_color_2"></span>			                
								            </div>
								            <div style="margin-bottom: 5px;    line-height: 20px;">
							                	<strong style="color: rgba(241, 113, 19, 0.98);"><i aria-hidden="true" class="icon-calendar"></i>&nbsp;Return:</strong><br>
								                <!--<div style="position: relative;" class="clearfix">
								                    <div class="left">
								                        <img src="' . $dept_images[$flight_obj['@attributes']['suppcode']] . '" style="width: 70px; height: 16px;">
								                    </div>
								                </div>-->
								               	 <small>' . $ascode . ' to ' . $dscode . '<br>' . date('d M Y', $this->cvtDt(str_date(explode(' ', $flight_obj['@attributes']['indep'])[0]))) . ' : ' . $return_start_time . '-' . $return_arr_time . '</small><br>
								                <span class="txt_color_2"></span>
					            			</div>

								            <div style="position: relative;" class="clearfix">
								                <div>
								                    <small>
								                        <span> Adults + Children : ' . ($rows[0]['num_adults'] + $rows[0]['num_children']) . ' x </span><span id="cphContent_ucBookingSummary_lblFPrice">&#163;' . $flight_obj['@attributes']['sellpricepp'] . '</span>
								                    </small>
								                    <span style="float:right;">
									                    <small>
									                        <a href="' . base_url() . 'flightsAvailability/' . $this->uri->segment(2) . '" onClick="return Change(' . "'" . $type_s . "'" . ',' . "'" . $cry . "'" . ')" title="Change Flight">Change</a>
									                    </small>
									                </span>
								                </div>			
								              
								            </div>								           
			          					 </div>                     		
			           					 <div class="bg_grey">	
								              <div>
												<div class="left">Atol Protection</div>
									           <div class="right" style="text-align: right;">&#163;' . ($rows[0]['num_adults'] + $rows[0]['num_children']) * 2.5 . '</div>
									          </div>
									           	
									           	<div style="margin-top: 10px;" class="clearfix">
									                 <small>&#163;2.50 x ' . ($rows[0]['num_adults'] + $rows[0]['num_children']) . '</small>
									                 <span style="float:right;">
									                    <small>
									                        <a class="toggle_atol">What\'s this?</a>
									                    </small>
									                </span>
						           			   </div>			        					
								       	</div>
									    <div class="atol_info clearfix" style="display: none;">
											 <div class="clearfix has_bottom_margin hide_mobile hide_tablet">
										           <h4 class="left ">Atol Protection</h4>
										               <a class="right toggle_atol"><small>close</small></a>
										     </div>
											 <div style="clear: both;">
										        <p class="hide_mobile hide_tablet">
										             <strong>With A1 Travel your holiday is protected!</strong><br>
										               A1Travel hold ATOL license 5287 and we are full ABTA members.
										       </p>
											   <small>
										         <p>
										             All of our Flight Plus Holidays are financially protected by the ATOL scheme.<br>
										             A Flight Plus Holiday is where you purchase through us, at the same time or within a day of each other, a flight plus overseas accommodation and / or car hire from separate Travel Suppliers and as separate bookings (i.e. not a package holiday)
										         </p>
										         <p>
										           On all Flight Plus Holiday bookings, your money is ATOL protected. This means you will be able to continue with your holiday or suitable alternative holiday (at no extra cost) or receive a refund of the amount paid to us in the unlikely event of our insolvency or the insolvency of one or more of your service Travel Suppliers
										         </p>
												 <p> When you book with us, we will send you an ATOL confirmation invoice that provides you with all the information you will need about your ATOL protection
										          </p>
										       </small>
										     </div>
										 </div>
									     <div class="bg_grey" style="margin-bottom:10px;">	
								              <div>
												<div class="left">Total</div>
									           <div class="right" style="text-align: right;">&#163;' . (($rows[0]['num_adults'] + $rows[0]['num_children']) * $flight_obj['@attributes']['sellpricepp'] + ($rows[0]['num_adults'] + $rows[0]['num_children']) * 2.5) . '</div>
									          </div>									           	
									          <div style="margin-top: 10px;" class="clearfix">									                 
									                 <span style="float:right;">
									                    <small>Per Person: ' . ($rows[0]['num_adults'] + $rows[0]['num_children']) * $flight_obj['@attributes']['sellpricepp'] / ($rows[0]['num_adults'] + $rows[0]['num_children']) . ' X ' . ($rows[0]['num_adults'] + $rows[0]['num_children']) . '</small>
									                </span>
						           			   </div>			        					
								       	</div>';
                /**************end*******************************/
                $data['type'] = 'pack_hotel';
                $this->layouts->add_include(array('css/bootstrap-responsive.min.css', 'css/jquery-ui.css', 'css/font-awesome.min.css', 'css/google_font.css', 'css/custom.css', 'css/responsive.css', 'css/inner-page.css', 'css/menu.css', 'css/bxslider/jquery.bxslider.css', 'css/jquery.fancybox.css', 'css/popup_fancy.css', 'css/customeffects.css', 'js/jquery-ui.js', 'js/jquery.blockUI.js', 'js/responsee.js', 'js/responsiveslides.min.js', 'js/bxslider/jquery.bxslider.js', 'js/jquery.fancybox.pack.js', 'js/script-hotels.js'));
                //$this->layouts->add_include(array('css/bootstrap-responsive.min.css','css/jquery-ui.css','css/font-awesome.min.css','css/google_font.css','css/custom.css','css/responsive.css','css/inner-page.css','css/menu.css','css/bxslider/jquery.bxslider.css','css/flight_result.css','js/jquery-ui.js','js/jquery.blockUI.js','js/responsee.js','js/responsiveslides.min.js','js/bxslider/jquery.bxslider.js','js/script-hotels.js'));
                $this->layouts->set_title('Available Hotels');
                //For change search poopulations
                $departures = new SimpleXMLElement($this->download_page('http://87.102.127.86:8005/search/websearch.exe?pageid=1&compid=1'));
                foreach ($departures as $departure) {
                    $code = (array) $departure->attributes()->code;
                    $name = (array) $departure->attributes()->name;
                    $data['filtered_departures'] = seperatorFlights($code[0], $name[0]);
                    $data['departures'][$code[0]] = $name[0];
                }
                $parts = parse_url($myser_URL);
                parse_str($parts['query'], $query);
                $data['change_search_info']['query'] = $query;
                $data['change_search_info']['row'] = $rows[0];
                $data['controller'] = $this;
                $data['fcls'] = 'done';
                $data['hcls'] = 'current';
                $data['ecls'] = '';
                $data['bcls'] = '';
                $data['f_done'] = 'done';
                $data['h_done'] = '';
                $data['e_done'] = '';
                $data['b_done'] = '';
                //End
                $this->layouts->view('available_hotels_view', $data);
            } else {
                redirect(base_url());
            }
        }
    }
コード例 #4
0
ファイル: Welcome.php プロジェクト: bogiesoft/bookitnow
 public function loadFlightDataFun($service_url, $u_selected_date, $row)
 {
     $data = array();
     $results = array();
     $results['controller'] = $this;
     $results['suppliers_list'] = dept_images();
     //$this->cache->delete($service_url);
     $count = 0;
     $flex = 3;
     $results['departures'] = $this->fetch_departures();
     $results['arrivals'] = $this->fetch_arrivals();
     // Future To-do :  Here Please check weather "selected_date" should more than current date otherwise 404 page
     $req_url = $service_url;
     $data['results'] = new SimpleXMLElement($this->download_page($req_url));
     $search_dates = array();
     $best_price = 0;
     //if(empty($this->cache->get($service_url)))
     //{
     if ($data['results']->attributes()->offers > 0) {
         $coded_date = json_decode(json_encode($data['results']), true);
         $this->search_upto_flex_days($coded_date, $u_selected_date, $flex, $search_dates);
         $search_dates[$u_selected_date]['offers_list'] = $coded_date['offer'];
         if ($cdate_bp = $this->best_price_date_wise_fun($coded_date['offer'])) {
             $search_dates[$u_selected_date]['best_price'] = $cdate_bp;
         }
     } else {
         redirect(base_url());
     }
     //	$this->cache->save($service_url,$search_dates, 3600);
     //}
     //else{
     //	$search_dates = $this->cache->get($service_url);
     //}
     $list_min = array_column($search_dates, 'best_price');
     if (!empty($list_min)) {
         $best_price = min($list_min);
         $results['dates_list'] = array_keys($search_dates);
         usort($results['dates_list'], array($this, "sortFunction"));
         $count = 0;
         //Variables
         $dept_take_offs = array();
         $return_take_offs = array();
         $results['fly_from'] = array();
         $results['flight_operators'] = array();
         //End - Varibles
         foreach ($search_dates as $key_date => $value_date) {
             if (@$value_date['best_price'] == $best_price && $count < 1) {
                 //Sort by best price
                 usort($search_dates[$key_date]['offers_list'], function ($a, $b) {
                     return $a['@attributes']['sellpricepp'] > $b['@attributes']['sellpricepp'] ? 1 : -1;
                 });
                 //END - Sort by best price
                 $results['flights_list'] = $search_dates[$key_date];
                 $results['selected_date'] = $key_date;
                 $count++;
             }
             if (!empty(@$value_date['offers_list'])) {
                 foreach ($value_date['offers_list'] as $offer) {
                     //$flight_suppliers[$offer['@attributes']['suppname']] = $offer['@attributes']['suppcode'];
                     $dept_take_offs[] = (int) substr(explode(' ', $offer['@attributes']['outdep'])[1], 0, 2);
                     $return_take_offs[] = (int) substr(explode(' ', $offer['@attributes']['indep'])[1], 0, 2);
                     // Listing departure airport list
                     if (!in_array($offer['@attributes']['depapt'], $results['fly_from'])) {
                         $results['fly_from'][$offer['@attributes']['depapt']] = explode(' - ', $results['departures'][$offer['@attributes']['depapt']])[0];
                         $results['fly_from_best_prices'][$offer['@attributes']['depapt']] = $value_date['best_price'];
                     }
                     // END - Listing departure airport list
                     // Listing flight operator list
                     if (!in_array($offer['@attributes']['suppcode'], $results['flight_operators'])) {
                         $results['flight_operators'][$offer['@attributes']['suppcode']] = $results['suppliers_list'][$offer['@attributes']['suppcode']];
                     }
                     // END - Listing flight operator list
                 }
                 $results['num_of_flights'][$key_date] = count(@$value_date['offers_list']);
                 $results['best_prices_dates_wise'][$key_date] = '&#163;' . @$value_date['best_price'];
             } else {
                 $results['num_of_flights'][$key_date] = 0;
                 $results['best_prices_dates_wise'][$key_date] = '&#163;N/A';
             }
         }
         // Filter populators
         $results['dept_take_offs_min'] = min($dept_take_offs);
         $results['dept_take_offs_max'] = max($dept_take_offs) + 1;
         // Remember : Take a look while max gretaer than 23 hours
         $results['return_take_offs_min'] = min($return_take_offs);
         $results['return_take_offs_max'] = max($return_take_offs) + 1;
         //END - Filter Populators
         //	print_r($results);exit;
         if (!$count) {
             $results['flights_list'] = $search_dates[$u_selected_date];
             $results['selected_date'] = $u_selected_date;
         }
         $parts = parse_url($service_url);
         parse_str($parts['query'], $query);
         $results['change_search_info']['query'] = $query;
         $results['change_search_info']['row'] = $row[0];
         $results['fcls'] = 'current';
         $results['hcls'] = '';
         $results['ecls'] = '';
         $results['bcls'] = '';
         $results['f_done'] = '';
         $results['h_done'] = '';
         $results['e_done'] = '';
         $results['b_done'] = '';
         /************fetching departure airports**************/
         changeSearch($results);
         /******************end***********/
         $this->layouts->add_include(array('css/importers/home.css', 'css/flight_result.css', 'css/style.css', 'js/compressed/JCkJUiJBUiResJBx.min.js', 'js/script.js'));
         /*$this->layouts->add_include(array('css/bootstrap-responsive.min.css',
         		'css/jquery-ui.css','css/font-awesome.min.css',
         		'css/google_font.css','css/custom.css','css/responsive.css',
         		'css/menu.css','css/preview.min.css','css/bxslider/jquery.bxslider.css',
         		'css/flight_result.css','css/jquery.fancybox.css','css/style.css','css/popup_fancy.css',
         		'js/jquery-ui.js','js/jquery.blockUI.js','js/responsee.js',
         		'js/responsiveslides.min.js','js/bxslider/jquery.bxslider.js',
         		'js/jquery.fancybox.pack.js','js/script.js'));*/
         $this->layouts->set_title('Search Page');
         $this->layouts->view('available_flights_view1', $results);
     } else {
         redirect(base_url());
     }
 }