<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<%option explicit%>
<!--#include file="../Conn.asp"-->
<!--#include file="../Task/TaskConfig.asp"-->
<!--#include file="../HSK_Cls/HSK.MemberCls.asp"-->
<!--#include file="../HSK_Cls/HSK.Label.CommonCls.asp"-->
<!--#include file="payfunction.asp"-->
<%
Dim KSCls
Set KSCls = New User_Card
KSCls.HSK_Run()
Set KSCls = Nothing

Class User_Card
        Private KS,KSUser
		Private Sub Class_Initialize()
		  Set KS=New PublicCls
		  Set KSUser = New UserCls
		  Session(KS.SiteSN&"UserInfo") = Empty
		End Sub
        Private Sub Class_Terminate()
		 Set KS=Nothing
		 Set KSUser=Nothing
		End Sub
		%>
		<!--#include file="../HSK_Cls/UserFunction.asp"-->
		<%
		Public Sub loadMain()
		IF Cbool(KSUser.UserLoginChecked)=false Then
		  Response.Write "<script>top.location.href='Login';</script>"
		  Exit Sub
		End If
		Call KSUser.Head()
		Response.Write "<div class=""tabs"">"
		Response.Write " <ul class="""">"
		Response.Write " <li><a href=""User_Transfer.asp"" style='color:red;'>支付宝自动充值</a></li>"
		Response.Write " <li><a href=""User_PayOnline.asp"">在线支付充值</a></li>"
		Response.Write " <li><a href=""user_recharge.asp"">充值卡充值</a></li>"
		Response.Write " <li class='select'><a href=""user_card.asp"" style='color:red;'>购买点卡</a></li>"
		
		If Mid(KS.Setting(170),1,1)="1" or Mid(KS.Setting(170),2,1)="1" Then
			If KS.S("Action")="Point" Then
			Response.Write " <li class='select'><a href=""user_exchange.asp?Action=Point"">兑换" & KS.Setting(45) & "</a></li>"
			Else
			Response.Write " <li><a href=""user_exchange.asp?Action=Point"">兑换" & KS.Setting(45) & "</a></li>"
			End IF
		End If
		If Mid(KS.Setting(170),3,1)="1" or Mid(KS.Setting(170),4,1)="1" Then
			If KS.S("Action")="Edays" Then
			Response.Write " <li class='select'><a href=""user_exchange.asp?Action=Edays"">兑换有效期</a></li>"
			Else
			Response.Write " <li><a href=""user_exchange.asp?Action=Edays"">兑换有效期</a></li>"
			End If
		End If
		If Mid(KS.Setting(170),5,1)="1" Then
			If KS.S("Action")="Money" Then
			Response.Write " <li class='select'><a href=""user_exchange.asp?Action=Money"">" & KS.Setting(45) & "兑换资金</a></li>"
			Else
			Response.Write " <li><a href=""user_exchange.asp?Action=Money"">兑换资金</a></li>"
			End If
		End If
		Response.Write "</ul>"
		Response.Write "</div>"
		Select Case KS.S("Action")
		 Case "Save"
		 	Call KSUser.InnerLocation("购买发布点提示")
		    Call DoCard()
		Case Else
		 	Call KSUser.InnerLocation("购买发布点")
			Call CardList()
		End Select
       End Sub
	   
	   Sub CardList()
	   %>
	   <script>
		//* 名　　称：IsInteger
		//* 功    能：判断是否为正整数
		//*****************************************************************
		function IsInteger(fData)
		{
		if ((fData==null) || (fData.length==0) || (isNaN(fData)) || (fData.indexOf(".")!=-1) || (fData.indexOf("-")!=-1)){
		return false   
		}
		return true   
		}
		
	     function Confirm(Obj,n)
		 {
		   var Money=<%=KSUser.GetUserInfo("Money")%>;
		   var str='友情提醒：\n\n';
		   if (Obj.Card.value==1 || Obj.Card.value==6 || Obj.Card.value==7){
			 if (IsInteger(Obj.CardNum.value)==false){
				alert('请输入整数！');
				Obj.CardNum.focus();
			    return false;
			 }
			 if(n==1){
				 var Num = 1;
				 var Price = <%=TaskCardPrice1%>;
			 }
			 if(n==2){
				 var Num = 10;
				 var Price = <%=TaskCardPrice6%>;
			 }
			 if(n==3){
				 var Num = 100;
				 var Price = <%=TaskCardPrice7%>;
			 }			 
			 if (parseInt(Obj.CardNum.value)<Num){
				alert('抱歉！最低购买' + Num + '个，请输入大于' + Num + '的整数！');
				Obj.CardNum.focus();
			    return false;
			 }
		     if (parseInt(Obj.CardNum.value) * Price > Money){
			   alert('您目前资金余额不足，请充值后再来购买！');
			   return false;
			   }
		    str+='购买前资金：'+Money+' 元\n\n';
			str+='购买后资金：'+(Money-parseInt(Obj.CardNum.value) * Price).toFixed(2)+' 元\n\n';
			str+='确定要购买吗？';
		   }else{
		   str+='确定要购买吗？';
		   }
		   if (confirm(str)){
		    return true}
		   else{ return false}
		 }
	   </script>
		<table class=border cellSpacing=1 cellPadding=2 width="100%" align=center border=0>
			<tr>
			  <td class=chargetitle height=22> 账号余额信息</td>
			</tr> 
			<tr class=tdbg>
			  <td align=center height=50>用户名：<span style="color:#FF5500"><%=KSUser.UserName%></span> &nbsp; &nbsp; 账户余额：<span style="color:#FF5500"><%=KS.GetN(KSUser.GetUserInfo("Money"),2)%></span> 元 &nbsp;&nbsp; 发布点：<span style="color:#FF5500"><%=KS.GetN(KSUser.GetUserInfo("Point"),2)%></span> <%=KS.Setting(46)%> &nbsp;&nbsp; 收藏点：<span style="color:#FF5500"><%=KS.GetN(KSUser.GetUserInfo("KS_CollectPoint"),3)%></span> 点 &nbsp;&nbsp; 流量点：<span style="color:#FF5500"><%=KS.GetN(KSUser.GetUserInfo("KS_FlowPoint"),4)%></span> 点</td>
			</tr>
		  </table>
          
<table class=border cellSpacing=1 cellPadding=2 width="100%" align=center border=0>
<tr>
  <td class=chargetitle height=22 width="50%"> 购买发布点</td>
  <td class=chargetitle height=22 width="50%"> 购买VIP会员卡<span style="font-weight:normal; color:#F63; font-size:9pt; padding-left:100px;"><a href="/html/help/FAQ/3965.html" target="_blank"><font color="#FF0000">了解VIP会员好处>></font></a></span></td>
</tr>
</table>
<table class=border align="center" width="99.9%" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td bgcolor="#EEEEEE">
<table width="100%" border="0" cellspacing="1" cellpadding="2">
  <tr class=tdbg>
    <td width="50%">
      <table width="100%" border="0" cellspacing="0" cellpadding="0">
		<FORM name=myform action="User_Card.asp" method="post" onsubmit="return Confirm(this,1)">
        <tr>
          <td align="center" valign="bottom" height="160"><img src="/style/images/PointCard1.jpg" width="263" height="150" /></td>
        </tr>
        <tr>
          <td height="60" align="center"><strong>单个发布点 价格：<span class="orange"><%=KS.GetN(TaskCardPrice1,2)%>元/个</span>&nbsp; 购买数量：<input name="CardNum" type="text" maxlength="4" value="10" style="width:40px;" onKeyUp="this.value=this.value.replace(/\D/g,'')"  onafterpaste="this.value=this.value.replace(/\D/g,'')" />个<br />
          <input id="Action" name="Action" type="hidden" value="Save">
          <input id="Card" name="Card" type="hidden" value="1"> 
          <input name="Card_bt" type="image" src="/style/images/Card_bt.gif" align="absmiddle" /></strong></td>
        </tr>
        </FORM>
      </table></td>
    <td width="50%" height="100" align="center">
    <table width="100%" border="0" cellspacing="0" cellpadding="0">
    <FORM name=myform4 action="User_Card.asp" method="post" onsubmit="return Confirm(this)">
        <tr>
          <td align="center" valign="bottom" height="160"><img src="/style/images/Vip_Card.gif" /></td>
        </tr>
        <tr>
          <td height="60" align="center"><strong><img src="/style/images/vip.gif" align="absmiddle" /> 半个月VIP会员卡 <span class="orange">15</span>元<br /></strong>
          <input id="Action" name="Action" type="hidden" value="Save">
          <input id="Card" name="Card" type="hidden" value="10"><input name="UserCardID" type="hidden" value="6">
          <input name="Card_bt" type="image" src="/style/images/Card_bt.gif" align="absmiddle" /></td>
        </tr>
      </FORM>
      </table></td>
  </tr>
  <tr class=tdbg>
    <td>
    <table width="100%" border="0" cellspacing="0" cellpadding="0">
		<FORM name=myform action="User_Card.asp" method="post" onsubmit="return Confirm(this,2)">
        <tr>
          <td align="center" valign="bottom" height="160"><img src="/style/images/PointCard6.jpg" width="263" height="150" /></td>
        </tr>
        <tr>
          <td height="60" align="center"><strong>单个<span style="color:blue">收藏点</span> 价格：<span class="orange"><%=KS.GetN(TaskCardPrice6,3)%>元/个</span>&nbsp; 购买数量：<input name="CardNum" type="text" maxlength="5" value="10" style="width:40px;" onKeyUp="this.value=this.value.replace(/\D/g,'')"  onafterpaste="this.value=this.value.replace(/\D/g,'')" />个<br />
          <input id="Action" name="Action" type="hidden" value="Save">
          <input id="Card" name="Card" type="hidden" value="6"> 
          <input name="Card_bt" type="image" src="/style/images/Card_bt.gif" align="absmiddle" /></strong></td>
        </tr>
        </FORM>
      </table>
      </td>
    <td height="100">
    <table width="100%" border="0" cellspacing="0" cellpadding="0">
    <FORM name=myform4 action="User_Card.asp" method="post" onsubmit="return Confirm(this)">
        <tr>
          <td align="center" valign="bottom" height="160"><img src="/style/images/Vip_Card2.gif" /></td>
        </tr>
        <tr>
          <td height="60" align="center"><strong><img src="/style/images/vip.gif" align="absmiddle" /> 一个月VIP会员卡 <span class="orange">28</span>元<br /></strong>
          <input id="Action" name="Action" type="hidden" value="Save">
          <input id="Card" name="Card" type="hidden" value="11"><input name="UserCardID" type="hidden" value="7">
          <input name="Card_bt" type="image" src="/style/images/Card_bt.gif" align="absmiddle" /></td>
        </tr>
      </FORM>
      </table></td>
  </tr>
  <tr class=tdbg>
    <td>
    <table width="100%" border="0" cellspacing="0" cellpadding="0">
		<FORM name=myform action="User_Card.asp" method="post" onsubmit="return Confirm(this,3)">
        <tr>
          <td align="center" valign="bottom" height="160"><img src="/style/images/PointCard7.jpg" width="263" height="150" /></td>
        </tr>
        <tr>
          <td height="60" align="center"><strong>单个<span style="color:blue">流量点</span> 价格：<span class="orange"><%=KS.GetN(TaskCardPrice7,4)%>元/个</span>&nbsp; 购买数量：<input name="CardNum" type="text" maxlength="5" value="100" style="width:40px;" onKeyUp="this.value=this.value.replace(/\D/g,'')"  onafterpaste="this.value=this.value.replace(/\D/g,'')" />个<br />
          <input id="Action" name="Action" type="hidden" value="Save">
          <input id="Card" name="Card" type="hidden" value="7"> 
          <input name="Card_bt" type="image" src="/style/images/Card_bt.gif" align="absmiddle" /></strong></td>
        </tr>
        </FORM>
      </table></td>
    <td height="100">
    <table width="100%" border="0" cellspacing="0" cellpadding="0">
    <FORM name=myform4 action="User_Card.asp" method="post" onsubmit="return Confirm(this)">
        <tr>
          <td align="center" valign="bottom" height="160"><img src="/style/images/Vip_Card3.gif" /></td>
        </tr>
        <tr>
          <td height="60" align="center"><strong><img src="/style/images/vip.gif" align="absmiddle" /> 六个月VIP会员卡 <span class="orange">128</span>元<br /></strong>
          <input id="Action" name="Action" type="hidden" value="Save">
          <input id="Card" name="Card" type="hidden" value="12"><input name="UserCardID" type="hidden" value="8">
          <input name="Card_bt" type="image" src="/style/images/Card_bt.gif" align="absmiddle" /></td>
        </tr>
      </FORM>
      </table>
    </td>
  </tr>
  <tr class=tdbg>
    <td>
    <table width="100%" border="0" cellspacing="0" cellpadding="0">
    <FORM name=myform2 action="User_Card.asp" method="post" onsubmit="return Confirm(this)">
        <tr>
          <td align="center" valign="bottom" height="160"><img src="/style/images/PointCard2.jpg" /></td>
        </tr>
        <tr>
          <td height="60" align="center"><strong><img src="/style/images/score_4.gif" width="16" height="16" align="absmiddle" /> 一钻卡 <span class="orange"><%=TaskCardPrice2%></span>元(<%=TaskCardPoint2%>个发布点) <span class="orange">节省<%=Round(TaskCardPrice1*TaskCardPoint2-TaskCardPrice2,2)%>元</span><br />
          <input id="Action" name="Action" type="hidden" value="Save">
          <input id="Card" name="Card" type="hidden" value="2"> 
          <input name="Card_bt" type="image" src="/style/images/Card_bt.gif" align="absmiddle" /></strong></td>
        </tr>
      </FORM>
      </table></td>
    <td height="100">
    <table width="100%" border="0" cellspacing="0" cellpadding="0">
    <FORM name=myform3 action="User_Card.asp" method="post" onsubmit="return Confirm(this)">
        <tr>
          <td align="center" valign="bottom" height="160"><img src="/style/images/PointCard3.jpg" /></td>
        </tr>
        <tr>
          <td height="60" align="center"><strong><img src="/style/images/score_5.gif" align="absmiddle" /> 二钻卡 <span class="orange"><%=TaskCardPrice3%></span>元(<%=TaskCardPoint3%>个发布点) <span class="orange">节省<%=Round(TaskCardPrice1*TaskCardPoint3-TaskCardPrice3,2)%>元</span><br />
          <input id="Action" name="Action" type="hidden" value="Save">
          <input id="Card" name="Card" type="hidden" value="3"> 
          <input name="Card_bt" type="image" src="/style/images/Card_bt.gif" align="absmiddle" /></strong></td>
        </tr>
      </FORM>
      </table>
    </td>
  </tr>
  <tr class=tdbg>
    <td>
    <table width="100%" border="0" cellspacing="0" cellpadding="0">
    <FORM name=myform4 action="User_Card.asp" method="post" onsubmit="return Confirm(this)">
        <tr>
          <td align="center" valign="bottom" height="160"><img src="/style/images/PointCard4.jpg" /></td>
        </tr>
        <tr>
          <td height="60" align="center"><strong><img src="/style/images/score_4.gif" align="absmiddle" /><img src="/style/images/score_6.gif" align="absmiddle" /> 四钻卡 <span class="orange"><%=TaskCardPrice4%></span>元(<%=TaskCardPoint4%>个发布点) <span class="orange">节省<%=Round(TaskCardPrice1*TaskCardPoint4-TaskCardPrice4,2)%>元</span><br />
          <input id="Action" name="Action" type="hidden" value="Save">
          <input id="Card" name="Card" type="hidden" value="4"> 
          <input name="Card_bt" type="image" src="/style/images/Card_bt.gif" align="absmiddle" /></strong></td>
        </tr>
      </FORM>
      </table></td>
    <td height="100">    
    <table width="100%" border="0" cellspacing="0" cellpadding="0">
    <FORM name=myform5 action="User_Card.asp" method="post" onsubmit="return Confirm(this)">
        <tr>
          <td align="center" valign="bottom" height="160"><img src="/style/images/PointCard5.jpg" /></td>
        </tr>
        <tr>
          <td height="60" align="center"><strong><img src="/style/images/score_7.gif" width="16" height="16" align="absmiddle" /> 皇冠卡 <span class="orange"><%=TaskCardPrice5%></span>元(<%=TaskCardPoint5%>个发布点) <span class="orange">节省<%=Round(TaskCardPrice1*TaskCardPoint5-TaskCardPrice5,2)%>元</span><br />
          <input id="Action" name="Action" type="hidden" value="Save">
          <input id="Card" name="Card" type="hidden" value="5"> 
          <input name="Card_bt" type="image" src="/style/images/Card_bt.gif" align="absmiddle" /></strong></td>
        </tr>
      </FORM>
      </table>
    </td>
  </tr>
</table>
</td>
  </tr>
</table>
    
<table width="100%" border="0" cellspacing="0" cellpadding="0">
    <tr>
    	<td height=40> <img src="images/icon21.png" align="absmiddle" /> 购买发布点卡，可以马上发布自己的任务 但你也可以通过在任务大厅接任务获得发布点，不一定需要购买的！</td>
    </tr> 
</table>

<%
End Sub
	   
Sub DoCard()
Dim RS
Dim Card,CardNum,Point,Price,Msg
Point = 0: Price = 0
Card=KS.ChkCLng(KS.S("Card"))
CardNum=KS.ChkCLng(KS.S("CardNum"))
If Card = 0 Then
	Response.Write "<script>alert('购买出错啦!请联系管理员！');history.back();</script>"
	Exit Sub
End If
If (Card = 1 Or Card = 6 Or Card = 7) And CardNum <=0 Then
	Response.Write "<script>alert('购买出错啦!请输入购买数量！');history.back();</script>"
	Exit Sub
End If
Select Case Card
	Case 1
		Point = CardNum
		Price = CardNum * TaskCardPrice1
		Msg	= "恭喜！购买" & CardNum & "个发布点成功！"
	Case 2
		Point = TaskCardPoint2
		Price = TaskCardPrice2
		Msg	= "恭喜！购买一钻卡成功！您已获得" & Point & "个发布点！"
	Case 3
		Point = TaskCardPoint3
		Price = TaskCardPrice3
		Msg	= "恭喜！购买二钻卡成功！您已获得" & Point & "个发布点！"
	Case 4
		Point = TaskCardPoint4
		Price = TaskCardPrice4
		Msg	= "恭喜！购买四钻卡成功！您已获得" & Point & "个发布点！"
	Case 5
		Point = TaskCardPoint5
		Price = TaskCardPrice5
		Msg	= "恭喜！购买皇冠卡成功！您已获得" & Point & "个发布点！"
	Case 6
		Point = CardNum
		Price = CardNum * TaskCardPrice6
		Msg	= "恭喜！购买" & CardNum & "个收藏点成功！"
	Case 7
		Point = CardNum
		Price = CardNum * TaskCardPrice7
		Msg	= "恭喜！购买" & CardNum & "个流量点成功！"
	Case 10,11,12		'半、一、六个月VIP卡
		Dim UserCardID:UserCardID=KS.ChkClng(KS.S("UserCardID"))
		Dim Title,Money
'		If KS.ChkClng(KSUser.GroupID)=UserGroupVipID Then Call KS.AlertHistory("您已经是VIP会员了，不需要再购买！",-1)
		IF KS.ChkClng(KSUser.GroupID) = AdminGroupID Then
			Call KS.AlertHistory("管理员不能购买VIP卡，谢谢！",-1)
			Exit Sub
		End If
		If UserCardID<>0 Then
		   Set RS=Conn.Execute("Select Top 1 Money,GroupName From KS_UserCard Where ID=" & UserCardID)
		   If Not RS.Eof Then
		    Money=RS(0)
		    Title=RS(1)
			RS.Close : Set RS=Nothing
		   Else
		    RS.Close : Set RS=Nothing
		    Call KS.AlertHistory("VIP会员卡数据出错，请联系管理员！",-1)
			Exit Sub 
		   End If
		   
			If round(KSUser.GetUserInfo("money"),2)<round(Money,2) Then
				Call KS.AlertHistory("对不起，您可用金额不足，本VIP卡需要消费" & Money & "元，您当前的可用余额为" & Formatnumber(KSUser.GetUserInfo("money"),2,-1) & "元，请充值后再购买！",-1)
				Exit Sub
			End If
			Call UpdateByCard(1,UserCardID,KSUser.UserName,KSUser.GetUserInfo("RealName"),KSUser.GetUserInfo("Edays"),KSUser.GetUserInfo("BeginDate"),UserCardID,"")
			'增加好友积分	默认10分
			If Split(Score_System_CardScore,"|")(0) = 1 Then
				Call KS.ScoreInOrOut(KSUser.UserName,1,Split(Score_System_CardScore,"|")(0),"系统","购买VIP会员卡赠送!",0,0)
			End If
			'增加好友动态
		 	Call KSUser.AddLog(KSUser.UserName,"购买[" & title & "]成功！",1)
			Session(KS.SiteSN&"UserInfo")=empty
			Response.Write("<script>alert('恭喜，[" & title & "]购买成功！');location.href='User_Card.asp';</script>")
			Response.End() 
		  End If 
		  Response.Redirect("User_Card.asp")
	Case Else
		KS.Die "<script>alert('出错啦!');history.back();</script>"
End Select

'以下为购买发布点
Set RS=Server.CreateObject("ADODB.RECORDSET")
RS.Open "Select top 1 UserName,RealName,Money From KS_User Where UserName='" & KSUser.UserName & "'",conn,1,1
If RS.Eof  Then
	Rs.Close:Set RS=Nothing
	Response.Write "<script>alert('出错啦!请检查是否登录已超时！');history.back();</script>"
    Response.End
	Exit Sub
End If

IF Round(RS("Money"),2) < Round(Price,2) Then
   Rs.Close:Set RS=Nothing
   Response.Write "<script>alert('你可用资金不足，请充值后再来购买!');history.back();</script>"
   Response.End
   Exit Sub
End If
RS.Close:Set RS=Nothing

If Card = 6 Then	'买收藏点
		Call KS.MoneyInOrOut(KSUser.UserName,KSUser.UserName,Price,4,2,now,0,"系统","购买"& Point &"个收藏点！",0,0,1)
		Call KS.CollectPointInOrOut(0,0,KSUser.UserName,"",1,Point,"系统","购买收藏点!",0)
		'增加好友积分	普通会员最高20分，VIP2倍
		If Split(Collect_ScoreSystem_BuyCardScore,"|")(0) = 1 Then
			IF Point <= Split(Collect_ScoreSystem_BuyCardScore,"|")(1) Then
				Point = 1
			ElseIF Point > Split(Collect_ScoreSystem_BuyCardScore,"|")(1) And Point< Split(Collect_ScoreSystem_BuyCardScore,"|")(1) * Split(Collect_ScoreSystem_BuyCardScore,"|")(2) Then
				Point = Int(Point\Split(Collect_ScoreSystem_BuyCardScore,"|")(1))
			ElseIF Point >= Split(Collect_ScoreSystem_BuyCardScore,"|")(1) * Split(Collect_ScoreSystem_BuyCardScore,"|")(2) Then
				Point = Split(Collect_ScoreSystem_BuyCardScore,"|")(2)
			End IF
			If KS.ChkClng(KSUser.GroupID) = UserGroupVipID Then	Point = Point * Split(Collect_ScoreSystem_BuyCardScore,"|")(3)
			Call KS.ScoreInOrOut(KSUser.UserName,1,CInt(Point),"系统","购买收藏点赠送!",0,0)
		End IF
ElseIf Card = 7 Then	'买流量点
		Call KS.MoneyInOrOut(KSUser.UserName,KSUser.UserName,Price,4,2,now,0,"系统","购买"& Point &"个流量点！",0,0,1)
		Call KS.FlowPointInOrOut(0,0,KSUser.UserName,1,Point,"系统","购买流量点!",0)
		'增加好友积分	普通会员最高20分，VIP2倍
		If Split(Flow_ScoreSystem_BuyCardScore,"|")(0) = 1 Then
			IF Point <= Split(Flow_ScoreSystem_BuyCardScore,"|")(1) Then
				Point = 1
			ElseIF Point > Split(Flow_ScoreSystem_BuyCardScore,"|")(1) And Point< Split(Flow_ScoreSystem_BuyCardScore,"|")(1) * Split(Flow_ScoreSystem_BuyCardScore,"|")(2) Then
				Point = Int(Point\Split(Flow_ScoreSystem_BuyCardScore,"|")(1))
			ElseIF Point >= Split(Flow_ScoreSystem_BuyCardScore,"|")(1) * Split(Flow_ScoreSystem_BuyCardScore,"|")(2) Then
				Point = Split(Flow_ScoreSystem_BuyCardScore,"|")(2)
			End IF
			If KS.ChkClng(KSUser.GroupID) = UserGroupVipID Then	Point = Point * Split(Flow_ScoreSystem_BuyCardScore,"|")(3)
			Call KS.ScoreInOrOut(KSUser.UserName,1,CInt(Point),"系统","购买流量点赠送!",0,0)
		End IF
Else
		Call KS.MoneyInOrOut(KSUser.UserName,KSUser.UserName,Price,4,2,now,0,"系统","购买"& Point &"个发布点！",0,0,1)
		Call KS.PointInOrOut(0,0,KSUser.UserName,1,Point,"系统","购买发布点！",0)
		'增加好友积分	普通会员最高20分，VIP2倍
		If Split(Score_System_CardScore,"|")(0) = 1 Then
			IF Point <= Split(Score_System_CardScore,"|")(2) Then
				Point = 1
			ElseIF Point > Split(Score_System_CardScore,"|")(2) And Point< Split(Score_System_CardScore,"|")(2) * Split(Score_System_CardScore,"|")(3) Then
				Point = Int(Point/Split(Score_System_CardScore,"|")(2))
			ElseIF Point >= Split(Score_System_CardScore,"|")(2) * Split(Score_System_CardScore,"|")(3) Then
				Point = Split(Score_System_CardScore,"|")(3)
			End IF
			If KS.ChkClng(KSUser.GroupID) = UserGroupVipID Then	Point = Point * Split(Score_System_CardScore,"|")(4)
			Call KS.ScoreInOrOut(KSUser.UserName,1,CInt(Point),"系统","购买发布点赠送!",0,0)
		End IF
End If
Response.Write "<script>alert('"& Msg &"');location.href='User_Card.asp';</script>"
End Sub

End Class
%>