<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>

<!--#include file="Connections/conn_news.asp" -->
<!--#include file="yns_config.asp" -->
<!--#include file="yns_chklogin.asp" -->
<% chk_user_login(3) %>
<!--#include file="yns_chkerror.asp" -->
<%
Dim rsts__MMColParam
rsts__MMColParam = "1"
If (Request.QueryString("ts_id") <> "") Then
  rsts__MMColParam = Request.QueryString("ts_id")
else
response.Write yns_err_null
response.End()
End If
%>
<%
Dim rsts
Dim rsts_numRows

Set rsts = Server.CreateObject("ADODB.Recordset")
rsts.ActiveConnection = MM_conn_news_STRING
rsts.Source = "SELECT * FROM t_type_son WHERE ts_id = " + Replace(rsts__MMColParam, "'", "''") + ""
rsts.CursorType = 0
rsts.CursorLocation = 2
rsts.LockType = 1
rsts.Open()

rsts_numRows = 0
%>
<%
If rsts.EOF And rsts.BOF Then
response.Write yns_err_rseof
response.End()
End If ' end rsts.EOF And rsts.BOF
%>
<%
dim mm_tid
mm_tid = (rsts.Fields.Item("ts_pid").Value)
%>
<%
Dim rst__MMColParam
rst__MMColParam = "1"
If (mm_tid <> "") Then
  rst__MMColParam = mm_tid
else
response.Write mm_tid
response.End()
End If
%>
<%
Dim rst
Dim rst_numRows

Set rst = Server.CreateObject("ADODB.Recordset")
rst.ActiveConnection = MM_conn_news_STRING
rst.Source = "SELECT *  FROM t_type  WHERE t_id = " + Replace(rst__MMColParam, "'", "''") + ""
rst.CursorType = 0
rst.CursorLocation = 2
rst.LockType = 1
rst.Open()

rst_numRows = 0
%>
<%
If rst.EOF And rst.BOF Then
response.Write yns_err_rseof
response.End()
End If ' end rst.EOF And rst.BOF
%>
<%
   dim fso
   dim f_path
   f_path = server.MapPath((rst.Fields.Item("t_dir").Value)&"/"&(rsts.Fields.Item("ts_dir").Value))
   Set fso = CreateObject("Scripting.FileSystemObject")
   If fso.FolderExists(f_path) then
   fso.DeleteFolder(f_path)
   else
%>
<script language=javascript>
alert( "删除文件夹失败,文件夹不存在！"  );
location.href = "javascript:history.back()"
</script>
<%
response.End()
end if
Set fso = nothing
%>
<%

if(request.querystring("ts_id") <> "") then Command1__mmid = request.querystring("ts_id")

%>
<%

if(request.querystring("ts_id") <> "") then Command2__mmid = request.querystring("ts_id")

%>
<%

if(request.querystring("ts_id") <> "") then Command3__mmid = request.querystring("ts_id")

%>
<%

set Command1 = Server.CreateObject("ADODB.Command")
Command1.ActiveConnection = MM_conn_news_STRING
Command1.CommandText = "DELETE FROM t_type_son  WHERE ts_id = " + Replace(Command1__mmid, "'", "''") + ""
Command1.CommandType = 1
Command1.CommandTimeout = 0
Command1.Prepared = true
Command1.Execute()

%>
<%

set Command2 = Server.CreateObject("ADODB.Command")
Command2.ActiveConnection = MM_conn_news_STRING
Command2.CommandText = "DELETE FROM t_news  WHERE n_tsid = " + Replace(Command2__mmid, "'", "''") + ""
Command2.CommandType = 1
Command2.CommandTimeout = 0
Command2.Prepared = true
Command2.Execute()

%>
<%

set Command3 = Server.CreateObject("ADODB.Command")
Command3.ActiveConnection = MM_conn_news_STRING
Command3.CommandText = "DELETE FROM t_review  WHERE r_tsid = " + Replace(Command3__mmid, "'", "''") + ""
Command3.CommandType = 1
Command3.CommandTimeout = 0
Command3.Prepared = true
Command3.Execute()

%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>湖南百润医药有限公司-------康曼德www.hnicp.com</title>
<meta http-equiv="refresh" content="1;URL=yns_type.asp">
</head>

<body>
删除成功,等待返回...
</body>
</html>
<%
rsts.Close()
Set rsts = Nothing
%>
<%
rst.Close()
Set rst = Nothing
%>