<%@page import="com.blueland.bpm.engine.config.model.*" %>
<%@page import="com.blueland.bpm.common.page.*" %>
<%@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_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 editMsgRemind(remindId){
			var url="";
			if(null!=remindId && ""!=remindId){
				url="${ctx}/msgRemind/edit.do?remindId="+remindId;
			}else{
				url="${ctx}/msgRemind/create.do";
			}
			
			showDiaLog(url,"待办消息提醒",'500px','260px');
		}
		
		function showMsgRemind(remindId){
			var url="${ctx}/msgRemind/show.do?remindId="+remindId;
			
			showDiaLog(url,"待办消息提醒",'500px','260px');
		}
	</script>
</head>
<body>
	<%@ include file="/commons/messages.jsp" %>
	<form id="queryForm" name="queryForm" action="${ctx}/msgRemind/list.do" method="get" style="display: inline;">
		<div class="main-container" id="main-container">	
		<div class="panel panel-primary">
			<div class="panel-heading">
				待办消息提醒
			</div>
			<div class="panel-body" id="panel-body" style="padding:3px;">
				<div class="well well-sm" style="margin-bottom: 2px;">
					<table width="100%" border="0" cellspacing="0" cellpadding="0" class="table-search">
						<tr>	
							<!-- <td>提醒流程定义：</td>		
							<td>
								<input  class="input" value="${query.remindProcessDefKey}" id="remindProcessDefKey" name="remindProcessDefKey" maxlength="50"  />
							</td> -->
							<td>是否接收短信提醒：</td>		
							<td>
								<select name="isReceiveSms">
									<option value="">请选择</option>
									<option value="Y" <c:if test='${"Y"==query.isReceiveSms}'>selected="selected"</c:if>>是</option>
									<option value="N" <c:if test='${"N"==query.isReceiveSms}'>selected="selected"</c:if>>否</option>
								</select>
							</td>
							<td>是否接收邮件提醒：</td>		
							<td>
								<select name="isReceiveMail">
									<option value="">请选择</option>
									<option value="Y" <c:if test='${"Y"==query.isReceiveMail}'>selected="selected"</c:if>>是</option>
									<option value="N" <c:if test='${"N"==query.isReceiveMail}'>selected="selected"</c:if>>否</option>
								</select>
							</td>
							<td>提醒所属系统：</td>		
							<td>
								<select name="remindAppId" id="remindAppId">
									<option value="">-请选择-</option>
									<c:forEach var="app" items="${apps}">
										<option value="${app.appId}" <c:if test="${app.appId == query.remindAppId}">selected="selected"</c:if>>${app.appName}</option>
									</c:forEach>
								</select>
							</td>
						</tr>	
						<tr>
							<td colspan="7">
								<button type="submit" class="btn btn-xs btn-primary" 
								onclick="getReferenceForm(this).action='${ctx}/msgRemind/list.do'">
										查&nbsp;&nbsp;询
										<i class="ace-icon fa fa-search bigger-110"></i>
								</button>
								<button type="button" class="btn btn-xs btn-success" onclick="editMsgRemind();">
									新增
									<i class="ace-icon fa fa-plus bigger-110"></i>
								</button>
								<button type="button" class="btn btn-xs btn-danger" 
								onclick="batchDelete('${ctx}/msgRemind/delete.do','items',document.forms.queryForm)">
									删除
									<i class="ace-icon fa fa-trash-o bigger-110"></i>
								</button>
							</td>
						</tr>
					</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 sortColumn="remindUserId" style="width: 50px;">提醒人</th>
						<!-- <th sortColumn="remindProcessDefKey" style="width: 300px;">提醒流程定义</th> -->
						<th sortColumn="isReceiveSms" style="width: 80px;">是否接收短信提醒</th>
						<th sortColumn="isReceiveMail" style="width: 80px;">是否接收邮件提醒</th>
						<!-- <th sortColumn="isReceiveTodo" style="width: 100px;">是否接收待办到达提醒</th>
						<th sortColumn="isReceiveReader" style="width: 100px;">是否接收待阅到达提醒</th> -->
						<th sortColumn="remindAppId" style="width: 100px;">提醒所属系统</th>
						<!-- <th sortColumn="remindTempContent" style="width: 200px;">提醒模版内容</th> -->
			
						<th style="width: 100px;">操作</th>
					  </tr>
					</thead>
				<tbody>
		  
				   <c:forEach items="${page.result}" var="item" varStatus="status">
		  	  
			  <tr class="${status.count % 2 == 0 ? 'odd' : 'even'}">
				
				<td><input type="checkbox" name="items" value="remindId=${item.remindId}&"></td>
				
				<td>${item.remindUserName}&nbsp;</td>
				<!-- <td>${item.remindProcessDefKey}&nbsp;</td> -->
				<td>${item.isReceiveSms eq 'Y'?"是":"否"}</td>
				<td>${item.isReceiveMail eq 'Y'?"是":"否"}</td>
				<!-- <td>${item.isReceiveTodo eq 'Y'?"是":"否"}</td>
				<td>${item.isReceiveReader eq 'Y'?"是":"否"}</td> -->
				<td>${item.remindAppName}</td>
				<!-- <td>${item.remindTempContent}&nbsp;</td> -->
				<td>
					<!-- <a href="javascript:void(0);" onclick="showMsgRemind('${item.remindId}');">查看</a>&nbsp;&nbsp; -->
					<a href="javascript:void(0);" onclick="editMsgRemind('${item.remindId}');">修改</a>
				</td>
			  </tr>
			  
		  	  </c:forEach>
				</tbody>
				</table>
				<simpletable:pageToolbar page="${page}">
				</simpletable:pageToolbar>
			</div>
						<!-- /.table-responsive -->
					</div>
					<!-- /span -->
				</div>
			</div>
		</div>
		</div>
		</form>
</body>
</html>	
