hope_admin.asp
来自「实现一个用JSP、Servlet技术实现的小型物流网站系统。实现功能如下:管理员」· ASP 代码 · 共 257 行
ASP
257 行
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<% data_path="../../" 'ACC连接数据库路径,对SQL无效 %>
<!--#include file="../../conn/conn.asp"-->
<!--#include file="../../inc/safe.asp"-->
<link rel="stylesheet" type="text/css" href="../css/style.css">
<%
if session("globalecmaster")="" or session("masterflag")="" then
response.write "<script language='javascript'>"
response.write"parent.location.href='../login.asp';</SCRIPT>"
response.end
end if
'权限限制^^^^^^^^^^^^^^^^^^^^
dim ishavegant
ishavegant=false
in_str=split(session("masterflag"),",")
for each ins in in_str
if trim(ins)="08" then
ishavegant=true
end if
next
if ishavegant=false then
response.redirect "../err.asp"
response.end
end if
'^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Action=Replace_Text(Request("action"))
if Action="CheckedOk" then
ID=Trim(Request("ID"))
if ID="" then
Response.write ("<script>alert('参数传递错误');history.go(-1);</script>")
end if
Sql="update yixiang_wt Set Checked=1,End_Time='"&Trim(Request("EndTime"))&"',Begin_time='"&Trim(Request("BeginTime"))&"' Where ID in("&ID&")"
Conn.Execute(Sql)
Response.write ("<script>alert('审核通过');window.location.href='Hope_Admin.asp';</script>")
end if
selAnnounce=Replace_Text(Request("selAnnounce"))
if Trim(Request("submit"))="审核" then
if selAnnounce="" then
Response.write ("<script>alert('参数传递错误');window.location.href='Hope_Admin.asp';</script>")
end if
%><br>
<table width="98%" border="0" align="center" cellpadding="3" cellspacing="0" class="tableBorder">
<script language="javascript">
function strDateTime()
{
var str=document.DateForm.Begintime.value;
var str1=document.DateForm.EndTime.value;
var r = str.match(/^(\d{1,4})(-|\/)(\d{1,2})\2(\d{1,2})$/);
var r1 = str1.match(/^(\d{1,4})(-|\/)(\d{1,2})\2(\d{1,2})$/);
if(r==null)
{ alert("请输入正确的开始时间格式!");
document.DateForm.Begintime.focus();
return false;
}
if(r1==null)
{ alert("请输入正确的结束时间格式! ");
document.DateForm.EndTime.focus();
return false;
}
}
</script>
<form name="DateForm" method="post" action="HOPE_Admin.asp?Action=CheckedOk" onSubmit="return strDateTime();">
<tr>
<th class="tableHeaderText" height=25 colspan=2>委托时间设置</th>
<tr>
<TR height=25>
<TD width="20%" height="20" class=bodytitle align=right>开始时间<input name="ID" type="hidden" value="<%=selAnnounce%>" ></TD>
<TD width="80%" height="20" class=bodytitle alogin=left><input name="Begintime" type="text" value="<%=date()%>" onBlur="this.value=this.value.replace(/\s/g,'');"></TD>
</TR>
<TR height=25>
<TD width="20%" height="20" class=bodytitle align=right>结束时间</TD>
<TD width="80%" height="20" class=bodytitle><input name="EndTime" type="text" value=<%=DateAdd("yyyy",1,date())%> onBlur="this.value=this.value.replace(/\s/g,'');"></TD>
</TR>
<TR height=25>
<TD width="20%" height="20" class=bodytitle align=right> <input type="submit" name="Submit" value="提交"></TD>
<TD width="80%" height="20" class=bodytitle><input name="" type="button" value="清除"></TD>
</TR>
</form>
</table>
<%
Response.end
end if
if Trim(Request("submit"))="删除" then
if selAnnounce="" then
Response.write ("<script>alert('参数传递错误');window.location.href='Hope_Admin.asp';</script>")
Response.end()
end if
%>
<%Sql="Delete From yixiang_wt Where ID in("&selAnnounce&")"
Conn.Execute(Sql)
Response.redirect("Hope_Admin.asp")
end if
%>
<script>
var checkflag="false";
function check(field){
if(checkflag=="false"){
for(i=0;i<field.length;i++){
field[i].checked=true;}
checkflag="true";
return "解除全选"; }
else {
for(i=0;i<field.length;i++) {
field[i].checked=false;}
checkflag="false";
return "选择全部";}}
function Emailhref(){
var len=document.forme.selAnnounce.length;
var id="";
for(i=0;i<len;i++)
{
if(document.forme.selAnnounce[i].checked==true) {
id=id+( document.forme.selAnnounce[i].value)+',';
}
}
window.location='message.asp?HOPE_id='+id
}
</script>
<body>
<%
Set Rs=Server.CreateObject("Adodb.Recordset")
if Trim(Request("Types"))="" then
Sql="Select * from yixiang_wt"
else
Sql="Select * from yixiang_wt Where yixiang_type="&Trim(Request("Types"))&""
end if
'Response.write Sql
Rs.open Sql,Conn,1,3
'Response.write Rs.RecordCount
msg_per_page=30 '定义每页显示记录条数
%>
<!--#include file="../../inc/headpage.asp"-->
<br>
<Form action="HOPE_ADmin.asp" method="POST" name="forme" id="forme">
<table width="98%" border="0" cellspacing="0" cellpadding="5">
<tr>
<td align="center">
<%SQl_type="Select id,yixiang_type from yixiang_Types"
Set Rs_Type=Conn.execute(Sql_type)
Do WHile Not Rs_Type.Eof
Response.Write("<a href='HOPe_admin.asp?Types="&RS_Type("ID")&"'>"&Rs_Type("yixiang_type")&"</a> ")
Rs_Type.MoveNext
if Rs_Type.Eof Then Exit Do
Loop
Rs_Type.Close
Set Rs_Type=nothing
%></td>
</tr>
</table>
<table width="98%" border="0" align="center" cellpadding="0" cellspacing="0" class="tableBorder">
<tr>
<th class="tableHeaderText" height=25>委托列表</th>
<tr>
<td>
<TABLE width="100%" border="0" align="center" cellpadding="3" cellspacing="1" bordercolor="#111111" bordercolorlight="#D7EBFF" bordercolordark="#D7EBFF" style="border-collapse: collapse">
<TBODY>
<TR height=25>
<TD width="130" height="20" class=bodytitle><font color="#CC3300"><b>公司名称</b></font></TD>
<TD width="83" class=bodytitle><font color="#CC3300"><b>联系人</b></font></TD>
<TD width="104" class=bodytitle><font color="#CC3300"><b>电话</b></font></TD>
<TD width="111" class=bodytitle><font color="#CC3300"><b>传真</b></font></TD>
<TD width="216" class=bodytitle><font color="#CC3300"><b>地址</b></font></TD>
<TD width="61" class=bodytitle align="center"><font color="#CC3300"><b>审核</b></font></TD>
<%
if not Rs.Eof Then
if Rs("End_Time")<>""or Rs("Begin_Time")<>"" then %>
<TD width="154" align="center" class=bodytitle><font color="#CC3300"><b>委托时间</b></font></TD>
<%end if
end if
%>
<TD width="71" align="center" class=bodytitle> </TD>
</TR>
<%
if Rs.Eof then
Response.write "<tr><td colspan=7 align=center class=forumRow><br><br>暂时没有委托代理信息<br><br></td></tr>"
Else
do while not rs.eof and rowcount > 0 %>
<TR height="20">
<TD width="130" class=forumRow style="word-break:break-all"><a href="see_wt.asp?ID=<%=Rs("ID")%>"><%=Rs("Company")%></a></td>
<TD width="83" class=forumRow style="word-break:break-all" ><%=Rs("UserName")%></td>
<TD width="104" class=forumRow style="word-break:break-all"><%=Rs("Tel")%></td>
<TD width="111" class=forumRow style="word-break:break-all"><%=Rs("Fax")%></td>
<TD width="216" class=forumRow style="word-break:break-all"><%=Rs("Address")%></td>
<TD width="61" class=forumRow style="word-break:break-all" align="center"><%if Rs("Checked")=0 Then Response.Write("<a href='Hope_Admin.asp?Submit=审核&selAnnounce="&Rs("ID")&"'><span style='color:red'>未审核</span>") Else Response.write "已审核" %></td>
<%if Rs("End_Time")<>""or Rs("Begin_Time")<>"" then %>
<TD width="154" align="center" class=forumRow>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td>开始时间:<%=Rs("Begin_Time")%></td>
</tr>
<tr>
<td>结束时间:<%=Rs("End_Time")%></td>
</tr>
</table>
</td>
<%end if%>
<TD width="71" align="center" class=forumRow><input name="selAnnounce" type="checkbox" id="selAnnounce" value="<%=cstr(rs("ID"))%>"></td>
</TR>
<%
icolor=icolor+1
if icolor>1 then icolor=0
rowcount=rowcount-1
rs.movenext
loop
End if%>
</TABLE>
</td>
</tr>
<tr><td class=forumRow><div align="right">
<input name="button" type=button onClick="this.value=check(this.form)" value=" 选择全部">
<input name="submit" type=submit value=" 审核 ">
<input name="submit" type=submit id="submit" value=" 删除" onClick="return sureok();">
</div></td></tr>
<tr>
<td class=forumrowHighLight align="center"><b><%=listPages("HOpe_Admin.asp?action="&action&"&keywords="&keywords&"")%></b></td>
</tr>
</table></FORM>
<!--#include file="../copy.asp"-->
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?