コード例 #1
0
ファイル: common_helper.php プロジェクト: bogiesoft/bookitnow
function boookattach($results, $type = '')
{
    // Include the main TCPDF library (search for installation path).
    //require_once('tcpdf/examples/tcpdf_include.php');
    $pdf = new MYPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'utf-8', false);
    //$pdf->Footer('hello');
    // create new PDF document
    //$pdf = new TCPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false);
    // set document information
    $pdf->SetCreator(PDF_CREATOR);
    //$pdf->SetAuthor('Nicola Asuni');
    //$pdf->SetTitle('TCPDF Example 001');
    //$pdf->SetSubject('<h1>TCPDF Tutorial</h1>');
    //$pdf->SetKeywords('TCPDF, PDF, example, test, guide');
    // set default header data
    //$pdf->SetHeaderData(PDF_HEADER_LOGO, PDF_HEADER_LOGO_WIDTH, PDF_HEADER_TITLE.' 001', PDF_HEADER_STRING, array(0,64,255), array(0,64,128));
    //$pdf->SetHeaderData(PDF_HEADER_LOGO, PDF_HEADER_LOGO_WIDTH, '<div style="float:right">haoooooooo</div>', PDF_HEADER_STRING, array(0,64,255), array(0,64,128));
    $pdf->setFooterData(array(0, 64, 0), array(0, 64, 128));
    // set header and footer fonts
    $pdf->setHeaderFont(array(PDF_FONT_NAME_MAIN, '', PDF_FONT_SIZE_MAIN));
    $pdf->setFooterFont(array(PDF_FONT_NAME_DATA, '', PDF_FONT_SIZE_DATA));
    // set default monospaced font
    $pdf->SetDefaultMonospacedFont(PDF_FONT_MONOSPACED);
    // set margins
    $pdf->SetMargins(PDF_MARGIN_LEFT, PDF_MARGIN_TOP, PDF_MARGIN_RIGHT);
    $pdf->SetHeaderMargin(PDF_MARGIN_HEADER);
    $pdf->SetFooterMargin(20);
    //echo PDF_MARGIN_FOOTER;exit;
    // set auto page breaks
    $pdf->SetAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM);
    // set image scale factor
    $pdf->setImageScale(PDF_IMAGE_SCALE_RATIO);
    // set some language-dependent strings (optional)
    if (@file_exists(dirname(__FILE__) . '/lang/eng.php')) {
        require_once dirname(__FILE__) . '/lang/eng.php';
        $pdf->setLanguageArray($l);
    }
    // ---------------------------------------------------------
    // set default font subsetting mode
    $pdf->setFontSubsetting(true);
    // Set font
    // dejavusans is a UTF-8 Unicode font, if you only need to
    // print standard ASCII chars, you can use core fonts like
    // helvetica or times to reduce file size.
    //$pdf->SetFont('dejavusans', '', 10, '', true);
    $pdf->SetFont('Helvetica', '', 10, '', 'false');
    // Add a page
    // This method has several options, check the source code documentation for more information.
    $pdf->AddPage();
    // set text shadow effect
    $pdf->setTextShadow(array('enabled' => true, 'depth_w' => 1, 'depth_h' => 0.2, 'color' => array(196, 196, 196), 'opacity' => 0, 'blend_mode' => 'Normal'));
    // Set some content to print
    $tbl = '<br /><br/><br/><br/>	
<table border="0" cellpadding="2" cellspacing="2" nobr="true">
 
 <tr>
  <td style="width:60%"><b>Your Personal Travel Advisor:</b>' . @$results['pdfdata']['adviser_info']['name'] . '</td>
  <td style="width:40%"><b>Quote Reference:</b>' . @$results['pdfdata']['adviser_info']['reference'] . '</td>
 </tr>
 <tr>  
  <td style="width:60%"><b>Phone Number:</b>' . @$results['pdfdata']['adviser_info']['phone'] . '</td>
  <td style="width:40%"><b>Date:</b> ' . @$results['pdfdata']['adviser_info']['date'] . '</td> 
 </tr>
 <tr>
  <td style="width:60%"><b>Email Address:</b>' . @$results['pdfdata']['adviser_info']['email'] . '</td>
  <td style="width:40%"><b>Adults:</b> ' . @$results['seg'][0]['num_adults'] . ' <b>Children:</b> ' . @$results['seg'][0]['num_children'] . '</td>  
 </tr>
</table>';
    $pdf->writeHTML($tbl, true, false, false, false, '');
    //$ci = $results['controller'];
    $t = json_decode($results['row'][0]['adults_info'], true);
    $tbl = '
<div>
	<span>Dear ' . $t['fname'][0] . '</span>
	</br>
	<p>
		I have pleasure in enclosing a quote in respect of your recent enquiry with Super Escapes. Please feel free to contact us, should you need any more information or advice.
	</p>
</div>';
    $pdf->writeHTML($tbl, true, false, false, false, '');
    if (isset($results['fobj'])) {
        $depts = fetch_departures();
        $arrivs = fetch_arrivals();
        $dep_arr = explode('-', $depts[$results['fobj']['@attributes']['depapt']]);
        $arr_arr = explode('-', $arrivs[$results['fobj']['@attributes']['arrapt']]);
        $ret_arr = explode('-', $depts[$results['fobj']['@attributes']['retapt']]);
        $dept_start_time = substr(explode(' ', $results['fobj']['@attributes']['outdep'])[1], 0, -3);
        $dept_arr_time = substr(explode(' ', $results['fobj']['@attributes']['outarr'])[1], 0, -3);
        $return_start_time = substr(explode(' ', $results['fobj']['@attributes']['indep'])[1], 0, -3);
        $return_arr_time = substr(explode(' ', $results['fobj']['@attributes']['inarr'])[1], 0, -3);
        $tbl = '
<b><u>Flight Details : </u></b><br><br>  
<table border="0" cellpadding="2" cellspacing="2" nobr="true">
	<tr>
		<th style="width:35%;text-align:center;font-weight:bold;">Route</th>
		<td style="width:13%;text-align:center;font-weight:bold;">Dep Date</td>
		<td style="width:13%;text-align:center;font-weight:bold;">Dep Time</td>
		<td style="width:13%;text-align:center;font-weight:bold;">Arr Date</td>
		<td style="width:13%;text-align:center;font-weight:bold;">Arr Time</td>
		<td style="width:13%;text-align:center;font-weight:bold;">Flight No</td>
	</tr>
    <tr>
        <td >' . current($dep_arr) . ' Airport ' . array_pop($arr_arr) . ' Airport</td>
        <td>' . explode(' ', $results['fobj']['@attributes']['outdep'])[0] . '</td>
		<td>' . $dept_start_time . '</td>
		<td>' . explode(' ', $results['fobj']['@attributes']['outarr'])[0] . '</td>
		<td>' . $dept_arr_time . '</td>
		<td>' . $results['fobj']['@attributes']['outfltnum'] . '</td>
    </tr>
    <tr>
         <td >' . array_pop($arr_arr) . ' Airport ' . current($ret_arr) . ' Airport</td>
		<td>' . explode(' ', $results['fobj']['@attributes']['indep'])[0] . '</td>    	
		<td>' . $return_start_time . '</td>
		<td>' . explode(' ', $results['fobj']['@attributes']['inarr'])[0] . '</td>
		<td>' . $return_arr_time . '</td>
		<td>' . $results['fobj']['@attributes']['infltnum'] . '</td>
    </tr>  
</table>';
        $pdf->writeHTML($tbl, true, false, false, false, '');
    }
    $ci = $results['controller'];
    if (!empty($results['hobjs'])) {
        $tbl = '
<b><u>Accommodation Details: </u></b><br><br>  
<table border="0" cellpadding="2" cellspacing="2" nobr="true">
	<tr>
		<th style="text-align:center;font-weight:bold;">Hotel</th>
		<td style="text-align:center;font-weight:bold;">Resort</td>
		<td style="text-align:center;font-weight:bold;">Board</td>
		<td style="text-align:center;font-weight:bold;">Room</td>
		<td style="text-align:center;font-weight:bold;">Rating</td>		
	</tr>
    <tr>
        <td style="text-align:center;">' . urldecode($results['hobjs'][0]['@attributes']['hotelname']) . '</td>
        <td style="text-align:center;">' . urldecode($results['hobjs'][0]['@attributes']['resort']) . '</td>
		<td style="text-align:center;">' . boardbasis($results['hobjs'][0]['@attributes']['boardbasis']) . '</td>
		<td style="text-align:center;">' . $results['seg'][0]['num_rooms'] . ' ' . $results['hobjs'][0]['@attributes']['suppname'] . '</td>
		<td style="text-align:center;">' . (int) $results['hobjs'][0]['@attributes']['starrating'] . ' KEY</td>		
    </tr>
    <tr>
		<td style="text-align:center;font-weight:bold;">Check In</td>
    	<td style="text-align:center;font-weight:bold;">Check Out</td>
		<td style="text-align:center;font-weight:bold;">Adults</td>
		<td style="text-align:center;font-weight:bold;">Children</td>
		<td style="text-align:center;font-weight:bold;">Infants</td>
    </tr>
	<tr>
		<td style="text-align:center;">' . $results['hobjs'][0]['@attributes']['checkindate'] . '</td>
    	<td style="text-align:center;">' . date('d/m/Y', strtotime('+' . $results['hobjs'][0]['@attributes']['nights'] . " day", $ci->cvtDt(str_date($results['hobjs'][0]['@attributes']['checkindate'])))) . '</td>
		<td style="text-align:center;">' . @$results['seg'][0]['num_adults'] . '</td>
		<td style="text-align:center;">' . @$results['seg'][0]['num_children'] . '</td>
		<td style="text-align:center;"></td>
    </tr>	
</table>';
        $pdf->writeHTML($tbl, true, false, false, false, '');
    }
    $tbl = <<<EOD
<div style="margin-top:20px;">
\t<b><u>Price Summary:</u></p>\t
\t<p>
\t\tThe total price inclusive of any discounts for the holiday described above is: £653.92 To make a firm reservation please call us on 01386298033 and quote the reference number at the top of this quote. Our friendly and experienced travel consultants will be happy to book the above holiday or look for any alternatives that may suit your needs. 
\t</p>
\t<p>\t\t
\t\tMay we take this opportunity of thanking you for your enquiry, and we do hope that we are able to assist you in fulfilling your requirements.
\t</p>
</div>
EOD;
    $pdf->writeHTML($tbl, true, false, false, false, '');
    $tbl = <<<EOD
<div style="margin-top:20px;text-align:center;">\t
\t<small>
\t\t* All costings are subject to a final confirmation which will be given upon making a firm reservation *
\t</small>
</div><br/><br/>
EOD;
    $pdf->writeHTML($tbl, true, false, false, false, '');
    /*$tbl = '
    <div style="margin-top:20px;width:100%;display:inline-flex;">	
    	<div style="color:blue;text-align:center;width:60%">BookItNow Travel is a trading name of broadway Travel Services (Wimbledon) Ltd. Whose registered office is at Unit 1,Finway,Dallow Road,Luton,Beds LUI 1WE</div>
    	<div> <img src="'.base_url().'/images/abta.png"/></div>
    </div>';
    $pdf->writeHTML($tbl, true, false, false, false, '');*/
    //echo $tbl;exit;
    $tbl = '
<div style="margin-top:20px;">
	<span>Yours sincerely</span>
	<p>' . @$results['pdfdata']['adviser_info']['name'] . '</p>
</div>';
    $pdf->writeHTML($tbl, true, false, false, false, '');
    if (!empty($results['hobjs'])) {
        // $hotel_meta = new SimpleXMLElement(download_page('http://87.102.127.86:8005/search/websearch.exe?pageid=7&compid=1&brochurecode=BEWE-AMTSES1CO0'));
        $hotel_meta = new SimpleXMLElement(download_page('http://87.102.127.86:8005/search/websearch.exe?pageid=7&compid=1&brochurecode=' . $results['hobjs'][0]['@attributes']['brocode']));
        $i = 1;
        $desc = urldecode($hotel_meta->HotelDescription);
        $ty = new tidy();
        $desc = $ty->repairString($desc);
        $tbl = '<br /><br/><br/><br/><h2 style="text-align:center; "pagebreak="true">Accommodation Info</h2><table>';
        foreach ($hotel_meta->Images->Url as $img) {
            $tbl .= '<tr>';
            //Allow_url_fopen must be On
            if (is_array(@getimagesize(urldecode($img)))) {
                $tbl .= '<td colspan="1"  style="margin-right: 30px !important;"><img src="' . urldecode($img) . '" /></td>';
            } else {
                $tbl .= '<td colspan="3"><img src="' . base_url() . '/images/destination_placeholder.jpg"/></td>';
            }
            $tbl .= '<td colspan="1"></td>';
            if ($i == 1) {
                $tbl .= '<td rowspan="' . count($hotel_meta->Images->Url) . '" colspan="8">' . $desc . '</td>';
            }
            $tbl .= '</tr>';
            //$tbl .= '<style>.desc{background:red;}</style>';
            $i++;
        }
        $tbl .= '</table>';
        //echo $tbl;exit;
        $pdf->writeHTML($tbl, true, false, false, false, '');
    }
    // ---------------------------------------------------------
    // Close and output PDF document
    // This method has several options, check the source code documentation for more information.
    //$pdf->Output('D:\xampp\htdocs\test_plugins\tcpdf\examples\example_001.pdf', 'F');
    if ($type == 'email') {
        $pdf->Output(getcwd() . '/booking_files/' . $results['pdfdata']['adviser_info']['reference'] . '.pdf', 'F');
        if (file_exists(getcwd() . '/booking_files/' . $results['pdfdata']['adviser_info']['reference'] . '.pdf')) {
            $subject = 'Quick Quote Ref: ' . $results['pdfdata']['adviser_info']['reference'] . ' - Book it now';
            $body = 'Dear ' . $t['fname'][0];
            $body .= '<p></p>';
            $body .= '<p>Please find the attached document</p>';
            $body .= '<p></p>';
            $body .= '<p>Cheers</p>';
            $body .= '<p>BootItNow</p>';
            $from = '*****@*****.**';
            $sendername = "BookItNow Admin";
            $list = array($results['row'][0]['email']);
            $config['protocol'] = "smtp";
            $config['smtp_host'] = 'mail.expertwebworx.in';
            $config['smtp_port'] = '25';
            $config['smtp_user'] = '******';
            $config['smtp_pass'] = '******';
            $config['smtp_crypto'] = 'tls';
            $config['charset'] = "iso-8859-1";
            $config['mailtype'] = "html";
            $ci->load->library('email', $config);
            $ci->email->set_newline("\r\n");
            $ci->email->from($from, $sendername);
            $ci->email->to($list);
            $ci->email->reply_to($from, $sendername);
            $ci->email->subject($subject);
            $ci->email->attach(getcwd() . '/booking_files/' . $results['pdfdata']['adviser_info']['reference'] . '.pdf');
            $ci->email->message($body);
            if ($ci->email->send()) {
            }
        }
    } else {
        $pdf->Output($results['pdfdata']['adviser_info']['reference'] . '.pdf', 'D');
        exit;
    }
    //============================================================+
    // END OF FILE
    //============================================================+
}
コード例 #2
0
ファイル: Welcome.php プロジェクト: bogiesoft/bookitnow
    public function filter_given_content_fun($response, $type, $page, $crypt = null)
    {
        $result = array();
        $html = '';
        $pageHtml = '';
        $start = ($page - 1) * 10 - 1;
        $start = $start < 0 ? 0 : $start;
        $departures = fetch_departures();
        $arrivals = fetch_arrivals();
        $suppliers_list = array('AVRO' => '/images/AVROF.gif', 'EJET' => '/images/EASYJET.gif', 'NFFT' => '/images/NORWAIR.jpg', 'MNFT' => '/images/FLYM.gif', 'EJFT' => '/images/AVROF.gif', 'MONA' => '/images/FLYM.gif', 'MNNF' => '/images/MNNF.gif', 'NORW' => '/images/NORWAIR.jpg', 'EJNF' => '/images/EJNF.gif', 'FLTH' => '/images/THOMASCOOK.png', 'TFFT' => '/images/THOMSON.gif', 'FTNF' => '/images/FTNF.gif', 'TFNF' => '/images/TFNF.gif', 'THFL' => '/images/THFL.gif', 'TOHO' => '/images/TOHO.gif', 'RYAT' => '/images/logo_ryan_txt.png', 'JET2' => '/images/JET2.gif', 'AERL' => '/images/AERL.gif', 'EJTF' => '/images/EJTF.gif', 'NFTF' => '/images/NFTF.gif');
        //ordering keys
        if (!empty($response)) {
            $iOne = array_combine(range(0, count($response) - 1), array_values($response));
        }
        //END -  Ordeing keys
        for ($i = $start; $i < $start + 10; $i++) {
            if (isset($iOne[$i])) {
                $flight_obj = $iOne[$i];
                $plain_txt = json_encode($flight_obj);
                $encrypted_txt = $this->encrypt_decrypt('encrypt', $plain_txt);
                $dscode = $flight_obj['@attributes']['depapt'];
                $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]);
                $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);
                $html .= '<div id="divShowWhenSelect_1" class="flightresult">
				                      <div class="clearfix">
				                    	<div class="flight_info clearfix">
				                          <div class="flight_depart"> <strong class="txt_color_2"><i class="fa fa-plane icon_flightdepart" aria-hidden="true"></i><h3 class="fl_dep_ret">Depart</h3></strong><br>
				                       	 	<div><!-- <img  src="' . @$suppliers_list[$flight_obj['@attributes']['suppcode']] . '" style="border: 0;">-->
				                              <div style="float: right"> </div>
				                            </div>
				                        	<strong style="font-size: 16px;color: #114C6F;">' . date('l d M Y', $this->cvtDt($flight_obj['@attributes']['outdep'])) . '</strong><br>				                        	
				                       		<small>' . $dscode . ' to ' . $ascode . ' ' . $dept_start_time . '/' . $dept_arr_time . '</small><br>
				                        	<span class="txt_color_2"> </span> </div>
				                          	<div class="flight_return"> <strong class="txt_color_2"><i class="fa fa-plane icon_flightreturn" aria-hidden="true"></i><h3 class="fl_dep_ret">Return</h3></strong><br>
				                        		<div> <!--<img src="' . @$suppliers_list[$flight_obj['@attributes']['suppcode']] . '" style="border: 0;">--> </div>
						                        <strong style="font-size: 16px;color: #114C6F;">' . date('l d M Y', $this->cvtDt($flight_obj['@attributes']['indep'])) . '</strong><br>
						                        <small>' . $ascode . ' to ' . $dscode . ' ' . $return_start_time . '/' . $return_arr_time . '</small><br>
						                        <span class="txt_color_2"> </span>
						                    </div>
				                          	<div class="clear flight_bags">
				                        		<small> <span ></span> </small>
				                      		</div>
				                          </div>
						                  <div class="fluid flight_price clearfix">
						                          <div class="flight_cost"> <strong class="txt_color_1 txt_large"> <span id="cphContent_lvDatePlus3_lblTotalPrice_0">&#163;' . $flight_obj['@attributes']['sellpricepp'] . '</span></strong><small class="txt_color_1">pp</small><br>
						                        <small> <span class="luggage_label"></span> </small> </div>
						                          <div class="flight_button center"> <span></span> <a  class="button"  style="margin-top: 5px;" onclick=Addflight("' . $type . '","' . $encrypted_txt . '","' . $crypt . '")>ADD <i class="fa fa-plus-circle" aria-hidden="true"></i> </a> </div>
						                        </div>
						                  </div>
				                   </div>';
                //onclick=Addflight("'.$type.'","'.$encrypted_txt.'","'.$crypt.'")
            }
        }
        $result['status'] = 'success';
        if (!empty($response)) {
            $res_count = count($response);
            if (($type == 'flight_date' || $type == 'full_flight_date') && $res_count > 10) {
                $num_pages = $res_count % 10 ? $res_count / 10 + 1 : $res_count / 10;
                $pageHtml .= '<span>Page: </span><span  class="pager_list_pages">';
                //	$pageHtml .= '<a class="aspNetDisabled">&lt;</a>&nbsp;';
                for ($i = 1; $i <= $num_pages; $i++) {
                    if ($i == $page) {
                        $pageHtml .= '<span>' . $i . '</span>';
                    } else {
                        $pageHtml .= '<a class="pagerhyperlink">' . $i . '</a>';
                    }
                }
                //$pageHtml .= '<a class="pagerhyperlink">&gt;</a>&nbsp;';
                $pageHtml .= '</span>';
            }
        } else {
            $html .= '<div> <strong class="txt_color_2">Sorry! No Flights Available</strong><br> Please select an alternative date
                      </div>';
        }
        $result['data'] = $html;
        $result['pages_data'] = $pageHtml;
        return $result;
    }
コード例 #3
0
ファイル: Admin.php プロジェクト: bogiesoft/bookitnow
 public function view_booking($id = null)
 {
     $data = array();
     $data['controller'] = $this;
     $data['active_tab_var'] = 'booking';
     $this->load->model('Bookinginfo');
     $this->load->model('UserSearch');
     $data['departures'] = fetch_departures();
     $data['arrivals'] = fetch_arrivals();
     $data['row'] = $this->Bookinginfo->fetch_a_search(array('reference_id' => $id));
     if (empty($data['row'])) {
         redirect(base_url() . 'admin/booking_info');
     }
     if ($data['row'][0]['type_search'] == 'hotel_only') {
         $data['seg'] = $this->UserSearch->fetch_a_search(array('id' => $data['row'][0]['base_id']));
         $data['hobjs'] = json_decode($data['seg'][0]['pack_info'], true);
     } else {
         if ($data['row'][0]['type_search'] == 'flight_only') {
             $data['seg'] = $this->UserSearch->fetch_a_search(array('id' => $data['row'][0]['base_id']));
             $data['fobj'] = json_decode($data['seg'][0]['pack_info'], true);
             $data['flit'][0]['flight_selected_date'] = explode(' ', $data['fobj']['@attributes']['outdep'])[0];
         } else {
             $this->load->model('FullSearch');
             //	$this->serachInfo($data['row'][0]['base_id'])
             //echo  $data['row'][0]['base_id'];exit;
             $data['seg'] = $this->FullSearch->fetch_a_search(array('id' => $data['row'][0]['base_id']));
             if (!empty($data['seg'])) {
                 $this->load->model('PhaseFlightOrHotel');
                 $this->load->model('AlLugagePrice');
                 $this->load->model('SavingsNExtFields');
                 $this->load->model('PhaseSavingsNExtras');
                 $data['flit'] = $this->PhaseFlightOrHotel->fetch_a_search(array('type_search' => 'full_flight_date', 'full_pack_id' => $data['seg'][0]['id']));
                 $data['hotel'] = $this->PhaseFlightOrHotel->fetch_a_search(array('type_search' => 'pack_hotel', 'full_pack_id' => $data['seg'][0]['id']));
                 if (empty($data['flit']) || empty($data['hotel'])) {
                     redirect(base_url());
                 }
                 $data['fobj'] = json_decode($data['flit'][0]['pack_info'], true);
                 $data['lug_row'] = $this->AlLugagePrice->fetch_a_search(array('airline_code' => $data['fobj']['@attributes']['suppcode']));
                 $data['hobjs'] = json_decode($data['hotel'][0]['pack_info'], true);
                 $tot_sel = 0;
                 $data['departures'] = fetch_departures();
                 $data['arrivals'] = fetch_arrivals();
                 $data['ext_row'] = $this->PhaseSavingsNExtras->fetch_a_search(array('full_pack_id' => $data['seg'][0]['id']));
             } else {
                 redirect(base_url() . 'admin/booking_info');
             }
         }
     }
     if ($this->input->post()) {
         $this->form_validation->set_rules('adult_fname');
         $this->form_validation->set_rules('adult_lname');
         $this->form_validation->set_rules('email');
         $this->form_validation->set_rules('mobile');
     }
     $this->layouts->set_title('Admin Dashboard');
     $this->layouts->view('view_booking.php', $data, 'admin');
 }