<?
   session_start();
?>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<TITLE>forgotpass</TITLE>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=ISO-8859-1">
<META NAME="Generator" CONTENT="NetObjects Fusion 8 for Windows">
<link rel="stylesheet" href="../assets/clases.css" type="text/css" />
<LINK REL=STYLESHEET TYPE="text/css" HREF="../html/style.css">
<LINK REL=STYLESHEET TYPE="text/css" HREF="../html/site.css">
<STYLE>
</STYLE>
</HEAD>
<BODY NOF="(MB=(logout, 212, 65, 0, 0), L=(forgotpassLayout, 760, 310))" STYLE="text-align: center;" TOPMARGIN=0 LEFTMARGIN=0 MARGINWIDTH=0 MARGINHEIGHT=0>
    <TABLE BORDER=0 CELLSPACING=0 CELLPADDING=0 NOF=LY>
        <TR VALIGN=TOP ALIGN=LEFT>
            <TD WIDTH=760>
                <TABLE ID="Table1" BORDER=0 CELLSPACING=0 CELLPADDING=0 WIDTH="100%" HEIGHT=213>
                    <TR HEIGHT=41>
                        <TD WIDTH=760 STYLE="background-color: rgb(255,255,255);">
                            <P>
                                <TABLE WIDTH=760 BORDER=0 CELLSPACING=0 CELLPADDING=0 ALIGN=LEFT NOF=TE>
                                    <TR>
                                        <TD>
                                            <TABLE BORDER=0 CELLSPACING=0 CELLPADDING=0 WIDTH=760 HEIGHT=41 NOF="LayoutRegion1">
                                                <TR ALIGN=LEFT VALIGN=TOP>
                                                    <TD>
                                                        <TABLE CELLPADDING=0 CELLSPACING=0 BORDER=0 WIDTH=654 NOF="LayoutRegion1">
                                                            <TR VALIGN=TOP ALIGN=LEFT>
                                                                <TD>
                                                                    <TABLE BORDER=0 CELLSPACING=0 CELLPADDING=0 WIDTH=425 NOF="LayoutRegion1">
                                                                        <TR VALIGN=TOP ALIGN=LEFT>
                                                                            <TD WIDTH=409 HEIGHT=16><IMG SRC="../assets/images/autogen/clearpixel.gif" WIDTH=409 HEIGHT=1 BORDER=0 ALT=""></TD>
                                                                            <TD></TD>
                                                                        </TR>
                                                                        <TR VALIGN=TOP ALIGN=LEFT>
                                                                            <TD HEIGHT=15></TD>
                                                                            <TD WIDTH=16><IMG ID="Picture2" HEIGHT=15 WIDTH=16 SRC="../assets/images/ihhomicon1.jpg" BORDER=0 ALT="ihhomicon" TITLE="ihhomicon"></TD>
                                                                        </TR>
                                                                    </TABLE>
                                                                </TD>
                                                                <TD>
                                                                    <TABLE BORDER=0 CELLSPACING=0 CELLPADDING=0 WIDTH=56 NOF="LayoutRegion1">
                                                                        <TR VALIGN=TOP ALIGN=LEFT>
                                                                            <TD WIDTH=2 HEIGHT=17><IMG SRC="../assets/images/autogen/clearpixel.gif" WIDTH=2 HEIGHT=1 BORDER=0 ALT=""></TD>
                                                                            <TD WIDTH=54><IMG SRC="../assets/images/autogen/clearpixel.gif" WIDTH=54 HEIGHT=1 BORDER=0 ALT=""></TD>
                                                                        </TR>
                                                                        <TR VALIGN=TOP ALIGN=LEFT>
                                                                            <TD></TD>
                                                                            <TD WIDTH=54 CLASS="TextObject">
                                                                                <P><B><U><SPAN STYLE="font-size: 10px;">Home</SPAN></U></B></P>
                                                                            </TD>
                                                                        </TR>
                                                                    </TABLE>
                                                                </TD>
                                                                <TD>
                                                                    <TABLE BORDER=0 CELLSPACING=0 CELLPADDING=0 WIDTH=21 NOF="LayoutRegion1">
                                                                        <TR VALIGN=TOP ALIGN=LEFT>
                                                                            <TD WIDTH=5 HEIGHT=16><IMG SRC="../assets/images/autogen/clearpixel.gif" WIDTH=5 HEIGHT=1 BORDER=0 ALT=""></TD>
                                                                            <TD></TD>
                                                                        </TR>
                                                                        <TR VALIGN=TOP ALIGN=LEFT>
                                                                            <TD HEIGHT=15></TD>
                                                                            <TD WIDTH=16><IMG ID="Picture3" HEIGHT=15 WIDTH=16 SRC="../assets/images/ihemail1.jpg" BORDER=0 ALT="ihemail" TITLE="ihemail"></TD>
                                                                        </TR>
                                                                    </TABLE>
                                                                </TD>
                                                                <TD>
                                                                    <TABLE BORDER=0 CELLSPACING=0 CELLPADDING=0 WIDTH=84 NOF="LayoutRegion1">
                                                                        <TR VALIGN=TOP ALIGN=LEFT>
                                                                            <TD WIDTH=2 HEIGHT=17><IMG SRC="../assets/images/autogen/clearpixel.gif" WIDTH=2 HEIGHT=1 BORDER=0 ALT=""></TD>
                                                                            <TD WIDTH=82><IMG SRC="../assets/images/autogen/clearpixel.gif" WIDTH=82 HEIGHT=1 BORDER=0 ALT=""></TD>
                                                                        </TR>
                                                                        <TR VALIGN=TOP ALIGN=LEFT>
                                                                            <TD></TD>
                                                                            <TD WIDTH=82 CLASS="TextObject">
                                                                                <P><B><U><SPAN STYLE="font-size: 10px;">Contacte-nos</SPAN></U></B></P>
                                                                            </TD>
                                                                        </TR>
                                                                    </TABLE>
                                                                </TD>
                                                                <TD>
                                                                    <TABLE BORDER=0 CELLSPACING=0 CELLPADDING=0 WIDTH=24 NOF="LayoutRegion1">
                                                                        <TR VALIGN=TOP ALIGN=LEFT>
                                                                            <TD WIDTH=7 HEIGHT=15><IMG SRC="../assets/images/autogen/clearpixel.gif" WIDTH=7 HEIGHT=1 BORDER=0 ALT=""></TD>
                                                                            <TD></TD>
                                                                        </TR>
                                                                        <TR VALIGN=TOP ALIGN=LEFT>
                                                                            <TD HEIGHT=17></TD>
                                                                            <TD WIDTH=17><IMG ID="Picture7" HEIGHT=17 WIDTH=17 SRC="../assets/images/ihgobutton031.jpg" BORDER=0 ALT="ihgobutton03" TITLE="ihgobutton03"></TD>
                                                                        </TR>
                                                                    </TABLE>
                                                                </TD>
                                                                <TD>
                                                                    <TABLE BORDER=0 CELLSPACING=0 CELLPADDING=0 WIDTH=44 NOF="LayoutRegion1">
                                                                        <TR VALIGN=TOP ALIGN=LEFT>
                                                                            <TD WIDTH=6 HEIGHT=17><IMG SRC="../assets/images/autogen/clearpixel.gif" WIDTH=6 HEIGHT=1 BORDER=0 ALT=""></TD>
                                                                            <TD WIDTH=38><IMG SRC="../assets/images/autogen/clearpixel.gif" WIDTH=38 HEIGHT=1 BORDER=0 ALT=""></TD>
                                                                        </TR>
                                                                        <TR VALIGN=TOP ALIGN=LEFT>
                                                                            <TD></TD>
                                                                            <TD WIDTH=38 CLASS="TextObject">
                                                                                <P><B><U><SPAN STYLE="color: rgb(255,102,0);">Ajuda</SPAN></U></B></P>
                                                                            </TD>
                                                                        </TR>
                                                                    </TABLE>
                                                                </TD>
                                                            </TR>
                                                        </TABLE>
                                                    </TD>
                                                </TR>
                                            </TABLE>
                                        </TD>
                                    </TR>
                                </TABLE>
                            </P>
                        </TD>
                    </TR>
                    <TR HEIGHT=138>
                        <TD>
                            <P><IMG ID="Banner2" HEIGHT=137 WIDTH=760 SRC="../assets/images/autogen/_NDefault.jpg" VSPACE=0 HSPACE=0 ALIGN="TOP" BORDER=0 ALT="" NOF=B_H></P>
                        </TD>
                    </TR>
                    <TR HEIGHT=32>
                        <TD STYLE="background-color: rgb(255,255,255); background-image: url('../assets/images/ihnavbg1.jpg');">
                            <H1 STYLE="text-align: center;"><SPAN STYLE="font-size: x-small; font-weight: normal;"></SPAN></TD>
                    </TR>
                    <TR HEIGHT=1>
                        <TD STYLE="background-color: rgb(255,255,255); background-image: url('../assets/images/ihtop31.gif');">
                            <P></P>
                        </TD>
                    </TR>
                </TABLE>
            </TD>
        </TR>
    </TABLE>
    <TABLE BORDER=0 CELLSPACING=0 CELLPADDING=0 WIDTH=760 NOF=LY>
        <TR VALIGN=TOP ALIGN=LEFT>
            <TD HEIGHT=310 WIDTH=760>
                <TABLE BORDER=0 CELLSPACING=0 CELLPADDING=0 WIDTH=760 HEIGHT=310 STYLE="background-color: rgb(237,237,237);" NOF="LayoutRegion3">
                    <TR ALIGN=LEFT VALIGN=TOP>
                        <TD>
                            <TABLE BORDER=0 CELLSPACING=0 CELLPADDING=0 WIDTH=549 NOF="LayoutRegion3">
                                <TR VALIGN=TOP ALIGN=LEFT>
                                    <TD WIDTH=208 HEIGHT=18><IMG SRC="../assets/images/autogen/clearpixel.gif" WIDTH=208 HEIGHT=1 BORDER=0 ALT=""></TD>
                                    <TD WIDTH=341><IMG SRC="../assets/images/autogen/clearpixel.gif" WIDTH=341 HEIGHT=1 BORDER=0 ALT=""></TD>
                                </TR>
                                <TR VALIGN=TOP ALIGN=LEFT>
                                    <TD></TD>
                                    <TD WIDTH=341 CLASS="TextObject">
                                        <P><?
   include('main.php');
   db_connect();
 	
   if (isset($_REQUEST['email']))
       $email = $_REQUEST['email'];

   if (isset($email)) 
   {
	$sql="select login, password, email_contacto from tbfornecedor, tbcontactos ";
       $sql=$sql." where tbfornecedor.cod_empresa = tbcontactos.cod_empresa ";
       $sql=$sql." and tbfornecedor.tipo_empresa = tbcontactos.tipo_empresa ";
       $sql=$sql." and email_contacto='$email'";
	$result=mysql_query($sql);

	$num_row=mysql_num_rows($result);

	if($num_row!=0) 
       {                
          $row = mysql_fetch_row($result);     	         

          $username = $row[0];
          $password = $row[1];
          $msg = "
                     
	   Utilizador e palavra-passe para painel de rentacar.
	   Por favor, guardar num lugar seguro.

	   Seu utilizador é:    $username
	   Sua palavra-passe é: $password

	   - Obrigada
          Netrent - Rent a car

          ";

          mail("$email", "Palavra-passe para Netrent - Rent a car", "$msg", "From:".FROMEMAIL." \nReply-To: ".FROMEMAIL."");
          echo '<BR><CENTER><P STYLE="text-align: justify;"><B><SPAN STYLE="font-family: Tahoma,Verdana,Arial,Helvetica,Sans-serif,sans-serif; font-size: 11px;">Sua palavra-passe foi enviada de forma exitosa!</SPAN></B></P></CENTER>';      

          echo '<INPUT TYPE=BUTTON VALUE="Voltar" ID="ID_btBack" class="text_objects" onclick="history.back();">';        
       } 
       else
       {
          $mensagem = '<BR><CENTER><P STYLE="text-align: justify;"><B><SPAN STYLE="font-family: Tahoma,Verdana,Arial,Helvetica,Sans-serif,sans-serif; font-size: 11px;">Este email não existe na nossa base de dados.</SPAN></B></P></CENTER>';
          echo $mensagem;		
          echo '<INPUT TYPE=BUTTON VALUE="Back" ID="ID_btBack" class="text_objects" onclick="history.back();">';	
       }
    } 
    else 
    {
       $mensagem = '<BR><P STYLE="text-align: justify;"><SPAN STYLE="font-family: Tahoma,Verdana,Arial,Helvetica,Sans-serif,sans-serif; font-size: 11px;"><b>Para receber seu utilizador e palavra-passe</b>, por favor indique seu email de contacto e brevemente será enviada a informação.</SPAN></B></P><BR><BR>';
       echo $mensagem;             

       echo "<form action='forgotpass.php' method='post' class='text_objects'>";
       echo "<B><SPAN STYLE='font-family: Tahoma,Verdana,Arial,Helvetica,Sans-serif,sans-serif; font-size: 11px;'>Email: </SPAN></B>&nbsp;<input type='text' name='email' class='text_objects' maxlength=30 size=28>";
       
       echo "&nbsp;&nbsp;<input type=submit name=submit value=Enviar class='text_objects'></form><br>";
       echo '<INPUT TYPE=BUTTON VALUE="Voltar" ID="ID_btBack" class="text_objects" onclick="history.back();">';

    }

    db_disconnect();
?>&nbsp;</P>
                                    </TD>
                                </TR>
                            </TABLE>
                        </TD>
                    </TR>
                </TABLE>
            </TD>
        </TR>
        <TR VALIGN=TOP ALIGN=LEFT>
            <TD HEIGHT=65 WIDTH=760>
                <TABLE BORDER=0 CELLSPACING=0 CELLPADDING=0 WIDTH=760 HEIGHT=65 STYLE="background-color: rgb(0,51,102);" NOF="LayoutRegion6">
                    <TR ALIGN=LEFT VALIGN=TOP>
                        <TD>
                            <TABLE BORDER=0 CELLSPACING=0 CELLPADDING=0 WIDTH=567 NOF="LayoutRegion6">
                                <TR VALIGN=TOP ALIGN=LEFT>
                                    <TD WIDTH=215 HEIGHT=29><IMG SRC="../assets/images/autogen/clearpixel.gif" WIDTH=215 HEIGHT=1 BORDER=0 ALT=""></TD>
                                    <TD WIDTH=352><IMG SRC="../assets/images/autogen/clearpixel.gif" WIDTH=352 HEIGHT=1 BORDER=0 ALT=""></TD>
                                </TR>
                                <TR VALIGN=TOP ALIGN=LEFT>
                                    <TD></TD>
                                    <TD WIDTH=352 CLASS="TextObject">
                                        <P STYLE="text-align: center;"><B><SPAN STYLE="color: rgb(255,255,255);">Copyright Bravacar 2006</SPAN></B></P>
                                    </TD>
                                </TR>
                            </TABLE>
                        </TD>
                    </TR>
                </TABLE>
            </TD>
        </TR>
    </TABLE>
</BODY>
</HTML>
 