<!-- #include file="tjConn.asp" -->
<!-- #include file="Conn.asp" -->
<!-- #include file="admin.asp" -->
<%
Dim Conntjj,sid
sid=Request.querystring("sid")
On Error Resume Next

	
	set Conntjj=Server.CreateObject ("Adodb.Connection")
	Conntjj.Open "provider=microsoft.jet.oledb.4.0;" & "data source = " & server.mappath(""&db&"")

Call head()

IF  Request.QueryString("Action")="login" Then
	call login
else
	call index
end if



Function index
	dim rs,sql,Runtxt,id
	Runtxt=RunStr
    		id = Request("id")    
    		If id = "" Then id = 1
   		If Not IsNumeric(id) Then id = 1
    		id = CLng(id)
    		If id < 1 Then id = 1
Call saycarda("删除统计")

		set rs=Server.CreateObject("ADODB.Recordset")
		Sql = "select top 1 *  FROM qtwap_tj where id="&id&""
		rs.open sql,Conntjj,1,1
		if not (rs.eof and rs.bof) then
%>
		确定删除<%=rs("time")%>的统计吗?<br/>
    	<a href="admin_del_tj.asp?Action=login&amp;id=<%=id%>&amp;saytk=<%=saytk%>&amp;sid=<%=sid%>">确定删除</a><br/>
<%
		end if
		rs.Close
		Set rs = Nothing
%>

-------------<br/><anchor title="back"><prev/>返回上级页面</anchor><br/>
<a href='admin_tj.asp?saytk=<%=saytk%>&amp;sid=<%=sid%>'>返回统计管理</a><br/>
<a href='index.asp?saytk=<%=saytk%>&amp;sid=<%=sid%>'>后台管理首页</a><br/>

<%Call headsay()
End Function


Function login

		dim rs,sql,id,i

    		id = Request("id")    
    		If id = "" Then id = 1
   		If Not IsNumeric(id) Then id = 1
    		id = CLng(id)
    		If id < 1 Then id = 1

Call cardz("删除统计","admin_tj.asp?saytk="&saytk&"&amp;sid="&sid&"")


		set rs=Server.CreateObject("ADODB.Recordset")
		Sql = "select top 1 *  FROM qtwap_tj where id="&id&""
		rs.open sql,Conntjj,1,3
		if not (rs.eof and rs.bof) then
		rs.delete()
		end if
		rs.Close
		Set rs = Nothing

		Set Rs = Server.CreateObject("Adodb.Recordset")
		Sql = "select id from qtwap_tj_list WHERE tjid=" & id
		Rs.Open Sql,Conntjj,1,3
		if not (rs.bof and rs.eof)  then 
		For i=1 to rs.RecordCount
		rs.Delete
		Rs.MoveNext
		next
		end if
		rs.Close
		Set rs = Nothing


		%>删除统计成功!<br/>
<a href='admin_tj.asp?saytk=<%=saytk%>&amp;sid=<%=sid%>'>返回统计管理</a><br/>
<a href='index.asp?saytk=<%=saytk%>&amp;sid=<%=sid%>'>后台管理</a><br/>

<%call headsay()
end Function 
%>
