{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 ><a href="shakeconfig.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="btn btn-xs btn-warning btn_add" onclick="openvoteitemform(0)">添加</button>
										</label>
										
									</div> -->
								</div>
							<div class="widget-body">
								<div class="widget-main no-padding">
									<!-- PAGE CONTENT BEGINS -->
									<table class="table table-striped table-bordered table-hover">
										<thead class="thin-border-bottom">
											<tr>
												<th>名次</th>
												<th>头像和信息</th>
												<th>成绩</th>
											</tr>
										</thead>
										<tbody>
										
										{foreach from=$shake_record item=item name=foo}
											<tr >
												<td >{$smarty.foreach.foo.iteration}</td>
												<td ><img src="{$item['avatar']}" style="width:80px;height:80px;"/><span>昵称：{$item['nickname']}</span><span>姓名：{$item['signname']}</span><span>手机号：{$item['phone']}</span></td>
												<td >{$item['point']}</td>
											</tr>
										{/foreach}
										</tbody>
									</table>
									{$pagehtml}
									</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 src="assets/ace_v1.4/components/jqGrid/js/jquery.jqGrid.js"></script>
<script src="assets/ace_v1.4/components/jqGrid/js/i18n/grid.locale-cn.js"></script>
<script type="text/javascript" src="assets/js/jquery.form.js"></script>
<script type="text/javascript">
{literal}
function openvoteitemform(id){
	$('input[name=id]').val(id);
	if(id>0){
		$.ajax({
			"url":"dovoteconfig.php?action=getvoteitem",
			'type':'post',
			'data':{"id":id},
			"dataType":"json",
			"success":function(json){
				if(json.code>0){
					$('input[name=voteitem]').val(json.data.voteitem);
					$('input[name=votecount]').val(json.data.votecount);
					
					if(json.data.imagepath!=null){
						$('input[name=imagepath]')
						.ace_file_input('show_file_list', [
							{type: 'image', name: '背景图', path:json.data.imagepath },
						]);
					}
				}else{
					alert(json.message);
				}
			}
		})
	}else{

	}
	$('#voteitemform').modal('show');
}

function del(id){
	if(!confirm("确定要删除这个选项及相关的数据吗？"))return false;
	$.ajax({
		"url":"dovoteconfig.php?action=delvoteitem",
		'type':'post',
		'data':{"id":id},
		"dataType":"json",
		"success":function(json){
			if(json.code>0){
				window.location.reload();
			}else{
				alert(json.message);
			}
		}
	})
}
$(function(){
	$('.imageuploader').ace_file_input({
		style: 'well',
		btn_choose: '点击此处选择图片',
		btn_change: null,
		no_icon: 'ace-icon fa fa-cloud-upload',
		droppable: true,
		maxSize: 550000,
		allowExt: ["jpeg", "jpg", "png", "gif"],
		allowMime: ["image/jpg", "image/jpeg", "image/png", "image/gif"],
		thumbnail: 'large',//large | fit
		previewHeight:200,
		preview_error : function(filename, error_code) {
		}
	}).on('change', function(){
		
	});
	
	$('.btn-save-item').bind('click',function(){
		$('#saveform').ajaxSubmit({
			dataType: 'json',
			success:function(json){
				if(json.code>0){
					window.location.reload();
				}else{
					alert(json.message);
				}
			}
		});
		return false;
	});
})
{/literal}
</script>
{include file="templates/html_footer.html"}