<?php echo $this->fetch('admin_head.htm'); ?>

<div class="span12">
		  <div class="page-header">
            <h3><?php echo $this->_var['title']; ?></h3>
          </div>

			<form class="form-search" action="" method="post">
			<a href="?action=vote&do=new" class="btn btn-primary pull-right"><i class="icon-pencil icon-white"></i> 新建投票选项</a>
			<input type="text" name="title" class="input-medium" value="<?php echo $_REQUEST['title']; ?>"  placeholder="标题关键词">	
	
			
			<input type="text" name="time_start" value="<?php echo $_REQUEST['time_start']; ?>"  id="datepicker" placeholder="开始时间" class="input-small"/>
			- <input type="text" name="time_over" value="<?php echo $_REQUEST['time_over']; ?>"  id="datepicker2" placeholder="结束时间" class="input-small"/>
			<button type="submit" class="btn"><i class="icon-search"></i> 查询</button>
			<a href="" class="btn"><i class="icon-th-list"></i> 全部</a>
			</form> 
			
          <div class="row-fluid">
            <div class="span12">
			
               
				<table width="90%" class="table table-bordered table-striped">
				<tr>
					
					<td>
				     <?php
						$sql="select * from votetitle";
						$rs=mysql_query($sql);
						$row=mysql_fetch_assoc($rs);
						echo $row["votetitle"];
	                ?>	
				     &nbsp;&nbsp;<a class="btn btn-small" href="?action=vote&do=edit_votetitle&id=1"><i class="icon-edit"></i> 修改</a>
			    
				</tr>
					
			</table>
					
				
				<table width="90%" class="table table-bordered table-striped">
					<thead>
					  <tr>
						<th width="30">ID</th>
						<th width="100">项目</th>
						<th width="30">票数</th>
						<th width="100">发布时间</th>
						<th width="100">操作</th>
					  </tr>
					</thead>
					<tbody>
					 
			<?php $_from = $this->_var['list']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }; $this->push_vars('', 'row');if (count($_from)):
    foreach ($_from AS $this->_var['row']):
?>
				<tr>
					<td><?php echo $this->_var['row']['id']; ?></td>
					<td><?php echo $this->_var['row']['item']; ?></td>
					<td><?php echo $this->_var['row']['count']; ?></td>
					<td><?php echo date("Y-m-d H:i:s",$this->_var['row']['created_at']); ?></td>
					
					<td>
		<a class="btn btn-small" href="?action=vote&do=edit&id=<?php echo $this->_var['row']['id']; ?>"><i class="icon-edit"></i> 修改</a>	
		<a class="btn btn-small" href="?action=vote&do=del&id=<?php echo $this->_var['row']['id']; ?>" onclick="if(!confirm( '确认要删除吗? ')){return false;}"><i class="icon-trash"></i> 删除</a>
					</td>
				</tr>			
			<?php endforeach; endif; unset($_from); ?><?php $this->pop_vars();; ?>
 
					</tbody>
				  </table>
				  
				<div class="pagination pagination-centered">
					  <ul class="">
						<li><span class="btn">共<?php echo $this->_var['total']; ?>条</span></li>
						<?php echo $this->_var['page']; ?>
					 </ul>
				</div>
	  
            </div>
          </div>
		  
		  
        </div>

<?php echo $this->fetch('admin_foot.htm'); ?>