<?
require 'CONFIG_START.php';
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<HTML>
<HEAD>
<TITLE>Bravacar - Rent a Car - Location</TITLE>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=ISO-8859-1">
<META NAME="Abstract" CONTENT="rent a car  madeira island, car rental lisbon, car rental algarve, car rental porto, car rental online bookings, funchal rent a car, madeira rent a car">
<META NAME="Copyright" CONTENT="Bravacar">
<META NAME="Description" CONTENT="Bravacar - Easy rent a car bookings in Portugal.  Bookings available in Lisbon, Madeira Island, Algarve and Porto.  Customers pay only a small percentage when booking online and pay the remainder at pickup location.">
<META NAME="Generator" CONTENT="Bravacar">
<META NAME="Keywords" CONTENT="rent a car,car rentals portugal,bravacar, car rental in madeira, rent a car in lisbon, rent a car in oporto, porto car rental, lisbon car rental, faro car rental, algarve rent a car, netrent rent a car, rent, car, rent a car, car rental, rental, car rentals, rentals, holiday rentals, cheap rent a car, cheap car rental, cheap rental, cheap car rentals, cheap rentals, cheap holiday rentals, portugal rent a car, portugal car rental,madeira car rental,algarve car rental,lisbon car rental,porto car rental,bravacar madeira,bravacar porto, bravacar lisbon, bravacar faro">
<META NAME="Language" CONTENT="en">
<META NAME="revisit-after" CONTENT="2 days">
<link rel="stylesheet" href="../assets/clases.css" type="text/css" />
<script language="javascript" src="../assets/pop_up_car.js"></script>

<script language="javascript" src="../assets/cal3.js"></script>
<script language="javascript" src="../assets/cal_conf3.js"></script>
<script language="javascript" src="../assets/car_func.js"></script>
<meta name="robots" content="index,follow">
<meta name="googlebot" content="index,follow">
<LINK REL="STYLESHEET" TYPE="text/css" HREF="../html/style.css">
<LINK REL="STYLESHEET" TYPE="text/css" HREF="../html/site.css">
</HEAD>
<BODY STYLE="text-align: center; background-color: rgb(255,255,255); background-image: none; margin: 0px;">
    <DIV ALIGN="CENTER">
    <TABLE BORDER="0" CELLSPACING="0" CELLPADDING="0">
        <TR>
            <TD>                
                <TABLE BORDER="0" CELLSPACING="0" CELLPADDING="0" WIDTH="780" STYLE="background-color: rgb(40,49,79); height: 21;">
                    <TR ALIGN="LEFT" VALIGN="middle">
                        <TD width="510" HEIGHT="21"></TD>
                        <TD WIDTH="20"><IMG ID="PictPT" HEIGHT="11" WIDTH="16" SRC="../assets/images/pt.gif" BORDER="0" ALT="pt"></TD>
                        <TD width="18"></TD>
                        <TD WIDTH="20"><IMG ID="PictGB" HEIGHT="11" WIDTH="16" SRC="../assets/images/gb.gif" BORDER="0" ALT="gb"></TD>
                        <TD width="18"></TD>
                        <TD WIDTH="20"><IMG ID="PictDE" HEIGHT="11" WIDTH="16" SRC="../assets/images/de.gif" BORDER="0" ALT="de"></TD>
                        <TD WIDTH="174" class="muda_link">                            
                            <P STYLE="text-align: center;">
                            <B><SPAN STYLE="font-family: Verdana,Tahoma,Arial,Helvetica,Sans-serif; font-size: xx-small;">
                            <A HREF="../../index.php">Português</A> | 
                            <span class="link_actual"><A HREF="../index.php">English</A></span> | 
                            <A HREF="#">Deutsch</A></SPAN></B></P>                                                        
                        </TD>
                    </TR>
                </TABLE>       
                
                <TABLE BORDER="0" CELLSPACING="0" CELLPADDING="0" WIDTH="780" height="207">
                    <TR>
                        <TD HEIGHT="48" WIDTH="780">
                        	<IMG ID="Pict357" HEIGHT="48" WIDTH="780" SRC="../assets/images/bravacar_01.gif" BORDER="0" ALT=""></TD>
                    </TR>
                    <TR>
                        <TD HEIGHT="159" WIDTH="780">
                        	<IMG ID="Pict358" HEIGHT="159" WIDTH="780" SRC="../assets/images/bravacar_02.jpg" BORDER="0" ALT=""></TD>
                    </TR>
                 </TABLE>

                 <TABLE BORDER="0" CELLSPACING="0" CELLPADDING="0" WIDTH="780">
                    <TR VALIGN="TOP" ALIGN="LEFT">
                        <TD HEIGHT="7" WIDTH="780">
                        	<IMG ID="Pict359" HEIGHT="7" WIDTH="780" SRC="../assets/images/linha01.jpg" BORDER="0" ALT=""></TD>
                    </TR>
					<TR VALIGN="TOP" ALIGN="LEFT">
                        <TD HEIGHT="25" CLASS="TextObject">
                        <P><script language="javascript" src="../assets/menu_bravacar_en.js"></script></P></TD>
                  	</TR>       
					<TR VALIGN="TOP" ALIGN="LEFT">
                        <TD HEIGHT="25" CLASS="TextObject">&nbsp;</TD>
                  	</TR>                                  
                </TABLE>
                
                <FORM NAME="LayoutRegion3FORM" ACTION="rentacar.php" method="GET">
                <input type=hidden name="registos" value="">  
                <table width="780" border="0" cellspacing="0" cellpadding="0">
                  <tr>
                    <td width="159" height="35">&nbsp;</td>
                    <td width="26">&nbsp;</td>
                    <td width="560">
                    	<b><span style="font-family: Verdana,Tahoma,Arial,Helvetica,Sans-serif; font-size: x-small; color: rgb(208,25,32);">
                        Find a <span style="font-size: x-small; color: rgb(40,49,79);">BRAVACAR </span>location and Book your Car</span></b>
                        <?
							include('main.php');
							include('car_functions.php');
							db_connect();       
							   
							$cod_regiao = 0;
							if ($_SERVER['REQUEST_METHOD'] == "GET" and isset($_GET['car_destination'])) 
							   {          
								  $cod_regiao     = $_GET['car_destination'];
						
								  $data_in        = $_GET['car_data_up'];
								  $data_out       = $_GET['car_data_off'];         
						
								  $data_inicio    = $_GET['car_data_up'];
								  $data_fim       = $_GET['car_data_off'];
						
								  $hour_in        = $_GET['car_hour_up'];
								  $hour_out       = $_GET['car_hour_off'];
								  
								  $min_in         = $_GET['car_min_up'];
								  $min_out        = $_GET['car_min_off'];          
								  
								  $car_class      = $_GET['car_class'];
								  $car_pickup_loc = $_GET['car_pickup_loc'];
						
								  $vDY1           = $data_in;
								  $vDY7           = $data_out;
								  
								  $erro = "";
										  
							   if ($cod_regiao==0)
									  $erro = $erro."Please select a destination<br>";
						
							   if ($car_pickup_loc==0)
									  $erro = $erro."Please select a pickup location<br>";
						
							   if ($data_in =="")
									  $erro = $erro."Please select a pick-up date<br>";
						
								  if ($data_in !="" and !(IsDate($data_in)))
									  $erro = $erro."Please select a valid pick-up date<br>";
						
							   if ($data_out =="")
									  $erro = $erro."Please select a drop-off date<br>";
						
								  if ($data_out !="" and !(IsDate($data_out)))
									  $erro = $erro."Please select a valid drop-off date<br>";
						
								  if (IsDate($data_in) and IsDate($data_out))
								  {
									 $data_hora_inicio = $data_in.' '.$hour_in.':'.$min_in;
									 $data_hora_fim    = $data_out.' '.$hour_out.':'.$min_out;
						
									 $data_in  = FormatarDataHora($data_in,$hour_in,$min_in);
									 $data_out = FormatarDataHora($data_out,$hour_out,$min_out);             
						
									 $data_hoje  = getDate();
									 $data_today = date("Y-m-d H:i:s", mktime($data_hoje['hours'],$data_hoje['minutes'],0,$data_hoje['mon'],$data_hoje['mday'],$data_hoje['year'])); 
						
									 $nro_dias = diff_days($data_today,$data_in);   
									 if ($nro_dias < 0)
										$erro = $erro."The pick-up date must be at least the date of today<br>";
						
									 $data_out_ant = strtotime($data_out)- 7200;
									 $data_out_ant = date("Y-m-d H:i:s", $data_out_ant);         
						
									 $nro_dias = diff_days($data_in,$data_out_ant);                
									 if ($nro_dias < 0)
										$erro = $erro."The drop-off date must be at least two hours after the pick-up date<br>";
									 
									 $nro_dias = diff_days($data_in,$data_out);
									 $hora_tol = (fmod((strtotime($data_out) - strtotime($data_in)),86400)/3600);
									 
								  }  
							 }						
						?>                    </td>
                    <td width="35">&nbsp;</td>
                  </tr>
                  <tr>
                    <td><img id="Picture385" height="46" width="159" src="../assets/images/autogen/a_botao-estatico_1.gif" border="0" alt=""></td>
                    <td>&nbsp;</td>                    
                    <td VALIGN="MIDDLE" align="center" STYLE="background-color: rgb(228,31,31);">
                    <p><span style="font-size: x-large; color: rgb(255,255,255);">.............................................</span></p></td>
                    <td>&nbsp;</td>
                  </tr>
                  <tr>
                    <td rowspan="3" valign="top"><img src="../assets/images/05megane1.jpg" width="159" height="416"></td>
                    <td rowspan="3">&nbsp;</td>
                    <td valign="top" STYLE="background-color: rgb(213,222,238);">
                    	<img id="Picture392" height="120" width="560" src="../assets/images/clio_int.jpg" border="0" alt="">
                
                        <TABLE ID="Table72" BORDER="0" CELLSPACING="0" CELLPADDING="0" WIDTH="100%" STYLE="height: 60px; background-color: rgb(213,222,238); ">
                                <TR STYLE="height:30px">
                                    <TD WIDTH="203" valign="bottom">
                                        <P>&nbsp;&nbsp;<SPAN STYLE="font-size: 11px;">Location&nbsp;&nbsp;
										<?
										function ConvertToJSArray2D($PArray , $ArrayName, $filas)
										{
										$Row = $filas;
										$Col = 3;
										
										?>
										<SCRIPT LANGUAGE = 'JAVASCRIPT' >
										<?=$ArrayName?> = new Array(<?=$Row?>);
										for (i=0; i < <?=$Row?>; i++) 
										{ 
										<?=$ArrayName?>[i] = new Array(<?=$Col?>);
										for (j=0; j < <?=$Col?>; j++) 
										<?=$ArrayName?>[i][j] = " ";
										}
										
										<? 
										for ($i=0;$i<$Row;$i++) 
										{
										for ($j=0;$j<$Col;$j++) 
										{
										$str = $PArray[$i][$j];
										?> 
										<?=$ArrayName?>[<?=$i?>][<?=$j?>] = "<?=$str?>"
										<?
										}
										}
										?> 
										document.LayoutRegion3FORM.registos.value = <?=$Row?>;
										</SCRIPT>										
										<?										
										}										
										
										$sql = "SELECT a.cod_regiao, a.cod_localidade, b.descricao ";
										$sql = $sql." FROM tr_rentacar_escritorios a, tr_rentacar_localidades b, tr_rentacar c ";
										$sql = $sql." WHERE a.cod_localidade = b.cod_localidade ";
										$sql = $sql." and a.cod_rentacar = c.cod_rentacar ";
										$sql = $sql." and a.entrega = 1 ";
										$sql = $sql." and c.activo = 1 ";
										$sql = $sql." GROUP BY a.cod_regiao, a.cod_localidade, b.descricao ";
										$sql = $sql." ORDER BY b.descricao ";
										
										$result = mysql_query($sql) or die("select fails");      
										$filas  = mysql_num_rows($result);   
										
										$i = 0;	
										
										while ($row = mysql_fetch_row($result))
										{     
										$tabela_loc[$i][0] = $row[0];
										$tabela_loc[$i][1] = $row[1];
										$tabela_loc[$i][2] = $row[2];
										$i = $i + 1;
										}  
										
										if ($filas >0)
										{
										ConvertToJSArray2D($tabela_loc, 'tb_loc', $filas);
										}
										
										?>
										</SPAN></P>									
                                    </TD>
                                    <TD WIDTH="202" valign="bottom">
                                        <span style="font-size: 11px;">Pick-up location:</span>                                    
                                    </TD>
                              		<TD WIDTH="135" valign="bottom">
                                        <span style="font-size: 11px;"> Car class:</span>
                                    </TD>
                                </TR>
                                <TR STYLE="height:30px">
                                    <TD>
                                        <P>&nbsp;
                                        <SELECT ID="ID_car_destination" NAME="car_destination" style="width:180px" class="text_objects" onChange="change_pick_up(document.LayoutRegion3FORM.car_destination.value,document.LayoutRegion3FORM.registos.value)"
>
                                            <OPTION VALUE="0" SELECTED>Select a destination</OPTION>
                                            <OPTION VALUE="6">Madeira</OPTION>
                                            <OPTION VALUE="5">Lisbon</OPTION>
                                            <OPTION VALUE="3">Faro - Algarve</OPTION>
                                            <OPTION VALUE="8">Oporto</OPTION>
                                        </SELECT>
                                        </P>                                    </TD>
                                    <TD>
                                        <P>
                                        <select id="ID_car_pickup_loc" name="car_pickup_loc" style="width:180px" class="text_objects">
                                        	<option value="0" selected>Select a location</option>
                                        </select>
                                    	</P>                                    </TD>
                                    <TD>
                                      <P>
                                          <select id="ID_car_class" name="car_class" style="width:130px" class="text_objects">
                                            <option value="0" selected>No preference</option>
                                            <option value="1">Economy</option>
                                            <option value="2">Compact</option>
                                            <option value="3">Midsize</option>
                                            <option value="4">Standard</option>
                                            <option value="5">Full Size</option>
                                            <option value="6">Premium</option>
                                            <option value="7">Luxury</option>
                                            <option value="8">Convertible</option>
                                            <option value="9">Minivan</option>
                                            <option value="10">Sports car</option>
                                          </select>
                                      </P>                                    
                                    </TD>
                                </TR>
                          </TABLE>
                                        
                          <TABLE ID="Table73" BORDER="0" CELLSPACING="0" CELLPADDING="0" WIDTH="100%" STYLE="height: 60px; background-color: rgb(213,222,238); ">
                                <TR STYLE="height:18px">
                                    <TD WIDTH="204" height="30px" valign="bottom">
                                      <P>&nbsp;&nbsp;<SPAN STYLE="font-size: 11px;">Pick-up:</SPAN></P>
                                    </TD>
                                  <TD WIDTH="336" valign="bottom">
                                <P>&nbsp;<SPAN STYLE="font-size: 11px;">Drop-off:</SPAN></P>
                                    </TD>
                                </TR>
                                <TR STYLE="height:30px">
                                    <TD>
                                        <P><SPAN STYLE="font-size: 11px;">&nbsp; <INPUT ID="ID_car_data_up" TYPE="TEXT" NAME="car_data_up" STYLE="white-space: pre;" VALUE="<?=$vDY1?>" SIZE="9" MAXLENGTH="10" class="text_objects"> <A HREF="javascript:showCal('Calendar3')" TARGET="_self"><IMG ID="Picture192" HEIGHT="18" WIDTH="19" SRC="../assets/images/cal06.gif" VSPACE="0" HSPACE="0" ALIGN="TOP" BORDER="0" ALT=""></A>&nbsp; 
                                            <SELECT ID="ID_car_hour_up" NAME="car_hour_up" style="width:40px" class="text_objects">
                                                <OPTION VALUE="00">00</OPTION>
                                                <OPTION VALUE="01">01</OPTION>
                                                <OPTION VALUE="02">02</OPTION>
                                                <OPTION VALUE="03">03</OPTION>
                                                <OPTION VALUE="04">04</OPTION>
                                                <OPTION VALUE="05">05</OPTION>
                                                <OPTION VALUE="06">06</OPTION>
                                                <OPTION VALUE="07">07</OPTION>
                                                <OPTION VALUE="08">08</OPTION>
                                                <OPTION VALUE="09" SELECTED>09</OPTION>
                                                <OPTION VALUE="10">10</OPTION>
                                                <OPTION VALUE="11">11</OPTION>
                                                <OPTION VALUE="12">12</OPTION>
                                                <OPTION VALUE="13">13</OPTION>
                                                <OPTION VALUE="14">14</OPTION>
                                                <OPTION VALUE="15">15</OPTION>
                                                <OPTION VALUE="16">16</OPTION>
                                                <OPTION VALUE="17">17</OPTION>
                                                <OPTION VALUE="18">18</OPTION>
                                                <OPTION VALUE="19">19</OPTION>
                                                <OPTION VALUE="20">20</OPTION>
                                                <OPTION VALUE="21">21</OPTION>
                                                <OPTION VALUE="22">22</OPTION>
                                                <OPTION VALUE="23">23</OPTION>
                                            </SELECT>
                                             
                                            <SELECT ID="ID_car_min_up" NAME="car_min_up" style="width:40px" class="text_objects">
                                                <OPTION VALUE="00" SELECTED>00</OPTION>
                                                <OPTION VALUE="15">15</OPTION>
                                                <OPTION VALUE="30">30</OPTION>
                                                <OPTION VALUE="45">45</OPTION>
                                            </SELECT>
                                            </SPAN></P>
                                  </TD>
                                    <TD>
                                        <P><SPAN STYLE="font-size: 11px;">&nbsp;<INPUT ID="FormsEditField27" TYPE="TEXT" NAME="car_data_off" STYLE="white-space: pre;" VALUE="<?=$vDY7?>" SIZE="9" MAXLENGTH="10" class="text_objects"> <A HREF="javascript:showCal('Calendar4')" TARGET="_self"><IMG ID="Picture194" HEIGHT="18" WIDTH="19" SRC="../assets/images/cal06.gif" VSPACE="0" HSPACE="0" ALIGN="TOP" BORDER="0" ALT=""></A>&nbsp; 
                                            <SELECT ID="ID_car_hour_off" NAME="car_hour_off" style="width:40px" class="text_objects">
                                                <OPTION VALUE="00">00</OPTION>
                                                <OPTION VALUE="01">01</OPTION>
                                                <OPTION VALUE="02">02</OPTION>
                                                <OPTION VALUE="03">03</OPTION>
                                                <OPTION VALUE="04">04</OPTION>
                                                <OPTION VALUE="05">05</OPTION>
                                                <OPTION VALUE="06">06</OPTION>
                                                <OPTION VALUE="07">07</OPTION>
                                                <OPTION VALUE="08">08</OPTION>
                                                <OPTION VALUE="09" SELECTED>09</OPTION>
                                                <OPTION VALUE="10">10</OPTION>
                                                <OPTION VALUE="11">11</OPTION>
                                                <OPTION VALUE="12">12</OPTION>
                                                <OPTION VALUE="13">13</OPTION>
                                                <OPTION VALUE="14">14</OPTION>
                                                <OPTION VALUE="15">15</OPTION>
                                                <OPTION VALUE="16">16</OPTION>
                                                <OPTION VALUE="17">17</OPTION>
                                                <OPTION VALUE="18">18</OPTION>
                                                <OPTION VALUE="19">19</OPTION>
                                                <OPTION VALUE="20">20</OPTION>
                                                <OPTION VALUE="21">21</OPTION>
                                                <OPTION VALUE="22">22</OPTION>
                                                <OPTION VALUE="23">23</OPTION>
                                            </SELECT>
                                             
                                            <SELECT ID="ID_car_min_off" NAME="car_min_off" style="width:40px" class="text_objects">
                                                <OPTION VALUE="00" SELECTED>00</OPTION>
                                                <OPTION VALUE="15">15</OPTION>
                                                <OPTION VALUE="30">30</OPTION>
                                                <OPTION VALUE="45">45</OPTION>
                                            </SELECT>
                                            </SPAN></P>
                                    </TD>
                                </TR>                                                                 
                            </TABLE>                            
                                                                                                                        
                    </td>  
                    <td rowspan="3">&nbsp;</td>                      
                  </tr>
                  <tr height="146">
                    <td valign="top" style="padding-top:10px;">
                        <P STYLE="text-align: center;"><SPAN STYLE="font-family: Tahoma,Verdana,Arial,Helvetica,Sans-serif; font-size: 11px;"></SPAN>				
                        <INPUT ID="FormsButton19" NAME="FormsButton18" TYPE="IMAGE" STYLE="border-style:solid;border-width:0" SRC="../assets/images/Search_verde_rentacar.jpg"></P>                   
                    </td>
                  </tr>
                </table>                                                                        
                </FORM>
                <TABLE BORDER="0" CELLSPACING="0" CELLPADDING="0" WIDTH="780">
                    <TR VALIGN="TOP" ALIGN="LEFT">
                        <TD HEIGHT="30"></TD>
                    </TR>
                    <TR VALIGN="TOP" ALIGN="LEFT">
                        <TD STYLE="background-image: url('../assets/images/f000.jpg'); height: 42; vertical-align:middle" class="table_esq">
                             <P STYLE="text-align: center; font-size: 12px;">&nbsp;&nbsp; 
                             <A HREF="../index.php">Home</A>&nbsp;|&nbsp;
                             <A HREF="../html/newsletter.php">Subscribe our Newsletter</A>&nbsp;|&nbsp;
                             <A HREF="../html/custsuport.php">Customer support</A>&nbsp;|&nbsp;
                             <A HREF="../html/questions.php">FAQ&#8217;s</A></P>
                        </TD>
                    </TR>
                    <TR>
                        <TD VALIGN="TOP" STYLE="background-color: rgb(209,36,36);height:34px" class="table_esq">
                            <SPAN STYLE="font-size: 8pt; color: rgb(255,255,255);">
                            Copyright &#169; 2006-2009 Bravacar, Lda - Rent a Car &#153; </SPAN></P>
                        </TD>
                    </TR>
                    <TR>
                        <TD class="table_esq" align="center" STYLE="height:45px; font-family: Tahoma,Verdana,Arial,Helvetica,Sans-serif; font-size: 11px; color: rgb(153,153,153);" >
                            <BR>Partner sites: 
                            <A HREF="http://www.baiabrava.pt/en/index.html" TARGET="_blank">Hotel Apartamentos Baía Brava</A>&nbsp;|&nbsp;
                            <A HREF="http://www.terrasdeaventura.com/english/index.php" TARGET="_blank">Terras de Aventura</A>&nbsp;|&nbsp;
                            <A HREF="http://www.albergariafozdosado.com/en/homebt.html" TARGET="_blank">Albergaria Foz do Sado</A>&nbsp; |&nbsp;
                            <A HREF="http://www.parquetematicodamadeira.pt/en/default.asp" TARGET="_blank">The Madeira Island Theme Park</A>
                            <BR>
                        </TD>
                    </TR>
                </TABLE>                                
            </TD>
        </TR>
    </TABLE>
    </DIV>
</BODY>
</HTML>
 