<%@ page import="com.lightinit.hsdataportal.dictionary.*" %>
<%@ page language="java" pageEncoding="UTF-8"
         contentType="text/html; charset=UTF-8"%>
<%@ page isELIgnored="false"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%
    String basePath = request.getContextPath();
    String resourcePath = basePath + "/resource";
%>
<!doctype html>
<html>
<head>
    <title>订单管理-在线订单</title>
    <jsp:include page="../common/head.jsp"></jsp:include>
</head>
<body>
<jsp:include page="../common/body_header.jsp"></jsp:include>
<jsp:include page="../common/user_center_header.jsp"></jsp:include>
<div class="user-mid2">
    <div class="xinxi0">
        <div class="user-mid0">
            <div class="if">
                <span onclick="fnOnlineOrder()" class="xx0" id="onlineOrderId"><a>在线订单</a></span>
                <span onclick="fnOfflineContract()" class="xx"  id="offlineContractId"><a>线下合同</a></span>
            </div>
            <div class="clearfix"></div>
            <div class="xx-main" id="onlineOrderView">
                <table >
                    <tr bgcolor="#f2f2f2" class="biaotou1">
                        <td class="td3">订单号</td>
                        <td class="td5">资源名称</td>
                        <td class="td3">资源类型</td>
                        <td class="td3">申请时间</td>
                        <td class="td3">价格（元）</td>
                        <td class="td3">申请次数</td>
                        <td class="td3">总金额（元)</td>
                        <td class="td3">订单状态</td>
                        <td class="td4">操作</td>
                    </tr>
                    <c:if test="${outputModel !=null}">
                        <c:forEach items="${outputModel}" var="item">
                            <tr>
                                <td>${item.orderNumber}</td>
                                <td>${item.resourceName}</td>
                                <td>${item.resourceType}</td>
                                <td><fmt:formatDate value="${item.orderTime}" pattern="yyyy-MM-dd"/></td>
                                <td>
                                <c:if test="${item.chargeMethod eq mianfei}">
                                   免费
                                </c:if>
                                <c:if test="${!item.chargeMethod eq mianfei}">
                                    ${item.packagePrice}
                                </c:if>
                                </td>
                                <td>${item.totalTimes}</td>
                                <td>
                                <c:if test="${item.chargeMethod eq mianfei}">
                                    0.00
                                </c:if>
                                <c:if test="${item.chargeMethod != mianfei}">
                                   ${item.orderAmount}
                                </c:if>
                                </td>
                                <td>${item.orderState}</td>
                                <td>
                                    <c:if test="${item.orderState =='已付款'}">
                                        --
                                    </c:if>
                                    <c:if test="${item.orderState !='已付款'}">
                                        <a class="qxbm" href="<%=basePath%>/alipay/index.htm/${item.orderNumber}/${item.orderAmount}">支付</a> &nbsp; <a class="qxbm" href="<%=basePath%>/open/order/deleteOrder.action/${item.orderId}">取消</a>
                                    </c:if>
                                </td>
                            </tr>
                        </c:forEach>
                    </c:if>
                </table>
            </div>
            <div class="xx-main" id="offlineContractView">
                <table >
                    <tr bgcolor="#f2f2f2" class="biaotou1">
                        <td class="td7">合同编号</td>
                        <td class="td7">合同名称</td>
                        <td class="td7">资源提供方</td>
                        <td class="td7">有效期起止</td>
                        <td class="td3">合同金额</td>
                        <td class="td3">已收款金额</td>
                        <td class="td3">状态</td>
                        <td class="td3">操作</td>
                    </tr>
                    <tr>
                        <td>132523123123</td>
                        <td>资源使用协议</td>
                        <td>大数据公司</td>
                        <td>2016.01-2018.01</td>
                        <td>10万</td>
                        <td>10万</td>
                        <td>已生效</td>
                        <td><a class="qxbm">详情</a></td>
                    </tr>
                </table>
            </div>
        </div>
    </div>
</div>
<jsp:include page="../common/body_footer.jsp"></jsp:include>
</body>
<script type="text/javascript">
    //tab页切换
    if ($("#type").val() !=2){
        fnOnlineOrder();
    }else{
        fnOfflineContract();
    }
    function fnOnlineOrder(){
        $('#onlineOrderView').show();
        $('#offlineContractView').hide();
        $("#onlineOrderId").addClass("xx01");
        $("#offlineContractId").removeClass("xx01");
    }
    function fnOfflineContract(){
        $('#onlineOrderView').hide();
        $('#offlineContractView').show();
        $("#offlineContractId").addClass("xx01");
        $("#onlineOrderId").removeClass("xx01");
    }
</script>
</html>