<?php TPL::output('admin/global/header.tpl.htm'); ?>

<!--left-->
<?php TPL::output('admin/global/left.tpl.htm'); ?>
<!--left-->

<!-- main -->
<div id="main-content">
	<div class="clear"></div>
	<div class="content-box">
		<div class="content-box-header">
			<h3><?php echo $this->crumb['last']['name']; ?></h3>
			<ul class="content-box-tabs">
				<li><a href="admin/question/report_list/status-0" class="<?php if($_GET['status'] == 0){ ?>default-tab current<?php } ?>">Latest report</a></li>
				<li><a href="admin/question/report_list/status-1" class="<?php if($_GET['status'] == 1){ ?>default-tab current<?php } ?>">Processed</a></li>
			</ul>
			<div class="clear"></div>
		</div>
		<div class="content-box-content">
			<div class="tab-content default-tab" id="tab1">
				<?php if(!$this->list){ ?>
				<div class="notification attention png_bg"> <a href="javascript:;" class="close"><img src="<?php echo GET_STATIC_URL;?>/admin/images/icons/cross_grey_small.png" title="Close this notification" alt="close" /></a>
					<div> No Content </div>
				</div>
				<?php }else{ ?>
				<form action="admin/question/report_batch/" onsubmit="return false;" method="post">
				<input name="action_type" id="action_type" type="hidden" value="" />
				<table class="list">
					<thead>
						<tr>
							<th></th>
							<th>Address</th>
							<th>Reason</th>
							<th>Time</th>
							<th>Whistleblower</th>
							<th>Operation</th>
						</tr>
					</thead>
					<tbody style="border-bottom: 1px solid #ddd;">
						<?php foreach ($this->list AS $key => $val) { ?>
						<tr>
							<td><input name="report_ids[]" value="<?php echo $val['id']; ?>" type="checkbox" /></td>
							<td align="left"><a href="<?php echo $val['url']; ?>" target="_blank"><?php echo $val['url']; ?></a></td>
							<td><?php echo $val['reason']; ?></td>
							<td><?php echo date("Y-m-d H:i:s", $val['add_time']); ?></td>
							<td><a href="people/<?php echo $val['user']['url_token']; ?>" target="_blank"><?php echo $val['user']['user_name']; ?></a></td>
							<td><?php if($_GET['status'] == 1){ ?>Processed<?php }else{ ?><a href="javascript:;" onclick="ajax_request(GET_BASE_URL + '/admin/question/report_batch/', 'action_type=handle&report_ids[]=<?php echo $val['id']; ?>')">Process</a><?php } ?></td>
						</tr>
						<?php } ?>
					</tbody>
					<tfoot>
						<tr>
							<td colspan="6">
								<input type="checkbox" class="check-all">Select all&nbsp;&nbsp;<input type="button" value="  Delete  " onclick="$('#action_type').val('delete');ajax_post($(this).parents().find('form'), _form_process);" class="button">
								<?php if($_GET['status'] == 0){ ?>&nbsp;&nbsp;
									<input type="button" value="Processing selected" onclick="$('#action_type').val('handle');ajax_post($(this).parents().find('form'), _form_process);" class="button">
								<?php } ?>
								<div class="pagination" style=" width:500px;float:right;"> <?php echo $this->pagination; ?> </div>
								<div class="clear"></div>
							</td>
						</tr>
					</tfoot>
				</table>
				</form>
				<?php } ?>
			</div>
		</div>
		<div class="clear"></div>
		<div id="notf_tip" style="display:none;" class="notification png_bg"> <a href="javascript:;" class="close"><img src="<?php echo GET_STATIC_URL;?>/admin/images/icons/cross_grey_small.png" alt="Close" /></a>
			<div id="notf_cont"></div>
		</div>
	</div>

<!-- footer -->
<?php TPL::output('admin/global/footer.tpl.htm'); ?>
<!-- footer -->

</div>
<!-- main -->

</div>

</body>
</html>