<!--#include file="tgzcm_Conn.asp"-->
<!--#include file="tgzcm_Check.asp"-->
<!--#include file="../tgzcm.Cache/tgzcm.Admin.asp"-->
<!--原是引用conn.asp 为了避免sql注入错误检查 -->
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=gb2312" />
<TITLE>模板管理页面</TITLE>
<link href="skins/css/tgzcm_main.css" rel="stylesheet" type="text/css" />
<script language = "javaScript" src = "tgzcm_All.js" type="text/javascript"></script>
</head>
<body>
<%
Dim Id,htmlurl,Content,Action,Custom
Id=Cint(Request.QueryString("id"))
Action=Request.QueryString("action")
Custom=Request.QueryString("Custom")
Content=Request.Form("content")
If Id=0 Then
    htmlurl="style.css"
ElseIf Id=1 Then
    htmlurl=""&tgzcmId(21)&"tgzcm_Default.html"
ElseIf Id=2 Then
    htmlurl=""&tgzcmId(21)&"tgzcm_type.html"
ElseIf Id=3 Then
    htmlurl=""&tgzcmId(21)&"tgzcm_Details.html"
ElseIf Id=4 Then
    htmlurl=""&tgzcmId(21)&"tgzcm_search.html"
ElseIf Id=5 Then
    htmlurl=""&tgzcmId(21)&"tgzcm_player.html"
ElseIf Id=6 Then
    htmlurl=""&tgzcmId(21)&"tgzcm_new.html"
ElseIf Id=7 Then
    htmlurl=""&tgzcmId(21)&"tgzcm_hot.html"
ElseIf Id=8 Then
    htmlurl=""&tgzcmId(21)&"tgzcm_elite.html"
ElseIf Id=9 Then
    htmlurl=""&tgzcmId(21)&"tgzcm_all.html"	
ElseIf Id=10 Then
    htmlurl=""&tgzcmId(21)&"tgzcm_header.html"
ElseIf Id=11 Then
    htmlurl=""&tgzcmId(21)&"tgzcm_footer.html"
ElseIf Id=12 Then
    htmlurl=""&tgzcmId(21)&"tgzcm_player_Gvod.html"
ElseIf Id=13 Then
    htmlurl=""&tgzcmId(21)&"tgzcm_news_type.html"	
ElseIf Id=14 Then
    htmlurl=""&tgzcmId(21)&"tgzcm_news.html"	
ElseIf Id=15 Then
    htmlurl=""&tgzcmId(21)&"tgzcm_Product_type.html"
ElseIf Id=16 Then
    htmlurl=""&tgzcmId(21)&"tgzcm_Product.html"		
ElseIf Id=17 Then	
    htmlurl="Custom/"&Custom
Else 
    htmlurl=""
End If

If Action="cteate" Then
    Call SkinCteate
Else
    Call SkinMain
End If	

Sub SkinCteate'作用:生成模板
    'Response.Write(Content)
	If htmlurl="" Then
	    Call tgzcm_err_b("请正确加载模板后,编辑完毕再生成!","Adn_Skin.asp?Id="&Id)
	Else
	    'Response.Write "../skin/"&tgzcm(12)&"/"&htmlurl
		Call MakeHtml("../skin/"&tgzcm(12)&"/"&htmlurl&"",Content)
	    Call tgzcm_err_b("生成模板"&htmlurl&"成功,点击确后后将重新加载"&htmlurl&"","tgzcm_Skin.asp?Id="&Id&"&Custom="&Custom)
	End If
End Sub 

Sub SkinMain'作用:加载模板		
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''加载内容模板开始
If IsExists("../skin/"&tgzcm(12)&"/"&htmlurl&"")=True Then
	Dim moban
	Dim url, fso, s
	Dim find 
	url= server.mappath("../skin/"&tgzcm(12)&"/"&htmlurl&"")
	set fso = server.createobject("scripting.fileSystemobject")
	set find = fso.opentextfile(url, 1)
	moban = find.Readall
	find.close
Else
    moban = "提示:请从左边正确选择要编辑的模板文件..."
End If
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''加载内容模板结束
%>
<table width="95%" border="0" cellspacing="0" cellpadding="0">
<form id="skin" name="skin" method="post" action="tgzcm_Skin.asp?action=cteate&id=<%=id%>&Custom=<%=Custom%>">
<tr> 
<th colspan=5 style="text-align:center; height:40px;"><span style="font-size:18px; font-weight:bold">正在进行<font color="#FF0000"><%=htmlurl%></font>模板编辑</span> <input type="submit" name="Submit" value="修改完成/生成模板" onClick="return confirm('生成后将覆盖掉原模板，请确定已经备份，确定要生成吗?');" style="color:#000066"></th>
</tr>
<tr >
<td colspan="5" class="td2"><textarea name="content" style=" width:100%; height:500px; color:#333333; font-size:12px;"><%=moban%></textarea></td>
</tr>
</form>
</table>
<%End Sub%>
</body>
</html>