{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"><a href="redpacket.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">
												<button class="btn btn-xs btn-warning btn_gen">生成手动发放脚本</button>
												</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>
																</tr>
															</thead>
															<tbody>
															{foreach $redpacketusers as $item}
																<tr data="{$item['openid']}">
																	<td ><img src="{$item['avatar']}" style="width:60px;height:60px;"/>{$item['nickname']}</td>
																	<td >{$item['amount']}</td>
																	<td >{$item['statustext']}</td>
																	<td >{$item['updated_at']}</td>
																	<td ><a href="redpacketuserlog.php?userid={$item['userid']}">详情</a></td>
																</tr>
															{/foreach}
															</tbody>
														</table>
													</div>
											{$pagerhtml}
												</div>
									</div>

									<div id="genscriptmodal" class="modal" tabindex="-1">
									<div class="modal-dialog">
										<div class="modal-content">
											<div class="modal-header">
												<button type="button" class="close" data-dismiss="modal">&times;</button>
												<h4 class="blue bigger">手动发放红包脚本</h4>
											</div>
											<div class="modal-body">
												<div class="row">
													<div class="col-sm-12">
														<div class="form-group">
															<div>
																<p>复制下面文本框内的内容，保存成txt文件导入商户平台，可以进行红包手动发放操作。注意每次不要超过3000行数据。</p>
																<p>文本框内不包含已经发放成功的红包信息</p>
															</div>
														</div>
														<div class="form-group">
															<textarea name="hongbaoscript" class="form-control" readonly="true" rows="30"></textarea>
														</div>
													</div>
												</div>
											</div>

											<div class="modal-footer">
												<button class="btn btn-sm" data-dismiss="modal" >
													<i class="ace-icon fa fa-times"></i>
													关闭
												</button>
											</div>
										</div>
									</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">
	var roundid={$roundid};
	{literal}
	$(function(){
		$('.btn_gen').bind('click',function(){
			$('textarea[name=hongbaoscript]').val('');
			$.ajax({
				"url":"doredpacketusers.php?action=genscript",
				"data":{"roundid":roundid},
				"type":"get",
				"success":function(response){
					$('textarea[name=hongbaoscript]').val(response);
				}
			});
			$('#genscriptmodal').modal('show');
		});
	});
	{/literal}
</script>
{include file="templates/html_footer.html"}