<%@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 rsn__mmid
rsn__mmid = "0"
If (request.querystring("n_id") <> "") Then
  rsn__mmid = request.querystring("n_id")
  else
  response.Write yns_err_null
  response.End()
End If
%>
<%
Dim rsn
Dim rsn_numRows

Set rsn = Server.CreateObject("ADODB.Recordset")
rsn.ActiveConnection = MM_conn_news_STRING
rsn.Source = "SELECT *  FROM (t_news inner join t_type on t_news.n_tid = t_type.t_id) inner join t_type_son on t_news.n_tsid = t_type_son.ts_id  WHERE n_id = " + Replace(rsn__mmid, "'", "''") + ""
rsn.CursorType = 0
rsn.CursorLocation = 2
rsn.LockType = 1
rsn.Open()

rsn_numRows = 0
%>
<%
if rsn.eof and rsn.bof then
response.Write yns_err_rseof
response.End()
end if
%>
<%

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

%>
<%

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

%>
<%
dim mm_path
mm_path =server.MapPath((rsn.Fields.Item("t_dir").Value)&"/"&(rsn.Fields.Item("ts_dir").Value)&"/"&(rsn.Fields.Item("n_fpath").Value) &"/"& (rsn.Fields.Item("n_fname").Value))
Set fso = Server.CreateObject("Scripting.FileSystemObject")
if (fso.FileExists(mm_path)) then
fso.DeleteFile(mm_path)
else
response.Write("<font color=red>文件未找到,数据库记录已经删除!</font><br>")
end if
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>湖南百润医药有限公司-------康曼德www.hnicp.com</title>
<meta http-equiv="refresh" content="2;URL=yns_nlist.asp">
</head>

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