<%@ page contentType="text/html;charset=UTF-8"%>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<!DOCTYPE html>
<html>
<head>
	<%@include file="/WEB-INF/views/include/head.jsp"%>
	<link href="${ctxStatic }/css/plugins/bootstrap-table/bootstrap-table.min.css?v=${version}" rel="stylesheet">
</head>
<body class="gray-bg">
<div class="wrapper wrapper-content animated fadeInRight">
	<div class="row">
		<div class="col-sm-12">
			<div class="ibox float-e-margins">
				<div class="ibox-content">
					<form id="searchForm" class="form-horizontal">
						<div class="form-group">
							<input type="hidden" name="state" value="1">
							<label class="col-sm-1 control-label">姓名</label>
							<div class="col-sm-2">
								<input type="text" class="form-control" id="name" name="name">
							</div>
							<label class="col-sm-1 control-label">身份证号</label>
							<div class="col-sm-2">
								<input type="text" class="form-control" id="cardnumber" name="cardnumber">
							</div>
							<label class="col-sm-1 control-label">所属公司</label>
							<div class="col-sm-2">
								<input type="text" class="form-control" id="pxdwmc" name="pxdwmc">
							</div>
							<label class="col-sm-1 control-label">打印状态</label>
							<div class="col-sm-2">
								<select class="form-control m-b"  id="isprint" name="isprint">
									<option value="" data-code="">全部</option>
									<option value="0" data-code="">未打印</option>
									<option value="1" data-code="">已打印</option>
								</select>
							</div>
							<label class="col-sm-1 control-label">是否有照片</label>
							<div class="col-sm-2">
								<select class="form-control m-b"  id="havephoto" name="havephoto">
									<option value="" data-code="" selected>全部</option>
									<option value="1" data-code="">是</option>
									<option value="0" data-code="">否</option>
								</select>
							</div>
							<label class="col-sm-1 control-label">历史数据</label>
							<div class="col-sm-2">
								<select class="form-control m-b"  id="isOldData" name="isOldData">
									<option value="0" data-code="0">否</option>
									<option value="1" data-code="1">是</option>
									<option value="">全部</option>
								</select>
							</div>
							<div class="col-sm-2">
								<button class="btn btn-primary" type="button" onclick="reSearch();">搜索</button>
							</div>
						</div>
					</form>
					<div class="btn-group hidden-xs" id="tableEventsToolbar" role="group">
						<%--<a href="<c:url value='/manage/security/batchSaveElectronCerUrlForOldData.json?sid=${sid}'/>" target="ajaxTodo" title="确定生成保安员证旧数据电子证书地址?" class="btn btn-primary">
							保安员证旧数据生成电子证书地址
						</a>--%>
						<a href="<c:url value='/manage/security/batch.do?sid=${sid}'/>" target="dialog" width="960px" height="600px" class="btn btn-primary">批量重新推送保安员资格证书信息给saas</a>
						<a href="<c:url value='/manage/security/batchGrade.do?sid=${sid}'/>" target="dialog" width="960px" height="600px" class="btn btn-primary">批量重新推送等级证给saas</a>
						<a href="<c:url value='/manage/security/viewCount.json?sid=${sid}'/>" target="ajaxTodo" title="确定查看调用次数?" class="btn btn-primary">查看调用次数</a>


					</div>
					<table id="defaultTable">
					</table>
				</div>
			</div>
		</div>
	</div>
</div>
<%@include file="/WEB-INF/views/include/foot.jsp"%>
<script src="${ctxStatic }/js/plugins/bootstrap-table/bootstrap-table.min.js?v=${version}"></script>
<script src="${ctxStatic }/js/plugins/bootstrap-table/locale/bootstrap-table-zh-CN.min.js?v=${version}"></script>
<script src="${ctxStatic }/js/tablePage.js?v=${version}"></script>
<script>
    $(function(){
        var objId = "defaultTable";
        var url = ctx + "/manage/security/searchForPage.json?sid=${sid}";
        var columns = [
            {title: 'id',field: 'id', visible: false, align: 'center',valign: 'middle'},
            {title: '姓名',field: 'name',align: 'center',valign: 'middle'},
            {title: '身份证号',field: 'idnum',align: 'center',valign: 'middle'},
            {title: '报名公司',field: 'companyName',align: 'center',valign: 'middle'},
            {title: '保安员证号',field: 'zsbh',align: 'center',valign: 'middle'},
            {title: '是否有照片',field: 'havephoto', align: 'center',valign: 'middle',
                formatter:function(value,row,index){
                    return  (row.havephoto==true?"是":(row.havephoto==false?"否":"")) || '';
                }
			},
            {title: '操作',field: '#',align: 'center',
                formatter:function(value,row,index){
                    var d = '';
                    if(row.havephoto && row.havephoto == true ){

					}else {
                        d = d + '<a class="ml-10 btn btn-primary" href="' + ctx + '/manage/security/upload/' + row.idnum + '.do?sid='+sid+'" target="dialogDetail" width="960px" height="600px">上传头像</a>';
                        d = d + '<a class="ml-10 btn btn-primary" href="' + ctx + '/manage/security/getPersonImg/' + row.id + '.do?sid='+sid+'" target="ajaxTodo" title="确定获取人口库头像?">获取人口库头像</a>';
                    }
                    d = d + '<a class="ml-10 btn btn-primary" href="' + ctx + '/manage/security/sendToSAAS/' + row.id + '.do?sid='+sid+'" target="ajaxTodo" title="确定同步给SAAS?">同步给SAAS</a>';
                    return d;
                }
            }
        ];
        bootstrapTableInit(objId,url,columns);

        initLayerBtnClick();
    })
</script>
</body>
</html>
