<?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;";
$enews=$_GET['enews'];
$url=$urlgname."<a href=ListVotetemp.php?gid=$gid>管理投票模板</a>&nbsp;->&nbsp;增加投票模板";
//修改
if($enews=="EditVoteTemp")
{
	$tempid=(int)$_GET['tempid'];
	$r=$empire->fetch1("select tempid,tempname,temptext from ".GetDoTemptb("enewsvotetemp",$gid)." where tempid=$tempid");
	$url=$urlgname."<a href=ListVotetemp.php?gid=$gid>管理投票模板</a>&nbsp;->&nbsp;修改投票模板：<b>".$r[tempname]."</b>";
}
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>增加投票模板</title>
<link href="../adminstyle/<?=$loginadminstyleid?>/adminstyle.css" rel="stylesheet" type="text/css">
</head>

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

<form name="form1" method="post" action="ListVotetemp.php">
  <table width="98%" border="0" align="center" cellpadding="3" cellspacing="1" class="tableborder">
    <tr class="header"> 
      <td height="25" colspan="2">增加投票模板 
        <input name="enews" type="hidden" id="enews" value="<?=$enews?>"> <input name="tempid" type="hidden" id="tempid" value="<?=$tempid?>">
        <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"><textarea name="temptext" cols="90" rows="23" id="temptext"><?=htmlspecialchars(stripSlashes($r[temptext]))?></textarea></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="[!--vote.action--]"></td>
            <td height="23">投票标题: 
              <input name="textfield2" type="text" value="[!--title--]"></td>
          </tr>
          <tr> 
            <td height="23">投票查看地址: 
              <input name="textfield3" type="text" value="[!--vote.view--]"></td>
            <td height="23">投票窗口宽度: 
              <input name="textfield4" type="text" value="[!--width--]"></td>
          </tr>
          <tr> 
            <td height="23"> <p>投票ID: 
                <input name="textfield6" type="text" value="[!--voteid--]">
              </p></td>
            <td height="23">投票窗口高度: 
              <input name="textfield5" type="text" value="[!--height--]"></td>
          </tr>
          <tr> 
            <td height="23">投票选项: 
              <input name="textfield7" type="text" value="[!--vote.box--]"></td>
            <td height="23">投票选项名称: 
              <input name="textfield8" type="text" value="[!--vote.name--]"></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>
    <tr bgcolor="#FFFFFF"> 
      <td height="25">增加说明</td>
      <td height="25">格式:列表头[!--empirenews.listtemp--]列表内容[!--empirenews.listtemp--]列表尾</td>
    </tr>
  </table>
</form>
</body>
</html>
