<%@ page language="java" pageEncoding="UTF-8" contentType="text/html; charset=UTF-8" %>
<%@ page isELIgnored="false" %>
<%@ taglib prefix="shiro" uri="http://shiro.apache.org/tags" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%
    String basePath = request.getContextPath();
%>
<!DOCTYPE html>
<html>
<head>
    <jsp:include page="../../../common/admin/head.jsp"></jsp:include>
</head>
<body>
<jsp:include page="../../../common/admin/body_pre.jsp"></jsp:include>
<div class="row hidden-print">
    <div class="col-lg-12">
        <div class="ibox">
            <div class="ibox-title">
                <h2>${type}</h2>
                <ol class="breadcrumb">
                    <li>
                        <a href="javascript:void(0);" >民生机构</a>
                    </li>
                    <li class="active">
                        <strong>${type}</strong>
                    </li>
                </ol>
            </div>
        </div>
    </div>
</div>
<jsp:include page="../../../common/admin/search_pre.jsp"></jsp:include>
<input type="hidden" name="formSerialize" />
<input type="hidden" name="pageNo" value="1" />
<form id="formSearch" action="<%=basePath%>/admin/msEducation/getEducationOrganization.htm?orgCode=${code}" method="get" class="form-inline">
    <input id="type" value="${type}" type="hidden">
    <input id="code" value="${code}" type="hidden">
    <div class="form-group">
        <label for="orgType">机构类型</label>
        <select id="orgType" name="orgType" class="form-control">
            <option value="">全部</option>
            <c:forEach items="${educationType}" var="item" >
                <option value="${item.key}">${item.value}</option>
            </c:forEach>
        </select>
    </div>
    <div class="form-group">
        <label for="orgName">机构名称</label>
        <input type="text" id="orgName" name="orgName" class="form-control" />
    </div>
    <div class="form-group">
        <button id="btnSearch" type="button" class="btn btn-sm btn-primary"><i class="fa fa-search"></i>查询</button>
    </div>
    <div class="form-group">
    <button id="btnReset" type="button" class="btn btn-sm btn-default"><i class="fa fa-reply"></i>重置</button>
    </div>
</form>
<jsp:include page="../../../common/admin/search_post.jsp"></jsp:include>
<jsp:include page="../../../common/admin/grid_pre.jsp"></jsp:include>
<button id="btnAdd" type="button" class="btn btn-sm btn-primary btn-position"><i class="fa fa-plus"></i>新增</button>
<jsp:include page="../../../common/admin/grid_middle.jsp"></jsp:include>
<div id="divGrid">
</div>
<jsp:include page="../../../common/admin/grid_post.jsp"></jsp:include>
<jsp:include page="../../../common/admin/body_post.jsp"></jsp:include>
<script type="text/javascript">

    var code = $("#code").val() ;
    var type = $("#type").val() ;

    $("#btnReset").click(function () {
        $('#formSearch').resetForm();
    });

    function search() {
        var formSerialize = $("input[type='hidden'][name='formSerialize']").val();
        var pageNo = $("input[type='hidden'][name='pageNo']").val();
        var formData = formSerialize + "&pageNo=" + pageNo;
        $("#divGrid").renderPartial({ url: "<%=basePath%>/admin/msEducation/getEducationOrganization.htm?orgCode="+code+"", data: formData });
    }

    $("#btnSearch").click(function () {
        $("input[type='hidden'][name='pageNo']").val(1);
        $("input[type='hidden'][name='formSerialize']").val($("#formSearch").serialize());
        search();
    });

    function showItem(){
        $.popBsPartial({ url: "<%=basePath%>/admin/xxxxx/info/" + id });
    }
    search();

    $("#btnAdd").click(function () {
        $.popBsPartial({ url: "<%=basePath%>/admin/msEducation/addEducation.htm?orgType="+type });
    });

    $(".input-group.date").datetimepicker({
        format: "YYYY-MM-DD",
        locale: "zh-cn"
    });
</script>
</body>
</html>