<!--#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"-->
<!--#include file="../Generate/SC_Config.Asp"-->
<!--#include file="../Generate/SC_Function.Asp"-->
<!--#include file="../Generate/SC_About.Asp"-->
<!--#include file="../Generate/SC_Index.Asp"-->
<%
'*********************************************
'软件名称：博科企业网站内容管理系统（BOKECMS）
'软件开发：博科网络科技工作室
'网    址：http://www.bokew.net
'服务  QQ：530051328
'服务邮箱：bbfhq@163.com
'微信公众号：bokewlkj
'*********************************************
%>
<%
Dim Result
Result = request.QueryString("Result")
Dim ID, AboutName, ClassSeo, ViewFlag, MobileFlag, Content, SeoKeywords, SeoDescription, Origin,Sequence
ID = request.QueryString("ID")
Call AboutEdit()
%>
<!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"-->
<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.create('textarea[name="Content"]', {
		cssPath : '../KindEditor/plugins/code/prettify.css',
		uploadJson : '../KindEditor/asp/upload_json.asp?action=about',
		fileManagerJson : '../KindEditor/asp/file_manager_json.asp',
		allowFileManager : true,
		afterBlur : function() {
			this.sync();
			K.ctrl(document, 13, function() {
				K('form[name=example]')[0].submit();
			});
			K.ctrl(this.edit.doc, 13, function() {
				K('form[name=example]')[0].submit();
			});
		}
	});
	prettyPrint();
});
</script>
</head>

<body>
<!--#Include file="BokeCMS_Top.Asp"-->
<!--#Include file="BokeCMS_Meun.Asp"-->
<div id="wrap">
	<%
	If InStr(CompanyAdminPurview, "|1,") = 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_AboutEdit.Asp?Result=Add">  
                            <i class="fa fa-sign-in"></i>
                            <div class="title">添加企业信息</div>
                        </a>					
                        <a class="ShortCut2" href="BokeCMS_Funct_About.Asp">  
                            <i class="fa fa-list"></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="?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="AboutName" type="text" id="AboutName" class="form-control" value="<%=AboutName%>">
                                <label class="checkbox-inline" for="ViewFlag">
                                    <input type="checkbox" id="ViewFlag" name="ViewFlag" value="1" <%If Result = "Add" then response.write ("checked")%><%if ViewFlag then response.write ("checked")%>> PC显示
                                </label>
                                <%If mStatus Then%>
                                <label class="checkbox-inline" for="MobileFlag">
                                    <input type="checkbox" id="MobileFlag" name="MobileFlag" value="1" <%If Result = "Add" then response.write ("checked")%><%if MobileFlag then response.write ("checked")%>> 手机显示
                                </label>
                                <%End If%>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-md-2 control-label" for="text-input">静态文件名：</label>
                            <div class="col-md-4">
								<%if Result = "Add" then%>
                                <input name="ClassSeo" type="text" id="ClassSeo" class="form-control">
                                <div class="radio">
                                    <label class="radio-inline" for="oAutopinyin_1">
                                        <input name="oAutopinyin" type="radio" id="oAutopinyin_1" value="1" checked="checked"> 自动生成系统默认静态文件名<font color="red">（已填写“静态文件名”则该功能无效）</font>
                                    </label>
                                </div>
                                <%If ClassSeoISPY = True Then%>
                                <div class="radio">
                                    <label class="radio-inline" for="oAutopinyin_2">
                                        <input name="oAutopinyin" type="radio" id="oAutopinyin_2" value="2"> 将标题转换为拼音<font color="red">（已填写“静态文件名”则该功能无效）</font>
                                    </label>
                                </div>
                                <%End If%>
                                <%elseif Result = "Modify" then%>
                                <input type="text" value="<%= ClassSeo %>" class="form-control" readonly>
                                <%end if%>
                                <span class="help-block"></span>
                            </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-6">
                                <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-6">
                                <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" for="text-input">信息内容：</label>
                            <div class="col-md-10">
                                <textarea name="Content" class="form-control" style="width:95%;height:400px;visibility:hidden;"><%=Server.HTMLEncode(Content)%></textarea>							
								<input type="checkbox" name="T_SaveImg" value="1" /> 保存内容中网络图片到本地
                                <span class="help-block"></span>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-md-2 control-label">信息来源：</label>
                            <div class="col-md-5">  
                                <input name="Origin" type="text"  value="<%=Origin%>" class="form-control" maxlength="100">
                                <a href="javascript:" onClick="document.editForm.Origin.value='网络转载'">网络转载</a> &nbsp; | &nbsp; 
                                <a href="javascript:" onClick="document.editForm.Origin.value='<%=ComName%>'"><%=ComName%></a> 
                                <span class="help-block"></span>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-md-2 control-label">排序：</label>
                            <div class="col-md-3">
                                <input name="Sequence" type="text" id="Sequence" class="form-control" value="<%=Sequence%>" onKeyDown="OnKeyDown()" onchange="OnChange(this, <%=Sequence%>)">
                                <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 AboutEdit()
    Dim Action, rsCheckAdd, rs, sql
    Action = request.QueryString("Action")
    If Action = "SaveEdit" Then
        Set rs = server.CreateObject("adodb.recordset")
        If Len(Trim(request.Form("AboutName")))<1 Then
			Call SweetAlert("warning", "友情提示", "请填写信息标题！", "false", "history.back(-1)")
            response.End
        End If
        If Trim(request.Form("Content")) = "" Then
			Call SweetAlert("warning", "友情提示", "请填写信息内容！", "false", "history.back(-1)")
            response.End
		End If
	    If Trim(request.Form("Origin")) = "" Then
		Call SweetAlert("warning", "友情提示", "请填写信息来源！", "false", "history.back(-1)")
		    response.End
	    End If        

        If Result = "Add" Then
            sql = "select * from BokeCMS_About"
            rs.Open sql, conn, 1, 3
            rs.addnew
			rs("AboutName")=trim(Request.Form("AboutName"))
			If Request.Form("ClassSeo") = "" then
				If Request.Form("oAutopinyin") = "1" then rs("ClassSeo") = TimeToName()
				If Request.Form("oAutopinyin") = "2" then rs("ClassSeo") = Left(Pinyin(trim(request.form("AboutName"))),200)
			Else
				rs("ClassSeo") = trim(Request.form("ClassSeo"))
			End If
            rs("AboutName") = Trim(Request.Form("AboutName"))
            If Request.Form("ViewFlag") = 1 Then
                rs("ViewFlag") = Request.Form("ViewFlag")
            Else
                rs("ViewFlag") = 0
            End If
            If Request.Form("MobileFlag") = 1 Then
                rs("MobileFlag") = Request.Form("ViewFlag")
            Else
                rs("MobileFlag") = 0
            End If
			rs("SeoKeywords") = trim(Request.Form("SeoKeywords"))
			rs("SeoDescription") = trim(Request.Form("SeoDescription"))
            rs("Content") = RTrim(Request.Form("Content"))
			rs("Origin") = trim(Request.Form("Origin"))
			rs("Sequence") = trim(Request.Form("Sequence"))
            rs("AddTime") = Now()
            rs("UpdateTime") = Now()
            rs.update
			rs.close : set rs = nothing
		  
			set rs = server.createobject("adodb.recordset")
            sql = "select top 1 ID,ClassSeo from BokeCMS_About order by ID desc"
            rs.Open sql, conn, 1, 1
            ID = rs("ID")
			rs.close : set rs = nothing
            
			Call Html_To_About(ID, "PC")
			If mStatus Then Call Html_To_About(ID, "Mobile")
		    Call html_To_Index("Index", "PC")'生成PC首页
		    If mStatus Then Call html_To_Index("Index", "Mobile")'生成WAP首页
        End If
        If Result = "Modify" Then
            sql = "select * from BokeCMS_About where ID="&ID
            rs.Open sql, conn, 1, 3
            rs("AboutName") = Trim(Request.Form("AboutName"))
            If Request.Form("ViewFlag") = 1 Then
                rs("ViewFlag") = Request.Form("ViewFlag")
            Else
                rs("ViewFlag") = 0
            End If
            If Request.Form("MobileFlag") = 1 Then
                rs("MobileFlag") = Request.Form("ViewFlag")
            Else
                rs("MobileFlag") = 0
            End If
			rs("SeoKeywords") = trim(Request.Form("SeoKeywords"))
			rs("SeoDescription") = trim(Request.Form("SeoDescription"))
            rs("Content") = Request.Form("Content")
			rs("Origin") = trim(Request.Form("Origin"))
			rs("Sequence") = trim(Request.Form("Sequence"))
            rs("UpdateTime") = Now()
	  		ID = rs("ID")
            rs.update
			rs.close : set rs = nothing
					
			Call Html_To_About(ID, "PC")
			If mStatus Then Call Html_To_About(ID, "Mobile")
		    Call html_To_Index("Index", "PC")'生成PC首页
		    If mStatus Then Call html_To_Index("Index", "Mobile")'生成WAP首页
        End If
		
'==========================保存远程图片和添加水印开始===================================
Dim AspJpeg,T_SaveImg,T_UploadDir '建立变量
AspJpeg=Request.Form("AspJpeg")
T_SaveImg=Request.Form("T_SaveImg")
if T_SaveImg="" then T_SaveImg=0
if T_SaveImg=1 then'保存远程图片
T_UploadDir=""&SysRootDir&"UploadFile/About/"
content=ReplaceRemoteUrl(content,T_UploadDir,AspJpeg)
else
content=content
end If
'==========================保存远程图片、添加水印结束========bokew.net==============
	
    Call SweetAlert("success", "操作成功", "已生成本记录详细页和网站首页，请在“生成静态”中批量生成案例模块栏目及分类页！", "false", "location.replace('BokeCMS_Funct_About.Asp')")
    Else
        If Result = "Modify" Then
            Set rs = server.CreateObject("adodb.recordset")
            sql = "select * from BokeCMS_About where ID="& ID
            rs.Open sql, conn, 1, 1
            AboutName = rs("AboutName")
            ViewFlag = rs("ViewFlag")
            MobileFlag = rs("MobileFlag")
	        ClassSeo=rs("ClassSeo")&Separated&rs("ID")
            Content = rs("Content")
			SeoKeywords = rs("SeoKeywords")
			SeoDescription = rs("SeoDescription")
			Origin = rs("Origin")
			Sequence = rs("Sequence")
			rs.close : set rs = nothing
		Else
			Sequence = 99
        End If
    End If
End Sub
%>