⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 content_modi4.asp

📁 是一个关于小学信息化教育的平台,提供了学校论坛,和聊天室功能!
💻 ASP
字号:
<!--#include file="../../include/db.asp"-->
<!--#include file="../../include/admin_check.asp"-->
<!--#INCLUDE FILE="power.ASP"-->
<%
action=trim(request.querystring("action"))
Set conn = OpenOrGet_Database("sql_conn")
newsid=trim(Request("id"))

'得到项目列表
sql="select number,name from item_type where (len(number)=4 and show_type='link') or (len(number)=4 and show_type='image2') or (len(number)=2) order by number"
Set itemRs=Open_rs(conn,sql)

 
newsid=trim(Request("id"))

booksql="select * from content where id='"&newsid&"'"
set Rs=open_rs(conn,booksql)

if newsid<>"" and rs.eof then
				%>
				<script language="javascript">
				<!--
					alert("没有相关记录,请重新选择!!");
					window.history.back(1);
				-->
				</script>
	<%
end if

if action="add" or action="modi" then

	selectsql="select id from content where title='"&trim(request("title"))&"'"
	set checkRs=open_rs(conn,selectsql)
	
	if not (checkRs.eof and checkRs.bof) then
		if rs("id")<>checkRs("id") then
	  Response.Write "<script language=javascript>"
   	  Response.Write "alert('有同名的记录,请重新操作');"
    	  Response.Write "history.go(-1);"
    	  Response.Write "</script>"
	  Response.End
	  	end if
	end if

mytitle=transvalue(request("title"))
apply_name=request("apply_name")
if len(request("type"))=1 then
	depart_number="0"&request("type")
else
	depart_number=request("type")
end if
apply_time=now

conn.execute "update content set title='"&mytitle&"',user_name='"&apply_name&"',type_id='"&depart_number&"',content='"&transvalue(trim(request("content")))&"' where id='"&rs("id")&"'"


	      Response.Write "<script language=javascript>"
   		  Response.Write "alert('操作成功!!');"
    	  Response.Write "window.location.href='content4.asp?myjoke=1&type="&trim(request("type"))&"&act=search';"
    	  Response.Write "</script>"
	 	  Response.End

end if

%>
<html>
<head>
<title>深圳育才一小欢迎您!</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link rel="stylesheet" href="../../include/page.css" type="text/css">
</head>

<body >
<table width="1" border="0" cellspacing="0" cellpadding="0" align="center">
  <tr> 
    <td> 
      <table width="753" border="0" cellspacing="0" cellpadding="0">
        <tr> 
          <td><!--#include file="../../include/admin_banner.inc"--></td>
        </tr>
        <tr> 
          <td> 
            <table width="100%" border="0" cellspacing="0" cellpadding="0">
              <tr> 
                <td width="1%">&nbsp;</td>
                <td width="99%"> 
                  <table width="100%" border="0" cellspacing="0" cellpadding="0">
                    <tr> 
                      <td id="td1">&nbsp;</td>
                    </tr>
                    <tr> 
                      <td> 
                        <table width="100%" border="0" cellspacing="0" cellpadding="0">
                          <tr> 
                            <td width="21%" valign="top"><!--#include file="../../include/admin_left.inc"--></td>
                            <td width="2%" valign="top">&nbsp;</td>
                            <td width="77%" height=1 valign="top"> 
                              <table width="100%" border="0" cellspacing="0" cellpadding="0">
                                <tr> 
                                  <td> 
                                    <table width="100%" border="0" cellspacing="0" cellpadding="0">
                                      <tr valign="top"> 
                                        <td background="/images/middle/m-bg.gif" width="70"><img src="/images/wzgl.gif"></td>
                                        <td background="/images/middle/m-bg.gif"  align="right"><img src="/images/middle/pacer1.gif" width="3" height="38"></td>
                                        <td background="/images/middle/m-bg.gif"  align="right" valign="middle" width="16"><a href=# onClick="more()"><img src="/images/middle/more.gif" width="16" height="16" border=0 alt="更多"></a></td>
                                        <td background="/images/middle/m-bg.gif"  align="right" width="8"><img src="/images/middle/pacer.gif" width="8" height="38"></td>
                                        <td background="/images/middle/m-bg.gif"  align="right" valign="middle" width="16"><a href=# onClick="help()"><img src="/images/middle/help.gif" width="16" height="16" border=0 alt="栏目帮助"></a></td>
                                        <td width="6" align="right"><img src="/images/middle/M-r.gif" width="16" height="38"></td>
                                      </tr>
                                    </table>
                                    <table width="100%" border="0" cellspacing="0" cellpadding="0">
                                      <tr> 
                                        <td class="bg-left" width="6"><img src="/images/left/l-l.gif" border=0></td>
                                        <td class="newsborder" width="100%" > 
                                          <table width="100%" border="0" cellspacing="1" cellpadding="0">
                                            <tr> 
                                              <td height="170" valign="top"> 
                                                <table border="0" cellpadding="0" cellspacing="1" width="100%" height="100%">
                                                  <tr> 
                                                    <td> 
                                                      <table border=0 cellpadding=0 cellspacing=0 align="center" width="100%" height="100%">
                                                        <form name=dataform method=post action='<%=Request.ServerVariables("PATH_INFO")%>?action=modi&id=<%=rs("id")%>'>
                                                          <tr> 
                                                            <td class=tdsmall noWrap valign=top bgcolor="#f0f0e8" width="70"> 
                                                              <p><br>
                                                                &nbsp;&nbsp;&nbsp;<b>项目名:</b></p>
                                                            </td>
                                                            <td bgcolor="#f0f0e8" class="tdsmall" colspan="2"> 
                                                              <select name="type" class="textfield">
                                                                <% for i=1 to itemRs.recordcount
                                                                	' 检索itemrs 中的栏目是不是根栏目,或是在管理员的可以管理的权限中
                                                                  	if len(itemRs("number"))=2 or session("adm_power")="1" or instr(session("content_admin"),"/"&itemRs("number")&"/")<>0 then
                                                                  		selectname=transvalue(itemrs("name"))
                                                                  		j=len(trim(itemrs("number")))/2
                                                                  		for j=1 to j-1
											selectname="--"&selectname
										next
										if itemRs("number")=rs("type_id") then                                                             
									%>
                                                                			<option value="<%=itemRs("number")%>" selected><%=selectname%></option>
                                                                	<%
                                                                		else
                                                                  	%>
                                                                			<option value="<%=itemRs("number")%>"><%=selectname%></option>
                                                                	<% 	end if 
                                                                	end if
                                                                  	itemRs.movenext
								next %>
                                                              </select>
                                                            </td>
                                                          </tr>
                                                          <tr> 
                                                            <td class=tdsmall noWrap valign=top bgcolor="#f0f0e8" width="70"><br>
                                                              &nbsp;&nbsp;&nbsp;<b>标题:</b></td>
                                                            <td bgcolor="#f0f0e8" class="tdsmall" colspan="2"> 
                                                              <p> 
                                                                <input name=title type=text value='<%=rs("title")%>' style='HEIGHT: 22px; WIDTH: 150px'  class='edline' maxlength="100" >(字数限制100)
                                                              </p>
                                                            </td>
                                                          </tr>
                                                         <tr> 
                                                            <td class=tdsmall noWrap valign=top bgcolor="#f0f0e8" width="70"><b><br>
                                                              &nbsp;&nbsp;&nbsp;链接:</b></td>
                                                            <td bgcolor="#f0f0e8" class="tdsmall"> 
                                                               <input name=content type=text value='<%=rs("content")%>' style='HEIGHT: 22px; WIDTH: 150px'  class='edline' maxlength="200" >(字数限制200,格式如:http://www.sahu.com)</td>
                                                          </tr>
                                                          <%
selectsql="select username from bbs_user where id='"&session("userid")&"'"
set ApplyNameRs=open_rs(conn,selectsql)
if not (ApplyNamers.eof and ApplyNameRs.bof) then
response.write "<input type=hidden value='"&ApplyNameRs("username")&"' name=apply_name>"
else
response.write "<input type=hidden value='未知人员' name=apply_name>"
end if
ApplyNameRs.close
set ApplyNameRs=nothing
%>
                                                          <input type=hidden name=id value=<%=rs("id")%>>
                                                        </form>
                                                      </table>
                                                    </td>
                                                  </tr>
                                                </table>
                                                <p align="center">&nbsp;</p>
                                                </td>
                                            </tr>
                                            <tr>
                                              <td height="20" valign="top"> 
                                                <table width="100%" border="0" cellspacing="0" cellpadding="0">
                                                  <tr align="center"> 
                                                    <td width="50%" height="30"> 
                                                                                                                     <table border=0 cellpadding=0 cellspacing=0>
                 
                <tr><td><img border=0   src="/images/left/s-l.gif"></td><td background="/images/left/s-bg.gif" class=button noWrap>&nbsp;<a href="javascript:checkform2();">提 交</a>&nbsp;</td>
                  <td><img border=0 
                        src="/images/left/s-r.gif"></td>
                  <td width="20"></td>
            <td><img border=0 
                  src="/images/left/s-l.gif"></td>
            <td background="/images/left/s-bg.gif" 
                class=button noWrap>&nbsp;<a href="content4.asp?type=<%=rs("type_id")%>">返 回</a>&nbsp;</td>
            <td><img border=0 
                  src="/images/left/s-r.gif"></td></tr>
        </table>
                                                    </td>
                                                  </tr>
                                                </table>
                                              </td>
                                            </tr>
                                          </table>
                                        </td>
                                        <td class="bg_right" width="6"><img src="/images/left/l-r.gif" border=0></td>
                                      </tr>
                                    </table>
                                    <table width="100%" border="0" cellspacing="0" cellpadding="0">
                                      <tr valign="top" class="xxtz_bg"> 
                                        <td width="6"><img src="/images/middle/m_left.gif" width="13" height="8"></td>
                                        <td width="100%" align="right"></td>
                                        <td align="right" width="6"><img src="/images/middle/m_right.gif" width="12" height="8"></td>
                                      </tr>
                                    </table>
                                  </td>
                                </tr>
                              </table>
                            </td>
                          </tr>
                        </table>
                      </td>
                    </tr>
                    <tr> 
                      <td height="13">&nbsp;</td>
                    </tr>
                    <tr> 
                      <td><!--#include file="../../include/dot.inc"--></td>
                    </tr>
                    <tr> 
                      <td>&nbsp;</td>
                    </tr>
                  </table>
                </td>
              </tr>
            </table>
          </td>
        </tr>
      </table>
    </td>
  </tr>
</table>
</body>
</html>
     <SCRIPT language=javascript>
<!--
function checkform()
{ 
 	var Checkblank = /^(\s*|(\ )|(\.))*$/;
	if (Checkblank.test(form.username.value))	 	 
{
          alert("用户名不能为空!");
	  return false;	
         } 
	if (Checkblank.test(form.userpass.value))	 	 
{
          alert("密码不能为空!");
	  return false;	
         } 
      

      window.form.submit();

   }
   function checkform2()
{    
 	var Checkblank = /^(\s*|(\ )|(\.))*$/;
   if (Checkblank.test(dataform.title.value)){
   	alert("标题不能为空!");
   	return;
   }
             if(dataform.title.value.length>=100)
 {
          alert("标题的字数不能超过100!");
	  return false;	
         }   
                      if(dataform.content.value.length>=200)
 {
          alert("链接的字数不能超过100!");
	  return false;	
         }  
      window.dataform.submit();

   }
//-->
</SCRIPT>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -