<%@ 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 class="hidden-print">操 作</th>
        </tr>
        </thead>
        <tbody>
        <c:choose>
            <c:when test="${list!=null}">
                <c:forEach items="${list}" var="item" >
                    <tr>
                        <td><a href="javascript:(0);" onclick="toDetail(${item.id})">${item.orgType}</a></td>
                        <td>${item.orgName}</td>
                        <td>${item.contact}</td>
                        <td>${item.phone}</td>
                        <td class="btn-table hidden-print">
                            <button name="btnDelete" onclick="deleteButton(${item.id})" class="btn btn-sm btn-danger m-r-sm"><i class="fa fa-trash-o"></i>删除</button>
                            <button name="btnEdit" onclick="edit(${item.id})" class="btn btn-sm btn-primary m-r-sm" ><i class="fa fa-edit"></i>编辑</button>
                        </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">
    function edit(id) {
        $.popBsPartial({ url: "<%=basePath%>/admin/msEducation/editEducation.htm/"+id+"?orgType="+type});
    }
    function toDetail(id) {
        $.popBsPartial({ url: "<%=basePath%>/admin/msEducation/view.htm/"+id});
    }
    function deleteButton(id) {
        $.delWithConfirm({ func: $.ajaxGetRefresh, funcArgs: { ajaxGetOptions: { url: "<%=basePath%>/admin/msEducation/delete.action/" + id } } });
    };
</script>