<!--#include file="../utf-8.asp" -->
<!--#include file="../js/Function.asp" -->
<!--#include file="../html/yidacms_htmlurl.asp" -->
<!--#include file="../js/admin_vipkp.asp" -->
<!--#include file="../CheckAdmin.asp" -->
<!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 NAME="copyright" CONTENT="Copyright 2010-2012 - yidacms.com" />
<META NAME="Author" CONTENT="世纪伟成  yidacms.com" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link href="../js/admin.css" rel="stylesheet" type="text/css">
<title>下载配置！</title>
	<link rel="stylesheet" href="../js/reveal.css">	
	<script type="text/javascript" src="../js/jquery-1.4.4.min.js"></script>
	<script type="text/javascript" src="../js/jquery.reveal.js"></script>
</head>

<body>
<%
	set rs = server.createobject("adodb.recordset")
	sql="select * from shuaiweb_down ORDER BY id DESC"
	rs.open sql,dbok,1,1
%>

<table width="98%" border="1" cellpadding="6" cellspacing="0" bordercolor="#cccccc" style="border-collapse:collapse" bgcolor="ffffff" align="center">
            <tr>
              <td colspan="7"><a href="#" class="big-link" data-reveal-id="myModal">+ 创建</a>	
               </td>
             </tr>
<%
		if rs.bof and rs.eof then
			No_record = "暂无记录!"
				Else
		do while not rs.eof
%>
  <tr>
    <td colspan="5" height="30">&nbsp;</td>
  </tr>
  <tr>
    <td colspan="4">文档名称:<%=rs("shuaiweb_downname")%></td>
    <td rowspan="2"><a href="admin_downedit.asp?id=<%=rs("id")%>"><img src="../images/023.jpg" alt="修改"/></a> <a href="admin_down.asp?t=downdel&id=<%=rs("id")%>"><img src="../images/015.gif" alt="删除" onclick="{if(confirm('确定删除它吗?')){return true;}return false;}"/></a></td>
  </tr>
  <tr>
    <td>下载数量:<%=rs("shuaiweb_downnumber")%></td>
    <td>文档版本:<%=rs("shuaiweb_downversion")%></td>
    <td>文档大小:<%=rs("shuaiweb_downsize")%></td>
	    <td> 运行环境:<%=rs("shuaiweb_downxp")%></td>
  </tr>
  <tr>
    <td colspan="5">文档详情:<%=rs("shuaiweb_downcontent")%></td>
  </tr>

<%
		rs.MoveNext 
		loop   
		End If
		rs.Close
		set rs=nothing 
%>
<tr>
                <td colspan="7"><%=No_record%></td>
</tr>
		</table>
<%
		'版权：世纪伟成(http://yidacms.com)
		'本信息不会影响您网站的正常访问，无论免费用户或是收费用户请保留这里的信息.
		'如果您删除了这里的版权信息,将追究法律责任.

        if request("t")="down" Then
			if len(trim(request.Form("shuaiweb_downname")))<1 then
				response.write ("<script language=javascript> alert('名称必填且不能少于1个字符！');history.back(-1);</script>")
				response.end
			end if
		  
			if len(trim(request.Form("shuaiweb_downcontent")))<1 then
				response.write ("<script language=javascript> alert('内容不能为空，且不少于1个字符！');history.back(-1);</script>")
				response.end
			end if 
		  
		dim rs,sql
		set rs=server.createobject("adodb.recordset")
		sql="select * from shuaiweb_down" 
		rs.open sql,dbok,3,2
		rs.addnew 
			rs("shuaiweb_downname")=trim(request.form("shuaiweb_downname"))
			rs("shuaiweb_downversion")=trim(request.form("shuaiweb_downversion"))
			rs("shuaiweb_downsize")=trim(request.form("shuaiweb_downsize"))
			rs("shuaiweb_downxp")=trim(request.form("shuaiweb_downxp")) & trim(request.form("shuaiweb_downxp1")) &_
						trim(request.form("shuaiweb_downxp2")) & trim(request.form("shuaiweb_downxp3")) &_
						trim(request.form("shuaiweb_downxp4")) & trim(request.form("shuaiweb_downxp5")) &_
						trim(request.form("shuaiweb_downxp6"))
			rs("shuaiweb_downupload")=trim(request.form("shuaiweb_downupload"))
			rs("shuaiweb_downweb")=trim(request.form("shuaiweb_downweb"))
			rs("shuaiweb_downcontent")=trim(request.form("shuaiweb_downcontent"))
		rs.update
		rs.close
		set rs=nothing
		response.write "<script language=javascript> alert('成功添加！');location.replace('admin_down.asp');</script>"
		End If
%>
		<div id="myModal" class="reveal-modal">
		<table width="98%" height="100%" border="0"cellpadding="10" cellspacing="0" bordercolor="#666666" bgcolor="ffffff" style="border-collapse:collapse" align="center">
		   <form id="form1" name="form1" method="post" action="admin_down.asp?t=down">
			<tr>
			  <td onMouseOver="this.id='aa'" onMouseOut="this.id='bb'" class="cc">文档名称<br /><input name="shuaiweb_downname" type="text" class="win"/> <font color=red>(必填)</font>
                        </tr>
			<tr>
			  <td onMouseOver="this.id='aa'" onMouseOut="this.id='bb'" class="cc">文档版本<br /><input name="shuaiweb_downversion" type="text" class="win"/>
                        </tr>
			<tr>
			  <td onMouseOver="this.id='aa'" onMouseOut="this.id='bb'" class="cc">文档大小<br /><input name="shuaiweb_downsize" type="text" class="win"/>
                        </tr>
			<tr>
			  <td onMouseOver="this.id='aa'" onMouseOut="this.id='bb'" class="cc">运行环境<br /><input type="checkbox" name="shuaiweb_downxp" value="WinXp|" />WinXp <input type="checkbox" name="shuaiweb_downxp1" value="Vista|" />Vista <input type="checkbox" name="shuaiweb_downxp2" value="Win7|" />Win7 <input type="checkbox" name="shuaiweb_downxp3" value="Win2000|" />Win2000 <input type="checkbox" name="shuaiweb_downxp4" value="Win2003|" />Win2003 <input type="checkbox" name="shuaiweb_downxp5" value="Linux|" />Linux <input type="checkbox" name="shuaiweb_downxp6" value="Java|" />Java 
                        </tr>
			<tr>
			  <td onMouseOver="this.id='aa'" onMouseOut="this.id='bb'" class="cc"><div class="uppic">内部上传<br /><input name="shuaiweb_downupload" type="text" class="win" value="不使用内部上传，系统则自动选择外部链接~" id="yidacms_adpic"/></div><div class="uppic2"><iframe width="305" height="34" marginwidth=0 marginheight=0 hspace=0 vspace=0 frameborder=0 scrolling=no src="../../uploadclass/upload/upfile.asp?class=1&upload_class=down" allowtransparency="true" ></iframe></div>
                        </tr>
			<tr>
			  <td onMouseOver="this.id='aa'" onMouseOut="this.id='bb'" class="cc">外部链接<br /><input name="shuaiweb_downweb" type="text" class="win" value="http://"/>
                        </tr>
			<tr>
			  <td width="90%" onMouseOver="this.id='aa'" onMouseOut="this.id='bb'" class="cc">文档详情<br /><textarea name="shuaiweb_downcontent" style="width:98%;height:100px;"></textarea><font color=red>(必填)</font></td>
			</tr>
			<tr>

			  <td><input type="submit" name="Submit" value="提交" class="inanniu"/>
			  <input type="reset" name="Submit2" value="重置" class="inanniu" /></td>
			</tr>
			</form>
		</table>
<a class="close-reveal-modal">&#215;</a>
		</div>

<%
		yidacms_id = cint(Request("id"))
 		if request("t")="downdel" Then 

			set rs=server.createobject("adodb.recordset")
			sql="select * from shuaiweb_down WHERE id = "&yidacms_id&""
			rs.open sql,dbok,1,1
			htm = "../../"&rs("shuaiweb_downupload")&""
			set fso = server.createobject("scripting.FileSystemObject")
			arrFile = split(htm,",")		
			for i = 0 to ubound(arrFile)
			   if fso.FileExists(server.mappath(arrFile(i)))then
			   		fso.DeleteFile(server.mappath(arrFile(i)))
			   end if
			next

			set rs = server.createobject("adodb.recordset")
			sql="DELETE * from shuaiweb_down WHERE id = "&yidacms_id&""
			rs.open sql,dbok,3,2
			response.write "<script language=javascript> alert('成功删除！');location.replace('admin_down.asp');</script>"
			response.end
		End If 
%>
</body>
</html>
