<%@ page language="java" errorPage="/error.jsp" pageEncoding="UTF-8"
	contentType="text/html; charset=UTF-8"%>
<%@ include file="/common/taglibs.jsp"%>
<!DOCTYPE html>
<html>
<head>
<title>客户服务信息管理</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<!-- bootstrap 3.0.2 -->
<link href="<c:url value='/styles/lib/bootstrap.min.css'/>" rel="stylesheet" type="text/css" />
<link href="<c:url value='/styles/lib/font-awesome.min.css'/>" rel="stylesheet" type="text/css" />
<link href='<c:url value='/styles/lib/ionicons.min.css' />' rel="stylesheet" type="text/css" />
<link href="<c:url value='/styles/lib/datatables/dataTables.bootstrap.css' />" rel="stylesheet" type="text/css" />
<link href="<c:url value='/styles/AdminLTE.css'/>" rel="stylesheet" type="text/css" />
<script src="${ctx }/scripts/lib/jquery-1.8.2.min.js"></script>
<script type="text/javascript" src="<c:url value='/plugin/layer/layer.js'/>"></script>
<script type="text/javascript" src="<c:url value='/scripts/bootstrap.min.js'/>"></script>
<script type="text/javascript" src="<c:url value='/scripts/admin/contractInformation.js'/>"></script>
</head>
<body>
	<input type="hidden" id="funcid" value="${funcid}">
	<input type="hidden" value="${ctx}" id="contextPath">
	<input type="hidden" value="${virtualArchitectureId}" id="virtualId_">
	<section class="content">
		<div class="row">
			<div class="col-xs-12">
				<div class="boxlist">
					<!-- /.box-header -->
					<div class="box-body table-responsive">
						<form:form id="conditionform" action="${ctx}/admin/contract/page?funcid=${funcid}" method="POST">
							<input type="hidden" id="pageNo" name="pageNo" />
							<input type="hidden" id="funcid" value="${funcid}">
							<div class="form-group">
								<label>项目名称</label>
								<select name="organizationId" id="organizationId"  style="width:160px;">
									<option value="">请选择项目</option>
									<c:forEach items="${organizationList }" var="obj">
										<c:choose>
											<c:when test="${obj.id==organizationId }">
											<option value="${obj.id }" selected="selected">${obj.name }</option>
											</c:when>
											<c:otherwise>
											<option value="${obj.id }">${obj.name }</option>
											</c:otherwise>
										</c:choose>
									</c:forEach>
								</select>~
								<select name="virtualArchitectureId" id="virtualId" style="width:160px;">
									<option value="">请选择企业</option>
								</select>
							</div>
							
							<span style="float:right; margin-bottom: 2px;"> 
								<a class="btn btn-default" href="javaScript:void(0);" id='btn-search'>查询</a>
							</span>
						</form:form>

						<table id="example2" 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="model" varStatus="status">
									<tr>
										<td>${ (page.currentPage-1)*page.pageSize+(status.index+1)}</td>
										<td>${model.userName }</td>
										<td>${model.userMobile }</td>
										<td>
										${model.organizationName }
										<c:if test="${not empty model.virtualarchitectureName }">
										/${model.virtualarchitectureName }
										</c:if>
										<c:if test="${empty model.virtualarchitectureName }">
										/暂无
										</c:if>
										<c:if test="${not empty model.typeName }">
										/${model.typeName }
										</c:if>
										<c:if test="${empty model.typeName }">
										/暂无
										</c:if>
										</td>
										<td>
											${model.customerNumber }
										</td>
										<td>${model.userTypeName }</td>
										<td>
											<a href="javascript:void(0);" title="完善资料" class="btn btn-success" onclick="eidtContractIinformationOrder('${model.id}','${model.organizationId }','${model.virtualArchitectureId }','${model.userName }','${model.userMobile }','${model.userId }')">
												<span>完善资料</span>
	                                   		</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-primary" href="javascript:goPage('gopage');" id='bindBtn'>确定</a>
		                	</div>
			            </div>
					</div>
					<!-- /.box-body -->
				</div>
			</div>
		</div>
	</section>
	
	<div class="modal fade" id="saveModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
			<div class="modal-dialog">
				<div class="modal-content">
					<div class="modal-header">
						<button type="button" class="close" data-dismiss="modal" aria-hidden="true">
							&times;
						</button>
						<h4 class="modal-title" id="myModalLabel">
							
						</h4>
					</div>
					<div class="modal-body">
					<form class="form-horizontal" role="form">
						<fieldset>
                         <legend>项目信息</legend>
                         <input type="hidden" id="contracId"/>
                         <input type="hidden" id="userId"/>
                        <div class="form-group">
                           <label for="formOrganizationId"  class="col-sm-2 control-label">所属项目</label>
                           <div class="col-sm-10">
                              <select id="formOrganizationId" class="form-control" onchange="initVirtual(this.value,'')">
                                 <option value="">请选择项目</option>
									<c:forEach items="${organizationList }" var="obj">
											<option value="${obj.id }">${obj.name }</option>
									</c:forEach>
                              </select>
                           </div>
                        </div>
                    </fieldset>
                    <fieldset>
                    </fieldset>
                       <fieldset>
                         <legend>签约企业信息</legend>
                        <div class="form-group">
                           <label for="formvirtualId"  class="col-sm-2 control-label">所属企业</label>
                           <div class="col-sm-10">
                              <select id="formvirtualId" class="form-control">
                                 <option value="">请选择企业</option>
                              </select>
                           </div>
                        </div>
                         <div class="form-group" style="display: none;">
                          
                           <label   class="col-sm-2 control-label">编码</label>
                           <div class="col-sm-4">
                          		
                           </div>
                           <label   class="col-sm-2 control-label">企业号码</label>
                            <div class="col-sm-4">
                          		
                           </div>
                        </div>
                        
                        <div class="form-group" style="display: none;">
                         <label   class="col-sm-2 control-label">地址</label>
                           <div class="col-sm-10">
                          		
                           </div>   
                        </div>
                    </fieldset>
                    <fieldset>
                        <legend>用户信息</legend>
                       <div class="form-group">
                          <label class="col-sm-2 control-label" for="userName">姓名</label>
                          <div class="col-sm-4">
                             <input class="form-control" id="userName" type="text" disabled="disabled" value=""/>
                          </div>
                          <label class="col-sm-2 control-label" for="userMobile">电话号码</label>
                          <div class="col-sm-4">
                             <input class="form-control" id="userMobile" disabled="disabled" type="text"/>
                          </div>
                       </div>
                    </fieldset>      
                </form>
          				
			         </div>
					<div class="modal-footer">
						<a href="javascript:void(0);" title="关闭" data-dismiss="modal" class="btn btn-info" style="float: right;"><span>关闭</span></a>
						<a href="javascript:void(0);" title="提交修改" class="btn btn-success" style="float: right;margin-right: 10px;" id="save" onclick="saveUpdateContart()"><span>提交修改</span></a>
					</div>
				</div><!-- /.modal-content -->
			</div><!-- /.modal -->
	</div>
</body>
</html>