?? main.jsp
字號:
<%@ page language="java" import="java.util.*" pageEncoding="GB18030"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<%@ taglib uri="http://struts.apache.org/tags-bean" prefix="bean" %>
<%@ taglib uri="http://struts.apache.org/tags-html" prefix="html" %>
<%@ taglib uri="http://struts.apache.org/tags-logic" prefix="logic" %>
<%@ taglib uri="http://struts.apache.org/tags-tiles" prefix="tiles" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<base href="<%=basePath%>">
<LINK href="cs/style_1.css" type=text/css
rel=stylesheet>
<title>My JSP 'admin.jsp' starting page</title>
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="This is my page">
<!--
<link rel="stylesheet" type="text/css" href="styles.css">
-->
<style type="text/css">
<!--
#admintop {
position:absolute;
top:55;
left:2;
width:99%;
height:20px;
z-index:1;
BORDER-TOP: #9db3c5 1px solid;
BORDER-BOTTOM: #9db3c5 1px solid;
BORDER-right: #9db3c5 1px solid;
BORDER-left: #9db3c5 1px solid;
BACKGROUND: #e8f3fd;
}
#admintitle {
position:absolute;
top:20;
left:50;
width:150;
height:40px;
z-index:1;
font-size:23px;
font-family:"方正舒體";
color:#CC3399
}
#title{
BORDER-TOP: #9db3c5 0px solid;
BORDER-BOTTOM: #9db3c5 1px solid;
BORDER-right: #9db3c5 0px solid;
BORDER-left: #9db3c5 0px solid;
}
#showmes{
position:absolute;
top:100;
left:10;
width:150;
height:20px;
z-index:1;
color:#CC3399
}
#btn{
BORDER-TOP: #9db3c5 1px solid;
BORDER-BOTTOM: #9db3c5 1px solid;
BORDER-right: #9db3c5 1px solid;
BORDER-left: #9db3c5 1px solid;
BACKGROUND: #e8f3fd;
}
#login{
width:400;
height:300;
z-index:1;
top:200;
BORDER-TOP: #9db3c5 1px solid;
BORDER-BOTTOM: #9db3c5 1px solid;
BORDER-right: #9db3c5 1px solid;
BORDER-left: #9db3c5 1px solid;
}
#search{
width:400;
height:300;
z-index:1;
top:200;
BORDER-TOP: #9db3c5 1px solid;
BORDER-BOTTOM: #9db3c5 1px solid;
BORDER-right: #9db3c5 1px solid;
BORDER-left: #9db3c5 1px solid;
}
#newsubject{
width:400;
height:300;
z-index:1;
top:200;
BORDER-TOP: #9db3c5 1px solid;
BORDER-BOTTOM: #9db3c5 1px solid;
BORDER-right: #9db3c5 1px solid;
BORDER-left: #9db3c5 1px solid;
}
-->
</style>
<script type="text/javascript">
var ele;
function fun(){
var width=document.body.clientWidth;
var div1=document.getElementById(ele);
div1.style.left=(width-400)/2;
}
function fun1(element){
ele=element;
var login=document.getElementById("login");
var search=document.getElementById("search");
var subject=document.getElementById("newsubject");
var width=document.body.clientWidth;
var div1=document.getElementById(element);
if(div1==login){
search.style.display="none";
subject.style.display="none";
}
if(div1==search){
login.style.display="none";
subject.style.display="none";
}
if(div1==subject){
search.style.display="none";
login.style.display="none";
}
div1.style.left=(width-400)/2;
div1.style.display="block";
}
function fun2(){
var psw=document.form1.newpsw.value;
var repsw=document.form1.renewpsw.value;
if(psw!=repsw){
alert("tst");
return false;
}
}
</script>
<script type="text/javascript">
var xmlHttp;
var dataDiv;
var dataBody;
var curElement;
function createHttpRequest()
{
if(window.XMLHttpRequest)
{
xmlHttp=new XMLHttpRequest();
}
else if(window.ActiveXObject)
{
try
{
xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
}
catch(e)
{
try
{
xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
}catch(e){}
}
}
}
function getClient(){
var text=document.form2.username.value;
dataBody=document.getElementById("databody");
dataDiv=document.getElementById("popup");
createHttpRequest();
var url="manager.do?method=getclient&username="+text;
xmlHttp.open("GET",url,true);
xmlHttp.onreadystatechange=handleResponse;
xmlHttp.send(null);
}
function handleResponse(){
if(xmlHttp.readyState==4)
{
if(xmlHttp.status==200)
{
setData();
}else{
alert("error");
}
}
}
function setData(){
var xml=xmlHttp.responseXML;
var content=xml.getElementsByTagName("content")[0].firstChild.nodeValue;
document.getElementById("uname").innerHTML=content;
var content1=xml.getElementsByTagName("content")[1].firstChild.nodeValue;
document.getElementById("upassword").innerHTML=content1;
var status=xml.getElementsByTagName("content")[2].firstChild.nodeValue;
var suo=document.getElementById("status");
if(status=='1'){
suo.innerHTML="未鎖定";
}
if(status=='4'){
suo.innerHTML="鎖定";
}
if(content=='user undifined'){
document.getElementById("btn2").disabled="disabled";
document.getElementById("btn3").disabled="disabled";
document.getElementById("btn4").disabled="disabled";
}
document.getElementById("table1").style.display="block";
}
var n=5;
function clean(){
n=n-1;
if(n==0){
document.getElementById("mes").innerHTML="";
}
setTimeout("clean()",1000);
}
</script>
</head>
<body onresize="fun()" onload="clean()">
<div id="admintitle">后臺管理</div>
<div id="admintop" align="right" valign="bottom">
<logic:present name="admin">
<html:link action="mainpage.do">論壇首頁</html:link>
<input type="button" value="添加新板塊" id="btn" onclick="fun1('newsubject')">
<input type="button" value="用戶信息搜索" id="btn" onclick="fun1('search')">
</logic:present>
<logic:notPresent name="admin">
<input type="button" disabled="disabled" value="添加新板塊" id="btn" onclick="fun1('newsubject')">
<input type="button" disabled="disabled" value="用戶信息搜索" id="btn" onclick="fun1('search')">
</logic:notPresent>
<input type="button" value="管理員登錄" id="btn" onclick="fun1('login')"> </div>
<div id="login" style="position:absolute;display:none">
<br><br><br><br>
<form action="manager.do?method=login" name="form1" method="post">
<table width="100%">
<tr><td width="20%"></td><td width="35%">用戶名:</td><td width="45%"><input type="text" name="username" ></td></tr>
<tr><td></td><td>密碼:</td><td><input type="password" name="password" ></td></tr>
<tr><td> </td></tr>
<tr><td colspan="3" align="center"><input type="submit" value="提交"></td></tr>
<tr>
<td colspan="3" align="center">
<FONT color="red"><logic:present name="psw">
<bean:write name="psw"/>
</logic:present></FONT>
</td>
</tr>
</table>
</form>
</div>
<div id="showmes">
<span id="mes">
<logic:present name="status">
<bean:write name="status"/>
</logic:present>
</span>
</div>
<div id="search" style="position:absolute;display:none">
<br><br>
<form action="" name="form2">
<table width="100%" border="0">
<tr><td width="20%"><br></td><td width="35%">用戶名:<br></td><td width="45%"><input type="text" name="username"><br></td></tr>
<tr><td colspan="3" align="center"><br><input type="button" value="提交" onclick="getClient()"><br></td></tr>
</table>
</form><br>
<form action="client.do" method="post">
<table width="100%" border="0" id="table1" style="display:none">
<tr><td width="100%" colspan="3" align="center">用戶信息<br></td></tr>
<tr><td width="20%"><br></td><td width="35%">用戶名:<br></td><td width="45%"><span id="uname"></span><br></td></tr>
<tr><td><br></td><td>密碼:<br></td><td><span id="upassword"></span><br></td></tr>
<tr><td><br></td><td>用戶狀態:<br></td><td><span id="status" style="background-color:#999999;font-size:18px"></span>
<select name="status">
<option value="1">未鎖定</option>
<option value="4">鎖定</option>
</select><br></td></tr>
<tr><td colspan="3" align="center"><input type="hidden" name="method" value="">
<input type="submit" value="更改" id="btn2" onclick="method.value='modify'">
<input type="submit" value="刪除" id="btn3" disabled="disabled" onclick="method.value='delete'">
<input type="reset" value="重置" id="btn4"><br></td></tr>
</table>
</form>
</div>
<div id="newsubject" style="position:absolute;display:none">
<form action="subject.do?method=add" method="post">
<table border="0" width="100%">
<tr>
<td width="10%"><br><br><br>主題</td><td width="90%" valign="bottom"><input id="title" type="text" name="title"></td>
</tr>
<tr>
<td>描述</td><td><textarea rows="10" cols="65" name="desc"></textarea></td>
</tr>
<tr>
<td colspan="2" align="center"><input type="submit" value="提交"> <input type="reset" value="重置"></td>
</tr>
</table>
</form>
</div>
</body>
</html>
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -