<?php session_start(); include("../conn/conn.php");
if($_SESSION[admin_user]==true and $_SESSION[admin_pass]==true){
?>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>管理投票内容</title>
<style type="text/css">
<!--
.STYLE1 {font-weight: bold}
-->
</style>
</head>

<body>
<table width="572" border="2" cellpadding="2" cellspacing="2" bordercolor="#FFFFFF" bgcolor="#FDAE2B">
  <tr>
    <td bgcolor="#FFFFFF"><table width="560" border="0" cellpadding="0" cellspacing="0">
<form action="vote_content_manage_ok.php" method="post" enctype="multipart/form-data" name="form2">
  <tr bgcolor="#167BE3">
    <td width="111" height="29" align="right" valign="middle" bgcolor="#F4F2F3" class="style1">&nbsp;投票主题----      </td>
    <td width="461" valign="middle" bgcolor="#F4F2F3" class="style1"><select name="tb_vote_subject" size="1" id="tb_vote_subject">
      <?php 
$query="select * from tb_vote_subject";
$result=mysql_query($query);
while($myrow=mysql_fetch_array($result)){
?>
      <option value="<?php echo $myrow[tb_vote_subject_name]?>"><?php echo $myrow[tb_vote_subject_name]?></option>
      <?php }?>
    </select></td>
  </tr>
  <tr>
    <td height="40" align="right">添加投票内容：</td>
    <td><input name="tb_vote_content" type="text" id="tb_vote_content" size="35" maxlength="50"></td>
  </tr>
  <tr>
    <td height="40" align="right">添加投票说明：</td>
    <td><textarea name="tb_vote_explain" cols="40" rows="5" id="tb_vote_explain"></textarea></td>
  </tr>
  <tr>
    <td height="40" align="right">上传图片：</td>
    <td><input name="tb_vote_photo" type="file" id="tb_vote_photo" size="20">
      <strong>(*图片可以根据内容决定是否上传)</strong></td>
  </tr>
  <tr>
    <td height="30">&nbsp;&nbsp;&nbsp;&nbsp;</td>
    <td><input type="submit" name="Submit" value="单选">
      &nbsp;&nbsp;
      <input type="submit" name="Submit2" value="多选"></td>
  </tr>
  </form>
</table></td>
  </tr>
</table>
<table width="572" border="1" cellpadding="0" cellspacing="0" bordercolor="#FFFFFF" bgcolor="#FFFFFF">
  <tr>
    <td height="29" colspan="2" align="center" bgcolor="#CEE74A"><span class="style1">投票内容</span></td>
    <td width="151" align="center" bgcolor="#CEE74A" class="style1">删除项目</td>
  </tr>
   <?php 
  $query="select * from tb_vote_odd ";
  $result=mysql_query($query);
  while($myrow=mysql_fetch_array($result)){
  ?>
  <tr>
    <td width="117" height="29" align="left" background="../images/bg_20.gif"><?php echo $myrow[tb_vote_subject];?></td>
    <td width="361" height="25" align="left" background="../images/bg_20.gif"><span class="style2">（<?php echo $myrow[tb_vote_type];?>）&nbsp;<?php echo $myrow[tb_vote_content];?>&nbsp;&nbsp;&nbsp;&nbsp;票数：<?php echo $myrow[tb_vote_counts];?></span></td>
    <td align="center" background="../images/bg_201.gif"><a href="delete_vote_content.php?vote_content=<?php echo $myrow[tb_vote_content];?>" class="style2">删除</a></td>
  </tr>
<?php }
  $query="select * from tb_vote_more ";
  $result=mysql_query($query);
  while($myrow=mysql_fetch_array($result)){
  ?>
  <tr>
    <td height="29" align="left" background="../images/bg_20.gif" class="style2"><?php echo $myrow[tb_vote_subject];?></td>
    <td height="25" align="left" background="../images/bg_20.gif" class="style2">（<?php echo $myrow[tb_vote_type];?>）<?php echo $myrow[tb_vote_content];?>&nbsp;&nbsp;&nbsp;&nbsp;票数：<?php echo $myrow[tb_vote_counts];?></td>
    <td align="center" background="../images/bg_201.gif"><a href="delete_vote_content.php?vote_contents=<?php echo $myrow[tb_vote_content];?>" class="style2">删除</a></td>
  </tr> 
<?php }?>
</table>
</body>
</html>
<?php }else{
	echo "<script>alert('您没有正确登录！');window.location.href='admin_enter.php';</script>";
}?>