<%@ page language="java" contentType="text/html;charset=UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="sec" uri="http://www.springframework.org/security/tags" %>
<%@ page import="org.springframework.security.core.AuthenticationException" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
<div id="heiPolicy">
<input type="hidden" id="heiPolicy_val">
<c:if test="${status eq 'IN_FORCE' }">

<c:if test="${policyList.size()>0 }">
<c:forEach items="${policyList }" var="list">
		<div class="insur_list"><!-- insur_list start -->
			<div>
		    	<c:if test="${list.agreementSpec.productType eq 'CONBID' && list.agreementSpec.productClass eq 'JGL' }">
		    	<img src="<c:url value='/resources/images/inqu_img1.jpg' />" width="199" height="103" title="${list.agreementSpec.name  }">
		    	</c:if>
		    	<c:if test="${list.agreementSpec.productType eq 'CONBID' && list.agreementSpec.productClass eq 'ZCL' }">
		    	<img src="<c:url value='/resources/images/inqu_img6.jpg' />" width="199" height="103" title="${list.agreementSpec.name  }">
		    	</c:if>
		    	<c:if test="${list.agreementSpec.productType eq 'WAGEPAY' }">
		    	<img src="<c:url value='/resources/images/pay_img.jpg' />" width="199" height="103" title="${list.agreementSpec.name  }">
		    	</c:if>
		    	<c:if test="${list.agreementSpec.productType eq 'CONQUALITY' }">
		    	<img src="<c:url value='/resources/images/product_img3.jpg' />" width="199" height="103" title="${list.agreementSpec.name  }">
		    	</c:if>
		    	<c:if test="${list.agreementSpec.productType eq 'PERFORMANCE' }">
		    	<img src="<c:url value='/resources/images/product_img2.jpg' />" width="199" height="103" title="${list.agreementSpec.name  }">
		    	</c:if>
		    	<c:if test="${list.agreementSpec.productType eq 'PACT' }">
		    	<img src="<c:url value='/resources/images/product_img1.jpg' />" width="199" height="103" title="${list.agreementSpec.name  }">
		    	</c:if>
		    </div>
		    <div class="inli_text">
		    	<a href="<c:url value='/order/policyDetail/${list.oid }?ACCESS_TOKEN=${ACCESS_TOKEN}' />">
		        	<h4>${list.agreementSpec.name  }<c:if test="${list.agreementSpec.productClass != 'RESTS' }">(${list.agreementSpec.productClass.name })</c:if></h4>
		            <p>订单号：${list.policyTransaction.tradeSerialNumber }</p>
		            <p>保单号：${list.external_reference }</p>
		            <p>保费：${list.grossPremium }元</p>
		            <p>订单日期：<fmt:formatDate pattern="yyyy-MM-dd" value="${list.policyTransaction.startTime}"/></p>
		        </a>
		    </div>
		    <div class="skip">
		    	<p>${list.policyStatus.name }</p>
		        <%-- <span><a href="<c:url value='' />">批单</a></span> --%>
		    	<a href="<c:url value='/order/policyDetail/${list.oid }?ACCESS_TOKEN=${ACCESS_TOKEN}' />" class="aborder mar_left35">保单详情</a>
		    </div>
		</div><!-- insur_list end -->
	
</c:forEach>
</c:if>

<c:if test="${policyList.size()==0 }">
<!-- 无任何订单记录 开始 -->
<div class="anony_mous"><p>无任何订单记录，<a href="<c:url value='/?ACCESS_TOKEN=${ACCESS_TOKEN}' />">立即购买</a></p></div>
 <!-- 无任何订单记录 结束 -->
</c:if>
</c:if>
<c:if test="${status eq 'LAPSED' }">
<c:if test="${policyList.size()>0 }">
<c:forEach items="${policyList }" var="list">
	
		<div class="insur_list"><!-- insur_list start -->
			<div>
				<c:if test="${list.agreementSpec.productType eq 'CONBID' && list.agreementSpec.productClass eq 'JGL' }">
		    	<img src="<c:url value='/resources/images/inqu_img1.jpg' />" width="199" height="103" title="${list.agreementSpec.name  }">
		    	</c:if>
		    	<c:if test="${list.agreementSpec.productType eq 'CONBID' && list.agreementSpec.productClass eq 'ZCL' }">
		    	<img src="<c:url value='/resources/images/inqu_img6.jpg' />" width="199" height="103" title="${list.agreementSpec.name  }">
		    	</c:if>
		    	<c:if test="${list.agreementSpec.productType eq 'WAGEPAY' }">
		    	<img src="<c:url value='/resources/images/pay_img.jpg' />" width="199" height="103" title="${list.agreementSpec.name  }">
		    	</c:if>
		    	<c:if test="${list.agreementSpec.productType eq 'CONQUALITY' }">
		    	<img src="<c:url value='/resources/images/product_img3.jpg' />" width="199" height="103" title="${list.agreementSpec.name  }">
		    	</c:if>
		    	<c:if test="${list.agreementSpec.productType eq 'PERFORMANCE' }">
		    	<img src="<c:url value='/resources/images/product_img2.jpg' />" width="199" height="103" title="${list.agreementSpec.name  }">
		    	</c:if>
		    	<c:if test="${list.agreementSpec.productType eq 'PACT' }">
		    	<img src="<c:url value='/resources/images/product_img1.jpg' />" width="199" height="103" title="${list.agreementSpec.name  }">
		    	</c:if>
		    </div>
		    <div class="inli_text">
		    	<a href="<c:url value='/order/policyDetail/${list.oid }?ACCESS_TOKEN=${ACCESS_TOKEN}' />">
		        	<h4>${list.agreementSpec.name  }<c:if test="${list.agreementSpec.productClass != 'RESTS' }">(${list.agreementSpec.productClass.name })</c:if></h4>
		            <p>订单号：${list.policyTransaction.tradeSerialNumber }</p>
		            <p>保单号：${list.external_reference }</p>
		            <p>保费：${list.grossPremium }元</p>
		            <p>订单日期：<fmt:formatDate pattern="yyyy-MM-dd" value="${list.policyTransaction.startTime}"/></p>
		        </a>
		    </div>
		    <div class="skip">
		    	<p>${list.policyStatus.name }</p>
		    </div>
		</div><!-- insur_list end -->
</c:forEach>
</c:if>

<c:if test="${policyList.size()==0 }">
<!-- 无任何订单记录 开始 -->
<div class="anony_mous"><p>无任何订单记录，<a href="<c:url value='/?ACCESS_TOKEN=${ACCESS_TOKEN}' />">立即购买</a></p></div>
 <!-- 无任何订单记录 结束 -->
</c:if>
</c:if>
<c:if test="${status eq 'PENDING' }">
<c:if test="${policyList.size()>0 }">
<c:forEach items="${policyList }" var="list">
	
		<div class="insur_list"><!-- insur_list start -->
			<div>
		    	<c:if test="${list.agreementSpec.productType eq 'CONBID' && list.agreementSpec.productClass eq 'JGL' }">
		    	<img src="<c:url value='/resources/images/inqu_img1.jpg' />" width="199" height="103" title="${list.agreementSpec.name  }">
		    	</c:if>
		    	<c:if test="${list.agreementSpec.productType eq 'CONBID' && list.agreementSpec.productClass eq 'ZCL' }">
		    	<img src="<c:url value='/resources/images/inqu_img6.jpg' />" width="199" height="103" title="${list.agreementSpec.name  }">
		    	</c:if>
		    	<c:if test="${list.agreementSpec.productType eq 'WAGEPAY' }">
		    	<img src="<c:url value='/resources/images/pay_img.jpg' />" width="199" height="103" title="${list.agreementSpec.name  }">
		    	</c:if>
		    	<c:if test="${list.agreementSpec.productType eq 'CONQUALITY' }">
		    	<img src="<c:url value='/resources/images/product_img3.jpg' />" width="199" height="103" title="${list.agreementSpec.name  }">
		    	</c:if>
		    	<c:if test="${list.agreementSpec.productType eq 'PERFORMANCE' }">
		    	<img src="<c:url value='/resources/images/product_img2.jpg' />" width="199" height="103" title="${list.agreementSpec.name  }">
		    	</c:if>
		    	<c:if test="${list.agreementSpec.productType eq 'PACT' }">
		    	<img src="<c:url value='/resources/images/product_img1.jpg' />" width="199" height="103" title="${list.agreementSpec.name  }">
		    	</c:if>
		    </div>
		    <div class="inli_text">
		    	<a href="<c:url value='/order/policyDetail/${list.oid }?ACCESS_TOKEN=${ACCESS_TOKEN}' />">
		        	<h4>${list.agreementSpec.name  }<c:if test="${list.agreementSpec.productClass != 'RESTS' }">(${list.agreementSpec.productClass.name })</c:if></h4>
		            <p>订单号：${list.policyTransaction.tradeSerialNumber }</p>
		            <c:if test="${list.agreementSpec.productType eq 'CONBID' }"><p>保费：${list.grossPremium }元</p></c:if>
		            <p>订单日期：<fmt:formatDate pattern="yyyy-MM-dd" value="${list.policyTransaction.startTime}"/></p>
		        </a>
		    </div>
		    <div class="skip">
		    	<p>${list.policyStatus.name }</p>
		        <span><a href="javascript:void();" onclick="deletePolicy('${list.oid }','${status }');">删除</a></span>
		        <c:choose>
		        	<c:when test="${list.agreementSpec.productType eq 'CONBID' }">
		        		<c:if test="${not empty list.policySerialNumber && empty list.external_reference }">
		        		<a href="${list.policyTransaction.showUrl }" target="_blank" class="aborder mar_left35" onclick="fluchHtml()">立即支付</a>
		        		</c:if>
		        		<c:if test="${empty list.policySerialNumber }">
				        <a href="<c:url value='/product/sale/policyPay/${list.oid }?ACCESS_TOKEN=${ACCESS_TOKEN}' />" class="aborder mar_left35">立即支付</a>
		        		</c:if>
		        	</c:when>
		        	<c:otherwise>
		        		<a href="<c:url value='/order/policyDetail/${list.oid }?ACCESS_TOKEN=${ACCESS_TOKEN}' />" class="aborder mar_left35">保单详情</a>
		        	</c:otherwise>
		        </c:choose>
		    </div>
		</div><!-- insur_list end -->
</c:forEach>
</c:if>

<c:if test="${policyList.size()==0 }">
<!-- 无任何订单记录 开始 -->
<div class="anony_mous"><p>无任何订单记录，<a href="<c:url value='/?ACCESS_TOKEN=${ACCESS_TOKEN}' />">立即购买</a></p></div>
 <!-- 无任何订单记录 结束 -->
</c:if>
</c:if>
<c:if test="${status eq 'APPLIED' }">
<c:if test="${policyList.size()>0 }">
<c:forEach items="${policyList }" var="list">
		<div class="insur_list"><!-- insur_list start -->
			<div>
		    	<c:if test="${list.agreementSpec.productType eq 'CONBID' && list.agreementSpec.productClass eq 'JGL' }">
		    	<img src="<c:url value='/resources/images/inqu_img1.jpg' />" width="199" height="103" title="${list.agreementSpec.name  }">
		    	</c:if>
		    	<c:if test="${list.agreementSpec.productType eq 'CONBID' && list.agreementSpec.productClass eq 'ZCL' }">
		    	<img src="<c:url value='/resources/images/inqu_img6.jpg' />" width="199" height="103" title="${list.agreementSpec.name  }">
		    	</c:if>
		    	<c:if test="${list.agreementSpec.productType eq 'WAGEPAY' }">
		    	<img src="<c:url value='/resources/images/pay_img.jpg' />" width="199" height="103" title="${list.agreementSpec.name  }">
		    	</c:if>
		    	<c:if test="${list.agreementSpec.productType eq 'CONQUALITY' }">
		    	<img src="<c:url value='/resources/images/product_img3.jpg' />" width="199" height="103" title="${list.agreementSpec.name  }">
		    	</c:if>
		    	<c:if test="${list.agreementSpec.productType eq 'PERFORMANCE' }">
		    	<img src="<c:url value='/resources/images/product_img2.jpg' />" width="199" height="103" title="${list.agreementSpec.name  }">
		    	</c:if>
		    	<c:if test="${list.agreementSpec.productType eq 'PACT' }">
		    	<img src="<c:url value='/resources/images/product_img1.jpg' />" width="199" height="103" title="${list.agreementSpec.name  }">
		    	</c:if>
		    </div>
		    <div class="inli_text">
		    	<a href="<c:url value='/product/sale/continueFill/${list.oid }?ACCESS_TOKEN=${ACCESS_TOKEN}' />">
		        	<h4>${list.agreementSpec.name  }<c:if test="${list.agreementSpec.productClass != 'RESTS' }">(${list.agreementSpec.productClass.name })</c:if></h4>
		            <p>订单号：${list.policyTransaction.tradeSerialNumber }</p>
		            <p>保费：${list.grossPremium }元</p>
		            <p>订单日期：<fmt:formatDate pattern="yyyy-MM-dd" value="${list.policyTransaction.startTime}"/></p>
		        </a>
		    </div>
		    <div class="skip">
		    	<p>${list.policyStatus.name }</p>
		        <span><a href="javascript:void();" onclick="deletePolicy('${list.oid }','${status }');">删除</a></span>
		        <a href="<c:url value='/product/sale/continueFill/${list.oid }?ACCESS_TOKEN=${ACCESS_TOKEN}' />" class="aborder mar_left35">继续投保</a>
		    </div>
		</div><!-- insur_list end -->
	
</c:forEach>
</c:if>

<c:if test="${policyList.size()==0 }">
<!-- 无任何订单记录 开始 -->
<div class="anony_mous"><p>无任何订单记录，<a href="<c:url value='/?ACCESS_TOKEN=${ACCESS_TOKEN}' />">立即购买</a></p></div>
 <!-- 无任何订单记录 结束 -->
</c:if>
</c:if>

<c:if test="${status eq 'OFFLINE' }">

<c:if test="${policyList.size()>0 }">
<c:forEach items="${policyList }" var="list">
		<div class="insur_list"><!-- insur_list start -->
			<div>
		    	<c:if test="${list.agreementSpec.productType eq 'CONBID' && list.agreementSpec.productClass eq 'JGL' }">
		    	<img src="<c:url value='/resources/images/inqu_img1.jpg' />" width="199" height="103" title="${list.agreementSpec.name  }">
		    	</c:if>
		    	<c:if test="${list.agreementSpec.productType eq 'CONBID' && list.agreementSpec.productClass eq 'ZCL' }">
		    	<img src="<c:url value='/resources/images/inqu_img6.jpg' />" width="199" height="103" title="${list.agreementSpec.name  }">
		    	</c:if>
		    	<c:if test="${list.agreementSpec.productType eq 'WAGEPAY' }">
		    	<img src="<c:url value='/resources/images/pay_img.jpg' />" width="199" height="103" title="${list.agreementSpec.name  }">
		    	</c:if>
		    	<c:if test="${list.agreementSpec.productType eq 'CONQUALITY' }">
		    	<img src="<c:url value='/resources/images/product_img3.jpg' />" width="199" height="103" title="${list.agreementSpec.name  }">
		    	</c:if>
		    	<c:if test="${list.agreementSpec.productType eq 'PERFORMANCE' }">
		    	<img src="<c:url value='/resources/images/product_img2.jpg' />" width="199" height="103" title="${list.agreementSpec.name  }">
		    	</c:if>
		    	<c:if test="${list.agreementSpec.productType eq 'PACT' }">
		    	<img src="<c:url value='/resources/images/product_img1.jpg' />" width="199" height="103" title="${list.agreementSpec.name  }">
		    	</c:if>
		    </div>
		    <div class="inli_text">
		    	<a href="<c:url value='/order/policyDetail/${list.oid }?ACCESS_TOKEN=${ACCESS_TOKEN}' />">
		        	<h4>${list.agreementSpec.name  }<c:if test="${list.agreementSpec.productClass != 'RESTS' }">(${list.agreementSpec.productClass.name })</c:if></h4>
		            <p>订单号：${list.policyTransaction.tradeSerialNumber }</p>
		            <p>保单号：${list.external_reference }</p>
		            <%-- <p>保费：${list.grossPremium }元</p> --%>
		            <p>订单日期：<fmt:formatDate pattern="yyyy-MM-dd" value="${list.policyTransaction.startTime}"/></p>
		        </a>
		    </div>
		    <div class="skip">
		    	<p>${list.policyStatus.name }</p>
		        <%-- <span><a href="<c:url value='' />">批单</a></span> --%>
		    	<a href="<c:url value='/order/policyDetail/${list.oid }?ACCESS_TOKEN=${ACCESS_TOKEN}' />" class="aborder mar_left35">保单详情</a>
		    </div>
		</div><!-- insur_list end -->
	
</c:forEach>
</c:if>

<c:if test="${policyList.size()==0 }">
<!-- 无任何订单记录 开始 -->
<div class="anony_mous"><p>无任何订单记录，<a href="<c:url value='/?ACCESS_TOKEN=${ACCESS_TOKEN}' />">立即购买</a></p></div>
 <!-- 无任何订单记录 结束 -->
</c:if>
</c:if>
</div>

<script type="text/javascript">
$(function(){
	
	$("#heiPolicy_val").val($("#heiPolicy").height());
});
</script>