<!--#include file="../inc/config.asp"-->
<!--#include file="../inc/conn.asp"-->
<!-- #include file="inc/Session.asp" -->
<!-- #include file="inc/checkrole.asp" -->
<!-- #include file="inc/function.asp" -->
<HTML>
<HEAD>
<TITLE>创建JS文件</TITLE>
<META http-equiv=Content-Type content="text/html; charset=gb2312">
<style>
body,td,input,textarea {font-size:9pt}
body {
	margin-left: 0px;
	margin-top: 0px;
	margin-right: 0px;
	margin-bottom: 0px;
}
.style1 {
	color: #FFFFFF;
	font-weight: bold;
}
</style>

</HEAD>
<BODY>
<%
'''''''''''''''''''''''''''''''''''''''''''''''
call checkPrevilege(Session("Name"),"p15")
'''''''''''''''''''''''''''''''''''''''''''''''
%>
<table width="100%"  border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td><iframe src="right_top.htm" frameborder="0" scrolling="no" marginheight="0" marginwidth="0" height="30" width="100%"></iframe></td>
  </tr>
</table>
<%
dim act,jsName,content
act=request.QueryString("act")
if(act="ok") then
	jsName=trim(request.Form("jsName"))
	content=request.Form("content")
	call SaveTextFile(server.mappath("../js/freejs/"&jsName),content)
	
	response.Write("成功创建JS文件："&jsName)
	response.write("<p>广告"&id&"的调用代码为：<br><br><textarea style=""width:100%"" rows=""5"">&lt;script src="""&SiteUrl&"/js/freejs/"&jsName&"""&gt;&lt;/script&gt;</textarea></p>")
	response.write("<p>请将以上代码复制到您要插入的地方。</p>") 
	response.write("<p><a href=""#"" onClick=""javascript:history.back()""><==返 回</a></p>") 
	set fs=nothing
else	
%>
<FORM method="POST" name="form1" action="js_get.asp?act=ok" style="margin:0 0 0 0;">
  <TABLE width="100%" border="0" align="center" cellpadding="2" cellspacing="1" bgcolor="#666666">
<TR bgcolor="#FF9900">
  <TD height="22" colspan="2"><div align="center" class="style1">创建JS文件</div></TD>
  </TR>
<TR bgcolor="#F5F5F5" id="objLink">
  <TD width="18%"><div align="center">JS文件名：</div></TD>
  <TD width="82%"><div align="left">
  	<%
	dim randN,nameStr
  	Randomize timer
	randN=cint(8999*Rnd+1000)
	nameStr=day(now)&randN&".js"
	%>
    <input name="jsName" type="text" id="jsName" size="60" value="<%=nameStr%>">
    <br>
  (要生成的JS文件名,系统已为你自动生成一个随机的数字，你也可以自己定义)</div>
</TR>
<TR bgcolor="#F5F5F5" id="textContent">
	<TD><div align="center">JS文件内容：</div></TD>
	<TD>		
		<textarea rows="12" name="content" cols="70">内容...</textarea>
		<br>
		此处输入你的JS代码		
</TR>
<TR bgcolor="#F5F5F5">
	<TD align=right>&nbsp;	  </TD>
    <TD align=right><div align="left">	
        <input type=submit name=b1 value="提 交">&nbsp;&nbsp;
        <input type=reset name=b2 value="重 填">       
    </div></TD>
</TR>
</TABLE>
</FORM>
<%
end if
%>
</BODY>
</HTML>
<%
call connclose()
%>