Commit 5ee3fc83 by Felipe Escala Torres

Excel Report

parent 20b8275d
......@@ -22,4 +22,8 @@ public interface AsistenciaDAO {
public JSONObject eliminarAsistencia(JSONObject datos) throws Exception;
public JSONObject listarCicloPorEstudiante(JSONObject datos) throws Exception;
public JSONObject listarEstudiantesPorCiclo(JSONObject datos) throws Exception;
public JSONObject listarClasesPorCiclo(JSONObject datos) throws Exception;
}
......@@ -454,4 +454,127 @@ public class MysqlAsistenciaDAO implements AsistenciaDAO {
return jreturn;
}
@Override
public JSONObject listarEstudiantesPorCiclo(JSONObject datos) throws Exception {
JSONObject jreturn;
JSONArray lista = new JSONArray();
JSONObject data = new JSONObject();
Connection con = null;
PreparedStatement pst = null;
ResultSet rSet = null;
int rs = 0;
String sql = "";
ResponseHelper response = new ResponseHelper();
try {
con = MySqlDAOFactory.obtenerConexion(GeneralVariables.nameDB);
sql = "";
} catch (Exception e) {
e.printStackTrace();
response.setStatus(false);
response.setMessage("Error --->" + e.getMessage());
} finally {
try {
if (rSet != null) {
rSet.close();
}
if (pst != null) {
pst.close();
}
if (con != null) {
con.close();
}
} catch (Exception e) {
e.printStackTrace();
response.setStatus(false);
response.setMessage("Error --->" + e.getMessage());
}
}
jreturn = new JSONObject(response);
return jreturn;
}
@Override
public JSONObject listarClasesPorCiclo(JSONObject datos) throws Exception {
JSONObject jreturn;
JSONArray lista = new JSONArray();
JSONObject data = new JSONObject();
Connection con = null;
PreparedStatement pst = null;
ResultSet rSet = null;
int rs = 0;
String sql = "";
ResponseHelper response = new ResponseHelper();
try {
con = MySqlDAOFactory.obtenerConexion(GeneralVariables.nameDB);
sql = " SELECT "
+ " DAYOFMONTH(DATE_ADD(CONCAT_WS('-', YEAR(NOW()), ?, '01'),INTERVAL ta. ROW DAY)), "
+ " DAYOFWEEK (DATE_ADD(CONCAT_WS('-', YEAR(NOW()), ?, '01'),INTERVAL ta. ROW DAY)) -1, "
+ " DATE_ADD(CONCAT_WS('-', YEAR(NOW()), ?, '01'),INTERVAL ta. ROW DAY) "
+ " FROM "
+ " ( "
+ " SELECT @ROW := @ROW + 1 AS ROW "
+ " FROM INFORMATION_SCHEMA. COLUMNS, "
+ " (SELECT @ROW := - 1) t "
+ " ) Ta "
+ " WHERE Ta. ROW < DAYOFMONTH( "
+ " LAST_DAY(CONCAT_WS('-', YEAR(NOW()), ?, '01'))) "
+ " AND DAYOFWEEK(DATE_ADD(CONCAT_WS('-', YEAR(NOW()), ?, '01'), INTERVAL row DAY)) - 1 IN "
+ " ( "
+ " SELECT "
+ " b.dia_bloque "
+ " FROM "
+ " bloques AS b "
+ " INNER JOIN horarios AS h ON h.codigo_horario = b.codigo_horario "
+ " INNER JOIN aula AS a ON a.codigo_horario = h.codigo_horario "
+ " WHERE a.codAula = ? "
+ " ); "
+ "";
pst = con.prepareStatement(sql);
int c = 1;
pst.setString(c++, datos.getString("mesReporte"));
pst.setString(c++, datos.getString("mesReporte"));
pst.setString(c++, datos.getString("mesReporte"));
pst.setString(c++, datos.getString("mesReporte"));
pst.setString(c++, datos.getString("mesReporte"));
pst.setInt(c++, datos.getInt("codigoCiclo"));
rSet = pst.executeQuery();
while (rSet.next()) {
JSONObject obj = new JSONObject();
obj.put("dayMonth", rSet.getInt(1));
obj.put("dayWeek", rSet.getInt(2));
obj.put("date", rSet.getString(3));
lista.put(obj);
}
if (lista.length() >= 1) {
response.setStatus(true);
response.setResults(lista);
} else {
response.setStatus(false);
response.setMessage("No hay contenido");
}
} catch (Exception e) {
e.printStackTrace();
response.setStatus(false);
response.setMessage("Error --->" + e.getMessage());
} finally {
try {
if (rSet != null) {
rSet.close();
}
if (pst != null) {
pst.close();
}
if (con != null) {
con.close();
}
} catch (Exception e) {
e.printStackTrace();
response.setStatus(false);
response.setMessage("Error --->" + e.getMessage());
}
}
jreturn = new JSONObject(response);
return jreturn;
}
}
<%@page import="org.json.JSONObject"%>
<%@page import="java.text.SimpleDateFormat"%>
<%@page import="java.util.Date"%>
<%@page import="java.util.Calendar"%>
<%@page import="pe.siso.academia.Beans.Aula"%>
<%@page import="javax.swing.JPanel"%>
<%@page import="pe.siso.academia.Services.MatriculadosService"%>
<%@page import="pe.siso.academia.Beans.Matriculados"%>
<%@page import="java.util.ArrayList"%>
<%@page import="java.io.PrintWriter"%>
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
pageEncoding="ISO-8859-1"%>
pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Export to Excel - Demo</title>
</head>
<body>
<%
PrintWriter pw = response.getWriter();
int cantidadRegistros = 0;
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title></title>
</head>
<body>
<%
PrintWriter pw = response.getWriter();
String json = request.getParameter("json");
JSONObject parameters = new JSONObject(json);
int codigoCiclo = parameters.getInt("idCiclo");
String nombreCiclo = parameters.getString("nombreCiclo");
String mesAsistencia = parameters.getString("mesAsistencia");
response.setContentType("application/vnd.ms-excel");
response.setHeader("Content-Disposition", "inline; filename=" + "AsistenciaCiclo" + nombreCiclo + "-" + mesAsistencia + ".xls");
%>
<table>
</table>
</body>
String cod_sede=(request.getParameter("cod_sede"));
String cod_centro=(request.getParameter("cod_centro"));
String cod_nivel=(request.getParameter("cod_nivel"));
String cod_grado=(request.getParameter("cod_grado"));
String cod_ciclo=(request.getParameter("cod_ciclo"));
String turno=(request.getParameter("turno"));
String seccion1=request.getParameter("seccion");
String n_mes=request.getParameter("n_mes");
Aula au =new Aula();
au.setCodSede(cod_sede);
au.setCodCentro(cod_centro);
au.setCodNivel(cod_nivel);
au.setCodTipoGrado(cod_grado);
au.setCodGrado(cod_ciclo);
au.setCodTurno(turno);
au.setSecciones(seccion1);
ArrayList<Aula> lista=new ArrayList<Aula>();
MatriculadosService servicio=new MatriculadosService();
lista=servicio.ListaAlumnoAsistencia(au);
String fec1="2017-"+n_mes.trim()+"-12";
Calendar fecha = Calendar.getInstance();
// SimpleDateFormat Nmes = new SimpleDateFormat("M");
SimpleDateFormat Nmes1 = new SimpleDateFormat("yyyy-MM-dd");
// Date date1 = Nmes1.parse(fec1);
// Date date2 = Nmes1.parse(fec2);
// System.out.println("nuemro dsffsdg= "+date1);
// System.out.println("nuemro = "+Nmes.format(date1));
fecha.setTime(Nmes1.parse(fec1));
// fecha.add(Calendar.MONTH, 0);
// calculamos el primer dia del mes anterior
Calendar inicioMesAnterior = servicio.resetCalenderTime((Calendar)fecha.clone()); // clonamos la fecha
inicioMesAnterior.set(Calendar.DAY_OF_MONTH, inicioMesAnterior.getActualMinimum(Calendar.DAY_OF_MONTH));
// calculamos el ultimo dia del mes anterior
Calendar finMesAnterior = servicio.resetCalenderTime2((Calendar)fecha.clone());
finMesAnterior.set(Calendar.DAY_OF_MONTH, inicioMesAnterior.getActualMaximum(Calendar.DAY_OF_MONTH));
System.out.println("Fecha inicio mes anterior: " + inicioMesAnterior.getTime());
System.out.println("Fecha fin mes anterior: " + finMesAnterior.getTime());
System.out.println("r: " + finMesAnterior.getTime().getDate());
int dias=0;
Date Hoy = new Date();
SimpleDateFormat MesSemana = new SimpleDateFormat("MMMM");
for (int j = 0; j < finMesAnterior.getTime().getDate(); j++) {
Date a =servicio.sumarRestarHorasFecha(inicioMesAnterior.getTime(),j);
SimpleDateFormat DiaSemana = new SimpleDateFormat("E");
// SimpleDateFormat fe = new SimpleDateFormat("yyyy/MM/dd");
if (!DiaSemana.format(a).equals("dom")) {
dias=dias+1;
// System.out.println("rango fecha ->"+fe.format(finMesAnterior.getTime()));
}
}
response.setContentType("application/vnd.ms-excel");
response.setHeader("Content-Disposition", "inline; filename="
+ "AsistenciaCiclo"+lista.get(0).getNombAula().replace("/", " ")+".xls");
%>
<table >
<!--FILA 1-->
<tr >
<td colspan="<%=dias+2%>" style='vertical-align:middle' align="center"><h2>ASISTENCIA POR AULA</h2></td>
</tr>
<!--FILA 2-->
<tr>
<!-- <td></td><td></td><td></td><td></td>-->
<td style='vertical-align:middle' colspan="<%=dias+2%>"><b>CICLO:</b><b> <%=lista.get(0).getNombAula() %> </b></td>
</tr>
<!--FILA 3-->
<tr>
<td style='vertical-align:middle' align="left" colspan="<%=dias+2%>"><b> MES: <%=MesSemana.format(Nmes1.parse(fec1)).toUpperCase() %> </b></td>
<!--<td></td><td></td><td></td><td></td>-->
<!--<td style='vertical-align:middle' align="right" colspan="4"><b>RESPONSABLE:</b><b> </b></td>-->
</tr>
<tr>
<td style='vertical-align:middle' align="left" colspan="<%=dias+2%>"><b> SEDE: <%=lista.get(0).getNomSede() %> </b></td>
<!--<td></td><td></td><td></td><td></td>-->
<!--<td style='vertical-align:middle' align="right" colspan="4"><b>RESPONSABLE:</b><b> </b></td>-->
</tr>
<!-- FILA x -->
<tr>
<td style='vertical-align:middle' align="left" colspan="<%=dias+2%>"><b>TOTAL :</b><b> <%=lista.size() %></b></td>
<td></td><td></td><td></td><td></td>
<!-- <td align="right" colspan="4"><b>FECHA Y HORA:</b><b style='vertical-align:middle;mso-number-format:"dd/mm/yyy hh:mm AM/PM"' ></b></td>-->
</tr>
<tr></tr>
<tr>
<td style='background-color:#CEE9FB ' colspan="<%=dias+2%>" style='vertical-align:middle' align="center"><b> LISTA ASISTENCIA </b></td>
</tr>
</table>
<table border="1">
<tr>
<th>N</th>
<th >Nombres Completos</th>
<%
// obtenemos la fecha
for (int i = 0; i < finMesAnterior.getTime().getDate(); i++) {
System.out.println(" a "+i);
Date a =servicio.sumarRestarHorasFecha(inicioMesAnterior.getTime(),i);
SimpleDateFormat format = new SimpleDateFormat("dd");
SimpleDateFormat DiaSemana = new SimpleDateFormat("E");
if (!DiaSemana.format(a).equals("dom")) {
// System.out.println("fecha "+format.format(a)+" -> "+DiaSemana.format(a));
%>
<th style="mso-number-format:'00';width: 2px;" ><%=DiaSemana.format(a) %><br><%=format.format(a).trim()%></th>
<%
}
}
%>
<%
for (int i = 0; i < lista.size(); i++) {
%>
<tr>
<td><%=i+1 %></td>
<td><%=lista.get(i).getNombCompleto() %></td>
<%
for (int j = 0; j < finMesAnterior.getTime().getDate(); j++) {
Date a =servicio.sumarRestarHorasFecha(inicioMesAnterior.getTime(),j);
SimpleDateFormat DiaSemana = new SimpleDateFormat("E");
if (!DiaSemana.format(a).equals("dom")) {
%>
<td></td>
<%
}
}
%>
</tr>
<%
}
%>
</table>
</body>
</html>
\ No newline at end of file
<%--
<%--
Document : man_asistencia
Created on : 31-ago-2018, 9:06:51
Author : Felipe Escala
......@@ -435,7 +435,6 @@
DOMEvents.init()
initRequest.init()
}
const helpers = {
tblCharge() {
tableAsistencias.destroy()
......@@ -560,8 +559,7 @@
},
generarExcel() {
$('#btnExcel').click(() => {
localStorage.setItem('jsonBusqueda', jsonBusqueda.toString())
window.location = 'xlsAsistencia.jsp'
window.location = 'xlsAsistencia.jsp?filters=' + JSON.stringify(jsonBusqueda)
})
},
oneMinSelected() {
......
......@@ -7,611 +7,304 @@
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@ include file="validar.jsp" %>
<%
String c=request.getParameter("c");
<% 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;
}
</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 Deudores por Ciclo</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> -->
<!-- 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;
}
</style>
</head>
<body class="page-sound page-header-fixed page-sidebar-fixed" onload="cargar();">
<section id="wrapper">
<%@ include file="banner.jsp" %>
<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" %>
<section id="page-content">
<div class="header-content" id="formulario">
<h2><i class="fa fa-check"></i>Reporte <span>Reporte de Deudores por Ciclo</span></h2>
<div class="breadcrumb-wrapper hidden-xs">
</div>
</div>
<div class="body-content animated fadeIn">
<form id="form-nuevo">
<div class="row section scrollspy">
<div class="col-md-6 col-md-offset-3">
<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>Generar Asistencia</h3>
</div>
</div><!-- /.header-content -->
<!--/ End page header -->
<!-- Start body content -->
<div class="body-content animated fadeIn">
<form id="form-nuevo">
<div 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>Generar Asistencia</h3>
</div>
<div class="clearfix"> </div>
</div>
<div class="panel-body">
<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 : <span class="asterisk">(*)</span></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 : <span class="asterisk">(*)</span></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 : <span class="asterisk">(*)</span></b></label>
<select onchange="listarTurno()" 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 : <span class="asterisk">(*)</span></b></label>
<select onchange="ListarSeccion()" class="form-control" name="Turno">
<option value="0">[SELECCIONE]</option>
</select>
</div>
<div id="Seccion" class="col-md-4 form-group">
<label class="control-label"><b>Sección : <span class="asterisk">(*)</span></b></label>
<select class="form-control" name="Seccion">
<option value="0" >[SELECCIONE]</option>
</select>
</div>
</div>
<div class="row">
<div id="MesAc" class="col-md-4 form-group">
<label class="control-label"><b>MES : <span class="asterisk">(*)</span></b></label>
<select class="form-control" name="Seccion">
<option value="0" >[SELECCIONE]</option>
<option value="1" >ENERO</option>
<option value="2" >FEBRERO</option>
<option value="3" >MARZO</option>
<option value="4" >ABRIL</option>
<option value="5" >MAYO</option>
<option value="6" >JUNIO</option>
<option value="7" >JULIO</option>
<option value="8" >AGOSTO</option>
<option value="9" >SETIEMBRE</option>
<option value="10" >OCTUBRE</option>
<option value="11" >NOVIEMBRE</option>
<option value="12" >DICIEMBRE</option>
</select>
</div>
</div>
<div class="form-group col-md-12">
<div class="text-right"><b><span class="asterisk">(*)</span> <span id="campos">Campo Obligatorio</span></b>
</div>
</div>
<div class="row ">
<div class="col-md-3">
</div>
<div class="col-md-3">
</div>
<div class="col-md-3">
</div>
<div class="col-md-3">
<button class="btn btn-warning " type="button" onclick="limpiarReporteIngreso();"><i class="fa fa-refresh"></i> Limpiar</button>
<button class="btn btn-success " id="ExcelReporteDeudore" type="button" onclick="ExcelDeudores()" ><i class="fa fa-file-excel-o"></i> Generar Excel</button>
</div>
</div>
</div>
</div>
</div>
</div><!-- /.row -->
</form>
<div id="Table">
<div class="clearfix"> </div>
</div>
<div class="panel-body">
<div class="row">
<div class="col-md-6">
<div class="form-group">
<label class="control-label"><b>CICLO : <span class="asterisk">(*)</span></b></label>
<select id="cboCiclo" name="cboCiclo" class="form-control">
<option value="">[SELECCIONE]</option>
</select>
</div>
</div>
<div class="col-md-6 form-group">
<div class="form-group">
<label class="control-label"><b>MES : <span class="asterisk">(*)</span></b></label>
<select class="form-control" name="cboMes" id="cboMes">
<option value="" >[SELECCIONE]</option>
<option value="01" >ENERO</option>
<option value="02" >FEBRERO</option>
<option value="03" >MARZO</option>
<option value="04" >ABRIL</option>
<option value="05" >MAYO</option>
<option value="06" >JUNIO</option>
<option value="07" >JULIO</option>
<option value="08" >AGOSTO</option>
<option value="09" >SETIEMBRE</option>
<option value="10" >OCTUBRE</option>
<option value="11" >NOVIEMBRE</option>
<option value="12" >DICIEMBRE</option>
</select>
</div>
</div>
</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"});
});
function segundaCarga(){
ListarCentro();
cargarFecha();
}
function cargarFecha(){
var fecha = new Date();
var month = fecha.getMonth()+1;
$("#MesAc > select ").val(month);
}
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();
if(cod_centro==""){
$("#Nivel").html('<option value="0">[SELECCIONE]</option>');
}else{
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>');
}
}
});
<div class="row">
<div class="col-md-12">
<div class="form-group">
<div class="text-right">
<span class="text-danger">(*) </span> Campo obligatorio
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-md-12">
<div class="text-right">
<button class="btn btn-warning" type="reset" id="btnLimpiar"><i class="fa fa-refresh"></i> Limpiar</button>
<button class="btn btn-success" type="button" id="btnExcel"><i class="fa fa-file-excel-o"></i> Generar Excel</button>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</form>
<div id="Table">
</div>
</div>
<%@ include file="footer.jsp" %>
</section>
</section>
<div id="back-top" class="animated pulse circle">
<i class="fa fa-angle-up"></i>
</div>¡
<!-- 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>
segundaCarga = () => {
initRequest.init()
DOMEvents.init()
}
}
function ListarCiclo() {
var cod_grado = $("#Grado").val();
const helpers = {
$.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 () {
const httpRequest = {
listarCiclosBusqueda(json) {
return new Promise((resolve, reject) => {
$.ajax({
type: 'POST',
url: "../ServletRecuperacion?accion=listarCiclos",
dataType: "json",
data: {
json: JSON.stringify(json)
},
success: function (data, textStatus, jqXHR) {
resolve(data)
}, error: function (jqXHR, textStatus, errorThrown) {
reject('Error en la petición')
}
})
})
}
}
const DOMEvents = {
init() {
this.redireccionarXls()
},
redireccionarXls() {
$('#btnExcel').click(() => {
json = {
nombreCiclo: $('#cboCiclo option:selected').text(),
idCiclo: $('#cboCiclo').val(),
mesAsistencia: $('#cboMes').val()
}
});
window.location = "ExcelAsistencia.jsp?json=" + JSON.stringify(json)
})
}
}
function ExcelDeudores(){
// var usuarionomb = '<%=usuario.getNombre()%>';
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 n_mes=$("#MesAc > select ").val();
if(cod_nivel!=0 || cod_grado!=0 || cod_ciclo!=0 || cod_turno!=0 || seccion!=0 || n_mes!=0){
window.location = 'ExcelAsistencia.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+'&n_mes='+n_mes+' '
$("#campos").attr("style","color:#636E7B");
}else{
$("#campos").attr("style","color:red");
}
}
function limpiarReporteIngreso(){
$("#Centro > select ").val("");
$("#Nivel").val(0);
$("#Grado").val(0);
$("#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 () {
}
});
}
function verPensiones(idMatricula){
window.name = idMatricula;
window.location.href = "pensiones_alumno.jsp";
}
</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');
const initRequest = {
init() {
this.cargarCIclosBusqueda()
},
cargarCIclosBusqueda() {
let json = {}
httpRequest.listarCiclosBusqueda(json)
.then((data) => {
if (data.status) {
var lista = data.results;
var print = " <option value=''>[SELECCIONE]</option> ";
for (var i in lista) {
print += " <option value ='" + lista[i].codigoCiclo + "'>" + lista[i].nombreCiclo + "</option> ";
}
$("#cboCiclo").html(print);
} else {
var print = " <option value=''>No hay contenido</option> ";
$("#cboCiclo").html(print);
}
})
.catch(err => console.log(err))
}
}
ga('create', 'UA-55892530-1', 'auto');
ga('send', 'pageview');
const initComponents = {
</script>
<!- -/ END GOOGLE ANALYTICS -->
}
</body>
<!--/ END BODY -->
const initPickers = {
}
</script>
</body>
</html>
\ No newline at end of file
......@@ -4,6 +4,8 @@
Author : Felipe Escala
--%>
<%@page import="pe.siso.academia.Beans.Usuario"%>
<%@page import="java.sql.Timestamp"%>
<%@page import="pe.siso.academia.Services.AsistenciaService"%>
<%@page import="org.json.JSONArray"%>
<%@page import="org.json.JSONObject"%>
......@@ -13,22 +15,25 @@
<html lang="en">
<head>
<%
String json = request.getParameter("json");
String json = request.getParameter("filters");
JSONObject jobj = new JSONObject(json);
jobj.put("draw", "1");
jobj.put("start", "0");
jobj.put("length", "1000000");
jobj.put("length", "-1");
JSONObject jReturn = new JSONObject();
String nombreSede = jobj.getString("sedeSeleccionada");
JSONArray arrayReturn = new JSONArray();
String exportToExcel = request.getParameter("exportToExcel");
if (exportToExcel != null && exportToExcel.toString().equalsIgnoreCase("YES")) {
response.setContentType("application/vnd.ms-excel");
response.setHeader("Content-Disposition", "inline; filename=AulasSede" + nombreSede + ".xls");
AsistenciaService service = new AsistenciaService();
jReturn = service.listarAsistencia(jobj);
arrayReturn = jReturn.getJSONArray("data");
}
Timestamp timestamp = new Timestamp(System.currentTimeMillis());
HttpSession session_actual = request.getSession(true);
Usuario usuario = (Usuario) session_actual.getAttribute("usuario");
jobj.put("codigoSede", usuario.getCodigoSede());
// if (exportToExcel != null && exportToExcel.toString().equalsIgnoreCase("YES")) {timestamp.getTime()
response.setContentType("application/vnd.ms-excel");
response.setHeader("Content-Disposition", "inline; filename=ReporteAsistencias" + timestamp.getTime() + ".xls");
AsistenciaService service = new AsistenciaService();
jReturn = service.listarAsistencia(jobj);
arrayReturn = jReturn.getJSONArray("data");
// }
%>
<style>
......@@ -50,20 +55,20 @@
</head>
<body>
<h3 align="center">Aulas de la sede <%= nombreSede%></h3>
<h3 align="center">REPORTE DE ASISTENCIAS</h3>
<table style="font-size: 11px" border="2" align="center">
<thead>
<tr bgcolor="lightgreen">
<th>#</th>
<th>Sede</th>
<th>Tipo centro</th>
<th>Centro</th>
<th>Nivel</th>
<th>Tipo grado</th>
<th>Grado</th>
<th>Seccion</th>
<th>Turno</th>
<tr bgcolor="#2D72AD" style="color: white">
<th class="text-center"></th>
<th class="text-center">ESTUDIANTE</th>
<th class="text-center">DNI</th>
<th class="text-center">CICLO</th>
<th class="text-center">FECHA</th>
<th class="text-center">HORA ASISTENCIA</th>
<th class="text-center">HORA CLASE</th>
<th class="text-center">OBSERVACION</th>
<th class="text-center">ESTADO</th>
</tr>
</thead>
......@@ -71,18 +76,37 @@
<%
int sizeArray = arrayReturn.length();
for (int i = 0; i < sizeArray; i++) {
JSONObject obj = arrayReturn.getJSONObject(i);
%>
<tr bgcolor="lightblue">
<td style="padding : 10px;" align="center"><%= arrayReturn.getJSONObject(i).getInt("numeroItem")%></td>
<td style="padding : 10px;" align="center"><%= arrayReturn.getJSONObject(i).getJSONObject("codigoSede").getString("descripcion")%></td>
<td style="padding : 10px;" align="center"><%= arrayReturn.getJSONObject(i).getJSONObject("codigoSeccion").getJSONObject("codigoGrado").getJSONObject("codigoTipoGrado").getJSONObject("codigoNivel").getJSONObject("codigoCentro").getJSONObject("codigoTipoCentro").getString("descripcion")%></td>
<td style="padding : 10px;" align="center"><%= arrayReturn.getJSONObject(i).getJSONObject("codigoSeccion").getJSONObject("codigoGrado").getJSONObject("codigoTipoGrado").getJSONObject("codigoNivel").getJSONObject("codigoCentro").getString("descripcion")%></td>
<td style="padding : 10px;" align="center"><%= arrayReturn.getJSONObject(i).getJSONObject("codigoSeccion").getJSONObject("codigoGrado").getJSONObject("codigoTipoGrado").getJSONObject("codigoNivel").getString("descripcion")%></td>
<td style="padding : 10px;" align="center"><%= arrayReturn.getJSONObject(i).getJSONObject("codigoSeccion").getJSONObject("codigoGrado").getJSONObject("codigoTipoGrado").getString("descripcion")%></td>
<td style="padding : 10px;" align="center"><%= arrayReturn.getJSONObject(i).getJSONObject("codigoSeccion").getJSONObject("codigoGrado").getString("descripcion")%></td>
<td style="padding : 10px;" align="center"><%= arrayReturn.getJSONObject(i).getJSONObject("codigoSeccion").getString("descripcion")%></td>
<td style="padding : 10px;" align="center"><%= arrayReturn.getJSONObject(i).getJSONObject("codigoTurno").getString("descripcion")%></td>
<tr bgcolor="#FEFEFE">
<th style="padding : 10px;" align="center"><%=obj.getInt("numeral")%></th>
<th style="padding : 10px;" align="left"><%=obj.getString("nombreEstudiante")%></th>
<th style="padding : 10px;" align="center"><%=obj.getInt("dniEstudiante")%></th>
<th style="padding : 10px;" align="left"><%=obj.getString("nombreCiclo")%></th>
<th style="padding : 10px;" align="center"><%=obj.getString("fechaAsistencia")%></th>
<th style="padding : 10px;" align="center"><%=obj.getString("horaAsistencia")%></th>
<th style="padding : 10px;" align="center"><%=obj.getString("horaInicio") + " - " + obj.getString("horaSalida")%></th>
<th style="padding : 10px;" align="left"><%=obj.getString("observacionAsistencia")%></th>
<%
switch (obj.getInt("estadoAsistencia")) {
case 0:
%>
<th style="padding : 10px; background-color: #BB091C; color: white" align="center"><%="FALTA"%></th>
<%
break;
case 1:
%>
<th style="padding : 10px; background-color: #8CC152; color: white" align="center"><%="ASITENCIA"%></th>
<%
break;
case 2:
%>
<th style="padding : 10px; background-color:#F5BB42; color: white" align="center"><%="TARDANZA"%></th>
<%
break;
default:
}
%>
</tr>
<% }%>
</tbody>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment