<?php
@session_start();
include('inc/conn.php');
?>
<!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" />
<title>ETW国际案例演示</title>
<style type="text/css">
input{ border:none; height:18px;}
body{ font-size:12px; color:#FFFFFF}
</style>
</head>

<body>
<div style=" width:100%;margin:180px auto;font-size:12px;color:#FFFFFF; line-height:23px;">
<table width='100%' height='100%'  border=0 cellpadding=0 cellspacing=0><tr><td>
<table width='100%' align=center height=160 border=0 cellpadding=0 cellspacing=0 style='border-top:1px #0069BF solid;border-bottom:1px #0069BF solid'>
<tr><td align=center>
<table width='100%' align=center height=150 border=0 cellpadding=0 cellspacing=2 bgcolor=#1890CC>
<form id="form1" name=login method=post>
<tr><td width='25%' align=right><img src='img/Login_pic.gif' align=absmiddle></td><td width='2%'><img src='img/Login_line.gif' align=absmiddle></td><td width='73%'>
<table width="536" border=0 cellpadding=0 cellspacing=2 style="float:left;"><tr>
<td colspan=6><img src='img/Login_tit.gif' align=absmiddle></td>
<td align=right rowspan=2 valign=bottom width=90><img onclick='CheckForm();' src=Img/Login.gif width=71 height=71 border=0 align=absmiddle style='cursor:pointer'></td>
</tr><tr>
<td width=52 align=right height=60><img src='img/admin_login_01.gif' align=absmiddle></td>
<td width="150" align="left">用户名<br><input name='username' id="user" size=22   style='width:100;height:18px'></td>
<td width=35 align=right><img src='img/admin_login_02.gif' align=absmiddle></td>
<td width="177" align="left">密　码
<table border=0 cellspacing=0 cellpadding=0>
<tr><td><input name='password' id="pwd" type=PassWord  style='width:100;height:18px'></td>
</table></td>

<td width="2">&nbsp;</td>
</tr>
<tr style="  text-align:left"><td align="right">说明:&nbsp;&nbsp; </td><td colspan="4"> &nbsp;&nbsp; 用户名和密码为邮件中的8位登陆号和对应的密码</td></tr>
</table>
</td></tr></form></table>
</td></tr></table>
</td></tr></table>
<script type="text/javascript">
function CheckForm(){
        if(document.getElementById("user")!='' && document.getElementById("pwd")!=''){
		document.getElementById("form1").submit()
		}
}
</script>
</div>
<?php 
 if($_POST['username']!='' && $_POST['password']!=''){
    $sql="select * from guestuser where guestusername='".$_POST['username']."' and guestpwd='".md5($_POST['password'])."'";
	$result=mysql_query($sql);
	$mun=mysql_num_rows($result);
	//$rs=mysql_fetch_array($result);
	//if($rs['guestusername']==$_POST['username']){
	  if($mun==1){
	    $_SESSION['etwguestuser']=$_POST['username'];
        echo "<script type=\"text/javascript\">window.location.href=\"index.php\";</script>";	
	}else{
        echo "<script type=\"text/javascript\">alert('用户名或密码错误');</script>";		
	}
 }
?>

</body>
</html>
