<% Option Explicit %>
<!--#include file="../../Inc/Const.asp" -->
<!--#include file="../../Inc/Cls_DB.asp" -->
<%
Dim DBC,Conn
Set DBC = New DataBaseClass
Set Conn = DBC.OpenConnection()
Set DBC = Nothing
%>
<!--#include file="../../Inc/Session.asp" -->
<!--#include file="../../Inc/CheckPopedom.asp" -->
<%
if Not JudgePopedomTF(Session("Name"),"P0501") then Call ReturnError1()
    dim FileID,JSDellObj,FileObj,FileSavaPath,FileName
	    if Request("FileID")<>"" then
		   FileID = Clng(Request("FileID"))
		   Set JSDellObj = Conn.Execute("select FileSavePath,FileName from SysJS where ID = "&FileID&"")
		   if JSDellObj.eof then
			 Response.Write("<script>alert(""参数传递错误"");window.close();</script>")
			 response.end
		   end if
		   FileName = JSDellObj("FileName")
		   FileSavaPath = JSDellObj("FileSavePath")
		else
		 Response.Write("<script>alert(""参数传递错误"");window.close();</script>")
		 response.end
		end if 
%>
<html>
<head>
<link href="../Inc/ModeWindow.css" rel="stylesheet" type="text/css">
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>系统JS删除</title>
</head>

<body leftmargin="0" topmargin="0">
<form action="" name="JSDellForm" method="post">
<table width="100%" border="0" cellspacing="5" cellpadding="0">
  <tr> 
    <td width="7%" height="10">&nbsp;</td>
    <td width="28%" rowspan="3"><div align="center"><img src="../Images/Question.gif" width="39" height="37"></div></td>
    <td width="59%">&nbsp;</td>
    <td width="6%" height="10">&nbsp;</td>
  </tr>
  <tr> 
    <td>&nbsp;</td>
    <td>您确定要删除此JS?</td>
    <td>&nbsp;</td>
  </tr>
  <tr>
    <td height="2">&nbsp;</td>
    <td height="2">&nbsp;</td>
    <td height="2">&nbsp;</td>
  </tr>
  <tr> 
    <td>&nbsp;</td>
    <td colspan="2"><div align="center"> 
        <input type="submit" name="Submit" value=" 确 定 ">
        <input type="hidden" name="action" value="trues">
        <input type="button" name="Submit2" value=" 取 消 " onClick="window.close();">
      </div></td>
    <td>&nbsp;</td>
  </tr>
  <tr> 
    <td height="10">&nbsp;</td>
    <td height="10" colspan="2">&nbsp;</td>
    <td height="10">&nbsp;</td>
  </tr>
</table>
</form>
</body>
</html>
<%
  if request.Form("action")="trues" then
     Conn.Execute("delete from SysJS where ID="&FileID&"")
	Set FileObj = Server.CreateObject("Scripting.FileSystemObject")
	if FileObj.FileExists(Server.MapPath("\")&FileSavaPath&"/"& FileName &".js") = True then
		FileObj.DeleteFile (Server.MapPath("\")&FileSavaPath&"/"& FileName &".js")
	end if 
	response.write("<script>dialogArguments.location.reload();window.close();</script>")
	response.end
  end if
%>