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

Class TaskTemplate
	Private KS,KSUser,ChannelID,ID,ClassID,RS
	Private ComeUrl,Selbutton,LoginTF,ReadPoint,Action
	Private Sub Class_Initialize()
		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()
		ComeUrl=Request.ServerVariables("HTTP_REFERER")
		LoginTF=Cbool(KSUser.UserLoginChecked)
		IF LoginTF=false  Then
		  GCls.ComeUrl=GCls.GetUrl()
		  Response.Redirect("/user/login/")
		  Exit Sub
		End If
		Action=KS.FilterIllegalChar(KS.LoseHtml(KS.S("Action")))
		Select Case Action
		 Case "Del" Call DoDel()
		 Case Else  Call Template()
		End Select
	End Sub
	
	Sub Template()
%>
<!--#include file="Template/head.html"-->
<style type="text/css">
.center_tbl td {border-bottom:1px solid #E5F5FF; line-height:24px; height:26px; 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;
	margin-bottom:10px;
}
.Template_Tips .center{
	border: 1px solid #c7e5fa;
	margin: 0 10px 10px 10px;
	padding:10px; background:url(/style/images/kuai.gif) #FFF 10px center no-repeat; 
	padding-left: 85px;
}
</style>

<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><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 id="tab_m1" class="current"><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">任务模板流程：发布任务时保存为模板 &gt;&gt; 下次发同样或类似的任务 &gt;&gt; 选择【从任务模板中创建】快速创建！</span><br />
      1.平台的任务模板是为了方便刷客们发布重复的任务而设计的一项实用功能；<br />
      2.在发布任务时，可以选择是否将该次发布的任务保存为任务模板；<br />
      3.如果您已经保存了任务模板，这次发布相同的任务就可以选择&ldquo;从任务模板中创建&rdquo;，为您省时省力，方便快捷！ </div>
</div>

<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="50">序号</th>
        <th width="70">所有任务区</th>
        <th width="105">模板名称</th>
        <th width="100">掌柜名</th>
        <th width="">商品网址</th>
        <th width="60">价格</th>
        <th width="60">发布点</th>
        <th width="70">好评时限</th>
        <th width="90">添加时间</th>
        <th width="120">操作</th>
        </tr>
        </table>
		<table class="list_tbl" border="0" cellSpacing="0" cellPadding="4" width="100%">
<%   Dim RStpl:	Set RStpl=Server.CreateObject("ADODB.RECORDSET")
		 RStpl.Open "Select * From TaskTemplate Where Inputer='" & KSUser.UserName & "'",Conn,1,1
	 	 If Not RStpl.Eof Then
		 	 Dim i: i = 1
			 Do While Not(RStpl.Eof) %>
			<tr>
              <td width="50" align="center"><%=i%></td>
              <td width="70" align="center"><%=KS.C_C(RStpl("tid"),1)%></td>
			  <td width="105" align="center"><%=RStpl("TemplateName")%></td>
			  <td width="100" align="center"><%=RStpl("KS_ShopName")%></td>
			  <td width="" align="center"><%=RStpl("KS_ProductUrl")%></td>
              <td width="60" align="center"><%=RStpl("KS_Price")%> 元</td>
              <td width="60" align="center"><%=RStpl("KS_Point")%> 点</td>
              <td width="70" align="center"><%=ks_haopinglimit(RStpl("KS_HaoPingLimit"),RStpl("KS_ShopDynamic"),RStpl("KS_HaoPingContent")) %></td>
              <td width="90" align="center"><%=KS.GetTimeFormat(RStpl("AddDate"))%></td>
			  <td width="120" align="center"><a class="link_t" href="AddTask.asp?Action=Add&tplID=<%=RStpl("ID")%>">发布任务</a> <a class="link_bt_2" href="?Action=Del&ID=<%=RStpl("ID")%>" onClick="return confirm('您确定要删除吗？')">删除</a></td>
		  </tr>
		<%	 RStpl.MoveNext
             i = i + 1
			 loop
		 Else
		 	KS.Echo "<tr><td class=""border"">抱歉！您还没有保存过任务模板!</td></tr>"
	 	 End If
		 RStpl.Close
	 Set RStpl=Nothing
	 %>
		</table>
       </div>
    </div>

<!-- 模板列表结束 -->
</div>

<!--#include file="Template/foot.html"-->
<%
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

Function DoDel()
Dim ID: ID=KS.ChkClng(KS.CheckXSS(KS.R(KS.S("ID"))))
	IF IsNumeric(ID) And KS.CheckOuterUrl()=False And Action = "Del" Then
		If ID <> 0 Then
			Conn.Execute("Delete From TaskTemplate Where Inputer='" & KSUser.UserName & "' And ID=" & ID)
			KS.AlertHintScript("删除成功！")
		End If
	Else
		KS.AlertHintScript("系统提示：\n\n你提交的数据有误，如果是正常操作看到此提示，请与管理员反馈情况，谢谢！")
	End IF
End Function

End Class
%>