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

数据库编程

开发平台:

ASP/ASPX

  1. <% Option Explicit %>
  2. <!--#include file="../../FS_Inc/Const.asp" -->
  3. <!--#include file="../../FS_Inc/Function.asp"-->
  4. <!--#include file="../../FS_InterFace/MF_Function.asp" -->
  5. <!--#include file="../../FS_InterFace/NS_Function.asp" -->
  6. <!--#include file="lib/cls_main.asp" -->
  7. <% 'Copyright (c) 2006 Foosun Inc. Code by awen
  8. Dim Conn,User_Conn
  9. MF_Default_Conn
  10. MF_User_Conn
  11. 'session判断
  12. MF_Session_TF
  13. 'Call MF_Check_Pop_TF("NS_Class_000001")
  14. '得到会员组列表
  15. Dim Fs_news,NS_SpecialCNameValure,sRootDir,strShowErr ,obj_Special_Rs,str_newsDir,str_CurrPath
  16. set Fs_news = new Cls_News
  17. Fs_News.GetSysParam()
  18. MF_GetUserGroupID  
  19. if G_VIRTUAL_ROOT_DIR<>"" then sRootDir="/"+G_VIRTUAL_ROOT_DIR else sRootDir=""
  20. if Session("Admin_Is_Super") = 1 then
  21. str_CurrPath = sRootDir &"/"&G_UP_FILES_DIR
  22. Else
  23. str_CurrPath = Replace(sRootDir &"/"&G_UP_FILES_DIR&"/adminfiles/"&Session("Admin_Name"),"//","/")
  24. End if
  25. if Fs_news.newsDir<>"" then str_newsDir = "/"+Fs_news.newsDir else str_newsDir=""
  26. ''+++++++++++++++++++
  27. '变量定义
  28. Dim lng_SpecialID,str_Templet ,str_SpecialCName,str_SpecialEName,str_SpecialSize,str_SpecialContent,str_naviPic
  29. Dim str_SavePath,str_ExtName,bit_isLock,dtm_Addtime,int_sPoint,lng_GroupID,lng_AdminID
  30. ''+++++++++++++++++++
  31. if Request.QueryString("Action")="add" then
  32. if not Get_SubPop_TF("","NS026","NS","specail") then Err_Show
  33. str_SpecialCName = ""
  34. str_SpecialEName = ""
  35. str_SpecialSize = "150,120"
  36. str_SpecialContent = ""
  37. str_SavePath = Fs_news.GetSysParamDir & "special"
  38. str_Templet = Replace("/"&G_TEMPLETS_DIR&"/NewsClass/Special.htm","//","/")
  39. str_ExtName = "html"  ''专题扩展名
  40. bit_isLock = 0
  41. dtm_Addtime = now
  42. lng_GroupID = ""
  43. int_sPoint = ""
  44. Elseif Request.QueryString("Action")="edit" then
  45. lng_SpecialID = NoSqlHack(Trim(Request.QueryString("SpecialID")))
  46. if not Get_SubPop_TF(lng_SpecialID,"NS027","NS","specail") then  Err_Show
  47. if lng_SpecialID="" or not isnumeric(lng_SpecialID) then 
  48. strShowErr = "<li>必要的ID必须提供,并且是数字。</li>"
  49. Response.Redirect("lib/Error.asp?ErrCodes="&Server.URLEncode(strShowErr)&"&ErrorUrl=")
  50. Response.end
  51. end if
  52. Set obj_Special_Rs = server.CreateObject(G_FS_RS)
  53. obj_Special_Rs.open "select SpecialID,SpecialCName,SpecialEName,SpecialSize,SpecialContent,SavePath,Templet,ExtName,isLock,Addtime,naviPic,adminName From FS_NS_Special where SpecialID = "& lng_SpecialID ,Conn,1,3
  54. if  not obj_Special_Rs.eof then
  55. str_SpecialCName = obj_Special_Rs("SpecialCName")
  56. str_SpecialEName = obj_Special_Rs("SpecialEName")
  57. str_SpecialSize = obj_Special_Rs("SpecialSize")
  58. str_SpecialContent = obj_Special_Rs("SpecialContent")
  59. str_SavePath = obj_Special_Rs("SavePath")
  60. str_Templet = obj_Special_Rs("Templet")
  61. str_ExtName = obj_Special_Rs("ExtName")
  62. bit_isLock = obj_Special_Rs("isLock")
  63. dtm_Addtime = obj_Special_Rs("Addtime")
  64. str_naviPic=obj_Special_Rs("naviPic")
  65. lng_AdminID = obj_Special_Rs("adminName")
  66. obj_Special_Rs.close
  67. set  obj_Special_Rs = nothing
  68. Else
  69. strShowErr = "<li>错误的参数</li>"
  70. Response.Redirect("lib/Error.asp?ErrCodes="&Server.URLEncode(strShowErr)&"&ErrorUrl=")
  71. Response.end
  72. End if
  73. End if
  74. %>
  75. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
  76. <html>
  77. <head>
  78. <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
  79. <title>专题管理___Powered by foosun Inc.</title>
  80. <link href="../images/skin/Css_<%=Session("Admin_Style_Num")%>/<%=Session("Admin_Style_Num")%>.css" rel="stylesheet" type="text/css">
  81. <script language="JavaScript" src="js/Public.js"></script>
  82. </head>
  83.   <body>
  84. <form name="MainForm" method="post" action="Special_Save.asp">
  85.   <table width="98%" border="0" align="center" cellpadding="5" cellspacing="1" class="table">
  86.     <tr class="hback"> 
  87.       <td class="xingmu">栏目管理</td>
  88.     </tr>
  89.     <tr> 
  90.       <td height="18" class="hback"><a href="Special_Manage.asp">管理首页</a> | <a href="Special_Add.asp?Action=add">新增专题</a> 
  91.         | <a href="../../help?Lable=NS_Special_Add" target="_blank" style="cursor:help;"><img src="../Images/_help.gif" border="0"></a></td>
  92.     </tr>
  93.   </table>
  94.   <table width="98%" border="0" align="center" cellpadding="5" cellspacing="1" class="table">
  95.     <tr class="hback"> 
  96.       <td colspan="3" class="xingmu"><%if request.QueryString("Action")="edit" then response.Write("修改专题") else response.Write("添加专题") end if%></td>
  97.     </tr>
  98.     <tr> 
  99.       <td width="18%" class="hback"><div align="right">专题中文名称:</div></td>
  100.       <td width="82%" colspan="2" class="hback"><input name="SpecialCName" type="text" id="SpecialCName" size="35" maxlength="100" value="<% = str_SpecialCName%>"> 
  101.         <span class="tx"> *3-100个字符</span></td>
  102.     </tr>
  103.     <tr> 
  104.       <td width="18%" class="hback"><div align="right">专题英文名称:</div></td>
  105.       <td width="82%" class="hback"><input name="SpecialEName" type="text" id="SpecialEName" size="35" maxlength="50" value="<% =str_SpecialEName%>" <%if Request.QueryString("Action")="edit" then response.Write("Readonly")%> onKeyUp="value=value.replace(/[^a-zA-Z0-9_-]/g,'') " onbeforepaste="clipboardData.setData('text',clipboardData.getData('text').replace(/[^a-zA-Z0-9_-]/g,''))">   
  106.         <span class="tx"> *<br>
  107.         3-50个字符,必须是字母,数字,中划线,下划线,@,.,一旦确认,将不能修改</span></td>
  108.     </tr>
  109.     <tr> 
  110.       <td class="hback"><div align="right">专题高度和宽度:</div></td>
  111.       <td class="hback"><input name="SpecialSize" type="text" id="SpecialSize" size="35" maxlength="150" value="<% = str_SpecialSize %>" onKeyUp="value=value.replace(/[^0-9,0-9]/g,'') " onbeforepaste="clipboardData.setData('text',clipboardData.getData('text').replace(/[^0-9,0-9]/g,''))">
  112.         <span class="tx">*</span>格式:高度,宽度(150,120)</td>
  113.     </tr>
  114.     <tr>
  115.       <td class="hback"><div align="right">专题图片</div></td>
  116.       <td class="hback"><input name="naviPic" type="text" id="naviPic" value="<% = str_naviPic %>" size="35"  maxlength="255">
  117.         <img  src="../Images/upfile.gif" width="44" height="22" onClick="OpenWindowAndSetValue('../CommPages/SelectManageDir/SelectPic.asp?CurrPath=<% = str_CurrPath %>',500,320,window,document.MainForm.naviPic);" style="cursor:hand;"> </td>
  118.     </tr>
  119.     <tr> 
  120.       <td class="hback"><div align="right">专题导航说明:</div></td>
  121.       <td class="hback"><textarea name="SpecialContent" style="width:80%" rows="6" id="SpecialContent"><% = str_SpecialContent %></textarea>      </td>
  122.     </tr>
  123.     <tr>
  124.       <td class="hback"><div align="right">管理员:</div></td>
  125.       <td class="hback"><SELECT name="AdminName" id="AdminName">
  126.         <%
  127. Dim obj_AdminList_Rs
  128. set obj_AdminList_Rs = Conn.Execute("Select Admin_Name,Admin_Real_Name from FS_MF_Admin Where Admin_Parent_Admin='"&Session("Admin_Name")&"' or Admin_Name='"&Session("Admin_Name")&"' order by ID asc")
  129. If not obj_AdminList_Rs.eof Then
  130. if lng_AdminID = obj_AdminList_Rs("Admin_Name") then
  131. Response.Write "<OPTION value=""" & obj_AdminList_Rs("Admin_Name") & """ selected>管理员帐号:" & obj_AdminList_Rs("Admin_Name") & " 管理员姓名:" & obj_AdminList_Rs("Admin_Real_Name") & "</OPTION>"
  132. Else
  133. Response.Write "<OPTION value=""" & obj_AdminList_Rs("Admin_Name") & """>管理员帐号:" & obj_AdminList_Rs("Admin_Name") & " 管理员姓名:" & obj_AdminList_Rs("Admin_Real_Name") & "</OPTION>"
  134. End if
  135. obj_AdminList_Rs.MoveNext
  136. End If
  137. Do while not obj_AdminList_Rs.eof
  138. if lng_AdminID = obj_AdminList_Rs("Admin_Name") then
  139. Response.Write "<OPTION value=""" & obj_AdminList_Rs("Admin_Name") & """ selected>管理员帐号:" & obj_AdminList_Rs("Admin_Name") & " 管理员姓名:" & obj_AdminList_Rs("Admin_Real_Name") & "</OPTION>"
  140. Else
  141. Response.Write "<OPTION value=""" & obj_AdminList_Rs("Admin_Name") & """>管理员帐号:" & obj_AdminList_Rs("Admin_Name") & " 管理员姓名:" & obj_AdminList_Rs("Admin_Real_Name") & "</OPTION>"
  142. End if
  143. obj_AdminList_Rs.Movenext
  144. Loop
  145. obj_AdminList_Rs.Close
  146. Set obj_AdminList_Rs = Nothing
  147. %>
  148.       </SELECT></td>
  149.     </tr>
  150.     <tr> 
  151.       <td class="hback"><div align="right">专题保存路径:</div></td>
  152.       <td class="hback"><input name="SavePath" type="text" id="SavePath"  value="<%=str_SavePath%>" readonly>
  153.         <INPUT type="button"  name="Submit4" value="选择路径" onClick="OpenWindowAndSetValue('../CommPages/SelectManageDir/SelectPathFrame.asp?CurrPath=<%=sRootDir & str_newsDir%>',300,250,window,document.MainForm.SavePath);document.MainForm.SavePath.focus();"> 
  154.         <span class="tx"> *</span></td>
  155.     </tr>
  156.     <tr> 
  157.       <td class="hback"><div align="right">专题模板地址:</div></td>
  158.       <td class="hback"><input name="Templet" type="text" id="Templet" value="<% = str_Templet %>" size="50" maxlength="250" readonly> 
  159.         <input type="button" name="Submit" value="选择模板" onClick="OpenWindowAndSetValue('../Commpages/SelectManageDir/SelectTemplet.asp?CurrPath=<%=sRootDir %>/<% = G_TEMPLETS_DIR %>',400,300,window,document.MainForm.Templet);document.MainForm.Templet.focus();"> 
  160.         <span class="tx"> *250个字符</span></td>
  161.     </tr>
  162.     <tr> 
  163.       <td class="hback"><div align="right">专题扩展名:</div></td>
  164.       <td class="hback">
  165.     <select name="ExtName" id="ExtName">
  166.           <option value="html" <% if  Trim(str_ExtName) = "html"  then response.Write("selected")%>>.html</option>
  167.           <option value="htm" <% if  Trim(str_ExtName) = "htm"  then response.Write("selected")%>>.htm</option>
  168.           <option value="shtml" <% if  Trim(str_ExtName) = "shtml"  then response.Write("selected")%>>.shtml</option>
  169.           <option value="shtm" <% if  Trim(str_ExtName)= "shtm"  then response.Write("selected")%>>.shtm</option>
  170.           <option value="asp" <% if  Trim(str_ExtName) = "asp"  then response.Write("selected")%>>.asp</option>
  171.         </select> <span class="tx"> *如果需要阅读权限,必须设置为.asp</span></td>
  172.     </tr>
  173.     <tr> 
  174.       <td height="22" class="hback"><div align="right">是否锁定:</div></td>
  175.       <td height="22" class="hback"><input name="isLock" type="checkbox" id="isLock" value="1" <% if bit_isLock = 1 then response.Write("checked") %>></td>
  176.     </tr>
  177.     <tr> 
  178.       <td width="18%" height="21" class="hback"><div align="right">添加日期:</div></td>
  179.       <td width="82%" height="21" class="hback"><input  name="Addtime" type="text" id="Addtime" value="<% = dtm_Addtime %>" readonly>
  180.       <input name="SelectDate" type="button" id="SelectDate" value="选择时间" onClick="OpenWindowAndSetValue('../CommPages/SelectDate.asp',300,130,window,document.all.Addtime);" ></td>
  181.     </tr>
  182.     <tr id="InUrl6" style="display:none"> 
  183.       <td class="hback"><div align="right">浏览会员组:</div></td>
  184.       <td class="hback"> <input name="BrowPop"  id="BrowPop" type="text" value="<% = lng_GroupID %>" onMouseOver="this.title=this.value;" readonly> 
  185.         <select name="selectPop" id="selectPop" style="overflow:hidden;" onChange="ChooseExeName();">
  186.           <option value="" selected>选择会员组</option>
  187.           <option value="del" style="color:red;">清空</option>
  188.           <% = MF_GetUserGroupID %>
  189.         </select>
  190.         需要点数 
  191.         <input name="sPoint" type="text" id="sPoint" size="8" maxlength="5" value="<% = int_sPoint %>"  onChange="ChooseExeName();"  onKeyUp="if(isNaN(value)||event.keyCode==32)execCommand('undo')"  onafterpaste="if(isNaN(value)||event.keyCode==32)execCommand('undo')">
  192.        <span class="tx"> 大于0</span> </td>
  193.     </tr>
  194.       <td height="21" class="hback"></td>
  195.       <td height="21" class="hback"><input type="button" name="Submit4222" value="保存专题" onClick="{if(confirm('确认保存您的专题信息吗?')){this.document.MainForm.submit();return true;}return false;}"> 
  196.         <input type="reset" name="Submit5222" value="重置">
  197. <input name="SpecialID" type="hidden" id="SpecialID" value="<% = Request.QueryString("SpecialID")%>">
  198.         <input name="Action" type="hidden" id="Action" value="<% = Request.QueryString("Action")%>"></td>
  199.     </tr>
  200. </table>
  201. </form>
  202. </body>
  203. </html>
  204. <%
  205. set Fs_news = nothing
  206. %>
  207. <SCRIPT language="JavaScript">
  208. var DocumentReadyTF=false;
  209. function document.onreadystatechange()
  210. {
  211. ChooseExeName();
  212. }
  213. function ChooseExeName()
  214. {
  215.   var ObjValue = document.MainForm.selectPop.options[document.MainForm.selectPop.selectedIndex].value;
  216.   if (ObjValue!='')
  217.   {
  218. if (document.MainForm.BrowPop.value=='')
  219. document.MainForm.BrowPop.value = ObjValue;
  220. else if(document.MainForm.BrowPop.value.indexOf(ObjValue)==-1)
  221. document.MainForm.BrowPop.value = document.MainForm.BrowPop.value+","+ObjValue;
  222. if (ObjValue=='del')
  223.    document.MainForm.BrowPop.value ='';
  224.   }
  225.   CheckNumber(document.MainForm.sPoint,"浏览扣点值");
  226.   if (document.MainForm.sPoint.value>32767||document.MainForm.sPoint.value<-32768)  //||document.MainForm.sPoint.value=='0'
  227. {
  228. alert('浏览扣点值超过允许范围!n最大32767,且不能为0');
  229. document.MainForm.sPoint.value='';
  230. document.MainForm.sPoint.focus();
  231. }
  232.    if (document.MainForm.BrowPop.value!='' || (document.MainForm.sPoint.value!='0' && document.MainForm.sPoint.value!='') ){document.MainForm.ExtName.options[4].selected=true;document.MainForm.ExtName.readonly=true;}
  233.   else {document.MainForm.ExtName.readonly=false;}
  234. }
  235. function CheckExtName(Obj)
  236. {
  237. if (Obj.value!='')
  238. {
  239. for (var i=0;i<document.all.ExtName.length;i++)
  240. {
  241. if (document.all.ExtName.options(i).value=='asp') document.all.ExtName.options(i).selected=true;
  242. }
  243. document.all.ExtName.readonly=true;
  244. }
  245. else
  246. {
  247. document.all.ExtName.readonly=false;
  248. }
  249. }
  250. </SCRIPT>
  251. <!-- Powered by: FoosunCMS4.0系列,Company:Foosun Inc. -->