<!--#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
'*********************************************
%>
<%
xmlErr = "<h2 class='text-center'>DianJiaCMS_Template.xml文件中文件有错误</h2>"
Result = request.QueryString("Result")%>
<!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"-->
<link rel="stylesheet" href="../KindEditor/themes/default/default.css" />
<script charset="utf-8" src="../KindEditor/kindeditor-min.js"></script>
<script charset="utf-8" src="../KindEditor/lang/zh_CN.js"></script>
<script charset="utf-8" src="../KindEditor/plugins/code/prettify.js"></script>
<script>
KindEditor.ready(function(K) {
	var editor = K.editor({
		cssPath : '../KindEditor/plugins/code/prettify.css',
		uploadJson : '../KindEditor/asp/upload_json.asp',
		fileManagerJson : '../KindEditor/asp/file_manager_json.asp',
		allowFileManager : true
	});
	K('#image').click(function() {
		editor.loadPlugin('image', function() {
			editor.plugin.imageDialog({
				imageUrl : K('#SmallPic').val(),
				clickFn : function(url, title, width, height, border, align) {
					K('#SmallPic').val(url);
					editor.hideDialog();
				}
			});
		});
	});
})
</script>
</head>
<body>
<!--#Include file="DianJiaCMS_Top.Asp"-->
<!--#Include file="DianJiaCMS_Meun.Asp"-->
<div id="wrap">
	<%
	If InStr(CompanyAdminPurview, "|25,") = 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
	%>
    <div class="main">
        <div class="row">
            <ol class="breadcrumb">
                <li><i class="fa fa-home"></i> <%=DianJiaCMS_Lang_Copyright(14)%></li>
                <li><%=DianJiaCMS_Lang_Copyright(2)%></li>
                <li class="active"><a href="">模板方案</a></li>
                <li class="active"><%If Result = "Add" then%>添加<%ElseIf Result = "Modify" then%>修改<%End If%>模板</li>
            </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="ShortCut2" href="DianJiaCMS_Template.Asp">  
                            <i class="fa fa-qrcode"></i>
                            <div class="title">模板方案</div>
                        </a>	
                        <a class="ShortCut1" href="DianJiaCMS_TemplateEdit.Asp?Result=Add">  
                            <i class="fa fa-download"></i>
                            <div class="title">添加方案</div>
                        </a>					
                        <a class="ShortCut2" href="DianJiaCMS_TemplateEdit.Asp?Result=Edit">  
                            <i class="fa fa-gear"></i>
                            <div class="title">模板修改</div>
                        </a>	
                        <a class="ShortCut3" href="DianJiaCMS_TemplateInout.Asp?Result=in">  
                            <i class="fa fa-mail-reply"></i>
                            <div class="title">模板导入</div>
                        </a>
                        <a class="ShortCut4" href="DianJiaCMS_TemplateInout.Asp?Result=out">  
                            <i class="fa fa-mail-forward "></i>
                            <div class="title">模板导出</div>
                        </a>											
                        </div>
					</div>
				</div>
			</div>
			<div class="row">
            <div class="col-md-12">
                <div class="panel panel-default">
                    <div class="panel-heading">
                        <ul class="nav tab-menu nav-tabs" id="myTab">
                            <li><a href="#PC"><%If mStatus Then%>PC<%End If%>网站模板</a></li>
                            <%If mStatus Then%><li><a href="#Mobile">手机网站模板</a></li><%End If%>
                        </ul>
                    </div>
                    <div class="panel-body">
                        <div id="myTabContent" class="tab-content">
                            <div class="tab-pane" id="PC"><%TemplateList("PC")%></div>
                            <%If mStatus Then%><div class="tab-pane" id="Mobile"><%TemplateList("Wap")%></div><%End If%>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
	<!--#Include file="DianJiaCMS_End.Asp"-->				
</div>
<!--#Include file="DianJiaCMS_Js.Asp"-->
<script>
$("select[name=SortName]").change(function(){
	SortName = $(this).children("option:selected").attr("value")
	$("#TemplatePathText").html("/Template/" + SortName + "/")
})
</script>
</body>
</html>
<%
Function TemplateList(bkkey)
set rs = server.CreateObject("adodb.recordset")
rs.open "select * from DianJiaCMS_Template where SortName='"&bkkey&"' Order by UseFlag asc",conn,1,2
if rs.eof then
	response.Write "<center>暂无模板</center>"
else
	do until rs.eof
		response.Write "<div class='TemplateDiv'>"
		response.Write "	<div class='Div1'>"
		response.Write "		<img src='"&rs("SmallPic")&"'/>"
		response.Write "		<div class='text'>"
		response.Write "			<p>作者：<a href='"&rs("WebSite")&"' target='_blank'>"&rs("Author")&"</a></p>"
		response.Write "			<p>版本："&rs("Version")&"</p>"
		response.Write "			<p>目录："&rs("TemplatePath_A")&"</p>"
		response.Write "			<p>简介："&rs("Text")&"</p>"
		response.Write "		</div>"
		response.Write "	</div>"
		response.Write "	<h2 class='text-center'><strong>"&rs("TemplateName")&"</strong></h2>"
		response.Write "	<div class='row'>"
		if not rs("UseFlag") then
			response.Write "    <div class='col-xs-5'>"
			response.Write "        <a href='DianJiaCMS_TemplateUsed.Asp?SortName="&rs("SortName")&"&ID="&rs("ID")&"' class='btn btn-success btn-block'>启用</a>"
			response.Write "    </div>"
			response.Write "    <div class='col-xs-5'>"
			Response.Write "		<a href='JavaScript:void(0)' class='btn btn-success btn-block' onclick='test_1("&rs("ID")&", ""Template"")'>卸载</a>" & vbCrLf
			response.Write "    </div>"
		else
			response.Write "	<div class='col-xs-11'>"
			response.Write "		<a class='btn btn-danger btn-block'>已启用</a>"
			response.Write "	</div>"
		end if
		response.Write "	</div>"
		response.Write "</div>"
		rs.movenext
	loop
end if
Call CloseRs(rs)
End Function%>