{include file="templates/html_header.html"}
		<!-- /section:basics/navbar.layout -->
		<div class="main-container ace-save-state" id="main-container">
			<script type="text/javascript">
			{literal}
				try{ace.settings.loadState('main-container')}catch(e){}
			{/literal}
			</script>
			<!-- #section:basics/sidebar -->
			{include file="templates/html_sidebar.html"}
			<!-- /section:basics/sidebar -->
			<div class="main-content">
				<div class="main-content-inner">
					<!-- #section:basics/content.breadcrumbs -->
					<div class="breadcrumbs ace-save-state" id="breadcrumbs">
						<ul class="breadcrumb">
							<li>
								<i class="ace-icon fa fa-home home-icon"></i>
								<a href="index.php">首页</a>
							</li>

							
							<li class="active">{$title}</li>
						</ul><!-- /.breadcrumb -->
						<!-- /section:basics/content.searchbox -->
					</div>

					<!-- /section:basics/content.breadcrumbs -->
					<div class="page-content">
					<h3 class="header smaller lighter blue">
						{$title}
						<small>列出所有中奖信息</small>
					</h3>
						<div class="row">
							<div class="col-xs-12">
								<!-- PAGE CONTENT BEGINS -->
									<div class="widget-box widget-color-blue" id="widget-box-2">
										<div class="widget-header">
											<h5 class="widget-title bigger lighter">
												<i class="ace-icon fa fa-users"></i>
												中奖名单
											</h5>
											<div class="widget-toolbar no-border">
												<label>
												<button class="ace btn btn-xs btn-warning btn_export" onclick="clearzjlist('{$currentplug}');">点击清空当前类型的中奖记录</button>
												</label>
												<label>
												<button class="ace btn btn-xs btn-warning btn_export" onclick="window.open('exportzjlist.php');">导出excel</button>
												</label>
												<label>
													<select class="ace" name="plug">
													{foreach $cjplugs $item}
													<option value="{$item['name']}" {if $currentplug==$item['name']}selected{/if}>{$item['title']}</option>
													{/foreach}
													</select>
												</label>
											</div>
											
										</div>
										<div class="widget-body">
													<div class="widget-main no-padding">
														<table class="table table-striped table-bordered table-hover">
															<thead class="thin-border-bottom">
																<tr>
																	<th>奖项</th>
																	<th>头像</th>
																	<th>昵称</th>
																	<th>姓名</th>
																	<th>手机号</th>
																	<th>状态</th>
																	<th>操作</th>
																</tr>
															</thead>
															<tbody>
															{foreach $zjlist $item}
																<tr>
																	<td class="">{$item['awardname']}</td>
																	<td class=""><img src="{$item['avatar']}" style="width:40px;height:40px;"/></td>
																	<td class="">{$item['nickname']}</td>
																	<td class="">{$item['signname']}</td>
																	<td>{$item['phone']}</td>
																	<td>{if $item['status']==2}未发{else if $item['status']==3}已发{/if}</td>
																	<td>
																		<a href="###" onclick="fj('{$item['openid']}')"><span class="label label-info">发奖</span></a>
																		<a href="###" onclick="del('{$item['openid']}')"><span class="label label-danger">删除</span></a>
																	</td>
																</tr>
															{/foreach}
															</tbody>
														</table>
													</div>
											{$pagerhtml}
												</div>
										
									</div>
								<!-- PAGE CONTENT ENDS -->
							</div><!-- /.col -->
						</div><!-- /.row -->
					</div><!-- /.page-content -->
				</div>
			</div><!-- /.main-content -->
{include file="templates/html_footercontent.html"}
<!-- 写每个页面自定的js -->
<script type="text/javascript">
{literal}
jQuery(function($){
	$('select[name=plug]').on('change',function(){
		window.location.href='zjlist.php?plug='+$(this).val();
	})
	
})
function fj(openid){
	var plug=$('select[name=plug]').val();
	$.ajax({
		'url':'dozjlist.php?action=fj',
		'data':{'openid':openid,'plug':plug},
		'type':'post',
		'dataType':'json',
		'success':function(json){
			alert(json.message);
			window.location.reload();
		}
	})
}
function del(openid){
	if(!confirm("确认要删除这条中奖信息吗？"))return false;
	var plug=$('select[name=plug]').val();
	$.ajax({
		'url':'dozjlist.php?action=del',
		'data':{'openid':openid,'plug':plug},
		'type':'post',
		'dataType':'json',
		'success':function(json){
			alert(json.message);
			window.location.reload();
		}
	})
}
function clearzjlist(cjtype){
	var cjtypename=$("select[name=plug]").find("option:selected").text();
	if(!confirm("确认要删除【"+cjtypename+"】中奖信息吗？"))return false;
	$.ajax({
		'url':'dozjlist.php?action=clearzjlist',
		'data':{'plug':cjtype},
		'type':'post',
		'dataType':'json',
		'success':function(json){
			alert(json.message);
			window.location.reload();
		}
	});
}
{/literal}
</script>
{include file="templates/html_footer.html"}