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

数据库编程

开发平台:

ASP/ASPX

  1. <% Option Explicit %>
  2. <!--#include file="../../FS_Inc/Const.asp" -->
  3. <!--#include file="../../FS_InterFace/MF_Function.asp" -->
  4. <!--#include file="../../FS_Inc/Function.asp" -->
  5. <%
  6. 'on error resume next
  7. Dim Conn,User_Conn,AddGroupRs,if_repage_RS
  8. Dim GroupName,AllowUpFile,UpfileNum,UpfileSize,GroupDate,GroupPoint,GroupMoney,GroupType,CorpTemplet,LimitInfoNum,GroupDebateNum,GroupDebateNum_Array,JuniorDomain,KeywordsNumber,Ishtml,BcardNumber,Templetwatermark
  9. dim sRootDir,str_CurrPath
  10. if G_VIRTUAL_ROOT_DIR<>"" then sRootDir="/"+G_VIRTUAL_ROOT_DIR else sRootDir=""
  11. '************************************Update
  12. if Request.QueryString("Act")="addGroup" then
  13. MF_Default_Conn
  14. MF_User_Conn
  15. MF_Session_TF
  16. if not MF_Check_Pop_TF("ME_GUser") then Err_Show 
  17. if not MF_Check_Pop_TF("ME034") then Err_Show 
  18. Set AddGroupRs=server.CreateObject(G_FS_RS)
  19. AddGroupRs.open "select GroupName,UpfileNum,UpfileSize,GroupDate,GroupPoint,GroupMoney,GroupType,CorpTemplet,LimitInfoNum,GroupDebateNum,JuniorDomain,KeywordsNumber,ProductDiscount,isHtml,BcardNumber,Templetwatermark From FS_ME_Group",User_Conn,1,3
  20. AddGroupRs.addNew
  21. AddGroupRs("GroupName")=Request.Form("GroupName")
  22. AddGroupRs("UpfileNum")=Request.Form("UpfileNum")
  23. if Request.Form("UpfileSize")<1024 then
  24. Response.Redirect("../error.asp?ErrCodes=<li>用户上传所站的空间必须为大于1M</li>")
  25. Response.End()
  26. else
  27. AddGroupRs("UpfileSize")=Request.Form("UpfileSize")
  28. end if
  29. AddGroupRs("GroupDate")=Request.Form("GroupDate")
  30. AddGroupRs("GroupPoint")=Request.Form("GroupPoint")
  31. AddGroupRs("GroupMoney")=Request.Form("GroupMoney")
  32. AddGroupRs("GroupType")=Request.Form("GroupType")
  33. AddGroupRs("ProductDiscount")=Request.Form("ProductDiscount")
  34. 'AddGroupRs("CorpTemplet")=Request.Form("CorpTemplet")
  35. AddGroupRs("LimitInfoNum")=Request.Form("LimitInfoNum")
  36. AddGroupRs("GroupDebateNum")=trim(Request.Form("GroupDebateNum_1"))&","&trim(Request.Form("GroupDebateNum_2"))
  37. AddGroupRs("JuniorDomain")=Request.Form("JuniorDomain")
  38. 'AddGroupRs("KeywordsNumber")=Request.Form("KeywordsNumber")
  39. 'AddGroupRs("isHtml")=Request.Form("isHtml")
  40. 'AddGroupRs("BcardNumber")=Request.Form("BcardNumber")
  41. 'AddGroupRs("Templetwatermark")=Request.Form("Templetwatermark")
  42. Set if_repage_RS=User_Conn.execute("Select GroupName from FS_ME_Group where GroupName='"&trim(Request.Form("GroupName"))&"'")
  43. if not if_repage_RS.eof then
  44. Response.Redirect("../error.asp?ErrCodes=<li>组名不能重复</li>")
  45. Response.End()
  46. End if
  47. AddGroupRs.update
  48. if err.number=0 then 
  49. Response.Redirect("../success.asp?ErrCodes=<li>操作成功</li>&ErrorURL="&request.ServerVariables("HTTP_REFERER"))
  50. Response.End()
  51. else
  52. Response.Redirect("../error.asp?ErrCodes=<li>"&err.description&"</li>&ErrorURL="&request.ServerVariables("HTTP_REFERER"))
  53. Response.End()
  54. end if
  55. end if
  56. %>
  57. <html xmlns="http://www.w3.org/1999/xhtml">
  58. <HEAD>
  59. <TITLE>FoosunCMS</TITLE>
  60. <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=gb2312">
  61. </HEAD>
  62. <script language="JavaScript" src="../../FS_Inc/PublicJS.js" type="text/JavaScript"></script>
  63. <script language="JavaScript" src="lib/UserJS.js" type="text/JavaScript"></script>
  64. <link href="../images/skin/Css_<%=Session("Admin_Style_Num")%>/<%=Session("Admin_Style_Num")%>.css" rel="stylesheet" type="text/css">
  65. <BODY LEFTMARGIN=0 TOPMARGIN=0 MARGINWIDTH=0 MARGINHEIGHT=0 scroll=yes> 
  66. <table width="98%" border="0" align="center" cellpadding="3" cellspacing="1" class="table"> 
  67.   <tr class="hback"> 
  68.     <td align="right" class="xingmu" colspan="2"><div align="left">添加用户组</div></td></tr> 
  69.     <form action="?Act=addGroup" method="post" name="AddGroup" id="AddGroup">  
  70.         <tr class="hback"> 
  71.           <td width="180" align="right"><div align="right">组名称:</div></td> 
  72.           <td width="764"> <input name="GroupName" type="text" id="GroupName" size="50" />
  73.           <font color="#FF0000">*</font><span id="GroupName_Alert"></span></td> 
  74.         </tr> 
  75.       
  76. <tr class="hback">
  77.     <td align="right">文件个数限制: </td>
  78.     <td><input name="UpfileNum" type="text" id="UpfileNum"  value="0" size="50"></td>
  79.   </tr>
  80. <tr class="hback">
  81.     <td align="right">文件大小限制:</td>
  82.     <td><input name="UpfileSize" type="text" id="UpfileSize" value="2048" size="50">
  83.     <span id="UpfileSize_Alert">k<span id="UpfileNum_Alert"> 会员空间占用</span></span></td>
  84.   </tr>
  85.   <tr class="hback">
  86.   <td align="right">会员折扣:</td>
  87.   <td><input name="ProductDiscount" type="text" id="ProductDiscount" value="1" size="50">
  88.   比如:打八折,该处则填写0.8 <span id="ProductDiscount_Alert"></span></td>
  89.   </tr>
  90. <tr class="hback"> 
  91.                 <td align="right">组有效期限:</td> 
  92.                 <td><input name="GroupDate" type="text" id="GroupDate"  value="0" size="50"/> 
  93.                 天 <span id="GroupDate_Alert"></span></td> 
  94.         </tr> 
  95.       <tr class="hback"> 
  96.           <td align="right">该组所需积分:</td> 
  97.           <td><input name="GroupPoint" type="text" id="GroupPoint" value="0" size="50"/>
  98.           <span id="GroupPoint_Alert"></span></td> 
  99.         </tr>
  100.         <tr class="hback">
  101.           <td align="right">该组所需金币:</td>
  102.           <td><input name="GroupMoney" type="text" id="GroupMoney" value="0" size="50"/>
  103.           <span id="GroupMoney_Alert"></span></td>
  104.         </tr> 
  105.       <tr class="hback"> 
  106.           <td align="right">组类型:</td> 
  107.           <td><label>
  108.             <input name="GroupType" type="radio" value="1" checked > 
  109.             个人会员组</label>
  110.             <label>
  111.             <input type="radio" name="GroupType" value="0">
  112. 企业会员组(企业会员组暂时应用于以后扩展使用。您目前建立并不能使用)</label></td> 
  113.         </tr> 
  114.       <tr class="hback"> 
  115.           <td align="right">信息发布数量上限:</td> 
  116.           <td><input name="LimitInfoNum" type="text" id="LimitInfoNum" value="10" size="50"/>
  117.           <span id="LimitInfoNum_Alert"></span></td> 
  118.         </tr>
  119.         <tr class="hback" style="display:none">
  120.           
  121.       <td align="right">会员模板地址:</td>
  122.           <td><input name="CorpTemplet" type="text" size="50">
  123.   <input name="Submit5" type="button" id="selCorpTemplet" value="选择模板"  onClick="OpenWindowAndSetValue('../CommPages/SelectManageDir/SelectTemplet.asp?CurrPath=<%=sRootDir %>/<% = G_TEMPLETS_DIR %>',400,300,window,document.AddGroup.CorpTemplet);document.AddGroup.CorpTemplet.focus();"> 
  124.   <span id="CorpTemplet_Alert"></span></td>
  125.         </tr>
  126.         <tr class="hback">
  127.           <td align="right">社群参数:</td>
  128.           <td>社群最大数量:
  129.             <input name="GroupDebateNum_1" type="text" id="GroupDebateNum_1" value="0" size="15"> 
  130.           &nbsp;社群最大人数
  131.           <input name="GroupDebateNum_2" type="text" id="GroupDebateNum_2" value="0" size="15">
  132.           <span id="GroupDebateNum_Alert1"></span>&nbsp; <span id="GroupDebateNum_Alert2"></span></td>
  133.         </tr>
  134.         <tr class="hback" style="display:none">
  135.           <td align="right">开通二级域名:</td>
  136.           <td><p>
  137.             <label>
  138.             <input type="radio" name="JuniorDomain" value="1" >
  139.   是</label>
  140.             <label>
  141.             <input name="JuniorDomain" type="radio" value="0" checked>
  142.   否</label>
  143.             <br>
  144.           </p></td>
  145.         </tr>
  146.         <tr class="hback" style="display:none">
  147.           <td align="right">信息关键字个数:</td>
  148.           <td><input name="KeywordsNumber" type="text" id="KeywordsNumber"  value="0" size="50"/>
  149.           <span id="KeywordsNumber_Alert"></span></td>
  150.         </tr>
  151.         <tr class="hback" style="display:none">
  152.           <td align="right">生成静态文件:</td>
  153.           <td><label>
  154.             <input type="radio" name="Ishtml" value="1" >
  155. 是</label>
  156.             <label>
  157.             <input name="Ishtml" type="radio" value="0" checked >
  158. 否</label></td>
  159.         </tr>
  160.         <tr class="hback" style="display:none">
  161.           <td align="right">名片收藏个数限制:</td>
  162.           <td><input name="BcardNumber" type="text" id="BcardNumber" value="0" size="50"/>
  163.           <span id="BcardNumber_Alert"></span></td>
  164.         </tr>
  165.         <tr class="hback" style="display:none">
  166.           <td align="right">开通水印:</td>
  167.           <td><label>
  168.             <input type="radio" name="Templetwatermark" value="1" >
  169. 是</label>
  170.             <label>
  171.             <input name="Templetwatermark" type="radio" value="0" checked >
  172. 否</label></td>
  173.         </tr> 
  174.       <tr class="hback"> 
  175.           <td align="right">&nbsp;</td> 
  176.           <td><input type="Button" name="AddGroupButton" value=" 保存 " onClick="AddGroupSubmit()"/> 
  177.             <input type="reset" name="Submit2" value=" 重置 " /></td> 
  178.         </tr> 
  179.     </form> 
  180.   </tr> 
  181. </table> 
  182. </body>
  183. <%
  184. if Request.QueryString("Act")="addGroup" then
  185. AddGroupRs.close
  186. set AddGroupRs=nothing
  187. if_repage_RS.close
  188. Set if_repage_RS=nothing
  189. Conn.close
  190. Set Conn=nothing
  191. User_Conn.close
  192. Set User_Conn=nothing
  193. end if
  194. %>
  195. <script language="JavaScript" type="text/JavaScript">
  196. <!--
  197. function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  198.   if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
  199.     document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  200.   else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
  201. }
  202. MM_reloadPage(true);
  203. //-->
  204. function AddGroupSubmit()
  205. {
  206. var flag1=isEmpty('GroupName','GroupName_Alert')
  207. var flag2=isNumber('UpfileNum','UpfileNum_Alert','文件个数应为正整数',true)
  208. var flag3=isNumber('UpfileSize','UpfileSize_Alert','文件大小应为正整数',true)
  209. var flag4=isNumber('GroupDate','GroupDate_Alert','有效期限应为正整数',true)
  210. var flag5=isNumber('GroupPoint','GroupPoint_Alert','积分应为正整数',true)
  211. var flag6=isNumber('GroupMoney','GroupMoney_Alert','金币应为正整数',true)
  212. var flag7=isNumber('LimitInfoNum','CorpTemplet_Alert','金币应为正整数',true)
  213. var flag8=isNumber('GroupDebateNum_1','GroupDebateNum_Alert1','社群最大数量应为正整数',true)
  214. var flag9=isNumber('GroupDebateNum_2','GroupDebateNum_Alert2','社群最大人数应为正整数',true)
  215. //var flag10=isNumber('KeywordsNumber','KeywordsNumber_Alert','关键字个数应为正整数',true)
  216. //var flag11=isNumber('BcardNumber','BcardNumber_Alert','名片收藏个数应为正整数',true)
  217. //var flag12=isEmpty('CorpTemplet','CorpTemplet_Alert')
  218. //var flag13=isNumber('ProductDiscount','ProductDiscount_Alert',false)
  219. if(flag1&&flag2&&flag3&&flag4&&flag5&&flag6&&flag7&&flag8&&flag9)
  220. document.AddGroup.submit();
  221. }
  222. </script>
  223. </html>