<!--#include file="Conn.asp"-->
<!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>UsCMS 2.0 后台管理</title>
<link href="../templates/uscms/css/default.css" rel="stylesheet" type="text/css" />
<link href="../templates/uscms/css/admincp.css" rel="stylesheet" type="text/css" />
<link type="text/css" href="../js/css/custom-theme/jquery-ui-1.7.2.custom.css" rel="stylesheet" />	
<script language="JavaScript" type="text/javascript" src="../js/jquery-1.2.6.min.js"></script>

<style>
table{position:absolute;width:500px;left:50%; margin:100px 0 0 -250px;border:1px solid #000000;}
body {background-color: #cbe1ef;}
#dialog_link a{padding: .4em 1em .4em 20px;text-decoration: none;position: relative;}
#dialog_link span.ui-icon {margin: 0 5px 0 0;position: absolute;left: .2em;top: 50%;margin-top: -8px;}
</style>
<script type="text/javascript">
	$(function(){$('#login a').hover(
			function() { $(this).addClass('ui-state-hover'); }, 
			function() { $(this).removeClass('ui-state-hover'); });				
	});
</script>
</head>
<body style="border-top:1px solid #29a1d9;height:99%">

<div class="list" id="dialog_link"> 
 <%
 if request.QueryString("action")="" then
 if request.QueryString("errorMsg")="" then
 errorMsg=""
 else
 errorMsg="<font color=red>用户名或密码错误</font>"
 end if
 %>
  <form id="form1" name="form1" method="post" action="Login.asp?action=Start">
    <table width="80%" style="border-top:30px #29a1d9 solid;border-left:1px #29a1d9 solid;border-bottom:1px #29a1d9 solid;border-right:1px #29a1d9 solid;">
      <tbody>
      <tr>
      <td colspan="2" >登陆管理后台!<%=errorMsg%></td>
      </tr>
      </tbody>
      <tr>
        <td style="width:10%">用户：</td>
        <td><input name="uName" id="uName" type="text" value="" style="width:118px;"/><label style="display:none" for="uName" class="error" metaDone="true" generated="true"></label></td>
      </tr>
      <tr>
        <td>密码：</td>
        <td><input name="uPass" id="uPass" type="password" value="" style="width:118px;"/></td>
      </tr>     
      <tr>
        <td><input type="submit" value="IE6"/></td>
        <td style="height:40px;"id="login">
        <a class="ui-state-default ui-corner-all" href="javascript:;" onClick="document.form1.submit();"><span class="ui-icon ui-icon-check"></span>登陆</a>
        <a class="ui-state-default ui-corner-all" href="javascript:;" onClick="document.form1.reset();"><span class="ui-icon ui-icon-arrowreturnthick-1-w"></span>重置</a>
        <a class="ui-state-default ui-corner-all" href="javascript:;" onClick="submit();"><span class="ui-icon ui-icon-arrowreturnthick-1-w"></span>重置</a>
        </td>
      </tr>
       
    </table>  
  </form>
<%
Elseif Request.QueryString("action")="Start" then
%>

<%  
uName=FunStr(Request.Form("uName"))
uPass=FunStr(Request.Form("uPass"))
Set Rs=server.CreateObject("Adodb.Recordset")
Sql="Select * From UsCMSAdmin"

Rs.open Sql,Conn,1,3
Do While Not Rs.Eof 
if Rs("uName")=uName And Rs("uPass")=uPass then

  Session("Admin")=uName
  REsponse.Redirect("usCMS.asp?action=system")
End if
Rs.Movenext
Loop
  Response.Redirect "login.asp?errorMsg=1"
Rs.Close
Set Rs=Nothing
Elseif Request.QueryString("action")="Out" then
  Session("Admin")=""
  Response.Redirect "login.asp"
End if  
  %>
  </div>

</body>
</html>