<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<%option explicit%>
<!--#include file="../Conn.asp"-->
<!--#include file="TaskConfig.asp"-->
<!--#include file="../HSK_Cls/HSK.MemberCls.asp"-->
<%
Dim HSKCls
Set HSKCls = New CollectTask
HSKCls.Run()
Set HSKCls = Nothing

Class CollectTask
	Private KS,KSUser,Action,ID,RS
	Private TotalPut,MaxPerPage,TopNum,CurrPage
	Private XML,Node
	Private Sub Class_Initialize()
		MaxPerPage =20			'每页显示多少条
		TopNum = 0				'查询多少条记录 0表示无限

		Set KS=New PublicCls
		Set KSUser = New UserCls
	End Sub
	Private Sub Class_Terminate()
		Set KS=Nothing
		Set KSUser=Nothing
		Call CloseConn()
	End Sub

	
	Public Sub Run()
		IF Cbool(KSUser.UserLoginChecked) = False  Then
		  GCls.ComeUrl = GCls.GetUrl()
		  Response.Redirect("/user/login/")
		  Exit Sub
		End If
	
		Action = KS.CheckXSS(KS.R(KS.S("Action")))
		ID = KS.ChkClng(KS.S("ID"))
		Select Case Action
				Case "Del"
						Call DoDel()
				Case "Pause"
						Call DoPause()
				Case Else
						Call DoMain()
		End Select
		
	End Sub
	
	Sub DoMain()
%>
<!--#include file="Template/head.html"-->
<style type="text/css">
.center_tbl td {border-bottom:1px solid #E0F0FF; line-height:22px; height:35px; clear:both; background-color:#FFF}
.center_tbl tr:hover td{background-color:#EBF5FF}
.Template_Tips{
	background-color:#eef9ff;
	border: 1px solid #ACDAFF;
	border-top: 0px;
	height: auto;
	width:958px;
	padding-top:10px;
}

.Template_Tips .innerframe{
	display:block;
	border: 1px solid #c7e5fa;
	margin: 0 10px 10px 10px;
	padding:10px;
	background-color: #FFF;
	position: relative;
	height: 60px;
}
.Template_Tips .innerframe .left{
	color:#20537a;
	float:left;
	width:400px;
	}
.Template_Tips .innerframe .right{
	float:left;
	width:500px;
	margin-left:14px;
	}
</style>
<!-- 以下条脚本是控制导航菜单的当前项CSS，可根据需求调整eq(4)的数字 -->
<script language="javascript">$(".nav_content li:eq(4)").addClass("current")</script>
<!-- 任务列表 start -->
<div class="clear"></div>
  <div class="task_content"> 
	<!-- 任务列表 -->
	<div class="taskHall">
	  <ul class="task_tab">
        <li id="tab_m1" class="current"><a><span>流量任务区</span></a></li>
        <li style="padding-left:50px" class="red rough size14"><img src="/style/images/horn.gif" width="14" height="14" align="absmiddle" /> 亲！发布刷收藏任务/刷流量任务、或查看已发收藏/流量任务等，请点击下图下载客户端软件登录后操作</li>
      </ul>
      <div class="clear"></div>

		<!-- 模板列表 -->

<div class="Template_Tips">
    <div class="innerframe">
		<div class="left"><span class="rough size14">尊敬的<span class="orange"><%=KSUser.UserName%></span>，欢迎您回来！</span><br />
        您的账户余额：<span class="orange"><%=KS.GetN(KSUser.GetUserInfo("Money"),2)%></span> 元 &nbsp; 发布点：<span class="orange"><%=KS.GetN(KSUser.GetUserInfo("Point"),3)%></span> 点 &nbsp; 收藏点：<span class="orange"><%=KS.GetN(KSUser.GetUserInfo("KS_CollectPoint"),3)%></span> 点</p>
          <p>流量点：<span class="orange"><%=KS.GetN(KSUser.GetUserInfo("KS_FlowPoint"),4)%></span> 点 &nbsp; 可用积分：<span class="orange"><%=KSUser.GetUserInfo("Score")%></span> &nbsp; <%=ScoreGradeIco(KSUser.GetUserInfo("KS_TotalScore"))%> &nbsp; <%
If KS.ChkClng(KSUser.GetUserInfo("KS_IDAuthentication"))=1 Then
	KS.Echo "<img src=""/style/images/mobile_1.gif"" align=""absmiddle"" title=""已通过手机认证"" />"
Else
	KS.Echo "<img src=""/style/images/mobile_2.gif"" align=""absmiddle"" title=""未通过手机认证"" />"
End IF
if KS.ChkClng(KSUser.GetUserInfo("KS_IsShangbao")) = 1 Then KS.Echo " &nbsp;<img src=""/style/images/ShangBao.gif"" title=""已加入商保服务"" align=""absmiddle"">"
KS.Echo " &nbsp;" & GetVipIco(KSUser.GroupID)
%></div>
<div class="right"><a href="http://www.mm2006.com/1.exe" title="点击下载"><img src="/style/images/HelperDown.gif" /></a></div>
	</div>
</div>
<div class="clear"></div>
<ul class="screening" style="border-top: 1px solid #ACDAFF; margin-top: 10px;">
        <li>
		<span class="orderSub">
        	<a class="active" href='?Tid=0&Status=0'>所有任务<span class="red" id="Status0"></span></a>
            <span style="display:inline-block; width:600px; height:22px; line-height:22px; text-align:center; color:red;">温馨提示：收藏和流量任务需要下载互刷助手到本地电脑运行，软件才自动接任务并完成！</span>
        	<span style="display:inline-block; width:240px; height:22px; vertical-align:middle; text-align:right"><img src="/style/images/task_reflesh.gif" align="absmiddle" style="cursor:pointer;" onClick="location.reload();" title="刷新本页面"></span>
        </span>
        </li>
</ul>
      
<div class="t_list">
		<table style="border-bottom:1px solid #ACDAFF; margin-bottom:6px;" border="0" cellSpacing="0" cellPadding="4" height="30" width="100%">
        <tr>
        <th width="110">任务编号</th>
        <th width="140">发布人</th>
        <th width="110">已完成/总浏览量</th>
        <th width="150">IP限制</th>
        <th width="180">发布时间</th>
        <th width="90">任务状态</th>
        <th>操作</th>
        </tr>
        </table>
        <div  id="list_tbl">
<%
	If KS.S("page") <> "" Then
		  CurrPage = CInt(KS.S("page"))
	Else
		  CurrPage = 1
	End If
	
	Set RS=Server.CreateObject("ADODB.RECORDSET")
	RS.Open "Select * From Flow Where LockTF = 0 And PauseTF = 0 Order By Status,ID Desc", Conn, 1, 1
	If Not RS.Eof Then
		TotalPut = RS.RecordCount
		If TotalPut>TopNum And TopNum<>0 Then TotalPut=TopNum
		If CurrPage >1 and (CurrPage - 1) * MaxPerPage < TotalPut Then
			RS.Move (CurrPage - 1) * MaxPerPage
		Else
			CurrPage = 1
		End If
		Set XML=KS.ArrayToXml(RS.GetRows(MaxPerPage),RS,"row","root")
	End If
	RS.Close
	Set RS=Nothing

	If IsObject(XML) Then
%>
	<div  id="list_tbl">
    <table class="center_tbl" border="0" cellSpacing="0" cellPadding="4" width="100%">
<%		For Each Node In Xml.DocumentElement.SelectNodes("row") %>
        <tr>
          <td width="110" align="center" class="rough"><img src="/style/images/FlowICO.gif" align="absmiddle" title="流量任务" /> <%=GetNodeText("TaskID")%></td>
          <td width="140" align="center"><%=UserScoreVipInfo()%></td>
          <td width="110" align="center"><span class="orange" title="已完成浏览数量"><%=GetNodeText("CompleteCount")%></span> / <span title="总浏览数量"><%=GetNodeText("TotalCount")%></span></td>
          <td width="150" align="center"><%
		  If KS.ChkClng(GetNodeText("Times")) > 0 Then
		  	KS.Echo "<span class=""orange"">同IP最多浏览" & GetNodeText("Times") & "次</span>"
		  Else
		  	KS.Echo "系统默认限制"
		  End If
			%></td>
          <td width="180" align="center"><img src="/style/images/time.gif" align="absmiddle" /> <%=GetNodeText("AddDate")%></td>
          <td width="90" align="center"><%
		  If KS.ChkClng(GetNodeText("LockTF")) = 1 Then
		  		KS.Echo "<span class=""red"" title=""请联系客服人员解锁"">已被锁定</span>"
		  Else
		  	  If KS.ChkClng(GetNodeText("PauseTF")) = 1 Then
				 KS.Echo "<span class=""red"">已暂停</span>"
			  Else
				  Select Case KS.ChkClng(GetNodeText("Status"))
						Case 0
							KS.Echo "<span class=""blue"">待浏览</span>"
						Case 1
							KS.Echo "<span class=""orange"">进行中</span>"
						Case 2
							KS.Echo "已完成"
				  End Select
			  End If
		  End If
		  %></td>
          <td align="center">客户端自动接手并完成</td>
        </tr>
	<%	Next  %>
    </table>
    </div>
<%	Else
		KS.Echo "<div class='border' style='text-align:center'>目前还没有流量任务！</div>"
	End If
	Set XML = Nothing
    If Totalput > MaxPerPage Then KS.Echo "<div class=""multipage"">" & KS.ShowPage(Totalput, MaxPerPage, "", CurrPage,false,false) & "</div>"
    %>
        </div>
       </div>
    </div>

<!-- 任务列表结束 -->
</div>
<!--#include file="Template/foot.html"-->
<%
End Sub

Function GetNodeText(NodeName)
	Dim N,Str
	NodeName=Lcase(NodeName)
		If IsObject(Node) Then
		set N=node.SelectSingleNode("@" & NodeName)
		If Not N is Nothing Then Str=N.text
	GetNodeText=Str
	End If
End Function

Function UserScoreVipInfo()
	Dim UserName,str,RS
	UserName = KS.Delsql(GetNodeText("inputer"))
	If Not KS.IsNul(UserName) Then
		Set RS = Conn.Execute("select top 1 GroupID,IsOnline,KS_TotalScore from KS_User Where UserName='" & UserName & "'")
			If Not RS.Eof Then
				if KS.ChkClng(RS(1))=1 then
					str = str & " <img src=""/user/images/online.gif"" align=""absmiddle"" title=""该用户在线"">"
				else
					str = str & " <img src=""/user/images/notonline.gif"" align=""absmiddle"" title=""该用户不在线"">"
				end if
				IF KS.ChkClng(RS(0)) = UserGroupVipID Then
					UserName = "<span class=""red"">" & UserName & "</span>"
					str = str & " <img src=""/style/images/vip.gif"" align=""absmiddle"" title=""尊贵VIP会员"" />"
				End If
				str = str & " " & ScoreGradeIco(RS(2))
			End If
		Set RS = Nothing
	End If
	UserScoreVipInfo = UserName & str
End Function
End Class
%>
