<?php

include "includefilemng.php";


$sql = "select sendemailid,site_name,username,pass  from admin";
$result = mysql_query($sql);
$data_admin = mysql_fetch_object($result);
$sendemailid = $data_admin->sendemailid;
$site_name =  $data_admin->site_name;
$fromemailid = $sendemailid;

 $flag=1;

		if(isset($_POST["submitemail"]))
		{ 
		$email=$_POST['mailid'];
		 $subject="$site_name";
		$tablename="admin";
		
		$sql="select * from ".$tablename." where sendemailid='$email'";		
		$query=mysql_query($sql);
		$res=mysql_fetch_object($query);	
		$count=mysql_num_rows($query);
		
			if($count >0)
			{			
			$username=$res->username;
			$mail=$res->sendemailid;
			$paswd=$res->pass;						
			include "password_mail.php";		
			$errmsg = "Your Password has been sent to your email Address";
			$flag=0;
			}
			else
			{   
			$errmsg ="<br>"."Your email address is not found."."<br>";
			$flag=1;			
			}
		}
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Control Panel</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link href="ssi.css" rel="stylesheet" type="text/css">
<script language="JavaScript" type="text/JavaScript">
<!--
function MM_goToURL() { //v3.0
  var i, args=MM_goToURL.arguments; document.MM_returnValue = false;
  for (i=0; i<(args.length-1); i+=2) eval(args[i]+".location='"+args[i+1]+"'");
}
</script>
</head>
<body>
<table width="98%" border="0" cellspacing="0" cellpadding="2" align="center">
  <tr>
    <td width="1%"></td>
	<td width="98%"><table width="100%"  border="0" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF">
  <tr>
    <td height="100%" align="left" valign="top"><table width="100%"  border="0" cellpadding="0" cellspacing="0" bgcolor="#4C719B">
  <tr>
    <td width="51%" height="45" align="left" valign="top" background="panelimages/bg.gif"   class="blacklogTxt"> </td>
    <td width="33%" align="center" valign="middle"  background="panelimages/bg.gif" class="blacklogTxt" >CONTROL PANEL </td>
    <td width="16%"  background="panelimages/bg.gif" class="blacklogTxt">&nbsp;</td>
  </tr>
</table></td>
  </tr>
</table>
<table width="100%" border="0" cellpadding="2" cellspacing="0" class="darkassback">
  <tr>
    <td height="25" class="topPanelText">&nbsp;</td>
  </tr>
</table>
</td>

  </tr>
  <tr>
   <td width="1%"></td>
    <td width="98%"><table width="100%"  border="0" cellpadding="0" cellspacing="0" class="centertable">
      <tr>
        <td><table width="100%"  border="0" align="center" cellpadding="0" cellspacing="0">
          <tr>
            <td height="50"><span class="bigblueTxt"> </span></td>
          </tr>
          <tr>
            <td>
              <table width="80%"  border="0" align="center" cellpadding="0" cellspacing="0">
         
          <tr>
            <td class="errFont"><?php 
		  if(isset($errmsg))
					                   {
					                 $errmsg = $errmsg;
					                 echo "$errmsg" ;
					                     }
				                       ?>
            </td>
          </tr>
          <tr>
            <td>
			
              <table width="100%"  border="0" cellpadding="2" cellspacing="0">
                <form method="POST" action="" name="SaveForm"  enctype="multipart/form-data" ID="SaveForm">
                 
                  <tr>
                    <td colspan="5" class="hhead" >Retrive Password</td>
                  </tr>
                  <tr>
                    <td class="bluebold">&nbsp;</td>
                    <td colspan=4>&nbsp;</td>
                  </tr>
                  <tr>
                    <td width="22%" class="bluebold">Enter your email </td>
                    <td width="78%" colspan=4><input type="text" name="mailid" id="mailid" class="inputBOX" /></td>
                  </tr>
                  <tr>
                   
				  
				   
                 
                  <tr valign="bottom">
                    <td align="left" class="bluebold">&nbsp;</td>
                    <td colspan=4>&nbsp;</td>
                  </tr>
                  <tr valign="bottom">
                    <td align="right">&nbsp;</td>
                    <td colspan=4>
                      <input name="submitemail" type="submit" class="hbutton" value="Submit" />
					   <input name="cancel" type="submit" class="hbutton" id="cancel" onClick="MM_goToURL('parent','index.php');return document.MM_returnValue" value="CANCEL" />
					   
                     </td>
                  </tr>
                  
                  <tr>
                    <td colspan="5">&nbsp;</td>
                  </tr>
                </form>
            </table></td>
          </tr>
        </table></td>
          </tr>
        </table></td>
      </tr>
    </table></td>
    <td width="1%"></td>
  </tr>
  <tr>
    <td width="1%"></td>
	<td><?php include_once "footer.php";?></td>
	<td width="1%"></td>
  </tr>
</table>
</body>
</html>
