📄 adminpic_body.asp
字号:
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 cellpadding="2" cellspacing="1" border="0" width="760" cellpadding="4" align=center class="a2">
<form name="form2" method="post" action="">
<tr class="a1">
<td colspan="2">新增图片</td>
</tr>
<tr class="a3">
<td width="17%">图片名称</td>
<td width="83%">
<input type="text" name="name" size="40">
</td>
</tr>
<tr class="a4">
<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 class="a3">
<td width="17%">图片添加</td>
<td width="83%">
<input type="text" name="url" size="60" value="<%=webname%>">
</td>
</tr>
<tr class="a4">
<td width="17%">图片地址</td>
<td width="83%">
<input type="text" name="pic" size="60">
</td>
</tr>
<tr class="a3">
<td width="17%">图片介绍</td>
<td width="83%">
<textarea name="desc" cols="65" rows="6">图片版权归图片本人所有,未经同意不得转载!</textarea>
</td>
</tr>
<tr class="a4" align="center">
<td colspan="2" height="30" bgcolor="#F5F5F5">
<input type="checkbox" name="isbest" value="1">
推荐
<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
errmsg=errmsg+"<br>"+"<li>请指定操作的对象!"
call diserror()
response.end
else
if not isinteger(request.querystring("id")) then
errmsg=errmsg+"<br>"+"<li>非法的ID参数!"
call diserror()
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 cellpadding="2" cellspacing="1" border="0" width="760" cellpadding="4" align=center class="a2">
<form name="form2" method="post" action="">
<tr class="a1">
<td colspan="2">修改图片</td>
</tr>
<tr class="a3">
<td width="17%">图片名称</td>
<td width="83%">
<input name="name" type="text" id="name" size="40" value="<%=rs("pic_name")%>">
</td>
</tr>
<tr class="a4">
<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 class="a3">
<td width="17%">图片添加</td>
<td width="83%">
<input name="url" type="text" id="url" size="60" value="<%=rs("pic_url")%>">
</td>
</tr>
<tr class="a4">
<td width="17%">图片地址</td>
<td width="83%">
<input name="pic" type="text" id="pic" size="60" value="<%=rs("pic_pic")%>">
</td>
</tr>
<tr class="a3">
<td width="17%">图片介绍</td>
<td width="83%">
<textarea name="desc" cols="65" rows="6" id="desc"><%=rs("pic_desc")%></textarea>
</td>
</tr>
<tr class="a4" align="center">
<td colspan="2" height="30" bgcolor="#F5F5F5"> <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="确定修改">
<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
errmsg=errmsg+"<br>"+"<li>请指定操作的对象!"
call diserror()
response.end
else
if not isinteger(request.querystring("id")) then
errmsg=errmsg+"<br>"+"<li>非法的ID参数!"
call diserror()
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 cellpadding="2" cellspacing="1" border="0" width="760" cellpadding="4" align=center class="a2">
<form name="form2" method="post" action="">
<tr class="a1">
<td colspan="2">
<font color="#333333">删除图片</font></td>
</tr>
<tr class="a3">
<td width="17%">图片名称</td>
<td width="83%"> <%=rs("pic_name")%> </td>
</tr>
<tr class="a4">
<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 class="a3">
<td width="17%">图片地址</td>
<td width="83%"><img src="<%=rs("pic_pic")%>">
</td>
</tr>
<tr class="a4">
<td width="17%">图片介绍</td>
<td width="83%"><%=rs("pic_desc")%> </td>
</tr>
<tr class="a3"align="center">
<td colspan="2" height="30" bgcolor="#F5F5F5">
<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%>
<br>
</td>
</tr>
</table>
<%
end sub%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -