<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<%option explicit%>
<!--#include file="../Conn.asp"-->
<!--#include file="../Task/TaskConfig.asp"-->
<!--#include file="../HSK_Cls/HSK.CommonCls.asp"-->
<!--#include file="../HSK_Cls/HSK.AdministratorCls.asp"-->
<!--#include file="Include/Session.asp"-->
<%

Dim KSCls
Set KSCls = New Admin_TaskManage
KSCls.HSK_Run()
Set KSCls = Nothing

Class Admin_TaskManage
        Private KS,Param,KSCls,ChannelID
		Private Action,i,strClass,sFileName,RS,SQL,maxperpage,CurrentPage,totalPut,TotalPageNum
		Private FieldStr,TaoBaoTID,PaiPaiTID,YouaTID,KS_LailuSearch
        Private Sub Class_Initialize()
		  Set KS=New PublicCls
		  Set KSCls=New ManageCls
		  ChannelID	 = 113	'刷信誉模型ID
  		  maxperpage = 20 '###每页显示数
		  FieldStr = "*"
		  TaoBaoTID = "20100598989251"
		  PaiPaiTID = "20104912544927"
		  YouaTID   = "20107602754390"
		End Sub
        Private Sub Class_Terminate()
		 Call CloseConn()
		 Set KS=Nothing
		End Sub

		Public Sub HSK_Run()
			If Not KS.ReturnPowerResult(ChannelID, "M" & ChannelID & "10012") Then        '检查审核权限
			 Call KS.ReturnErr(1, "")
			 Response.End()
			 End If
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link href="Include/Admin_Style.CSS" rel="stylesheet" type="text/css">
<script src="../HSK_JS/common.js" language="JavaScript"></script>
<script src="../HSK_JS/jquery.js" language="JavaScript"></script>
<script type="text/javascript" src="../editor/ckeditor.js" mce_src="../editor/ckeditor.js"></script>
<script language="JavaScript" src="../HSK_JS/HSK.Box.js"></script>
</head>
<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<%
		If Not IsNumeric(Request("page")) And Len(Request("page")) <> 0 Then
			KS.AlertHistory "错误的系统参数!请输入整数",-1
		End If
		If Not IsEmpty(Request("page")) And Len(Request("page")) <> 0 Then
			CurrentPage = CInt(Request("page"))
		Else
			CurrentPage = 1
		End If
		If CInt(CurrentPage) = 0 Then CurrentPage = 1
		
		Param=" where 1=1"
		If KS.G("KeyWord")<>"" Then
		  If KS.G("condition")="1" Then
		   Param= Param & " And KS_TaskID like '%" & Trim(KS.G("KeyWord")) & "%'"
		  ElseIf KS.G("condition")="2" Then
		   Param= Param & " And Inputer like '%" & Trim(KS.G("KeyWord")) & "%'"
		  ElseIf KS.G("condition")="3" Then
		   Param= Param & " And KS_ShopName like '%" & Trim(KS.G("KeyWord")) & "%'"
		  ElseIf KS.G("condition")="4" Then
		   Param= Param & " And KS_BuyUserName like '%" & Trim(KS.G("KeyWord")) & "%'"
		  ElseIf KS.G("condition")="5" Then
		   Param= Param & " And KS_BuyShopName like '%" & Trim(KS.G("KeyWord")) & "%'"
		  End If
		End If
		
		If KS.G("Flag")<>"" Then
		  If KS.G("Flag")="1" Then Param=Param & " and KS_Status=0"
		  If KS.G("Flag")="2" Then Param=Param & " and KS_Status=1"
		  If KS.G("Flag")="3" Then Param=Param & " and KS_Status=2"
		  If KS.G("Flag")="4" Then Param=Param & " and KS_Status=3"
		  If KS.G("Flag")="5" Then Param=Param & " and KS_Status=4"
		  If KS.G("Flag")="6" Then Param=Param & " and KS_Status=5"
		  If KS.G("Flag")="7" Then Param=Param & " and KS_Status=5 And (KS_CreditDate IS Not Null) And (KS_BuyCreditDate IS Not Null)"
		  If KS.G("Flag")="8" Then Param=Param & " and KS_XuShiTF=0"
		  If KS.G("Flag")="9" Then Param=Param & " and KS_XuShiTF=1"
		  If KS.G("Flag")="10" Then Param=Param & " and KS_XuShiTF=2"
		End If
		
		If KS.G("Tid")<>"" Then
			If KS.G("Tid")="1" Then Param=Param & " and Tid='" & TaoBaoTID & "'"
			If KS.G("Tid")="2" Then Param=Param & " and Tid='" & PaiPaiTID & "'"
			If KS.G("Tid")="3" Then Param=Param & " and Tid='" & YouaTID & "'"
		End If
		
		Dim begindate: begindate=request("begindate")
		Dim enddate: enddate=request("enddate")
		If CInt(DataBaseType) = 1 Then         'Sql
			if isdate(begindate) then Param=Param & " and AddDate>='" & begindate & "'"
			if isdate(enddate) then enddate=DateAdd("d", 1,EndDate):Param=Param & " and AddDate<='" & enddate & "'"
		Else
			if isdate(begindate) then Param=Param & " and AddDate>=#" & begindate & "#"
			if isdate(enddate) then enddate=DateAdd("d", 1,EndDate):Param=Param & " and AddDate<=#" & enddate & "#"
		End If

		totalPut = Conn.Execute("Select Count(id) From KS_U_sxyrw " & Param)(0)
		TotalPageNum = CInt(totalPut / maxperpage)  '得到总页数
		If TotalPageNum < totalPut / maxperpage Then TotalPageNum = TotalPageNum + 1
		If CurrentPage < 1 Then CurrentPage = 1
		If CurrentPage > TotalPageNum Then CurrentPage = TotalPageNum
		Select Case KS.S("action")
		 Case "Del"  Call DoDel()
		 Case "Mod"  Call DoMod()
		 Case "Detail"  Call DoDetail()
		 Case Else
					Call ShowTaskList()
		End Select
End Sub


Private Sub ShowTaskList()
	Dim begindate: begindate=request("begindate")
	Dim enddate: enddate=request("enddate")
%>
<ul id='menu_top'>
<li style='margin-left:10px;margin-top:10px'><strong>任务区筛选：</strong>
<select name="orderby" style="MARGIN-Right: 10px; VERTICAL-ALIGN: middle;" onChange="javascript:if(this.value)window.location.href=this.value"> 
<option<%IF KS.G("Tid")="0" Then KS.Echo " selected"%> value='?Tid=0&flag=<%=KS.G("flag")%>'>默认显示所有</option>
<option<%IF KS.G("Tid")="1" Then KS.Echo " selected"%> value='?Tid=1&flag=<%=KS.G("flag")%>'>淘宝任务区</option>
<option<%IF KS.G("Tid")="2" Then KS.Echo " selected"%> value='?Tid=2&flag=<%=KS.G("flag")%>'>京东任务区</option>
<!-- <option<%IF KS.G("Tid")="3" Then KS.Echo " selected"%> value='?Tid=3&flag=<%=KS.G("flag")%>'>有啊任务区</option> -->

	</select><strong></strong><a href="TaskManage.asp?Tid=<%=KS.G("Tid")%>">所有任务</a> <a href="TaskManage.asp?Tid=<%=KS.G("Tid")%>&flag=1">等待接手</a> <a href="TaskManage.asp?Tid=<%=KS.G("Tid")%>&flag=2">等待支付</a> <a href="TaskManage.asp?Tid=<%=KS.G("Tid")%>&flag=3">等待发货</a> <a href="TaskManage.asp?Tid=<%=KS.G("Tid")%>&flag=4">等待收货与好评</a> <a href="TaskManage.asp?Tid=<%=KS.G("Tid")%>&flag=5">等待确认审核</a> <a href="TaskManage.asp?Tid=<%=KS.G("Tid")%>&flag=6">已完成</a> <a href="TaskManage.asp?Tid=<%=KS.G("Tid")%>&flag=7">已评价</a> <a href="TaskManage.asp?Tid=<%=KS.G("Tid")%>&flag=8">虚拟任务</a> <a href="TaskManage.asp?Tid=<%=KS.G("Tid")%>&flag=9">实物任务</a> <a href="TaskManage.asp?Tid=<%=KS.G("Tid")%>&flag=10">套餐任务</a></li>

</ul>
<table width="100%" border="0" align="center" cellspacing="0" cellpadding="0">
<tr height="25" align="center" class='sort'>
	<td width='6%' nowrap>选择</th>
	<td nowrap>ID号</th>
	<td nowrap>发布人</th>
	<td nowrap>掌柜号</th>
	<td nowrap>任务价格</th>
	<td nowrap>发布点</th>
	<td nowrap>发布时间</th>
	<td nowrap>任务时限</th>
    <td nowrap>接手人</th>
	<td nowrap>任务备注</th>
	<td nowrap>操作</th>
</tr>
<%
	sFileName = "TaskManage.asp?"
	Set Rs = Server.CreateObject("ADODB.Recordset")
	SQL = "select " & FieldStr & " from KS_U_sxyrw " & Param & " order by id desc"
	If DataBaseType = 1 Then
		If CurrentPage > 100 Then
			Rs.Open SQL, Conn, 1, 1
		Else
			Set Rs = Conn.Execute(SQL)
		End If
	Else
		Rs.Open SQL, Conn, 1, 1
	End If
	If Rs.bof And Rs.EOF Then
		Response.Write "<tr><td height=""25"" align=center bgcolor=""#ffffff"" colspan=11>还没有任何任务！</td></tr>"
	Else
		If TotalPageNum > 1 then Rs.Move (CurrentPage - 1) * maxperpage
		i = 0
%>
<form name=selform method=post action=?action=Del>
<%
	Do While Not Rs.EOF And i < CInt(maxperpage)
		If Not Response.IsClientConnected Then Response.End
		
%>
<tr height="25" class='list' onMouseOver="this.className='listmouseover'" onMouseOut="this.className='list'">
	<td align="center" class="splittd"><input type=checkbox name=id value='<%=rs("id")%>'><%if RS("Tid")=TaoBaoTid then
							KS.echo "<img src=""/style/images/taobao_ico.gif"" align=""absmiddle"" title=""淘宝任务""  onClick=""$('#C" & rs("id") & "').toggle()"" /> "
						elseif RS("Tid")=PaiPaiTid then
							KS.echo "<img src=""/style/images/paipai_ico.gif"" align=""absmiddle"" title=""京东任务""  onClick=""$('#C" & rs("id") & "').toggle()"" /> "
						elseif RS("Tid")=YouaTid then
							KS.echo "<img src=""/style/images/youa_ico.gif"" align=""absmiddle"" title=""有啊任务""  onClick=""$('#C" & rs("id") & "').toggle()"" /> "
						end if%></td>
	<td align="center" class="splittd"><a href="javascript:void(0);" onclick="ViewDetail('<%=Rs("ID")%>')"><%=Rs("ID")%></a></td>
	<td align="center" class="splittd"><a href="?keyword=<%=Rs("Inputer")%>&condition=2"><%=Rs("Inputer")%></a></td>
	<td align="center" class="splittd"><a href="?keyword=<%=Rs("KS_ShopName")%>&condition=3"><%=Rs("KS_ShopName")%></a></td>
	<td align="center" class="splittd"><img src="/style/images/ico_gold.gif" align="absmiddle" /> <%=Rs("KS_Price")%>元<%if KS.ChkClng(Rs("ks_modpricetf"))=1 then KS.echo " <span  style=""color:red"">改价</span>"%></td>
	<td align="center" class="splittd"><%=KS.GetN(Rs("KS_Point"),3)%>点</td>
	<td align="center" class="splittd"><%=RS("AddDate")%></td>
	<td align="center" class="splittd"><%=ks_haopinglimit(RS("KS_HaoPingLimit"),RS("KS_ShopDynamic"),RS("KS_HaoPingContent")) %>
	</td>
   	<td align="center" class="splittd" title="用户账号：<%=Rs("KS_BuyUserName")%>&#13;&#10;接手买号：<%=Rs("KS_BuyShopName")%>"><a href="?keyword=<%=Rs("KS_BuyUserName")%>&condition=4"><%=Rs("KS_BuyUserName")%></a>&nbsp;</td>
    <td align="center" class="splittd" onClick="$('#C<%=Rs("id")%>').toggle()"><%
	if KS.ChkClng(Rs("ks_ShangBao"))=1 then KS.Echo "<img src=""/style/images/ShangBao.gif"" width=""20"" height=""20"" align=""absmiddle"" title=""商保任务"" /> "
	if KS.ChkClng(Rs("ks_xushitf"))=1 then
		KS.echo "<img src=""/style/images/realobject.gif"" align=""absmiddle"" title=""该任务为实物商品"" />"
	elseif KS.ChkClng(Rs("ks_xushitf"))=2 then
		KS.echo "<img src=""/style/images/dapei.gif"" align=""absmiddle"" title=""该任务为搭配套餐"" />"
	else
		KS.echo "<img src=""/style/images/virtual.gif"" align=""absmiddle"" title=""该任务为虚拟商品"" />"
	end if
	if KS.ChkClng(Rs("ks_payType"))=2 then KS.echo "|<span style=""color:red"" Title=""红包支付"">红</span>"
	if KS.ChkClng(Rs("ks_payType"))=3 then KS.echo "|<span style=""color:blue"" Title=""卖家代付"">代</span>"
	if KS.ChkClng(Rs("KS_RealNameType"))>0 then KS.echo "|<span style=""color:green"" Title=""买号实名认证"">实</span>"
	if KS.ChkClng(Rs("KS_CollectTF"))=1 then KS.echo "|<span style=""color:red"" Title=""收藏店铺和宝贝"">藏</span>"
	if KS.ChkClng(Rs("ks_shopcarttf"))=1 then KS.echo "|<span style=""color:green"" Title=""购物车任务"">购</span>"
	if Not KS.IsNul(Rs("KS_LailuSearch")) then KS.echo "|<span style=""color:#FF7700"" Title=""搜索来路任务"">搜</span>"
	
	Select Case Rs("KS_Status")
		case 0
				KS.Echo "|等待接手"
		case 1
			IF KS.IsNul(Rs("KS_BuyShopName")) Then
				KS.Echo "|等待绑定买号"
			Else
				KS.Echo "|等待支付"
			End If
		case 2
			KS.Echo "|等待发货"
		case 3
			KS.Echo "|等待收货"
		case 4
			KS.Echo "|等待审核"
		case 5
			KS.Echo "|已完成"
			If KS.IsNul(Rs("KS_CreditDate")) Or KS.IsNul(Rs("KS_BuyCreditDate")) Then	KS.Echo ",待评价"
	End Select
	if KS.ChkClng(Rs("ks_LockTF"))=1 then KS.echo "|<span style=""color:red"" title=""该任务已被锁定,锁定的任务不会在任务大厅显示,且只有管理员可以解锁"">锁</span>"
	if KS.ChkClng(Rs("KS_PauseTF"))=1 then KS.echo "|<span style=""color:red"" title=""该任务已被暂停,暂停的任务不会在任务大厅显示"">暂</span>"
	%></td>
    <td align="center" class="splittd"><a href="?Action=Del&Rebate=1&ID=<%=rs("id")%>" onclick="return(confirm('确定要删除吗？\n\n注：删除后将返还担保金及发布点！'));">删除</a>
    </td>
</tr>
<tr id="C<%=rs("id")%>" bgcolor="#EEEEEE" style="display:<%if ks.g("keyword")<>"" And KS.G("condition")="1" then ks.echo "block" else ks.echo "none"%>;">
	<td height='25' colspan=11>&nbsp;任务编号：<%=rs("KS_TaskID")%> &nbsp; 标题：<%=rs("Title")%> &nbsp; 商品数量：<%=rs("KS_ProductCount")%> &nbsp;  <span title="总发布点包括增值功能区所需额外发布点">总发布点：<%=rs("KS_TotalPoint")%></span> &nbsp;  发布IP：<%=rs("KS_AddUserIP")%> &nbsp;  接手IP：<%=rs("KS_BuyUserIP")%>
    <br>&nbsp;接手时间：<%=rs("KS_BuyDate")%>&nbsp; 支付时间：<%=rs("KS_PayDate")%>&nbsp; 发货时间：<%=rs("KS_DeliveryDate")%>&nbsp; 好评时间：<%=rs("KS_HaoPingDate")%>&nbsp; 完成时间：<%=rs("KS_EndDate")%>
   <% If Not KS.IsNul(Rs("KS_LailuSearch")) Then
   		KS_LailuSearch = Split(RS("KS_LailuSearch"),"^%^")
   		If KS_LailuSearch(1)=1 Then
			KS.Echo "<br>&nbsp;搜索来路类型：店铺搜索 &nbsp; 搜索店铺关键字："& KS_LailuSearch(2) & " &nbsp; 搜索提示："& KS_LailuSearch(3)
		ElseIf KS_LailuSearch(1)=2 Then
			KS.Echo "<br>&nbsp;搜索来路类型：宝贝搜索 &nbsp; 搜索宝贝关键字："& KS_LailuSearch(2) & " &nbsp; 搜索提示："& KS_LailuSearch(3)
		ElseIf KS_LailuSearch(1)=3 Then
			KS.Echo "<br>&nbsp;搜索来路类型：买家信用评价页面链接 &nbsp; 买家信用评价地址："& KS_LailuSearch(2) & " &nbsp; 来路提示："& KS_LailuSearch(3)
		End If
   End If %>
    </td>
</tr>
<%
		Rs.movenext
			i = i + 1
			If i >= maxperpage Then Exit Do
		Loop
	End If
	Rs.Close:Set Rs = Nothing
%>
<tr>
	<td class='list' onMouseOver="this.className='listmouseover'" onMouseOut="this.className='list'" height='35' colspan=11>
	&nbsp;&nbsp;<input id="chkAll" onClick="CheckAll(this.form)" type="checkbox" value="checkbox"  name="chkAll">全选
	<input class="button" type="button" name="Submit2" value=" 删除选中的任务 " title="注：本项删除不返还担保金和发布点！" onclick="{if(confirm('确定要删除选中的记录吗?\n\n注：本项删除不返还担保金和发布点！')){this.document.selform.submit();return true;}return false;}">  &nbsp;<input type="button" value="设未接手" onclick="SetUrl(this,'?Action=Mod&Status=0')" class="button"> <input type="button" value="设已接手" onclick="SetBuyShopName('?Action=Mod&Status=1');" class="button"> <input type="button" value="设已支付" onclick="SetUrl(this,'?Action=Mod&Status=2')" class="button"> <input type="button" value="设已发货" onclick="SetUrl(this,'?Action=Mod&Status=3')" class="button"> <input type="button" value="设已收货" onclick="SetUrl(this,'?Action=Mod&Status=4')" class="button"> <input type="button" value="设已审核" onclick="if(confirm('本功能为了方便自己人假刷，不用产生资金记录等而设，仅把任务设为审核，不返还资金和发布点的；\n\n如需要返还资金和发布点，请点击右边“设已审核并放款”')){SetUrl(this,'?Action=Mod&Status=5');}" class="button"> <input type="button" value="设已审核并放款" onclick="SetUrl(this,'?Action=Mod&Status=55')" class="button"> <input type="button" value="设已互评价" onclick="SetUrl(this,'?Action=Mod&Status=100')" class="button"> <input type="button" value="锁定任务" onclick="SetUrl(this,'?Action=Mod&Status=101')" class="button" /> <input type="button" value="解锁任务" onclick="SetUrl(this,'?Action=Mod&Status=102')" class="button" /> <input type="button" value="暂停任务" onclick="SetUrl(this,'?Action=Mod&Status=103')" class="button" /> <input type="button" value="解暂任务" onclick="SetUrl(this,'?Action=Mod&Status=104')" class="button" /></td>
</tr>
</form>
<tr>
	<td  colspan=11 align=right>
	<%
	 Call KSCLS.ShowPage(totalPut, MaxPerPage, "TaskManage.asp", True, "个", CurrentPage, KS.QueryParam("page"))
	%></td>
</tr>
</table>
<div>
<form action="TaskManage.asp" name="myform" method="get">
   <div style="border:1px dashed #cccccc;margin:3px;padding:4px">
      &nbsp;<strong>快速搜索=></strong>
	 &nbsp;关键字:<input type="text" class='textbox' name="keyword" value="<%=Trim(KS.G("keyword"))%>">&nbsp;类型:
	 <select name="condition">
	  <option value=1<%if KS.G("condition")="1" then ks.echo " selected=""selected"""%>>按任务编号搜索</option>
	  <option value=2<%if KS.G("condition")="2" then ks.echo " selected=""selected"""%>>按发布者搜索</option>
	  <option value=3<%if KS.G("condition")="3" then ks.echo " selected=""selected"""%>>按掌柜号搜索</option>
	  <option value=4<%if KS.G("condition")="4" then ks.echo " selected=""selected"""%>>按接手者搜索</option>
	  <option value=5<%if KS.G("condition")="5" then ks.echo " selected=""selected"""%>>按接手买号搜索</option>
	 </select>
	  &nbsp;<input type="submit" value="开始搜索" class="button" name="s1">
    </div>
</form>
<table width="100%" border="0" style="border:1px dashed #cccccc;margin:3px;padding:4px">
<form action="?action=search&SearchType=100&condition=2" method=post name="myform">   
   <tr>
     <td width="12%"><strong> &nbsp;按时间段查询=></strong></td>
     <td width="48%">
       
       <table width="100%"  align="center" border=0 cellPadding=0 cellSpacing=0>
         <tr>
           <td nowrap="nowrap" class=form-left>起始日期：
             <%if isdate(begindate) then%>
             <input type="text" name="begindate" value="<%=begindate%>" size="12" class="form-input">
             <%else%>
             <input type="text" name="begindate" value="<%=year(now)&"-"&month(now)&"-1"%>" size="12" class="form-input">
             <%end if%>
            </td>    
		    <td  class=form-left>终止日期：  
		      <%if isdate(enddate) then%>            
		      <input type="text" name="enddate" value="<%=enddate%>" size="12" class="form-input">
		      <%else%>
		      <input type="text" name="enddate" value="<%=formatdatetime(now,2)%>" size="12" class="form-input">
		      <%end if%>
		      </td>    
			</tr>
        </table>	 </td>
     <td width="40%">发布人用户名：
      <input type="text" class='textbox' name="keyword" size="10" value="<%If KS.ChkClng(KS.G("condition"))=2 Then KS.Echo Request("keyword")%>" /> &nbsp;
      <input name="submit2" type="submit" value="按日期查找" class='button' />
      </td>
    </tr>
</form>
 </table>
</div>
<script language="javascript">

function ViewDetail(id)
{
  new KesionPopup().PopupCenterIframe('任务详细浏览','?Action=Detail&ID=' + id,650,480,'auto')
}
		
function SetUrl(o,url){
	if (confirm('您确定要将选中的任务“'+o.value+'”吗？')==true){
//		alert(get_Ids(document.selform));return false;		
		location.href=url + "&id=" + get_Ids(document.selform);
		}
}
function CheckName()
{
 var BuyUserName=$("#BuyUserName").val();
 var BuyShopName=$("#BuyShopName").val();
 var url=$("#url").val();
 if (BuyUserName==''||BuyShopName==''||url==''){
  alert('接手人账号或买号不能为空!');
  return false;
  closeWindow();
 }
location.href = url + '&BuyUserName=' + BuyUserName + '&BuyShopName=' + BuyShopName + '&id=' + get_Ids(document.selform); 
}
//设已接手
function SetBuyShopName(url) {
	new KesionPopup("#fff",4,true,"font-size:12px;background:url(/style/images/w_b_2.gif) #1B76B7 0 -4px;color:#20537A;height:22px;").mousepopup("&nbsp; 设置接手人","<br />&nbsp; 请输入所选任务的接手人账号和接手买号<br /><br />&nbsp; 接手人账号：<input name='BuyUserName' id='BuyUserName' style='width:120px;' value=''> 买号：<input name='BuyShopName' id='BuyShopName' style='width:120px;' value=''><div style='text-align:center;margin:10px'><input type='button' onclick='return(CheckName())' value=' 确定提交 ' class='button'><input type='hidden' value="+url+" name='url' id='url'> <input type='button' value=' 取 消 ' onclick='closeWindow()' class='button'></div>",400);
}
</script>
</body>
</html>
<%
End Sub

Sub DoDetail()
Dim ID: ID=KS.ChkClng(KS.S("ID"))
IF ID<>0 Then
Set RS=Server.CreateObject("ADODB.RECORDSET")
RS.Open "Select Top 1 * From KS_U_sxyrw Where ID="& ID &"",Conn,1,1
If Not RS.Eof Then
%>
<table width="100%" border="0" align="center" cellpadding="1" cellspacing="1">
<!--
 <tr>
  <td colspan=2 align=center><strong>任 务 明 细</strong></td>
 </tr>
 <tr>
   <td style="height:6px"></td>
   <td></td>
 </tr>
  -->
 <tr class="tdbg">
  <td width="22%" height="25" align="right" class="clefttitle"><strong><span>任务编号：</span></strong></td>
  <td width="78%">&nbsp;<%=Rs("KS_TaskID")%></td>
 </tr>
 <tr class="tdbg">
  <td width="22%" height="25" align="right" class="clefttitle"><strong><span>任务区：</span></strong></td>
  <td width="78%">&nbsp;<%=KS.C_C(RS("tid"),1)%></td>
 </tr>
  <tr class="tdbg">
   <td  height="25" align="right" class="clefttitle"><strong>发布人账号：</strong></td>
   <td>&nbsp;<a href="/Task/UserInfo.asp?UserName=<%=Rs("Inputer")%>" target="_blank"><%=Rs("Inputer")%></a></td>
 </tr>
 <tr class="tdbg">
   <td  height="25" align="right" class="clefttitle"><strong>掌柜名称：</strong></td>
   <td>&nbsp;<%=Rs("KS_ShopName")%></td>
 </tr>
 <tr  class="tdbg" height="28">
   <td align="right" class="clefttitle"><strong>商品标题：</strong></td>
   <td>&nbsp;<%=Rs("Title")%></td>
 </tr>
 <tr  class="tdbg" height="28">
  <td align="right" class="clefttitle"><strong>商品地址：</strong></td>
  <td style="padding-left:7px;"><%=Rs("KS_ProductUrl")%></td>
  </tr>
  <tr class="tdbg" height="28">
    <td align="right" class="clefttitle"><strong>使用购物车：</strong></td>
    <td>&nbsp;<%IF KS.ChkClng(Rs("KS_ShopCartTF"))=1 Then KS.Echo "是" Else KS.Echo "否"%></td>
  </tr>
  <tr class="tdbg" height="28">
    <td align="right" class="clefttitle"><strong>使用搜索来路：</strong></td>
    <td><%
	IF Not KS.IsNul(RS("KS_LailuSearch")) Then
		Dim KS_LailuSearch: KS_LailuSearch = Split(RS("KS_LailuSearch") & "^%^","^%^")
	%><table width="98%" border="0" cellpadding="0" cellspacing="4" bgcolor="#FFFFFF">
     <tr height="28">
       <td style="text-align:right" width="30%" class="clefttitle"><strong>搜索来路类型：</strong></td>
       <td>&nbsp;<%
	If KS_LailuSearch(1)=1 Then
		KS.Echo "店铺搜索来路"
	ElseIf KS_LailuSearch(1)=2 Then
		KS.Echo "宝贝搜索来路"
	ElseIf KS_LailuSearch(1)=3 Then
		KS.Echo "买家信用评价页面来路"
	ElseIf KS_LailuSearch(1)=4 Then
		KS.Echo "直通车来路"
	ElseIf KS_LailuSearch(1)=5 Then
		KS.Echo "指定网站来路"
	End If
  %></td>
     </tr>
     <tr height="28">
     <%
	If KS_LailuSearch(1)=1 Then
		KS.Echo "   <td align=""right"" class=""clefttitle""><strong>搜索店铺关键字：</strong></td>"
	ElseIf KS_LailuSearch(1)=2 Or KS_LailuSearch(1)=4 Then
		KS.Echo "   <td align=""right"" class=""clefttitle""><strong>搜索宝贝关键字：</strong></td>"
	ElseIf KS_LailuSearch(1)=3 Then
		KS.Echo "   <td align=""right"" class=""clefttitle""><strong>买家信用评价地址：</strong></td>"
	ElseIf KS_LailuSearch(1)=5 Then
		KS.Echo "   <td align=""right"" class=""clefttitle""><strong>网站地址：</strong></td>"
	End If
  %>
  <td>&nbsp;<%=KS_LailuSearch(2)%></td>
     </tr>
     <tr height="28">
     <%
	If KS_LailuSearch(1)=3 Then
		KS.Echo "   <td align=""right"" class=""clefttitle""><strong>来路提示：</strong></td>"
	ElseIf KS_LailuSearch(1)=5 Then
		KS.Echo "   <td align=""right"" class=""clefttitle""><strong>链接位置提示：</strong></td>"
	Else
		KS.Echo "   <td align=""right"" class=""clefttitle""><strong>搜索提示：</strong></td>"
	End If
  %>
       <td>&nbsp;<%=KS_LailuSearch(3)%></td>
     </tr>
	<% IF Not KS.IsNul(KS_LailuSearch(4)) Then %>
     <tr class="tdbg" height="28">
       <td align="right" class="clefttitle"><strong>宝贝链接位置截图：</strong></td>
       <td class="orange">&nbsp;<%
            KS.Echo "<a href=""" & KS_LailuSearch(4) & """ target=""_blank"" title=""点击在新窗口查看图片""><img src=""" & KS_LailuSearch(4) & """ border=""0"" onload=""if(this.width>350){this.width='350';}""></a>"
       %></td>
     </tr>
     <% End If %>
	</table>
	<%
	Else
		KS.Echo "&nbsp;否"
	End If
    %></td>
  </tr>
  <tr class="tdbg" height="28">
  	<td align="right" class="clefttitle"><strong>支付方式：</strong></td>
  	<td style="color:red">&nbsp;<%
	If KS.ChkClng(Rs("KS_PayType")) = 1 Then
		KS.Echo "接手方支付"
	ElseIf KS.ChkClng(Rs("KS_PayType")) = 2 Then
		KS.Echo "红包支付"
	ElseIf KS.ChkClng(Rs("KS_PayType")) = 3 Then
		KS.Echo "发布方代付"
	End If
	%> </td>
  </tr>
  <tr class="tdbg" height="28">
  	<td align="right" class="clefttitle"><strong>任务担保价格：</strong></td>
  	<td>&nbsp;￥<%=Rs("KS_Price")%>元 </td>
  </tr>
  <tr class="tdbg" height="28">
  	<td align="right" class="clefttitle"><strong>基本发布点：</strong></td>
    <td>&nbsp;<%=Rs("KS_Point")%>点</td>
  </tr>
  <tr class="tdbg" height="28">
  	<td align="right" class="clefttitle"><strong>追加竞价发布点：</strong></td>
  	<td>&nbsp;<%If rs("KS_AddPoint")>0 Then KS.Echo KS.GetN(rs("KS_AddPoint"),2) &"点" Else KS.Echo "否"%></td>
  </tr>
  <tr class="tdbg" height="28">
  	<td align="right" class="clefttitle"><strong>是否需要改价：</strong></td>
  	<td>&nbsp;<%IF KS.ChkClng(Rs("KS_ModPriceTF"))=1 Then KS.Echo "是" Else KS.Echo "否"%></td>
  </tr>
  <tr class="tdbg" height="28">
  	<td align="right" class="clefttitle"><strong>任务类型：</strong></td>
    <td>&nbsp;<%
	IF KS.ChkClng(Rs("KS_XuShiTF"))=1 Then
		KS.Echo "实物商品"
	ElseIF KS.ChkClng(Rs("KS_XuShiTF"))=2 Then
		KS.Echo "搭配套餐"
	Else
		KS.Echo "虚拟商品"
	End If%></td>
  </tr>
  <tr class="tdbg" height="28">
  	<td align="right" class="clefttitle"><strong>好评要求时限：</strong></td>
    <td>&nbsp;<%
	IF KS.ChkClng(Rs("KS_HaoPingLimit"))=1 Then
		KS.Echo "马上好评"
	ElseIF KS.ChkClng(Rs("KS_HaoPingLimit"))=2 Then
		KS.Echo "30分钟后好评"
	ElseIF KS.ChkClng(Rs("KS_HaoPingLimit"))=3 Then
		KS.Echo "1天后好评"
	ElseIF KS.ChkClng(Rs("KS_HaoPingLimit"))=4 Then
		KS.Echo "2天后好评"
	ElseIF KS.ChkClng(Rs("KS_HaoPingLimit"))=5 Then
		KS.Echo "3天后好评"
	ElseIF KS.ChkClng(Rs("KS_HaoPingLimit"))=6 Then
		KS.Echo "4天后好评"
	ElseIF KS.ChkClng(Rs("KS_HaoPingLimit"))=7 Then
		KS.Echo "5天后好评"
	ElseIF KS.ChkClng(Rs("KS_HaoPingLimit"))=8 Then
		KS.Echo "6天后好评"
	ElseIF KS.ChkClng(Rs("KS_HaoPingLimit"))=9 Then
		KS.Echo "7天后好评"
	End IF%></td>
  </tr>
  <tr class="tdbg" height="28">
  	<td align="right" class="clefttitle"><strong>指定好评内容：</strong></td>
    <td>&nbsp;<textarea style="width:350px;height:50px" rows="4" class="textbox" name="KS_HaoPingContent" id="KS_HaoPingContent"><%= Rs("KS_HaoPingContent") %></textarea></td>
  </tr>
  <tr class="tdbg" height="28">
  	<td width="19%" align="right" class="clefttitle"><strong>平台留言提醒：</strong></td>
    <td>&nbsp;<textarea style="width:350px;height:50px" rows="4" class="textbox" name="KS_MessageRemind" id="KS_MessageRemind"><%= Rs("KS_MessageRemind") %></textarea></td>
  </tr>
  <tr class="tdbg" height="28">
  	<td align="right" class="clefttitle"><strong>商铺动态评分：</strong></td>
    <td>&nbsp;<%if Rs("KS_ShopDynamic")=0 then KS.Echo "全部不打分" Else KS.Echo "全部5分"%></td>
  </tr>
  <tr>
  	<td colspan="2" height="28" align="center" bgcolor="#EEF1F1" ><strong><font color="#0000FF">任务增值功能区</font></strong></td>
  </tr>
  <% IF KS.ChkClng(Rs("KS_CollectTF"))=1 Then %>
  <tr class="tdbg" height="28">
  	<td align="right" class="clefttitle red"><strong>店铺和宝贝双收藏：</strong></td>
    <td>&nbsp;是</td>
  </tr>
  <% End IF %>
  <% IF Not KS.IsNul(Rs("KS_ModAddress")) Then %>
  <tr class="tdbg" height="28">
  	<td align="right" class="clefttitle red"><strong>指定收货地址：</strong></td>
    <td>&nbsp;<input type="text" style="width:350px;height:21px; line-height:21px; border:1px #CCC solid;" name="KS_ModAddress" id="KS_ModAddress" maxlength="200" value="<%=Rs("KS_ModAddress")%>" /></td>
  </tr>
  <% End IF %>
  <% IF KS.ChkClng(Rs("KS_RealNameType")) > 0 Then %>
  <tr class="tdbg" height="28">
  	<td align="right" class="clefttitle red"><strong>实名认证买号：</strong></td>
    <td>&nbsp;<%IF KS.ChkClng(Rs("KS_RealNameType")) =1 Then KS.Echo "普通实名认证买号" Else KS.Echo "掌柜号（开店铺的账号）"%></td>
  </tr>
  <% End IF %>
  <% IF KS.ChkClng(Rs("KS_ShangBao")) = 1 Then %>
  <tr class="tdbg" height="28">
  	<td align="right" class="clefttitle red"><img src="/style/images/ShangBao.gif" width="20" height="20" align="absmiddle" /> <strong>商家保障：</strong></td>
    <td>&nbsp;是</td>
  </tr>
  <% End IF %>
  
  <tr class="tdbg" height="28">
	<td align="right" class="clefttitle"><strong><font color="#FF6600">仅允许某地区接手：</font></strong></td>

	<td>&nbsp;<%
	if KS.IsNul(Rs("Province")) And KS.IsNul(Rs("City")) then
		KS.Echo "否"
	else
		if Not KS.IsNul(Rs("Province")) then KS.Echo Rs("Province")
		if Not KS.IsNul(Rs("City")) then KS.Echo Rs("City")
	end if
	%></td>
  </tr>
  <tr class="tdbg" height="28">
  	<td align="right" class="clefttitle"><strong>限制不重复接手：</strong></td>
    <td>&nbsp;<%if Rs("KS_LimitBuy")=1 then KS.Echo "是" Else KS.Echo "否"%></td>
  </tr>
  <tr class="tdbg" height="28">
  	<td align="right" class="clefttitle"><strong>需要旺旺聊天：</strong></td>
    <td>&nbsp;<%if Rs("KS_ChatTF")=1 then KS.Echo "是" Else KS.Echo "否"%></td>
  </tr>
  <tr class="tdbg" height="28">
  	<td align="right" class="clefttitle"><strong>审核接手人：</strong></td>
    <td>&nbsp;<%if KS.ChkClng(Rs("KS_Verific"))=1 then KS.Echo "是" Else KS.Echo "否"%></td>
  </tr>
  <tr class="tdbg" height="28">
    <td align="right" class="clefttitle"><strong>基础过虑：</strong></td>
    <td>
    <%IF Not KS.IsNul(RS("KS_BaseFilter")) Then
		Dim BaseFilter: BaseFilter = Split(RS("KS_BaseFilter"), ",")
		Dim isBaseFilter(3),KS_BaseFilter(3)
		For i=0 to Ubound(BaseFilter)
			isBaseFilter(i+1)	= Split(BaseFilter(i), "|")(0)
			KS_BaseFilter(i+1)	= Split(BaseFilter(i), "|")(1)
		Next
	  End IF
	%>
    <table width="100%" border="0" cellpadding="4" cellspacing="0">
    <%if isBaseFilter(1)=1 then %>
  	<tr>
    <td width="26"><input name="isBaseFilter1" type="checkbox" id="isBaseFilter1" value="1" title="勾上才启用"<%if isBaseFilter(1)=1 then Response.Write " checked='checked'"%> /></td>
    <td width="160">接手人积分不低于：</td>
    <td width="190"><input type="radio" name="KS_BaseFilter1"  value="50"<%if KS_BaseFilter(1)=50 then Response.Write " checked='checked'"%> />
            50　 
              <input type="radio" name="KS_BaseFilter1" value="200"<%if KS_BaseFilter(1)=200 then Response.Write " checked='checked'"%> />
            200&nbsp;　<input type="radio" name="KS_BaseFilter1" value="400"<%if KS_BaseFilter(1)=400 then Response.Write " checked='checked'"%> />
            400</td>
 	</tr>
    <%
	End IF
	if isBaseFilter(2)=1 then
	%>
  	<tr>
    <td><input name="isBaseFilter2" type="checkbox" id="isBaseFilter2" value="1" title="勾上才启用"<%if isBaseFilter(2)=1 then Response.Write " checked='checked'"%> /></td>
    <td>接手人信用满意度不低于：</td>
    <td><input name="KS_BaseFilter2" type="radio" value="100"<%if KS_BaseFilter(2)=100 then Response.Write " checked='checked'"%> />
      100% <input name="KS_BaseFilter2" type="radio" value="95"<%if KS_BaseFilter(2)=95 then Response.Write " checked='checked'"%> />
      95%&nbsp;&nbsp; <input name="KS_BaseFilter2" type="radio" value="90"<%if KS_BaseFilter(2)=90 then Response.Write " checked='checked'"%> />
      90%</td>
  </tr>
  <% 
	End IF
	if isBaseFilter(3)=1 then
	%>
  <tr>
    <td><input name="isBaseFilter3" type="checkbox" id="isBaseFilter3" value="1" title="勾上才启用"<%if isBaseFilter(3)=1 then Response.Write " checked='checked'"%> /></td>
    <td>接手人被拉黑名单数不大于：</td>
    <td><input type="radio" name="KS_BaseFilter3" value="0"<%if KS_BaseFilter(3)="0" then Response.Write " checked='checked'"%> />
      0　　<input type="radio" name="KS_BaseFilter3" value="3"<%if KS_BaseFilter(3)="3" then Response.Write " checked='checked'"%> />
      3　　&nbsp;<input type="radio" name="KS_BaseFilter3" value="10"<%if KS_BaseFilter(3)="10" then Response.Write " checked='checked'"%> />
      10</td>
    </tr>
    <% End IF %>
	</table>
	</td>
  </tr>
  <tr class="tdbg" height="28">
 	 <td align="right" class="clefttitle"><strong><font color="#FF6600">指定任务接手人：</font></strong></td>
  	<td>&nbsp;<%if Not KS.IsNul(Rs("KS_LimitUserName")) then KS.Echo Rs("KS_LimitUserName") Else KS.Echo "否"%></td>
  </tr>
</table>

<table width="100%" border="0" align="center" cellpadding="1" cellspacing="1">
  <tr>
  	<td colspan="2" height="28" align="center" bgcolor="#EEF1F1" ><strong><font color="#0000FF">任务交易记录</font></strong></td>
  </tr>
  <tr class="tdbg">
  	<td width="22%" height="25" align="right" class="clefttitle"><strong><span>任务发布时间：</span></strong></td>
  	<td width="78%">&nbsp;<%=RS("AddDate")%></td>
  </tr>
  <% IF Not KS.IsNul(Rs("KS_BuyDate")) Then %>
  <tr class="tdbg">
  	<td height="25" align="right" class="clefttitle"><strong>任务接手时间：</strong></td>
  	<td>&nbsp;<%=Rs("KS_BuyDate")%> &nbsp; 接手人账号：<a href="/Task/UserInfo.asp?UserName=<%=Rs("KS_BuyUserName")%>" target="_blank"><%=Rs("KS_BuyUserName")%></a> &nbsp; 接手买号：<%=Rs("KS_BuyShopName")%></td>
  </tr>
  <% End IF %>
  <% IF Not KS.IsNul(Rs("KS_PayDate")) Then %>
  <tr class="tdbg">
  	<td height="25" align="right" class="clefttitle"><strong>任务支付时间：</strong></td>
  	<td>&nbsp;<%=Rs("KS_PayDate")%></td>
  </tr>
  <% End IF %>
  <% IF Not KS.IsNul(Rs("KS_DeliveryDate")) Then %>
  <tr class="tdbg">
  	<td height="25" align="right" class="clefttitle"><strong>任务发货时间：</strong></td>
  	<td>&nbsp;<%=Rs("KS_DeliveryDate")%></td>
  </tr>
  <% End IF %>
  <% IF Not KS.IsNul(Rs("KS_HaoPingDate")) Then %>
  <tr class="tdbg">
  	<td height="25" align="right" class="clefttitle"><strong>任务收货好评时间：</strong></td>
  	<td>&nbsp;<%=Rs("KS_HaoPingDate")%></td>
  </tr>
  <% End IF %>
  <% IF Not KS.IsNul(Rs("KS_EndDate")) Then %>
  <tr class="tdbg">
  	<td height="25" align="right" class="clefttitle"><strong>任务确认审核时间：</strong></td>
  	<td>&nbsp;<%=Rs("KS_EndDate")%></td>
  </tr>
  <% End IF %>
  <% IF Not KS.IsNul(Rs("KS_CreditDate")) Then %>
  <tr class="tdbg">
  	<td height="25" align="right" class="clefttitle"><strong>发布方平台评价时间：</strong></td>
  	<td>&nbsp;<%=Rs("KS_CreditDate")%></td>
  </tr>
  <% End IF %>
  <% IF Not KS.IsNul(Rs("KS_BuyCreditDate")) Then %>
  <tr class="tdbg">
  	<td height="25" align="right" class="clefttitle"><strong>接手方平台评价时间：</strong></td>
  	<td>&nbsp;<%=Rs("KS_BuyCreditDate")%></td>
  </tr>
  <% End IF %>
  <tr class="tdbg">
  	<td height="25" align="right" class="clefttitle"><strong>任务当前状态：</strong></td>
  	<td style="color:red">&nbsp;<%
	Select Case KS.ChkClng(Rs("KS_Status"))
		case 0
				KS.Echo "等待接手"
		case 1
			IF KS.IsNul(Rs("KS_BuyShopName")) Then
				KS.Echo "等待绑定买号"
			Else
				KS.Echo "等待支付"
			End If
		case 2
			KS.Echo "等待发货"
		case 3
			KS.Echo "等待收货"
		case 4
			KS.Echo "等待审核"
		case 5
			KS.Echo "已完成"
			If KS.IsNul(Rs("KS_CreditDate")) And KS.IsNul(Rs("KS_BuyCreditDate")) Then
				KS.Echo ",等待双方平台评价"
			Else
				If KS.IsNul(Rs("KS_CreditDate")) Then 		KS.Echo ",等待发布方平台评价"
				If KS.IsNul(Rs("KS_BuyCreditDate")) Then	KS.Echo ",等待接手方平台评价"
			End IF
	End Select
	if KS.ChkClng(Rs("ks_LockTF"))=1 then KS.echo "<span style=""color:blue;font-weight:bold""> | 已锁</span>"
	if KS.ChkClng(Rs("ks_PauseTF"))=1 then KS.echo "<span style=""color:blue;font-weight:bold""> | 已暂停</span>"
	%></td>
  </tr>
  <tr>
  	<td colspan="2" height="40" align="center" bgcolor="#EEF1F1" ><input name="submit2" type="button" value=" 关闭窗口 " class='button' onclick="parent.closeWindow();" /></td>
  </tr>
</table>

</body>
</html>
<%
	Else
		KS.AlertHistory "传送的ID有误或该任务已被删除！","-1"
	End If
End If
End Sub

Function ks_haopinglimit(HaoPingLimit,ShopDynamic,HaoPingContent)
	Dim Val,Val2,Val3,str,str2,str3
	Val = KS.ChkClng(HaoPingLimit)
	Val2 = KS.ChkClng(ShopDynamic)
	Val3 = KS.R(HaoPingContent)
	If Not KS.IsNul(Val3) Then str3 = "带字"
	If Val2 = 5 Then str2 = "和店评5分"
	If Val = 1 Then
		str = "<span title=""立即确认收货" & str3 & "好评"& str2 &""">立即确认</span>"
	ElseIF Val =2 Then
		str = "<span title=""30分钟后确认收货" & str3 & "好评"& str2 &""">30分钟好评</span>"
	ElseIF Val =3 Then
		str = "<span title=""1天后确认收货" & str3 & "好评"& str2 &""">1天好评</span>"
	ElseIF Val =4 Then
		str = "<span title=""2天后确认收货" & str3 & "好评"& str2 &""">2天好评</span>"
	ElseIF Val =5 Then
		str = "<span title=""3天后确认收货" & str3 & "好评"& str2 &""">3天好评</span>"
	ElseIF Val =6 Then
		str = "<span title=""4天后确认收货" & str3 & "好评"& str2 &""">4天好评</span>"
	ElseIF Val =7 Then
		str = "<span title=""5天后确认收货" & str3 & "好评"& str2 &""">5天好评</span>"
	ElseIF Val =8 Then
		str = "<span title=""6天后确认收货" & str3 & "好评"& str2 &""">6天好评</span>"
	ElseIF Val =9 Then
		str = "<span title=""7天后确认收货" & str3 & "好评"& str2 &""">7天好评</span>"
	Else
		str = "联系发布方"
	End If
	ks_haopinglimit = str
End Function

Sub DoDel()
Dim RSObj, ID
ID=KS.G("ID")
IF KS.CheckOuterUrl()=False Then
	If ID <> "" Then
		Set RSObj = Server.CreateObject("Adodb.Recordset")
		RSObj.Open "Select ID,Inputer,KS_TaskID,KS_TotalPrice,KS_TotalPoint,KS_PayType From KS_U_sxyrw Where ID IN("& ID & ")", Conn, 1, 3
		If Not RSObj.Eof Then
			Do While Not(RSObj.Eof)
				If KS.ChkClng(KS.G("Rebate")) = 1 Then
					If KS.ChkClng(RSObj("KS_PayType")) = 1 Then
						Call KS.MoneyInOrOut(RSObj("Inputer"),"",RSObj("KS_TotalPrice"),4,1,Now,0,"系统","删除任务退还担保金，任务编号：" & RSObj("KS_TaskID"),113,RSObj("ID"),0)
					End If
					Call KS.PointInOrOut(113,RSObj("ID"),RSObj("Inputer"),1,RSObj("KS_TotalPoint"),"系统","删除任务退还发布点，任务编号：" & RSObj("KS_TaskID"),1)
					'下面一条为删除任务扣除10个积分，考虑到后台任务删除一般多数任务是管理员或自己发布的，所以默认不启用,如需要请自行开启，把前面的注释'号去掉即可
					'Call KS.ScoreInOrOut(RSObj("Inputer"),2,10,"系统","删除任务扣除的积分",113,RSObj("ID"))
					Conn.Execute("UPDate KS_User Set KS_FaBuTaskCount = KS_FaBuTaskCount - 1 Where UserName='" & RSObj("Inputer") & "'")
				End If
				'Conn.Execute("DELETE FROM KS_U_sxyrw WHERE ID=" & RSObj("ID"))
				RSObj.Delete
				RSObj.MoveNext
			Loop
		End If
		RSObj.Close
		Set RSObj = Nothing		
		KS.AlertHintScript("任务删除成功！")
	Else
		KS.AlertHintScript("提交参数有误！")
	End If
End If
End Sub

Sub DoMod()
Dim ID: ID=KS.G("ID")
IF KS.CheckOuterUrl()=False Then
	Dim StatusID : StatusID = KS.S("Status")
	If ID <> "" And StatusID <> "" Then
		Select Case KS.ChkClng(StatusID)
		Case 0
				Conn.Execute("Update KS_U_sxyrw Set KS_BuyUserName=Null, KS_BuyShopName=Null, KS_BuyDate=Null, KS_PayDate=Null, KS_DeliveryDate=Null, KS_HaoPingDate=Null, KS_EndDate=Null, KS_CreditDate=Null, KS_BuyCreditDate=Null, KS_BuyUserIP=Null, KS_Status=0 Where ID In("& ID& ")")
				KS.AlertHintScript("设为未接手成功！")
		Case 1
				Dim BuyUserName: BuyUserName = KS.S("BuyUserName")
				Dim BuyShopName: BuyShopName = KS.S("BuyShopName")
				IF Not KS.IsNul(BuyUserName) And Not KS.IsNul(BuyShopName) Then
					Conn.Execute("Update KS_U_sxyrw Set KS_BuyUserName='" & BuyUserName & "', KS_BuyShopName='" & BuyShopName & "', KS_BuyDate=" & SqlNowString & ", KS_BuyUserIP='" & KS.GetIP() & "', KS_Status=1 Where ID In("& ID& ")")
				Else
					KS.AlertHintScript("接手人账号或买号不能为空！")
				End IF
				KS.AlertHintScript("设为已接手成功！")
		Case 2
				Conn.Execute("Update KS_U_sxyrw Set KS_PayDate=" & SqlNowString & ",  KS_Status=2 Where ID In("& ID& ")")
				KS.AlertHintScript("设为已支付成功！")
		Case 3
				Conn.Execute("Update KS_U_sxyrw Set KS_DeliveryDate=" & SqlNowString & ", KS_Status=3 Where ID In("& ID& ")")
				KS.AlertHintScript("设为已发货成功！")
		Case 4
				Conn.Execute("Update KS_U_sxyrw Set KS_HaoPingDate=" & SqlNowString & ", KS_Status=4 Where ID In("& ID& ")")
				KS.AlertHintScript("设为已收货成功！")
		Case 5
				Conn.Execute("Update KS_U_sxyrw Set KS_EndDate=" & SqlNowString & ", KS_Status=5 Where ID In("& ID& ")")
				KS.AlertHintScript("设为已审核成功！")
		Case 55
				Dim Rs: Set Rs = Conn.Execute("Select ID,Inputer,KS_TaskID,KS_Price,KS_Point,KS_BuyUserName,KS_BuyShopName,KS_PayType From KS_U_sxyrw Where KS_Status<>5 And KS_BuyUserName IS Not Null And ID In("& ID & ")")
				IF Not Rs.Eof Then
				Dim Point,Content
				Do While Not Rs.Eof
					If KS.ChkClng(Rs("KS_PayType")) = 1 Then
						Call KS.MoneyInOrOut(Rs("KS_BuyUserName"),Rs("KS_BuyShopName"),Rs("KS_Price"),4,1,Now,0,"系统","完成任务获得担保金,任务编号：" & Rs("KS_TaskID"),113,Rs("ID"),0)
					End If
					Point = Round(Rs("KS_Point") * JieShou_ReturnPoint,2)
					Call KS.PointInOrOut(113,Rs("ID"),Rs("KS_BuyUserName"),1,Point,"系统","完成任务获得发布点,任务编号：" & Rs("KS_TaskID"),1)
					Content = "尊敬的用户：<br>任务编号为：" & Rs("KS_TaskID") &" 的发布方已经审核并放款。<br>任务金额："& Rs("KS_Price") &"元<br>发布点："& Rs("KS_Point") &"点"
					If JieShou_ReturnPoint < 1 Then Content = Content & "<br>同时扣除"& (1 - JieShou_ReturnPoint) * 100 &"%发布点作为对平台的推广发展基金，感谢您！"
					Call KS.SendInfo(Rs("KS_BuyUserName"),RS("Inputer"),"任务编号为：" & Rs("KS_TaskID") &" 的发布方已经审核并放款",Content)
					Conn.Execute("UPDate MaiMaiUser Set CurrentXinYu = CurrentXinYu + 1 Where UserName='" & Rs("KS_BuyUserName") & "' And ShopName='" & Rs("KS_BuyShopName") & "'")	'接手方平台买号信誉值+1
					Conn.Execute("Update KS_U_sxyrw Set KS_EndDate=" & SqlNowString & ", KS_Status=5 Where ID=" & RS("ID"))
					Rs.MoveNext
				Loop
				End If
				Set Rs=Nothing
				KS.AlertHintScript("设为已审核并放款成功！")
				
		Case 100
				Conn.Execute("Update KS_U_sxyrw Set KS_CreditDate="& SqlNowString &", KS_BuyCreditDate="& SqlNowString &" Where ID In("& ID& ")")
				KS.AlertHintScript("设为互相好评成功！")
		Case 101
				Conn.Execute("Update KS_U_sxyrw Set KS_LockTF=1 Where ID In("& ID& ")")
				KS.AlertHintScript("任务锁定成功！")
		Case 102
				Conn.Execute("Update KS_U_sxyrw Set KS_LockTF=0 Where ID In("& ID& ")")
				KS.AlertHintScript("解锁成功！")
		Case 103
				Conn.Execute("Update KS_U_sxyrw Set KS_PauseTF=1 Where ID In("& ID& ")")
				KS.AlertHintScript("任务暂停成功！")
		Case 104
				Conn.Execute("Update KS_U_sxyrw Set KS_PauseTF=0 Where ID In("& ID& ")")
				KS.AlertHintScript("解暂成功！")
		End Select
	Else
		KS.AlertHintScript("请选择任务ID再提交！")
	End If
End If
End Sub

End Class
%> 
