<?
    session_start();
?>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<HTML>
<HEAD>
<TITLE>Bravacar - Rent a Car - Online bookings</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 2006 - Carlos Pontes">
<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="carlos alberto pontes">
<META NAME="Language" CONTENT="en">
<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="revisit-after" CONTENT="2 days">
<link rel="stylesheet" href="../assets/clases.css" type="text/css" />
<script language="javascript" src="../assets/car_func.js"></script>

<meta name="robots" content="index,follow">
<meta name="googlebot" content="index,follow">
<SCRIPT TYPE="text/javascript">
<!--
var F_A,F_B,F_CH,F_CL,F_DB,F_E,F_F,F_L,F_MT,F_MV,F_R,F_SE,F_SU,F_U,F_HR,F_MU,F_MD;
function F_e(){} function F_n(){} function F_onLoaded(){}
//-->
</SCRIPT>
<SCRIPT TYPE="text/javascript">
<!--
document.write("<SCRIPT SRC=\"../assets/validation.js\"><\/SCRIPT>");
document.write("<SCRIPT SRC=\"../assets/script.js\"><\/SCRIPT>");
document.write("<SCRIPT SRC=\"../assets/effects.js\"><\/SCRIPT>");
//-->
</SCRIPT>
<SCRIPT TYPE="text/javascript">
<!--
function F_doLoaded() {
	document.main = new F_cMain();
	document.objectModel = new Object();
	F_OM('Layout','LayoutLYR', 'doc', '', new Array());
	F_OM('LayoutRegion13' , 'LayoutRegion13LYR', 'lyr', 'Layout',null,'',0);
		F_OM('Table75' , 'Table75LYR', 'lyr', 'LayoutRegion13',null,'',0);
			F_OM('ID_car_destination' , '', 'sel', 'Table75',new Array(
			'Change',F_functID_car_destinationAction0,'','',0),'bookcarLayout',0,'car_destination');
			F_OM('ID_car_dropoff_loc' , '', 'sel', 'Table75',new Array(
			'Change',F_functID_car_dropoff_locAction0,'','',0),'bookcarLayout',0,'car_dropoff_loc');
		F_OM('Table76' , 'Table76LYR', 'lyr', 'LayoutRegion13',null,'',0);
	F_pageLoaded('Layout');
}
function F_functID_car_destinationAction0(params) {
var dest = document.bookcarLayout.car_destination.value;
var reg  = document.bookcarLayout.registos.value;
var reg1 = document.bookcarLayout.registos1.value;

change_drop_off(dest,reg);
desc_destination(dest,reg1);

}

function F_functID_car_dropoff_locAction0(params) {
var dest = document.bookcarLayout.car_destination.value;
var reg  = document.bookcarLayout.registos.value;
var loc  = document.bookcarLayout.car_dropoff_loc.value;
desc_drop_off(dest,loc,reg);
}

//-->
</SCRIPT>
<LINK REL="STYLESHEET" TYPE="text/css" HREF="../html/style.css">
<LINK REL="STYLESHEET" TYPE="text/css" HREF="../html/site.css">
<STYLE TYPE="text/css" TITLE="NOF_STYLE_SHEET">
<!--
DIV#LayoutLYR	{ position:absolute; top:0; left:0; z-index:	1; visibility:inherit; }
DIV#LayoutRegion13LYR {	position:relative; visibility:inherit; background-color: #E41F1F; 	top:0; left:0; width:555; height:95;	z-index:1;	}
DIV#Table75LYR	{ position:absolute;	visibility:inherit;	top:2;	left:2; width:551; height:45; z-index:1 }
DIV#Table76LYR	{ position:absolute;	visibility:inherit;	top:48;	left:2; width:551; height:45; z-index:2 }
-->
</STYLE>

</HEAD>
<BODY onLoad="F_onLoaded();" STYLE="background-color: rgb(255,255,255); background-image: none;">
    <DIV ID="LayoutLYR">
    <FORM NAME="bookcarLayout" ACTION="ins_prod.php" method="GET">
        <INPUT type=hidden NAME="registos" VALUE=""><INPUT type=hidden NAME="registos1" VALUE=""><INPUT type=hidden NAME="desc_drop_off_loc" VALUE=""><INPUT type=hidden NAME="desc_destination" VALUE=""><INPUT type=hidden NAME="endereco_drop_off" VALUE="">
        <TABLE BORDER="0" CELLSPACING="0" CELLPADDING="0" WIDTH="780">
            <TR VALIGN="TOP" ALIGN="LEFT">
                <TD HEIGHT="21" WIDTH="780">
                    <TABLE BORDER="0" CELLSPACING="0" CELLPADDING="0" WIDTH="780" STYLE="background-color: rgb(40,49,79); height: 21;">
                        <TR ALIGN="LEFT" VALIGN="TOP">
                            <TD>
                                <TABLE CELLPADDING="0" CELLSPACING="0" BORDER="0" WIDTH="770">
                                    <TR VALIGN="TOP" ALIGN="LEFT">
                                        <TD>
                                            <TABLE BORDER="0" CELLSPACING="0" CELLPADDING="0" WIDTH="594">
                                                <TR VALIGN="TOP" ALIGN="LEFT">
                                                    <TD WIDTH="522" HEIGHT="6"><IMG SRC="../assets/images/autogen/clearpixel.gif" WIDTH="522" HEIGHT="1" BORDER="0" ALT=""></TD>
                                                    <TD></TD>
                                                    <TD WIDTH="12"><IMG SRC="../assets/images/autogen/clearpixel.gif" WIDTH="12" HEIGHT="1" BORDER="0" ALT=""></TD>
                                                    <TD></TD>
                                                    <TD WIDTH="12"><IMG SRC="../assets/images/autogen/clearpixel.gif" WIDTH="12" HEIGHT="1" BORDER="0" ALT=""></TD>
                                                    <TD></TD>
                                                </TR>
                                                <TR VALIGN="TOP" ALIGN="LEFT">
                                                    <TD HEIGHT="11"></TD>
                                                    <TD WIDTH="16"><IMG ID="Picture364" HEIGHT="11" WIDTH="16" SRC="../assets/images/pt.gif" BORDER="0" ALT="pt" TITLE="pt"></TD>
                                                    <TD></TD>
                                                    <TD WIDTH="16"><IMG ID="Picture365" HEIGHT="11" WIDTH="16" SRC="../assets/images/gb.gif" BORDER="0" ALT="gb" TITLE="gb"></TD>
                                                    <TD></TD>
                                                    <TD WIDTH="16"><IMG ID="Picture366" HEIGHT="11" WIDTH="16" SRC="../assets/images/de.gif" BORDER="0" ALT="de" TITLE="de"></TD>
                                                </TR>
                                            </TABLE>
                                        </TD>
                                        <TD>
                                            <TABLE BORDER="0" CELLSPACING="0" CELLPADDING="0">
                                                <TR VALIGN="TOP" ALIGN="LEFT">
                                                    <TD WIDTH="7" HEIGHT="1"><IMG SRC="../assets/images/autogen/clearpixel.gif" WIDTH="7" HEIGHT="1" BORDER="0" ALT=""></TD>
                                                    <TD></TD>
                                                </TR>
                                                <TR VALIGN="TOP" ALIGN="LEFT">
                                                    <TD></TD>
                                                    <TD WIDTH="169">
                                                        <TABLE ID="Table86" BORDER="0" CELLSPACING="0" CELLPADDING="0" WIDTH="100%" STYLE="height: 10;" class="table_netrent">
                                                            <TR STYLE="height:12px">
                                                                <TD WIDTH="169">
                                                                    <P STYLE="text-align: center;"><B><SPAN STYLE="font-family: Verdana,Tahoma,Arial,Helvetica,Sans-serif; font-size: xx-small; color: rgb(255,255,255);"><A HREF="http://www.bravacar.pt/">Portuguκs</A> | <SPAN STYLE="color: rgb(255,0,0);">English</SPAN> | Deutsch</SPAN></B></P>
                                                                </TD>
                                                            </TR>
                                                        </TABLE>
                                                    </TD>
                                                </TR>
                                            </TABLE>
                                        </TD>
                                    </TR>
                                </TABLE>
                            </TD>
                        </TR>
                    </TABLE>
                </TD>
            </TR>
        </TABLE>
        <TABLE BORDER="0" CELLSPACING="0" CELLPADDING="0" WIDTH="780">
            <TR VALIGN="TOP" ALIGN="LEFT">
                <TD HEIGHT="48" WIDTH="780"><IMG ID="Picture357" HEIGHT="48" WIDTH="780" SRC="../assets/images/netrent_01.gif" BORDER="0" ALT=""></TD>
            </TR>
        </TABLE>
        <TABLE BORDER="0" CELLSPACING="0" CELLPADDING="0" WIDTH="780">
            <TR VALIGN="TOP" ALIGN="LEFT">
                <TD HEIGHT="159" WIDTH="780"><IMG ID="Picture358" HEIGHT="159" WIDTH="780" SRC="../assets/images/netrent_0202.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="Picture359" HEIGHT="7" WIDTH="780" SRC="../assets/images/linha01.jpg" BORDER="0" ALT=""></TD>
            </TR>
        </TABLE>
        <TABLE CELLPADDING="0" CELLSPACING="0" BORDER="0" WIDTH="780">
            <TR VALIGN="TOP" ALIGN="LEFT">
                <TD>
                    <TABLE BORDER="0" CELLSPACING="0" CELLPADDING="0" WIDTH="159">
                        <TR VALIGN="TOP" ALIGN="LEFT">
                            <TD WIDTH="25" CLASS="TextObject">
                                <P><script language="javascript" src="../assets/menu_bravacar_en.js"></script>&nbsp;</P>
                            </TD>
                            <TD WIDTH="134"><IMG SRC="../assets/images/autogen/clearpixel.gif" WIDTH="134" HEIGHT="1" BORDER="0" ALT=""></TD>
                        </TR>
                        <TR VALIGN="TOP" ALIGN="LEFT">
                            <TD COLSPAN="2" HEIGHT="110"></TD>
                        </TR>
                        <TR VALIGN="TOP" ALIGN="LEFT">
                            <TD HEIGHT="46" COLSPAN="2" WIDTH="159"><IMG ID="Picture385" HEIGHT="46" WIDTH="159" SRC="../assets/images/autogen/a_botao-estatico_4.gif" BORDER="0" ALT="Rate details" TITLE="Rate details"></TD>
                        </TR>
                        <TR VALIGN="TOP" ALIGN="LEFT">
                            <TD HEIGHT="379" COLSPAN="2" WIDTH="159">
                                <TABLE BORDER="0" CELLSPACING="0" CELLPADDING="0" WIDTH="159" STYLE="background-color: rgb(225,221,221); background-image: url('../assets/images/05megane1.jpg'); height: 379;">
                                    <TR ALIGN="LEFT" VALIGN="TOP">
                                        <TD>&nbsp;</TD>
                                    </TR>
                                </TABLE>
                            </TD>
                        </TR>
                    </TABLE>
                </TD>
                <TD>
                    <TABLE BORDER="0" CELLSPACING="0" CELLPADDING="0" WIDTH="570">
                        <TR VALIGN="TOP" ALIGN="LEFT">
                            <TD WIDTH="22" HEIGHT="98"><IMG SRC="../assets/images/autogen/clearpixel.gif" WIDTH="22" HEIGHT="1" BORDER="0" ALT=""></TD>
                            <TD WIDTH="548"><IMG SRC="../assets/images/autogen/clearpixel.gif" WIDTH="548" HEIGHT="1" BORDER="0" ALT=""></TD>
                        </TR>
                        <TR VALIGN="TOP" ALIGN="LEFT">
                            <TD></TD>
                            <TD WIDTH="548" CLASS="TextObject">
                                <P><?       

if ($_SERVER['REQUEST_METHOD'] == "GET") 
{
    include('main.php');    
    include('book_car_functions.php');   

    db_connect();	 
   
    $cod_rentacar = $_GET["rentacar"];
    $cod_regiao   = $_GET["regiao"];
    $data_in      = $_GET["date1"];
    $data_out     = $_GET["date2"];

    $date1        = $_GET["date1"];
    $date2        = $_GET["date2"];

    $hour_in      = $_GET["hour1"];
    $hour_out     = $_GET["hour2"];
    $min_in       = $_GET["min1"];
    $min_out      = $_GET["min2"];
    $group        = $_GET["cod_grupo"];
    $class        = $_GET["car_class"];
    $pick_up_loc  = $_GET["pickup_loc"];
    
    $endereco_pick_up = '';

    $data_in  = FormatarDataHora($data_in,$hour_in,$min_in);
    $data_out = FormatarDataHora($data_out,$hour_out,$min_out);             

    $data_in_1  = FormatarData($date1);
    $data_out_1 = FormatarData($date2);    

    $nro_dias   = diff_days($data_in,$data_out);             
    $hora_tol   = (fmod((strtotime($data_out) - strtotime($data_in)),86400)/3600);
    
    if ($nro_dias == 0)
    {
        $nro_dias = $nro_dias + 1;  
        $hora_tol = 0;
    }

    $sql = "select b.nome, b.comissao, b.cidade, b.morada, f.descricao, ";
    $sql = $sql." a.cod_grupo, a.descricao, g.codigo, g.descricao, d.horas_tol, d.cod_tarifa, ";
    $sql = $sql." ((100*e.preco)/(100-b.comissao)) as preco_dia, ";    
    $sql = $sql." ((100*e.preco)/(100-b.comissao))* ";
    $sql = $sql." ($nro_dias + (case when $hora_tol > d.horas_tol then 1 else 0 end)) as preco, ";
    $sql = $sql." c.endereco "; 
    $sql = $sql." from tr_rentacar_grupos a, tr_rentacar b, ";
    $sql = $sql." tr_rentacar_escritorios c, tr_rentacar_tarifas d, ";
    $sql = $sql." tr_rentacar_tarifas_precos e, tbregiao f, tr_rentacar_categoria g ";
    $sql = $sql." where a.cod_rentacar = b.cod_rentacar ";
    $sql = $sql." and b.cod_rentacar   = $cod_rentacar ";
    $sql = $sql." and c.cod_localidade = $pick_up_loc ";
    $sql = $sql." and c.entrega = 1 ";
    $sql = $sql." and c.cod_rentacar = b.cod_rentacar ";
    $sql = $sql." and d.cod_rentacar = b.cod_rentacar ";
    $sql = $sql." and e.cod_rentacar = b.cod_rentacar ";
    $sql = $sql." and d.cod_tarifa = e.cod_tarifa ";
    $sql = $sql." and ($nro_dias + (case when $hora_tol > d.horas_tol then 1 else 0 end)) >= e.day_from ";
    $sql = $sql." and ($nro_dias + (case when $hora_tol > d.horas_tol then 1 else 0 end)) <= e.day_to ";
    $sql = $sql." and d.data_inicio <= '$data_in' ";
    $sql = $sql." and d.data_fim >= '$data_in' ";
    $sql = $sql." and e.cod_grupo = a.cod_grupo ";
    //$sql = $sql." and b.cod_regiao = $cod_regiao ";
    $sql = $sql." and f.cod_regiao = $cod_regiao ";
    $sql = $sql." and a.cod_categoria = g.codigo ";
    $sql = $sql." and e.cod_grupo = '$group' ";
    $sql = $sql." and b.activo = 1 ";
    $sql = $sql." order by preco ";

    $result = mysql_query($sql) or die("select rentacar fails");
    $no     = mysql_num_rows($result);
        
    if ($no!=0) 
    {                
        $row = mysql_fetch_row($result);
 
        $nome              = $row[0];
        $comissao          = $row[1];
        $cidade            = $row[2];
        $morada            = $row[3];
        $desc_regiao       = $row[4];
        $cod_grupo         = $row[5];
        $desc_grupo        = $row[6];
        $cod_categoria     = $row[7];
        $desc_categoria    = $row[8];
        $horas_tolerancia  = $row[9];
        $cod_tarifa        = $row[10];
        $preco_dia         = $row[11];
        $preco_total       = $row[12];
        $endereco_pick_up  = $row[13];

        //$endereco        = $morada.' - '.$cidade.' - '.$desc_regiao;
        $endereco          = $endereco_pick_up.' - '.$desc_regiao;
       
        $charged     = ($preco_total*$comissao)/100;
        $balance     = ($preco_total*(100 - $comissao))/100;

        $charged     = number_format($charged, 2, '.', '');
        $balance     = number_format($balance, 2, '.', '');

        $preco_dia   = number_format($preco_dia, 2, '.', '');
        $preco_total = number_format($preco_total, 2, '.', '');  
        
        if ($nro_dias > 1)
            $mensagem_dias = $nro_dias.' days';
        else
            $mensagem_dias = $nro_dias.' day';
        
        if ($hora_tol > $horas_tolerancia)
        {
            $nro_dias  = $nro_dias + 1; 
            $dias_real = floor(((strtotime($data_out) - strtotime($data_in))/86400));
            $dias_data = diff_days($data_in_1,$data_out_1);
                       
            if ($dias_real == $dias_data)
                $mensagem_dias = ' (Dif hours > '.$horas_tolerancia.') ==> + 1 day  ==> '.$nro_dias.' days';
            else
                $mensagem_dias = $nro_dias.' days';      
        }
    }

    $sql = "select descricao from tr_rentacar_localidades ";
    $sql = $sql." where cod_localidade = $pick_up_loc ";
    
    $result = mysql_query($sql) or die("select location fails");
    $no     = mysql_num_rows($result);
        
    if ($no!=0) 
    {                
        $row = mysql_fetch_row($result);
        $desc_pick_up_loc  = $row[0];
    }

    $date_array  = explode("/",$_GET["date1"]);
    $var_day     = $date_array[0]; 
    $var_month   = $date_array[1]; 
    $var_year    = $date_array[2]; 
    $day_week_in = jddayofweek ( cal_to_jd(CAL_GREGORIAN,$var_month,$var_day,$var_year), 1 );

    $data_pickup = $day_week_in.', '.$_GET["date1"].' at '.$hour_in.':'.$min_in;

    $date_array    = explode("/",$_GET["date2"]);
    $var_day       = $date_array[0]; 
    $var_month     = $date_array[1]; 
    $var_year      = $date_array[2]; 
    $day_week_out  = jddayofweek ( cal_to_jd(CAL_GREGORIAN,$var_month,$var_day,$var_year), 1 );

    $data_drop_off = $day_week_out.', '.$_GET["date2"].' at '.$hour_out.':'.$min_out;
}

?>
&nbsp;</P>
                            </TD>
                        </TR>
                    </TABLE>
                    <TABLE BORDER="0" CELLSPACING="0" CELLPADDING="0" WIDTH="577">
                        <TR VALIGN="TOP" ALIGN="LEFT">
                            <TD WIDTH="22" HEIGHT="9"><IMG SRC="../assets/images/autogen/clearpixel.gif" WIDTH="22" HEIGHT="1" BORDER="0" ALT=""></TD>
                            <TD></TD>
                        </TR>
                        <TR VALIGN="TOP" ALIGN="LEFT">
                            <TD HEIGHT="284"></TD>
                            <TD WIDTH="555">
                                <TABLE BORDER="0" CELLSPACING="0" CELLPADDING="0" WIDTH="555" STYLE="background-color: rgb(228,31,31); height: 284;">
                                    <TR ALIGN="LEFT" VALIGN="TOP">
                                        <TD>
                                            <TABLE BORDER="0" CELLSPACING="0" CELLPADDING="0">
                                                <TR VALIGN="TOP" ALIGN="LEFT">
                                                    <TD WIDTH="2" HEIGHT="2"><IMG SRC="../assets/images/autogen/clearpixel.gif" WIDTH="2" HEIGHT="1" BORDER="0" ALT=""></TD>
                                                    <TD></TD>
                                                </TR>
                                                <TR VALIGN="TOP" ALIGN="LEFT">
                                                    <TD></TD>
                                                    <TD WIDTH="551">
                                                        <TABLE ID="Table48" BORDER="0" CELLSPACING="0" CELLPADDING="0" WIDTH="100%" STYLE="height: 281;">
                                                            <TR STYLE="height:18px">
                                                                <TD COLSPAN="2" STYLE="background-color: rgb(215,220,232);">
                                                                    <P STYLE="text-align: center;"><B><SPAN STYLE="font-family: Verdana,Tahoma,Arial,Helvetica,Sans-serif;">RATE DETAILS</SPAN></B></P>
                                                                </TD>
                                                            </TR>
                                                            <TR STYLE="height:25px">
                                                                <TD WIDTH="220" STYLE="background-color: rgb(255,255,255); margin-left: 0pt;">
                                                                    <P STYLE="margin-left: 4pt;"><SPAN STYLE="font-family: Verdana,Tahoma,Arial,Helvetica,Sans-serif; font-size: 11px;">Car class:</SPAN></P>
                                                                </TD>
                                                                <TD WIDTH="331" STYLE="background-color: rgb(255,255,255); padding-right: 4pt;">
                                                                    <P STYLE="text-align: right; margin-left: 4pt;"><SPAN STYLE="font-family: Verdana,Tahoma,Arial,Helvetica,Sans-serif; font-size: 11px;"><?echo $desc_categoria;?></SPAN>&nbsp;</P>
                                                                </TD>
                                                            </TR>
                                                            <TR STYLE="height:21px">
                                                                <TD STYLE="background-color: rgb(255,255,255);">
                                                                    <P STYLE="margin-left: 4pt;"><SPAN STYLE="font-family: Verdana,Tahoma,Arial,Helvetica,Sans-serif; font-size: 11px;">Type of car:</SPAN></P>
                                                                </TD>
                                                                <TD STYLE="background-color: rgb(255,255,255); padding-right: 4pt;">
                                                                    <P STYLE="text-align: right; margin-left: 4pt;"><SPAN STYLE="font-family: Verdana,Tahoma,Arial,Helvetica,Sans-serif; font-size: 11px;"><?echo $desc_grupo;?></SPAN>&nbsp;</P>
                                                                </TD>
                                                            </TR>
                                                            <TR STYLE="height:21px">
                                                                <TD STYLE="background-color: rgb(255,255,255);">
                                                                    <P STYLE="margin-left: 4pt;"><SPAN STYLE="font-family: Verdana,Tahoma,Arial,Helvetica,Sans-serif; font-size: 11px;">Pick-up location:</SPAN></P>
                                                                </TD>
                                                                <TD STYLE="background-color: rgb(255,255,255); padding-right: 4pt;">
                                                                    <P STYLE="text-align: right;"><SPAN STYLE="font-family: Verdana,Tahoma,Arial,Helvetica,Sans-serif; font-size: 11px;"><?echo $desc_pick_up_loc;?>
</SPAN>&nbsp;</P>
                                                                </TD>
                                                            </TR>
                                                            <TR STYLE="height:21px">
                                                                <TD STYLE="background-color: rgb(255,255,255); margin-left: 0pt;">
                                                                    <P STYLE="margin-left: 4pt;"><SPAN STYLE="font-family: Verdana,Tahoma,Arial,Helvetica,Sans-serif; font-size: 11px;">Pick-up date:</SPAN></P>
                                                                </TD>
                                                                <TD STYLE="background-color: rgb(255,255,255); padding-right: 4pt;">
                                                                    <P STYLE="text-align: right; margin-left: 4pt;"><SPAN STYLE="font-family: Verdana,Tahoma,Arial,Helvetica,Sans-serif; font-size: 11px;"><?echo $data_pickup;?></SPAN>&nbsp;</P>
                                                                </TD>
                                                            </TR>
                                                            <TR STYLE="height:21px">
                                                                <TD STYLE="background-color: rgb(255,255,255); margin-left: 0pt;">
                                                                    <P STYLE="margin-left: 4pt;"><SPAN STYLE="font-family: Verdana,Tahoma,Arial,Helvetica,Sans-serif; font-size: 11px;">Drop-off date:</SPAN></P>
                                                                </TD>
                                                                <TD STYLE="background-color: rgb(255,255,255); padding-right: 4pt;">
                                                                    <P STYLE="text-align: right; margin-left: 4pt;"><SPAN STYLE="font-family: Verdana,Tahoma,Arial,Helvetica,Sans-serif; font-size: 11px;"><?echo $data_drop_off;?></SPAN>&nbsp;</P>
                                                                </TD>
                                                            </TR>
                                                            <TR STYLE="height:21px">
                                                                <TD STYLE="background-color: rgb(255,255,255); margin-left: 0pt;">
                                                                    <P STYLE="margin-left: 4pt;"><SPAN STYLE="font-family: Verdana,Tahoma,Arial,Helvetica,Sans-serif; font-size: 11px;">Number of days:</SPAN></P>
                                                                </TD>
                                                                <TD STYLE="background-color: rgb(255,255,255); padding-right: 4pt;">
                                                                    <P STYLE="text-align: right; margin-left: 4pt;"><SPAN STYLE="font-family: Verdana,Tahoma,Arial,Helvetica,Sans-serif; font-size: 11px;"><? echo $mensagem_dias; ?></SPAN>&nbsp;</P>
                                                                </TD>
                                                            </TR>
                                                            <TR STYLE="height:21px">
                                                                <TD STYLE="background-color: rgb(255,255,255); margin-left: 0pt;">
                                                                    <P STYLE="margin-left: 4pt;"><SPAN STYLE="font-family: Verdana,Tahoma,Arial,Helvetica,Sans-serif; font-size: 11px;">Rate per day:</SPAN></P>
                                                                </TD>
                                                                <TD STYLE="background-color: rgb(255,255,255); padding-right: 4pt;">
                                                                    <P STYLE="text-align: right; margin-left: 4pt;"><SPAN STYLE="font-family: Verdana,Tahoma,Arial,Helvetica,Sans-serif; font-size: 11px;"><? echo $preco_dia.' '; ?></SPAN>&nbsp;</P>
                                                                </TD>
                                                            </TR>
                                                            <TR STYLE="height:21px">
                                                                <TD STYLE="background-color: rgb(255,255,255); margin-left: 0pt;">
                                                                    <P STYLE="margin-left: 4pt;"><SPAN STYLE="font-family: Verdana,Tahoma,Arial,Helvetica,Sans-serif; font-size: 11px;">Total car value:</SPAN></P>
                                                                </TD>
                                                                <TD STYLE="background-color: rgb(255,255,255); padding-right: 4pt;">
                                                                    <P STYLE="text-align: right; margin-left: 4pt;"><SPAN STYLE="font-family: Verdana,Tahoma,Arial,Helvetica,Sans-serif; font-size: 11px;"><?
echo "<input type=\"hidden\" value=\"$preco_total\" name=hidden_preco_total_carro>"; 

$preco_total_carro = $preco_total.' ';
echo "<input type=\"text\" value=\"$preco_total_carro\" name=preco_total_carro style='border-width:0px; font-family: Verdana,Tahoma,Arial,Helvetica,Sans-serif,sans-serif; font-size: 11px; font-weight:normal; text-align: right' size='30' readonly='readOnly'>"; 

?>
</SPAN>&nbsp;</P>
                                                                </TD>
                                                            </TR>
                                                            <TR STYLE="height:21px">
                                                                <TD STYLE="background-color: rgb(255,255,255);">
                                                                    <P STYLE="margin-left: 4pt;"><SPAN STYLE="font-family: Verdana,Tahoma,Arial,Helvetica,Sans-serif; font-size: 11px;">Total for extras:</SPAN></P>
                                                                </TD>
                                                                <TD STYLE="background-color: rgb(255,255,255); padding-right: 4pt;">
                                                                    <P STYLE="text-align: right; margin-left: 4pt;"><SPAN STYLE="font-family: Verdana,Tahoma,Arial,Helvetica,Sans-serif; font-size: 11px;"><?
$total_extras_euros = '0,00 ';
echo "<input type=\"text\" value=\"$total_extras_euros\" name=total_extras1 style='border-width:0px; font-family: Verdana,Tahoma,Arial,Helvetica,Sans-serif,sans-serif; font-size: 11px; text-align: right' size='30' readonly='readOnly'>"; 
?>
</SPAN>&nbsp;</P>
                                                                </TD>
                                                            </TR>
                                                            <TR STYLE="height:21px">
                                                                <TD STYLE="background-color: rgb(215,220,232);">
                                                                    <P STYLE="margin-left: 4pt;"><B><SPAN STYLE="font-family: Verdana,Tahoma,Arial,Helvetica,Sans-serif; font-size: 11px;">To be charged from credit card:</SPAN></B></P>
                                                                </TD>
                                                                <TD STYLE="background-color: rgb(215,220,232); padding-right: 4pt;">
                                                                    <P STYLE="text-align: right; margin-left: 4pt;"><B><SPAN STYLE="font-family: Verdana,Tahoma,Arial,Helvetica,Sans-serif; font-size: 13px;"><? echo $charged.' '; ?></SPAN></B>&nbsp;</P>
                                                                </TD>
                                                            </TR>
                                                            <TR STYLE="height:21px">
                                                                <TD STYLE="background-color: rgb(255,255,255);">
                                                                    <P STYLE="margin-left: 4pt;"><SPAN STYLE="font-family: Verdana,Tahoma,Arial,Helvetica,Sans-serif; font-size: 11px;">To be paid on car rental:</SPAN></P>
                                                                </TD>
                                                                <TD STYLE="background-color: rgb(255,255,255); padding-right: 4pt;">
                                                                    <P STYLE="text-align: right; margin-left: 4pt;"><B><SPAN STYLE="font-family: Verdana,Tahoma,Arial,Helvetica,Sans-serif; font-size: 11px;"><?
$balance_euros = $balance.' ';
echo "<input type=\"text\" value=\"$balance_euros\" name=balance1 style='border-width:0px; font-family: Verdana,Tahoma,Arial,Helvetica,Sans-serif,sans-serif; font-size: 11px; font-weight:bold; text-align: right' size='30' readonly='readOnly'>"; 
?>
</SPAN></B>&nbsp;</P>
                                                                </TD>
                                                            </TR>
                                                            <TR STYLE="height:21px">
                                                                <TD STYLE="background-color: rgb(255,255,255); margin-left: 0pt;">
                                                                    <P STYLE="margin-left: 4pt;"><SPAN STYLE="font-family: Verdana,Tahoma,Arial,Helvetica,Sans-serif; font-size: 11px;">Total car rental cost:</SPAN></P>
                                                                </TD>
                                                                <TD STYLE="background-color: rgb(255,255,255); padding-right: 4pt;">
                                                                    <P STYLE="text-align: right; margin-left: 4pt;"><B><SPAN STYLE="font-family: Verdana,Tahoma,Arial,Helvetica,Sans-serif; font-size: 11px;"><?
$preco_total_euros = $preco_total.' ';
echo "<input type=\"text\" value=\"$preco_total_euros\" name=preco_total1 style='border-width:0px; font-family: Verdana,Tahoma,Arial,Helvetica,Sans-serif,sans-serif; font-size: 11px; font-weight:bold; text-align: right;' size='30' readonly='readOnly'>"; 
?>
</SPAN></B>&nbsp;</P>
                                                                </TD>
                                                            </TR>
                                                        </TABLE>
                                                    </TD>
                                                </TR>
                                            </TABLE>
                                        </TD>
                                    </TR>
                                </TABLE>
                            </TD>
                        </TR>
                    </TABLE>
                    <TABLE BORDER="0" CELLSPACING="0" CELLPADDING="0" WIDTH="577">
                        <TR VALIGN="TOP" ALIGN="LEFT">
                            <TD WIDTH="22" HEIGHT="8"><IMG SRC="../assets/images/autogen/clearpixel.gif" WIDTH="22" HEIGHT="1" BORDER="0" ALT=""></TD>
                            <TD></TD>
                        </TR>
                        <TR VALIGN="TOP" ALIGN="LEFT">
                            <TD HEIGHT="95"></TD>
                            <TD WIDTH="555"><DIV ID="LayoutRegion13LYR"><DIV ID="Table75LYR" STYLE="visibility:inherit;top:2px;left:2px;z-index:1;width:551;height:45">
                                <TABLE ID="Table75" BORDER="0" CELLSPACING="0" CELLPADDING="0" WIDTH="100%" STYLE="height: 45;">
                                    <TR STYLE="height:18px">
                                        <TD WIDTH="238" STYLE="background-color: rgb(255,255,255);">
                                            <P>&nbsp;<SPAN STYLE="font-family: Arial,Helvetica,Geneva,Sans-serif; font-size: 11px;"><B>Drop-off destination:</B> <?
function ConvertToJSArray_dest($PArray , $ArrayName, $filas)
{
   $Row = $filas;
   $Col = 2;

   ?>
   <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.bookcarLayout.registos1.value = <?=$Row?>;  
   </SCRIPT>

   <?

}

function ConvertToJSArray2D($PArray , $ArrayName, $filas)
{
   $Row = $filas;
   $Col = 4;

   ?>
   <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.bookcarLayout.registos.value = <?=$Row?>;
   </SCRIPT>

   <?

}

function create_drop_off_destination($Row)
{
   ?>
   <SCRIPT LANGUAGE = 'JAVASCRIPT' >
       drop_off_destination(<?=$Row?>);
   </SCRIPT>
   <?
}

$sql = "SELECT a.cod_regiao, a.cod_localidade, b.descricao, a.endereco ";
$sql = $sql." FROM tr_rentacar_escritorios a, tr_rentacar_localidades b ";
$sql = $sql." WHERE a.cod_localidade = b.cod_localidade ";
$sql = $sql." and a.recolha = 1 ";
$sql = $sql." and a.cod_rentacar = $cod_rentacar ";
$sql = $sql." GROUP BY a.cod_regiao, a.cod_localidade, b.descricao, a.endereco ";
$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];
   $tabela_loc[$i][3] = $row[3];
   $i = $i + 1;
}  
ConvertToJSArray2D($tabela_loc, 'tb_loc', $filas);

$sql = "SELECT a.cod_regiao, b.descricao ";
$sql = $sql." FROM tr_rentacar_escritorios a, tbregiao b ";
$sql = $sql." WHERE a.cod_rentacar = $cod_rentacar ";
$sql = $sql." and a.cod_regiao = b.cod_regiao ";
$sql = $sql." and a.recolha = 1 ";
$sql = $sql." GROUP BY a.cod_regiao, b.descricao ";
$sql = $sql." ORDER BY a.cod_regiao ";
  
$result1  = mysql_query($sql) or die("select fails");   
$num_row1 = mysql_num_rows($result1);

$i = 0;	
while ($row = mysql_fetch_row($result1))
{     
   $tabela_dest[$i][0] = $row[0];
   $tabela_dest[$i][1] = $row[1];
   $i = $i + 1;
}
ConvertToJSArray_dest($tabela_dest, 'tb_dest', $num_row1);   

?>
</SPAN></P>
                                        </TD>
                                        <TD WIDTH="313" STYLE="background-color: rgb(255,255,255);">
                                            <P>&nbsp;<B><SPAN STYLE="font-size: 11px;">Drop-off location:</SPAN></B></P>
                                        </TD>
                                    </TR>
                                    <TR STYLE="height:27px">
                                        <TD STYLE="background-color: rgb(255,255,255);">
                                            <P>&nbsp;
                                                <SELECT ID="ID_car_destination" NAME="car_destination" style="width:180px" class="text_objects" onChange="return(F_e('ID_car_destination', F_CH))">
                                                    <OPTION VALUE="0" SELECTED>Select a destination</OPTION>
                                                </SELECT>
                                                 </P>
                                        </TD>
                                        <TD STYLE="background-color: rgb(255,255,255);">
                                            <P>
                                                <SELECT ID="ID_car_dropoff_loc" NAME="car_dropoff_loc" style="width:180px" class="text_objects" onChange="return(F_e('ID_car_dropoff_loc', F_CH))">
                                                    <OPTION VALUE="0" SELECTED>Select a location</OPTION>
                                                </SELECT>
                                            </P>
                                        </TD>
                                    </TR>
                                </TABLE>
                                </DIV><DIV ID="Table76LYR" STYLE="visibility:inherit;top:48px;left:2px;z-index:2;width:551;height:45">
                                <TABLE ID="Table76" BORDER="0" CELLSPACING="0" CELLPADDING="0" WIDTH="100%" STYLE="height: 45;">
                                    <TR STYLE="height:19px">
                                        <TD WIDTH="238" STYLE="background-color: rgb(255,255,255);">
                                            <P><B>&nbsp;<SPAN STYLE="font-size: 11px;">Hotel name:</SPAN></B></P>
                                        </TD>
                                        <TD WIDTH="313" STYLE="background-color: rgb(255,255,255);">
                                            <P>&nbsp;<SPAN STYLE="font-size: 11px;"> <B>Flight number:</B></SPAN></P>
                                        </TD>
                                    </TR>
                                    <TR STYLE="height:26px">
                                        <TD STYLE="background-color: rgb(255,255,255);">
                                            <P><SPAN STYLE="font-size: 11px;">&nbsp;&nbsp;<INPUT ID="ID_nome_hotel" TYPE="TEXT" NAME="nome_hotel" STYLE="white-space: pre;" VALUE="" SIZE="22" MAXLENGTH="50" style="width:180px" class="text_objects"></SPAN></P>
                                        </TD>
                                        <TD STYLE="background-color: rgb(255,255,255);">
                                            <P><SPAN STYLE="font-size: 11px;">&nbsp;<INPUT ID="ID_nro_voo" TYPE="TEXT" NAME="nro_voo" STYLE="white-space: pre;" VALUE="" SIZE="15" MAXLENGTH="15" class="text_objects"></SPAN></P>
                                        </TD>
                                    </TR>
                                </TABLE>
                                </DIV></DIV>
                            </TD>
                        </TR>
                    </TABLE>
                    <TABLE BORDER="0" CELLSPACING="0" CELLPADDING="0">
                        <TR VALIGN="TOP" ALIGN="LEFT">
                            <TD WIDTH="23" HEIGHT="9"><IMG SRC="../assets/images/autogen/clearpixel.gif" WIDTH="23" HEIGHT="1" BORDER="0" ALT=""></TD>
                            <TD></TD>
                        </TR>
                        <TR VALIGN="TOP" ALIGN="LEFT">
                            <TD></TD>
                            <TD WIDTH="555">
                                <TABLE ID="Table74" BORDER="0" CELLSPACING="0" CELLPADDING="0" WIDTH="100%" STYLE="background-color: rgb(255,255,255); border-left-color:  rgb(255,255,255); border-top-color:  rgb(255,255,255); border-right-color:  rgb(255,255,255); border-bottom-color:  rgb(255,255,255); height: 18;">
                                    <TR STYLE="height:18px">
                                        <TD WIDTH="555" STYLE="background-color: rgb(255,255,255);">
                                            <P STYLE="text-align: center;"><SPAN STYLE="color: rgb(0,102,153);">____________________________________________________________</SPAN></P>
                                        </TD>
                                    </TR>
                                </TABLE>
                            </TD>
                        </TR>
                    </TABLE>
                    <TABLE BORDER="0" CELLSPACING="0" CELLPADDING="0" WIDTH="577">
                        <TR VALIGN="TOP" ALIGN="LEFT">
                            <TD WIDTH="22" HEIGHT="9"><IMG SRC="../assets/images/autogen/clearpixel.gif" WIDTH="22" HEIGHT="1" BORDER="0" ALT=""></TD>
                            <TD WIDTH="555"><IMG SRC="../assets/images/autogen/clearpixel.gif" WIDTH="555" HEIGHT="1" BORDER="0" ALT=""></TD>
                        </TR>
                        <TR VALIGN="TOP" ALIGN="LEFT">
                            <TD></TD>
                            <TD WIDTH="555" CLASS="TextObject" STYLE="background-color: rgb(255,255,255);">
                                <P><?
if ($_SERVER['REQUEST_METHOD'] == "GET") 
{
    create_drop_off_destination($num_row1);
    
    // EXTRAS INCLUIDOS
    $sql = "select a.cod_extra, a.desc_extra, b.cod_interno ";
    $sql = $sql." from tr_rentacar_extras a, tr_rentacar_extras_values b ";
    $sql = $sql." where a.cod_rentacar = b.cod_rentacar ";
    $sql = $sql." and b.cod_rentacar   = $cod_rentacar ";
    $sql = $sql." and a.cod_extra  = b.cod_extra ";
    $sql = $sql." and b.cod_grupo  = '".$cod_grupo."' ";
    $sql = $sql." and b.cod_tarifa = $cod_tarifa ";
    $sql = $sql." and b.incluido   = 1 ";
    $sql = $sql." order by desc_extra ";    

    $result = mysql_query($sql) or die("select extras fails");
    $no     = mysql_num_rows($result);
        
    if ($no!=0) 
    {
        $indice = 1;        
        draw_header_extras_included();                
        while ($row = mysql_fetch_row($result))
        {        
            $desc_extra    = $row[1];
            draw_body_extras_included($desc_extra);
        }
        draw_foot_extras_included();
        echo '<br>';
    }

    // EXTRA FORA HORAS
    $total_extras_eur    = 0;
    $total_fh_extras_eur = 0;

    $time_inicio = "'".$hour_in.":".$min_in."'";

    $sql = "select a.cod_extra, a.desc_extra, b.cod_interno, b.preco ";
    $sql = $sql." from tr_rentacar_extras a, tr_rentacar_extras_values b, ";
    $sql = $sql." tr_rentacar_escritorios c ";
    $sql = $sql." where a.cod_rentacar = b.cod_rentacar ";
    $sql = $sql." and b.cod_rentacar   = $cod_rentacar ";
    $sql = $sql." and c.cod_rentacar   = $cod_rentacar ";
    $sql = $sql." and c.cod_localidade = $pick_up_loc ";
    $sql = $sql." and c.hora_inicio_fora_horas <> '00:00'";
    $sql = $sql." and c.hora_inicio_manha <> '00:00'";
    $sql = $sql." and c.entrega = 1 ";
    $sql = $sql." and (time_to_sec(c.hora_inicio_manha) > time_to_sec(".$time_inicio.")";
    $sql = $sql." or time_to_sec(c.hora_inicio_fora_horas) < time_to_sec(".$time_inicio."))";
    $sql = $sql." and a.cod_extra  = b.cod_extra ";
    $sql = $sql." and b.cod_grupo  = '".$cod_grupo."' ";
    $sql = $sql." and b.cod_tarifa = $cod_tarifa ";
    $sql = $sql." and b.incluido   = 0 ";
    $sql = $sql." and a.extra_fora_horas = 1 ";
    $sql = $sql." order by desc_extra ";    
    
    $result = mysql_query($sql) or die("select extra fora horas fails");
    $no     = mysql_num_rows($result);
        
    if ($no!=0) 
    {
        $indice = 1;
        $hidden_extras = "";        
        draw_header_extras_out_hours();                
        while ($row = mysql_fetch_row($result))
        {        
            $cod_extra_out = $row[0];
            $desc_extra    = $row[1];
            $cod_interno   = $row[2];            
            $preco         = $row[3];   

            $total_extras_eur    = $total_extras_eur + $preco;
            $total_fh_extras_eur = $total_fh_extras_eur + $preco;

            $preco = number_format($preco, 2, '.', '');         
            draw_body_extras_out_hours($desc_extra, $preco);

            $var             = "cod_extra_out".$indice;   
            $var_desc        = "desc_extra_out".$indice;          
            $var_price       = "price_extra_out".$indice;      
            $var_total_price = "price_total_extra_out".$indice;      
        
            $hidden_extras = $hidden_extras."<input type=\"hidden\" value=\"$cod_extra_out\" name=".$var.">";             
            $hidden_extras = $hidden_extras."<input type=\"hidden\" value=\"$desc_extra\" name=".$var_desc.">";   
            $hidden_extras = $hidden_extras."<input type=\"hidden\" value=\"$preco\" name=".$var_price.">";   
            $hidden_extras = $hidden_extras."<input type=\"hidden\" value=\"$preco\" name=".$var_total_price.">";   
            $indice = $indice + 1;
        }
        draw_foot_extras_out_hours();
        echo '<br>';
        echo $hidden_extras;
    }

    // EXTRAS NAO INCLUIDOS
    $sql = "select a.cod_extra, a.desc_extra, b.preco, a.preco_por_dia, b.cod_interno ";
    $sql = $sql." from tr_rentacar_extras a, tr_rentacar_extras_values b ";
    $sql = $sql." where a.cod_rentacar = b.cod_rentacar ";
    $sql = $sql." and b.cod_rentacar   = $cod_rentacar ";
    $sql = $sql." and a.cod_extra  = b.cod_extra ";
    $sql = $sql." and b.cod_grupo  = '".$cod_grupo."' ";
    $sql = $sql." and b.cod_tarifa = $cod_tarifa ";
    $sql = $sql." and b.incluido   = 0 ";
    $sql = $sql." and a.extra_fora_horas = 0 ";
    $sql = $sql." order by desc_extra ";    

    $result = mysql_query($sql) or die("select extras fails");
    $no     = mysql_num_rows($result);
        
    if ($no!=0) 
    {
        $indice = 1;
        $hidden_extras = "";
        draw_header_extras();                
        while ($row = mysql_fetch_row($result))
        {        
            $cod_extra     = $row[0];
            $desc_extra    = $row[1];
            $preco         = $row[2];
            $preco_por_dia = $row[3];
            $cod_interno   = $row[4];
            $preco         = number_format($preco, 2, '.', '');        
            draw_body_extras($indice, $cod_extra, $desc_extra, $preco, $preco_por_dia, $nro_dias, $preco_total);

            $var           = "cod_extra".$indice;      
            $var_desc      = "hidden_desc_extra".$indice;   
            $var_price     = "hidden_price_extra".$indice;   
            $var_hidden    = "hidden_price_total_extra".$indice;
            
            $hidden_extras = $hidden_extras."<input type=\"hidden\" value=\"$cod_extra\" name=".$var.">"; 
            $hidden_extras = $hidden_extras."<input type=\"hidden\" value=\"$desc_extra\" name=".$var_desc.">"; 
            $hidden_extras = $hidden_extras."<input type=\"hidden\" value=\"$preco\" name=".$var_price.">"; 
            $hidden_extras = $hidden_extras."<input type=\"hidden\" value=0 name=".$var_hidden.">"; 
            $indice = $indice + 1;
        }
        draw_foot_extras();
        echo $hidden_extras;
    }    

    echo "<input type='hidden' value='Car' name=Type>"; 
    echo "<input type='hidden' value=1 name=id>"; 
    echo "<input type='hidden' value=$cod_rentacar name=cod_rentacar>"; 
    echo "<input type=\"hidden\" value=\"$nome\" name=desc_rentacar>"; 
    echo "<input type='hidden' value=$cod_regiao name=cod_regiao>"; 
    echo "<input type=\"hidden\" value=\"$desc_regiao\" name=desc_regiao>";      
    echo "<input type='hidden' value=$cod_categoria name=cod_categoria>"; 
    echo "<input type=\"hidden\" value=\"$desc_categoria\" name=desc_categoria>";     
    echo "<input type=\"hidden\" value=\"$cod_grupo\" name=cod_grupo>"; 
    echo "<input type=\"hidden\" value=\"$desc_grupo\" name=desc_grupo>"; 
    echo "<input type='hidden' value=$pick_up_loc name=pick_up_loc>"; 
    echo "<input type=\"hidden\" value=\"$desc_pick_up_loc\" name=desc_pick_up_loc>";
    echo "<input type=\"hidden\" value=\"$data_pickup\" name=data_pickup>";  
    echo "<input type=\"hidden\" value=\"$date1\" name=date1>"; 
    echo "<input type=\"hidden\" value=\"$hour_in\" name=hour1>"; 
    echo "<input type=\"hidden\" value=\"$min_in\" name=min1>";
    echo "<input type=\"hidden\" value=\"$data_drop_off\" name=data_drop_off>";  
    echo "<input type=\"hidden\" value=\"$date2\" name=date2>"; 
    echo "<input type=\"hidden\" value=\"$hour_out\" name=hour2>"; 
    echo "<input type=\"hidden\" value=\"$min_out\" name=min2>"; 
    echo "<input type=\"hidden\" value=\"$nro_dias\" name=nro_dias>"; 
    echo "<input type=\"hidden\" value=\"$comissao\" name=comissao>"; 
    echo "<input type=\"hidden\" value=\"$preco_dia\" name=preco_dia>"; 
    echo "<input type=\"hidden\" value=\"$charged\" name=charged>"; 
    echo "<input type=\"hidden\" value=\"$balance\" name=balance>"; 
    echo "<input type=\"hidden\" value=\"$preco_total\" name=preco_total>"; 
    echo "<input type=\"hidden\" value=0 name=total_extras>"; 
    echo "<input type='hidden' value='' name=special_request>";
    echo "<input type=\"hidden\" value=\"$endereco_pick_up\" name=endereco_pick_up>"; 
    echo "<input type='hidden' value=$cod_tarifa name=cod_tarifa>"; 

    db_disconnect();
}
?>
&nbsp;</P>
                            </TD>
                        </TR>
                    </TABLE>
                    <TABLE BORDER="0" CELLSPACING="0" CELLPADDING="0" WIDTH="577">
                        <TR VALIGN="TOP" ALIGN="LEFT">
                            <TD WIDTH="22" HEIGHT="18"><IMG SRC="../assets/images/autogen/clearpixel.gif" WIDTH="22" HEIGHT="1" BORDER="0" ALT=""></TD>
                            <TD></TD>
                        </TR>
                        <TR VALIGN="TOP" ALIGN="LEFT">
                            <TD HEIGHT="144"></TD>
                            <TD WIDTH="555">
                                <TABLE BORDER="0" CELLSPACING="0" CELLPADDING="0" WIDTH="555" STYLE="background-color: rgb(228,31,31); height: 144;">
                                    <TR ALIGN="LEFT" VALIGN="TOP">
                                        <TD>
                                            <TABLE BORDER="0" CELLSPACING="0" CELLPADDING="0">
                                                <TR VALIGN="TOP" ALIGN="LEFT">
                                                    <TD WIDTH="2" HEIGHT="2"><IMG SRC="../assets/images/autogen/clearpixel.gif" WIDTH="2" HEIGHT="1" BORDER="0" ALT=""></TD>
                                                    <TD></TD>
                                                </TR>
                                                <TR VALIGN="TOP" ALIGN="LEFT">
                                                    <TD></TD>
                                                    <TD WIDTH="551">
                                                        <TABLE ID="Table78" BORDER="0" CELLSPACING="0" CELLPADDING="0" WIDTH="100%" STYLE="height: 139;">
                                                            <TR VALIGN="BOTTOM" STYLE="height:24px">
                                                                <TD COLSPAN="2" STYLE="text-align: center; background-color: rgb(215,220,232);">
                                                                    <P STYLE="text-align: center;"><B><SPAN STYLE="font-family: Verdana,Tahoma,Arial,Helvetica,Sans-serif;">TOTAL VALUES</SPAN></B></P>
                                                                </TD>
                                                            </TR>
                                                            <TR STYLE="height:12px">
                                                                <TD WIDTH="396" STYLE="background-color: rgb(215,220,224);">
                                                                    <P>&nbsp;</P>
                                                                </TD>
                                                                <TD WIDTH="155" STYLE="background-color: rgb(215,220,224);">
                                                                    <P>&nbsp;</P>
                                                                </TD>
                                                            </TR>
                                                            <TR STYLE="height:25px">
                                                                <TD STYLE="background-color: rgb(255,255,255);">
                                                                    <P STYLE="margin-left: 4pt;"><SPAN STYLE="font-family: Verdana,Tahoma,Arial,Helvetica,Sans-serif; font-size: 11px;">Total car value:</SPAN></P>
                                                                </TD>
                                                                <TD STYLE="text-align: right; background-color: rgb(255,255,255);">
                                                                    <P><SPAN STYLE="color: rgb(0,0,0);"><SPAN STYLE="font-family: Verdana,Tahoma,Arial,Helvetica,Sans-serif; font-size: 11px;"><? echo $preco_total.' ';?></SPAN>
</SPAN>&nbsp;</P>
                                                                </TD>
                                                            </TR>
                                                            <TR STYLE="height:19px">
                                                                <TD STYLE="background-color: rgb(255,255,255);">
                                                                    <P STYLE="margin-left: 4pt;"><SPAN STYLE="font-family: Verdana,Tahoma,Arial,Helvetica,Sans-serif; font-size: 11px;">Total for extras:</SPAN></P>
                                                                </TD>
                                                                <TD STYLE="text-align: right; background-color: rgb(255,255,255); padding-right: 4pt;">
                                                                    <P STYLE="text-align: right;"><SPAN STYLE="font-family: Verdana,Tahoma,Arial,Helvetica,Sans-serif; font-size: 11px;"><?
$total_extras_euros = '0,00 ';
echo "<input type=\"text\" value=\"$total_extras_euros\" name=total_extras2 style='border-width:0px; font-family: Verdana,Tahoma,Arial,Helvetica,Sans-serif,sans-serif; font-size: 11px; text-align: right;' size='30' readonly='readOnly'>"; 
?>
</SPAN>&nbsp;</P>
                                                                </TD>
                                                            </TR>
                                                            <TR STYLE="height:21px">
                                                                <TD STYLE="background-color: rgb(215,220,232);">
                                                                    <P STYLE="margin-left: 4pt;"><B><SPAN STYLE="font-family: Verdana,Tahoma,Arial,Helvetica,Sans-serif; font-size: 11px;">To be charged from credit card:</SPAN></B></P>
                                                                </TD>
                                                                <TD STYLE="text-align: right; background-color: rgb(215,220,232); padding-right: 4pt;">
                                                                    <P STYLE="text-align: right;"><B><SPAN STYLE="font-family: Verdana,Tahoma,Arial,Helvetica,Sans-serif; font-size: 11px;"><? echo $charged.' '; ?></SPAN></B>&nbsp;</P>
                                                                </TD>
                                                            </TR>
                                                            <TR STYLE="height:20px">
                                                                <TD STYLE="background-color: rgb(255,255,255);">
                                                                    <P STYLE="margin-left: 4pt;"><SPAN STYLE="font-family: Verdana,Tahoma,Arial,Helvetica,Sans-serif; font-size: 11px;">To be paid on car rental:</SPAN></P>
                                                                </TD>
                                                                <TD STYLE="text-align: right; background-color: rgb(255,255,255); padding-right: 4pt;">
                                                                    <P STYLE="text-align: right;"><B><SPAN STYLE="font-family: Verdana,Tahoma,Arial,Helvetica,Sans-serif; font-size: 11px;"><?
$balance_euros = $balance.' ';
echo "<input type=\"text\" value=\"$balance_euros\" name=balance2 style='border-width:0px; font-family: Verdana,Tahoma,Arial,Helvetica,Sans-serif,sans-serif; font-size: 11px; font-weight:bold; text-align: right' size='30' readonly='readOnly'>"; 
?>
</SPAN></B>&nbsp;</P>
                                                                </TD>
                                                            </TR>
                                                            <TR STYLE="height:18px">
                                                                <TD STYLE="background-color: rgb(255,255,255); margin-left: 0pt;">
                                                                    <P STYLE="margin-left: 4pt;"><SPAN STYLE="font-family: Verdana,Tahoma,Arial,Helvetica,Sans-serif; font-size: 11px;">Total car rental cost:</SPAN></P>
                                                                </TD>
                                                                <TD STYLE="text-align: right; background-color: rgb(255,255,255); padding-right: 4pt;">
                                                                    <P STYLE="text-align: right;"><B><SPAN STYLE="font-family: Verdana,Tahoma,Arial,Helvetica,Sans-serif; font-size: 11px;"><?
$preco_total_euros = $preco_total.' ';
echo "<input type=\"text\" value=\"$preco_total_euros\" name=preco_total2 style='border-width:0px; font-family: Verdana,Tahoma,Arial,Helvetica,Sans-serif,sans-serif; font-size: 11px; font-weight:bold; text-align: right' size='30' readonly='readOnly'>"; 
?>
</SPAN></B>&nbsp;</P>
                                                                </TD>
                                                            </TR>
                                                        </TABLE>
                                                    </TD>
                                                </TR>
                                            </TABLE>
                                        </TD>
                                    </TR>
                                </TABLE>
                            </TD>
                        </TR>
                    </TABLE>
                    <TABLE BORDER="0" CELLSPACING="0" CELLPADDING="0">
                        <TR VALIGN="TOP" ALIGN="LEFT">
                            <TD WIDTH="22" HEIGHT="20"><IMG SRC="../assets/images/autogen/clearpixel.gif" WIDTH="22" HEIGHT="1" BORDER="0" ALT=""></TD>
                            <TD></TD>
                        </TR>
                        <TR VALIGN="TOP" ALIGN="LEFT">
                            <TD></TD>
                            <TD WIDTH="550">
                                <TABLE ID="Table80" BORDER="0" CELLSPACING="0" CELLPADDING="0" WIDTH="100%" STYLE="height: 22;">
                                    <TR STYLE="height:24px">
                                        <TD ALIGN="RIGHT" WIDTH="325" STYLE="padding-right: 5pt;">
                                            <P><INPUT TYPE="BUTTON" NAME="FormsButton1" VALUE="Reserve your car now" ID="Forms Button3" onclick="valida_fields()"></P>
                                        </TD>
                                        <TD ALIGN="LEFT" WIDTH="225" STYLE="padding-left: 5pt;">
                                            <P><INPUT TYPE="BUTTON" NAME="FormsButton4" VALUE="Back" ID="Forms Button4" onclick="javascript:history.back()"></P>
                                        </TD>
                                    </TR>
                                </TABLE>
                            </TD>
                        </TR>
                    </TABLE>
                    <TABLE BORDER="0" CELLSPACING="0" CELLPADDING="0" WIDTH="575">
                        <TR VALIGN="TOP" ALIGN="LEFT">
                            <TD WIDTH="22" HEIGHT="5"><IMG SRC="../assets/images/autogen/clearpixel.gif" WIDTH="22" HEIGHT="1" BORDER="0" ALT=""></TD>
                            <TD WIDTH="553"><IMG SRC="../assets/images/autogen/clearpixel.gif" WIDTH="553" HEIGHT="1" BORDER="0" ALT=""></TD>
                        </TR>
                        <TR VALIGN="TOP" ALIGN="LEFT">
                            <TD></TD>
                            <TD WIDTH="553" CLASS="TextObject">
                                <P><?      
    echo "<SCRIPT LANGUAGE = 'JAVASCRIPT' >calcular_fora_horas(".$total_fh_extras_eur.");</SCRIPT>";
?>&nbsp;</P>
                            </TD>
                        </TR>
                    </TABLE>
                </TD>
            </TR>
        </TABLE>
        <TABLE BORDER="0" CELLSPACING="0" CELLPADDING="0">
            <TR VALIGN="TOP" ALIGN="LEFT">
                <TD HEIGHT="20"></TD>
            </TR>
            <TR VALIGN="TOP" ALIGN="LEFT">
                <TD WIDTH="780">
                    <TABLE ID="Table83" BORDER="0" CELLSPACING="1" CELLPADDING="0" WIDTH="100%" STYLE="background-image: url('../assets/images/f000.jpg'); height: 42;" class="table_esq">
                        <TR STYLE="height:40px">
                            <TD WIDTH="778">
                                <P STYLE="text-align: center;">&nbsp;&nbsp; <SPAN STYLE="font-size: 12px;">&nbsp;<A HREF="../index.php">Home</A> |&nbsp;<A HREF="../html/newsletter.php">Subscribe our Newsletter</A>&nbsp;|&nbsp;<A HREF="../html/custsuport.php">Customer support</A>&nbsp;|&nbsp;<SPAN STYLE="color: rgb(51,102,153);"><A HREF="../html/questions.php">FAQ&#8217;s</A>&nbsp;<SPAN STYLE="color: rgb(40,49,79);">|</SPAN> <SPAN STYLE="color: rgb(51,51,153);"><A HREF="../html/adv.php">Advertise with us</A></SPAN></SPAN>&nbsp;&nbsp;</SPAN>&nbsp;</P>
                            </TD>
                        </TR>
                    </TABLE>
                </TD>
            </TR>
        </TABLE>
        <TABLE BORDER="0" CELLSPACING="0" CELLPADDING="0" WIDTH="780">
            <TR VALIGN="TOP" ALIGN="LEFT">
                <TD HEIGHT="38" WIDTH="780"><IMG ID="Picture352" HEIGHT="38" WIDTH="780" SRC="../assets/images/bb1.gif" BORDER="0" ALT=""></TD>
            </TR>
        </TABLE>
        <TABLE BORDER="0" CELLSPACING="0" CELLPADDING="0" WIDTH="780">
            <TR VALIGN="TOP" ALIGN="LEFT">
                <TD WIDTH="4" HEIGHT="10"><IMG SRC="../assets/images/autogen/clearpixel.gif" WIDTH="4" HEIGHT="1" BORDER="0" ALT=""></TD>
                <TD WIDTH="776"><IMG SRC="../assets/images/autogen/clearpixel.gif" WIDTH="776" HEIGHT="1" BORDER="0" ALT=""></TD>
            </TR>
            <TR VALIGN="TOP" ALIGN="LEFT">
                <TD></TD>
                <TD WIDTH="776" CLASS="TextObject">
                    <P STYLE="text-align: center;"><SPAN STYLE="color: rgb(51,102,153);">Address: <SPAN STYLE="font-family: Tahoma,Verdana,Arial,Helvetica,Sans-serif; font-size: 11px;">Bravacar - Rent a Car, Lda&nbsp; Caminho do Amparo, 2&nbsp;9000-248&nbsp;Funchal - Madeira - Portugal<BR></SPAN></SPAN>&nbsp;</P>
                </TD>
            </TR>
        </TABLE>
        <TABLE BORDER="0" CELLSPACING="0" CELLPADDING="0">
            <TR VALIGN="TOP" ALIGN="LEFT">
                <TD WIDTH="27" HEIGHT="10"><IMG SRC="../assets/images/autogen/clearpixel.gif" WIDTH="27" HEIGHT="1" BORDER="0" ALT=""></TD>
                <TD></TD>
            </TR>
            <TR VALIGN="TOP" ALIGN="LEFT">
                <TD></TD>
                <TD WIDTH="732">
                    <TABLE ID="Table81" BORDER="0" CELLSPACING="0" CELLPADDING="0" WIDTH="100%" STYLE="height: 29;" class="table_esq">
                        <TR STYLE="height:38px">
                            <TD WIDTH="732">
                                <P STYLE="text-align: center;"><SPAN STYLE="font-family: Tahoma,Verdana,Arial,Helvetica,Sans-serif; font-size: 11px; color: rgb(153,153,153);"><BR>Partner sites: <A HREF="http://www.packholidays.com" TARGET="_blank">Packholidays.com</A>&nbsp;|&nbsp;<A HREF="http://www.terrasdeaventura.com" TARGET="_blank">Terras de Aventura </A> |&nbsp;<A HREF="http://www.lasthotelbeds.com" TARGET="_blank">Lasthotelbeds</A>&nbsp;|&nbsp;<A HREF="http://www.eurorelais.net/cgi/eris/extern/pvct/pvct.htm?pvct=zken&amp;Pt=terras&amp;Lo=terras&amp;Cur=eur&amp;Land=alle&amp;Catg=0&amp;T=en&amp;Frames=ja" TARGET="_blank">Accommodations in Europe</A>&nbsp;|&nbsp;<A HREF="http://www.parquetematicodamadeira.pt/en/default.asp" TARGET="_blank">The Madeira Island Theme Park</A><BR></SPAN>&nbsp;</P>
                            </TD>
                        </TR>
                    </TABLE>
                </TD>
            </TR>
        </TABLE>
    </FORM>
    </DIV>
</BODY>
</HTML>
 