<?php

$sessionid='a1'.session_id();

$apiKey="1e1c0a7b9491a4s45238591099254058f9";

$apiBaseUrl='https://www.globallimos.com';

$fromName='Limo Service Concord';

$fromEmail='info@limoserviceconcord.com';

$time=date('Ymdhis');

$website='limoserviceconcord.com';

$ipaddress=$_SERVER['REMOTE_ADDR'];



function fnGetSearchService($serviceid,$services_id_B){

	?>

	 <optgroup label="Most Popular:">

		<option value="1000" <? if($serviceid==1000){?> selected="selected"<? }?>>To Airport</option>

		<option value="1001" <? if($serviceid==1001){?> selected="selected"<? }?>>From Airport</option>

		<option value="1002" <? if($serviceid==1002){?> selected="selected"<? }?>>Point-to-Point (one-way)</option>

		<option value="1003" <? if($serviceid==1003){?> selected="selected"<? }?>>Just Drive (hourly)</option>

    </optgroup>

    <optgroup label="Special Occasions:">

		<option value="27" <? if($serviceid==27){?> selected="selected"<? }?>>Prom / School Event</option>

		<option value="25" <? if($serviceid==25){?> selected="selected"<? }?>>Wedding</option>

		<option value="24" <? if($serviceid==24){?> selected="selected"<? }?>>Birthday and Anniversary</option>

		<option value="3" <? if($serviceid==3){?> selected="selected"<? }?>>Night On The Town</option>

		<option value="12" <? if($serviceid==12){?> selected="selected"<? }?>>Concert / Sporting Events</option>

		<option value="11" <? if($serviceid==11){?> selected="selected"<? }?>>Bachelor (ette) Party</option>

		<option value="10" <? if($serviceid==10){?> selected="selected"<? }?>>Executive & Corporate</option>

		<option value="7" <? if($serviceid==7){?> selected="selected"<? }?>>Wine Tours</option>

		<option value="30" <? if($serviceid==30){?> selected="selected"<? }?>>To & From Sea-Port</option>

		<option value="31" <? if($serviceid==31){?> selected="selected"<? }?>>Funeral</option>	

    </optgroup>

	<?

}



function fnGetSearchTime($stime){

	?>

	<option value="01" <? if($stime=='01'){?> selected="selected"<? }?>>01 AM </option> 

    <option value="02" <? if($stime=='02'){?> selected="selected"<? }?>>02 AM </option> 

    <option value="03" <? if($stime=='03'){?> selected="selected"<? }?>>03 AM </option> 

    <option value="04" <? if($stime=='04'){?> selected="selected"<? }?>>04 AM </option> 

    <option value="05" <? if($stime=='05'){?> selected="selected"<? }?>>05 AM </option> 

    <option value="06" <? if($stime=='06'){?> selected="selected"<? }?>>06 AM </option> 

    <option value="07" <? if($stime=='07'){?> selected="selected"<? }?>>07 AM </option> 

    <option value="08" <? if($stime=='08'){?> selected="selected"<? }?>>08 AM </option> 

    <option value="09" <? if($stime=='09'){?> selected="selected"<? }?>>09 AM </option>

    <option value="10" <? if($stime=='10'){?> selected="selected"<? }?>>10 AM </option> 

    <option value="11" <? if($stime=='11'){?> selected="selected"<? }?>>11 AM </option> 

    <option value="12" <? if($stime=='12'){?> selected="selected"<? }?>>12 Noon</option> 

    <option value="13" <? if($stime=='13'){?> selected="selected"<? }?>>01 PM </option> 

    <option value="14" <? if($stime=='14'){?> selected="selected"<? }?>>02 PM </option> 

    <option value="15" <? if($stime=='15'){?> selected="selected"<? }?>>03 PM </option> 

    <option value="16" <? if($stime=='16'){?> selected="selected"<? }?>>04 PM </option> 

    <option value="17" <? if($stime=='17'){?> selected="selected"<? }?>>05 PM </option> 

    <option value="18" <? if($stime=='18'){?> selected="selected"<? }?>>06 PM </option> 

    <option value="19" <? if($stime=='19'){?> selected="selected"<? }?>>07 PM </option> 

    <option value="20" <? if($stime=='20'){?> selected="selected"<? }?>>08 PM </option> 

    <option value="21" <? if($stime=='21'){?> selected="selected"<? }?>>09 PM </option> 

    <option value="22" <? if($stime=='22'){?> selected="selected"<? }?>>10 PM </option> 

    <option value="23" <? if($stime=='23'){?> selected="selected"<? }?>>11 PM </option> 

    <option value="00" <? if($stime=='00'){?> selected="selected"<? }?>>12 Midnight</option>

	<?

}

function getServiceName($services_id,$services_id_B){

	$rtnStr='';	

	if($services_id==1003){

		$rtnStr='Just Drive (hourly)';

	}elseif($services_id==1000){

		$rtnStr='To Airport';

	}elseif($services_id==1001){

		$rtnStr='From Airport';

	}elseif($services_id==1002){

		$rtnStr='Point-to-Point (one-way)';

	}

	if($services_id_B==0){

		$rtnStr=$rtnStr.' ';

	}elseif($services_id_B==27){

		$rtnStr='Prom / School Event';

	}elseif($services_id_B==25){

		$rtnStr='Wedding';

	}elseif($services_id_B==24){

		$rtnStr=$rtnStr.'Birthday and Anniversary';

	}elseif($services_id_B==3){

		$rtnStr='Night On The Town';

	}elseif($services_id_B==12){

		$rtnStr='Concert / Sporting Events';

	}elseif($services_id_B==11){

		$rtnStr='Bachelor (ette) Party';

	}elseif($services_id_B==10){

		$rtnStr='Executive & Corporate';

	}elseif($services_id_B==7){

		$rtnStr='Wine Tours';

	}elseif($services_id_B==30){

		$rtnStr='To & From Sea-Port';

	}elseif($services_id_B==31){

		$rtnStr='Funeral';

	}

	return $rtnStr;

}

function fnTimeDropDown($dtime){

	?>

	<li>12:00 Am</li>

    <li>12:30 Am</li>

    <li>01:00 Am</li>

    <li>01:30 Am</li>

    <li>02:00 Am</li>

    <li>02:30 am</li>

          <li>03:00 am</li>

          <li>03:30 am</li>

          <li>04:00 am</li>

          <li>04:30 am</li>

          <li>05:00 am</li>

          <li>05:30 am</li>

          <li>06:00 am</li>

          <li>06:30 am</li>

          <li>07:00 am</li>

          <li>07:30 am</li>

          <li>08:00 am</li>

          <li>08:30 am</li>

          <li>09:00 am</li>

          <li>09:30 am</li>

          <li>10:00 am</li>

          <li>10:30 am</li>

          <li>11:00 am</li>

          <li>11:30 am</li>

          <li>12:00 Noon</li>

          <li>12:30 pm</li>

          <li>01:00 pm</li>

          <li>01:30 pm</li>

          <li>02:00 pm</li>

          <li>02:30 pm</li>

          <li>03:00 pm</li>

          <li>03:30 pm</li>

          <li>04:00 pm</li>

          <li>04:30 pm</li>

          <li>05:00 pm</li>

          <li>05:30 pm</li>

          <li>06:00 pm</li>

          <li>06:30 pm</li>

          <li>07:00 pm</li>

          <li>07:30 pm</li>

          <li>08:00 pm</li>

          <li>08:30 pm</li>

          <li>09:00 pm</li>

          <li>09:30 pm</li>

          <li>10:00 pm</li>

          <li>10:30 pm</li>

          <li>11:00 pm</li>

          <li>11:30 pm</li>

	<?

}



function fnGetService($serviceid){

	?>

	<option value="27" <? if($serviceid==27){?> selected="selected"<? }?>>Prom / School Event</option>

	<option value="25" <? if($serviceid==25){?> selected="selected"<? }?>>Wedding</option>

	<option value="24" <? if($serviceid==24){?> selected="selected"<? }?>>Birthday and Anniversary</option>

	<option value="3" <? if($serviceid==3){?> selected="selected"<? }?>>Night On The Town</option>

	<option value="12" <? if($serviceid==12){?> selected="selected"<? }?>>Concert / Sporting Events</option>

	<option value="11" <? if($serviceid==11){?> selected="selected"<? }?>>Bachelor (ette) Party</option>

	<option value="10" <? if($serviceid==10){?> selected="selected"<? }?>>Executive & Corporate</option>

	<option value="7" <? if($serviceid==7){?> selected="selected"<? }?>>Wine Tours</option>

	<option value="30" <? if($serviceid==30){?> selected="selected"<? }?>>To & From Sea-Port</option>

	<option value="31" <? if($serviceid==31){?> selected="selected"<? }?>>Funeral</option>	

	<?

}



function fnDdlNumber($fieldid,$noofval){

	?>

	<option value="01" <? if($fieldid=='01'){?> selected="selected"<? }?>>01</option>

	<option value="02" <? if($fieldid=='02'){?> selected="selected"<? }?>>02</option>

	<option value="03" <? if($fieldid=='03'){?> selected="selected"<? }?>>03</option>

	<option value="04" <? if($fieldid=='04'){?> selected="selected"<? }?>>04</option>

	<option value="05" <? if($fieldid=='05'){?> selected="selected"<? }?>>05</option>

	<option value="06" <? if($fieldid=='06'){?> selected="selected"<? }?>>06</option>

	<option value="07" <? if($fieldid=='07'){?> selected="selected"<? }?>>07</option>

	<option value="08" <? if($fieldid=='08'){?> selected="selected"<? }?>>08</option>

	<option value="09" <? if($fieldid=='09'){?> selected="selected"<? }?>>09</option>

	<option value="10" <? if($fieldid=='10'){?> selected="selected"<? }?>>10</option>

	<option value="11" <? if($fieldid=='11'){?> selected="selected"<? }?>>11</option>

	<option value="12" <? if($fieldid=='12'){?> selected="selected"<? }?>>12</option>

	<option value="13" <? if($fieldid=='13'){?> selected="selected"<? }?>>13</option>

	<option value="14" <? if($fieldid=='14'){?> selected="selected"<? }?>>14</option>

	<option value="15" <? if($fieldid=='15'){?> selected="selected"<? }?>>15</option>

	<option value="16" <? if($fieldid=='16'){?> selected="selected"<? }?>>16</option>

	<option value="17" <? if($fieldid=='17'){?> selected="selected"<? }?>>17</option>

	<option value="18" <? if($fieldid=='18'){?> selected="selected"<? }?>>18</option>

	<option value="19" <? if($fieldid=='19'){?> selected="selected"<? }?>>19</option>

	<option value="20" <? if($fieldid=='20'){?> selected="selected"<? }?>>20</option>

	<? if($noofval > 20){?>

	<option value="21" <? if($fieldid=='21'){?> selected="selected"<? }?>>21</option>

	<? }?>

	<?

}



function getGlobalCstID($customers_id){

	global $wpdb;

	$rowD=$wpdb->get_row("SELECT refid FROM customers WHERE customers_id='".$customers_id."'");

	$refid=$rowD->refid;

	return $refid;

}

function GetApiData($apiUrl,$postdata){

	$post = urldecode($postdata);

	$curl = curl_init($apiUrl);

			

	curl_setopt($curl, CURLOPT_POST, true);

	curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);

	curl_setopt($curl, CURLOPT_HTTPAUTH, CURLAUTH_BASIC);

	curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);

	curl_setopt($curl, CURLOPT_USERAGENT , 'Mozilla 5.0');

	curl_setopt($curl, CURLOPT_POSTFIELDS, $post);

	curl_setopt($curl, CURLOPT_VERBOSE , true);			

	$resp = curl_exec($curl);	

	return $resp;

}



function DateForDB($strval){

	$strvalA=explode("/",$strval,3);

	$strval=$strvalA[2].'-'.$strvalA[0].'-'.$strvalA[1];

	return $strval;

}

?>