⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 wm.coupon.asp

📁 网人分类信息5.0商业版。非常优秀的分类信息系统。比较少见。
💻 ASP
📖 第 1 页 / 共 3 页
字号:
<!--#include file="WM.Sys_Cook.asp"-->
<%
Select Case WRMPS.CheckStr(Request("Action"), 0)
  Case "AddSave","Add"
    If CheckAdminFlag("CouPost") = False Then Call WRMPS.ErrView("·您没有权限进行此操作",0)
  Case Else
    If CheckAdminFlag("Cou") = False Then Call WRMPS.ErrView("·您没有权限进行此操作",0)
End Select

ChannelID = 7
Call WM_Content
Sub WM_Content()
  Dim i,ID,Key,rFlag,Path,PathList,n,Table,Word,Title,Intro,AgioType,Agio,WM_Begin,WM_End,Address,TEL,ClassDir
  Dim AreaIDName,ClassName,Path_List,SPath_List
  Dim WM_aZTop,WM_aTop,WM_aTitColor,WM_aBgColor,WM_aBold,WM_aProp,WM_aTColor,WM_aBColor
  Dim aKey,aCommend,aZTop,aTop,aTColor,aBColor,aTitColor,aBgColor,aBold,aProp1,aProp2,WM_Commend,WM_Key,Tags,Items,Circumscribe
  
  Key = WRMPS.CheckStr(Request("Key"), 1)
  If Key = "" Then Key = 1
  Table = WRMPS.CheckStr(Request("Table"), 0)
  Word = WRMPS.CheckStr(Request("Word"), 0)
  Page = WRMPS.CheckStr(Request("Page"), 1)
  ID = WRMPS.CheckStr(Request("ID"), 0)
  Call DBConnBegin()
  Set Rs=server.createobject("adodb.recordset")
  Select Case WRMPS.CheckStr(Request("Action"), 0)
    Case "Save"
	  ID = WRMPS.GetReplace(ID,"&nbsp;","")
      If ID <> "" Then
	    ID = Split(ID,",")
        Call WRMPS.FsoBegin()
		For i = 0 To Ubound(ID)
		  Select Case Request("Work")
		    Case "Key"
             Set Rs = Conn.Execute("Select WM_Key,WM_User,WM_Title,WM_ComID From WM_Coupon Where WM_ID = "&Int(ID(i)))
			 If Not Rs.Eof Then
			   If Rs(0) < 1 Then
			     rFlag = WRDB.GetUserFlag(Rs(1))
				 Call WRDB.SaveConsume(0,Rs(1),0,Int(Split(Split(rFlag,"§")(1),"|")(21)),Int(Split(Split(rFlag,"§")(1),"|")(20)),0,"优惠券“"&Rs(2)&"”通过审核")
	             If Rs(3) > 0 Then Conn.Execute("Update WM_Company Set WM_CouponNum=WM_CouponNum+1 Where WM_ID="&Rs(3))
	             Conn.Execute("Update WM_Config Set WM_CouponNum = WM_CouponNum + 1")
	             Conn.Execute("Update WM_Member Set WM_CouponNum = WM_CouponNum + 1 Where WM_UserName = '"&Rs(1)&"'")
	             Call WRMPS.SCache("CouponNum",WRMPS.GetCache("CouponNum") + 1)
			   End If
			 End If
			 Rs.Close
		     Conn.Execute("Update WM_Coupon Set WM_Key=1 Where WM_ID="&Int(ID(i)))

		    Case "Comm"
		      Conn.Execute("Update WM_Coupon Set WM_Commend=1 Where WM_ID="&Int(ID(i)))

		    Case "NoComm"
		      Conn.Execute("Update WM_Coupon Set WM_Commend=0 Where WM_ID="&Int(ID(i)))
			  
		    Case "Lock"
		      Conn.Execute("Update WM_Coupon Set WM_Key=2 Where WM_ID="&Int(ID(i)))
			
		    Case "NoLock"
		      Conn.Execute("Update WM_Coupon Set WM_Key=1 Where WM_ID="&Int(ID(i)))

		    Case "Del"
              Set Rs = Conn.Execute("Select WM_Key,WM_ComID,WM_Path,WM_PathList,WM_User From WM_Coupon Where WM_ID = "&Int(ID(i)))
			  If Not Rs.Eof Then
			     Path = WRMPS.CheckStr(Rs(2),5)
				 PathList = Rs(3)
				 PathList = WRMPS.CheckStr(PathList,5)
			     If Rs(0) > 0 Then
	               If Rs(1) > 0 Then Conn.Execute("Update WM_Company Set WM_CouponNum=WM_CouponNum-1 Where WM_ID="&Rs(1)&" and WM_CouponNum > 0")
				   Conn.Execute("Update WM_Config Set WM_CouponNum = WM_CouponNum - 1 where WM_CouponNum > 0")
	               Conn.Execute("Update WM_Member Set WM_CouponNum = WM_CouponNum - 1 Where WM_UserName = '"&Rs(4)&"' and WM_CouponNum > 0")
	               Call WRMPS.SCache("CouponNum",WRMPS.GetCache("CouponNum") - 1)
				 End If
			  End If
			  Rs.Close
              Conn.Execute("Delete From WM_Coupon where WM_ID="&Int(ID(i)))
			  WRMPS.FsoDel "File",Path
              If PathList <> "" Then
			    For n=0 To Ubound(Split(PathList,"|"))
				  If Split(PathList,"|")(n) <> "" Then
		            SPath_List = Split(PathList,"|")(n)
				    SPath_List = WRMPS.GetReplace(SPath_List,Split(SPath_List,"/")(UBound(Split(SPath_List,"/"))),"S/"&Split(SPath_List,"/")(UBound(Split(SPath_List,"/"))))
				    WRMPS.FsoDel "File",Split(PathList,"|")(n)
				  End If
				Next
			  End If
		  End Select
		Next
	    Call WRMPS.FsoEnd()
	  End If
	  Call WRMPS.ErrView("·操作成功<meta http-equiv=refresh content='1;URL=?Page=" & Page & "&Table=" & Table & "&Word=" & Word&"&Key=" & Key & "'>",1)

    Case "AddSave"
      ClassID = WRMPS.CheckStr(Request.form("ClassID"),1)
      AreaID = WRMPS.CheckStr(Request.form("AreaID"),1)
      If ClassID ="" Then Call WRMPS.ErrView("·请选择优惠券所属分类",0)
      If AreaID ="" Then Call WRMPS.ErrView("·请选择优惠券所属地区",0)
      Title = WRMPS.CheckStr(Request.form("Title"),0)
	  If Title = "" Then Call WRMPS.ErrView("·优惠券名称不能为空",0)
      Intro = WRMPS.CheckStr(Request.form("Content"),0)
	  If Intro = "" Then Intro = NULL
	  AgioType = WRMPS.CheckStr(Request.form("AgioType"),1)
	  Select Case AgioType
	    Case 0
	      Agio = WRMPS.CheckStr(Request.form("Agio1"),1)
	      If Agio = "" Then Call WRMPS.ErrView("·折扣额不能为空",0)
	    Case 1
	      Agio = WRMPS.CheckStr(Request.form("Agio2"),1)
		  If Agio = "" Then Call WRMPS.ErrView("·抵价金额不能为空",0)
	    Case 2
	      Agio = WRMPS.CheckStr(Request.form("Agio3"),0)
	      If Agio = "" Then Call WRMPS.ErrView("·礼品名称不能为空",0)
	  End Select
	  Items = WRMPS.CheckStr(Request.form("Item"),0)
	  If Items = "" Then Items = Null
	  Circumscribe = WRMPS.CheckStr(Request.form("Circumscribe"),0)
	  If Circumscribe = "" Then Circumscribe = Null
      WM_Begin = WRMPS.CheckStr(Request.form("Begin"),0)
	  If WM_Begin = "" Then Call WRMPS.ErrView("·开始时间不能为空",0)
      WM_End = WRMPS.CheckStr(Request.form("End"),0)
	  If WM_End = "" Then Call WRMPS.ErrView("·结束时间不能为空",0)
      TEL = WRMPS.CheckStr(Request.form("TEL"),0)
	  If TEL = "" Then TEL = Null
      Address = WRMPS.CheckStr(Request.form("Address"),0)
	  If Address = "" Then Address = Null
	  Path = WRMPS.CheckStr(Request.form("Pic"),4)
	  If Path = "" Then Call WRMPS.ErrView("·优惠券缩略图不能为空",0)
	  PathList = WRMPS.CheckStr(Request.form("PicList"),4)
	  If PathList = "" Then Call WRMPS.ErrView("·优惠券图片列表不能为空",0)
	  Tags = WRMPS.CheckStr(Request.form("Tags"),0)
	  If Tags = "" Then Tags = Null
	  TempID = WRMPS.CheckStr(Request.form("TempID"),1)
	  If TempID = "" Or IsNull(TempID) Then TempID = 0
	  Set Rs = Conn.Execute("Select WM_ParentDir,WM_Dir,WM_ChannelDir From WM_CouponSort Where WM_ID="&ClassID)
	  If Not Rs.Eof Then
	    ClassDir = Rs(0)&Rs(1)
		ChannelDir = Rs(2)
	  Else
	    Call WRMPS.ErrView("·请按规定操作<br>·",0)
	  End If
      Rs.Close
      Conn.Execute("Insert into WM_Coupon(WM_Title,WM_Agio,WM_AgioType,WM_Item,WM_Circumscribe,WM_Begin,WM_End,WM_Tel,WM_Address,WM_Intro,WM_Path,WM_PathList,WM_ComID,WM_Time,WM_User,WM_PostType,WM_Key,WM_ClassID,WM_ClassDir,WM_ChannelID,WM_ChannelDir,WM_AreaID,WM_Commend,WM_Hit,WM_Re,WM_TempID,WM_aZTop,WM_aTop,WM_aTitColor,WM_aBgColor,WM_aBold,WM_aProp,WM_aTColor,WM_aBColor,WM_Collection,WM_Tags)values('"&Title&"','"&Agio&"',"&AgioType&",'"&Items&"','"&Circumscribe&"','"&WM_Begin&"','"&WM_End&"','"&Tel&"','"&Address&"','"&Intro&"','"&Path&"','"&PathList&"',0,"&ConnTime&",'"&Request.Cookies("Admin")("Admin")&"',2,1,"&ClassID&",'"&ClassDir&"',"&ChannelID&",'"&ChannelDir&"',"&AreaID&",0,0,0,"&TempID&","&ConnTime&","&ConnTime&",Null,Null,"&ConnTime&",'0|0',"&ConnTime&","&ConnTime&",0,'"&Tags&"')")
	  Conn.Execute("Update WM_Config Set WM_CouponNum = WM_CouponNum + 1")
	  Call WRMPS.SCache("CouponNum",WRMPS.GetCache("CouponNum") + 1)
	  Call WRMPS.ErrView("·优惠券发布成功<meta http-equiv=refresh content='1;URL=?Action=Add'>",1)
	  
    Case "Add"
      Content = Content & "<Script language='JavaScript' Src='../Inc/GetDate.Js'></Script>" & vbCrLf  
	  Content = Content & "<table width='100%' cellpadding=3 cellspacing=1 Class=td1>" & vbCrLf  
	  Content = Content & "<form action='?Action=AddSave&Page=" & Page & "&Table=" & Table & "&Word=" & Word&"&Key=" & Key & "' name=myform method=POST>" & vbCrLf
	  Content = Content & "<tr Class=td4><td colspan=2><strong>添加优惠券</strong></td></tr>" & vbCrLf  
	  Content = Content & "<tr Class=td2><td width='20%'><strong>选择地区 <font color=#FF0000>*</font></strong></td><td width='80%'><script language=""JavaScript"" src=""../Inc/Js/AreaSelect.Js""></Script></td></tr>" & vbCrLf
	  Content = Content & "<tr Class=td2><td><strong>选择分类 <font color=#FF0000>*</font></strong></td><td><script language=""JavaScript"" src=""../Inc/Js/CouponSelect.Js""></Script></td></tr>" & vbCrLf
	  Content = Content & "<tr Class=td2><td><strong>优惠券名称 <font color=#FF0000>*</font></strong></td><td><input name='Title' type='text' Style='width:400px' maxlength=50></td></tr>" & vbCrLf
	  Content = Content & "<tr Class=td2><td><strong>详细说明 <font color=#FF0000>*</font></strong></td><td><textarea name='Content' style='height:100px;width:600px'></textarea></td></tr>" & vbCrLf
	  Content = Content & "<tr Class=td2><td><strong>折扣类型 <font color=#FF0000>*</font></strong></td><td><input type=""radio"" name=""AgioType"" value=0 checked onclick=""agio1.style.display='';agio2.style.display='none';agio3.style.display='none';"">折扣券 <input type=""radio"" name=""AgioType"" value=1 onclick=""agio1.style.display='none';agio2.style.display='';agio3.style.display='none';"">抵价券 <input type=""radio"" name=""AgioType"" value=2 onclick=""agio1.style.display='none';agio2.style.display='none';agio3.style.display='';"">礼品券</td></tr>" & vbCrLf
	  Content = Content & "<tr Class=td2 id=agio1><td><strong>折扣额 <font color=#FF0000>*</font></strong><br>折扣,可为小数</td><td><input name='Agio1' type='text' Style='width:100px' maxlength=10></td></tr>" & vbCrLf
	  Content = Content & "<tr Class=td2 id=agio2 style=""display:none""><td><strong>抵价金额 <font color=#FF0000>*</font></strong><br>单位:元</td><td><input name='Agio2' type='text' Style='width:100px' maxlength=10></td></tr>" & vbCrLf
	  Content = Content & "<tr Class=td2 id=agio3 style=""display:none""><td><strong>礼品名称 <font color=#FF0000>*</font></strong></td><td><input name='Agio3' type='text' Style='width:200px' maxlength=50></td></tr>" & vbCrLf
	  Content = Content & "<tr Class=td2><td><strong>针对项目</strong><br>如:全场项目</td><td><input name='Item' type=text Style='width:200px' maxlength=50></td></tr>" & vbCrLf
	  Content = Content & "<tr Class=td2><td><strong>使用限制</strong><br>如:特价、酒水、套餐除外</td><td><input name='Circumscribe' type=text Style='width:200px' maxlength=50></td></tr>" & vbCrLf
	  Content = Content & "<tr Class=td2><td><strong>开始时间 <font color=#FF0000>*</font></strong></td><td><input name=""Begin"" type=""text"" Style=""width:100px"" maxlength=10 readonly onClick='PopCalendar.show(document.myform.Begin, ""yyyy-mm-dd"", null, null, null, ""11"");'> <a style='cursor:pointer;' onClick='PopCalendar.show(document.myform.Begin, ""yyyy-mm-dd"", null, null, null, ""11"");'><img src='../Images/other/Calendar.gif' border='0' Style='Padding-Top:10px'></a></td></tr>" & vbCrLf
	  Content = Content & "<tr Class=td2><td><strong>结束时间 <font color=#FF0000>*</font></strong></td><td><input name=""End"" type=""text"" Style=""width:100px"" maxlength=10 readonly onClick='PopCalendar.show(document.myform.End, ""yyyy-mm-dd"", null, null, null, ""11"");'> <a style='cursor:pointer;' onClick='PopCalendar.show(document.myform.End, ""yyyy-mm-dd"", null, null, null, ""11"");'><img src='../Images/other/Calendar.gif' border='0' Style='Padding-Top:10px'></a></td></tr>" & vbCrLf
	  Content = Content & "<tr Class=td2><td><strong>预定电话</strong></td><td><input name='Tel' type='text' Style='width:200px' maxlength=30></td></tr>" & vbCrLf
	  Content = Content & "<tr Class=td2><td><strong>地址</strong></td><td><input name='Address' type='text' Style='width:300px' maxlength=50></td></tr>" & vbCrLf
	  Content = Content & "<tr Class=td2><td><strong>上传文件 <font color=#FF0000>*</font></strong></td><td>缩略图:<input name=Pic type='text' Style='width:400px' maxlength=50><input type='hidden' name='PicList'><div style='padding:8px 0'><span id=plist></span></div><div class=Up style='float:left;'><div class=UpFont><a href=""javascript:openWithIframe('添加附件','../Plus/UpLoad/Index.asp?Type=9&User=1',350,150);"">添加附件</a></div><div style='width:120px; height:120px; z-index:1;overflow:auto' class=updiv ID=PicPreview><Img src='img/nopic.gif'></div></div></td></tr>" & vbCrLf
	  Content = Content & "<tr class=td2><td><strong>标签</strong><br>多个关键字用英文豆号隔开</td><td><input name='Tags' type=text Style='width:300px' maxlength=50></td></tr>" & vbCrLf
      Content = Content & "<tr class=td2><td><strong>模板选择</strong></td><td>"&TempSelect(0,61,ChannelID,"TempID")&"</td></tr>" & vbCrLf
	  Content = Content & "<tr Class=td2><td></td><td><input type=submit value='提交保存' onclick=""Loading.style.display='';Loading.style.bottom=100;""></td></tr>" & vbCrLf
	  Content = Content & "</form>" & vbCrLf
	  Content = Content & "</table>" & vbCrLf
    
	Case "EditSave"
      ClassID = WRMPS.CheckStr(Request.form("ClassID"),1)
      AreaID = WRMPS.CheckStr(Request.form("AreaID"),1)
	  If ClassID = "" Then  ClassID = WRMPS.CheckStr(Request.form("ClassID_"),1)
	  If AreaID = "" Then  AreaID = WRMPS.CheckStr(Request.form("AreaID_"),1)
      If ClassID ="" Then Call WRMPS.ErrView("·请选择优惠券所属分类",0)
      If AreaID ="" Then Call WRMPS.ErrView("·请选择优惠券所属地区",0)
      Title = WRMPS.CheckStr(Request.form("Title"),0)
	  If Title = "" Then Call WRMPS.ErrView("·优惠券名称不能为空",0)
      Intro = WRMPS.CheckStr(Request.form("Content"),0)
	  If Intro = "" Then Intro = NULL
	  AgioType = WRMPS.CheckStr(Request.form("AgioType"),1)
	  Select Case AgioType
	    Case 0
	      Agio = WRMPS.CheckStr(Request.form("Agio1"),1)
	      If Agio = "" Then Call WRMPS.ErrView("·折扣额不能为空",0)
	    Case 1
	      Agio = WRMPS.CheckStr(Request.form("Agio2"),1)
		  If Agio = "" Then Call WRMPS.ErrView("·抵价金额不能为空",0)
	    Case 2
	      Agio = WRMPS.CheckStr(Request.form("Agio3"),0)
	      If Agio = "" Then Call WRMPS.ErrView("·礼品名称不能为空",0)
	  End Select
	  Items = WRMPS.CheckStr(Request.form("Item"),0)
	  If Items = "" Then Items = Null
	  Circumscribe = WRMPS.CheckStr(Request.form("Circumscribe"),0)
	  If Circumscribe = "" Then Circumscribe = Null
      WM_Begin = WRMPS.CheckStr(Request.form("Begin"),0)
	  If WM_Begin = "" Then Call WRMPS.ErrView("·开始时间不能为空",0)
      WM_End = WRMPS.CheckStr(Request.form("End"),0)
	  If WM_End = "" Then Call WRMPS.ErrView("·结束时间不能为空",0)
      TEL = WRMPS.CheckStr(Request.form("TEL"),0)
	  If TEL = "" Then TEL = Null
      Address = WRMPS.CheckStr(Request.form("Address"),0)
	  If Address = "" Then Address = Null
	  Path = WRMPS.CheckStr(Request.form("Pic"),4)
	  If Path = "" Then Call WRMPS.ErrView("·优惠券缩略图不能为空",0)
	  PathList = WRMPS.CheckStr(Request.form("PicList"),4)
	  If PathList = "" Then Call WRMPS.ErrView("·优惠券图片列表不能为空",0)
	  Tags = WRMPS.CheckStr(Request.form("Tags"),0)
	  If Tags = "" Then Tags = Null
	  TempID = WRMPS.CheckStr(Request.form("TempID"),1)
	  If TempID = "" Or IsNull(TempID) Then TempID = 0
	  Set Rs = Conn.Execute("Select WM_ParentDir,WM_Dir,WM_ChannelDir From WM_CouponSort Where WM_ID="&ClassID)
	  If Not Rs.Eof Then
	    ClassDir = Rs(0)&Rs(1)

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -