Flink_Edit.asp
上传用户:jisenq
上传日期:2014-06-29
资源大小:7216k
文件大小:11k
源码类别:

数据库编程

开发平台:

ASP/ASPX

  1. <% Option Explicit %>
  2. <!--#include file="../../FS_Inc/Const.asp" -->
  3. <!--#include file="../../FS_InterFace/MF_Function.asp" -->
  4. <!--#include file="../../FS_InterFace/NS_Function.asp" -->
  5. <!--#include file="../../FS_Inc/Function.asp" -->
  6. <!--#include file="../../FS_Inc/Func_Page.asp" -->
  7. <%
  8. Response.Buffer = True
  9. Response.Expires = -1
  10. Response.ExpiresAbsolute = Now() - 1
  11. Response.Expires = 0
  12. Response.CacheControl = "no-cache"
  13. Dim Conn,User_Conn,tmp_type,strShowErr,sRootDir,str_CurrPath
  14. MF_Default_Conn
  15. MF_Session_TF
  16. if not MF_Check_Pop_TF("FL002") then Err_Show
  17. if G_VIRTUAL_ROOT_DIR<>"" then sRootDir="/"+G_VIRTUAL_ROOT_DIR else sRootDir=""
  18. if Session("Admin_Is_Super") = 1 then
  19. str_CurrPath = sRootDir &"/"&G_UP_FILES_DIR
  20. Else
  21. str_CurrPath = Replace(sRootDir &"/"&G_UP_FILES_DIR&"/adminfiles/"&Session("Admin_Name"),"//","/")
  22. End if
  23. if trim(Request.Form("edit_save"))<>"" then
  24. dim obj_save_Rs
  25. if trim(Request.Form("F_Name"))="" or trim(Request.Form("F_Type"))="" or trim(Request.Form("F_Url"))="" or trim(Request.Form("F_Url"))="http://" or trim(Request.Form("F_Content"))="" then
  26. strShowErr = "<li>带*的必须填写</li>"
  27. Response.Redirect("../error.asp?ErrCodes="&Server.URLEncode(strShowErr)&"&ErrorUrl=")
  28. Response.end
  29. end if
  30. set obj_save_Rs = Server.CreateObject(G_FS_RS)
  31. if Request.Form("edit_save")="edit" then
  32. obj_save_Rs.open "select * from FS_FL_FrendList where id="&Request.Form("id"),Conn,1,3
  33. else
  34. obj_save_Rs.open "select * from FS_FL_FrendList where 1=2",Conn,1,3
  35. obj_save_Rs.addnew
  36. end if
  37. obj_save_Rs("F_Name") = Request.Form("F_Name")
  38. if Request.Form("F_Type")="0" then:obj_save_Rs("F_Type") =0:else:obj_save_Rs("F_Type") =1:end if
  39. obj_save_Rs("F_Url") = Request.Form("F_Url")
  40. obj_save_Rs("F_Content") = Request.Form("F_Content")
  41. if Request.Form("F_Type")="0" then:obj_save_Rs("F_PicUrl") = Request.Form("F_PicUrl"):end if
  42. if trim(Request.Form("F_Lock"))<>"" then:obj_save_Rs("F_Lock") =1:else:obj_save_Rs("F_Lock") = 0:end if
  43. obj_save_Rs("F_OrderID") = clng(Request.Form("F_OrderID"))
  44. if trim(Request.Form("F_IsUser"))<>"" then:obj_save_Rs("F_IsUser") = 1:else:obj_save_Rs("F_IsUser") = 0:end if
  45. obj_save_Rs("F_Author") = session("Admin_Name")
  46. obj_save_Rs("F_Mail") = Request.Form("F_Mail")
  47. obj_save_Rs("F_Content_des") = Request.Form("F_Content_des")
  48. obj_save_Rs("F_LinkContent") = Request.Form("F_LinkContent")
  49. obj_save_Rs("F_isAdmin") = 1
  50. if trim(Request.Form("ClassID"))="" then:obj_save_Rs("ClassID") = 0:else:obj_save_Rs("ClassID") = Request.Form("ClassID"):end if
  51. obj_save_Rs("Addtime") = Request.Form("Addtime")
  52. obj_save_Rs.update
  53. obj_save_Rs.close:set obj_save_Rs = nothing
  54. strShowErr = "<li>保存成功</li>"
  55. Response.Redirect("../success.asp?ErrCodes="&Server.URLEncode(strShowErr)&"&ErrorUrl=Flink/Flink_Manage.asp")
  56. Response.end
  57. end if
  58. if Request.QueryString("Action")="edit" then
  59. dim tmp_id,tmp_F_Name,tmp_F_Type,tmp_F_Url,tmp_F_Content,tmp_F_PicUrl,tmp_F_Lock,tmp_F_OrderID,tmp_save,tmp_str,obj_edit_Rs
  60. dim tmp_F_IsUser,tmp_F_Author,tmp_F_Mail,tmp_F_Content_des,tmp_F_LinkContent,tmp_F_isAdmin,tmp_ClassID,tmp_Addtime
  61. if trim(Request.QueryString("id"))=empty or not isnumeric(trim(Request.QueryString("id"))) then
  62. strShowErr = "<li>错误参数</li>"
  63. Response.Redirect("../success.asp?ErrCodes="&Server.URLEncode(strShowErr)&"&ErrorUrl=")
  64. Response.end
  65. end if
  66. set obj_edit_Rs = Server.CreateObject(G_FS_RS)
  67. obj_edit_Rs.open "select * from FS_FL_FrendList where id="&Request.QueryString("id"),Conn,1,3
  68. if obj_edit_Rs.eof then
  69. strShowErr = "<li>此记录不存在</li>"
  70. Response.Redirect("../error.asp?ErrCodes="&Server.URLEncode(strShowErr)&"&ErrorUrl=")
  71. Response.end
  72. else
  73. tmp_id=obj_edit_Rs("id")
  74. tmp_F_Name=obj_edit_Rs("F_Name")
  75. tmp_F_Type=obj_edit_Rs("F_Type")
  76. tmp_F_Url=obj_edit_Rs("F_Url")
  77. tmp_F_Content=obj_edit_Rs("F_Content")
  78. tmp_F_PicUrl=obj_edit_Rs("F_PicUrl")
  79. tmp_F_Lock=obj_edit_Rs("F_Lock")
  80. tmp_F_OrderID=obj_edit_Rs("F_OrderID")
  81. tmp_F_IsUser=obj_edit_Rs("F_IsUser")
  82. tmp_F_Author=obj_edit_Rs("F_Author")
  83. tmp_F_Mail=obj_edit_Rs("F_Mail")
  84. tmp_F_Content_des=obj_edit_Rs("F_Content_des")
  85. tmp_F_LinkContent=obj_edit_Rs("F_LinkContent")
  86. tmp_F_isAdmin=obj_edit_Rs("F_isAdmin")
  87. tmp_ClassID=obj_edit_Rs("ClassID")
  88. tmp_Addtime=obj_edit_Rs("Addtime")
  89. tmp_save="edit"
  90. end if
  91. elseif Request.QueryString("Action")="Add" then
  92. tmp_id=""
  93. tmp_F_Name=""
  94. tmp_F_Type=0
  95. tmp_F_Url="http://"
  96. tmp_F_Content=""
  97. tmp_F_PicUrl=""
  98. tmp_F_Lock=0
  99. tmp_F_OrderID=0
  100. tmp_F_IsUser=0
  101. tmp_F_Author=""
  102. tmp_F_Mail=""
  103. tmp_F_Content_des=""
  104. tmp_F_LinkContent=""
  105. tmp_F_isAdmin=1
  106. tmp_ClassID=""
  107. tmp_Addtime=now
  108. tmp_save="add"
  109. tmp_str = "readonly"
  110. else
  111. response.Write("错误的参数"):response.end
  112. end if
  113. %>
  114. <html>
  115. <HEAD>
  116. <TITLE>FoosunCMS</TITLE>
  117. <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=gb2312">
  118. </HEAD>
  119. <link href="../images/skin/Css_<%=Session("Admin_Style_Num")%>/<%=Session("Admin_Style_Num")%>.css" rel="stylesheet" type="text/css">
  120. <BODY>
  121. <script language="JavaScript" src="../../FS_Inc/PublicJS.js" type="text/JavaScript"></script>
  122. <script language="JavaScript" type="text/JavaScript">
  123. function opencat(cat)
  124. {
  125.   if(cat.style.display=="none"){
  126.      cat.style.display="";
  127.   } else {
  128.      cat.style.display="none"; 
  129.   }
  130. }
  131. </script>
  132. <table width="98%" border="0" align="center" cellpadding="4" cellspacing="1" class="table">
  133.   <tr> 
  134.     <td align="left" colspan="2" class="xingmu">友情连接管理</td>
  135.   </tr>
  136.   <tr> 
  137.     <td align="left" colspan="2" class="hback"><a href="Flink_Manage.asp">管理首页</a>┆<a href="Flink_Edit.asp?Action=Add">添加连接</a>┆<a href="Flink_Manage.asp?Type=0">图片连接</a>┆<a href="Flink_Manage.asp?Type=1">文字连接</a>┆<a href="Flink_Manage.asp?Lock=1">已锁定</a>┆<a href="Flink_Manage.asp?Lock=0">未锁定</a>┆用户申请的连接:<a href="Flink_Manage.asp?Lock=0&isUser=1">已审核</a>,<a href="Flink_Manage.asp?Lock=1&isUser=1">未审核</a>┆管理员添加的连接:<a href="Flink_Manage.asp?Lock=0&isAdmin=1">已审核</a>,<a href="Flink_Manage.asp?Lock=1&isAdmin=1">未审核</a></td>
  138.   </tr>
  139. </table>
  140. <table width="98%" border="0" align="center" cellpadding="5" cellspacing="1" class="table">
  141.   <form name="form1" method="post" action="">
  142.     <tr> 
  143.       <td class="hback"><div align="right">类别</div></td>
  144.       <td class="hback"> <select name="ClassID" id="ClassID">
  145.           <option value="">不选择栏目</option>
  146.           <%dim obj_list_rs
  147.   set obj_list_rs=conn.execute("select id,F_ClassCName from FS_FL_Class order by id desc")
  148.   do while not obj_list_rs.eof
  149.    if tmp_classid = obj_list_rs("id") then
  150. Response.Write "<option value="""& obj_list_rs("id") &""" selected>"& obj_list_rs("F_ClassCName") &"</option>"
  151. else
  152. Response.Write "<option value="""& obj_list_rs("id") &""">"& obj_list_rs("F_ClassCName") &"</option>"
  153. end if
  154.   obj_list_rs.movenext
  155.   loop
  156.   obj_list_rs.close:set obj_list_rs = nothing
  157.   %>
  158.         </select></td>
  159.     </tr>
  160.     <tr> 
  161.       <td width="27%" class="hback"><div align="right">站点名称</div></td>
  162.       <td width="73%" class="hback"><input name="F_Name" type="text" id="F_Name" value="<% = tmp_F_Name%>" size="40">
  163.         *</td>
  164.     </tr>
  165.     <tr> 
  166.       <td class="hback"><div align="right">连接类型</div></td>
  167.       <td class="hback"> <input type="radio" name="F_Type" value="1" <%if tmp_F_Type = 1 then response.Write("checked")%>>
  168.         文字连接 <input type="radio" name="F_Type" value="0" <%if tmp_F_Type = 0 then response.Write("checked")%>>
  169.         图片连接*</td>
  170.     </tr>
  171.     <tr> 
  172.       <td class="hback"><div align="right">连接地址</div></td>
  173.       <td class="hback"><input name="F_Url" type="text" id="F_Url" value="<% = tmp_F_Url%>" size="40">
  174.         *</td>
  175.     </tr>
  176.     <tr> 
  177.       <td class="hback"><div align="right">站点说明</div></td>
  178.       <td class="hback"><textarea name="F_Content" rows="5" id="F_Content" style="width:60%"><% = tmp_F_Content%></textarea>
  179.         最多300个字符*</td>
  180.     </tr>
  181.     <tr> 
  182.       <td class="hback"><div align="right">图片地址</div></td>
  183.       <td class="hback"><input name="F_PicUrl" type="text" id="F_PicUrl" size="42" value="<% = tmp_F_PicUrl%>"> 
  184.         <input type="button" name="PPPChoose"  value="选择图片" onClick="OpenWindowAndSetValue('../CommPages/SelectManageDir/SelectPic.asp?CurrPath=<%=str_CurrPath %>',500,300,window,document.form1.F_PicUrl);"></td>
  185.     </tr>
  186.     <tr>
  187.       <td class="hback"><div align="right">是否锁定</div></td>
  188.       <td class="hback"><input name="F_Lock" type="checkbox" id="F_Lock" value="1" <%if tmp_F_Lock = 1 then response.Write("checked")%>>
  189.         是</td>
  190.     </tr>
  191.     <tr> 
  192.       <td class="hback"><div align="right"></div></td>
  193.       <td class="hback" id=item$pval[CatID]) style="CURSOR: hand"  onmouseup="opencat(id_fl);"  language=javascript><a href="###">高级选项</a></td>
  194.     </tr>
  195.     <tr id="id_fl" style="display:none;">
  196.       <td colspan="2" class="hback"> <table width="100%" border="0" cellpadding="5" cellspacing="1" class="table" >
  197.           <tr> 
  198.             <td width="26%" class="hback"><div align="right">权重(排列使用)</div></td>
  199.             <td width="74%" class="hback"><input name="F_OrderID" type="text" id="F_OrderID" value="<% = tmp_F_OrderID%>"></td>
  200.           </tr>
  201.           <tr> 
  202.             <td class="hback"><div align="right">前台会员申请</div></td>
  203.             <td class="hback"><input name="F_IsUser" type="checkbox" id="F_IsUser" value="1" <%if tmp_F_IsUser= 1 then response.Write("checked")%>>
  204.               是</td>
  205.           </tr>
  206.           <tr> 
  207.             <td class="hback"><div align="right">申请人作者</div></td>
  208.             <td class="hback"><input name="F_Author" type="text" id="F_Author" value="<% = tmp_F_Author%>"></td>
  209.           </tr>
  210.           <tr> 
  211.             <td class="hback"><div align="right">申请人电子邮件</div></td>
  212.             <td class="hback"><input name="F_Mail" type="text" id="F_Mail" value="<% = tmp_F_Mail%>"></td>
  213.           </tr>
  214.           <tr> 
  215.             <td class="hback"><div align="right">申请理由</div></td>
  216.             <td class="hback"><textarea name="F_Content_des" rows="5" id="F_Content_des" style="width:60%"><% = tmp_F_Content_des%></textarea>
  217.               最多300个字符</td>
  218.           </tr>
  219.           <tr> 
  220.             <td class="hback"><div align="right">其他联系方式</div></td>
  221.             <td class="hback"><textarea name="F_LinkContent" rows="5" id="textarea2" style="width:60%"><% = tmp_F_LinkContent%></textarea>
  222.               最多300个字符</td>
  223.           </tr>
  224.           <tr> 
  225.             <td class="hback"><div align="right">申请日期</div></td>
  226.             <td class="hback"><input name="Addtime" type="text" id="Addtime" value="<% = tmp_Addtime%>"></td>
  227.           </tr>
  228.         </table></td>
  229.     </tr>
  230.     <tr> 
  231.       <td class="hback"><div align="right"></div></td>
  232.       <td class="hback"><input type="submit" name="Submit" value="保存信息"> <input type="reset" name="Submit2" value="重置"> 
  233.         <input name="id" type="hidden" id="id" value="<% = tmp_id %>"> <input name="edit_save" type="hidden" id="edit_save" value="<% = tmp_save %>"></td>
  234.     </tr>
  235.   </form>
  236. </table>
  237. </body>
  238. </html>