<?include("includes/connection.php")?>
<?include("includes/func.php")?>
<html>
<head>
<link href="images/class.css" rel="stylesheet" type="text/css">
<title>Forget Your Login/Password </title>
</head>
<?
?>
<body>
<?$step=6;
//include("stepstop.php")?>
<?if ($_POST["submitlogin"]!='')
 {
	 
	 $_SESSION["errmsg"]="";
	
	if ($_POST["your_name"]=='')
		    $_SESSION["errmsg"].="@Name Should not be blank";
	if ($_POST["your_email"]=='')
		    $_SESSION["errmsg"].="@Email Address  Should not be blank";
	if (!eregi('^[a-zA-Z0-9._-]+@[a-zA-Z0-9._-]+\.([a-zA-Z]{2,4})$',$_POST["your_email"]) && $_POST["your_email"]!='') 
			$_SESSION["errmsg"].="@Email Address  does not looks like valid.";
	
	
	
	if ($_SESSION["errmsg"]=='')
	{
		$sql="select user_name,password from user_master where active=1 and user_type=3 and email='".pdbfx("your_email")."'";
	
		$cmd = mysql_query($sql);
		$rs = mysql_fetch_array($cmd);
	 
		if ($rs[0]=='') {
				$_SESSION["errmsg"]="@The Email address you entered does not match wil any existing user.You can register again using this email.";
		}

	} //end for new login check



	if ($_SESSION["errmsg"]==''){ //Insert Order
			
			
						$login_name=$rs["user_name"];
						$password=$rs["password"];
						
						$emaildetails="<table width='100%' border='0' cellspacing='1' cellpadding='2' bgcolor='#EEB94A'><tr align='center' class='heading'> 
							<td  align=left width='40%' bgcolor='#FFFFFF'><font  size=2><strong>Your Login Name:</strong></font></td>
							<td class='toplinks' align=left width='60%' bgcolor='#FFFFFF'><font  size=2>".$login_name."</font></td>
						 </tr>
						<tr align='center' class='heading'> 
							<td  align=left width='40%' bgcolor='#FFFFFF'><font  size=2><strong>Your Login Password</strong></font></td>
							<td class='toplinks' align=left width='60%' bgcolor='#FFFFFF'><font  size=2>".$password."</font></td>
						 </tr></table>";
						$orderdetails=$emaildetails.$orderdetails;
			

		$orderdetails="Dear ".pdbfx('your_name').",<br>Your Requested Login name and Password for ATI website are mentioned below.<br>".$orderdetails;
		echo "<font class=text><font color=red><br>An Email is sent to your email address <strong><font color=red> ".pdbfx("your_email")."</font></strong> with your login name & password.The email should arrive at your mailbox in few seconds.If you face any difficulty please email us at CS@ACATRI.COM</font>";
		$headers = "From:cs@acatri.com\nContent-Type: text/html";
		mail(pdbfx("your_email"),"Your Login / Password For ATI Website",$orderdetails,$headers);
		
				
		?>
		<tr>

<td bgcolor="#FFFFFF" class="toplinks"><a href='javascript:window.close();'><u>Close Window</u></a>

		</td>	
</tr>
		<table width="100%" border="0" cellspacing="1" cellpadding="2" ><tr>
</table>
		<?
		die;
	}
}
	?>
 <form name=step3 action="" method=POST>

				  <input type=hidden name=product value="<?=gdbfx("product");?>">
				  
<?if ($_SESSION["errmsg"]!=''){?>
<table width="100%" border="0" cellspacing="1" cellpadding="2">
				  <tr>
		<td class="text"><span class="heading">
			<font color=red>Wait!You are not done yet.Please correct these errors and submit again:</font><br>

	<?}?>
		<?if ($_SESSION["errmsg"]!='')
			{
				$temp=split("@",$_SESSION["errmsg"]);
					for($i = 1; $i < count($temp); $i++){ 
							echo "<img src='images/icons/help.gif'> &nbsp; ". $temp[$i] ."<br>";
						}
			$_SESSION["errmsg"]='';
			?>
		</span><br>
		  <br>
		 </td>
	  </tr>
	 </table>
			<?}?>


<table width="100%" border="0" cellspacing="1" cellpadding="2" bgcolor="#EEB94A">


<tr align="center" class="heading"> 
	<td  align=left width="100%" bgcolor="#FFFFFF" colspan=2>
	Please enter your name & email address below and we will sent your Login Name & password to that email address.
<table>
	<tr align="center" class="heading"> 
	<td  align=left width="30%" bgcolor="#FFFFFF"><font  size=2><strong>Your Complete Name</strong></font></td>
	<td class="toplinks" align=left width="70%" bgcolor="#FFFFFF"><input type=text class=input name=your_name size=40 maxlength=40 value="<?=pdbfx("your_name");?>"></td>
 </tr>
<tr align="center" class="heading"> 
	<td  align=left width="30%" bgcolor="#FFFFFF"><font  size=2><strong>Email Address</strong></font></td>
	<td class="toplinks" align=left width="70%" bgcolor="#FFFFFF"><input type=text class=input name=your_email size=40 maxlength=40 value="<?=pdbfx("your_email");?>"></td>
 </tr>
 <?echo "<tr>";
echo "<td align=center colspan=\"2\" class=toplinks>Please use the valid email you used earlier to register,Your Login Name & password will be email to this Email address.</td></tr></table>";?>
	</table>
</td>
 </tr>
 
</table>



<table width="100%" border="0" cellspacing="1" cellpadding="2">
<?echo "<tr>";
echo "<td align=center  class=toplinks><td align=center  class=toplinks><input type=submit name=submitlogin value=\"Submit\" class=button></form></td></tr></table>";?>






<script>
function openWin(argURL, argSize) {

	window.open(argURL, "x_win" + (new Date()).getTime(), "resizable=yes,scrollbars=yes," + argSize);

}
</script>
</body>
</html>