<!--#include file="../Include/conn.asp" -->
<!--#include file="../Include/ConnDatabase.asp" -->
<!--#include file="../Include/Form_board .asp"-->
<!--#include file="CheckAdmin.asp"-->
<%
'=====================================
'天天企业网站管理系统  TianTianCMS
'天天网络科技工作室版权所有
'官方客服中心 http://www.ip126.com
'微信公众号 ip126com
'QQ:530051328 mail:bbfhq@163.com
'=====================================
if Instr(session("AdminPurview"),"|47,")=0 then
  response.write ("<br><br><div align=""center""><font style=""color:red; font-size:9pt; "")>您没有管理该模块的权限！</font></div>")
  response.end
end If

Dim Action,ID,fso,Ts,Data,Moldboard,TextFile,Text'当前最大变量
MoldboardCh=Request.Form("MoldboardCh")
MoldboardEn=Request.Form("MoldboardEn")
ID=strint(request.QueryString("ID"))

IF Request.Form("Submit")<>"" Then

Set Rs=server.createobject("adodb.recordset")
Sql="Select ID,M_ArticleCh,M_ArticleEn From TianTianCMS_Template Where ID="&ID
Rs.Open Sql,conn,1,3
Rs(1)=MoldboardCh
Rs(2)=MoldboardEn
Rs.Update

	Set Rs=Conn.Execute("Select M_ArticleCh,M_ArticleEn,M_Articlestr,M_Productstr,M_Recruitmentstr,M_Downstr,M_Servicesstr From TianTianCMS_Template Where ID="&ID&"")	
	set fso = CreateObject("Scripting.FileSystemObject")

	If Not IsNull(Rs(0)) Then
    Call WriteToFile(Server.Mappath("../Ch/ArticleList.asp"),M_Article(Rs(0),Rs(2)),"utf-8")'用过程函数方式生成，下同
    End if	
	If Not IsNull(Rs(1)) Then
    Call WriteToFile(Server.Mappath("../En/ArticleList.asp"),M_Article(Rs(1),Rs(2)),"utf-8")
    End If

	If Not IsNull(Rs(0)) Then
    Call WriteToFile(Server.Mappath("../Ch/ProductList.asp"),M_Product(Rs(0),Rs(3)),"utf-8")
    End if	
	If Not IsNull(Rs(1)) Then
    Call WriteToFile(Server.Mappath("../En/ProductList.asp"),M_Product(Rs(1),Rs(3)),"utf-8")
    End If

	If Not IsNull(Rs(0)) Then
    Call WriteToFile(Server.Mappath("../Ch/RecruitmentList.asp"),M_Recruitment(Rs(0),Rs(4)),"utf-8")
    End if	
	If Not IsNull(Rs(1)) Then
    Call WriteToFile(Server.Mappath("../En/RecruitmentList.asp"),M_Recruitment(Rs(1),Rs(4)),"utf-8")
    End If	

	If Not IsNull(Rs(0)) Then
    Call WriteToFile(Server.Mappath("../Ch/DownList.asp"),M_Down(Rs(0),Rs(5)),"utf-8")
    End if	
	If Not IsNull(Rs(1)) Then
    Call WriteToFile(Server.Mappath("../En/DownList.asp"),M_Down(Rs(1),Rs(5)),"utf-8")
    End If

	If Not IsNull(Rs(0)) Then
    Call WriteToFile(Server.Mappath("../Ch/ServicesList.asp"),M_Services(Rs(0),Rs(6)),"utf-8")
    End if	
	If Not IsNull(Rs(1)) Then
    Call WriteToFile(Server.Mappath("../En/ServicesList.asp"),M_Services(Rs(1),Rs(6)),"utf-8")
    End If

	Ts.Close:Set Ts=Nothing
	Set Fso=Nothing

response.write "<script language='javascript'>	alert('通用频道模板设置成功，并已生成新的动态频道页面\n\n如果开启生成静态页面功能，请重新生成相关频道静态页面！');location.href='javascript:history.go(-1)';</script>"
End IF

Set Rs=Conn.Execute("Select M_Name,M_ArticleCh,M_ArticleEn From TianTianCMS_Template Where ID="&ID)
IF Not Rs.Eof Then Data=Rs.GetRows
Rs.close:Set Rs=Nothing
Call CloseDB(conn)
%>
<HTML>
<HEAD>
<link rel="stylesheet" href="Images/Admin.css">
<SCRIPT language="javascript" src="admin.js"></SCRIPT>
<META http-equiv="Content-Type" content="text/html; charset=gb2312">
<META name="GENERATOR" content="Microsoft FrontPage 6.0">
<META name="ProgId" content="FrontPage.Editor.Document">
<TITLE>通用频道页模板</title>
<style type="text/css">
<!--
body {
	background-color: #D6DFF7;
}
body,td,th {
	color: #135294;
}
-->
</style></HEAD>
<BODY background="images/background.gif">                                                               
  <TABLE width="98%" border="0" align="center" cellpadding="4" cellspacing="1" bgcolor="#799AE1">
    <TR>
      <TD height="20" align="center" bgcolor="#799AE1"><FONT color="#FFFFFF" style="font-size:14px">通 用 频 道 页 模 板 管 理</FONT></TD>
    </TR>
    <TR>
      <TD bgcolor="#FFFFFF">
            <TABLE width="98%" border="0"  align=center cellpadding="1" cellspacing="1" bgcolor="#D6DFF7">
  <FORM name="form1" method="post" action="">
    <TR bgcolor="#FFFFFF">
      <TD width="20%" height="26" align="right">模板代码（中文）<br><FONT color="#ff0000">（新闻、产品、招聘、下载、服务频道通用）</font></TD>
      <TD width="60%" bgcolor="#FFFFFF" valign="top">当前模板：通用频道页模板，当前模板方案：<FONT color="#ff0000"><%=Data(0,0)%></font>
        &nbsp;<TEXTAREA name="MoldboardCh" cols="90" rows="30" id="T2Ch"><%=Data(1,0)%></TEXTAREA></TD>
		<TD width="20%" height="26" align="left" >模版标签：<br>
      可通过如下标签调用相关内容：<p>
<FONT color="#ff0000">
{$标题读取}<br>
{$频道分类名}<br>
{$频道分类}<br>
{$频道名称}<br>
{$频道隶属}<br>
{$本站推荐}<br>
{$点击热门}<br>
{$频道列表}<br>
</font></TD></TR>

    <TR bgcolor="#FFFFFF">
      <TD width="20%" height="26" align="right">模板代码（英文）<br><FONT color="#ff0000">（新闻、产品、招聘、下载、服务频道通用）</font></TD>
      <TD width="60%" bgcolor="#FFFFFF" valign="top">当前模板：通用频道页模板，当前模板方案：<FONT color="#ff0000"><%=Data(0,0)%></font>
        &nbsp;<TEXTAREA name="MoldboardEn" cols="90" rows="30" id="T2En"><%=Data(2,0)%></TEXTAREA></TD>
		<TD width="20%" height="26" align="left" >模版标签：<br>
      可通过如下标签调用相关内容：<p>
<FONT color="#ff0000">
{$标题读取}<br>
{$频道分类名}<br>
{$频道分类}<br>
{$频道名称}<br>
{$频道隶属}<br>
{$本站推荐}<br>
{$点击热门}<br>
{$频道列表}<br>
</font></TD></TR>


    <TR bgcolor="#FFFFFF"> 
      <TD height="30" colspan="3" align=center>	  
      <input name="Submit" type="submit" id="Submit" value="确定">
	  <input name="Submit1" type="button" id="Submit1" value="返回" onClick="location='M_Template_Management.asp?id=<%=ID%>'"/></TD>
      </TR>
  </FORM>
</TABLE>
      <BR></TD>
    </TR>
</TABLE>
</BODY>                    
                    
</HTML>                    
