<%-- 
    Document   : index
    Created on : 31/10/2015, 10:10:43 AM
    Author     : fcelestino
--%>

<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@ include file="validar.jsp" %>
<%    String c = request.getParameter("c");
%>
<!DOCTYPE html>
<!--[if IE 8]> <html lang="en" class="ie8"> <![endif]-->
<!--[if IE 9]> <html lang="en" class="ie9"> <![endif]-->
<!--[if !IE]><!--> <html lang="es"> <!--<![endif]-->

    <!-- START @HEAD -->
    <head>
        <!-- START @META SECTION -->
        <meta charset="utf-8">
        <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
        <meta name="description" content="Blankon is a theme fullpack admin template powered by Twitter bootstrap 3 front-end framework. Included are multiple example pages, elements styles, and javascript widgets to get your project started.">
        <meta name="keywords" content="admin, admin template, bootstrap3, clean, fontawesome4, good documentation, lightweight admin, responsive dashboard, webapp">
        <meta name="author" content="Djava UI">
        <title>SISTEMA CUOTAS PAGO ACADEMIA</title>
        <link rel="icon" type="image/png" sizes="16x16" href="images/helicoide.png" />
        <!--/ END META SECTION -->

        <!-- START @FAVICONS -->
        <!--<link href="../img/ico/apple-touch-icon-144x144-precomposed.png" rel="apple-touch-icon-precomposed" sizes="144x144">-->
        <!--<link href="../img/ico/apple-touch-icon-114x114-precomposed.png" rel="apple-touch-icon-precomposed" sizes="114x114">-->
        <!--<link href="../img/ico/apple-touch-icon-72x72-precomposed.png" rel="apple-touch-icon-precomposed" sizes="72x72">-->
        <!--<link href="../img/ico/apple-touch-icon-57x57-precomposed.png" rel="apple-touch-icon-precomposed">-->
        <!--<link href="../img/ico/apple-touch-icon.png" rel="shortcut icon">-->
        <!--/ END FAVICONS -->

        <!-- START @FONT STYLES -->
        <link href="http://fonts.googleapis.com/css?family=Open+Sans:400,300,600,700" rel="stylesheet">
        <link href="http://fonts.googleapis.com/css?family=Oswald:700,400" rel="stylesheet">
        <!--/ END FONT STYLES -->

        <!-- START @GLOBAL MANDATORY STYLES -->
        <link href="../assets/global/plugins/bower_components/bootstrap/dist/css/bootstrap.min.css" rel="stylesheet">
        <link href="../assets/global/plugins/bower_components/bootstrap-switch/dist/css/bootstrap3/bootstrap-switch.min.css" rel="stylesheet">

        <!--/ END GLOBAL MANDATORY STYLES -->

        <!-- START @PAGE LEVEL STYLES -->
        <link href="../assets/global/plugins/bower_components/fontawesome/css/font-awesome.min.css" rel="stylesheet">
        <link href="../assets/global/plugins/bower_components/animate.css/animate.min.css" rel="stylesheet">
        <link href="../assets/global/plugins/bower_components/dropzone/downloads/css/dropzone.css" rel="stylesheet">
        <link href="../assets/global/plugins/bower_components/jquery.gritter/css/jquery.gritter.css" rel="stylesheet">
        <!--/ END PAGE LEVEL STYLES -->
        <!-- DATEPICKER CSS INICIO -->
        <link href="../assets/global/plugins/bower_components/bootstrap-daterangepicker/daterangepicker.css" rel="stylesheet">

        <!-- START @THEME STYLES -->
        <link href="../assets/admin/css/reset.css" rel="stylesheet">
        <link href="../assets/admin/css/layout.css" rel="stylesheet">
        <link href="../assets/admin/css/components.css" rel="stylesheet">
        <link href="../assets/admin/css/plugins.css" rel="stylesheet">
        <link href="../assets/admin/css/themes/red.theme.css" rel="stylesheet" id="theme">
        <link href="../assets/admin/css/custom.css" rel="stylesheet">
        <!--/ END THEME STYLES -->
        <link rel="stylesheet" href="validar/css/validationEngine.jquery.css" type="text/css"/>
        <!-- START @IE SUPPORT -->
        <!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries -->
        <!--[if lt IE 9]>
        <script src="../assets/global/plugins/bower_components/html5shiv/dist/html5shiv.min.js"></script>
        <script src="../assets/global/plugins/bower_components/respond-minmax/dest/respond.min.js"></script>
        <![endif]-->
        <!--/ END IE SUPPORT -->
        <style>
            #popup-general .modal-dialog{
                top: 40%;
            }
            .modal-dialog .form-body{
                overflow-y: scroll;
                overflow-x: inherit;
                max-height: 470px;
            }
        </style>
        <style>
            .daterangepicker td.in-range {
                background: #D0D0D0;
                border-radius: 0;
            }.daterangepicker td.active, .daterangepicker td.active{
                background-color: #BB1515;
                border-color: #8CC152;
                color: #fff;

            }.daterangepicker td.available:hover , .datepicker.th.available:hover{
                background: #BB1515;
                color: #fff;                
            }.modal-dialog {
                margin: 30px auto;
            }.table>tbody>tr>td, .table>tbody>tr>th, .table>tfoot>tr>td, .table>tfoot>tr>th, .table>thead>tr>td, .table>thead>tr>th {
                padding: 5px;
            }
        </style>
    </head>
    <!--/ END HEAD -->

    <!--

    |=========================================================================================================================|
    |  TABLE OF CONTENTS (Use search to find needed section)                                                                  |
    |=========================================================================================================================|
    |  01. @HEAD                        |  Container for all the head elements                                                |
    |  02. @META SECTION                |  The meta tag provides metadata about the HTML document                             |
    |  03. @FAVICONS                    |  Short for favorite icon, shortcut icon, website icon, tab icon or bookmark icon    |
    |  04. @FONT STYLES                 |  Font from google fonts                                                             |
    |  05. @GLOBAL MANDATORY STYLES     |  The main 3rd party plugins css file                                                |
    |  06. @PAGE LEVEL STYLES           |  Specific 3rd party plugins css file                                                |
    |  07. @THEME STYLES                |  The main theme css file                                                            |
    |  08. @IE SUPPORT                  |  IE support of HTML5 elements and media queries                                     |
    |=========================================================================================================================|
    |  09. @BODY                        |  Contains all the contents of an HTML document                                      |
    |  10. @WRAPPER                     |  Wrapping page section                                                              |
    |  11. @HEADER                      |  Header page section contains about logo, top navigation, notification menu         |
    |  12. @SIDEBAR LEFT                |  Sidebar page section contains all sidebar menu left                                |
    |  13. @PAGE CONTENT                |  Contents page section contains breadcrumb, content page, footer page               |
    |  14. @SIDEBAR RIGHT               |  Sidebar page section contains all sidebar menu right                               |
    |  15. @BACK TOP                    |  Element back to top and action                                                     |
    |=========================================================================================================================|
    |  16. @CORE PLUGINS                |  The main 3rd party plugins script file                                             |
    |  17. @PAGE LEVEL PLUGINS          |  Specific 3rd party plugins script file                                             |
    |  18. @PAGE LEVEL SCRIPTS          |  The main theme script file                                                         |
    |=========================================================================================================================|

    START @BODY
    |=========================================================================================================================|
        |  TABLE OF CONTENTS (Apply to body class)                                                                                |
        |=========================================================================================================================|
    |  01. page-boxed                   |  Page into the box is not full width screen                                         |
        |  02. page-header-fixed            |  Header element become fixed position                                               |
        |  03. page-sidebar-fixed           |  Sidebar element become fixed position with scroll support                          |
        |  04. page-sidebar-minimize        |  Sidebar element become minimize style width sidebar                                |
        |  05. page-footer-fixed            |  Footer element become fixed position with scroll support on page content           |
        |  06. page-sound                   |  For playing sounds on user actions and page events                                 |
        |=========================================================================================================================|

    -->
    <body class="page-sound page-header-fixed page-sidebar-fixed" onload="cargar();">

        <!--[if lt IE 9]>
        <p class="upgrade-browser">Upps!! You are using an <strong>outdated</strong> browser. Please <a href="http://browsehappy.com/" target="_blank">upgrade your browser</a> to improve your experience.</p>
        <![endif]-->

        <!-- START @WRAPPER -->
        <section id="wrapper">

            <!-- START @HEADER -->



            <%@ include file="banner.jsp" %>
            <!--/ END HEADER -->

            <!--

            START @SIDEBAR LEFT
            |=========================================================================================================================|
            |  TABLE OF CONTENTS (Apply to sidebar left class)                                                                        |
            |=========================================================================================================================|
            |  01. sidebar-box               |  Variant style sidebar left with box icon                                              |
            |  02. sidebar-rounded           |  Variant style sidebar left with rounded icon                                          |
            |  03. sidebar-circle            |  Variant style sidebar left with circle icon                                           |
            |=========================================================================================================================|

            -->


            <!--        <input id="codModulo" type="hidden" value="< %=menu!=null?menu.getCodModulo():""%>">
                        <input id="codCategoria" type="hidden" value="< %=menu!=null?menu.getCodCategoria():""%>">-->
            <input id="codTitulo" type="hidden" value='<%=menu != null ? menu.getCodigoTitulo() : ""%>'>
            <input id="codModulo" type="hidden" value='<%=menu != null ? menu.getCodigoModulo() : ""%>'>
            <input id="codCategoria" type="hidden" value='<%=menu != null ? menu.getCodigoCategoria() : ""%>'>
            <input id="codSubCategoria" type="hidden" value='<%=menu != null ? menu.getCodigoSubCategoria() : ""%>'>



            <%@ include file="menu.jsp" %>

            <!-- /#sidebar-left -->
            <!--/ END SIDEBAR LEFT -->

            <!-- START @PAGE CONTENT -->
            <section id="page-content">

                <!-- Start page header -->
                <div class="header-content" id="formulario">
                    <h2><i class="fa fa-check"></i>Reporte <span>Reporte de Ingresos</span></h2>
                    <div class="breadcrumb-wrapper hidden-xs">
                        <!-- <span class="label">You are here:</span>
                        <ol class="breadcrumb">
                            <li class="active">Tipo Usuario</li>
                        </ol> -->
                    </div>
                </div><!-- /.header-content -->
                <!--/ End page header -->
                <!-- Start body content -->
                <div class="body-content animated fadeIn">


                    <form id="form-nuevo">
                        <div id="" class="row section scrollspy">
                            <div class="col-sm-12">
                                <div class="panel rounded shadow panel-blueDark panelborder">
                                    <div class="panel-heading blue2">
                                        <div class="pull-left">
                                            <h3 class="panel-title"><i class="fa fa-list-alt"></i>Ingresos Diarios</h3>
                                        </div>
                                        <div class="clearfix"> </div>
                                    </div>
                                    <div class="panel-body">
                                        <div class="row">
                                            <div id="Fecha" class="col-md-4 form-group">
                                                <label class="control-label "><b>Rango Fecha : <span class="asterisk">(*)</span></b></label>
                                                <input class="form-control date-range-picker-double-Top validate[required]" id="fecha_nac" type="text" data-referencia="6" >
                                            </div>
                                            <div  class="col-md-6 form-group">

                                            </div>
                                        </div>
                                        <div class="row">
                                            <div id="Centro" class="col-md-4 form-group">
                                                <label class="control-label"><b>Centro: <span class="asterisk">(*)</span></b></label>
                                                <select  class="form-control validate[required]" name="Centro">
                                                    <option value="0">[SELECCIONE]</option>
                                                </select>
                                            </div>
                                            <div  class="col-md-4 form-group">
                                                <label class="control-label"><b>Ciclo : </b></label>
                                                <select id="Nivel" onchange="ListarGrado()" class="form-control" name="Nivel">
                                                    <option value="0">[SELECCIONE]</option>
                                                </select>
                                            </div>
                                            <div  class="col-md-4 form-group">
                                                <label class="control-label"><b>Tipo Grado : </b></label>
                                                <select  id="Grado" onchange="ListarCiclo()" class="form-control" name="Grado">
                                                    <option value="0">[SELECCIONE]</option>
                                                </select>
                                            </div>
                                        </div>
                                        <div class="row">
                                            <div id="Ciclo" class="col-md-4 form-group">
                                                <label class="control-label"><b> Universidad :</b></label>
                                                <select  class="form-control" name="Ciclo">
                                                    <option value="0">[SELECCIONE]</option>
                                                </select>
                                            </div>
                                            <div id="Turno" class="col-md-4 form-group">
                                                <label class="control-label"><b>Turno :</b></label>
                                                <select onchange="ListarSeccion()" class="form-control" name="Turno">
                                                    <option value="0">[SELECCIONE]</option>
                                                    <option value="1">Mañana</option>
                                                    <option value="2">Tarde</option>
                                                    <option value="3">Noche</option>
                                                </select>
                                            </div>
                                            <div id="Seccion" class="col-md-4 form-group">
                                                <label class="control-label"><b>Sección :</b></label>
                                                <select  class="form-control" name="Seccion">
                                                    <option value="0" >[SELECCIONE]</option>
                                                </select>
                                            </div>
                                        </div>



                                        <div class="row">
                                            <div id="TBuscar" class="col-md-4 form-group">
                                                <label class="control-label"><b>Buscar Por :</b></label>
                                                <select  class="form-control" name="Ciclo">
                                                    <option value="0">[SELECCIONE]</option>
                                                    <option value="1">Nombre</option>
                                                    <option value="2" >DNI</option>
                                                </select>
                                            </div>
                                            <div id="Nombre" class="col-md-4 form-group">
                                                <label class="control-label ">  </label>
                                                <input class="form-control " type="text" >
                                            </div>
                                            <div class="col-md-4 form-group">
                                                <label class="control-label"><b>Tipo Documento:</b></label>
                                                <select  class="form-control" id="tipDocumento">
                                                    <option value="">[TODOS]</option>
                                                    <option value="TICKET">TICKET</option>
                                                    <option value="BOLETA" >BOLETA</option>
                                                    <option value="FACTURA" >FACTURA</option>
                                                </select>
                                            </div>
                                        </div>
                                        <div class="row">
                                            <div class="form-group col-md-12">                 
                                                <div class="text-right"><b><span class="asterisk">(*)</span> Campo Obligatorio</b>
                                                </div>         
                                            </div>
                                        </div>
                                        <div class="row ">
                                            <div class="col-md-4">

                                            </div>
                                            <div class="col-md-4">

                                            </div>
                                            <div class="col-md-4">
                                                <button  class="btn btn-foursquare" id="buscar" type="button"  onclick="BuscarIngreso(1);"><i class="fa fa-search"></i> Buscar</button>

                                                <button class="btn btn-warning  " type="button" onclick="limpiarReporteIngreso();"><i class="fa fa-refresh"></i> Limpiar</button>
                                                <button class="btn btn-success  " disabled="" type="button" id="ExcelIngreso" onclick="ExcelIngresoDiario()" ><i class="fa fa-file-excel-o"></i> Exportar</button>

                                            </div>

                                        </div>

                                    </div>
                                </div> 
                            </div>

                        </div><!-- /.row -->
                    </form>
                    <div id="Table">

                    </div>
                </div><!-- /.body-content -->
                <!--/ End body content -->
                <!-- Start DIV POPUP -->
                <!--                <div id="popup-conformidad" data-backdrop="static" class="modal fade modal-center modal-saco" tabindex="-1" role="dialog" aria-hidden="true"  ></div>
                                <div id="popup-notificacion" class="modal fade modal-center modal-success" tabindex="-1" role="dialog" aria-hidden="true" ></div>
                                <div id="popup-advertencia" class="modal fade modal-center modal-warning" tabindex="-1" role="dialog" aria-hidden="true" ></div>
                                <div id="popup-error" class="modal fade modal-center modal-danger" tabindex="-1" role="dialog" aria-hidden="true" ></div>
                                <div id="popup-general" class="modal fade bs-example-modal-form in modal-saco " tabindex="-1" role="dialog" aria-hidden="true" ></div>-->
                <!--/ End DIV POPUP -->
                <!-- Start footer content -->

                <%@ include file="footer.jsp" %>
                <!--/ End footer content -->

            </section><!-- /#page-content -->
            <!--/ END PAGE CONTENT -->

            <!-- START @SIDEBAR RIGHT -->

            <!--/ END SIDEBAR RIGHT -->

        </section><!-- /#wrapper -->
        <!--/ END WRAPPER -->

        <!-- START @BACK TOP -->
        <div id="back-top" class="animated pulse circle">
            <i class="fa fa-angle-up"></i>
        </div><!-- /#back-top -->
        <!--/ END BACK TOP -->
        <section>
            <div  id="popup-conformidad" data-backdrop="static"  class="modal  modal-center modal-saco animated flipInY prueba" tabindex="-1" role="dialog" aria-hidden="true"  >
            </div>
            <div  id="popup-notificacion" class="modal  modal-center modal-success animated flipInY " tabindex="-1" role="dialog" aria-hidden="true" >
            </div>
            <div  id="popup-advertencia" class="modal  modal-center modal-warning animated flipInY " tabindex="-1" role="dialog" aria-hidden="true" >
            </div>
            <!-- Modal General -->
            <div id="popup-general" class="modal fade bs-example-modal-form in modal-saco " tabindex="-1" role="dialog" aria-hidden="true" >
            </div>
        </section>
        <!-- START JAVASCRIPT SECTION (Load javascripts at bottom to reduce load time) -->
        <!-- START @CORE PLUGINS -->
        <script src="../assets/global/plugins/bower_components/jquery/dist/jquery.min.js"></script>
        <script src="../assets/global/plugins/bower_components/jquery-cookie/jquery.cookie.js"></script>
        <script src="../assets/global/plugins/bower_components/bootstrap/dist/js/bootstrap.min.js"></script>
        <script src="../assets/global/plugins/bower_components/typehead.js/dist/handlebars.js"></script>
        <script src="../assets/global/plugins/bower_components/typehead.js/dist/typeahead.bundle.min.js"></script>
        <script src="../assets/global/plugins/bower_components/jquery-nicescroll/jquery.nicescroll.min.js"></script>
        <script src="../assets/global/plugins/bower_components/jquery.sparkline.min/index.js"></script>
        <script src="../assets/global/plugins/bower_components/jquery-easing-original/jquery.easing.1.3.min.js"></script>
        <script src="../assets/global/plugins/bower_components/ionsound/js/ion.sound.min.js"></script>
        <script src="../assets/global/plugins/bower_components/bootbox/bootbox.js"></script>
        <!--/ END CORE PLUGINS -->

        <!-- START @PAGE LEVEL PLUGINS -->
        <!--<script src="../assets/global/plugins/bower_components/bootstrap-session-timeout/dist/bootstrap-session-timeout.min.js"></script>-->
        <script src="../assets/global/plugins/bower_components/flot/jquery.flot.js"></script>
        <script src="../assets/global/plugins/bower_components/flot/jquery.flot.spline.min.js"></script>
        <script src="../assets/global/plugins/bower_components/flot/jquery.flot.categories.js"></script>
        <script src="../assets/global/plugins/bower_components/flot/jquery.flot.tooltip.min.js"></script>
        <script src="../assets/global/plugins/bower_components/flot/jquery.flot.resize.js"></script>
        <script src="../assets/global/plugins/bower_components/flot/jquery.flot.pie.js"></script>
        <script src="../assets/global/plugins/bower_components/dropzone/downloads/dropzone.min.js"></script>
        <script src="../assets/global/plugins/bower_components/jquery.gritter/js/jquery.gritter.min.js"></script>
        <script src="../assets/global/plugins/bower_components/skycons-html5/skycons.js"></script>
        <!--/ END PAGE LEVEL PLUGINS -->

        <!-- START @PAGE LEVEL SCRIPTS -->
        <script src="../assets/admin/js/apps.js"></script>
        <script src="../assets/admin/js/pages/blankon.dashboard.js"></script>
        <script src="../assets/admin/js/demo.js"></script>
        <script src="../assets/global/plugins/bower_components/bootstrap-switch/dist/js/bootstrap-switch.min.js"></script>
        <!-- DATEPICKER JS INICIO -->
        <script src="../assets/global/plugins/bower_components/moment/min/moment.min.js"></script>
        <script src="../assets/global/plugins/bower_components/bootstrap-daterangepicker/daterangepicker.js"></script>
        <!-- DATEPICKER JS FINAL -->
        <script src="../assets/global/plugins/bower_components/twitter-bootstrap-wizard/jquery.bootstrap.wizard.min.js"></script>

        <script src="validar/js/languages/jquery.validationEngine-es.js" type="text/javascript" charset="utf-8"></script>
        <script src="validar/js/jquery.validationEngine.js" type="text/javascript" charset="utf-8"></script>
        <script>
                                                    $(document).ready(function () {
                                                        jQuery("#form-nuevo").validationEngine('attach', {promptPosition: "topLeft"});
                                                        jQuery("#form-busqueda").validationEngine('attach', {promptPosition: "topLeft"});

                                                        // $( "#block" ).animate({

                                                        //   }, 1500 );
                                                        //evento Scroll


                                                    });
                                                    function segundaCarga() {

                                                        ListarCentro();

                                                        convertirDateTimePicker();
                                                        ComboCargarfechaActual();
                                                    }
                                                    function ComboCargarfechaActual() {
                                                        if (<%=c%> != null) {
                                                            var f = new Date();
                                                            var dia = f.getDate();
                                                            var mes = (f.getMonth() + 1);
                                                            if (f.getDate() < 10) {
                                                                dia = "0" + f.getDate();
                                                            }
                                                            if ((f.getMonth() + 1) < 10) {
                                                                mes = "0" + (f.getMonth() + 1);
                                                            }
                                                            $("#Fecha > input").val("01/" + mes + "/" + f.getFullYear() + " - " + dia + "/" + mes + "/" + f.getFullYear() + "")
                                                        } else {
                                                            var f = new Date();
                                                            var dia = f.getDate();
                                                            var mes = (f.getMonth() + 1);
                                                            if (f.getDate() < 10) {
                                                                dia = "0" + f.getDate();
                                                            }
                                                            if ((f.getMonth() + 1) < 10) {
                                                                mes = "0" + (f.getMonth() + 1);
                                                            }
                                                            $("#Fecha > input").val("" + dia + "/" + mes + "/" + f.getFullYear() + " - " + dia + "/" + mes + "/" + f.getFullYear() + "")
                                                        }

                                                    }
                                                    function ListarCentro() {
                                                        var cod_sede =<%=usuario.getCodigoSede()%>;

                                                        $.ajax({
                                                            type: 'POST',
                                                            url: '../ServletMatriculados?accion=ListarCentro',
                                                            data: 'cod_sede=' + cod_sede,
                                                            beforeSend: function () {

                                                            }, success: function (resultado) {
                                                                $("#Centro").html(resultado);
                                                                if (<%=c%> != null) {
                                                                    $("#Centro > select").val(<%=c%>);
                                                                    $("#buscar").click();
                                                                    listarNivel();
                                                                }
                                                            }, complete: function () {
                                                                $("#Centro > select").val(2);
                                                                listarNivel();
                                                            }
                                                        });

                                                    }
                                                    function listarNivel() {
                                                        var cod_centro = $("#Centro > select").val();
                                                        var cod_sede =<%=usuario.getCodigoSede()%>;
                                                        // alert(cod_sede+" "+cod_centro)
                                                        $.ajax({
                                                            type: 'POST',
                                                            url: '../ServletMatriculados?accion=ListarNivel',
                                                            data: 'cod_centro=' + cod_centro + '&cod_sede=' + cod_sede,
                                                            beforeSend: function () {
                                                                $("#Seccion > select ").html('<option value="0">[SELECCIONE]</option>');
                                                                $("#Turno > select ").html('<option value="0">[SELECCIONE]</option>');
                                                                $("#Ciclo > select ").html('<option value="0">[SELECCIONE]</option>');
                                                                $("#Grado").html('<option value="0">[SELECCIONE]</option>');
                                                            }, success: function (resultado) {
                                                                $("#Nivel").html(resultado);
                                                            }, complete: function () {
                                                                if ($("#Centro > select option:selected ").text() == "[SELECCIONE]") {
                                                                    $("#Nivel").html('<option value="0">[SELECCIONE]</option>');
                                                                }
                                                            }
                                                        });

                                                    }
                                                    function ListarGrado(pag) {

                                                        var cod_nivel = $("#Nivel").val();


                                                        $.ajax({
                                                            type: 'POST',
                                                            url: '../ServletMatriculados?accion=listarGrado',
                                                            data: 'cod_nivel=' + cod_nivel + '&pag=' + pag,
                                                            beforeSend: function () {
                                                                $("#Seccion > select ").html('<option value="0">[SELECCIONE]</option>');
                                                                $("#Turno > select ").html('<option value="0">[SELECCIONE]</option>');
                                                                $("#Ciclo > select ").html('<option value="0">[SELECCIONE]</option>');
                                                            }, success: function (resultado) {
                                                                $("#Grado").html(resultado);
                                                            }, complete: function () {
                                                                if ($("#Nivel option:selected ").text() == "[SELECCIONE]") {
                                                                    $("#Grado").html('<option value="0">[SELECCIONE]</option>');
                                                                }
                                                            }
                                                        });


                                                    }

                                                    function ListarCiclo() {
                                                        var cod_grado = $("#Grado").val();

                                                        $.ajax({
                                                            type: 'POST',
                                                            url: '../ServletMatriculados?accion=listarCiclo',
                                                            data: 'cod_grado=' + cod_grado,
                                                            beforeSend: function () {
                                                                $("#Seccion > select ").html('<option value="0">[SELECCIONE]</option>');
                                                                $("#Turno > select ").html('<option value="0">[SELECCIONE]</option>');
                                                            }, success: function (resultado) {
                                                                $("#Ciclo").html(resultado);
                                                            }, complete: function () {
                                                                if ($("#Grado option:selected ").text() == "[SELECCIONE]") {
                                                                    $("#Ciclo > select ").html('<option value="0">[SELECCIONE]</option>');
                                                                }
                                                            }
                                                        });

                                                    }

                                                    function ListarSeccion() {
                                                        var cod_aula = $("div#Turno select option:SELECTED").data("aula");
                                                        //   alert(cod_centro +" "+cod_nivel+" "+cod_grado+" "+cod_ciclo+" "+cod_turno);
                                                        $.ajax({//cod_aula
                                                            type: 'POST',
                                                            url: '../ServletMatriculados?accion=listarSeccion',
                                                            data: 'cod_aula=' + cod_aula,
                                                            beforeSend: function () {

                                                            }, success: function (resultado) {

                                                                if (resultado != null) {
                                                                    $("#Seccion").html(resultado);
                                                                }

                                                            }, complete: function () {

                                                            }
                                                        });
                                                    }

                                                    function convertirDateTimePicker() {
                                                        var f = new Date();
                                                        var hoy = f.getDate() + "/" + (f.getMonth() + 1) + "/" + f.getFullYear();
                                                        $('.date-range-picker-double-Top').daterangepicker({
                                                            "singleDatePicker": false,
                                                            "showDropdowns": false,
                                                            "autoApply": true,
                                                            "locale": {
                                                                "format": "DD/MM/YYYY",
                                                                "separator": " - ",
                                                                "customRangeLabel": "Personaliza",
                                                                "daysOfWeek": [
                                                                    "Do",
                                                                    "Lu",
                                                                    "Ma",
                                                                    "Mi",
                                                                    "Ju",
                                                                    "Vi",
                                                                    "Sa"
                                                                ],
                                                                "monthNames": [
                                                                    "Ene",
                                                                    "Feb",
                                                                    "Mar",
                                                                    "Abr",
                                                                    "May",
                                                                    "Jun",
                                                                    "Jul",
                                                                    "Ago",
                                                                    "Sep",
                                                                    "Oct",
                                                                    "Nov",
                                                                    "Dic"
                                                                ],
                                                                "firstDay": 1
                                                            },
                                                            "startDate": hoy.toString(),
                                                            "endDate": hoy.toString(),
                                                            "drops": "down"
                                                        }, function (start, end, label) {

                                                        });
                                                        $('.date-range-picker-double').daterangepicker({
                                                            "singleDatePicker": false,
                                                            "showDropdowns": false,
                                                            "autoApply": true,
                                                            "locale": {
                                                                "format": "DD/MM/YYYY",
                                                                "separator": " - ",
                                                                "customRangeLabel": "Personaliza",
                                                                "daysOfWeek": [
                                                                    "Do",
                                                                    "Lu",
                                                                    "Ma",
                                                                    "Mi",
                                                                    "Ju",
                                                                    "Vi",
                                                                    "Sa"
                                                                ],
                                                                "monthNames": [
                                                                    "Ene",
                                                                    "Feb",
                                                                    "Mar",
                                                                    "Abr",
                                                                    "May",
                                                                    "Jun",
                                                                    "Jul",
                                                                    "Ago",
                                                                    "Sep",
                                                                    "Oct",
                                                                    "Nov",
                                                                    "Dic"
                                                                ],
                                                                "firstDay": 1
                                                            },
                                                            "startDate": hoy.toString(),
                                                            "endDate": hoy.toString()
                                                        }, function (start, end, label) {});
                                                        $('.date-range-picker-double-Top').val("");
                                                        $('.date-range-picker-double').val("");
                                                    }
                                                    function BuscarIngreso(pag) {

                                                        var estado = $('#form-nuevo').stop().validationEngine('validate');
                                                        // alert(estado);
                                                        if (estado) {
                                                            $('#ExcelIngreso').attr('disabled', false);

                                                            var cod_sede = <%=usuario.getCodigoSede()%>;
                                                            var cod_centro = $("#Centro > select ").val();
                                                            var cod_nivel = $("#Nivel  ").val();
                                                            var cod_grado = $("#Grado ").val();
                                                            var cod_ciclo = $("#Ciclo > select ").val();
                                                            var cod_turno = $("#Turno > select ").val();
                                                            var seccion = $("#Seccion > select ").val();
                                                            var tipDocumento = $("#tipDocumento").val();
                                                            var Fechas = $("#Fecha > input").val().split(' - ');
                                                            if (Fechas != "") {
                                                                var fecha_i = Fechas[0];
                                                                var fecha_f = Fechas[1];
                                                            } else {
                                                                //   alert("Ingrese Rango de Fechas 26/05/2016 - 26/05/2016   "+dia_actual + "/" +mes_actual + "/" + f.getFullYear());
                                                                //  $("#Fecha > input").val(""+f.getDay() + "/" +f.getMonth() + "/" + f.getYear()+" - "+f.getDay() + "/" +f.getMonth() + "/" + f.getFullYear()+"")
                                                                //   fecha_i=""+dia_actual + "/" +mes_actual + "/" + f.getFullYear();
                                                                //   fecha_f=""+dia_actual + "/" +mes_actual + "/" + f.getFullYear();
                                                            }

                                                            var tipo_buscar = $("#TBuscar > select ").val();
                                                            var nombre = $("#Nombre > input ").val();
                                                            var fecha_I;
                                                            var fecha_F;
                                                            var filtro;

                                                            if (fecha_i != "") {
                                                                fecha_I = fecha_i.split("/")[2] + "/" + fecha_i.split("/")[1] + "/" + fecha_i.split("/")[0];
                                                            } else {
                                                                fecha_I = "0";
                                                            }
                                                            if (fecha_f != "") {
                                                                fecha_F = fecha_f.split("/")[2] + "/" + fecha_f.split("/")[1] + "/" + fecha_f.split("/")[0];
                                                            } else {
                                                                fecha_F = "0";
                                                            }
                                                            if (nombre != "") {
                                                                filtro = nombre;
                                                            } else {
                                                                filtro = "null";
                                                            }

                                                            //       alert('cod_sede='+cod_sede+'&cod_centro='+cod_centro+'&cod_nivel='+cod_nivel+'&cod_grado='+cod_grado
                                                            //             +'&cod_ciclo='+cod_ciclo+'&turno='+cod_turno+'&seccion='+seccion+'&fecha_i='+fecha_I+'&fecha_f='+fecha_F+'&tipo_buscar='+tipo_buscar+'&nombre='+filtro+'&pag='+pag);

                                                            $.ajax({
                                                                type: 'POST',
                                                                url: '../ServletMatriculados?accion=ListarReporteIngreso',
                                                                data: 'cod_sede=' + cod_sede + '&cod_centro=' + cod_centro + '&cod_nivel=' + cod_nivel + '&cod_grado=' + cod_grado
                                                                        + '&cod_ciclo=' + cod_ciclo + '&turno=' + cod_turno + '&seccion=' + seccion + '&fecha_i=' + fecha_I + '&fecha_f=' + fecha_F + '&tipo_buscar=' + tipo_buscar + '&nombre=' + filtro + '&pag=' + pag + '&tipDocumento=' + tipDocumento + '',
                                                                beforeSend: function () {
                                                                    $("#Table").html('<center><img src="images/loader-gears.gif" alt=""/></center>');
                                                                }, success: function (resultado) {
                                                                    $("#Table").html(resultado);
                                                                }, complete: function () {

                                                                }
                                                            });
                                                        } else {
                                                            $('#ExcelIngreso').attr('disabled', true);
                                                            location.href = "#formulario"
                                                        }
                                                    }
                                                    function ExcelIngresoDiario() {
                                                        var f = new Date();
                                                        var dia_actual = f.getDate();
                                                        var mes_actual = (f.getMonth() + 1);
                                                        if (f.getDate() < 10) {
                                                            var dia_actual = "0" + f.getDate();
                                                        }
                                                        if ((f.getMonth() + 1) < 10) {
                                                            var mes_actual = "0" + (f.getMonth() + 1);
                                                        }
                                                        var usuarionomb = '<%=usuario.getNombre()%>';
                                                        var cod_usu =<%=usuario.getCodigoUsuario()%>;
                                                        var cod_sede = <%=usuario.getCodigoSede()%>;
                                                        var cod_centro = $("#Centro > select ").val();
                                                        var cod_nivel = $("#Nivel").val();
                                                        var cod_grado = $("#Grado").val();
                                                        var cod_ciclo = $("#Ciclo > select ").val();
                                                        var cod_turno = $("#Turno > select ").val();
                                                        var seccion = $("#Seccion > select ").val();
                                                        var Fechas = $("#Fecha > input").val().split(' - ');
                                                        var tipDocumento = $("#tipDocumento").val();
                                                        var f = new Date();
                                                        var fe_min = f.getMinutes();
                                                        var fe_seg = f.getSeconds();
                                                        var fe_hors = f.getHours();
                                                        var fe_dia = f.getDate();
                                                        var fe_mes = f.getMonth();
                                                        if (f.getMinutes() < 10) {
                                                            fe_min = "0" + f.getMinutes();
                                                        }
                                                        if (f.getSeconds() < 10) {
                                                            fe_seg = "0" + f.getSeconds();
                                                        }
                                                        if (f.getHours() < 10) {
                                                            fe_hors = "0" + f.getHours();
                                                        }
                                                        if (f.getDate() < 10) {
                                                            var fe_dia = "0" + f.getDate();
                                                        }
                                                        if ((f.getMonth() + 1) < 10) {
                                                            var fe_mes = "0" + (f.getMonth() + 1);
                                                        }

                                                        var fecha_actual = fe_dia + "/" + fe_mes + "/" + f.getFullYear() + " " + f.getHours() + ":" + fe_min + ":" + fe_seg;


                                                        if (Fechas != "") {
                                                            var fecha_i = Fechas[0];
                                                            var fecha_f = Fechas[1];
                                                        } else {
                                                            //   alert("Ingrese Rango de Fechas 26/05/2016 - 26/05/2016   "+dia_actual + "/" +mes_actual + "/" + f.getFullYear());
                                                            $("#Fecha > input").val("" + dia_actual + "/" + mes_actual + "/" + f.getFullYear() + " - " + dia_actual + "/" + mes_actual + "/" + f.getFullYear() + "")
                                                            fecha_i = "" + dia_actual + "/" + mes_actual + "/" + f.getFullYear();
                                                            fecha_f = "" + dia_actual + "/" + mes_actual + "/" + f.getFullYear();
                                                        }

                                                        var tipo_buscar = $("#TBuscar > select ").val();
                                                        var nombre = $("#Nombre > input ").val();
                                                        var fecha_I;
                                                        var fecha_F;
                                                        var filtro;

                                                        if (fecha_i != "") {
                                                            fecha_I = fecha_i.split("/")[2] + "/" + fecha_i.split("/")[1] + "/" + fecha_i.split("/")[0];
                                                        } else {
                                                            fecha_I = "0";
                                                        }
                                                        if (fecha_f != "") {
                                                            fecha_F = fecha_f.split("/")[2] + "/" + fecha_f.split("/")[1] + "/" + fecha_f.split("/")[0];
                                                        } else {
                                                            fecha_F = "0";
                                                        }
                                                        if (nombre != "") {
                                                            filtro = nombre;
                                                        } else {
                                                            filtro = "null";
                                                        }
                                                        // alert('ExcelIngresoDiario.jsp?cod_sede='+cod_sede+'&cod_centro='+cod_centro+'&cod_nivel='+cod_nivel+'&cod_grado='+cod_grado
                                                        //   +'&cod_ciclo='+cod_ciclo+'&turno='+cod_turno+'&seccion='+seccion
                                                        //   +'&fecha_i='+fecha_I+'&fecha_f='+fecha_F+'&tipo_buscar='+tipo_buscar+'&nombre='+filtro+'&fecha_actual='+fecha_actual+'&usu='+usuarionomb);


                                                        window.location = 'ExcelIngreso.jsp?cod_sede=' + cod_sede + '&cod_centro=' + cod_centro + '&cod_nivel=' + cod_nivel + '&cod_grado=' + cod_grado
                                                                + '&cod_ciclo=' + cod_ciclo + '&turno=' + cod_turno + '&seccion=' + seccion
                                                                + '&fecha_i=' + fecha_I + '&fecha_f=' + fecha_F + '&tipo_buscar=' + tipo_buscar + '&nombre=' + filtro + '&fecha_actual=' + fecha_actual + '&usu=' + usuarionomb + '&cod_usu=' +<%=usuario.getCodigoTipoUsuario()%> + '&tipDocumento=' + tipDocumento

                                                    }
                                                    function limpiarReporteIngreso() {

                                                        $("#Centro > select ").val("");
                                                        $("#Nivel").val("");
                                                        $("#Grado").val("");
                                                        $("#Ciclo > select ").val(0);
                                                        $("#Turno > select ").val(0);
                                                        $("#Seccion > select ").val(0);

                                                        $("#TBuscar > select ").val(0);
                                                        $("#Nombre > input ").val("");


                                                    }
                                                    function listarTurno() {
                                                        var cod_sede = <%=usuario.getCodigoSede()%>;
                                                        var cod_centro = $("#Centro > select ").val();
                                                        var cod_nivel = $("#Nivel  ").val();
                                                        var cod_grado = $("#Grado ").val();
                                                        var cod_ciclo = $("#Ciclo > select ").val();

                                                        //   alert('cod_sede='+cod_sede+'&cod_centro='+cod_centro+'&cod_nivel='+cod_nivel+'&cod_grado='+cod_grado
                                                        //        +'&cod_ciclo='+cod_ciclo);

                                                        $.ajax({
                                                            type: 'POST',
                                                            url: '../ServletMatriculados?accion=listarTurno',
                                                            data: 'cod_sede=' + cod_sede + '&cod_centro=' + cod_centro + '&cod_nivel=' + cod_nivel + '&cod_grado=' + cod_grado + '&cod_ciclo=' + cod_ciclo,
                                                            beforeSend: function () {
                                                                $("#Seccion > select ").html('<option value="0">[SELECCIONE]</option>');
                                                            }, success: function (resultado) {

                                                                if (resultado != null) {
                                                                    $("#Turno").html(resultado);
                                                                }

                                                            }, complete: function () {

                                                            }
                                                        });

                                                    }
        </script>

        <!--/ END PAGE LEVEL SCRIPTS -->
        <!--/ END JAVASCRIPT SECTION -->

        <!-- START GOOGLE ANALYTICS - ->
        <script>
            (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
                (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
                    m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
            })(window,document,'script','//www.google-analytics.com/analytics.js','ga');

            ga('create', 'UA-55892530-1', 'auto');
            ga('send', 'pageview');

        </script>
        <!- -/ END GOOGLE ANALYTICS -->

    </body>
    <!--/ END BODY -->

</html>