<!--#include file="../Include/Const.Asp" -->
<!--#include file="../Include/ConnDatabase.asp" -->
<!--#include file="../Include/System_Language.asp" -->
<!--#include file="../Include/Version.Asp" -->
<!--#include file="CheckAdmin.Asp"-->
<%
'*********************************************
'软件名称：电家企业网站内容管理系统
'软件开发：电脑家园工作室
'网    址：http://www.537600.cn
'服务  QQ：530051328
'服务邮箱：bbfhq@163.com
'微信公众号：diannaojiayuan
'*********************************************
%>
<%
Call SiteInfo()
%>
<!DOCTYPE html>
<html lang="zh-cn">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="description" content="<%=DianJiaCMS_Lang_Copyright(13)%>">
<meta name="author" content="<%=DianJiaCMS_Lang_Copyright(3)%>">
<title><%=DianJiaCMS_Lang_Copyright(1)%> <%=Soft_Version%></title>
<!--#Include file="DianJiaCMS_Css.Asp"-->
</head>

<body>
<!--#Include file="DianJiaCMS_Top.Asp"-->
<!--#Include file="DianJiaCMS_Meun.Asp"-->
<div id="wrap">
	<%
	If InStr(CompanyAdminPurview, "|5,") = 0 Then
		response.Write ("<br /><br /><div style='height:100%; text-align:center' class='main'><font style=""color:red; font-size:14px;"")>"&DianJiaCMS_Lang_System(26)&"</font></div>")
		response.End
	End If
	%>
	<%
	dim Result,Keyword,SortID,SortPath
	Result = request.QueryString("Result")
	Keyword = request.QueryString("Keyword")
	SortID = request.QueryString("SortID")
	SortPath = request.QueryString("SortPath")
	%>
    <div class="main">
        <div class="row">
            <ol class="breadcrumb">
                <li><i class="fa fa-home"></i> 当前位置</li>
             	<li>功能模块</li>
                <%
				If SortPath<>"" Then
					Response.Write "<li>下载信息列表</li>"
					TextPath(SortID)
				Else
					Response.Write "<li class='active'>下载信息列表</li>"
				End If
				%>
            </ol>	
        </div>	
        <div class="row">
            <div class="col-lg-12 hideInIE8">
                <div class="panel panel-default">
                    <div class="panel-heading">
                        <h2><i class="fa fa-edit"></i><span class="break"></span><strong>下载信息管理</strong></h2> 
                    </div>
                    <div class="panel-body">
                        <a class="ShortCut1" href="DianJiaCMS_Funct_DownEdit.Asp?Result=Add">  
                            <i class="fa fa-download"></i>
                            <div class="title">添加下载</div>
                        </a>					
                        <a class="ShortCut2" href="DianJiaCMS_Funct_Download.Asp">  
                            <i class="fa fa-th-list"></i>
                            <div class="title">下载列表</div>
                        </a>	
                        <a class="ShortCut3" href="DianJiaCMS_Funct_DownSort.Asp">  
                            <i class="fa fa-table"></i>
                            <div class="title">下载分类</div>
                        </a>													
                    </div>
                </div>
            </div>
        </div>
        <div class="row">
            <div class="col-lg-12">
                <div class="panel panel-default">
                    <div data-original-title="" class="panel-heading">
                        <h2><i class="fa fa-user"></i><span class="break"></span>下载信息列表</h2>
                        
                    </div>
                    <div class="panel-body">
                        <div id="DataTables_Table_0_wrapper" class="dataTables_wrapper form-inline no-footer">
                        	<input type="hidden" name="Result" value="Download">
                            <table id="datatable" class="table table-striped table-bordered bootstrap-datatable" cellspacing="0" width="100%">
                            <thead>
                            <tr role="row">
                                <th>ID</th>
                                <th>PC显示</th>
                                <%If mStatus Then%><th>手机显示</th><%End If%>
								<th>推荐</th>
								<th>固顶</th>
                                <th>下载标题</th>
                                <th>文件大小</th>
                                <th>操作</th>
                                <th>选择</th>
            				</tr>
                            </thead>
                            <tbody>
								<%Call DownList()%>
                            </tbody>
                            </table>
                        </div>            
                    </div>
                </div>
            </div>
        </div>
    </div>
	<!--#Include file="DianJiaCMS_End.Asp"-->
</div>
<script>
$(document).ready(function(){
	var oTable = $('#datatable').dataTable();
	oTable.fnSort( [ [0,'desc'] ] );
});
</script>
<!--#Include file="DianJiaCMS_Js.Asp"-->
</body>
</html>
<%
Function DownList()
	SortID = request.QueryString("SortID")
	SortPath = request.QueryString("SortPath")
	If SortID <> "" Then where = "where instr(SortPath,'"&SortPath&"')>0"
	
	datafrom = "DianJiaCMS_Download"
	taxis = "Order by ID desc"
	sql = "select * from ["& datafrom &"] "&where&" "&taxis
	
	Set rs = server.CreateObject("adodb.recordset")
	rs.Open sql, conn, 1, 2
	do until rs.EOF
		Response.Write "<tr role='row'>" & vbCrLf
		Response.Write "<td>"&rs("ID")&"</td>" & vbCrLf
		If rs("ViewFlag") Then
			Response.Write "<td><a href='DianJiaCMS_Funct_Conversion.Asp?id="&rs("ID")&"&LX="&datafrom&"&Conver=ViewFlag&Operation=no'><img src='skin_a/img/toolbar_ok.gif' width='13' height='13'/></a></td>" & vbCrLf
		Else
			Response.Write "<td><a href='DianJiaCMS_Funct_Conversion.Asp?id="&rs("ID")&"&LX="&datafrom&"&Conver=ViewFlag&Operation=up'><img src='skin_a/img/toolbar_no.gif' width='13' height='13'/></a></td>" & vbCrLf
		End If
	If mStatus Then
		If rs("MobileFlag") Then
			Response.Write "<td><a href='DianJiaCMS_Funct_Conversion.Asp?id="&rs("ID")&"&LX="&datafrom&"&Conver=MobileFlag&Operation=no'><img src='skin_a/img/toolbar_ok.gif' width='13' height='13'/></a></td>" & vbCrLf
		Else
			Response.Write "<td><a href='DianJiaCMS_Funct_Conversion.Asp?id="&rs("ID")&"&LX="&datafrom&"&Conver=MobileFlag&Operation=up'><img src='skin_a/img/toolbar_no.gif' width='13' height='13'/></a></td>" & vbCrLf
		End If
	End If
		If rs("CommendFlag") Then
			Response.Write "<td><a href='DianJiaCMS_Funct_Conversion.Asp?id="&rs("ID")&"&LX="&datafrom&"&Operation=no&Conver=CommendFlag'><font color='blue'><strong>√</strong></font></a></td>" & vbCrLf
		Else
			Response.Write "<td><a href='DianJiaCMS_Funct_Conversion.Asp?id="&rs("ID")&"&LX="&datafrom&"&Operation=up&Conver=CommendFlag'><font color='red'><strong>×</strong></font></a></td>" & vbCrLf
		End If
		If rs("IsTop") Then
			Response.Write "<td><a href='DianJiaCMS_Funct_Conversion.Asp?id="&rs("ID")&"&LX="&datafrom&"&Operation=no&Conver=IsTop'><font color='blue'><strong>√</strong></font></a></td>" & vbCrLf
		Else
			Response.Write "<td><a href='DianJiaCMS_Funct_Conversion.Asp?id="&rs("ID")&"&LX="&datafrom&"&Operation=up&Conver=IsTop'><font color='red'><strong>×</strong></font></a></td>" & vbCrLf
		End If
		if StrLen((rs("DownName")))>40 then
			Response.Write "<td title='"&rs("DownName")&"'><a href='DianJiaCMS_Funct_DownEdit.Asp?Result=Modify&ID="&rs("ID")&"'>"&StrLeft(rs("DownName"),37)&"</a></td>" & vbCrLf
		else
			Response.Write "<td title='"&rs("DownName")&"'><a href='DianJiaCMS_Funct_DownEdit.Asp?Result=Modify&ID="&rs("ID")&"'>"&rs("DownName")&"</a></td>" & vbCrLf
		end if
	
		Response.Write "<td>"&rs("FileSize")&"M</td>" & vbCrLf
		Response.Write "<td>"
		Response.Write "<a title='查看前台页面' href='/"&DownDir&"/"&rs("ClassSeo")&Separated&rs("ID")&"."&HTMLName&"' class='btn btn-success' target='_blank'><i class='fa fa-search-plus'></i></a>"
		Response.Write "<a title='修改' href='DianJiaCMS_Funct_DownEdit.Asp?Result=Modify&ID="&rs("ID")&"' class='btn btn-info'><i class='fa fa-edit'></i></a>"
		Response.Write "<a title='删除' href='JavaScript:void(0)' class='btn btn-danger' onclick='test("&rs("ID")&", ""Download"")'><i class='fa fa-trash-o'></i></a>"
		Response.Write "</td>" & vbCrLf
		Response.Write "<td><input name='SelectID' type='checkbox' value='"&rs("ID")&"'></td>"
		Response.Write "</tr>" & vbCrLf
		rs.movenext
	loop
End Function

Function TextPath(ID)
    Dim rs, sql
    Set rs = server.CreateObject("adodb.recordset")
    sql = "Select * From DianJiaCMS_DownSort where ID="&ID
    rs.Open sql, conn, 1, 1
    TextPath = "<li class='active'>"&rs("SortName")&"</li>"
    If rs("ParentID")<>0 Then TextPath rs("ParentID")
    response.Write(TextPath)
End Function%>