<%@page import="com.blueland.bpm.log.model.*" %>
<%@page import="com.blueland.bpm.engine.config.model.*" %>
<%@page import="com.blueland.bpm.common.page.*" %>
<%@page import="com.blueland.bpm.common.util.*"%>
<%@page import="java.util.*" %>
<%@ page contentType="text/html;charset=UTF-8" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib tagdir="/WEB-INF/tags/simpletable" prefix="simpletable"%>
<%@ include file="/commons/taglibs.jsp" %>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<%@ include file="/commons/meta.jsp" %>
	<base href="<%=basePath%>">
	<title>短信发送日志</title>
	<link href="${ctx}/resource/js/plugins/loadmask/jquery.loadmask.css" rel="stylesheet" type="text/css" />
	<script type='text/javascript' src='${ctx}/resource/js/plugins/loadmask/jquery.loadmask.js'></script>
	<link href="${ctx_js_plugins}/simpletable/simpletable.css" type="text/css" rel="stylesheet">
	<script type="text/javascript" src="${ctx_js_plugins}/simpletable/simpletable.js"></script>

	<script type="text/javascript" >
		$(document).ready(function() {
			// 分页需要依赖的初始化动作
			window.simpleTable = new SimpleTable('queryForm','${page.thisPageNumber}','${page.pageSize}','${pageRequest.sortColumns}');
		});

		function changeRetryStatus(pelogId){
			if(window.confirm('确定执行[已处理]操作?')){
				setMask("main-container");
				jQuery.ajax({
					type: "POST",
					url: "${ctx}/processErrorLog/disposeErrorLog.do",
					data: {pelogId:pelogId},
					success: function(resp)
					{
						if(resp=="ERROR"){
							$("#main-container").unmask();
							alert("处理失败！");
						}else{
							$("#main-container").unmask();
							alert("处理成功！");
						}
					}
				});
			}
		}

	</script>
</head>
<body>
<%@ include file="/commons/messages.jsp" %>
<form id="queryForm" name="queryForm" action="${ctx}/smsConfigLog/list.do" method="get" style="display: inline;">
	<div class="main-container" id="main-container">
		<div class="panel panel-primary">
			<div class="panel-heading">
				<h8>短信发送日志</h8>
			</div>
			<div class="panel-body">
				<div class="form-group well well-sm" style="margin-bottom: 2px;">
					<table border="0" cellspacing="0" cellpadding="0"
						   class="table-search">
						<tbody>
						<tr colspan="7">
							<td>短信提醒人：</td>
							<td>
								<input  class="input" value="${query.userCode}" id="userCode" name="userCode" maxlength="50"  />
							</td>
							<td>手机号码：</td>
							<td>
								<input  class="input" value="${query.mobile}" id="mobile" name="mobile" maxlength="50"  />
							</td>
							<td>发送时间：</td>
							<td colspan="2">
								从<input  class="input"  value="<fmt:formatDate value="${query.startTime}" pattern="yyyy-MM-dd"/>" onclick="WdatePicker({dateFmt:'<%=SmsConfigLog.FORMAT_CREATE_TIME%>'})" id="startTime" name="startTime"   />
								到<input  class="input" value="<fmt:formatDate value="${query.endTime}" pattern="yyyy-MM-dd"/>" onclick="WdatePicker({dateFmt:'<%=SmsConfigLog.FORMAT_CREATE_TIME%>'})" id="endTime" name="endTime"   />
							</td>

							<td>
								<button type="submit" class="btn btn-xs btn-primary">
									查&nbsp;&nbsp;询
									<i class="ace-icon fa fa-search bigger-110"></i>
								</button>
							</td>
						</tr>
						<tr colspan="7">
							<c:if test="${ebpmAdmin}">
								<td>应用系统：</td>
								<td>
									<input  class="input" value="${query.appId}" id="appId" name="appId" maxlength="50"  />
								</td>
							</c:if>
						</tr>
						</tbody>
					</table>
				</div>
				<div class="row">
					<div class="col-xs-12">
						<div class="table-responsive">
							<table id="sample-table-1"
								   class="table table-striped table-bordered table-hover">
								<thead>

								<tr>
									<!-- <th style="width:25px;"><input type="checkbox" onclick="setAllCheckboxState('items',this.checked)"></th> -->
									<!-- 排序时为th增加sortColumn即可,new SimpleTable('sortColumns')会为tableHeader自动增加排序功能; -->
									<th>短信提醒人</th>
									<th>短信提醒人手机号码</th>
									<th>所属应用</th>
									<th>短信内容</th>
									<th sortColumn="createTime" >发送时间</th>
								</tr>
								</thead>
								<tbody>

								<c:forEach items="${page.result}" var="item" varStatus="status">

									<tr class="${status.count % 2 == 0 ? 'odd' : 'even'}">
										<td class="td" title="${item.userCode}">${item.userCode}&nbsp;</td>
										<td class="td" title="${item.mobile}">${item.mobile}&nbsp;</td>
										<td class="td" title="${item.appId}">${item.appId}&nbsp;</td>
										<td class="td" title="${item.content}">${item.content}&nbsp;</td>
										<td class="td" title="${item.createTimeString}">${item.createTimeString}&nbsp;</td>
									</tr>

								</c:forEach>
								</tbody>
							</table>
							<simpletable:pageToolbar page="${page}">
							</simpletable:pageToolbar>
						</div>
						<!-- /.table-responsive -->
					</div>
					<!-- /span -->
				</div>
			</div>
		</div>

	</div>
</form>
</body>
</html>	
