欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

Asp+Rss閱讀器制作第2/2頁

 更新時間:2006年08月31日 00:00:00   作者:  

記錄編輯頁面Admin.asp代碼如下:
復制代碼 代碼如下:

<!--#include file="Conn.asp"-->
<link href="inc/style.css" rel="stylesheet" type="text/css">
<script language="JavaScript" src="inc/checkFunction.js"></script>
<%
'******************************
'文件名:Admin.asp
'功 能:數(shù)據(jù)添加管理文件
'日 期:2006-6-18
'編 程:Cloud.L
'******************************

Dim Wid,Rs,Sql
Wid=700

Select Case Request("menu")
Case ""
  Main
Case "AddOk"
  IsAdd=1
  RsOk
Case "EditRs"
  EditRs
Case "EditOk"
  IsAdd=0
  RsOk
Case "DelOk"
  conn.execute("delete from [SIHRT_Rss] where Rss_ID="&Request("ID"))
  Response.Redirect("Admin.asp")
Case "DelAll"
  if Request("CID")="" then
   Response.write "<script>alertMsg('您沒有選擇刪除項');</script>"
  end if
  for each DelItem in Request("CID")
   conn.execute("delete from [SIHRT_Rss] where Rss_ID="&DelItem)
  next
  Response.Redirect("Admin.asp")

End Select

Sub Main
'This is main sub
Sql="select * from [SIHRT_Rss] order by Rss_ID"
Set Rs=Server.CreateObject("Adodb.Recordset")
Rs.open Sql,Conn,1,1
%>
<form action="?menu=DelAll" method="post" name="ListForm">
<table border="0" cellpadding="2" cellspacing="1" align="center" width="<%=Wid%>" class="tb_bg">
<tr class="tr_tt">
  <td colspan="5" align="center">--==== RSS數(shù)據(jù)管理 ====--</td>
</tr>
<tr class="tr_tt2">
  <td width="5%" align="center" title="全選數(shù)據(jù)項"><input type="checkbox" name="SelectAll" onclick="checkAll(this)" class="checkbox"></td>
  <td width="5%" align="center">ID</td>
  <td width="20%" align="center">主題</td>
  <td width="60%" align="center">內(nèi)容</td>
  <td width="10%" align="center">操作</td>
</tr>

<%
if Rs.eof and Rs.eof then
  response.write "<tr class=""tr_bg""><td colspan=""5"" align=""center""><font color=red>無列表項數(shù)據(jù),請?zhí)砑佑涗?lt;/font></td>"
else 
  do while not Rs.eof 
%>
<tr class="tr_bg" onmouseover="this.className='tr_over'" onmouseout="this.className='tr_out'">
  <td align="center"><input type="checkbox" name="CID" class="checkbox" value="<%=Rs("Rss_ID")%>"></td>
  <td align="center"><%=Rs("Rss_ID")%></td>
  <td><%=Rs("Rss_Title")%></td>
  <td>
  <%
  Rss_cont=replace(Rs("Rss_Cont"),"<br>","")
  if len(Rss_Cont)>32 then
   Response.write left(Rss_Cont,32)&"..."
  else
   Response.write Rss_Cont
  end if
  %>
  </td>
  <td align="center">
  <a href="?menu=EditRs&ID=<%=Rs("Rss_ID")%>" title="編輯該記錄">編輯</a>  <a href="?menu=DelOk&ID=<%=Rs("Rss_ID")%>" title="刪除該記錄" onclick="checkConfirm('您確定刪除該記錄?')">刪除</a>
  </td>
</tr>
<%
  Rs.MoveNext
  loop
end if
RsClose 'Close Recordset
%>
<tr class="tr_bg">
  <td colspan="5"><input type="submit" name="DelAllItems" value="刪除所選" class="button"></td>
</tr>
</table>
</form>
<form action="?menu=AddOk" method="post" name="AddForm" style="margin-top:4px;">
<table border="0" cellpadding="2" cellspacing="1" width="<%=Wid%>" align="center" class="tb_bg">
<tr class="tr_tt">
  <td colspan="2" align="center">--==== 添加記錄 ====--</td>
</tr>
<tr class="tr_bg">
  <td width="20%">記錄主題</td>
  <td width="80%"><input type="text" name="Rss_Title" size="24" maxlength="20"></td>
</tr>
<tr class="tr_bg">
  <td valign="top" style="padding-top:4px;">記錄內(nèi)容</td>
  <td><textarea name="Rss_Cont" cols="40" rows="6"></textarea></td>
</tr>
<tr class="tr_bg">
  <td colspan="2"><input type="submit" name="SRss" value="添加記錄" class="button">  <input type="reset" name="RRss" value="重新添寫" class="button"></td>
</tr>
</table>
</form>
<%
End Sub
Sub RsOk

Rss_Title=Trim(Request.Form("Rss_Title"))
errorchar=array("@","#",".","|","%","&","+",";","<",">")
for i=0 to ubound(errorchar)
  if instr(Rss_Title,errorchar(i))>0 then
   Response.Write "<script>alertMsg('主題中不能包含特殊字符');</script>"
   exit Sub
  end if
next
Rss_Cont=Request.Form("Rss_Cont")

if Rss_Title<>"" or Rss_Cont<>"" then

  Sql="Select * from [SIHRT_Rss]"
  Set Rs=Server.CreateObject("Adodb.Recordset")
  Rs.open Sql,Conn,1,3
  if IsAdd=1 then 
   Rs.AddNew
  end if
  Rs("Rss_Title")=Rss_Title
  Rs("Rss_Cont")=Rss_Cont
  Rs.Update
  Response.Redirect "Admin.asp"
  RsClose
else
  Response.Write "<script>alertMsg('請?zhí)韺懲暾涗浶畔?)</script>"
end if

End Sub
Sub EditRs
Sql="select * from [SIHRT_Rss] where Rss_ID="&Request("ID")
Set Rs=Server.CreateObject("Adodb.Recordset")
Rs.open Sql,Conn,1,1
%>
<form action="?menu=EditOk" method="post" name="AddForm" style="margin-top:4px;">
<table border="0" cellpadding="2" cellspacing="1" width="<%=Wid%>" align="center" class="tb_bg">
<tr class="tr_tt">
  <td colspan="2" align="center">--==== 編輯記錄 ====--</td>
</tr>
<tr class="tr_bg">
  <td width="20%">記錄主題</td>
  <td width="80%"><input type="text" name="Rss_Title" size="24" maxlength="20" value="<%=Rs("Rss_Title")%>"></td>
</tr>
<tr class="tr_bg">
  <td valign="top" style="padding-top:4px;">記錄內(nèi)容</td>
  <td><textarea name="Rss_Cont" cols="40" rows="6"><%=replace(Rs("Rss_Cont"),"<br>",chr(10))%></textarea></td>
</tr>
<tr class="tr_bg">
  <td colspan="2">
  <input type="submit" name="SRss" value="修改記錄" class="button">  
  <input type="reset" name="RRss" value="重新添寫" class="button">  
  <input type="button" name="GoBack" value="返回上頁" class="button" onclick="history.back();">
  </td>
</tr>
</table>
</form>
<%
End Sub
ConnClose
%>

數(shù)據(jù)庫結(jié)構(gòu)如下:
------------------------------
字段名 字段類型
Rss_ID 自動編號
Rss_Title 文本型
Rss_Cont 備注型
Rss_Date 日期型

相關(guān)文章

最新評論