Group_manage.asp
资源名称:eat.rar [点击查看]
上传用户:jisenq
上传日期:2014-06-29
资源大小:7216k
文件大小:18k
源码类别:
数据库编程
开发平台:
ASP/ASPX
- <% Option Explicit %>
- <!--#include file="../../FS_Inc/Const.asp" -->
- <!--#include file="../../FS_InterFace/MF_Function.asp" -->
- <!--#include file="../../FS_Inc/Function.asp" -->
- <%
- 'on error resume next
- Dim Conn,User_Conn,ManageGroupRs,GType,GroupIndex,sRootDir
- MF_Default_Conn
- MF_User_Conn
- MF_Session_TF
- if not MF_Check_Pop_TF("ME_GUser") then Err_Show
- if G_VIRTUAL_ROOT_DIR<>"" then sRootDir="/"+G_VIRTUAL_ROOT_DIR else sRootDir=""
- Dim GroupName,UpfileNum,UpfileSize,GroupDate,GroupPoint,GroupMoney,GroupType,CorpTemplet,LimitInfoNum,GroupDebateNum,JuniorDomain,KeywordsNumber,Ishtml,BcardNumber,Templetwatermark
- if Request.QueryString("Act")="update" then
- if not MF_Check_Pop_TF("ME034") then Err_Show
- GType=NoSqlHack(Request.Form("GType"))
- GroupIndex=NoSqlHack(Request.Form("GroupIndex"))
- if GType="all" then
- User_Conn.execute("Update FS_ME_Group set GroupName='"&Request.Form("GroupName")&"',UpfileNum="&Request.Form("UpfileNum")&",UpfileSize="&Request.Form("UpfileSize")&",GroupDate="&Request.Form("GroupDate")&",GroupPoint="&Request.Form("GroupPoint")&",GroupMoney="&Request.Form("GroupMoney")&",GroupType="&Request.Form("GroupType")&",CorpTemplet='CorpTemplet',LimitInfoNum="&Request.Form("LimitInfoNum")&",GroupDebateNum='"&trim(Request.Form("GroupDebateNum_1"))&","&trim(Request.Form("GroupDebateNum_2"))&"',ProductDiscount="&trim(request.Form("ProductDiscount"))&",JuniorDomain=1,KeywordsNumber=0,isHtml="&Request.Form("isHtml")&",BcardNumber="&Request.Form("BcardNumber")&",Templetwatermark="&Request.Form("Templetwatermark"))
- elseif GroupIndex="user" then
- User_Conn.execute("Update FS_ME_Group set GroupName='"&Request.Form("GroupName")&"',UpfileNum="&Request.Form("UpfileNum")&",UpfileSize="&Request.Form("UpfileSize")&",GroupDate="&Request.Form("GroupDate")&",GroupPoint="&Request.Form("GroupPoint")&",GroupMoney="&Request.Form("GroupMoney")&",GroupType="&Request.Form("GroupType")&",CorpTemplet='CorpTemplet',LimitInfoNum="&Request.Form("LimitInfoNum")&",GroupDebateNum='"&trim(Request.Form("GroupDebateNum_1"))&","&trim(Request.Form("GroupDebateNum_2"))&"',ProductDiscount="&trim(request.Form("ProductDiscount"))&",JuniorDomain=1,KeywordsNumber=0,isHtml="&Request.Form("isHtml")&",BcardNumber="&Request.Form("BcardNumber")&",Templetwatermark="&Request.Form("Templetwatermark")&" where GroupType=1")
- elseif GroupIndex="corp" then
- User_Conn.execute("Update FS_ME_Group set GroupName='"&Request.Form("GroupName")&"',UpfileNum="&Request.Form("UpfileNum")&",UpfileSize="&Request.Form("UpfileSize")&",GroupDate="&Request.Form("GroupDate")&",GroupPoint="&Request.Form("GroupPoint")&",GroupMoney="&Request.Form("GroupMoney")&",GroupType="&Request.Form("GroupType")&",CorpTemplet='CorpTemplet',LimitInfoNum="&Request.Form("LimitInfoNum")&",GroupDebateNum='"&trim(Request.Form("GroupDebateNum_1"))&","&trim(Request.Form("GroupDebateNum_2"))&"',ProductDiscount="&trim(request.Form("ProductDiscount"))&",JuniorDomain=1,KeywordsNumber=0,isHtml="&Request.Form("isHtml")&",BcardNumber="&Request.Form("BcardNumber")&",Templetwatermark="&Request.Form("Templetwatermark")&" where GroupType=0")
- else
- User_Conn.execute("Update FS_ME_Group set GroupName='"&Request.Form("GroupName")&"',UpfileNum="&Request.Form("UpfileNum")&",UpfileSize="&Request.Form("UpfileSize")&",GroupDate="&Request.Form("GroupDate")&",GroupPoint="&Request.Form("GroupPoint")&",GroupMoney="&Request.Form("GroupMoney")&",GroupType="&Request.Form("GroupType")&",CorpTemplet='CorpTemplet',LimitInfoNum="&Request.Form("LimitInfoNum")&",GroupDebateNum='"&trim(Request.Form("GroupDebateNum_1"))&","&trim(Request.Form("GroupDebateNum_2"))&"',ProductDiscount="&trim(request.Form("ProductDiscount"))&",JuniorDomain=1,KeywordsNumber=0,isHtml="&Request.Form("isHtml")&",BcardNumber="&Request.Form("BcardNumber")&",Templetwatermark="&Request.Form("Templetwatermark")&" where GroupID="&GroupIndex)
- End if
- if err.number>0 then
- Response.Redirect("../error.asp?ErrCodes="&err.description&"&ErrorUrl="&Request.ServerVariables("HTTP_REFERER"))
- Response.End()
- else
- Response.Redirect("../success.asp?ErrCodes=<li>操作成功</li>&ErrorUrl="&Request.ServerVariables("HTTP_REFERER"))
- Response.End()
- end if
- elseif Request.QueryString("Act")="delete" then
- if not MF_Check_Pop_TF("ME036") then Err_Show
- if Request.QueryString("tf")="all" then
- User_Conn.execute("Delete from FS_ME_Group")
- elseif Request.QueryString("tf")="user" then
- User_Conn.execute("Delete from FS_ME_Group where GroupType=1")
- elseif Request.QueryString("tf")="corp" then
- User_Conn.execute("Delete from FS_ME_Group where GroupType=0")
- else
- User_Conn.execute("Delete from FS_ME_Group where GroupID="&NoSqlHack(Request.QueryString("tf")))
- end if
- if err.number>0 then
- Response.Redirect("../error.asp?ErrCodes="&err.description)
- Response.End()
- else
- Response.Redirect("../success.asp?ErrCodes=<li>删除成功</li>&ErrorUrl=./user/Group_Manage.asp")
- Response.End()
- end if
- end if
- %>
- <html xmlns="http://www.w3.org/1999/xhtml">
- <HEAD>
- <TITLE>FoosunCMS</TITLE>
- <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=gb2312">
- </HEAD>
- <script language="JavaScript" src="../../FS_Inc/PublicJS.js" type="text/JavaScript"></script>
- <script language="JavaScript" src="lib/UserJS.js" type="text/JavaScript"></script>
- <link href="../images/skin/Css_<%=Session("Admin_Style_Num")%>/<%=Session("Admin_Style_Num")%>.css" rel="stylesheet" type="text/css">
- <BODY LEFTMARGIN=0 TOPMARGIN=0 MARGINWIDTH=0 MARGINHEIGHT=0 scroll=yes >
- <table width="98%" border="0" align="center" cellpadding="3" cellspacing="1" class="table">
- <form action="?Act=update" method="post" name="ManageGroup" id="ManageGroup">
- <tr class="hback">
- <td align="right" class="xingmu" colspan="2"><div align="left">会员组管理</div></td></tr>
- <tr class="hback">
- <td width="183" align="right">会员组选择:</td>
- <td>会员组类型:
- <select name="GType" id="GType" onChange="getFormInfo(this)">
- <option value="all">所有会员组</option>
- <option value="1">个人会员组</option>
- <option value="0">企业会员组</option>
- </select>
-
- <span id="GroupIndexContent"></span></td>
- </tr>
- <tr class="hback">
- <td align="right">组名称:</td>
- <td width="791"> <input name="GroupName" type="text" id="GroupName" size="50" />
- <font color="#FF0000">*</font> <span class="style1" id="GroupName_Alert"></span></td>
- </tr>
- <tr class="hback">
- <td align="right">文件个数限制: </td>
- <td><input name="UpfileNum" type="text" id="UpfileNum" value="0" size="50" onChange="if(length(this.value)<=9){alert('文件大小限制最多只能输入9位整数');this.value='0';}" >
- <span id="UpfileNum_Alert"></span></td>
- </tr>
- <tr class="hback">
- <td align="right">文件大小限制:</td>
- <td><input name="UpfileSize" type="text" id="UpfileSize" value="0" size="50">
- k<span id="UpfileSize_Alert"> 会员空间占用</span></td>
- <tr class="hback">
- <td align="right">会员折扣:</td>
- <td><input name="ProductDiscount" type="text" id="ProductDiscount" value="0" size="50" onChange="if(length(this.value)<=9){alert('最多只能输入4个字符!');this.value='0';}">比如:打八折,该处则填写0.8 <span id="ProductDiscount_Alert"></span></td>
- </tr>
- <tr class="hback">
- <td align="right">组有效期限:</td>
- <td><input name="GroupDate" type="text" id="GroupDate" value="0" size="50" onChange="if(length(this.value)<=4){alert('组有效期限最多只能输入4位整数');this.value='0';}"/>
- 天 <span id="GroupDate_Alert"></span></td>
- </tr>
- <tr class="hback">
- <td align="right">积分:</td>
- <td><input name="GroupPoint" type="text" id="GroupPoint" value="0" size="50" onChange="if(this.value>32500){alert('积分不能大于32500');this.value='0';}"/>
- <span id="GroupPoint_Alert"></span></td>
- </tr>
- <tr class="hback">
- <td align="right">金币:</td>
- <td><input name="GroupMoney" type="text" id="GroupMoney" value="0" size="50" onChange="if(length(this.value)>4){alert('金币数不能大于9999');this.value='0';}"/>
- <span id="GroupMoney_Alert"></span></td>
- </tr>
- <tr class="hback">
- <td align="right">组类型:</td>
- <td><label>
- <input name="GroupType" type="radio" value="1">
- 个人会员组</label>
- <label>
- <input type="radio" name="GroupType" value="0" >
- 企业会员组</label> <span id="GroupType_Alert">(企业会员组暂时应用于以后扩展使用。您目前建立并不能使用)</span></td>
- </tr>
- <tr class="hback">
- <td align="right">信息发布数量上限:</td>
- <td><input name="LimitInfoNum" type="text" id="LimitInfoNum" value="10" size="50"/>
- <span id="LimitInfoNum_Alert"></span></td>
- </tr>
- <tr class="hback" style="display:none">
- <td align="right">会员模板地址:</td>
- <td><input name="CorpTemplet" type="text" size="50">
- <input name="Submit5" type="button" id="selNewsTemplet" value="选择模板" onClick="OpenWindowAndSetValue('../CommPages/SelectManageDir/SelectTemplet.asp?CurrPath=<%=sRootDir %>/<% = G_TEMPLETS_DIR %>',400,300,window,document.all.CorpTemplet);document.all.CorpTemplet.focus();">
- <span id="CorpTemplet_Alert"></span></td>
- </tr>
- <tr class="hback">
- <td align="right">社群参数:</td>
- <td>社群最大数量:
- <input name="GroupDebateNum_1" type="text" id="GroupDebateNum_1" value="0" size="15">
- 社群最大人数
- <input name="GroupDebateNum_2" type="text" id="GroupDebateNum_2" value="0" size="15" >
- <span id="GroupDebateNum1_Alert"></span> <span id="GroupDebateNum2_Alert"></span></td>
- </tr>
- <tr class="hback" style="display:none">
- <td align="right">开通二级域名:</td>
- <td><p>
- <label>
- <input type="radio" name="JuniorDomain" value="1" <%if JuniorDomain=1 then Response.Write("checked") end if%>>
- 是</label>
- <label>
- <input name="JuniorDomain" type="radio" value="0" checked <%if JuniorDomain=0 then Response.Write("checked") end if%>>
- 否</label>
- <br>
- </p></td>
- </tr>
- <tr class="hback" style="display:none">
- <td align="right">信息关键字个数:</td>
- <td><input name="KeywordsNumber" type="text" id="KeywordsNumber" value="0" size="50" onChange="if(length(this.value)>3){alert('信息关键字个数不能大于999');this.value='0';}"/>
- <span id="KeywordsNumber_Alert"></span></td>
- </tr>
- <tr class="hback" style="display:none">
- <td align="right">生成静态文件:</td>
- <td><label>
- <input type="radio" name="Ishtml" value="1"/>
- 是</label>
- <label>
- <input name="Ishtml" type="radio" value="0" checked >
- 否</label></td>
- </tr>
- <tr class="hback" style="display:none">
- <td align="right">名片收藏个数限制:</td>
- <td><input name="BcardNumber" type="text" id="BcardNumber" value="0" size="50" onChange="if(length(this.value)>4){alert('名片收藏个数不能大于9999');this.value='0';}"/>
- <span id="BcardNumber_Alert"></span></td>
- </tr>
- <tr class="hback" style="display:none">
- <td align="right">开通水印:</td>
- <td><label>
- <input type="radio" name="Templetwatermark" value="1" >
- 是</label>
- <label>
- <input name="Templetwatermark" type="radio" value="0" checked>
- 否</label></td>
- </tr>
- <tr class="hback">
- <td align="right"> </td>
- <td><input type="Button" name="ManageGroupButton" value=" 保存 " onClick="MySubmit()"/>
- <input type="reset" name="Submit2" value=" 重置 " />
- <input type="Button" name="DeleteGroup_Button" value=" 删 除 " onClick="AlertBeforeDelete()"></td>
- </tr>
- </form>
- </tr>
- </table>
- </body>
- <%
- Conn.close
- Set Conn=nothing
- User_Conn.close
- Set User_Conn=nothing
- %>
- <script language="JavaScript" type="text/JavaScript">
- <!--
- function MM_reloadPage(init) { //reloads the window if Nav4 resized
- if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
- document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
- else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
- }
- MM_reloadPage(true);
- //-->
- function MySubmit()
- {
- var flag1=isNumber('UpfileNum','UpfileNum_Alert','文件个数应为正整数',true)
- var flag2=isNumber('UpfileSize','UpfileSize_Alert','文件大小应为正整数',true)
- var flag3=isNumber('GroupDate','GroupDate_Alert','文件大小应为正整数',true)
- var flag4=isNumber('GroupMoney','GroupMoney_Alert','金币数量应为正整数',true)
- var flag5=isNumber('LimitInfoNum','LimitInfoNum_Alert','信息数量应为正整数',true)
- var flag6=isNumber('GroupDebateNum_1','GroupDebateNum1_Alert','社群数量应为正整数',true)
- var flag7=isNumber('GroupDebateNum_2','GroupDebateNum2_Alert','社群人数应为正整数',true)
- //var flag8=isNumber('KeywordsNumber','KeywordsNumber_Alert','关键字个数应为正整数',true)
- var flag9=isNumber('BcardNumber','BcardNumber_Alert','关键字个数应为正整数',true)
- var flag10=isEmpty('GroupName','GroupName_Alert','组名不能为空')
- //var flag11=isEmpty('CorpTemplet','CorpTemplet_Alert','模版地址不能为空')
- //var flag12=isNumber('ProductDiscount','ProductDiscount_Alert',false)
- if(document.ManageGroup.GroupType[0].checked|document.ManageGroup.GroupType[1].checked)
- {
- document.getElementById("GroupType_Alert").innerHTML=""
- if(flag1&&flag2&&flag3&&flag4&&flag5&&flag6&&flag7&&flag9&&flag10)
- {
- if(document.getElementById("GType").value=="all")
- {
- if(confirm("确定修改所有用户组?"))
- {
- document.ManageGroup.submit();
- }
- }else if(document.getElementById("GroupIndex").value=="user")
- {
- if(confirm("确定修改所有个人会员组?"))
- {
- document.ManageGroup.submit();
- }
- }
- else if(document.getElementById("GroupIndex").value=="corp")
- {
- if(confirm("确定修改所有企业会员组?"))
- {
- document.ManageGroup.submit();
- }
- }
- else
- document.ManageGroup.submit();
- }
- }else
- {
- document.getElementById("GroupType_Alert").innerHTML="<font color='F43631'>组类性质必须选择</font>";
- }
- }
- //Ajax
- var request=true;
- var result;
- var ParamArray;
- try
- {
- request=new XMLHttpRequest();
- }catch(trymicrosoft)
- {
- try
- {
- request=new ActiveXObject("Msxml2.XMLHTTP")
- }catch(othermicrosoft)
- {
- try
- {
- request=new ActiveXObject("Microsoft.XMLHTTP")
- }catch(filed)
- {
- request=false;
- }
- }
- }
- if(!request) alert("Error initializing XMLHttpRequest!");
- function getFormInfo(Obj)
- {
- var typeID=Obj.value;
- if(isNaN(typeID))
- {
- document.getElementById("GroupIndexContent").innerHTML="";
- return ;
- }
- var url="getUserGroup.asp?page=UserGroup&id="+typeID+"&r="+Math.random();//构造url
- request.open("GET",url,true);//建立连接
- request.onreadystatechange = getFormInfoResult;
- request.send(null);//传送数据,因为数据通过url传递了,所以这里传递的是null
- }
- function getFormInfoResult()//当服务器响应的时候就使用这个方法
- {
- if(request.readyState ==4)//根据HTTP 就绪状态判断响应是否完成
- {
- if(request.status == 200)//判断请求是否成功
- {
- result=request.responseText;//获得响应的结果,也就是新的<select>
- document.getElementById("GroupIndexContent").innerHTML="| 会员组:"+result;//将这个结果现实在客户端
- }
- }
- }
- function getGroupParam(Obj)
- {
- var GroupID=Obj.value;
- if(!isNaN(GroupID))
- {
- var url="getUserGroupParam.asp?id="+GroupID+"&r="+Math.random();//构造url
- request.open("GET",url,true);//建立连接
- request.onreadystatechange = getGroupParamResult;
- request.send(null);//传送数据,因为数据通过url传递了,所以这里传递的是null
- }
- }
- //ajax end
- function getGroupParamResult()//当服务器响应的时候就使用这个方法
- {
- if(request.readyState ==4)//根据HTTP 就绪状态判断响应是否完成
- {
- if(request.status == 200)//判断请求是否成功
- {
- result=request.responseText;//获得响应的结果,也就是新的<select>
- //获取原有设置
- ParamArray=result.split("|");
- document.getElementById("GroupName").value=ParamArray[0];
- document.getElementById("UpfileNum").value=ParamArray[1];
- document.getElementById("UpfileSize").value=ParamArray[2];
- document.getElementById("GroupDate").value=ParamArray[3];
- document.getElementById("GroupPoint").value=ParamArray[4];
- document.getElementById("GroupMoney").value=ParamArray[5];
- if(ParamArray[6]==1)
- {
- document.ManageGroup.GroupType[0].checked=true;
- }
- else
- {
- document.ManageGroup.GroupType[1].checked=true;
- }
- document.getElementById("LimitInfoNum").value=ParamArray[7];
- document.getElementById("CorpTemplet").value=ParamArray[8];
- if(ParamArray[9]!=null && ParamArray[9]!="")
- {
- var TempArray=ParamArray[9].split(",");
- document.getElementById("GroupDebateNum_1").value=TempArray[0]
- document.getElementById("GroupDebateNum_2").value=TempArray[1]
- }
- if(ParamArray[10]==1)
- {
- document.ManageGroup.JuniorDomain[0].checked=true;
- }
- else
- {
- document.ManageGroup.JuniorDomain[1].checked=true;
- }
- document.getElementById("KeywordsNumber").value=ParamArray[11];
- if(ParamArray[12]==1)
- {
- document.ManageGroup.Ishtml[0].checked=true;
- }
- else
- {
- document.ManageGroup.Ishtml[1].checked=true;
- }
- document.getElementById("BcardNumber").value=ParamArray[13];
- if(ParamArray[14]==1)
- {
- document.ManageGroup.Templetwatermark[0].checked=true;
- }
- else
- {
- document.ManageGroup.Templetwatermark[1].checked=true;
- }
- document.getElementById("ProductDiscount").value=ParamArray[15];
- }
- }
- }
- //end
- function AlertBeforeDelete()
- {
- if(document.getElementById("GType").value=="all")
- {
- if(confirm("确定要删除所有用户组!"))
- location='Group_manage.asp?act=delete&tf=all'
- }else if(document.getElementById("GType").value==1&&document.getElementById("GroupIndex").value=="user")
- {
- if(confirm("确定要删除所有个人用户组!"))
- location='Group_manage.asp?act=delete&tf=user'
- }else if(document.getElementById("GType").value==0&&document.getElementById("GroupIndex").value=="corp")
- {
- if(confirm("确定要删除所有企业用户组!"))
- location="Group_manage.asp?act=delete&tf=corp"
- }else
- {
- if(confirm("确定要删除该用户组!"))
- location='Group_manage.asp?act=delete&tf='+document.getElementById("GroupIndex").value
- }
- }
- </script>
- </html>