<?php
//取回密码界面
//fetchpassword.php,getadminpassword.php,resetpass.php

	require_once('inc/conn.php');
	require_once('inc/constant.php');
	$opendb=new mydb();
	$config_sql="select * from ls_config ";
	$config_query=$opendb->query($config_sql);
	$config_rows=mysql_fetch_assoc($config_query);
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<link href="css/admin.css" rel="stylesheet" type="text/css">
<title>找回密码</title>
<script language="JavaScript" type="text/JavaScript">

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
	d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_validateForm() { //v4.0
  var i,p,q,nm,test,num,min,max,errors='',args=MM_validateForm.arguments;
  for (i=0; i<(args.length-2); i+=3) { test=args[i+2]; val=MM_findObj(args[i]);
	if (val) { nm=val.name; if ((val=val.value)!="") {
	  if (test.indexOf('isEmail')!=-1) { p=val.indexOf('@');
		if (p<1 || p==(val.length-1)) errors+='- '+nm+' 必须是邮箱地址.\n';
	  } else if (test!='R') { num = parseFloat(val);
		if (isNaN(val)) errors+='- '+nm+' 必须包含数字.\n';
		if (test.indexOf('inRange') != -1) { p=test.indexOf(':');
		  min=test.substring(8,p); max=test.substring(p+1);
		  if (num<min || max<num) errors+='- '+nm+' must contain a number between '+min+' and '+max+'.\n';
	} } } else if (test.charAt(0) == 'R') errors += '- '+nm+' 不能为空：\n'; }
  } if (errors) alert('请更正下列错误:\n'+errors);
  document.MM_returnValue = (errors == '');
}
//-->
</script>
</head>

<body>
<table width="80%" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#6396D6">
  <tr>
    <td height="33" background="images/admin_bg.gif"><div align="center"><font color="#FFFFFF"><strong>找回密码 </strong></font></div></td>
  </tr>
  <tr>
    <td height="297" align="center" valign="top" bgcolor="#E8F1FF"><br>
      <form action="" method="post" name="form1">
  <p>&nbsp;</p>
  <p>&nbsp;</p>
      <table width="65%" height="215" border="0" align="center" cellpadding="0" cellspacing="0" id="table11">
        <tr  >
          <td width="118" align="right" ><span class="STYLE1">&nbsp;用户名：</span></td>
          <td width="25" height="34" align="center" >&nbsp;</td>
          <td width="349" ><div align="left">
              <input type="text" name="admin" size="10" width="200" style="width:180px" maxlength="20"  onmouseover="this.style.background='#FDE8FF';" onmouseout="this.style.background='#FFFFFF'" onfocus="this.select(); " />
          </div></td>
          </tr>
        <tr  >
          <td align="right" ><span style="letter-spacing: -1pt"><span class="STYLE1">网站 Email：</span></td>
          <td height="33" align="center" >&nbsp;</td>
          <td width="349" align="left"><span style="letter-spacing: -1pt">
            <input type="text" name="adminemail" size="24" maxlength="20" style="width:180px" onmouseover="this.style.background='#FDE8FF';" onmouseout="this.style.background='#FFFFFF'" onfocus="this.select(); " />
          （系统配置中）
		  </span></td>
          </tr>
        <tr  >
          <td align="right" ><span style="font-size: 9pt; font-family: 宋体,MingLiU, Arial; color: #000000; table-layout: fixed; word-break: break-all">验证码</span>：</td>
          <td height="37" align="center" >&nbsp;</td>
          <td align="left"><span style="font-size: 9pt; font-family: 宋体,MingLiU, Arial; color: #000000; table-layout: fixed; word-break: break-all">
            <input type="text" name="code" size="10" onmouseover="this.style.background='#FDE8FE';" onmouseout="this.style.background='#FFFFFF'" onfocus="this.select(); " />
            <img src="inc/code.php" border="0" valign="bottom" />
            <input type="hidden" name="ls" id="hiddenField" value="forget" />
          </span></td>
          </tr>
        <tr  >
          <td height="40" colspan="3" align="center" ><span style="font-size: 9pt; font-family: 宋体,MingLiU, Arial; color: #000000; table-layout: fixed; word-break: break-all">
            <input type="button" name="button" id="button" value="找回密码"   onclick="MM_validateForm('admin','','R','adminemail','','isEmail');if(document.MM_returnValue){form1.action='getadminpassword.php';form1.submit();};return document.MM_returnValue" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input type="reset" name="button" id="button" value="重置" />
                    </span></td>
          </tr>
    
      </table>
      </form>
      <br></td>
  </tr>
</table>
</body>
</html>
