📄 managedealer.asp
字号:
<!--#include file="conn.asp"-->
<!--#include file="session3.asp"-->
<%
selectid=request("selectid")
if selectid<>"" then
set rs=server.CreateObject("adodb.recordset")
rs.open "select * from [dealer] where id in ("&selectid&")",conn,1,1
do while not rs.eof
if rs("pic") <>"" then
picurl="../"&rs("pic")
set objfso=server.createobject("scripting.filesystemobject")
if objfso.fileexists(server.mappath(picurl)) then
objfso.deletefile server.mappath(picurl),true
else
response.write "该文件已不存在"
end if
set objfso=nothing
url2=rs("pic")
url2=replace(url2,"company/pic/","")
url2=replace(url2,".gif","")
conn.execute "delete from managepic where ( url like 'company_pic_"&url2&"_gif' )"
end if
if rs("logo") <>"" then
picurl="../"&rs("logo")
set objfso=server.createobject("scripting.filesystemobject")
if objfso.fileexists(server.mappath(picurl)) then
objfso.deletefile server.mappath(picurl),true
else
response.write "该文件已不存在"
end if
set objfso=nothing
url2=rs("logo")
url2=replace(url2,"company/logo/","")
url2=replace(url2,".gif","")
conn.execute "delete from managepic where ( url like 'company_logo_"&url2&"_gif' )"
end if
rs.movenext
loop
conn.execute "delete from dealer where id in ("&selectid&")"
set rs=server.CreateObject("adodb.recordset")
rs.open "select * from [1car] where userid in ("&selectid&")",conn,1,1
do while not rs.eof
if rs("carpic") <>"" then
picurl="../"&rs("carpic")
set objfso=server.createobject("scripting.filesystemobject")
if objfso.fileexists(server.mappath(picurl)) then
objfso.deletefile server.mappath(picurl),true
else
response.write "该文件已不存在"
end if
set objfso=nothing
url2=rs("carpic")
url2=replace(url2,"carpic/","")
url2=replace(url2,".gif","")
conn.execute "delete from managepic where ( url like 'carpic_"&url2&"_gif' )"
end if
if rs("carpic1") <>"" then
picurl="../"&rs("carpic1")
set objfso=server.createobject("scripting.filesystemobject")
if objfso.fileexists(server.mappath(picurl)) then
objfso.deletefile server.mappath(picurl),true
else
response.write "该文件已不存在"
end if
set objfso=nothing
url2=rs("carpic1")
url2=replace(url2,"carpic/","")
url2=replace(url2,".gif","")
conn.execute "delete from managepic where ( url like 'carpic_"&url2&"_gif' )"
end if
if rs("carpic2") <>"" then
picurl="../"&rs("carpic1")
set objfso=server.createobject("scripting.filesystemobject")
if objfso.fileexists(server.mappath(picurl)) then
objfso.deletefile server.mappath(picurl),true
else
response.write "该文件已不存在"
end if
set objfso=nothing
url2=rs("carpic2")
url2=replace(url2,"carpic/","")
url2=replace(url2,".gif","")
conn.execute "delete from managepic where ( url like 'carpic_"&url2&"_gif' )"
end if
if rs("carpic3") <>"" then
picurl="../"&rs("carpic1")
set objfso=server.createobject("scripting.filesystemobject")
if objfso.fileexists(server.mappath(picurl)) then
objfso.deletefile server.mappath(picurl),true
else
response.write "该文件已不存在"
end if
set objfso=nothing
url2=rs("carpic3")
url2=replace(url2,"carpic/","")
url2=replace(url2,".gif","")
conn.execute "delete from managepic where ( url like 'carpic_"&url2&"_gif' )"
end if
if rs("carpic4") <>"" then
picurl="../"&rs("carpic4")
set objfso=server.createobject("scripting.filesystemobject")
if objfso.fileexists(server.mappath(picurl)) then
objfso.deletefile server.mappath(picurl),true
else
response.write "该文件已不存在"
end if
set objfso=nothing
url2=rs("carpic4")
url2=replace(url2,"carpic/","")
url2=replace(url2,".gif","")
conn.execute "delete from managepic where ( url like 'carpic_"&url2&"_gif' )"
end if
rs.movenext
loop
conn.execute "delete from 1car where userid in ("&selectid&")"
conn.execute "delete from 2car where userid in ("&selectid&")"
response.Write "<script language='javascript'>alert('删除成功!');window.location.href='managedealer.asp?action=all';</script>"
response.End
end if
%>
<html>
<head>
<title>用户管理</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link href="css/style.css" rel="stylesheet" type="text/css">
<script language=javascript>
function mm()
{
var a = document.getElementsByTagName("input");
if(a[0].checked==true){
for (var i=0; i<a.length; i++)
if (a[i].type == "checkbox") a[i].checked = false;
}
else
{
for (var i=0; i<a.length; i++)
if (a[i].type == "checkbox") a[i].checked = true;
}
}
</script>
</head>
<body>
<% dim namekey,checkbox,action
action=request.QueryString("action")
checkbox=request("checkbox")
namekey=request("namekey")%>
<table cellpadding="3" cellspacing="1" border="0" width="100%" class="tableBorder" align=center>
<tr align="center">
<td class="forumRowHighlight" width=25%> <a href="managedealer.asp?action=all"><%if action="all" then %><font color="#FF0000"><% end if%>所有加盟商家</a></td>
<td class="forumRowHighlight" width=25%><a href="managedealer.asp?action=pass"><%if action="pass" then %><font color="#FF0000"><% end if%>通过审核加盟商家</a></font></td>
<td class="forumRowHighlight" width=25%><a href="managedealer.asp?action=wait"><%if action="wait" then %><font color="#FF0000"><% end if%>待审核加盟商家</a></font></td>
<td class="forumRowHighlight" width=25%><a href="managedealer.asp?action=fall"><%if action="fall" then %><font color="#FF0000"><% end if%>未通过审核加盟商家</a></font></td>
</tr>
</table>
<%'开始分页
Const MaxPerPage=20
dim totalPut
dim CurrentPage
dim TotalPages
dim j
dim sql
if Not isempty(request("page")) then
currentPage=Cint(request("page"))
else
currentPage=1
end if
if namekey="" then namekey=request.QueryString("namekey")
if checkbox="" then checkbox=request.querystring("checkbox")
'//
set rs=server.CreateObject("adodb.recordset")
if namekey="" then
select case action
case "all"
rs.open "select * from [dealer] order by addtime desc ",conn,1,1
case "wait"
rs.open "select * from [dealer] where reglx=0 order by addtime desc ",conn,1,1
case "pass"
rs.open "select * from [dealer] where reglx=1 order by addtime desc ",conn,1,1
case "fall"
rs.open "select * from [dealer] where reglx=-1 order by addtime desc ",conn,1,1
end select
else
if checkbox=1 then
rs.open "select * from [dealer] where company like '%"&namekey&"%' ",conn,1,1
else
rs.open "select * from [dealer] where company='"&namekey&"' ",conn,1,1
end if
end if
if err.number<>0 then
%>
<%
end if
if rs.eof then
%><br>
<table cellpadding="3" cellspacing="1" border="0" width="100%" class="tableBorder" align=center>
<tr>
<th class="tableHeaderText" colspan=5>加盟商家管理</th>
</tr>
<tr>
<td class="forumRowHighlight" width="30%"> <div align="center">登录名</div></td>
<td class="forumRowHighlight" width="20%"> <div align="center">
<span lang="zh-cn">公司名称</span></div></td>
<td class="forumRowHighlight" width="20%"> <div align="center">注册时间</div></td>
<td class="forumRowHighlight" width="20%"> <div align="center">
<span lang="zh-cn">联系地址</span></div></td>
<td class="forumRowHighlight" width="10%"> <div align="center">操作</div></td>
</tr>
<tr>
<td class="forumRowHighlight" colspan="5">没有数据</td>
</tr>
<tr>
<td colspan=5 align="center" class="forumRowHighlight">
</td>
</tr>
</table><%
else
totalPut=rs.recordcount
if currentpage<1 then
currentpage=1
end if
if (currentpage-1)*MaxPerPage>totalput then
if (totalPut mod MaxPerPage)=0 then
currentpage= totalPut \ MaxPerPage
else
currentpage= totalPut \ MaxPerPage + 1
end if
end if
if currentPage=1 then
showContent
showpage totalput,MaxPerPage,"managedealer.asp"
else
if (currentPage-1)*MaxPerPage<totalPut then
rs.move (currentPage-1)*MaxPerPage
dim bookmark
bookmark=rs.bookmark
showContent
showpage totalput,MaxPerPage,"managedealer.asp"
else
currentPage=1
showContent
showpage totalput,MaxPerPage,"managedealer.asp"
end if
end if
end if
sub showContent
dim i
i=0
%><br>
<table cellpadding="3" cellspacing="1" border="0" width="100%" class="tableBorder" align=center>
<form name="form1" method="post" action="">
<tr>
<th class="tableHeaderText" colspan=5>加盟商家管理</th>
</tr>
<tr>
<td class="forumRowHighlight" width="30%"> <div align="center">登录名</div></td>
<td class="forumRowHighlight" width="20%"> <div align="center">
<span lang="zh-cn">公司名称</span></div></td>
<td class="forumRowHighlight" width="20%"> <div align="center">注册时间</div></td>
<td class="forumRowHighlight" width="20%"> <div align="center">
<span lang="zh-cn">联系地址</span></div></td>
<td class="forumRowHighlight" width="10%"> <div align="center">操作</div></td>
</tr>
<%do while not rs.eof%>
<tr>
<td class="forumRowHighlight"> <div align="center"><a href=listdealer.asp?id=<%=rs("id")%>><%=trim(rs("user"))%></a><%if rs("reglx")=1 then%>(通过<%if rs("tj")=1 then%>-推荐<%end if%><%end if%><%if rs("reglx")=0 then%><font color="#FF0000">(待审核)</font><%end if%><%if rs("reglx")=-1 then%>(未通过)<%end if%>)</div></td>
<td class="forumRowHighlight"> <div align="center"><%=trim(rs("company"))%></div></td>
<td class="forumRowHighlight"> <div align="center"><%=rs("addtime")%></div></td>
<td class="forumRowHighlight">
<p align="center"> <%=rs("address")%> </td>
<td class="forumRowHighlight"> <div align="center">
<input name="selectid" type="checkbox" id="selectid" value="<%=rs("id")%>">
</div></td>
</tr>
<%i=i+1
if i>=MaxPerPage then Exit Do
rs.movenext
loop%>
<tr>
<td colspan=5 align="center" class="forumRowHighlight"> <input class=button type="submit" name="Submit" value="删除所选信息" onClick="return confirm('删除后不可恢复,您确定要删除吗?')">
全选
<input type="checkbox" name="checkbox2" value="Check All" onClick="mm()">
</td>
</tr>
</table>
</form>
<%
End Sub
Function showpage(totalnumber,maxperpage,filename)
Dim n
If totalnumber Mod maxperpage=0 Then
n= totalnumber \ maxperpage
Else
n= totalnumber \ maxperpage+1
End If
Response.Write "<p align='center' class='contents'> "
If CurrentPage<2 Then
Response.Write "<font class='contents'>首页 上一页</font> "
Else
Response.Write "<a href="&filename&"?action="&action&"&page=1&checkbox="&checkbox&"&namekey="&namekey&"action="&action&" class='contents'>首页</a> "
Response.Write "<a href="&filename&"?action="&action&"&page="&CurrentPage-1&"&checkbox="&checkbox&"&namekey="&namekey&"action="&action&" class='contents'>上一页</a> "
End If
If n-currentpage<1 Then
Response.Write "<font class='contents'>下一页 尾页</font>"
Else
Response.Write "<a href="&filename&"?action="&action&"&page="&(CurrentPage+1)&"&checkbox="&checkbox&"&namekey="&namekey&"action="&action&" class='contents'>"
Response.Write "下一页</a> <a href="&filename&"?action="&action&"&page="&n&"&checkbox="&checkbox&"&namekey="&namekey&"action="&action&" class='contents'>尾页</a>"
End If
Response.Write "<font class='contents'> 页次:</font><font class='contents'>"&CurrentPage&"</font><font class='contents'>/"&n&"页</font> "
Response.Write "<font class='contents'> 共有"&totalnumber&"名注册用户 "
End Function
%>
<br>
<table cellpadding="3" cellspacing="1" border="0" width="100%" class="tableBorder" align=center>
<form name="form2" method="post" action="managedealer.asp?action=select">
<tr>
<th class="tableHeaderText" colspan=6>查找加盟商家</th>
</tr>
<tr>
<td class="forumRowHighlight" align=center> 按<span lang="zh-cn">公司名称</span>查找:
<input name="namekey" type="text" id="namekey" size="12"> <input name="checkbox" type="checkbox" id="checkbox" value="1" checked>
模糊查询
<input class=button type="submit" name="Submit2" value="查 询"> </td>
</tr>
</form>
</table>
<br>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -