<?php /* Smarty version 2.6.17, created on 2018-05-28 12:14:16
         compiled from admin/activity/user_participate_form.html */ ?>
<?php require_once(SMARTY_CORE_DIR . 'core.load_plugins.php');
smarty_core_load_plugins(array('plugins' => array(array('modifier', 'date', 'admin/activity/user_participate_form.html', 78, false),)), $this); ?>
<?php $_smarty_tpl_vars = $this->_tpl_vars;
$this->_smarty_include(array('smarty_include_tpl_file' => "./admin/header.html", 'smarty_include_vars' => array()));
$this->_tpl_vars = $_smarty_tpl_vars;
unset($_smarty_tpl_vars);
 ?>
<?php $_smarty_tpl_vars = $this->_tpl_vars;
$this->_smarty_include(array('smarty_include_tpl_file' => "./admin/left.html", 'smarty_include_vars' => array()));
$this->_tpl_vars = $_smarty_tpl_vars;
unset($_smarty_tpl_vars);
 ?>
<?php $_smarty_tpl_vars = $this->_tpl_vars;
$this->_smarty_include(array('smarty_include_tpl_file' => "./admin/nav.html", 'smarty_include_vars' => array()));
$this->_tpl_vars = $_smarty_tpl_vars;
unset($_smarty_tpl_vars);
 ?>
<?php $_smarty_tpl_vars = $this->_tpl_vars;
$this->_smarty_include(array('smarty_include_tpl_file' => "get_kindeditor.html", 'smarty_include_vars' => array()));
$this->_tpl_vars = $_smarty_tpl_vars;
unset($_smarty_tpl_vars);
 ?>

<div id="activity_container">

<div class="activity_center">
<?php $_smarty_tpl_vars = $this->_tpl_vars;
$this->_smarty_include(array('smarty_include_tpl_file' => "./admin/activity/common_nav.html", 'smarty_include_vars' => array()));
$this->_tpl_vars = $_smarty_tpl_vars;
unset($_smarty_tpl_vars);
 ?>


	查看:
	<?php if ($this->_tpl_vars['action'] == 'all'): ?>
	<span class="text-muted">全部</span> &nbsp;
	<?php else: ?>
	<a href="<?php echo $this->_tpl_vars['web_cfg']['domain']; ?>
/?c=Admin_Activity_UserParticipateLog&a=PageList&events_id=<?php echo $this->_tpl_vars['eventData']['id']; ?>
&action=all">全部</a> &nbsp;
	<?php endif; ?>
	<?php if ($this->_tpl_vars['action'] == 'member'): ?>
	<span class="text-muted">用户</span> &nbsp;
	<?php else: ?>
	<a href="<?php echo $this->_tpl_vars['web_cfg']['domain']; ?>
/?c=Admin_Activity_UserParticipateLog&a=PageList&groupByUid=true&events_id=<?php echo $this->_tpl_vars['eventData']['id']; ?>
&action=member">用户</a> &nbsp;
	<?php endif; ?>
	<?php if ($this->_tpl_vars['action'] == 'form'): ?>
	<span class="text-muted">表单</span> &nbsp;
	<?php else: ?>
	<a href="<?php echo $this->_tpl_vars['web_cfg']['domain']; ?>
/?c=Admin_Activity_UserParticipateLog&a=PageEventFormData&events_id=<?php echo $this->_tpl_vars['eventData']['id']; ?>
&action=form">表单</a> &nbsp;
	<?php endif; ?>
	<?php if ($this->_tpl_vars['isPrizes']): ?>
	<?php if ($this->_tpl_vars['action'] == 'win'): ?>
	<span class="text-muted">中奖</span> &nbsp;
	<?php else: ?>
	<a href="<?php echo $this->_tpl_vars['web_cfg']['domain']; ?>
/?c=Admin_Activity_UserParticipateLog&a=PageLotteryDataList&events_id=<?php echo $this->_tpl_vars['eventData']['id']; ?>
&action=win">中奖</a> &nbsp;
	<?php endif; ?>
	<?php endif; ?>

	<?php if ($this->_tpl_vars['eventData']['type'] == 4): ?>
	<a href="<?php echo $this->_tpl_vars['web_cfg']['domain']; ?>
/?c=Admin_Activity_UserHelp&a=PageList&events_id=<?php echo $this->_tpl_vars['eventData']['id']; ?>
">助力排行</a> &nbsp;
	<?php endif; ?>
	
	<?php if ($this->_tpl_vars['download_url']): ?>
	<a href="<?php echo $this->_tpl_vars['download_url']; ?>
" target="_blank" class="" style="padding:0 10px;margin-left:10px;"><i class="fa fa-download"></i> 导出数据</a>
	<?php endif; ?>
		
	<div class="block_10"></div>
	
	<div  class="panel panel-default">
		<div class="panel-body">	
			<div class="form-group">
				<div>
					<table class="table table-hover">
						<thead>
							<tr>
								<th>参与人</th>
								<th>UID</th>
								<th>时间</th>
								<th>行为</th>
								<?php if ($this->_tpl_vars['audit']): ?>
								<th>审核状态</th>
								<?php endif; ?>
							</tr>
						</thead>
						<tbody>
							<?php if ($this->_tpl_vars['formData']): ?>
							<?php $_from = $this->_tpl_vars['formData']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
    foreach ($_from as $this->_tpl_vars['data']):
?>
							<tr>
								<td>
								
									<?php if ($this->_tpl_vars['userData'][$this->_tpl_vars['data']['uid']]['headimgurl']): ?>
									<img class="img-rounded" width="48" height="48" src="<?php echo $this->_tpl_vars['userData'][$this->_tpl_vars['data']['uid']]['headimgurl']; ?>
" />
									<?php else: ?>
									<img class="img-rounded" width="48" height="48" src="http://news.mydrivers.com/Img/20110518/04481549.png" />
									<?php endif; ?>
									<?php if ($this->_tpl_vars['userData'][$this->_tpl_vars['data']['uid']]['nickname']): ?><?php echo $this->_tpl_vars['userData'][$this->_tpl_vars['data']['uid']]['nickname']; ?>
<?php else: ?>游客<?php endif; ?></td>
								<td><?php echo $this->_tpl_vars['data']['uid']; ?>
</td>
								<td><?php echo ((is_array($_tmp="Y-m-d H:i:s")) ? $this->_run_mod_handler('date', true, $_tmp, $this->_tpl_vars['data']['create_time']) : date($_tmp, $this->_tpl_vars['data']['create_time'])); ?>
</td>
								<td>
								<?php $_from = $this->_tpl_vars['formType']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
    foreach ($_from as $this->_tpl_vars['name']):
?>
									<?php echo $this->_tpl_vars['name']; ?>
:<span class="text-muted"><?php echo $this->_tpl_vars['data'][$this->_tpl_vars['name']]; ?>
</span>&nbsp;  
								<?php endforeach; endif; unset($_from); ?>
								</td>
								<?php if ($this->_tpl_vars['audit']): ?>
								<th><input type="checkbox" class="audit" name="audit[<?php echo $this->_tpl_vars['data']['id']; ?>
]" value="<?php echo $this->_tpl_vars['data']['id']; ?>
" <?php if ($this->_tpl_vars['data']['audit'] == 2): ?>checked<?php endif; ?>/></th>
								<?php endif; ?>
							</tr>
							<?php endforeach; endif; unset($_from); ?>
							<?php else: ?>
							<tr>
								<td colspan="3" align="center" class="text-muted">无表单数据</td>
							</tr>
							<?php endif; ?>
						</tbody>
					</table>
					<?php if ($this->_tpl_vars['audit']): ?>
					
					<div style="float:right" ><input type="checkbox" id="audit" value="2" />全选&nbsp;&nbsp;&nbsp;&nbsp;

					<a id="audit_submit" href="javascript:;" class="button button-default button-rounded">更新状态</a>

					</div>

					<br /><br /><br />
					<?php endif; ?>
					<div class="page"><?php echo $this->_tpl_vars['page_html']; ?>
</div><p  style="float:right" >参与人数:<?php echo $this->_tpl_vars['total_num']; ?>
</p>
				</div>
			</div>
		</div>
	</div>
</div>

<?php $_smarty_tpl_vars = $this->_tpl_vars;
$this->_smarty_include(array('smarty_include_tpl_file' => "./admin/activity/common_right.html", 'smarty_include_vars' => array()));
$this->_tpl_vars = $_smarty_tpl_vars;
unset($_smarty_tpl_vars);
 ?>
<div style="clear:both;"></div>
</div>


<script>
KISSY.use('node, io, event', function (S, Node, IO, Event) {
	var $ = S.all;
	
});


function checkAll()
{
	$("#audit").click(function(){
		if ($(this).prop('checked')) {
			$(".audit").prop('checked',true);
		} else {
			$(".audit").prop('checked',false);
		}
	})
}

function submit()
{
	$("#audit_submit").click(function()
	{
		var yes = [];
		var no = [];
		$(".audit").each(function(){
			if ($(this).prop('checked')) {
				yes.push($(this).val());
			} else {
				no.push($(this).val());
			}
		});

		var state = true;
		if (state) {
			var id = '<?php echo $this->_tpl_vars['eventData']['id']; ?>
';
			var url = '<?php echo $this->_tpl_vars['web_cfg']['domain']; ?>
/?c=Admin_Activity_UserParticipateLog&a=Audit';
			$.post(url, {id:id,yes:yes.join(','),no:no.join(',')}, function(res) {
				alert('更新成功');
			});
		} else {
			alert('请选择一个选项');
		}
	})
}
checkAll();
submit();
</script>

<?php $_smarty_tpl_vars = $this->_tpl_vars;
$this->_smarty_include(array('smarty_include_tpl_file' => "./admin/bottom.html", 'smarty_include_vars' => array()));
$this->_tpl_vars = $_smarty_tpl_vars;
unset($_smarty_tpl_vars);
 ?>