Esempio n. 1
0
    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());
            }
        }
    }
Esempio n. 2
0
 public function dynamicDeals()
 {
     //echo "<pre>";print_r('asdf');exit;
     $data = array();
     //$this->load->model('ManagerChoices');
     //$manager_deals = $this->ManagerChoices->fetch_a_search(array('deal_category'=>$_GET['type']),'ALL');
     $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/jquery.fancybox.css', 'css/mamaison.css', 'css/tenerife-holidays.css', 'css/slideshow.css', 'js/jquery-ui.js', 'js/jquery.blockUI.js', 'js/responsee.js', 'js/bxslider/jquery.bxslider.js', 'js/jquery.fancybox.pack.js', 'js/gallery.js', 'js/script-home.js'));
     for ($i = 0; $i < 12; $i++) {
         $data['calendar']['months'][date('m-Y', strtotime('+' . $i . ' month'))] = date('M Y', strtotime('+' . $i . ' month'));
     }
     $departures = new SimpleXMLElement(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['calendar']['filtered_departures'] = seperatorFlights($code[0], $name[0]);
     }
     $input_cal_info = array('month_cal' => date('m') . '-' . date('Y'));
     $data['calendar']['datesInfo'] = $this->loadDates($input_cal_info);
     $data['calendar']['nights_limit'] = 21;
     $data['calendar']['book_types'] = array('fh' => 'Flights & Hotel', 'h' => 'Just Hotel', 'f' => 'Just Flight');
     $this->layouts->set_title('Home');
     $this->layouts->view('deals/dynamicDeals', $data);
 }
Esempio n. 3
0
    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());
        }
    }
Esempio n. 4
0
function changeSearch(&$data)
{
    $results['departures'] = new SimpleXMLElement(download_page('http://87.102.127.86:8005/search/websearch.exe?pageid=1&compid=1'));
    foreach ($results['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];
    }
    /*if ( ! $foo = $this->cache->get('departures'))
     	{
     		$foo = $data['departures'];
     		// Save into the cache for 60 minutes
     		$this->cache->save('departures', $foo, 3600);
     	}*/
}