<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>添加文件</title>
<link type="text/css" rel="stylesheet" href="../Css/style.css" />
<script language="javascript" type="text/javascript" src="../jQuery/lib/jquery.js"></script>
<script language="javascript" type="text/javascript" src="../js/WebSite.js"></script>
<script language="javascript" type="text/javascript" src="../js/ChkForm.js"></script>

</head>
<!--#include file="../inc/conn.asp"-->
<!--#include file="../inc/Function.asp"-->
<!--#include file="../FCKeditor/fckeditor.asp" -->
<!--#include file="../../inc/Config.asp"-->
<body>
<%
Call ChkLogin(session("WebAdminsUserName"))
Call ConnectionDataBase(2)

id=0
SortID=1
Act = Request.QueryString("Act")
IF Act = "Edit" Then
	id = Request.QueryString("id")
	Call ChkIsNumber(id,"参数类型错误!")
	Sql = "SELECT TOP 1 * FROM T_Ads WHERE ID=" & id
	SetRs Rs,Sql,conn,1,1
	IF Not Rs.EOF Then
		FileName = Rs("FileName")
		FilePath = Rs("FilePath")
		CID = Rs("ClassID")		
		SortID = Rs("SortID")
		Url = Rs("Url")	
	End IF
End IF
%>
<form action="Submit.asp" method="post" name="frm" style="margin:0" onsubmit="return ChkSubmitFiles();">
<input type="hidden" name="action" value="AddFiles" />
<input type="hidden" name="ID" value="<%=id%>" />
<table width="100%" border="0" cellspacing="0" cellpadding="0">  
  <tr>
    <td width="15%" align="right">广告分类：</td>
    <td width="85%" align="left">
    <select name="FileCategory" id="FileCategory">    
    <%
	For i=0 To UBOUND(AdsClass)
    %>
    <option value="<%=AdsClass(i,0)%>" <%IF Cstr(AdsClass(i,0))=Cstr(CID) Then Response.Write "Selected"%>><%=AdsClass(i,1)%></option>
	<%
	Next
    %>
    </select>
    </td>
  </tr>
  <tr>
    <td width="15%" align="right">广告名称：</td>
    <td width="85%" align="left"><input type="text" name="FileName" id="FileName" class="txt" value="<%=FileName%>" /></td>
  </tr>
  <tr>
    <td width="15%" align="right">图片上传：</td>
    <td width="85%" align="left">
    <input type="text" name="UpFiles" id="UpFiles" class="txt" value="<%=FilePath%>" />
    <input type="button" value="添加文件" class="btn2" onClick="window.open('../Public/UpLoad.asp?formname=frm&EditName=UpFiles&filepath=Ads&fileType=gif,jpg,png','','status=no,scrollbars=no,top=20,left=110,width=420,height=165')"> 建议上传比例:165px * 50px,只能上传gif,jpg,png格式的图片
    </td>
  </tr>  
  <tr>
    <td width="15%" align="right">排序号：</td>
    <td width="85%" align="left"><input type="text" name="SortID" id="SortID" class="txt" value="<%=SortID%>" onkeyup="value=value.replace(/[^\d]/g,'')" onbeforepaste="clipboardData.setData('text',clipboardData.getData('text').replace(/[^\d]/g,''))"/> 数字越大,排位越靠前</td>
  </tr>
  <tr>
    <td align="right">广告链接：</td>
    <td align="left"><input type="text" name="Url" id="Url" class="txt" value="<%=Url%>" /></td>
  </tr>
  <tr>
    <td align="right">&nbsp;</td>
    <td align="left"><input type="submit" class="btn" value="提交" /><input type="reset" class="btn" value="重置"></td>
  </tr>  
</table>
</form>
</body>
</html>
