<?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-size: 13px}
.style2 {font-size: 12px}
-->
</style>
</head>

<body>
<table width="572" height="57" border="1" cellpadding="0" cellspacing="0" bordercolor="#FFFFFF" bgcolor="#FFFFFF">
  <tr bgcolor="#167BE3">
    <td width="401" height="25" align="center" bgcolor="#CCE54B" class="style1">投票主题</td>
    <td width="171" bgcolor="#CCE54B" class="style1">删除主题</td>
  </tr>
  <?php 
  $query=mysql_query("select * from tb_vote_subject");
  while($row=mysql_fetch_array($query)){
  $rows2=$row[tb_vote_subject_name];
  ?>
  <tr>
    <td height="29" background="../images/bg_20.gif"><a href="index.php?admin_title=管理投票&&vote_subjectes=<?php echo $row[tb_vote_subject_name];?>" class="style2"><?php echo $row[tb_vote_subject_name];?></a></td>
    <td height="22" colspan="2" background="../images/bg_201.gif"><?php echo $row[tb_vote_subject_text];?> </td>
  </tr>
  <?php }?>
</table>
<p>&nbsp;</p>
<table width="572" border="1" cellpadding="0" cellspacing="0" bordercolor="#FFFFFF" bgcolor="#FFFFFF">
  <tr bgcolor="#167BE3">
    <td height="30" colspan="2" align="center" bgcolor="#CEE74A">投票主题(<?php echo $_GET[vote_subjectes];?>)</td>
  </tr>
  <tr>
    <td width="239" height="29" align="center" background="../images/bg_20.gif"><span class="style1">投票内容</span></td>
    <td width="151" align="center" background="../images/bg_201.gif" class="style1">&nbsp;</td>
  </tr>
   <?php 
  $query="select * from tb_vote_odd where tb_vote_subject='$_GET[vote_subjectes]'";
  $result=mysql_query($query);
  while($myrow=mysql_fetch_array($result)){
$type_odd=$myrow[tb_vote_type];
  ?>
  <tr>
    <td height="29" colspan="2" 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>
  </tr>
<?php }
if($type_odd==true){
?>

 <tr>
    <td height="29" align="left" class="style2">&nbsp;</td>
    <td align="center" background="../images/bg_201.gif"><a href="update_vote.php?update_id=<?php echo $_GET[vote_subjectes];?>&&type_odd=<?php echo $type_odd;?>">重新投票</a></td>
  </tr>
  <?php
} 
  $query="select * from tb_vote_more where tb_vote_subject='$_GET[vote_subjectes]'";
  $result=mysql_query($query);
  while($myrow=mysql_fetch_array($result)){
$type_more=$myrow[tb_vote_type];
  ?>
  <tr>
    <td height="29" colspan="2" 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>
  </tr>  <?php }

if($type_more==true){
?>
  <tr bgcolor="#ECF6FF">
    <td height="29" align="left" background="../images/bg_20.gif" class="style2">&nbsp;</td>
    <td align="center" background="../images/bg_201.gif" bgcolor="#FFFFFF"><a href="update_vote.php?update_id=<?php echo $_GET[vote_subjectes];?>&&type_more=<?php echo $type_more;?>">重新投票</a></td>
  </tr>
<?php }?>
</table>
</body>
</html>
<?php }else{
	echo "<script>alert('您没有正确登录！');window.location.href='admin_enter.php';</script>";
}?>