<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>

<head>

    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">

    <title>诉讼担保管理系统</title>

	<link href="${contextPath}/static/css/bootstrap.min.css" rel="stylesheet">
	<link href="${contextPath}/static/font-awesome/css/font-awesome.css" rel="stylesheet">
	
	<link href="${contextPath}/static/css/animate.css" rel="stylesheet">
	<link href="${contextPath}/static/css/style.css" rel="stylesheet">
	
	<!-- Mainly scripts -->
	<script src="${contextPath}/static/js/jquery-2.1.1.js"></script>
	<script src="${contextPath}/static/js/bootstrap.min.js"></script>
	<script src="${contextPath}/static/js/plugins/metisMenu/jquery.metisMenu.js"></script>
	<script src="${contextPath}/static/js/plugins/slimscroll/jquery.slimscroll.min.js"></script>
	<script src="${contextPath}/static/js/plugins/jquery-ui/jquery-ui.min.js"></script>
	
	<!-- Custom and plugin javascript -->
	<script src="${contextPath}/static/js/inspinia.js"></script>
	<script src="${contextPath}/static/js/plugins/pace/pace.min.js"></script>

    <script>
		var isUser = "${ sessionScope.SESSION_IS_USER}";
    function modPic(url){
    	$("#mod-img-src").attr("src",url);
    	$("#mod-img").modal("toggle");
    }
    
    function changeMenu(i,v){
    	$("#m"+i).attr("class","active");
		$(("#m"+i)+v).attr("class","active");
	}
    
	function psd(){
		$("#oldpassword").val('');
		$("#password").val('');
		$("#password2").val('');
		$("#oldpassword").removeAttr("readonly");
		$("#password").removeAttr("readonly");
		$("#password2").removeAttr("readonly");
		$("#modal-psd").modal("toggle");
	}
	
	$(document).ready(function(){
		
		//初始化
		$('#mod-psd-submit').on('click', function() {
			if($("#oldpassword").val()==''||$("#password").val()==''||$("#password2").val()==''){
				alert('请输入密码！');
				return;
			}
			if($("#password").val()!=$("#password2").val()){
				alert('新密码与确认密码不一致！');
				return;
			}
			
			$.ajax({
				url : "${contextPath}/user/resetPassword",
				data : {
					oldpassword : $("#oldpassword").val(),
					password : $("#password").val(),
				},
				type : 'POST',
				dataType : 'json',
				complete : function(response) {
					if(response.success){
						alert('修改成功！');
						$("#modal-psd").modal("toggle");
					}else
						alert(response.message);
					
				}
			});
		});
			
	});
</script>
</head>

<body>
<div id="mod-img" class="modal fade" tabindex="-1">
	<div class="modal-dialog"  style="max-width: 800px;">
		<div class="modal-content">
			<div class="modal-body text-center no-padding">
				<img id="mod-img-src">
			</div>
		</div><!-- /.modal-content -->
	</div><!-- /.modal-dialog -->
</div>

<div id="modal-psd" class="modal fade" tabindex="-1">
	  <div class="modal-dialog" style="max-width: 400px;">
	      <div class="modal-content">
	      	<div class="modal-header">
      			<div class="table-header">
					<button type="button" class="close" data-dismiss="modal" aria-hidden="true">
						<span class="white">&times;</span>
					</button>
					重置密码
				</div>
	      	</div>
	        <div class="modal-body">
                 <div class="form-group"><input type="password"  id="oldpassword" placeholder="原密码" class="form-control" readonly></div>
                 <div class="form-group"><input type="password" id="password" placeholder="新密码" class="form-control" readonly></div>
                 <div class="form-group"><input type="password" id="password2" placeholder="确认新密码" class="form-control" readonly></div>
	      	</div>
	      	<div class="modal-footer">
	      		<button class="btn  btn-primary" type="button" id="mod-psd-submit"><strong><i class="fa fa-floppy-o bigger-160"></i> 修改</strong></button>
                <button class="btn " data-dismiss="modal"><i class="fa fa-share bigger-160"></i> 取消</button>
			</div>
	      </div>
	  </div>
	</div>
	
	<div id="wrapper">

		<nav class="navbar-default navbar-static-side" role="navigation">
			<div class="sidebar-collapse">
				<ul class="nav metismenu" id="side-menu">
					<li class="nav-header">
						<div class="dropdown profile-element">
							<span> <img alt="image" class="img-circle"
								src="${contextPath}/static/img/profile_small.jpg" />
							</span> <a data-toggle="dropdown" class="dropdown-toggle" href="#"> <span
								class="clear">
							<c:choose>
								<c:when test="${sessionScope.SESSION_IS_USER == false}">
									<span class="block m-t-xs">
							<strong class="font-bold">${sessionScope.SESSION_COMPANY.loginName}</strong>
								</span>

									<span class="text-muted text-xs block">${sessionScope.SESSION_COMPANY.contact}
										<b class="caret"></b>
								</span>
								</c:when>

								<c:otherwise>
									<span class="block m-t-xs">
							<strong class="font-bold">${sessionScope.SESSION_COMPANY_USER.loginName}</strong>
								</span>

									<span class="text-muted text-xs block">${sessionScope.SESSION_COMPANY_USER.userName}
										<b class="caret"></b>
								</span>

								</c:otherwise>
							</c:choose>


							</span>
							</a>
							<ul class="dropdown-menu animated fadeInRight m-t-xs">
								<!-- <li><a href="javascript:void(0);" onclick="changeInfo()">修改信息</a></li> -->
								<li><a href="javascript:void(0);" onclick="psd()">重置密码</a></li>
								<li class="divider"></li>
								<li><a href="${contextPath}/pub/logout">退出</a></li>
							</ul>
						</div>
						<div class="logo-element">+</div>
		
					</li>
					<li id="m1"><a href="${contextPath}/user/index"><i class="fa fa-home"></i> <span class="nav-label">主页</span></a></li>
					<c:if test="${sessionScope.SESSION_IS_USER == false}">
					<li id="m2"><a href="javascript:void(0);"><i
							class="fa fa-bar-chart-o"></i> <span class="nav-label">先付费后出函-保单信息</span><span
							class="fa arrow"></span></a>
						<ul class="nav nav-second-level collapse">
							<li id="m21"><a href="${contextPath}/order/order?index=1">待审核</a></li>
							<li id="m22"><a href="${contextPath}/order/order?index=2">待收款确认</a></li>
							<li id="m23"><a href="${contextPath}/order/order?index=3">待出函</a></li>
							<li id="m24"><a href="${contextPath}/order/order?index=4">已出函</a></li>
							<li id="m26"><a href="${contextPath}/order/order?index=10">已取消</a></li>
							<li id="m25"><a href="${contextPath}/order/order?index=5">审核失败</a></li>
							<li id="m27"><a href="${contextPath}/order/order?index=11">退保</a></li>
							<li id="m28"><a href="${contextPath}/order/order?index=12">全部订单</a></li>
						</ul>
					</li>
					</c:if>
					<c:if test="${sessionScope.SESSION_IS_USER == false}">
						<c:if test="${sessionScope.SESSION_COMPANY.serviceType==1}">
							<li id="m5"><a href="javascript:void(0);"><i
									class="fa fa-bar-chart-o"></i> <span class="nav-label">先出函后付费-保单信息</span><span
									class="fa arrow"></span></a>
								<ul class="nav nav-second-level collapse">
									<li id="m51"><a href="${contextPath}/order/order?index=6">待审核</a></li>
									<li id="m52"><a href="${contextPath}/order/order?index=7">待出函</a></li>
									<li id="m53"><a href="${contextPath}/order/order?index=8">待确认付款</a></li>
									<li id="m54"><a href="${contextPath}/order/order?index=9">已完成</a></li>
								</ul>
							</li>
						</c:if>
					</c:if>
					<c:if test="${sessionScope.SESSION_IS_USER == false}">
					<li id="m3"><a href="javascript:void(0);"><i class="fa fa-database"></i>
							<span class="nav-label">资料设置 </span><span class="fa arrow"></span></a>
						<ul class="nav nav-second-level collapse">
							<li id="m31"><a href="${contextPath}/company/setting1">公司简介</a></li>
							<li id="m32"><a href="${contextPath}/company/setting2">设置审核资料</a></li>
							<li id="m33"><a href="${contextPath}/company/setting3">设置保费比例</a></li>
							<li id="m34"><a href="${contextPath}/company/setting4">服务承诺</a></li>
							<li id="m35"><a href="${contextPath}/company/setting5">服务法院</a></li>
						</ul>
					</li>
					</c:if>
					<c:if test="${sessionScope.SESSION_IS_USER == false}">
					<li id="m4"><a href="${contextPath}/user/account"><i
							class="fa fa-user"></i> <span class="nav-label">我的账户</span></a>
						<%-- <ul class="nav nav-second-level collapse">
							<li id="m41"><a href="${contextPath}/account/info">账户信息</a></li>
							<li id="m42"><a href="${contextPath}/account/detail">账户明细</a></li>
						</ul> --%>
					</li>
					</c:if>
					<li id="m6"><a href="javascript:void(0);"><i class="fa fa-database"></i>
						<span class="nav-label">订单统计 </span><span class="fa arrow"></span></a>
						<ul class="nav nav-second-level collapse">
							<li id="m61"><a href="${contextPath}/order/statistics1">订单统计表</a></li>
							<li id="m62"><a href="${contextPath}/order/statistics2">订单趋势图</a></li>
							<li id="m63"><a href="${contextPath}/order/orderList">订单列表</a></li>
						</ul>
					</li>
					<li id="m7"><a href="javascript:void(0);"><i class="fa fa-database"></i>
						<span class="nav-label">对账模块 </span><span class="fa arrow"></span></a>
						<ul class="nav nav-second-level collapse">
							<li id="m71"><a href="${contextPath}/order/monthBill">每月账单</a></li>
							<c:if test="${sessionScope.SESSION_IS_USER == false}">
							<li id="m72"><a href="${contextPath}/order/serviceCost">服务费打款</a></li>
							</c:if>
							<li id="m73"><a href="${contextPath}/order/serviceInvoice">开票</a></li>
						</ul>
					</li>
					<c:if test="${sessionScope.SESSION_IS_USER == false}">
					<li id="m8"><a href="${contextPath}/companyUser/account"><i
							class="fa fa-user"></i> <span class="nav-label">账号管理</span></a>
					</li>
					</c:if>
					<li id="m9"><a href="${contextPath}/companyUser/statistics"><i
							class="fa fa-user"></i> <span class="nav-label">跟单人员统计</span></a>
					</li>
					<li id="m10"><a href="${contextPath}/companyUser/openWeChat"><i
							class="fa fa-user"></i> <span class="nav-label">开通微信通知</span></a>
					</li>
				</ul>
		
			</div>
		</nav>

		<div id="page-wrapper" class="gray-bg">	
			<div class="row border-bottom">
				<nav class="navbar navbar-static-top" role="navigation" style="margin-bottom: 0">
					<div class="navbar-header">
						<a class="navbar-minimalize minimalize-styl-2 btn btn-primary " href="#"><i class="fa fa-bars"></i> </a>
			
					</div>
					<ul class="nav navbar-top-links navbar-right">
						<li><span class="m-r-sm text-muted welcome-message">欢迎使用多问律师诉讼担保系统</span>
						</li>
			
						<li><a href="${contextPath}/pub/logout"> <i class="fa fa-sign-out"></i> 退出</a></li>
					</ul>
			  	</nav>
			</div>

