<?php require("conn.php"); ?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title><?php if ($_GET['disp_type']!='find_password') { ?>会员登录<?php } else { ?>找回密码<?php } ?></title>
<style type="text/css">
<!--
body {
	margin-left: 0px;
	margin-top: 0px;
	margin-right: 0px;
	margin-bottom: 0px;
}
-->
</style></head>
<script language="javascript">
function refresh_code() { user_form.imgcode.src="verifycode.php?a="+Math.random(); }
function onfocus_check(id) { id.style.border='2px #FF0000 solid'; }
function onblur_check(id) { id.style.border='1px #6CB5FF solid'; }
function user_form_check() {
if (user_form.userpassword.value=='') { alert('请输入密码!'); user_form.userpassword.focus(); return false; }
if (user_form.userpassword_1.value=='') { alert('请再次输入密码!'); user_form.userpassword_1.focus(); return false; }
if (user_form.userpassword.value!=user_form.userpassword_1.value) { alert('两次输入密码必须相同!'); user_form.userpassword_1.focus(); return false; }
}
</script>
<body onLoad="javascript:sort_list('');"><table width="100%" height="110"  border="0" cellpadding="0" cellspacing="0">
  <tr><td height="13" align="center">&nbsp;</td></tr>
  <tr>
    <td height="80" align="center"><table width="970" border="0" cellpadding="0" cellspacing="0" style="font-size:12px;">
      <tr>
        <td width="310"><img src="images/logo.jpg" width="310" height="80"></td>
        <td align="right">&nbsp;</td>
		</tr>
    </table></td>
  </tr>
  <tr>
    <td style="height:10px;"></td>
  </tr>
</table><table width="100%"  border="0" cellpadding="0" cellspacing="0">
         <tr><td align="center"><?php switch ($_GET['disp_type']) { case 'login': ?><form name="user_form" method="post" action="login_action.php?type_action=login" onSubmit="return user_form_check()" enctype="multipart/form-data"><table width="970" border="0" cellpadding="0" cellspacing="0" style="border:1px #BCDFFF solid;">
            <tr>
              <td height="30" colspan="3" align="left" background="images/sort_top.jpg"><table width="960" border="0" cellpadding="0" cellspacing="0">
                  <tr>
                    <td width="120" align="left" style="font-size:14px;font-weight:bold;">　会员登录</td>
                    <td width="850" style="font-size:12px;">&nbsp;</td>
                  </tr>
              </table></td>
            </tr>
            <tr><td height="20" colspan="3"></td></tr>
            <tr>
              <td width="200" height="40" align="left" style="font-size:12px;line-height:160%;"> <font color="#FF0000">&nbsp; </font></td>
              <td width="300" align="left" style="font-size:12px;line-height:160%;">用 户 名：
              <input type="text" name="username" style="width:200px;height:20px;line-height:20px;border:1px #6CB5FF solid;" onFocus="javascript:onfocus_check(username);" onBlur="javascript:onblur_check(username);"></td>
              <td width="470" rowspan="3" align="center" style="font-size:12px;line-height:160%;"><a href="register.php"><img src="images/register_button_1.jpg" width="150" height="50" border="0"></a></td>
            </tr>
            <tr>
              <td height="40" align="left" style="font-size:12px;line-height:160%;">&nbsp;              </td>
              <td height="40" align="left" style="font-size:12px;line-height:160%;">密　　码：
              <input name="userpassword" type="password" style="width:200px;height:20px;line-height:20px;border:1px #6CB5FF solid;" onFocus="javascript:onfocus_check(userpassword);" onBlur="javascript:onblur_check(userpassword);"></td>
            </tr>
            <tr>
              <td height="40" align="left" style="font-size:12px;line-height:160%;"><label for="code">  </label></td>
              <td height="40" align="left" style="font-size:12px;line-height:160%;"><label for="code">验 证 码：</label>
                <input type="text" name="code" id="textfield" style="width:40px;height:20px;line-height:20px;border:1px #6CB5FF solid;" onFocus="javascript:onfocus_check(code);" onBlur="javascript:onblur_check(code);"/>
                <a href="javascript:refresh_code();"><img id="imgcode" src="VerifyCode.php" alt="验证码" border="0" /></a> </td>
            </tr>
            <tr>
              <td height="80" align="center" style="font-size:12px;line-height:160%;">&nbsp;              </td>
              <td height="80" align="center" style="font-size:12px;line-height:160%;"><input name="imageField" type="image" src="images/login_button.jpg" width="60" height="30" border="0"></td>
              <td height="80" align="center" style="font-size:12px;line-height:160%;">&nbsp;</td>
            </tr>			
			</table>
        </form>
		<?php break; case 'find_password': ?>
		<form action="login.php?disp_type=question_ask" name="user_form" method="post">
        <table width="970" border="0" cellpadding="0" cellspacing="0" style="border:1px #BCDFFF solid;">
          <tr>
            <td height="30" colspan="2" align="left" background="images/sort_top.jpg"><table width="960" border="0" cellpadding="0" cellspacing="0">
                <tr>
                  <td width="120" align="left" style="font-size:14px;font-weight:bold;">　找回密码</td>
                  <td width="850" style="font-size:12px;">&nbsp;</td>
                </tr>
            </table></td>
          </tr>
          <tr>
            <td height="20" colspan="2"></td>
          </tr>
          <tr>
            <td width="310" height="40" align="left" style="font-size:12px;line-height:160%;"><font color="#FF0000">&nbsp; </font></td>
            <td width="660" align="left" style="font-size:12px;line-height:160%;">用 户 名：
                <input type="text" name="username" style="width:200px;height:20px;line-height:20px;border:1px #6CB5FF solid;" onFocus="javascript:onfocus_check(username);" onBlur="javascript:onblur_check(username);"></td>
          </tr>
          <tr>
            <td height="80" colspan="2" align="center" style="font-size:12px;line-height:160%;"><input name="imageField" type="image" src="images/next.jpg" width="90" height="30" border="0"></td>
          </tr>
        </table>		
		</form>
		<?php break; case 'question_ask': 
        $username=str_sql($_POST['username']);
		$user_check="select * from user_info_manage where user_name='$username'";
		$rs_user_check=mysql_query ($user_check);
		if ($rs_user=mysql_fetch_object ($rs_user_check)) {
		?>
		<form action="login.php?disp_type=edit_password&username=<?=$_POST['username']?>" method="post">
		<table width="970" border="0" cellpadding="0" cellspacing="0" style="border:1px #BCDFFF solid;">
          <tr>
            <td height="30" colspan="2" align="left" background="images/sort_top.jpg"><table width="960" border="0" cellpadding="0" cellspacing="0">
                <tr>
                  <td width="200" align="left" style="font-size:14px;font-weight:bold;">　验证密码问题答案</td>
                  <td width="770" style="font-size:12px;">&nbsp;</td>
                </tr>
            </table></td>
          </tr>
          <tr>
            <td height="20" colspan="2"></td>
          </tr>
          <tr>
            <td width="310" height="40" align="left" style="font-size:12px;line-height:160%;"><font color="#FF0000">&nbsp; </font></td>		
            <td width="660" align="left" style="font-size:12px;line-height:160%;"><?=$rs_user->question_info?>：
              <input type="hidden" name="question_value" value="<?=$rs_user->question_info?>"><input name="ask_value" type="text" id="ask_value" style="width:200px;height:20px;line-height:20px;border:1px #6CB5FF solid;" onFocus="javascript:onfocus_check(ask_value);" onBlur="javascript:onblur_check(ask_value);"></td>
          </tr>
          <tr>
            <td height="80" colspan="2" align="center" style="font-size:12px;line-height:160%;"><input name="imageField" type="image" src="images/next.jpg" width="90" height="30" border="0"></td>
          </tr>
        </table>
		<?php } else { ?><script language="javascript">alert('对不起，您输入的用户名不存在!');history.go(-1);</script>	<?php } ?>
		</form>
		<?php break; case 'edit_password': 
		$username=str_sql($_GET['username']);
		$ask_value=str_sql($_POST['ask_value']);
		$user_check="select * from user_info_manage where user_name='$username' and ask_info='$ask_value'";
		$rs_user_check=mysql_query ($user_check);
		if (mysql_fetch_object ($rs_user_check)) {
		?>
		
		
		
		<form action="login_action.php?type_action=find_password&username=<?=$_GET['username']?>" name="user_form" method="post" onSubmit="return user_form_check()">
        <table width="970" border="0" cellpadding="0" cellspacing="0" style="border:1px #BCDFFF solid;">
          <tr>
            <td height="30" colspan="2" align="left" background="images/sort_top.jpg"><table width="960" border="0" cellpadding="0" cellspacing="0">
                <tr>
                  <td width="200" align="left" style="font-size:14px;font-weight:bold;">　修改密码</td>
                  <td width="770" style="font-size:12px;">&nbsp;</td>
                </tr>
            </table></td>
          </tr>
          <tr>
            <td height="20" colspan="2"></td>
          </tr>
          <tr>
            <td height="40" align="left" style="font-size:12px;line-height:160%;"><input type="hidden" name="ask_value" value="<?=$_POST['ask_value']?>"></td>
            <td align="left" style="font-size:12px;line-height:160%;"> 　　　　新密码：
            <input name="userpassword" type="text" id="userpassword" style="width:200px;height:20px;line-height:20px;border:1px #6CB5FF solid;" onFocus="javascript:onfocus_check(userpassword);" onBlur="javascript:onblur_check(userpassword);"></td>
          </tr>
          <tr>
            <td width="310" height="40" align="left" style="font-size:12px;line-height:160%;"><font color="#FF0000">&nbsp; </font></td>
            <td width="660" align="left" style="font-size:12px;line-height:160%;">再次输入新密码：
                <input name="userpassword_1" type="text" id="userpassword_1" style="width:200px;height:20px;line-height:20px;border:1px #6CB5FF solid;" onFocus="javascript:onfocus_check(userpassword_1);" onBlur="javascript:onblur_check(userpassword_1);"></td>
          </tr>
          <tr>
            <td height="80" colspan="2" align="center" style="font-size:12px;line-height:160%;"><input name="imageField" type="image" src="images/find_button.jpg" width="90" height="30" border="0"></td>
          </tr>
        </table>		
		</form>
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		<?php } else { ?><script language="javascript">alert('请输入正确的答案!');history.go(-1);</script>		
        <?php exit; }
		 } ?>
				
</td>
        </tr>
      </table>  
	  
	  
	  
  <table width="100%"  border="0" cellpadding="0" cellspacing="0">
    <tr><td height="120" align="center" style="font-size:12px;"><p>家教源码，家教网源码，家教网站源码　　　版权所有</p>
      <p>咨询QQ：741940577</p></td>
    </tr>
  </table>
  </body>
</html>