?? editarticle.asp
字號:
<!--#include file="head.asp" -->
<script src="Ubbcode.js"></script>
<%
IF Request("action") = "edit" then
id = Request.Form("id")
txttitle = Strcheck(Request.Form("txttitle"))
Intime = Request.Form("year1")&"-"&Request.Form("month1")&"-"&Request.Form("day1")
txtcontent = Strcheck(Request.Form("txtcontent"))
key = Strcheck(Request.Form("key"))
writer = Strcheck(Request.Form("writer"))
hits = Strcheck(Request.Form("hits"))
writefrom = Strcheck(Request.Form("writefrom"))
classid = Request.Form("classid")
Nclassid = Request.Form("Nclassid")
Sql = "Update article set content = "& txtcontent &",title = "& txttitle &",Nclassid = "
Sql = Sql & Nclassid &",classid = "& classid &",writer = "& writer &",writefrom = "
Sql = Sql & writefrom &",dateandtime = '"& Intime &"' where articleid = " & id
conn.execute(Sql)
Response.Write "<script>alert(""修改成功!請更新首頁公告靜態頁面"");location.href=""adminedit.asp"";</script>"
Response.End
end if
%>
<form method="POST" action="?action=edit" name="myform" onSubmit="return check();">
<input type="hidden" name="id" value="<%=request("id")%>">
<table width="100%" border="1" cellspacing="0" cellpadding="3" align="center" bordercolorlight="#cccccc" bordercolordark="#FFFFFF">
<tr valign="middle" bgcolor="#CCCCCC">
<td colspan="2" align="center" height="25">修 改 文 章</td>
</tr>
<tr>
<td width="15%" align="left" valign="middle" height="20">文章類型:</td>
<td width="85%">
<select class="smallSel" name="classid" size="1">
<%
dim rs,sql,sel
dim classid,Nclassid
classid=request("classid")
Nclassid=request("Nclassid")
set rs=server.createobject("adodb.recordset")
sql="select * from Aclass"
rs.open sql,conn,1,1
if rs.eof and rs.bof then
response.write "Not record."
else
do while not rs.eof
if classid=cstr(rs("classid")) then
sel="selected"
else
sel=""
end if
response.write "<option " & sel & " value='"+CStr(rs("classID"))+"' name=classid>"+rs("class")+"</option>"+chr(13)+chr(10)
rs.movenext
loop
end if
rs.close
%>
</select>
選擇分類:
<select name="Nclassid" size="1">
<%
sql="select * from ANclass"
rs.open sql,conn,1,1
if rs.eof and rs.bof then
response.write "Not record."
else
do while not rs.eof
if Nclassid=cstr(rs("Nclassid")) then
sel="selected"
else
sel=""
end if
response.write "<option " & sel & " value='" + Cstr(rs("Nclassid")) + "'>" + rs("Nclass") + "</option>"
rs.MoveNext
Loop
end if
rs.close
%>
</select>
** </td>
</tr>
<%
sql="select * from article where articleid="&request("id")
rs.open sql,conn,1,1
%>
<tr>
<td width="15%" align="left" height="30" valign="middle">文章標題:</td>
<td width="85%" height="30">
<input type="text" name="txttitle" size="70"
class="smallinput" maxlength="100" value="<%=rs("title")%>">
</td>
</tr>
<tr>
<td width="15%" align="left" height="30" valign="middle">UBB 標簽:</td>
<td width="85%" height="30">
<!--#include file="getUbb.asp" -->
</td>
</tr>
<tr>
<td width="15%" align="left" valign="middle">修改日期:</td>
<td width="85%">
<select name="year1">
<option value="<%=year(rs("dateandtime"))%>" selected><%=year(rs("dateandtime"))%></option>
<%
for i=2001 to 2005
response.write "<option value='"&i&"'>"&i&"</option>"
next
%>
</select>
年
<select name="month1">
<option value="<%=month(rs("dateandtime"))%>" selected><%=month(rs("dateandtime"))%></option>
<%
for i=1 to 12
response.write "<option value='"&i&"'>"&i&"</option>"
next
%>
</select>
月
<select name="day1">
<option value="<%=day(rs("dateandtime"))%>" selected><%=day(rs("dateandtime"))%></option>
<%
for i=1 to 31
response.write "<option value='"&i&"'>"&i&"</option>"
next
%>
</select>
日 </td>
</tr>
<tr>
<td width="15%" align="left" valign="middle" rowspan="4">文章內容:</td>
<td width="85%">
<textarea rows="10" name="txtcontent" cols="80" class="smallarea">
<%
content=replace(rs("content"),"<BR>",chr(13))
content=replace(content," "," ")
response.write content
%>
</textarea>
</td>
</tr>
<tr>
<td width="85%"><img src="../face/a1.gif"> <img src="../face/a2.gif">
<img src="../face/a3.gif"> <img src="../face/p1.gif"> <img src="../face/p2.gif">
<img src="../face/p3.gif"> <img src="../face/p4.gif"> <img src="../face/p5.gif">
<img src="../face/p6.gif"> <img src="../face/p7.gif"> <img src="../face/p8.gif">
<img src="../face/p9.gif"> <img src="../face/p10.gif"> <img src="../face/p11.gif">
<img src="../face/p12.gif"> <img src="../face/p13.gif"> <img src="../face/p14.gif">
<img src="../face/p15.gif"> <img src="../face/p16.gif"> <img src="../face/p17.gif">
<img src="../face/p18.gif"> <img src="../face/p19.gif"> <img src="../face/p20.gif">
<img src="../face/p21.gif"> <img src="../face/p22.gif"> <img src="../face/p23.gif">
</td>
</tr>
<tr>
<td width="85%"><img src="../face/p24.gif"> <img src="../face/p25.gif">
<img src="../face/p26.gif"> <img src="../face/p27.gif"> <img src="../face/p28.gif">
<img src="../face/p29.gif"> <img src="../face/p30.gif"> <img src="../face/p31.gif">
<img src="../face/p32.gif"> <img src="../face/p33.gif"></td>
</tr>
<tr>
<td width="85%"><img src="../face/p34.gif"> <img src="../face/p35.gif">
<img src="../face/p36.gif"> <img src="../face/p37.gif"> <img src="../face/p38.gif">
<img src="../face/p39.gif"> <img src="../face/p40.gif"> <img src="../face/p41.gif">
<img src="../face/p42.gif"> <img src="../face/p43.gif"> <img src="../face/p44.gif">
<img src="../face/p45.gif"> <img src="../face/p46.gif"> <img src="../face/p47.gif">
<img src="../face/p48.gif"> <img src="../face/p49.gif"> <img src="../face/p50.gif">
<img src="../face/p51.gif"> </td>
</tr>
<tr>
<td width="15%" align="left" height="30" valign="middle">表情符號:</td>
<td width="85%" height="30">
<input type="text" name="writer" size="30"
class="smallinput" maxlength="100" value=<%=rs("writer")%>>
face/p1.gif ~~ face/p33.gif </td>
</tr>
<tr>
<td width="15%" align="left" height="30" valign="middle">錄入人:</td>
<td width="85%" height="30"><%=rs("author")%></td>
</tr>
<tr>
<td colspan="2" align="center" height="30">
<input type="submit" value=" 修 改 "
name="cmdok" class="buttonface">
<input type="reset" value=" 清 除 "
name="cmdcancel" class="buttonface">
</td>
</tr>
</table>
</form>
<%
set rs=nothing
conn.close
set conn=nothing
%>
<script language="JavaScript">
function check(){
if (myform.txttitle.value ==""){
alert("請輸入文章標題");
myform.txttitle.focus();
return false;
}
if (myform.txtcontent.value ==""){
alert("請輸入文章內容");
myform.txtcontent.focus();
return false;
}
return true;
}
</script>
<!--#include file="copy.asp" -->
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -