📄 adminnews.asp
字号:
rs.close
set rs=nothing
%>
</table>
<%elseif request("type")="mgclass" then
%><br />
<table width="200" border="1" cellspacing="0" cellpadding="0">
<tr>
<td align="center" bgcolor="#3B83C5">分类名称</td>
<td align="center" bgcolor="#3B83C5">class值</td>
<td align="center" bgcolor="#3B83C5">操作</td>
</tr>
<% sqlstr ="select * from newsclass 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 newsclass 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")="addnews" then%>
<table align=center border="0" cellpadding="0" cellspacing="0" rules=none class=3d id=upnews style="position:absolute;left:270;top:40;display:none">
<tr onMouseDown="MDown(upnews)" 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.upnews.style.display=(document.all.upnews.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=news"></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.upnews.style.display=(document.all.upnews.style.display=='none')?'':'none'" class=wubian>上传新闻图片</button>
<br />
新闻来自:
<input name="user" type="text" class="wubian" id="user" size="40" />
<br />
新闻分类: <%call newclass("newsclass")%>
<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.form2.title.focus();
return false;}
if(IframeID.document.body.innerHTML==""){
alert("新闻内容不能为空");
IframeID.document.body.focus();
return false;}
return true;}
</Script>
<%elseif request("type")="editnews" then
set rs1=server.CreateObject("adodb.recordset")
sql1="select * from news where id="&request("id")
rs1.open sql1,cn,1,2
%>
<table align=center border="0" cellpadding="0" cellspacing="0" rules=none class=3d id=upnews style="position:absolute;left:270;top:40;display:none">
<tr onMouseDown="MDown(upnews)" 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.upnews.style.display=(document.all.upnews.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=news"></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.upnews.style.display=(document.all.upnews.style.display=='none')?'':'none'" class=wubian>上传新闻图片</button>
<br />
新闻来自:
<input name="user" type="text" class="wubian" id="user" value="<%=rs1("user")%>" size="40" />
<br />
新闻分类: <%call editclass("newsclass",rs1("class"))%>
<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.form.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 + -