<% Option Explicit %>
<!--#include file="../../Inc/Const.asp" -->
<!--#include file="../../Inc/Cls_DB.asp" -->
<!--#include file="../../Inc/Function.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"),"P099") then Call ReturnError()
%>
<html>
<head>
<link href="../Inc/ModeWindow.css" rel="stylesheet" type="text/css">
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>添加插件</title>
</head>

<body leftmargin="0" topmargin="0">
<form action="" method="post" name="PlusForm">
<table width="100%"  border="0" cellspacing="5" cellpadding="0">
  <tr>
    <td width="7%">&nbsp;</td>
    <td width="19%">&nbsp;</td>
    <td width="74%">&nbsp;</td>
  </tr>
  <tr>
    <td>&nbsp;</td>
    <td>插件名称</td>
    <td><input name="Name" type="text" id="Name" style="width:90%" value="<%=Request("Name")%>"></td>
  </tr>
  <tr>
    <td>&nbsp;</td>
    <td>链接地址</td>
    <td><input name="Link" type="text" id="Link" style="width:90%" value="<%=Request("Link")%>"></td>
  </tr>
  <tr>
    <td>&nbsp;</td>
    <td>打开方式</td>
    <td><input name="OpenType" type="radio" value="1" <%If Request("OpenType")<>"0" then Response.Write("checked") end if%>>
      新窗口
        <input type="radio" name="OpenType" value="0" <%If Request("OpenType")="0" then Response.Write("checked") end if%>>
      原窗口</td>
  </tr>
  <tr>
    <td>&nbsp;</td>
    <td>是否显示</td>
    <td><input name="ShowTF" type="radio" value="1" <%If Request("ShowTF")<>"0" then Response.Write("checked") end if%>>
      显&nbsp;&nbsp;示
        <input type="radio" name="ShowTF" value="0" <%If Request("ShowTF")="0" then Response.Write("checked") end if%>>
      隐&nbsp;&nbsp;藏</td>
  </tr>
  <tr>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
  </tr>
  <tr>
    <td colspan="3"><div align="center">
      <input type="submit" name="Submit" value=" 添 加 ">
      <input name="action" type="hidden" id="action" value="add">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
      <input type="button" name="Submit2" value=" 取 消 " onClick="window.close();">
    </div></td>
  </tr>
</table>
</form>
</body>
</html>
<%
   if Request.Form("action") = "add" then
      Dim PlusAddObj,PlusAddSql
	  if Request.Form("Name") = "" or isnull(Request.Form("Name")) then
	  	 Response.Write("<script>alert(""请输入插件名称"");</script>")
		 Response.End
	  end if
	  if Request.Form("Link") = "" or isnull(Request.Form("Link")) then
	  	 Response.Write("<script>alert(""请输入插件链接地址"");</script>")
		 Response.End
	  end if
	  Set PlusAddObj = Server.CreateObject("Adodb.RecordSet")
	  	  PlusAddSql = "Select * from Plus where 1=0"
		  PlusAddObj.Open PlusAddSql,Conn,3,3
		  PlusAddObj.AddNew
		  PlusAddObj("Name") = Replace(Replace(Request.Form("Name"),"""",""),"'","")
		  PlusAddObj("Link") = Request.Form("Link")
		  if Request.Form("OpenType") = "1" then
			  PlusAddObj("OpenType") = "1"
		  else
			  PlusAddObj("OpenType") = "0"
		  end if
		  if Request.Form("ShowTF") = "1" then
			  PlusAddObj("ShowTF") = "1"
		  else
			  PlusAddObj("ShowTF") = "0"
		  end if
		  PlusAddObj("AddTime") = Now()
		  PlusAddObj.Update
		  PlusAddObj.Close
		  Set PlusAddObj = Nothing
		  Response.Write("<script>alert(""插件添加成功"");dialogArguments.location.reload();window.close();</script>")
		  Response.End
   end if
Conn.Close
Set Conn = Nothing
%>