<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ include file="/common/taglibs.jsp"%>
<!DOCTYPE html>
<html>
<head>
<title>服务项管理</title>
<meta
	content='width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no'
	name='viewport'>
<!-- bootstrap 3.0.2 -->
<link href="<c:url value='/styles/lib/bootstrap.min.css'/>" rel="stylesheet" type="text/css" />
<!-- font Awesome -->
<link href="<c:url value='/styles/lib/font-awesome.min.css'/>" rel="stylesheet" type="text/css" />
<!-- Ionicons -->
<link href='<c:url value='/styles/lib/ionicons.min.css' />' rel="stylesheet" type="text/css" />
<!-- DATA TABLES -->
<link href="<c:url value='/styles/lib/datatables/dataTables.bootstrap.css' />" rel="stylesheet" type="text/css" />
<!-- Theme style -->
<link href="<c:url value='/styles/AdminLTE.css'/>" rel="stylesheet" type="text/css" />
<link rel="stylesheet" type="text/css" href="${ctx}/plugin/layer/mobile/need/layer.css" />
<script type="text/javascript" src="<c:url value='/scripts/lib/jquery-1.8.2.min.js'/>"></script>
<script type="text/javascript" src="<c:url value='/scripts/My97DatePicker/WdatePicker.js'/>" ></script>
<script type="text/javascript" src="${ctx}/plugin/layer/layer.js"></script>
<script type="text/javascript" src="${ctx}/scripts/admin/servicePack/servicePack.js"></script>
</head>
<body>
	<section class="content">
		<div class="row">
			<div class="col-xs-12">
				<div class="boxlist">
					<!-- /.box-header -->
					<div class="box-body table-responsive">
						<!-- 查询条件 -->
						<form class="query_frame form-inline" role="form"
							id="conditionform" action="${ctx}/admin/servicePack/list"
							method="POST">
							<input id="pageNo" name="pageNo" type="hidden" value="${pageNo}"/> 
							<div class="form-group">
								<label for="">服务项名称</label> <input type="text" id="name" width="20px"
									name="name" value="${name}" placeholder="请输入服务项名称查询" />
							</div>
							<div class="form-group">
								<label for="">开始时间</label> <input name="startTime"
									id="startTime" value="${startTime}" type="text"
									onfocus="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm'})"
									class="Wdate2 {required:true}"
									style="width: 120px; height: 35px;" />
							</div>
							--
							<div class="form-group">
								<input name="endTime" id="endTime" value="${endTime}"
									type="text" onfocus="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm'})"
									class="Wdate2 {required:true}"
									style="width: 120px; height: 35px;" />
							</div>
							<div class="form-group">
								<label for="">是否需要押金</label> <select name="isDeposit" id="isDeposit"
									class="form-control">
									<option value=""
										<c:if test="${isDeposit == '' || isDeposit == null}">selected='selected'</c:if>>请选择</option>
									<option value="0"
										<c:if test="${isDeposit == '0'}">selected='selected'</c:if>>否</option>
									<option value="1"
										<c:if test="${isDeposit == '1'}">selected='selected'</c:if>>是</option>
								</select>
							</div>
							<div class="form-group">
								<label for="">支付方式</label> <select name="paymentMethod" id="paymentMethod"
									class="form-control">
									<option value=""
										<c:if test="${paymentMethod == '' || paymentMethod == null}">selected='selected'</c:if>>请选择</option>
									<option value="0"
										<c:if test="${paymentMethod == '0'}">selected='selected'</c:if>>即时</option>
									<option value="1"
										<c:if test="${paymentMethod == '1'}">selected='selected'</c:if>>月结</option>
									<option value="2"
										<c:if test="${paymentMethod == '2'}">selected='selected'</c:if>>预付费</option>
								</select>
							</div>
						</form>
					</div>
					<!-- 按钮组 -->
					<div class="btns" style="float: right;">
						<a class="btn btn-success js_btn_reserve"
							href="${ctx}/admin/servicePack/toAddServicePack" title="新增">新增</a>
						<input type="button" id="btn-search" class="btn btn-info"
							value="查询" />
					</div>
					<table class="table table-bordered table-hover">
						<thead>
							<tr>
								<th>服务项名称</th>
<!-- 								<th>服务项类型</th> -->
								<th>时间</th>
								<th>是否需要押金</th>
								<th>支付方式</th>
								<th>服务项图片</th>
								<th>操作</th>
							</tr>
						</thead>
						<tbody>
							<c:forEach items="${page.items}" var="list" varStatus="status">
								<tr>
									<td nowrap="nowrap"><c:choose>
											<c:when test="${fn:length(list.name) >= 10}">
												<span class="spa2" title="${list.name}">${fn:substring(list.name,0,5)}…</span>
											</c:when>
											<c:otherwise>${list.name}</c:otherwise>
										</c:choose></td>
									<%-- <td nowrap="nowrap">
										<c:if test="${list.type == 0}">饮用水</c:if>
										<c:if test="${list.type == 1}">快递</c:if>
										<c:if test="${list.type == 2}">文具纸品</c:if>
										<c:if test="${list.type == 3}">打印纸</c:if>
										<c:if test="${list.type == 4}">绿植</c:if>
										<c:if test="${list.type == 5}">保洁</c:if>
										<c:if test="${list.type == 6}">宽带</c:if>
										<c:if test="${list.type == 7}">短信</c:if>
										<c:if test="${list.type == 8}">企业云</c:if>
									</td> --%>
									<td nowrap="nowrap">${list.createTime}</td>
									<td nowrap="nowrap">
										<c:if test="${list.isDeposit == 0}">否</c:if>
										<c:if test="${list.isDeposit == 1}">是</c:if>
									</td>
									<td nowrap="nowrap">
										<c:if test="${list.paymentMethod == 0}">即时</c:if>
										<c:if test="${list.paymentMethod == 1}">月结</c:if>
										<c:if test="${list.paymentMethod == 2}">预付款</c:if>
									</td>
									<td nowrap="nowrap">
										<c:if test="${not empty list.serviceImg}">
											<a href="${visitPrefix}${list.serviceImg}" target="_blank"><img src="${visitPrefix}${list.serviceImg}"/></a>
										</c:if>
									</td>
									<td nowrap="nowrap">
										<a href="javascript:toAddServicePack('${list.id}')" class="btn-table btn-red" title="编辑">编辑</a>
										<a href="javascript:deleteServicePack('${list.id}')" class="btn-table btn-red" title="删除">删除</a>
									</td>
								</tr>
							</c:forEach>
						</tbody>
					</table>
					<div class="btn-page">
	                    <!-- 页码 -->
	                    <div align="center" class="pages clearfix">
	                           <c:forEach items="${page.iterPages }" var="pageNo">
								<c:choose>
									<c:when test="${pageNo == page.currentPage }">
										<span class='current'>${pageNo }</span>
									</c:when>
									<c:when test="${pageNo != null}">
										<a href="javascript:void(0);" onclick='goPage(${pageNo});'>${pageNo}</a>
									</c:when>
									<c:otherwise>
										<em>...</em>
									</c:otherwise>
								</c:choose>
							</c:forEach>
							<strong>共<span style="color:black;font-weight:bold;font-size:16px;">${page.totalCount}</span>条</strong>
							<strong>跳转到第</strong><input type="text" id="gopage" style="width: 40px;" onkeyup="this.value=this.value.replace(/\D/g,'')" onkeypress="this.value=this.value.replace(/\D/g,'')"/><strong>页</strong>
							<a class="btn-sm btn-success" href="javascript:goPage('gopage');" id='bindBtn'>确定</a>
	                	</div>
		            </div>
				</div>
				<!-- /.box-body -->
			</div>
		</div>
	</section>
</body>
</html>