📄 adminbook.asp
字号:
<tr>
<td align="center" bgcolor="#3B83C5">分类名称</td>
<td align="center" bgcolor="#3B83C5">class值</td>
<td align="center" bgcolor="#3B83C5">操作</td>
</tr>
<% sqlstr ="select * from bookclass order by id desc" '查表
set rs =cn.execute(sqlstr) '利用connection的execute方法运行SQL命令
Do While (Not RS.Eof)
%>
<tr>
<td align="center"><%=rs("classname")%></td>
<td align="center"><%=rs("class")%></td>
<td align="center"><a href="?type=editclass&id=<%=rs("id")%>">修改</a> <a href="?action=delclass&id=<%=rs("id")%>">删除</a></td>
</tr>
<%
rs.movenext
loop
set rs =nothing%>
</table>
<form id="form1" name="form1" method="post" action="?action=addclass">
<table width="200" border="1" cellspacing="0" cellpadding="0">
<tr>
<td>
<label>
分类名称:<input name="classname" type="text" class="wubian" id="classname" size="20" />
</label>
<label>
分类class值:<input name="class" type="text" class="wubian" id="class" size="4" />
</label>
<label>
<input name="Submit" type="submit" class="wubian" value="添 加" />
</label> </td>
</tr>
</table></form>
<%elseif request("type")="editclass" then
set rs1=server.CreateObject("adodb.recordset")
sql1="select * from bookclass where id="&request("id")
rs1.open sql1,cn,1,3%>
<br /><form id="form3" name="form3" method="post" action="?action=cngclass&id=<%=rs1("id")%>">
<table width="200" border="1" cellspacing="0" cellpadding="0">
<tr>
<td>分类名称:
<label>
<input name="classname" type="text" value="<%=rs1("classname")%>" class="wubian" size="12" />
</label>
*</td>
</tr>
<tr>
<td>分类class值:
<input name="class" type="text" value=<%=rs1("class")%> class="wubian" size="8" />
*数字</td>
</tr>
<tr>
<td align="center"><label>
<input name="Submit3" type="submit" class="wubian" value="修 改" />
</label></td>
</tr>
</table></form>
<%rs1.close
set rs1=nothing
elseif request("type")="addbook" then%>
<table align=center border="0" cellpadding="0" cellspacing="0" rules=none class=3d id=upbook style="position:absolute;left:270;top:40;display:none">
<tr onMouseDown="MDown(upbook)" style="cursor:move" height=22><td colspan="2" class=uptitle><b> <img src=images/ie.gif border=0 width=15 height=15 align=absMiddle> 上传文章图片</b>
<img onClick="document.all.upbook.style.display=(document.all.upbook.style.display=='none')?'':'none'" style="position:absolute;right:2;top:5;cursor:hand" border="0" src="images/close.gif" align=absMiddle></td></tr>
<tr class=bg>
<td align=center height=30><iframe frameborder=0 width=290 height=35 scrolling=no src="up.asp?action=book"></iframe>
</td>
</tr>
</table>
<form id="form2" name="form2" method="post" onSubmit="return chk();" action="?action=add">
文章标题:
<label>
<input name="title" type="text" class="wubian" id="title" size="46" />
</label>
<select name=color class="wubian">
<option value="#000000" selected>黑色</option>
<option value="#FF0000">红色</option>
<option value="#0000FF">蓝色</option>
<option value="#FFFF00">黄色</option>
<option value="#FF8000">橙色</option>
<option value="#00C600">绿色</option>
<option value="#C0C0C0">灰色</option>
<option value="#8080C0">紫色</option>
<option value="#FF0080">洋红</option>
<option value="#004080">深色</option>
</select>
<br />
文章图片:
<input name="pic" type="text" class="wubian" id="pic" size="40" />
<button onClick="document.all.upbook.style.display=(document.all.upbook.style.display=='none')?'':'none'" class=wubian>上传文章图片</button>
<br />
文章分类:
<%call newclass("bookclass")%>
<br />
文章作者:
<input name="writer" type="text" class="wubian" id="writer" size="16" />
<label>
<select name="copyright" class="wubian" id="copyright">
<option value="原创" selected="selected">原创</option>
<option value="转载">转载</option>
</select>
</label>
<br/>
是否推荐:
<input name="best" type="radio" value="true" >
推荐
<input name="best" type="radio" value="false" checked>
不推荐
<%call html()%>
<br/>
<textarea name="content" id="content" style=display:none></textarea> <input name="new" type="submit" class="wubian" id="new" value="添 加"> <input name="Submit2" type="reset" class="wubian" value="清 空" onClick="ClearReset()">
</form>
<script language="javascript">
function chk(){
document.all("content").value=IframeID.document.body.innerHTML;
if(document.form2.title.value==""){
alert("文章标题不能为空");
document.form.title.focus();
return false;}
if(IframeID.document.body.innerHTML==""){
alert("文章内容不能为空");
IframeID.document.body.focus();
return false;}
return true;}
</Script>
<%elseif request("type")="editbook" then
set rs1=server.CreateObject("adodb.recordset")
sql1="select * from book where id="&request("id")
rs1.open sql1,cn,1,2
%>
<table align=center border="0" cellpadding="0" cellspacing="0" rules=none class=3d id=upbook style="position:absolute;left:270;top:40;display:none">
<tr onMouseDown="MDown(upbook)" style="cursor:move" height=22><td colspan="2" class=uptitle><b> <img src=images/ie.gif border=0 width=15 height=15 align=absMiddle> 上传文章图片</b>
<img onClick="document.all.upbook.style.display=(document.all.upbook.style.display=='none')?'':'none'" style="position:absolute;right:2;top:5;cursor:hand" border="0" src="images/close.gif" align=absMiddle></td></tr>
<tr >
<td align=center height=30><iframe frameborder=0 width=290 height=35 scrolling=no src="up.asp?action=book"></iframe>
</td>
</tr>
</table>
<form id="form2" name="form2" method="post" onSubmit="return chk();" action="?action=cng&id=<%=rs1("id")%>">
文章标题:
<label>
<input name="title" type="text" class="wubian" value="<%=rs1("title")%>" id="title" size="46" />
</label>
<%call editcolor()%>
<br />
文章图片:
<input name="pic" type="text" class="wubian" value="<%=rs1("pic")%>" id="pic" size="40" />
<button onClick="document.all.upbook.style.display=(document.all.upbook.style.display=='none')?'':'none'" class=wubian>上传文章图片</button>
<br />
文章分类:
<%call editclass("bookclass",rs1("class"))%>
<br />
文章作者:
<input name="writer" type="text" class="wubian" id="writer" value="<%=rs1("writer")%>" size="16" />
<label>
<select name="copyright" class="wubian" id="copyright">
<option value="原创" <%if rs1("copyright")="原创" then response.Write "selected" end if%>>原创</option>
<option value="转载" <%if rs1("copyright")="转载" then response.Write "selected" end if%>>转载</option>
</select>
</label>
<br/>
是否推荐:
<input name="best" type="radio" value="true" <%if rs1("best")=true then response.write "checked" end if%>>
推荐
<input name="best" type="radio" value="false" <%if rs1("best")=false then response.write "checked" end if%>>
不推荐
<%call html()%>
<br/>
<input name="new" type="submit" class="wubian" id="new" value="修 改"> <input name="Submit2" type="reset" class="wubian" value="重 写" onClick="ClearReset()">
<textarea name="content" id="content" style=display:none><%=Server.HtmlEncode(rs1("content"))%></textarea>
</form>
<script language="javascript">
function ax(){
IframeID.document.body.innerHTML=document.all("content").value;
document.all("content").value="";
}
function chk(){
document.all("content").value=IframeID.document.body.innerHTML;
if(document.form2.title.value==""){
alert("文章标题不能为空");
document.form.title.focus();
return false;}
if(IframeID.document.body.innerHTML==""){
alert("文章内容不能为空");
IframeID.document.body.focus();
return false;}
return true;}
</Script>
<%rs1.close
set rs1=nothing
end if%></td>
</tr>
</table>
<!--#include file="bottom.asp"-->
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -