<!--#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"-->
<%
'*********************************************
'软件名称：电家企业网站内容管理系统（DianJiaCMS）
'软件开发：电脑家园工作室
'网    址：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"-->
<link rel="stylesheet" href="../KindEditor/themes/default/default.css" />

</head>

<body>
<!--#Include file="DianJiaCMS_Top.Asp"-->
<!--#Include file="DianJiaCMS_Meun.Asp"-->
<div id="wrap">
	<%
	If InStr(CompanyAdminPurview, "|7,") = 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> 当前位置</li>
                <li class="active">功能模块</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-play-circle-o"></i>
                            <div class="title">添加视频</div>
                        </a>					
                        <a class="ShortCut2" href="DianJiaCMS_Funct_video.Asp">  
                            <i class="fa fa-th-list"></i>
                            <div class="title">视频列表</div>
                        </a>	
                        <a class="ShortCut3" href="DianJiaCMS_Funct_videoSort.Asp">  
                            <i class="fa fa-sitemap"></i>
                            <div class="title">视频分类</div>
                        </a>
                        <a class="ShortCut4" href="DianJiaCMS_Funct_videoConfig.Asp">  
                            <i class="fa fa-gear"></i>
                            <div class="title">参数设置</div>
                        </a>							
                    </div>
                </div>
            </div>
        </div>
		<%
        Dim Action, FolderName
        Action = request.QueryString("Action")
        Select Case Action
			Case "Add"
				addFolder
				CallFolderView()
			Case "Del"

			Case "Save"
				saveFolder ()
			Case "Edit"
				editFolder ()
				CallFolderView()
			Case "Move"
				moveFolderForm ()
				CallFolderView()
			Case "MoveSave"
				saveMoveFolder ()
			Case Else
				CallFolderView()
        End Select
        %>
    </div>
	<!--#Include file="DianJiaCMS_End.Asp"-->
</div>

<%Function CallFolderView()%>
<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>管理视频类别 &nbsp;&nbsp;&nbsp;&nbsp; <a href="DianJiaCMS_Funct_videoSort.Asp?Action=Add&ParentID=0" class="btn btn-danger btn-sm">添加一级分类</a></h2>
			</div>
			
			<div class="panel-body">
<img src='/mfb/07.jpg'><br>
         <a href="http://www.537600.cn" target="_blank" class="nav-header" ><img src='/mfb/mfb.png' width='500' height='100'></a>
			</div>
		</div>
	</div>
</div>
<%
End Function
Function addFolderForm(ParentID)
	Dim ParentPath, SortTextPath, rs, sql
	If ParentID = 0 Then
		ParentPath = "0,"
		SortTextPath = ""
	Else
		Set rs = server.CreateObject("adodb.recordset")
		sql = "Select * From DianJiaCMS_VideoSort where ID="&ParentID
		rs.Open sql, conn, 1, 1
		ParentPath = rs("SortPath")
	End If
%>
<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 ParentID<>0 then TextPath(ParentID)%></strong></h2>
            </div>
            <div class="panel-body">
            <form name="FolderForm" method="post" action="DianJiaCMS_Funct_videoSort.Asp?Action=Save&From=Add" class="form-horizontal">
                <div class="form-group">
                    <label class="col-md-2 control-label">类别名称：</label>
                    <div class="col-md-4">
                        <input name="SortName" type="text" id="SortName" class="form-control" maxlength="100">
                        <label class="checkbox-inline" for="ViewFlag">
                            <input type="checkbox" id="ViewFlag" name="ViewFlag" value="1"> 是否生效
                        </label>                           
                    </div>
                </div> 
                <%If EnableSeo = True Then%>
                <div class="form-group">
                    <label class="col-md-2 control-label">类别关键词：</label>
                    <div class="col-md-5">
                    	<input name="SeoKeywords" type="text" id="SeoKeywords" class="form-control" maxlength="250">
                        <span class="help-block">SEO：多个关键词请用“,”半角逗号分开</span>
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-md-2 control-label">类别描述：</label>
                    <div class="col-md-5">
                    	<input name="SeoDescription" type="text" id="SeoDescription" class="form-control" maxlength="250">
                        <span class="help-block">SEO：请填写描述</span>
                    </div>
                </div>
                <%End If%>
                <div class="form-group">
                    <label class="col-md-2 control-label"></label>
                    <div class="col-md-4">
                        <label class="checkbox-inline" for="Show">
                            <input type="checkbox" id="Show" name="Show" value="1"> 添加类别图标和简介
                        </label>                           
                    </div>
                </div> 
                <div class="form-group" name="ShowFlag" style="display:none;">
                    <label class="col-md-2 control-label">类别图标：</label>
                    <div class="col-md-5">
                        <div class="input-group">
                            <input name="SmallPic" type="text" id="SmallPic" class="form-control" />
                            <span class="input-group-btn">
                            <button type="button" id="imagePic" class="btn btn-default">选择图片</button>
                            </span>
                        </div>
                        <span class="help-block"></span>
                    </div>
                </div>
                <div class="form-group" name="ShowFlag" style="display:none;">
                    <label class="col-md-2 control-label">类别简介：</label>
                    <div class="col-md-5">
                        <textarea name="Content" class="form-control"></textarea>
                        <span class="help-block"></span>
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-md-2 control-label">类别文件夹名：</label>
                    <div class="col-md-5">
                        <div class="input-group">
                            <input name="FolderName" type="text" id="FolderName" class="form-control" />
                            <span class="input-group-btn">
                            <button type="button" id="Pinyin" class="btn btn-default" onClick="GetPinyin()">类别名称转换为拼音</button>
                            </span>
                        </div>
                        <span class="help-block">输入的文件夹名不能重复（如果“名称转换为拼音”无效或出错，请手动填写）</span>
                    </div>
                </div>
                <input name="ParentID" type="hidden" id="ParentID" value="<%=ParentID%>">
                <input name="ParentPath" type="hidden" id="ParentPath" value="<%=ParentPath%>" >
                <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="保存类别">
                    </div>	
                </div>
            </form>   
            </div>
        </div>
    </div>
</div>
<%
End Function

Function editFolder()
  Dim ID

  ID=request.QueryString("ID")
  editFolderForm (ID)
end function

Function editFolderForm(ID)

%>
<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 ParentID<>0 then TextPath(ParentID)%></strong></h2>
            </div>
            <div class="panel-body">
            <form name="FolderForm" method="post" action="DianJiaCMS_Funct_videoSort.Asp?Action=Save&From=Edit&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="SortName" type="text" id="SortName" class="form-control" value="<%=SortName%>" maxlength="100">
                        <label class="checkbox-inline" for="ViewFlag">
                            <input type="checkbox" id="ViewFlag" name="ViewFlag" value="1" <%if ViewFlag then response.write ("checked")%>> 是否生效
                        </label>                           
                    </div>
                </div> 
                <%If EnableSeo = True Then%>
                <div class="form-group">
                    <label class="col-md-2 control-label" for="text-input">类别关键词：</label>
                    <div class="col-md-5">
                    	<input name="SeoKeywords" type="text" id="SeoKeywords" class="form-control" value="<%=SeoKeywords%>" maxlength="250">
                        <span class="help-block">SEO：多个关键词请用“,”半角逗号分开</span>
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-md-2 control-label" for="text-input">类别描述：</label>
                    <div class="col-md-5">
                    	<input name="SeoDescription" type="text" id="SeoDescription" class="form-control" value="<%=SeoDescription%>" maxlength="250">
                        <span class="help-block">SEO：请填写描述</span>
                    </div>
                </div>
                <%End If%>
                <div class="form-group">
                    <label class="col-md-2 control-label"></label>
                    <div class="col-md-4">
                        <label class="checkbox-inline" for="Show">
                            <input type="checkbox" id="Show" name="Show" value="1" <%If ShowFlag Then response.Write "checked"%>> 添加类别图标和简介
                        </label>                           
                    </div>
                </div>
                <div class="form-group" name="ShowFlag" <%If not ShowFlag Then response.Write "style='display:none'"%>>
                    <label class="col-md-2 control-label" for="text-input">类别图片：</label>
                    <div class="col-md-5">
                    <div class="input-group">
                        <input name="SmallPic" type="text" id="SmallPic" value="<%=SmallPic%>" class="form-control" /> 
                        <span class="input-group-btn">
                        <button type="button" id="imagePic" class="btn btn-default">选择图片</button>
                        </span>
                        </div>
                        <span class="help-block"></span>
                    </div>
                </div>
                <div class="form-group" name="ShowFlag" <%If not ShowFlag Then response.Write "style='display:none'"%>>
                    <label class="col-md-2 control-label" for="text-input">类别简介：</label>
                    <div class="col-md-5">
                        <textarea name="Content" class="form-control"><%=Content%></textarea>
                        <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-5">
                        <div class="input-group">
                            <input name="FolderName" type="text" id="FolderName" value="<%=FolderName%>" class="form-control" />
                            <span class="input-group-btn">
                            <button type="button" id="Pinyin" class="btn btn-default" onClick="GetPinyin()">类别名称转换为拼音</button>
                            </span>
                        </div>
                        <span class="help-block">输入的文件夹名不能重复（如果“名称转换为拼音”无效或出错，请手动填写）</span>
                    </div>
                </div>
                <input name="ParentID" type="hidden" id="ParentID" value="<%=ParentID%>">
                <input name="SortPath" type="hidden" id="SortPath" value="<%=SortPath%>" >
                <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="保存类别">
                    </div>	
                </div>
            </form>   
            </div>
        </div>
    </div>
</div>
<%
End Function
%>