<!--#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"-->
<%
'*********************************************
'软件名称：博科企业网站内容管理系统（BOKECMS）
'软件开发：博科网络科技工作室
'网   址：http://www.bokew.net
'服务QQ：530051328
'服务邮箱：bbfhq@163.com
'微信公众号：bokewlkj
'*********************************************
%>
<%
dim Result
Result = request.QueryString("Result")
dim ID, BigPic, linkurl, State, SlideName
ID = request.QueryString("ID")
Call SlideEdit()
%>
<!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="<%=Bokecms_Lang_Copyright(13)%>">
<meta name="author" content="<%=Bokecms_Lang_Copyright(3)%>">
<title><%=Bokecms_Lang_Copyright(1)%> <%=Soft_Version%></title>
<!--#Include file="BokeCMS_Css.Asp"-->
<link rel="stylesheet" href="../KindEditor/themes/default/default.css" />
<script charset="utf-8" src="../KindEditor/kindeditor.js"></script>
<script charset="utf-8" src="../KindEditor/lang/zh_CN.js"></script>
<script>
KindEditor.ready(function(K) {
    var editor = K.editor({
        uploadJson : '../KindEditor/asp/upload_json.asp?action=slides',
        fileManagerJson : '../KindEditor/asp/file_manager_json.asp?action=slides',
        allowFileManager : true/*图片空间开关*/
    });

    K('#imageBig').click(function() {
        editor.loadPlugin('image', function() {
            editor.plugin.imageDialog({
                showRemote : true,/*网络图片开关*/
                imageUrl : K('#BigPic').val(),
                clickFn : function(url, title, width, height, border, align) {
                    K('#BigPic').val(url);
                    editor.hideDialog();
                }
            });
        });
    });
	K('#imageSmall').click(function() {
        editor.loadPlugin('image', function() {
            editor.plugin.imageDialog({
                showRemote : true,/*网络图片开关*/
                imageUrl : K('#linkurl').val(),
                clickFn : function(url, title, width, height, border, align) {
                    K('#linkurl').val(url);
                    editor.hideDialog();
                }
            });
        });
    });
});
</script>
</head>
<body>
<!--#Include file="BokeCMS_Top.Asp"-->
<!--#Include file="BokeCMS_Meun.Asp"-->
<div id="wrap">
	<%
	If InStr(CompanyAdminPurview, "|16,") = 0 Then
		response.Write ("<br /><br /><div style='height:100%; text-align:center' class='main'><font style=""color:red; font-size:14px;"")>"&Bokecms_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> <%=Bokecms_Lang_Copyright(14)%></li>
                <li><%=Bokecms_Lang_Copyright(2)%></li>
                <li class="active">幻灯片管理</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="ShortCut1" href="BokeCMS_Funct_SlideEdit.Asp?Result=Add">  
                            <i class="fa fa-edit"></i>
                            <div class="title">添加幻灯片</div>
                        </a>					
                        <a class="ShortCut2" href="BokeCMS_Funct_Slide.Asp">  
                            <i class="fa fa-film"></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">
                        <h2><i class="fa fa-gears"></i><span class="break"></span><strong><%If Result = "Add" then%>添加<%ElseIf Result = "Modify" then%>修改<%End If%>幻灯片</strong></h2>
                    </div>
                    <div class="panel-body">
                    <form name="editForm" method="post" action="BokeCMS_Funct_SlideEdit.Asp?Action=SaveEdit&Result=<%=Result%>&ID=<%=ID%>" class="form-horizontal">
                        <div class="form-group">
                            <label class="col-md-2 control-label" for="text-input">幻灯片名称：</label>
                            <div class="col-md-4">
                                <input name="SlideName" type="text" id="SlideName" class="form-control" value="<%=SlideName%>">
                                 <span class="help-block"></span>
                            </div>
                        </div> 
                        <div class="form-group">
                            <label class="col-md-2 control-label" for="text-input">图片路径：</label>
                            <div class="col-md-4">
                            	<div class="input-group">
                                    <input type="text" id="BigPic" name="BigPic" class="form-control" value="<%=BigPic%>" readonly>
                                    <span class="input-group-btn">
                                    <button type="button" id="imageBig" class="btn btn-default">上传图片</button>
                                    </span>
                                </div>
                                <span class="help-block">图片规格为1200*300</span>
                            </div>
                        </div> 
                        <div class="form-group">
                            <label class="col-md-2 control-label" for="text-input">链接网址：</label>
                            <div class="col-md-4">
                            	
                                    <input type="text" id="linkurl" name="linkurl" class="form-control" value="<%=linkurl%>">
                                
                                <span class="help-block">网址前面必须带http://</span>
                            </div>
                        </div>      
                        <div class="form-group">
                            <label class="col-md-2 control-label" for="text-input">幻灯片排序：</label>
                            <div class="col-md-2">
                                <input name="State" type="text" id="State" class="form-control" value="<%=State%>" onKeyDown="OnKeyDown()" onchange="OnChange(this, <%=State%>)" />
                                 <span class="help-block"></span>
                            </div>
                        </div>
                        <div class="form-group">
                            <div class="col-md-2 control-label"></div>
                            <div class="col-md-10">
                                <input name="submitSaveEdit" type="submit" id="submitSaveEdit" class="btn btn-danger btn-lg" value="保存幻灯片">
                                <input type="button" class="btn btn-danger btn-lg" value="<%=Bokecms_Lang_System(32)%>" onClick="history.back(-1)">
                            </div>	 
                        </div>	
                    </form>
                    </div>
                </div>		
            </div>
        </div>
    </div>
    <!-- end: Content -->
	<!--#Include file="BokeCMS_End.Asp"-->				
</div>
<!--#Include file="BokeCMS_Js.Asp"-->
</body>
</html>

<%
sub SlideEdit()
dim Action, rs, sql
Action = request.QueryString("Action")
if Action = "SaveEdit" then
    set rs = server.createobject("adodb.recordset")
    if request.Form("linkurl") = "" then
		Call SweetAlert("warning", "友情提示", "请填写前台显示的图片地址！", "false", "history.back(-1)")
		response.end
    end if
    if Result = "Add" then
		sql = "select * from BokeCMS_Slide"
		rs.open sql,conn,1,3
		rs.addnew
		rs("SlideName") = trim(Request.Form("SlideName"))
		rs("linkurl") = trim(Request.Form("linkurl"))
		
			rs("BigPic") = trim(Request.Form("BigPic"))	
		
		rs("State") = trim(Request.Form("State"))
	end if
	if Result = "Modify" then
		sql = "select * from BokeCMS_Slide where ID="&ID
		rs.open sql,conn,1,3
		rs("SlideName") = trim(Request.Form("SlideName"))
		rs("linkurl") = trim(Request.Form("linkurl"))
		
			rs("BigPic") = trim(Request.Form("BigPic"))	
		
		rs("State") = trim(Request.Form("State"))
	 end if
	rs.update
	rs.close : set rs = nothing
	Call SweetAlert("success", "操作成功", "幻灯片设置成功！", "false", "location.replace('BokeCMS_Funct_Slide.Asp')")
else
	if Result="Modify" then
		set rs = server.createobject("adodb.recordset")
		sql="select * from BokeCMS_Slide where ID="& ID
		rs.open sql,conn,1,1
		BigPic = rs("BigPic")
		linkurl = rs("linkurl")
		State = rs("State")
		SlideName = rs("SlideName")
		rs.close : set rs = nothing
	else
		State = 10
	end if
end if
end sub
%>