<%@ 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 uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
<%
    String basePath = request.getContextPath();
%>
<div class="table-responsive">
    <table class="table table-striped table-bordered table-hover ">
        <thead>
        <tr>
            <th>订单号</th>
            <th>用户</th>
            <th>资源需求</th>
            <%--<th>使用意向</th>--%>
            <th>提交日期</th>
            <th>联系人</th>
            <th>联系电话</th>
            <th>状态</th>
            <%--<th>处理人</th>--%>
            <th class="hidden-print">操 作</th>
        </tr>
        </thead>
        <tbody>
        <c:choose>
            <c:when test="${list!=null}">
                <c:forEach items="${list}" var="item">
                    <tr>
                        <td>
                            <a href="#" onclick="offlineView(${item.id})">${item.orderNumber}</a>
                        </td>
                        <td>${item.username}</td>
                        <td>${item.requirement}</td>
                      <%--  <td>${item.usage}</td>--%>
                        <td><fmt:formatDate value="${item.submitTime}" pattern="yyyy-MM-dd"/></td>
                        <td>${item.contact}</td>
                        <td>${item.phone}</td>
                        <td>${item.orderState ==null?'未处理':item.orderState}</td>
                        <%--<td>${item.auditedByName}</td>--%>
                        <td class="btn-table hidden-print">
                            <input type="hidden" name="id" value="${item.id}"/>
                            <c:if test="${item.orderState ==null}">
                                    <button name="btnHandle" class="btn btn-sm btn-primary m-r-sm"><i
                                            class="fa fa-edit"></i>反馈
                                    </button>
                            </c:if>
                            <c:if test="${item.orderState  != null}">
                                <div align="center">
                                    -----
                                </div>
                            </c:if>
                        </td>
                    </tr>
                </c:forEach>
            </c:when>
            <c:otherwise>
                <tr>
                    <td colspan="4">无数据</td>
                </tr>
            </c:otherwise>
        </c:choose>
        </tbody>
    </table>
</div>
<jsp:include page="../../../common/admin/pager.jsp">
    <jsp:param name="pageNo" value="${pager.pageNo}"/>
    <jsp:param name="pageSize" value="${pager.pageSize}"/>
    <jsp:param name="total" value="${pager.total}"/>
</jsp:include>
<script type="text/javascript">
    $("#divGrid table tbody tr td:last-child")
        .on("click", "button[name='btnHandle']", function () {
            var id = $(this).parent().children("input[type='hidden'][name='id']").val();
            $.popBsPartial({url: "<%=basePath%>/admin/offline_conference/handle.htm/" + id});
        }
        )
        function offlineView(id) {
            $.popBsPartial({url: "<%=basePath%>/admin/offline_conference/view.htm/" + id});
        }
</script>