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

📄 user_coupon.asp

📁 网人分类信息5.0商业版。非常优秀的分类信息系统。比较少见。
💻 ASP
📖 第 1 页 / 共 3 页
字号:
<!--#include file="Cook.asp" -->
<%
Dim N,i,Table,Word
Dim DCountOut,DIntegral,WM_Commend,DC1,DI1,DC2,DI2,DC3,DI3,DC4,DI4,DC5,DI5,DC6,DI6,DC7,DI7
Dim WM_aZTop,WM_aTop,WM_aTitColor,WM_aBgColor,WM_aBold,WM_aProp,WM_aTColor,WM_aBColor,WM_Key
Dim aKey,aCommend,aZTop,aTop,aTColor,aBColor,aTitColor,aBgColor,aBold,aProp1,aProp2,WM_CheckUser,WM_ClaimUser,WM_BLPic
Dim Path,SPath_List,PathList,AreaIDName,Path_List,Title,Intro,AgioType,Agio,WM_Begin,WM_End,Address,TEL,ClassDir,Tags,Items,Circumscribe

ChannelID = 7
Table = WRMPS.CheckStr(Request("Table"), 0)
Word = WRMPS.CheckStr(Request("Word"), 0)
Page = WRMPS.CheckStr(Request("Page"), 1)
ID = WRMPS.CheckStr(Request("ID"), 0)
Key = WRMPS.CheckStr(Request("Key"), 1)
If Key = "" Then Key = 1

Call DBConnBegin()
Set Rs = Server.CreateObject("ADODB.RecordSet")
Set Rso = Server.CreateObject("ADODB.RecordSet")

Select Case Request("Action")
  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 "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))&" and WM_User='"&MemName&"'")
			  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_ID = "&MemID&" and WM_ClassNum > 0")
	               Call WRMPS.SCache("CouponNum",WRMPS.GetCache("CouponNum") - 1)
				 End If
                 Conn.Execute("Delete From WM_Coupon where WM_ID="&Int(ID(i))&" and WM_User = '"&MemName&"'")
			     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 If
			  Rs.Close
		  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 "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
	  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("Update WM_Coupon Set WM_Title='"&Title&"',WM_Agio='"&Agio&"',WM_AgioType="&AgioType&",WM_Item='"&Items&"',WM_Circumscribe='"&Circumscribe&"',WM_Begin='"&WM_Begin&"',WM_End='"&WM_End&"',WM_Tel='"&Tel&"',WM_Address='"&Address&"',WM_Intro='"&Intro&"',WM_Path='"&Path&"',WM_PathList='"&PathList&"',WM_ClassID="&ClassID&",WM_ClassDir='"&ClassDir&"',WM_AreaID="&AreaID&",WM_Tags='"&Tags&"' Where WM_ID="&ID&" and WM_User='"&MemName&"'")
	  Call WRMPS.ErrView("·优惠券修改成功<meta http-equiv=refresh content='1;URL=?Page=" & Page & "&Table=" & Table & "&Word=" & Word&"&Key=" & Key & "'>",1)

  Case "Edit"
      Content = Content & PageTop()
      Content = Content & UserPath(",<a href=User_Coupon.asp>优惠券管理</a>")
	  
	  Rs.Open "Select * From WM_Coupon Where WM_ID="&ID&" and WM_User='"&MemName&"'" ,Conn,1,1
	  If Not Rs.Eof Then
      AreaIDName=WRDB.GetClassName("WM_Area",Rs("WM_AreaID"))
      ClassName=WRDB.GetClassName("WM_CouponSort",Rs("WM_ClassID"))
      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=EditSave&Page=" & Page & "&Table=" & Table & "&Word=" & Word&"&Key=" & Key & "' name=myform method=POST>" & vbCrLf
	  Content = Content & "<input type=hidden name=ID value="&ID&">" & vbCrLf
	  Content = Content & "<input type=hidden name=AreaID_ value="&Rs("WM_AreaID")&">" & vbCrLf
	  Content = Content & "<input type=hidden name=ClassID_ value="&Rs("WM_ClassID")&">" & vbCrLf
	  Content = Content & "<tr><td colspan=2 Class=td4><strong>修改优惠券</strong></td></tr>" & vbCrLf  
	  Content = Content & "<tr Class=td2><td><strong>所属地区</strong></td>" & vbCrLf
	  Content = Content & "<td>"&AreaIDName&" <font onclick='Edit2(b1)' style='cursor:pointer' color=blue>修改请点击</font></td></tr>" & vbCrLf
	  Content = Content & "<tr Class=td2 id=b1 style='display:none'><td><strong>修改地区</strong></td>" & vbCrLf
	  Content = Content & "<td><script src='../Inc/Js/AreaSelect.Js'></Script></td></tr>" & vbCrLf
	  Content = Content & "<tr Class=td2><td width='20%'><strong>所属分类</strong></td>" & vbCrLf
	  Content = Content & "<td width='80%'>"&ClassName&" <font onclick='Edit3(c1)' style='cursor:pointer' color=blue>修改请点击</font></td></tr>" & vbCrLf
	  Content = Content & "<tr Class=td2 id=c1 style='display:none'><td><strong>修改分类</strong></td>" & vbCrLf
	  Content = Content & "<td><script 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 value="""&Rs("WM_Title")&"""></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'>"&Rs("WM_Intro")&"</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';""" & WRMPS.GetCheckVer(0, Rs("WM_AgioType"), 1) & ">折扣券 <input type=""radio"" name=""AgioType"" value=1 onclick=""agio1.style.display='none';agio2.style.display='';agio3.style.display='none';""" & WRMPS.GetCheckVer(1, Rs("WM_AgioType"), 1) & ">抵价券 <input type=""radio"" name=""AgioType"" value=2 onclick=""agio1.style.display='none';agio2.style.display='none';agio3.style.display='';""" & WRMPS.GetCheckVer(2, Rs("WM_AgioType"), 1) & ">礼品券</td></tr>" & vbCrLf
	  Content = Content & "<tr Class=td2 id=agio1"
	  If Rs("WM_AgioType") <> 0 Then Content = Content & " style=""display:none"""
	  Content = Content & "><td><strong>折扣额 <font color=#FF0000>*</font></strong><br>折扣,可为小数</td><td><input name='Agio1' type='text' Style='width:100px' maxlength=10 value="""&Rs("WM_Agio")&"""></td></tr>" & vbCrLf
	  Content = Content & "<tr Class=td2 id=agio2"
	  If Rs("WM_AgioType") <> 1 Then Content = Content & " style=""display:none"""
	  Content = Content & "><td><strong>抵价金额 <font color=#FF0000>*</font></strong><br>单位:元</td><td><input name='Agio2' type='text' Style='width:100px' maxlength=10 value="""&Rs("WM_Agio")&"""></td></tr>" & vbCrLf
	  Content = Content & "<tr Class=td2 id=agio3"
	  If Rs("WM_AgioType") <> 2 Then Content = Content & " style=""display:none"""
	  Content = Content & "><td><strong>礼品名称 <font color=#FF0000>*</font></strong></td><td><input name='Agio3' type='text' Style='width:200px' maxlength=50 value="""&Rs("WM_Agio")&"""></td></tr>" & vbCrLf
	  Content = Content & "<tr Class=td2><td><strong>针对项目</strong><br>如:全场项目</td><td><input name='Item' type=text Style='width:200px' maxlength=50 value="""&Rs("WM_Item")&"""></td></tr>" & vbCrLf
	  Content = Content & "<tr Class=td2><td><strong>使用限制</strong><br>如:特价、酒水、套餐除外</td><td><input name='Circumscribe' type=text Style='width:200px' maxlength=50 value="""&Rs("WM_Circumscribe")&"""></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 value="""&Rs("WM_Begin")&""" 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 value="""&Rs("WM_End")&""" 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 value="""&Rs("WM_Tel")&"""></td></tr>" & vbCrLf
	  Content = Content & "<tr Class=td2><td><strong>地址</strong></td><td><input name='Address' type='text' Style='width:300px' maxlength=50 value="""&Rs("WM_Address")&"""></td></tr>" & vbCrLf
	  PathList = WRMPS.CheckStr(Rs("WM_PathList"),5)
	  Content = Content & "<tr Class=td2><td><strong>上传文件 <font color=#FF0000>*</font></strong></td><td>缩略图:<input name=Pic type='text' Style='width:400px' maxlength=50 value="""&WRMPS.CheckStr(Rs("WM_Path"),5)&"""><input type='hidden' name='PicList' value="""&PathList&"""><div style='padding:8px 0'><span id=plist>"
      If PathList <> "" Then 
	    Path_List = Split(PathList,"|")
	    Call WRMPS.FsoBegin()
		For I=0 To UBound(Path_List)
		  SPath_List = WRMPS.GetReplace(Path_List(i),Split(Path_List(i),"/")(UBound(Split(Path_List(i),"/"))),"S/"&Split(Path_List(i),"/")(UBound(Split(Path_List(i),"/"))))
		  If WRMPS.FsoIsTrue("File",SPath_List) = False Then SPath_List = Path_List(i)
		  Content = Content & "<div id=l_"&i&"><a href=# onclick=PicReset('"&SPath_List&"') alt='做为缩略图'>"&Path_List(i)&"</a>  <a href=# onclick=dlist('"&i&"','"&Path_List(i)&"','"&SPath_List&"') class=Red>删除</a></div>"
		Next
	    Call WRMPS.FsoEnd()
	  End If
	  Content = Content & "</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='"&WRMPS.CheckStr(Rs("WM_Path"),5)&"' onload='DrawImage(this, 118, 118);'></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 value="""&Rs("WM_Tags")&"""></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
	  End If
	  Rs.Close
      
	  Content = Content & PageButtom()

  Case "DJSave"
	DI1=0:DC1=0:DI2=0:DC2=0:DI3=0:DC3=0:DI4=0:DC4=0:DI5=0:DC5=0:DI6=0:DC6=0:DI7=0:DC7=0	
    Set Rs = Conn.Execute("Select Top 1 WM_Key,WM_Commend,WM_aProp,WM_aZTop,WM_aTop,WM_aTitColor,WM_aTColor,WM_aBgColor,WM_aBColor,WM_aBold From WM_Coupon Where WM_ID = "&ID&" and WM_User='"&MemName&"'")
    If Not Rs.Eof Then
	    WM_Key = Rs(0)
		WM_Commend = Rs(1)
		WM_aProp = Split(Rs(2),"|")
		WM_aZTop = Rs(3)
		WM_aTop = Rs(4)
		WM_aTitColor = Rs(5)
		WM_aTColor = Rs(6)
		WM_aBgColor = Rs(7)
		WM_aBColor = Rs(8)
		WM_aBold = Rs(9)
		aProp1=WM_aProp(0):aProp2=WM_aProp(1)
		

⌨️ 快捷键说明

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