<extend name="Public/base"/>
<block name="css">
<link rel="stylesheet" href="__CSS__/select2.min.css" type="text/css" />
<link href="__STATIC__/datetimepicker/css/datetimepicker.css" rel="stylesheet" type="text/css">
<php>if(C('COLOR_STYLE')=='blue_color') echo '<link href="__STATIC__/datetimepicker/css/datetimepicker_blue.css" rel="stylesheet" type="text/css">';</php>
<link href="__STATIC__/datetimepicker/css/dropdown.css" rel="stylesheet" type="text/css">

<style type="text/css">
.forbidden {
    color: #d0d0d0; 
}
.forbidden:hover
{
background-color: #FF9797;
}
#asd{
    display: none;
}
</style>
<style>
.select2-container--default .select2-selection--single {
				color: #000;
		resize: none;
		border-width: 1px;
		border-style: solid;
		border-color: #a7b5bc #ced9df #ced9df #a7b5bc;
		box-shadow: 0px 3px 3px #F7F8F9 inset;height:35px;
		height:28px;border-radius:3px;font-size:12px;
}
.select2-container--default .select2-selection--single .select2-selection__rendered {
		line-height:35px;
		line-height:28px;
}
.select2-container--default .select2-selection--single .select2-selection__arrow {
		height:26px;
}
.select2-container--default .select2-search--dropdown .select2-search__field {
	height:26px;line-height:26px;font-size:12px;
}
.select2-results__option[aria-selected] {font-size:12px;}
</style>
<style>
.butnbox {padding:10px 0 20px;}
.butnbox .butnlist {overflow:hidden;clear:both;}
.butnbox .butnlist .butn,.butnbox .butnlist .butn:hover {text-decoration:none;border:none;}
.butnbox .butnlist .butn {display:inline-block;width:120px;height:38px;line-height:38px;text-align:center;color:#FFF;background:#3C95C8;border-radius:3px;}
.butnbox .butnlist .butn.last {background:#009900;}
.butnbox .butnlist .butn~.butn {margin-left:20px;}
.data_list table tbody tr a.disabled,.data_list table tbody tr a.disabled:hover {color:#999;cursor:default;}
</style>
</block>
<block name="body">
<style>.data_list table tbody td:last-child a {float:none;}</style>
<div class="cf main-place top_nav_list navtab_list">

	<h3 class="page_title">系统检查</h3>
	<p class="description_text">说明:汇总展示管理后台的操作异常记录并对其进行处理</p>
</div>
 
<div class="butnbox">
	<div class="butnlist jscheckbutn">	
		<a href="javascript:;" class="butn" url="{:U('checkUser')}">检测用户</a>
		<a href="javascript:;" class="butn" url="{:U('checkWithdraw')}">检测结算</a>				
		<a href="javascript:;" class="butn" url="{:U('checkPromote')}">检测推广员</a>				
		<a href="javascript:;" class="butn last" url="{:U('checkOne')}">一键检测</a>			
	</div>
	
</div>



<div class="cf top_nav_list">
	<div class="fl button_list">
		<div class="tools">
			<a class="ajax-post " target-form="ids" url="{:U('Check/status',array('status'=>1,'msg_type'=>13))}"><span class="button_icon button_icon9"></span>处理</a>
			<a class="ajax-post " target-form="ids" url="{:U('Check/status',array('status'=>2,'msg_type'=>14))}"><span class="button_icon button_icon9"></span>忽略</a>
		</div>
	</div>
	<!-- 高级搜索 -->
	<div class="jssearch fl cf search_list" >
			<div class="input-list search-title-box">
						<label>搜索:</label>
					</div>
					<!--游戏类型搜索END-->
					<div class="input-list input-list-game search_label_rehab">
							<select id="type" name="type" class="select_gallery" style="width:200px;">
									<option value="">异常类型</option>
									<volist name=":get_bug_list()" id="vo">
											<option value="{$key}">{$vo}</option>
									</volist>
							</select>   
					</div>
					<div class="input-list input-list-game search_label_rehab">
							<select id="status" name="status" style="width:200px;">
									<option value="">状态</option>
									<option value="0">未处理</option>
									<option value="1">已处理</option>
									<option value="2">忽略</option>
							</select>   
					</div>
					<div class="input-list">
							<input type="text" id="time-start" name="start" class="" value="{:I('start')}" placeholder="开始时间" />
							-
							<div class="input-append date" id="datetimepicker"  style="display:inline-block">
							<input type="text" id="time-end" name="end" class="" value="{:I('end')}" placeholder="结束时间" />
							<span class="add-on"><i class="icon-th"></i></span>
							</div>
					</div>
					
					<div class="input-list">
						<a class="sch-btn" href="javascript:;" id="search" url="{:U('Check/index',array('model'=>$model['name'],'row'=>I('row')))}">搜索</a>
					</div>
					
	</div>
</div>


<!-- 数据列表 -->
<div class="data_list">
	<div class="">
		<table>
			<!-- 表头 -->
			<thead>
				<tr>
					<th><input class="check-all" type="checkbox"></th>
					<th>序号</th>
					<th>异常简介</th> 
					<th>异常类型</th>
					<th>异常时间</th>
					<th>异常状态</th>
					<th>操作</th>
				</tr>
			</thead>
			<!-- 列表 -->
			<tbody>
			<empty name ="list_data">
			<tr><td colspan="7" class="text-center">aOh! 暂时还没有内容!</td></tr>
			<else />
				<volist name="list_data" id="vo">
						<tr>
								<td>
								<neq name="vo.status" value="1">
								<input class="ids" type="checkbox" value="{$vo['id']}"  name="ids[]">
								<else />
								<input class="ids" type="checkbox" disabled value="{$vo['id']}"  name="ids[]">
								</neq>
								</td>
								<td>{$vo.id}</td>
								<td><a target="__blank" href="{$_SERVER['REQUEST_SCHEME']}://{$_SERVER['HTTP_HOST']}{$vo.url}">{$vo.info}</a></td>
								<td>{:get_bug_name_by_id($vo['type'])}</td>
								<td>{$vo.create_time|date='Y-m-d H:i:s',###}</td>
								<td>{:get_info_status($vo['status'],40)}</td>
								<td>
									<div class="">
										<neq name="vo.status" value="1">
												<!-- <a class="ajax-post" target-form="ids" href="" url="{:U('status',array('ids'=>$vo['id'],'status'=>1,'msg_type'=>13))}">处理</a>
												 --><a class="" target="__blank" href="{$_SERVER['REQUEST_SCHEME']}://{$_SERVER['HTTP_HOST']}{$vo.url}">处理</a>
												<span>|</span>
												<a class="ajax-post" target-form="ids" href="" url="{:U('status',array('ids'=>$vo['id'],'status'=>2,'msg_type'=>14))}">忽略</a>
										<else />
												<a class="disabled" href="javascript:;">处理</a>
												<span>|</span>
												<a class="disabled" href="javascript:;">忽略</a>
										</neq>
										
									</div>
								</td>
						</tr>
				</volist>
			</empty>
			</tbody>
		</table>
	</div>
</div>
<div class="page">
	<a class="sch-btn" href="{:U('Export/check_lists',array_merge(['xlsname'=>'管理_系统检查'. ((I('t',0)==1)?'_检测用户':((I('t',0)==2)?'_检测结算':((I('t',0)==3)?'_检测推广员':((I('t',0)==4)?'_一键检测':''))))],I('get.')))}">导出</a>
        {$_page|default=''}
</div>

<div class="common_settings">
			<span class="plus_icon"><span><img src="__IMG__/zwmimages/icon_jia.png"></span></span>
			<form class="addShortcutIcon">
				<input type="hidden" name="title" value="{$m_title}">
				<input type="hidden" name="url" value="Check/index">
			</form>
			<a class="ajax-post add-butn <notempty name='commonset'>addSIsetted</notempty>" href="javascript:;" target-form="addShortcutIcon" url="{:U('Think/addShortcutIcon')}"><img src="__IMG__/zwmimages/icon_jia.png"><span><notempty name='commonset'>已添加<else />添加至常用设置</notempty></span></a>
		</div>

</block>

<block name="script">
<script type="text/javascript" src="__STATIC__/datetimepicker/js/bootstrap-datetimepicker.min.js"></script>
<script type="text/javascript" src="__STATIC__/datetimepicker/js/locales/bootstrap-datetimepicker.zh-CN.js" charset="UTF-8"></script>
<script type="text/javascript" src="__JS__/bootstrap.min.js"></script>
<script type="text/javascript" src="__JS__/select2.min.js"></script>
<script src="__STATIC__/layer/layer.js"></script>
<script src="__STATIC__/layer/extend/layer.ext.js"></script>
<style>
  .layui-layer-demo .layui-layer-title {background:#F0F5F7;font-weight:bold;}
  .layui-layer-demo .layui-layer-content {}
  .layui-layer-demo .layui-layer-content table{width:100%;border:0;border-spacing:0;padding:0;}
  .layui-layer-demo .layui-layer-content td {height:42px;padding-left:20px;}
  .layui-layer-demo .layui-layer-content tr:hover {background:#F0F5F7;}
  .layui-layer-demo .layui-layer-content tr~tr {border-top:1px solid #ccc;}
  .layui-layer-demo .layui-layer-content td~td {border-left:1px solid #ccc;}
  .layui-layer-demo .layui-layer-content tr:last-child td {}
</style>
<script type="text/javascript">
Think.setValue('type',{:I('type','""')});
Think.setValue('status',{:I('status','""')});
Think.setValue('row',{:I('row',10)});
//导航高亮
highlight_subnav("{:U('Check/index')}");
$(function(){
	//搜索功能
	$("#search").click(function(){
		var val = new Date($.trim($("#time-start").val())).getTime();
		var end = new Date($.trim($('#time-end').val())).getTime();
		if (val>end) {
		  layer.msg('开始时间大于结束时间!');$(this).val('');
			return false;
		}
		var url = $(this).attr('url');
        var query  = $('.jssearch').find('input').serialize();
        query  += "&"+$('.jssearch').find('select').serialize();
        query = query.replace(/(&|^)(\w*?\d*?\-*?_*?)*?=?((?=&)|(?=$))/g,'');
        query = query.replace(/^&/g,'');
        if( url.indexOf('?')>0 ){
            url += '&' + query;
        }else{
            url += '?' + query;
        }
		window.location.href = url;
	});

    //回车自动提交
    $('.jssearch').find('input').keyup(function(event){
        if(event.keyCode===13){
            $("#search").click();
        }
    });

		
		$('#time-start').datetimepicker({
        format: 'yyyy-mm-dd',
        language:"zh-CN",
        minView:2,
        autoclose:true
    });

    $('#datetimepicker').datetimepicker({
       format: 'yyyy-mm-dd',
        language:"zh-CN",
        minView:2,
        autoclose:true,
        pickerPosition:'bottom-left'
    })
    
		$('.jscheckbutn a').on('click',function() {
			var that = $(this);
			var url = that.attr('url');
			if(that.hasClass('disabled')) {return false;}
			that.addClass('disabled');
			var index = layer.load(2, {shade: [0.2,'#000']});

			$.ajax({
				type:'post',
				dataType:'json',
				url:url,
				data:{},
				success:function(data) {
					setTimeout(function(){
						layer.close(index);
						that.removeClass('disabled');
						if (parseInt(data.status)==1) {
							layer.msg(data.info,{shade:[0.01,'#FFF'],time:1000,});
							setTimeout(function(){window.location.href=data.url;},1000);						
						} else {
							layer.msg(data.info,{shade:[0.01,'#FFF'],time:1000,});
							setTimeout(function(){window.location.href=data.url;},1000);
						}
					},1000);
				},
				error:function() {
					setTimeout(function(){
						layer.close(index);that.removeClass('disabled');layer.msg('服务器故障,请稍候再试...',{shade: [0.01,'#FFF'],time:1000,});
					},600);
				},
			});
			
			
			return false;
		});
    
});





</script>
</block>