📄 admin_pic.asp
字号:
Response.Write("<script language=javascript>alert('请指定操作的对象!');history.back(1);</script>")
response.end
else
if not isinteger(request.querystring("id")) then
Response.Write("<script language=javascript>alert('非法的分类ID参数!');history.back(1);</script>")
response.end
end if
end if
sql="select * from piccat where piccat_id="&cint(request.querystring("id"))
set rs=server.createobject("adodb.recordset")
rs.open sql,conn,1,1
%>
<table align="center" width="98%" align="center" border="1" cellspacing="0" cellpadding="4" style="border-collapse: collapse">
<form name="form1" method="post" action="">
<tr><td>删除分类</td></tr>
<tr><td>分类名称- <%=rs("piccat_name")%></td>
</tr>
<tr>
<td align="center">
<input name="Submit" type="submit" id="Submit" value="确定删除">
</td>
</tr>
<input type="hidden" name="id" value="<%=rs("piccat_id")%>">
<input type="hidden" name="action" value="delpiccat">
<input type="hidden" name="MM_insert" value="true">
</form>
</table>
<%end if
if request.querystring("action")="pic" then
sql="select * from pic order by pic_id desc"
if request.querystring("piccat_id")<>"" then
sql="select * from pic where piccat_id="&cint(request.querystring("piccat_id"))&" order by pic_id desc"
end if
set rs=server.createobject("adodb.recordset")
rs.open sql,conn,1,1
totalpic=rs.recordcount
%>
<table align="center" width="98%" align="center" border="1" cellspacing="0" cellpadding="4" style="border-collapse: collapse">
<form name="form3" method="post" action="">
<tr><td align="right" width="20%" colspan="4" style="padding-top:2px;">
<select style="margin:-3px" name="go" onChange='window.location=form.go.options[form.go.selectedIndex].value'>
<option value="">选择显示方式</option>
<option value="admin_pic.asp?action=pic">显示所有图片</option>
<%sql="select * from piccat"
set rs2=server.createobject("adodb.recordset")
rs2.open sql,conn,1,1
do while not rs2.eof%>
<option value="admin_pic.asp?action=pic&piccat_id=<%=rs2("piccat_id")%>"><%=rs2("piccat_name")%></option>
<%rs2.movenext
loop
if rs2.bof and rs2.eof then%><option value="">当前没有分类</option>
<%end if
rs2.close
set rs2=nothing%>
</select>
</td>
</tr>
</form>
<tr align="center">
<td width="80">图片名称</td><td width="*">图片名称</td><!--<td width="40">评论</td>--><td width="100">管理</td>
</tr>
<%
dim picperpage
picperpage=10
if not rs.eof then
rs.movefirst
rs.pagesize=picperpage
if trim(request("page"))<>"" then
currentpage=clng(request("page"))
if currentpage>rs.pagecount then
currentpage=rs.pagecount
end if
else
currentpage=1
end if
totalpic=rs.recordcount
if currentpage<>1 then
if (currentpage-1)*picperpage<totalpic then
rs.move(currentpage-1)*picperpage
dim bookmark
bookmark=rs.bookmark
end if
end if
if (totalpic mod picperpage)=0 then
totalpages=totalpic\picperpage
else
totalpages=totalpic\picperpage+1
end if
i=0
do while not rs.eof and i<picperpage
%>
<tr>
<td><img src='<%=rs("pic_spic")%>' width='75' border='0'></td><td>·<%=rs("pic_name")%> </td>
<!-- <td align="center"><font color=red><%=rs("reviewcount")%></font> </td> -->
<td align="center">
<!--<a href="admin_view.asp?action=pic&pic_id=<%=rs("pic_id")%>">评论</a>-->
<a href="admin_pic.asp?id=<%=rs("pic_id")%>&action=editpic">编辑</a>
<a href="admin_pic.asp?id=<%=rs("pic_id")%>&action=delpic">删除</a></td>
</tr>
<%
i=i+1
rs.movenext
loop
else
if rs.eof and rs.bof then
%>
<tr>
<td colspan="4" height="22" align="center">当前没有图片!</td>
</tr>
<%end if
end if%>
<form name="form1" method="post" action="admin_pic.asp?action=pic&piccat_id=<%=request.querystring("piccat_id")%>">
<tr>
<td align="right" colspan="4"> <%=currentpage%> /<%=totalpages%>页,<%=totalpic%>条记录/<%=picperpage%>篇每页.
<%
i=1
showye=totalpages
if showye>10 then
showye=10
end if
for i=1 to showye
if i=currentpage then
%>
<%=i%>
<%else%>
<a href="admin_pic.asp?action=pic&page=<%=i%>&piccat_id=<%=request.querystring("piccat_id")%>"><%=i%></a>
<%end if
next
if totalpages>currentpage then
if request("page")="" then
page=1
else
page=request("page")+1
end if%>
<a href="admin_pic.asp?action=pic&page=<%=page%>&piccat_id=<%=request.querystring("piccat_id")%>" title="下一页">>></a>
<%end if%>
<input type="text" name="page" size="4">
<input type="submit" name="Submit" value="Go">
</td>
</tr>
</form>
</table>
<br>
<%end if
if request.querystring("action")="newpic" then%>
<table align="center" width="98%" align="center" border="1" cellspacing="0" cellpadding="4" style="border-collapse: collapse">
<form name="form2" method="post" action="">
<tr>
<td colspan="2">
新增图片</td>
</tr>
<tr>
<td width="17%">图片名称</td>
<td width="83%">
<input type="text" name="name" size="40">
</td>
</tr>
<tr>
<td width="17%">所属分类</td>
<td width="83%">
<select name="piccatid">
<%
sql="select * from piccat"
set rs=server.createobject("adodb.recordset")
rs.open sql,conn,1,1
do while not rs.eof%><option value="<%=rs("piccat_id")%>"><%=rs("piccat_name")%></option>
<%rs.movenext
loop
if rs.eof and rs.bof then%><option value="0">当前没有分类</option>
<%end if%>
</select>
</td>
</tr>
<tr>
<td width="17%">图片大小</td>
<td width="83%">
<input type="text" name="url" size="60">
</td>
</tr>
<tr>
<td width="17%">缩图地址</td>
<td width="83%">
<input type="text" name="spic" size="60">
</td>
</tr>
<tr>
<td>上传缩图:</td>
<td align="left" height="25"><iframe frameborder=0 width=290 height=25 scrolling=no src="upload.asp?action=spic"></iframe></td>
</tr>
<tr>
<td width="17%">图片地址</td>
<td width="83%">
<input type="text" name="pic" size="60">
</td>
</tr>
<tr>
<td>上传原图:</td>
<td align="left" height="25"><iframe frameborder=0 width=290 height=25 scrolling=no src="upload.asp?action=pic"></iframe></td>
</tr>
<tr>
<td width="17%">图片介绍</td>
<td width="83%">
<textarea name="desc" cols="65" rows="6">图片版权归图片本人所有,未经同意不得转载!</textarea>
</td>
</tr>
<tr align="center">
<td colspan="2">
<input type="checkbox" name="isbest" value="1" style="display:none">
<input type="submit" name="Submit" value="确定新增">
<input type="reset" name="Reset" value="清空重填">
[<a href="admin_pic.asp?action=pic">返回</a>] </td>
</tr>
<input type="hidden" name="action" value="newpic">
<input type="hidden" name="MM_insert" value="true">
</form>
</table>
<%end if
if request.QueryString("action")="editpic" then
if request.querystring("id")="" then
Response.Write("<script language=javascript>alert('请指定操作的对象!');history.back(1);</script>")
response.end
else
if not isinteger(request.querystring("id")) then
Response.Write("<script language=javascript>alert('非法的ID参数!');history.back(1);</script>")
response.end
end if
end if
sql="select * from pic where pic_id="&cint(request.querystring("id"))
set rs=server.createobject("adodb.recordset")
rs.open sql,conn,1,1%>
<table align="center" width="98%" align="center" border="1" cellspacing="0" cellpadding="4" style="border-collapse: collapse">
<form name="form2" method="post" action="">
<tr>
<td colspan="2">
修改图片</td>
</tr>
<tr>
<td width="17%">图片名称</td>
<td width="83%">
<input name="name" type="text" id="name" size="40" value="<%=rs("pic_name")%>">
</td>
</tr>
<tr>
<td width="17%">所属分类</td>
<td width="83%">
<select name="piccatid" id="piccatid">
<%
sql="select * from piccat"
set rs2=server.createobject("adodb.recordset")
rs2.open sql,conn,1,1
do while not rs2.eof%>
<option value="<%=rs2("piccat_id")%>" <%if rs2("piccat_id")=rs("piccat_id") then response.write "selected" end if%>><%=rs2("piccat_name")%></option>
<%rs2.movenext
loop
if rs2.eof and rs2.bof then%>
<option value="0">当前没有分类</option>
<%end if%>
</select>
</td>
</tr>
<tr>
<td width="17%">图片大小</td>
<td width="83%">
<input name="url" type="text" id="url" size="60" value="<%=rs("pic_url")%>">
</td>
</tr>
<tr>
<td width="17%">缩图地址</td>
<td width="83%">
<input name="spic" type="text" id="spic" size="60" value="<%=rs("pic_spic")%>">
</td>
</tr>
<tr>
<td>上传缩图:</td>
<td align="left" height="25"><iframe frameborder=0 width=290 height=25 scrolling=no src="upload.asp?action=spic"></iframe></td>
</tr>
<tr>
<td width="17%">图片地址</td>
<td width="83%">
<input name="pic" type="text" id="pic" size="60" value="<%=rs("pic_pic")%>">
</td>
</tr>
<tr>
<td>上传原图:</td>
<td align="left" height="25"><iframe frameborder=0 width=290 height=25 scrolling=no src="upload.asp?action=pic"></iframe></td>
</tr>
<tr>
<td width="17%">图片介绍</td>
<td width="83%">
<textarea name="desc" cols="65" rows="6" id="desc"><%=rs("pic_desc")%></textarea>
</td>
</tr>
<tr align="center">
<td colspan="2">
<input name="isbest" type="checkbox" id="isbest" value="1" <%if rs("isbest")=1 then response.write "checked" end if%> style="display:none">
<input name="Submit" type="submit" id="Submit" value="确定修改">
<input type="reset" name="Reset" value="清空重填">
[<a href="admin_pic.asp?action=pic">返回</a>] </td>
</tr>
<input type="hidden" name="id" value="<%=rs("pic_id")%>">
<input type="hidden" name="action" value="editpic">
<input type="hidden" name="MM_insert" value="true">
</form>
</table>
<%end if
if request.QueryString("action")="delpic" then
if request.querystring("id")="" then
Response.Write("<script language=javascript>alert('请指定操作的对象!');history.back(1);</script>")
response.end
else
if not isinteger(request.querystring("id")) then
Response.Write("<script language=javascript>alert('非法的ID参数!');history.back(1);</script>")
response.end
end if
end if
sql="select * from pic where pic_id="&cint(request.querystring("id"))
set rs=server.createobject("adodb.recordset")
rs.open sql,conn,1,1%>
<table align="center" width="98%" align="center" border="1" cellspacing="0" cellpadding="4" style="border-collapse: collapse">
<form name="form2" method="post" action="">
<tr>
<td colspan="2">
删除图片</td>
</tr>
<tr>
<td width="17%">图片名称</td>
<td width="83%"> <%=rs("pic_name")%> </td>
</tr>
<tr>
<td width="17%">所属分类</td>
<td width="83%">
<%
sql="select * from piccat where piccat_id="&rs("piccat_id")
set rs2=server.createobject("adodb.recordset")
rs2.open sql,conn,1,1
%><%=rs2("piccat_name")%> </td>
</tr>
<tr>
<td width="17%">图片大小</td>
<td width="83%"><%=rs("pic_url")%>
</td>
</tr>
<tr>
<td width="17%">缩图地址</td>
<td width="83%"><%=rs("pic_spic")%>
</td>
</tr>
<tr>
<td width="17%">图片地址</td>
<td width="83%"><%=rs("pic_pic")%>
</td>
</tr>
<tr>
<td width="17%">图片介绍</td>
<td width="83%"><%=rs("pic_desc")%> </td>
</tr>
<tr align="center">
<td colspan="2">
<input name="isbest" type="checkbox" id="isbest" value="1" <%if rs("isbest")=1 then response.write "checked" end if%>>
推荐
<input name="Submit" type="submit" id="Submit" value="确定删除">
[<a href="admin_pic.asp?action=pic">返回</a>] </td>
</tr>
<input type="hidden" name="id" value="<%=rs("pic_id")%>">
<input type="hidden" name="action" value="delpic">
<input type="hidden" name="MM_insert" value="true">
</form>
</table>
<% end if %>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -