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

Class TaskTemplate
	Private HSK
	Private KS,KSUser
	Private ComeUrl,LoginTF,Action
	
	Private Sub Class_Initialize()
		Set KS = New PublicCls
		Set KSUser = New UserCls
		Set HSK = CreateObject("ASP_AiCaiBa.AiCaiBa")
		Set HSK = HSK.AiCaiBa (TaskConfig,1006)
	End Sub
	
	Private Sub Class_Terminate()
		Call CloseConn()
		Set KS=Nothing
		Set KSUser=Nothing
		HSK.Class_Terminate()
		Set HSK=Nothing
	End Sub
	
	Public Sub Run()
		Dim I
		ComeUrl=Request.ServerVariables("HTTP_REFERER")
		LoginTF=Cbool(KSUser.UserLoginChecked)
		IF LoginTF=false  Then
		  GCls.ComeUrl=ComeUrl	'GCls.GetUrl()
		  Response.Redirect("/user/login/")
		  Exit Sub
		End If
		Call HSK.Main()
%>
<!--#include file="Template/head.html"-->
<script type="text/javascript" src="/style/js/common_def.js"></script>
<script type="text/javascript" src="/style/js/task_def.js"></script>
<script type="text/javascript">
function ViewSearchDetail(ID,UserType)
{
  new KesionPopup("#fff",4,true,"font-size:12px;background:url(/style/images/w_b_2.gif) #1B76B7 0 -4px;color:#20537A;height:22px;").popupIframe('&nbsp; 搜索来路设置浏览','SearchLaiLuDetail.asp?ID=' + ID + '&UserType=' + UserType,550,310,'auto')
}
function ViewDetail(ID)
{
  new KesionPopup("#fff",4,true,"font-size:12px;background:url(/style/images/w_b_2.gif) #1B76B7 0 -4px;color:#20537A;height:22px;").popupIframe('&nbsp; 任务详细浏览','TaskDetail.asp?ID=' + ID,600,480,'auto')
}
function checkmsg()
{
 var message=escape($("#message").val());
 var username=escape($("#username").val());
 if (username==''){
  alert('参数传递出错!');
  closeWindow();
 }
 if (message==''){
   alert('请输入消息内容!');
   $("#message").focus();
   return false;
 }
 $.get("../plus/ajaxs.asp",{action:"SendMsg",username:username,message:message},function(r){
   r=unescape(r);
   if (r!='success'){
	alert(r);
   }else{
	 alert('恭喜，您的消息已发送!');
	 closeWindow();
   }
 });
}
function sendMsg(ev,username)
{
new KesionPopup().popupTips("<img src='../images/user/mail.gif' align='absmiddle'> 发送消息","对方登录后可以看到您的消息(可输入255个字符)<br /><textarea name='message' id='message' style='width:340px;height:80px'></textarea><div style='text-align:center;margin:10px'><input type='button' onclick='return(checkmsg())' value=' 确 定 ' class='button'><input type='hidden' value="+username+" name='username' id='username'> <input type='button' value=' 取 消 ' onclick='closeWindow()' class='button'></div>",354,350)
}
function check()
{

var message=escape($("#message").val());
var username=escape($("#username").val());
if (username==''){
alert('参数传递出错!');
closeWindow();
}
if (message==''){
alert('请输入附言!');
$("#message").focus();
return false;
}
$.get("../plus/ajaxs.asp",{action:"AddFriend",username:username,message:message},function(r){
r=unescape(r);
if (r!='success'){
alert(r);
}else{
 alert('您的请求已发送,请等待对方的确认!');
 closeWindow();
}
});
}
function addF(ev,username)
{ 
show(ev,username);
var isMyFriend=false;
$.get("../plus/ajaxs.asp",{action:"CheckMyFriend",username:escape(username)},function(b){
  if (b=='true'){
  closeWindow();
  alert('用户['+username+']已经是您的好友了！');
  return false;
 }else if(b=='verify'){
  closeWindow();
  alert('您已邀请过['+username+'],请等待对方的认证!');
  return false;
 }else{
   show(ev,username);
 }
});

}
function show(ev,username)
{
new KesionPopup().popupTips("<img src='../images/user/log/106.gif'> 添加好友","通过对方验证才能成为好友(可输入255个字符)<br /><textarea name='message' id='message' style='width:340px;height:80px'></textarea><div style='text-align:center;margin:10px'><input type='button' onclick='return(check())' value=' 确 定 ' class='button'><input type='hidden' value="+username+" name='username' id='username'> <input type='button' value=' 取 消 ' onclick='closeWindow()' class='button'></div>",354,350);
}		 
</script>
<style type="text/css">
.center_tbl td {border-bottom:1px solid #E0F0FF; line-height:22px; height:70px; 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 .center{
	border: 1px solid #c7e5fa;
	margin: 0 10px 10px 10px;
	padding:10px; background:url(/style/images/fa.gif) #FFF 10px center no-repeat; 
	padding-left: 85px;
}
</style>

<!-- 任务列表 start -->
<div class="clear"></div>
  <div class="task_content"> 
	<!-- 任务列表 -->
	<div class="taskHall">
	  <ul class="task_tab">
        <li><a href="AddTask.asp"><span>发布任务</span></a></li>
        <li id="tab_m1" class="current"><a href="TaskFaBu.asp"><span>已发布任务</span></a></li>
        <li><a href="TaskJieShou.asp"><span>已接手任务</span></a></li>
        <li><a href="BinDing.asp"><span>绑定买卖号</span></a></li>
        <li><a href="TaskTemplate.asp"><span>任务模板</span></a></li>
        <li><a href="../user/User_Express_Buy.asp"><span>购买空包</span></a></li>
      </ul>
      <div class="clear"></div>

		<!-- 模板列表 -->

<div class="Template_Tips">
    <div class="center">
      <span class="orange">已发任务：</span><br />
1. 在已发布任务区，您可以查看和操作所有自己发布的任务及接手操作进度；<br />
2. 点击下面任务区筛选及链接【所有任务】【虚拟任务】【等待接手任务】【等待支付任务】等等，可以快速筛选出您想要查看的相应已发布任务。
	</div>
</div>

<ul class="screening" style="border-top: 1px solid #ACDAFF; margin-top: 10px;">
        <li>任务区筛选：
		  <select name="orderby" style="MARGIN-Right: 10px; VERTICAL-ALIGN: middle;" onChange="javascript:if(this.value)window.location.href=this.value"> 
		<%=HSK.TopMenu%>
		</select>
        <span class="orderSub">
        <%=HSK.FieldMenu%>
        </span>
        <img src="/style/images/task_reflesh.gif" align="absmiddle" style="cursor:pointer;" onClick="location.reload();" title="刷新本页面">
        </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="160">任务编号</th>
        <th width="90">掌柜号</th>
        <th width="100">商品标题/地址</th>
        <th width="60">任务价格</th>
        <th width="52">发布点</th>
        <th width="72">发布时间</th>
        <th width="150">接手人信息</th>
        <th>任务状态/备注</th>
        <th width="74">操作</th>
        </tr>
        </table>
        <div class="list_tbl">
		<% HSK.TaskList() %>
        </div>
       </div>
    </div>

<!-- 任务列表结束 -->
</div>
<%
'============================================================================
' 读取 等待支付 等待发货 等待收货与好评 等待我审核  状态下有多少条任务
Dim Status4:Status4 = KS.ChkClng(Conn.Execute("Select Count(ID) From KS_U_sxyrw Where Inputer='" & KSUser.UserName & "' And KS_Status=1")(0))
IF Status4 > 0 Then	KS.Echo "<script>$('#Status4').html('(" & Status4 & ")');</script>"
Dim Status5:Status5 = KS.ChkClng(Conn.Execute("Select Count(ID) From KS_U_sxyrw Where Inputer='" & KSUser.UserName & "' And KS_Status=2")(0))
IF Status5 > 0 Then	KS.Echo "<script>$('#Status5').html('(" & Status5 & ")');</script>"
Dim Status6:Status6 = KS.ChkClng(Conn.Execute("Select Count(ID) From KS_U_sxyrw Where Inputer='" & KSUser.UserName & "' And KS_Status=3")(0))
IF Status6 > 0 Then	KS.Echo "<script>$('#Status6').html('(" & Status6 & ")');</script>"
Dim Status7:Status7 = KS.ChkClng(Conn.Execute("Select Count(ID) From KS_U_sxyrw Where Inputer='" & KSUser.UserName & "' And KS_Status=4")(0))
IF Status7 > 0 Then	KS.Echo "<script>$('#Status7').html('(" & Status7 & ")');</script>"
%>
<!--#include file="Template/foot.html"-->
<%
End Sub

End Class
%>