<?php
require("../../class/connect.php");
include("../../class/db_sql.php");
include("../../class/config.php");
include("../../class/functions.php");
$link=db_connect();
$empire=new mysqlquery();
$logininid=getcvar('loginuserid');
$loginin=getcvar('loginusername');
$loginrnd=getcvar('loginrnd');
$loginlevel=getcvar('loginlevel');
$editor=1;
is_login($logininid,$loginin,$loginrnd);
//验证权限
CheckLevel($logininid,$loginin,$classid,"template");
$gid=(int)$_GET['gid'];
$gname=CheckTempGroup($gid);
$urlgname=$gname."&nbsp;>&nbsp;";
$cid=$_GET['cid'];
$enews=$_GET['enews'];
$url=$urlgname."<a href=ListClasstemp.php?gid=$gid&classid=$cid>管理封面模板</a>&nbsp;>&nbsp;增加封面模板";
$postword='增加封面模板';
//修改
if($enews=="EditClasstemp")
{
	$tempid=(int)$_GET['tempid'];
	$r=$empire->fetch1("select tempid,tempname,temptext,classid from ".GetDoTemptb("enewsclasstemp",$gid)." where tempid=$tempid");
	$url=$urlgname."<a href=ListClasstemp.php?gid=$gid&classid=$cid>管理封面模板</a>&nbsp;>&nbsp;修改封面模板".$r[tempname];
	$postword='修改封面模板';
}
//分类
$cstr="";
$csql=$empire->query("select classid,classname from {$dbtbpre}enewsclasstempclass order by classid");
while($cr=$empire->fetch($csql))
{
	$select="";
	if($cr[classid]==$r[classid])
	{
		$select=" selected";
	}
	$cstr.="<option value='".$cr[classid]."'".$select.">".$cr[classname]."</option>";
}
db_close();
$empire=null;
//风格
$loginadminstyleid=(int)getcvar('loginadminstyleid');
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title><?=$postword?></title>
<link href="../adminstyle/<?=$loginadminstyleid?>/adminstyle.css" rel="stylesheet" type="text/css">
</head>

<body>
<table width="100%" border="0" align="center" cellpadding="3" cellspacing="1">
  <tr>
    <td height="25">位置：<?=$url?></td>
  </tr>
</table>

<form name="form1" method="post" action="ListClasstemp.php">
  <table width="100%" border="0" align="center" cellpadding="3" cellspacing="1" class="tableborder">
    <tr class="header"> 
      <td height="25" colspan="2"><?=$postword?> 
        <input name="enews" type="hidden" id="enews" value="<?=$enews?>"> <input name="tempid" type="hidden" id="tempid" value="<?=$tempid?>"> 
        <input name="cid" type="hidden" id="cid" value="<?=$cid?>"> <input name="gid" type="hidden" id="gid" value="<?=$gid?>"></td>
    </tr>
    <tr bgcolor="#FFFFFF"> 
      <td width="19%" height="25">模板名称</td>
      <td width="81%" height="25"> <input name="tempname" type="text" id="tempname" value="<?=$r[tempname]?>"> 
      </td>
    </tr>
    <tr bgcolor="#FFFFFF"> 
      <td height="25">所属分类</td>
      <td height="25"><select name="classid" id="classid">
          <option value="0">不隶属于任何类别</option>
          <?=$cstr?>
        </select> <input type="button" name="Submit6222322" value="管理分类" onclick="window.open('ClassTempClass.php');"></td>
    </tr>
    <tr bgcolor="#FFFFFF"> 
      <td rowspan="2">模板内容</td>
      <td height="25"><textarea name="temptext" cols="90" rows="23" id="temptext"><?=htmlspecialchars(stripSlashes($r[temptext]))?></textarea></td>
    </tr>
    <tr bgcolor="#FFFFFF"> 
      <td height="25">调用标签介绍请点 
        <input type="button" name="Submit32" value="这里" onclick="window.open('EnewsBq.php','','width=600,height=500,scrollbars=yes');">
        或JS调用点 
        <input type="button" name="Submit322" value="这里" onclick="window.open('../ListClass.php','','width=800,height=600,scrollbars=yes');">
        。</td>
    </tr>
    <tr bgcolor="#FFFFFF"> 
      <td height="25">&nbsp;</td>
      <td height="25"><table width="100%" border="0" align="center" cellpadding="3" cellspacing="1">
          <tr> 
            <td width="50%" height="23">栏目导航: 
              <input name="textfield" type="text" value="[!--newsnav--]"></td>
            <td height="23">栏目/专题关键字： <input name="textfield2" type="text" value="[!--class.keywords--]"></td>
          </tr>
          <tr> 
            <td height="23">栏目/专题简介： <input name="textfield3" type="text" value="[!--class.intro--]"></td>
            <td height="23">栏目/专题缩略图： <input name="textfield4" type="text" value="[!--class.classimg--]"></td>
          </tr>
          <tr> 
            <td height="23"> <p>页面标题: 
                <input name="textfield6" type="text" value="[!--pagetitle--]">
              </p></td>
            <td height="23">本栏目/专题ID： <input name="textfield5" type="text" value="[!--self.classid--]"></td>
          </tr>
          <tr>
            <td height="23">站点地址: 
              <input name="textfield62" type="text" value="[!--news.url--]"> 
            </td>
            <td height="23">&nbsp;</td>
          </tr>
        </table></td>
    </tr>
    <tr bgcolor="#FFFFFF"> 
      <td height="25">&nbsp;</td>
      <td height="25"><input type="submit" name="Submit" value="提交"> <input type="reset" name="Submit2" value="重置"></td>
    </tr>
  </table>
</form>
</body>
</html>
