<%@ Language=VBScript %>
<!--#include virtual="/inc-freehost-function/FreeHostFunctionMain.asp"-->
<%
If session("admau")="" Then
	ef=True
	ec="授权非法，有可能是超时造成的。"
elseIf session("canmodifyhtml")="" Then
	ef=True
	ec="您没有此操作的权限。"
ElseIf Request("id")<>"" and not IsNumeric(Request("id")) Then
	ef=True
	ec="编号必须是数字"
ElseIf Request("username")<>"" and  RegExpTest("[^A-Za-z0-9]",Request("username")) Then
	ef=True
	ec="用户名不合法！"
end if
if not ef then
Set conn=Server.CreateObject("ADODB.Connection")
	conn.Open Application("FreeHostDBlink")
	Set ds = Server.CreateObject("ADODB.Recordset")	
		Sql="Select * from FreeHost.FreeHost_HtmlStyle where username='freehost' and id='"&Request("id")&"'"
if Request("id")="" then Sql="Select * from FreeHost.FreeHost_HtmlStyle where username='freehost' and nowuse='1'"
if Request("id")<>"" and Request("op")<>"" then Sql="Select * from FreeHost.FreeHost_HtmlStyle where id='"&Request("id")&"'"
		ds.Open Sql,conn,1,3
if ds.eof then
Response.Redirect "2htmlstyle2.htm"
else

if Request("op")="del" then
if ds("nowuse")=true and ds("username")="freehost" then Response.Redirect "e.asp?e=正在用的模板不允许删除"
ds.delete
ds.update
Response.Redirect "htmlstyle.asp"
end if
%>
<!--#include virtual="/inc-freehost-function/htmlwrite.asp"--><%=htmlwrite("html8")%>
<%=htmlwrite("html9")%>
<TABLE width="100%" border=0 cellPadding=0 cellSpacing=0 background="img/midtop4.gif">
  <TBODY>
    <TR>
      <TD width=53 align="left" background="img/midtop1.gif"><strong> 　 </strong><font color="#FFFFFF">─<strong>&gt;</strong></font> </TD>
      <TD width="83"><table height="59"  border="0" cellpadding="0" cellspacing="0">
          <tr>
            <td width="7" background="img/midtop.gif">&nbsp;</td>
            <td width="60" align="center" valign="middle" background="img/r3.jpg" id="tableTop1" style="Cursor:hand"><a href="htmlstyle.asp"><font color="#FFFFFF">模板管理</font></a></td>
            <td width="5" background="img/midtop2.gif">&nbsp;</td>
          </tr>
      </table></TD>
      <TD width="83">&nbsp;</TD>
      <TD width="83">&nbsp;</TD>
      <TD width="83" align="left">&nbsp;</TD>
      <TD align="left">&nbsp;</TD>
      <TD width=23 align="right"><IMG height=59 
                  src="img/rtop4.jpg" 
                  width=19></TD>
    </TR>
  </TBODY>
</TABLE>
<TABLE width="100%" border=0 cellPadding=0 cellSpacing=0>
  <TBODY>
    <TR>
      <TD width=19 background="img/midlef.gif" id=rightid>&nbsp;</TD>
      <TD height="462" align="center" vAlign=top bgcolor="#FFFFFF">
	  
	  
	<form name="formhtml" method="post" action="htmlstyle-sub.asp">
 <br><DIV class="tableborder" id=t1>
  <table width="100%"  border="0" cellspacing="1">
  <tr>
    <td height="24" colspan="2" align="center" background="img/tablebg.gif"><font color="#FFFFFF">快速修改</font></td>
    </tr>
  <tr bgcolor="#E4EAF2">
    <td width="50%" align="right">查找内容：
      <input type="text" name="findme"></td>
    <td width="50%" align="left">替换　为：
      <input type="text" name="replaceme"></td>
  </tr>
  <tr bgcolor="#E4EAF2">
    <td colspan="2" align="center">      <script>
  function chcon()
  {
document.formhtml.html1.value=document.formhtml.html1.value.replace(document.formhtml.findme.value,document.formhtml.replaceme.value)
document.formhtml.html2.value=document.formhtml.html2.value.replace(document.formhtml.findme.value,document.formhtml.replaceme.value)
document.formhtml.html3.value=document.formhtml.html3.value.replace(document.formhtml.findme.value,document.formhtml.replaceme.value)
document.formhtml.html4.value=document.formhtml.html4.value.replace(document.formhtml.findme.value,document.formhtml.replaceme.value)
document.formhtml.html5.value=document.formhtml.html5.value.replace(document.formhtml.findme.value,document.formhtml.replaceme.value)
document.formhtml.html6.value=document.formhtml.html6.value.replace(document.formhtml.findme.value,document.formhtml.replaceme.value)
document.formhtml.html7.value=document.formhtml.html7.value.replace(document.formhtml.findme.value,document.formhtml.replaceme.value)
document.formhtml.html8.value=document.formhtml.html8.value.replace(document.formhtml.findme.value,document.formhtml.replaceme.value)
document.formhtml.html9.value=document.formhtml.html9.value.replace(document.formhtml.findme.value,document.formhtml.replaceme.value)
document.formhtml.html10.value=document.formhtml.html10.value.replace(document.formhtml.findme.value,document.formhtml.replaceme.value)
document.formhtml.html11.value=document.formhtml.html11.value.replace(document.formhtml.findme.value,document.formhtml.replaceme.value)
document.formhtml.html12.value=document.formhtml.html12.value.replace(document.formhtml.findme.value,document.formhtml.replaceme.value)
document.formhtml.html13.value=document.formhtml.html13.value.replace(document.formhtml.findme.value,document.formhtml.replaceme.value)
document.formhtml.html14.value=document.formhtml.html14.value.replace(document.formhtml.findme.value,document.formhtml.replaceme.value)
document.formhtml.html15.value=document.formhtml.html15.value.replace(document.formhtml.findme.value,document.formhtml.replaceme.value)
document.formhtml.html16.value=document.formhtml.html16.value.replace(document.formhtml.findme.value,document.formhtml.replaceme.value)
document.formhtml.html17.value=document.formhtml.html17.value.replace(document.formhtml.findme.value,document.formhtml.replaceme.value)
document.formhtml.html18.value=document.formhtml.html18.value.replace(document.formhtml.findme.value,document.formhtml.replaceme.value)
document.formhtml.html19.value=document.formhtml.html19.value.replace(document.formhtml.findme.value,document.formhtml.replaceme.value)
document.formhtml.html20.value=document.formhtml.html20.value.replace(document.formhtml.findme.value,document.formhtml.replaceme.value)
document.formhtml.html21.value=document.formhtml.html21.value.replace(document.formhtml.findme.value,document.formhtml.replaceme.value)
document.formhtml.html22.value=document.formhtml.html22.value.replace(document.formhtml.findme.value,document.formhtml.replaceme.value)
document.formhtml.html23.value=document.formhtml.html23.value.replace(document.formhtml.findme.value,document.formhtml.replaceme.value)
document.formhtml.html24.value=document.formhtml.html24.value.replace(document.formhtml.findme.value,document.formhtml.replaceme.value)
document.formhtml.html25.value=document.formhtml.html25.value.replace(document.formhtml.findme.value,document.formhtml.replaceme.value)
document.formhtml.html26.value=document.formhtml.html26.value.replace(document.formhtml.findme.value,document.formhtml.replaceme.value)
document.formhtml.html27.value=document.formhtml.html27.value.replace(document.formhtml.findme.value,document.formhtml.replaceme.value)
document.formhtml.html28.value=document.formhtml.html28.value.replace(document.formhtml.findme.value,document.formhtml.replaceme.value)
document.formhtml.html29.value=document.formhtml.html29.value.replace(document.formhtml.findme.value,document.formhtml.replaceme.value)
document.formhtml.html30.value=document.formhtml.html30.value.replace(document.formhtml.findme.value,document.formhtml.replaceme.value)
document.formhtml.html31.value=document.formhtml.html31.value.replace(document.formhtml.findme.value,document.formhtml.replaceme.value)
document.formhtml.html32.value=document.formhtml.html32.value.replace(document.formhtml.findme.value,document.formhtml.replaceme.value)
  }
      </script>
      <input name="chaX" type="button" onClick="chcon()" value="执行"></td>
    </tr>
</table>
</div>
  <br>
  <DIV class="tableborder" id=t2>
  <table width="100%"  border="0" cellspacing="1">
    <tr>
      <td height="24" colspan="2" align="center" background="img/tablebg.gif"><font color=#FFFFFF>修改您已有的模板</font></td>
    </tr>
    <tr bgcolor="#E4EAF2">
      <td width="31%" height="23" align="right"><b>系统自带的模板</b>：</td>
      <td width="69%" align="left"> <a href="htmlstyle2.htm"><font color="#000000">模板一&gt;&gt;</font></a>　<a href="2htmlstyle2.htm"><font color="#000000">新模板二&gt;&gt;</font></a>　<a href="newhtmlstyle2.htm"><font color="#000000">新模板三(idcnet提供)&gt;&gt;</font></a>　</td>
    </tr>
    <tr bgcolor="#E4EAF2">
      <td height="25" rowspan="2" align="right"><b>新模板</b>：
</td>
      <td align="left"><a href="newstyle1.htm"><font color="#000000">亿流网络提供(dns99.cn)</font></a> <a href="newstyle3.htm"><font color="#000000">腾翼网提供(tengyi.cn)</font></a> <a href="newhtmlstyle6.htm"><font color="#000000">[六号模板(idcmb.com)]</font></a></td>
    </tr>
    <tr bgcolor="#E4EAF2">
      <td height="25" align="left"> 　<a href="http://sys.7i24.com/soft/freehostmain/newstyle.rar" target="_blank"><font color="#000000">亿流及腾翼模板需要您下载模板包才能使用&gt;&gt;&gt;</font></a></td>
    </tr>
    <tr align="center" bgcolor="#E4EAF2">
      <td height="24" align="right">(当前编号：<%=ds ("id")%>)</td>
      <td height="24" align="left">[<%=ds ("stylename")%>] 注意可以将本页另存下来备份。</td>
    </tr>
	    <tr align="center" bgcolor="#E4EAF2">
      <td height="24" colspan="2">
	  
	  
	  <strong>网站首页设计：</strong></b><br>
1.<textarea name="html1" cols="50" rows="10"><%=server.htmlencode(ds("html1"))%></textarea><br>
<br><b>用户区设计：</b><br>
1.<textarea name="html2" cols="50" rows="10"><%=server.htmlencode(ds("html2"))%></textarea><br>
2.<textarea name="html3" cols="50" rows="10"><%=server.htmlencode(ds("html3"))%></textarea><br>
3.<textarea name="html4" cols="50" rows="10"><%=server.htmlencode(ds("html4"))%></textarea><br>
<br><b>代理区设计：</b><br>
1.<textarea name="html5" cols="50" rows="10"><%=server.htmlencode(ds("html5"))%></textarea><br>
2.<textarea name="html6" cols="50" rows="10"><%=server.htmlencode(ds("html6"))%></textarea><br>
3.<textarea name="html7" cols="50" rows="10"><%=server.htmlencode(ds("html7"))%></textarea><br>
<br><b>管理员区设计：</b><br>
1.<textarea name="html8" cols="50" rows="10"><%=server.htmlencode(ds("html8"))%></textarea><br>
2.<textarea name="html9" cols="50" rows="10"><%=server.htmlencode(ds("html9"))%></textarea><br>
3.<textarea name="html10" cols="50" rows="10"><%=server.htmlencode(ds("html10"))%></textarea><br>
<br><b>付款方式：</b><br>
1.<textarea name="html11" cols="50" rows="10"><%=server.htmlencode(ds("html11"))%></textarea><br>
<br><b>产品介绍页：</b><br>
1.<textarea name="html12" cols="50" rows="10"><%=server.htmlencode(ds("html12"))%></textarea><br>
2.<textarea name="html13" cols="50" rows="10"><%=server.htmlencode(ds("html13"))%></textarea><br>
3.<textarea name="html14" cols="50" rows="10"><%=server.htmlencode(ds("html14"))%></textarea><br>
<br><b>联系我们：</b><br>
1.<textarea name="html15" cols="50" rows="10"><%=server.htmlencode(ds("html15"))%></textarea><br>
<br><b>公司简介：</b><br>
1.<textarea name="html16" cols="50" rows="10"><%=server.htmlencode(ds("html16"))%></textarea><br>
<br><b>域名注册页：</b><br>
1.<textarea name="html17" cols="50" rows="10"><%=server.htmlencode(ds("html17"))%></textarea><br>
<br><b>网站推广页一：</b><br>
1.<textarea name="html18" cols="50" rows="10"><%=server.htmlencode(ds("html18"))%></textarea><br>
<br><b>网站推广页二：</b>(/style/info/listad.asp)<br>
1.<textarea name="html19" cols="50" rows="10"><%=server.htmlencode(ds("html19"))%></textarea><br>
<br><b>网站建设页：</b><br>
1.<textarea name="html20" cols="50" rows="10"><%=server.htmlencode(ds("html20"))%></textarea><br>
<br><b>整机租用/主机托管页：</b><br>
1.<textarea name="html21" cols="50" rows="10"><%=server.htmlencode(ds("html21"))%></textarea><br>
<br><b>常见问题(帮助页)：(对应文件是/style/info/help.asp)</b><br>
1.<textarea name="html22" cols="50" rows="10"><%=server.htmlencode(ds("html22"))%></textarea><br>
<br><b>自定义页一(对应文件是/style/info/self1.asp)不需要这个页面不用输入内容：</b><br>
1.<textarea name="html23" cols="50" rows="10"><%if not isnull(ds("html23")) then%><%=server.htmlencode(ds("html23"))%><%else%><%=ds("html23")%><%end if%></textarea><br>
<br><b>自定义页二(对应文件是/style/info/self2.asp)不需要这个页面不用输入内容：</b><br>
1.<textarea name="html24" cols="50" rows="10"><%if not isnull(ds("html24")) then%><%=server.htmlencode(ds("html24"))%><%else%><%=ds("html24")%><%end if%></textarea>
<br>
<b>自定义页三(对应文件是/style/info/self3.asp或tao.asp套装页)</b><br>
<textarea name="html25" cols="50" rows="10" id="html25"><%if not isnull(ds("html25")) then%><%=server.htmlencode(ds("html25"))%><%else%><%=ds("html25")%><%end if%>
</textarea><br><br>

<b>自定义页四(对应文件是/style/info/self4.asp</b><br>
<textarea name="html26" cols="50" rows="10"><%if not isnull(ds("html26")) then%><%=server.htmlencode(ds("html26"))%><%else%><%=ds("html26")%><%end if%>
</textarea><br><br>
<b>自定义页五(对应文件是/style/info/self5.asp</b><br>
<textarea name="html27" cols="50" rows="10"><%if not isnull(ds("html27")) then%><%=server.htmlencode(ds("html27"))%><%else%><%=ds("html27")%><%end if%>
</textarea><br><br>
<b>自定义页六(对应文件是/style/info/self6.asp</b><br>
<textarea name="html28" cols="50" rows="10"><%if not isnull(ds("html28")) then%><%=server.htmlencode(ds("html28"))%><%else%><%=ds("html28")%><%end if%>
</textarea><br><br>
<b>自定义页七(对应文件是/style/info/self7.asp</b><br>
<textarea name="html29" cols="50" rows="10"><%if not isnull(ds("html29")) then%><%=server.htmlencode(ds("html29"))%><%else%><%=ds("html29")%><%end if%>
</textarea><br><br>
<b>自定义页八(对应文件是/style/info/self8.asp</b><br>
<textarea name="html30" cols="50" rows="10"><%if not isnull(ds("html30")) then%><%=server.htmlencode(ds("html30"))%><%else%><%=ds("html30")%><%end if%>
</textarea><br><br>
<b>自定义页九(对应文件是/style/info/self9.asp</b><br>
<textarea name="html31" cols="50" rows="10"><%if not isnull(ds("html31")) then%><%=server.htmlencode(ds("html31"))%><%else%><%=ds("html31")%><%end if%>
</textarea><br><br>
<b>自定义页十(对应文件是/style/info/self10.asp</b><br>
<textarea name="html32" cols="50" rows="10"><%if not isnull(ds("html32")) then%><%=server.htmlencode(ds("html32"))%><%else%><%=ds("html32")%><%end if%>
</textarea><br><br>




<br>
<%end if%>
　<br>
模板命名：
<input name="stylename" type="text" id="stylename" value="<%=ds("stylename")%><%if ds("username")<>"freehost" then%>(来自代理)<%end if%>" maxlength="50">
<br>
<input type="submit" name="Submit" value="提交">
<input name="nowuse" type="checkbox" id="nowuse" value="1" <%if ds("nowuse")=true then%>checked<%end if%>>
设置为主站当前用模板
<input name="pubuse" type="checkbox" id="pubuse" value="1" <%if ds("pubuse")=true then%>checked<%end if%>> 
作为公共用的公开模板

<input name="agentdefault" type="checkbox" id="agentdefault" value="1" <%if ds("agentdefault")=true then%>checked<%end if%>>
作为代理默认用模板
<input name="newstyle" type="checkbox" id="newstyle" value="y">
作为新模板另存下来
<input name="id" type="hidden" value="<%=ds ("id")%>">
	  
	  </td>
      </tr>
  </table>
</div>

</form>

<%
	Set dsnews = Server.CreateObject("ADODB.Recordset")	
	Sql="Select id,stylename,nowuse,username,pubuse,agentdefault from FreeHost.FreeHost_HtmlStyle order by id asc"
if Request("username")<>"" then sql="Select id,stylename,nowuse,username,pubuse,agentdefault from FreeHost.FreeHost_HtmlStyle where username='"&Request("username")&"' order by id asc"
	dsnews.PageSize = 15
	dsnews.Open Sql,conn,1,1
%>
<%
if dsnews.Eof then
%>
<br>
数据库中不存在模板的记录。
<%
else
if Request.ServerVariables("QUERY_STRING")<>"" then
ask=Split(Request.ServerVariables("QUERY_STRING"), chr(38)&"pn")
else
ask=Split("freehost=1", "")
ask(0)="freehost=lsoft"
end if
	pn=1
if Request.QueryString ("pn")<>"" then pn=Request.QueryString ("pn")
If dsnews.RecordCount <> 0 Then dsnews.AbsolutePage = CLng(pn)  
    if clng(pn)<=10 then
    begini=1
      if dsnews.PageCount<=10 then
       endini=dsnews.PageCount 
       else
       endini=10
      end if
    end if
%>
<%if clng(pn)<=10 then%>最新 <%for i=begini to endini
    if clng(pn)=i then%><font color=red>[<%=i%>]</font><%else%><a href="?<%=ask(0)%>&pn=<%=i%>"><font color="#000000">[<%=i%>]</font></a><%end if%>　<%next%> 
        <%else%>　<a href="?<%=ask(0)%>&pn=1"><font color="#000000">最新[1]--[10]</font></a>　　现在是第<font color=red>[<%=pn%>]</font>页 
        　共<%=dsnews.PageCount%>页　<%end if%><%If Clng(pn)>1 Then%><a href="?<%=ask(0)%>&pn=<%=pn-1%>"><font color="#000000">上一页</font></a>
        <%End If%>|<%If Clng(pn)<dsnews.PageCount Then%><a href="?<%=ask(0)%>&pn=<%=pn+1%>"><font color="#000000">下一页</font></a>
        <%End If%>
<DIV class="tableborder" id=t3>
<table width="100%"  border="0" cellspacing="1">
  <tr>
    <td width="10%" height="24" align="center" background="img/tablebg.gif"><font color="#FFFFFF">编号</font></td>    
    <td width="24%" height="24" align="center" background="img/tablebg.gif"><font color="#FFFFFF">名称</font></td>
	<td width="24%" height="24" align="center" background="img/tablebg.gif"><font color="#FFFFFF">属性</font></td>
	<td width="25%" height="24" align="center" background="img/tablebg.gif"><font color="#FFFFFF">属性</font></td>
    <td width="17%" height="24" align="center" background="img/tablebg.gif"><font color="#FFFFFF">操作</font></td>
  </tr>
<%
For N=1 To dsnews.PageSize 
					If dsnews.RecordCount=0 Then Exit For
%>

  <tr bgcolor="#E4EAF2">
    <td align="center"><%=dsnews("id")%></td>
    <td align="center"><%=dsnews("stylename")%>(<%=dsnews("username")%>)</td>
	<td align="center"><%if dsnews("nowuse")=true and dsnews("username")="freehost" then%>
	  当前正在用的模板
    <%end if%>
    <br>
    <%if dsnews("agentdefault")=true and dsnews("username")="freehost" then%>
代理未设置模板时的默认模板
<%end if%></td>
	<td align="center"><%if dsnews("pubuse")=true then%>公开的模板<%else%>不公开的模板<%end if%></td>
    <td align="center"><a href="htmlstyle.asp?id=<%=dsnews("id")%>"><font color="#000000">修改</font></a> <a href="htmlstyle.asp?id=<%=dsnews("id")%>&op=del" <%if dsnews("username")<>"freehost" then%>onClick="if (confirm('请您确认是否要删除？注意，您现在在删除代理的模板，删除是不可恢复的！')==false){return false;}"<%end if%>><font color="#000000">删除</font></a></td>
  </tr>
<%
If clng(pn)=dsnews.PageCount Then
I = dsnews.RecordCount - (dsnews.PageCount-1) * dsnews.PageSize
If N=I Then Exit For
End If
dsnews.movenext
Next%>
</table>
</DIV>
<%end if
dsnews.close
set dsnews=nothing%>

<form action="htmlstyle.asp" method="get" name="form1">
  <DIV class="tableborder"  id="table2" >
    <table width="100%"  border="0" cellspacing="1">
      <tr >
        <td height="24" colspan="2" align="center" background="img/tablebg.gif"><font color="#FFFFFF">查找模板</font></td>
      </tr>
      <tr bgcolor="#E4EAF2">
        <td width="9%" height="40" align="right" bgcolor="#E4EAF2">&nbsp;</td>
        <td width="91%" align="left">　用户名：
          <input name="username" type="text" id="username" size="10" maxlength="14">
          
          <input name="Submit" type="submit" id="Submit" value="查找"></td>
      </tr>
    </table>
  </div>
</form>	
	
	</TD>
      <TD width=18 background="img/midri.gif">&nbsp;</TD>
    </TR>
  </TBODY>
</TABLE>



<TABLE cellSpacing=0 cellPadding=0 width="100%" border=0>
  <TBODY>
    <TR>
      <TD width=30><IMG height=19 
                  src="img/rb1.jpg" 
                  width=30></TD>
      <TD 
                background=img/rb2.jpg>&nbsp;</TD>
      <TD width=30><IMG height=19 
                  src="img/rb3.jpg" 
                  width=30></TD>
    </TR>
  </TBODY>
</TABLE>　

<%=htmlwrite("html10")%>
<%end if
if ef then
Response.Redirect "e.asp?e="&ec
end if%>
