<?php
include "user.php";

$user = $_COOKIE['AnYue_Admin_User'];
$pass = $_COOKIE['AnYue_Admin_Pass'];

if ($user == $username and $pass == $password){
header("refresh:0;url=./");
}else{
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<TITLE>后台管理 - <?=$configure['webname']?></TITLE>
<META http-equiv=Content-Type content="text/html; charset=gb2312">
<STYLE>
TD {
	FONT-SIZE: 11px; COLOR: #000000; FONT-FAMILY: Verdana, Arial, Helvetica, sans-serIf; TEXT-DECORATION: none
}
.input_1 {
	BORDER-RIGHT: #999999 1px solid; PADDING-RIGHT: 2px; BORDER-TOP: #999999 1px solid; PADDING-LEFT: 2px; LIST-STYLE-POSITION: inside; FONT-SIZE: 12px; PADDING-BOTTOM: 2px; MARGIN-LEFT: 10px; BORDER-LEFT: #999999 1px solid; COLOR: #333333; PADDING-TOP: 2px; BORDER-BOTTOM: #999999 1px solid; FONT-FAMILY: Arial, Helvetica, sans-serIf; LIST-STYLE-TYPE: none; HEIGHT: 18px; BACKGROUND-COLOR: #dadedf
}
</STYLE>
<META content="MSHTML 6.00.6000.16705" name=GENERATOR>
</HEAD>
<BODY>
<TABLE cellSpacing=0 cellPadding=0 width=651 align=center border=0>
  <TBODY>
  <TR>
    <TD height=50></TD>
  </TR>
  <TR>
    <TD height=351><TABLE cellSpacing=0 cellPadding=0 width="100%" border=0>
        <TBODY>
        <TR>
          <TD width=15 background=Images/ileft.gif height=43></TD>
          <TD width=620 background=Images/i_topbg2.gif><IMG 
            height=43 src="Images/i_top1.gif" width=43></TD>
          <TD width=16><IMG height=43 src="Images/iright.gif" 
            width=16></TD>
        </TR>
    <TR>
          <TD background=Images/ileftbg.gif></TD>
          <TD vAlign=center background=Images/bg_q.gif height=279>
		<TABLE height=109 cellSpacing=0 cellPadding=0 width=369 align=center border=0>
           <TBODY>
              <TR>
                <TD width=155><IMG height=140 
                  src="Images/logo.jpg" width=155 useMap=#Map 
                  border=0>
				</TD>

                <TD vAlign=top align=left width=214><TABLE cellSpacing=0 cellPadding=0 width=167 border=0>
                    <TBODY>

                    <TR>
                      <TD vAlign=bottom width=167 height=30><A href="./"><IMG 
                        height=19 src="Images/adminsyteam.gif" width=154 border=0></A>
					  </TD>
                    </TR>

                    <TR>
                      <TD height=123>
					    <TABLE height=109 cellSpacing=0 cellPadding=0 align=center border=0>
                          <FORM name=form2 action="login.php" method=post>
                            
                              <TR>
                                <TD vAlign=bottom align=left width=44 height=28>
									<DIV align=right><IMG height=14 src="Images/id.gif" width=43></DIV>
								</TD>

                                <TD vAlign=bottom align=left width=114 height=28>
									<INPUT class=input_1 id=username size=15 name=username>
                                </TD>
                              </TR>
                              <TR>
                                <TD align=left height=20>
								<DIV align=right><IMG height=14 src="Images/pass.gif" width=43></DIV>
								</TD>
                                <TD height=20>
									<INPUT class=input_1 id=password type=password size=15 name=password>
								</TD>
                              </TR>
                              <TR>
                                <TD vAlign=center colSpan=2 height=25>
									<DIV align=center>
                                    <INPUT type=image src="Images/b_login.gif" name=denglu>
                                    <IMG style="CURSOR: hand" onclick=document.form2.reset() height=21 src="Images/b_clean.gif" width=73>
									</DIV>
								</TD>
                              </TR>
                          </FORM>
                        </TABLE>
					  </TD>
                    </TR>
                    </TBODY>
                  </TABLE>
				  <?php
				  $user = @$_POST['username'];
				  $pass = @$_POST['password'];
				  if ($user != '' and $pass != ''){
				  if ($user == $username and $pass == $password){
				  setcookie("AnYue_Admin_User", $user, time() + 86400);
				  setcookie("AnYue_Admin_Pass", $pass, time() + 86400);
				  echo '登录成功，跳转中…';
				  echo '<meta http-equiv="refresh" content="3;url=./">';
				  }else{
				  echo '账号或密码错误！';
				  }
				  }
				  ?>
				</TD>
              </TR>
           </TBODY>
        </TABLE>
		  </TD>
          <TD background=Images/irightbg.gif></TD>
    </TR>
        <TR>
          <TD><IMG height=29 src="Images/i_bottom_left.gif" width=15></TD>
          <TD background=Images/i_bottom_bg.gif></TD>
          <TD width=16><IMG height=29 src="Images/i_bottom_right.gif" width=16></TD>
        </TR>
        </TBODY>
      </TABLE>
	</TD>
  </TR>
  <TR>
    <TD height=1></TD>
  </TR>
  <TR>
    <TD>&nbsp;</TD>
  </TR>
  </TBODY>
</TABLE>
<MAP name=Map>
  <AREA shape=CIRCLE coords=77,67,57 href="login.php">
</MAP>
</BODY>
</HTML>
<?php } ?>