AboutEdit.asp
上传用户:dbstep
上传日期:2022-08-06
资源大小:2803k
文件大小:7k
源码类别:

WEB源码(ASP,PHP,...)

开发平台:

ASP/ASPX

  1. <HTML xmlns="http://www.w3.org/1999/xhtml">
  2. <HEAD>
  3. <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=utf-8" />
  4. <TITLE>编辑企业</TITLE>
  5. <link rel="stylesheet" href="Images/CssAdmin.css">
  6. <script language="javascript" src="../skweb/JS/Admin.js"></script>
  7. </HEAD>
  8. <!--#include file="../skweb/Const.asp" -->
  9. <!--#include file="../skweb/ConnSiteData.asp" -->
  10. <!-- #include file="../fckeditor/fckeditor.asp" -->
  11. <!--#include file="CheckAdmin.asp"-->
  12. <%
  13. if Instr(session("AdminPurview"),"|11,")=0 then 
  14.   response.write ("<font color='red')>你不具有该管理模块的操作权限,请返回!</font>")
  15.   response.end
  16. end if
  17. '========判断是否具有管理权限
  18. %>
  19. <BODY>
  20. <% 
  21. dim Result
  22. Result=request.QueryString("Result")
  23. dim ID,AboutName,ViewFlag,Content,Source
  24. dim GroupID,GroupIdName,Exclusive,ChildFlag
  25. ID=request.QueryString("ID")
  26. call AboutEdit() 
  27. %>
  28.  
  29. <table width="100%" border="0"  >
  30.   <form name="editAboutForm" method="post" action="AboutEdit.asp?Action=SaveEdit&Result=<%=Result%>&ID=<%=ID%>">
  31.   <tr>
  32.     <td height="24" nowrap  ><table width="100%" border="0" cellpadding="5" cellspacing="1" bgcolor="#CCCCCC" id=editProduct idth="100%">
  33.  <tr>
  34.         <td height="29" colspan="2" background="Images/menutitle.gif" bgcolor="#FFFFFF"><table width="470" border="0" cellspacing="0" cellpadding="0">
  35.           <tr>
  36.             <td width="121"><strong><font color="#000000" size="2">企业信息</font></strong></td>
  37.             <td width="87"><a href="AboutEdit.asp?Result=Add"><img src="Images/x1.gif" width="52" height="17" border="0"></a></td>
  38.             <td width="87"><a href="AboutList.asp"><img src="Images/xlm.gif" width="52" height="17" border="0"></a></td>
  39.             <td width="87">&nbsp;</td>
  40.             <td width="88">&nbsp;</td>
  41.           </tr>
  42.         </table></td>
  43.       </tr>
  44.       <tr>
  45.         <td width="10%" height="20" align="right" bgcolor="#FFFFFF">信息名称:</td>
  46.         <td width="90%" bgcolor="#FFFFFF"><input name="AboutName" type="text" class="textfield" id="AboutName" style="WIDTH: 240;" value="<%=AboutName%>" maxlength="100">&nbsp;发布:<input name="ViewFlag" type="checkbox" style='HEIGHT: 13px;WIDTH: 13px;' value="1" <%if ViewFlag then response.write ("checked")%>>
  47. &nbsp;*&nbsp;不少于3个字符</td>
  48.       </tr>
  49.       <tr>
  50.         <td height="20" align="right" bgcolor="#FFFFFF">新闻来源:</td>
  51.         <td bgcolor="#FFFFFF"><input name="Source" type="text" class="textfield" style="WIDTH: 240;" value="<%=Source%>" maxlength="100"></td>
  52.       </tr>
  53.       <tr>
  54.         <td height="20" align="right" bgcolor="#FFFFFF">查看权限:</td>
  55.         <td bgcolor="#FFFFFF"><select name="GroupID" class="textfield">
  56.           <% call SelectGroup() %>
  57.           </select>
  58.           <input name="Exclusive" type="radio" value="&gt;="  <%if Exclusive="" or Exclusive=">=" then response.write ("checked")%>> 隶属<input type="radio"  <%if Exclusive="=" then response.write ("checked")%> name="Exclusive" value="=">专属[隶属:权限值≥可查看,专属:权限值=可查看]</td>
  59.       </tr>
  60.    <tr>
  61.         <td height="20" align="right" valign="top" bgcolor="#FFFFFF">信息内容:<br>
  62.         <td bgcolor="#FFFFFF"><%
  63. Dim oFCKeditor
  64. Set oFCKeditor = New FCKeditor
  65. oFCKeditor.BasePath = "../fckeditor/" 
  66. oFCKeditor.ToolbarSet = "Default" 
  67. oFCKeditor.Width = "100%" 
  68. oFCKeditor.Height = "400" 
  69. oFCKeditor.Value = content
  70. oFCKeditor.Create "Content" 
  71. %> </td>
  72.       </tr>
  73.       <tr>
  74.         <td height="30" align="right" bgcolor="#FFFFFF">&nbsp;</td>
  75.         <td valign="bottom" bgcolor="#FFFFFF"><input name="submitSaveEdit" type="submit"  id="submitSaveEdit" value="保存" style="WIDTH: 80;" ></td>
  76.       </tr>
  77.     </table></td>
  78.   </tr>
  79.   </form>
  80. </table>
  81. </BODY>
  82. </HTML>
  83. <%
  84. sub AboutEdit()
  85.   dim Action,rsCheckAdd,rs,sql
  86.   Action=request.QueryString("Action")
  87.   if Action="SaveEdit" then '保存编辑管理员信息
  88.     set rs = server.createobject("adodb.recordset")
  89.     if len(trim(request.Form("AboutName")))<3 then
  90.       response.write ("<script language=javascript> alert('信息名称为必填项目!');history.back(-1);</script>")
  91.       response.end
  92.     end if
  93.     if Result="Add" then '创建网站管理员
  94.   sql="select * from sk_About"
  95.       rs.open sql,conn,1,3
  96.       rs.addnew
  97.       rs("AboutName")=trim(Request.Form("AboutName"))
  98.       rs("Source")=trim(Request.Form("Source"))
  99.   if Request.Form("ViewFlag")=1 then
  100.         rs("ViewFlag")=Request.Form("ViewFlag")
  101.   else
  102.         rs("ViewFlag")=0
  103.   end if
  104.   rs("Content")=Request.Form("Content")
  105.       GroupIdName=split(Request.Form("GroupID"),"┎╂┚")
  106.   rs("GroupID")=GroupIdName(0)
  107.   rs("Exclusive")=trim(Request.Form("Exclusive"))
  108.   if Request.Form("ChildFlag")=1 then
  109.         rs("ChildFlag")=Request.Form("ChildFlag")
  110.     rs("Sequence")=999
  111.   else
  112.         rs("ChildFlag")=0
  113.     rs("Sequence")=99
  114.   end if
  115.   rs("AddTime")=now()
  116. end if  
  117. if Result="Modify" then '修改网站管理员
  118.       sql="select * from sk_About where ID="&ID
  119.       rs.open sql,conn,1,3
  120.       rs("AboutName")=trim(Request.Form("AboutName"))
  121.       rs("Source")=trim(Request.Form("Source"))
  122.   if Request.Form("ViewFlag")=1 then
  123.         rs("ViewFlag")=Request.Form("ViewFlag")
  124.   else
  125.         rs("ViewFlag")=0
  126.   end if
  127.   rs("Content")=Request.Form("Content")
  128.       GroupIdName=split(Request.Form("GroupID"),"┎╂┚")
  129.   rs("GroupID")=GroupIdName(0)
  130.   rs("Exclusive")=trim(Request.Form("Exclusive"))
  131.   if Request.Form("ChildFlag")=1 then
  132.         rs("ChildFlag")=Request.Form("ChildFlag")
  133.     rs("Sequence")=100
  134.   else
  135.         rs("ChildFlag")=0
  136.   end if
  137. end if
  138. rs.update
  139. rs.close
  140.     set rs=nothing 
  141.      Response.Redirect("Tips/about.asp")
  142.   else '提取管理员信息
  143. if Result="Modify" then
  144.       set rs = server.createobject("adodb.recordset")
  145.       sql="select * from sk_About where ID="& ID
  146.       rs.open sql,conn,1,1
  147.   AboutName=rs("AboutName")
  148.   Source=rs("Source")
  149.   ViewFlag=rs("ViewFlag")
  150.   GroupID=rs("GroupID")
  151.   Exclusive=rs("Exclusive")
  152.       Content=rs("Content")
  153.   ChildFlag=rs("ChildFlag")
  154.   rs.close
  155.       set rs=nothing 
  156. end if
  157.   end if
  158. end sub
  159. %>
  160. <% 
  161. sub SelectGroup()
  162.   dim rs,sql
  163.   set rs = server.createobject("adodb.recordset")
  164.   sql="select GroupID,GroupName from sk_MemGroup"
  165.   rs.open sql,conn,1,1
  166.   if rs.bof and rs.eof then
  167.     response.write("未设组别")
  168.   end if
  169.   while not rs.eof
  170.     response.write("<option value='"&rs("GroupID")&"┎╂┚"&rs("GroupName")&"'")
  171.     if GroupID=rs("GroupID") then response.write ("selected")
  172.     response.write(">"&rs("GroupName")&"</option>")
  173.     rs.movenext
  174.   wend
  175.   rs.close
  176.   set rs=nothing
  177. end sub
  178. %>