Commit 22a93482 by Billy Larru

[EDIT control asistencia docentes]

parent cfa5d9f6
......@@ -276,4 +276,13 @@ table.display tbody tr:hover td {
#frm .form-group{
text-align: -webkit-auto;
}
.boligrafo{
display: block;
/*margin-left: auto;*/
width: 16px;
height: 16px;
background: url(../img/icons/firma.svg);
background-size: 16px 16px;
}
\ No newline at end of file
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- Generator: Adobe Illustrator 18.1.1, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<svg version="1.1" id="Capa_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
viewBox="0 0 25.588 25.588" style="enable-background:new 0 0 25.588 25.588;" xml:space="preserve">
<g>
<path style="fill:#030104;" d="M18.724,9.903l3.855,1.416l-3.206,8.729c-0.3,0.821-1.927,3.39-3.06,3.914l-0.275,0.75
c-0.07,0.19-0.25,0.309-0.441,0.309c-0.054,0-0.108-0.01-0.162-0.029c-0.243-0.09-0.369-0.359-0.279-0.604l0.26-0.709
c-0.575-1.117-0.146-4.361,0.106-5.047L18.724,9.903z M24.303,0.667c-1.06-0.388-2.301,0.414-2.656,1.383l-2.322,6.326l3.854,1.414
l2.319-6.325C25.79,2.673,25.365,1.056,24.303,0.667z M17.328,9.576c0.108,0.04,0.219,0.059,0.327,0.059
c0.382,0,0.741-0.234,0.882-0.614l2.45-6.608c0.181-0.487-0.068-1.028-0.555-1.208c-0.491-0.178-1.028,0.068-1.209,0.555
l-2.45,6.608C16.592,8.855,16.841,9.396,17.328,9.576z M13.384,21.967c-0.253-0.239-0.568-0.537-1.078-0.764
c-0.42-0.187-0.829-0.196-1.128-0.203c-0.031,0-0.067-0.001-0.103-0.002c-0.187-0.512-0.566-0.834-1.135-0.96
c-0.753-0.159-1.354,0.196-1.771,0.47c0.037-0.21,0.098-0.46,0.143-0.64c0.144-0.58,0.292-1.18,0.182-1.742
c-0.087-0.444-0.462-0.774-0.914-0.806c-1.165-0.065-2.117,0.562-2.956,1.129c-0.881,0.595-1.446,0.95-2.008,0.749
c-0.686-0.244-0.755-2.101-0.425-3.755c0.295-1.49,0.844-4.264,2.251-5.524c0.474-0.424,1.16-0.883,1.724-0.66
c0.663,0.26,1.211,1.352,1.333,2.653c0.051,0.549,0.53,0.952,1.089,0.902c0.55-0.051,0.954-0.539,0.902-1.089
c-0.198-2.12-1.192-3.778-2.593-4.329C6.058,7.07,4.724,6.982,3.107,8.429c-1.759,1.575-2.409,4.246-2.88,6.625
c-0.236,1.188-0.811,5.13,1.717,6.029c1.54,0.549,2.791-0.298,3.796-0.976c0.184-0.124,0.365-0.246,0.541-0.355
c-0.167,0.725-0.271,1.501,0.167,2.155c0.653,0.982,1.576,1.089,2.742,0.321c0.045-0.029,0.097-0.063,0.146-0.097
c0.108,0.226,0.299,0.475,0.646,0.645c0.42,0.206,0.84,0.216,1.146,0.224c0.131,0.003,0.31,0.007,0.364,0.031
c0.188,0.083,0.299,0.185,0.515,0.389c0.162,0.153,0.333,0.312,0.55,0.476c0.18,0.135,0.39,0.199,0.598,0.199
c0.304,0,0.605-0.139,0.801-0.4c0.331-0.442,0.241-1.069-0.201-1.4C13.61,22.183,13.495,22.072,13.384,21.967z"/>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
</svg>
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- Generator: Adobe Illustrator 18.1.1, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" id="Capa_1" x="0px" y="0px" viewBox="0 0 25.588 25.588" style="enable-background:new 0 0 25.588 25.588;" xml:space="preserve" width="512px" height="512px">
<g>
<path d="M18.724,9.903l3.855,1.416l-3.206,8.729c-0.3,0.821-1.927,3.39-3.06,3.914l-0.275,0.75 c-0.07,0.19-0.25,0.309-0.441,0.309c-0.054,0-0.108-0.01-0.162-0.029c-0.243-0.09-0.369-0.359-0.279-0.604l0.26-0.709 c-0.575-1.117-0.146-4.361,0.106-5.047L18.724,9.903z M24.303,0.667c-1.06-0.388-2.301,0.414-2.656,1.383l-2.322,6.326l3.854,1.414 l2.319-6.325C25.79,2.673,25.365,1.056,24.303,0.667z M17.328,9.576c0.108,0.04,0.219,0.059,0.327,0.059 c0.382,0,0.741-0.234,0.882-0.614l2.45-6.608c0.181-0.487-0.068-1.028-0.555-1.208c-0.491-0.178-1.028,0.068-1.209,0.555 l-2.45,6.608C16.592,8.855,16.841,9.396,17.328,9.576z M13.384,21.967c-0.253-0.239-0.568-0.537-1.078-0.764 c-0.42-0.187-0.829-0.196-1.128-0.203c-0.031,0-0.067-0.001-0.103-0.002c-0.187-0.512-0.566-0.834-1.135-0.96 c-0.753-0.159-1.354,0.196-1.771,0.47c0.037-0.21,0.098-0.46,0.143-0.64c0.144-0.58,0.292-1.18,0.182-1.742 c-0.087-0.444-0.462-0.774-0.914-0.806c-1.165-0.065-2.117,0.562-2.956,1.129c-0.881,0.595-1.446,0.95-2.008,0.749 c-0.686-0.244-0.755-2.101-0.425-3.755c0.295-1.49,0.844-4.264,2.251-5.524c0.474-0.424,1.16-0.883,1.724-0.66 c0.663,0.26,1.211,1.352,1.333,2.653c0.051,0.549,0.53,0.952,1.089,0.902c0.55-0.051,0.954-0.539,0.902-1.089 c-0.198-2.12-1.192-3.778-2.593-4.329C6.058,7.07,4.724,6.982,3.107,8.429c-1.759,1.575-2.409,4.246-2.88,6.625 c-0.236,1.188-0.811,5.13,1.717,6.029c1.54,0.549,2.791-0.298,3.796-0.976c0.184-0.124,0.365-0.246,0.541-0.355 c-0.167,0.725-0.271,1.501,0.167,2.155c0.653,0.982,1.576,1.089,2.742,0.321c0.045-0.029,0.097-0.063,0.146-0.097 c0.108,0.226,0.299,0.475,0.646,0.645c0.42,0.206,0.84,0.216,1.146,0.224c0.131,0.003,0.31,0.007,0.364,0.031 c0.188,0.083,0.299,0.185,0.515,0.389c0.162,0.153,0.333,0.312,0.55,0.476c0.18,0.135,0.39,0.199,0.598,0.199 c0.304,0,0.605-0.139,0.801-0.4c0.331-0.442,0.241-1.069-0.201-1.4C13.61,22.183,13.495,22.072,13.384,21.967z" fill="#933EC5"/>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
</svg>
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- Generator: Adobe Illustrator 18.1.1, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" id="Capa_1" x="0px" y="0px" viewBox="0 0 25.588 25.588" style="enable-background:new 0 0 25.588 25.588;" xml:space="preserve" width="512px" height="512px">
<g>
<path d="M18.724,9.903l3.855,1.416l-3.206,8.729c-0.3,0.821-1.927,3.39-3.06,3.914l-0.275,0.75 c-0.07,0.19-0.25,0.309-0.441,0.309c-0.054,0-0.108-0.01-0.162-0.029c-0.243-0.09-0.369-0.359-0.279-0.604l0.26-0.709 c-0.575-1.117-0.146-4.361,0.106-5.047L18.724,9.903z M24.303,0.667c-1.06-0.388-2.301,0.414-2.656,1.383l-2.322,6.326l3.854,1.414 l2.319-6.325C25.79,2.673,25.365,1.056,24.303,0.667z M17.328,9.576c0.108,0.04,0.219,0.059,0.327,0.059 c0.382,0,0.741-0.234,0.882-0.614l2.45-6.608c0.181-0.487-0.068-1.028-0.555-1.208c-0.491-0.178-1.028,0.068-1.209,0.555 l-2.45,6.608C16.592,8.855,16.841,9.396,17.328,9.576z M13.384,21.967c-0.253-0.239-0.568-0.537-1.078-0.764 c-0.42-0.187-0.829-0.196-1.128-0.203c-0.031,0-0.067-0.001-0.103-0.002c-0.187-0.512-0.566-0.834-1.135-0.96 c-0.753-0.159-1.354,0.196-1.771,0.47c0.037-0.21,0.098-0.46,0.143-0.64c0.144-0.58,0.292-1.18,0.182-1.742 c-0.087-0.444-0.462-0.774-0.914-0.806c-1.165-0.065-2.117,0.562-2.956,1.129c-0.881,0.595-1.446,0.95-2.008,0.749 c-0.686-0.244-0.755-2.101-0.425-3.755c0.295-1.49,0.844-4.264,2.251-5.524c0.474-0.424,1.16-0.883,1.724-0.66 c0.663,0.26,1.211,1.352,1.333,2.653c0.051,0.549,0.53,0.952,1.089,0.902c0.55-0.051,0.954-0.539,0.902-1.089 c-0.198-2.12-1.192-3.778-2.593-4.329C6.058,7.07,4.724,6.982,3.107,8.429c-1.759,1.575-2.409,4.246-2.88,6.625 c-0.236,1.188-0.811,5.13,1.717,6.029c1.54,0.549,2.791-0.298,3.796-0.976c0.184-0.124,0.365-0.246,0.541-0.355 c-0.167,0.725-0.271,1.501,0.167,2.155c0.653,0.982,1.576,1.089,2.742,0.321c0.045-0.029,0.097-0.063,0.146-0.097 c0.108,0.226,0.299,0.475,0.646,0.645c0.42,0.206,0.84,0.216,1.146,0.224c0.131,0.003,0.31,0.007,0.364,0.031 c0.188,0.083,0.299,0.185,0.515,0.389c0.162,0.153,0.333,0.312,0.55,0.476c0.18,0.135,0.39,0.199,0.598,0.199 c0.304,0,0.605-0.139,0.801-0.4c0.331-0.442,0.241-1.069-0.201-1.4C13.61,22.183,13.495,22.072,13.384,21.967z" fill="#91DC5A"/>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
</svg>
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- Generator: Adobe Illustrator 18.1.1, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" id="Capa_1" x="0px" y="0px" viewBox="0 0 25.588 25.588" style="enable-background:new 0 0 25.588 25.588;" xml:space="preserve" width="512px" height="512px">
<g>
<path d="M18.724,9.903l3.855,1.416l-3.206,8.729c-0.3,0.821-1.927,3.39-3.06,3.914l-0.275,0.75 c-0.07,0.19-0.25,0.309-0.441,0.309c-0.054,0-0.108-0.01-0.162-0.029c-0.243-0.09-0.369-0.359-0.279-0.604l0.26-0.709 c-0.575-1.117-0.146-4.361,0.106-5.047L18.724,9.903z M24.303,0.667c-1.06-0.388-2.301,0.414-2.656,1.383l-2.322,6.326l3.854,1.414 l2.319-6.325C25.79,2.673,25.365,1.056,24.303,0.667z M17.328,9.576c0.108,0.04,0.219,0.059,0.327,0.059 c0.382,0,0.741-0.234,0.882-0.614l2.45-6.608c0.181-0.487-0.068-1.028-0.555-1.208c-0.491-0.178-1.028,0.068-1.209,0.555 l-2.45,6.608C16.592,8.855,16.841,9.396,17.328,9.576z M13.384,21.967c-0.253-0.239-0.568-0.537-1.078-0.764 c-0.42-0.187-0.829-0.196-1.128-0.203c-0.031,0-0.067-0.001-0.103-0.002c-0.187-0.512-0.566-0.834-1.135-0.96 c-0.753-0.159-1.354,0.196-1.771,0.47c0.037-0.21,0.098-0.46,0.143-0.64c0.144-0.58,0.292-1.18,0.182-1.742 c-0.087-0.444-0.462-0.774-0.914-0.806c-1.165-0.065-2.117,0.562-2.956,1.129c-0.881,0.595-1.446,0.95-2.008,0.749 c-0.686-0.244-0.755-2.101-0.425-3.755c0.295-1.49,0.844-4.264,2.251-5.524c0.474-0.424,1.16-0.883,1.724-0.66 c0.663,0.26,1.211,1.352,1.333,2.653c0.051,0.549,0.53,0.952,1.089,0.902c0.55-0.051,0.954-0.539,0.902-1.089 c-0.198-2.12-1.192-3.778-2.593-4.329C6.058,7.07,4.724,6.982,3.107,8.429c-1.759,1.575-2.409,4.246-2.88,6.625 c-0.236,1.188-0.811,5.13,1.717,6.029c1.54,0.549,2.791-0.298,3.796-0.976c0.184-0.124,0.365-0.246,0.541-0.355 c-0.167,0.725-0.271,1.501,0.167,2.155c0.653,0.982,1.576,1.089,2.742,0.321c0.045-0.029,0.097-0.063,0.146-0.097 c0.108,0.226,0.299,0.475,0.646,0.645c0.42,0.206,0.84,0.216,1.146,0.224c0.131,0.003,0.31,0.007,0.364,0.031 c0.188,0.083,0.299,0.185,0.515,0.389c0.162,0.153,0.333,0.312,0.55,0.476c0.18,0.135,0.39,0.199,0.598,0.199 c0.304,0,0.605-0.139,0.801-0.4c0.331-0.442,0.241-1.069-0.201-1.4C13.61,22.183,13.495,22.072,13.384,21.967z" fill="#D80027"/>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
</svg>
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- Generator: Adobe Illustrator 18.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg version="1.1" id="Capa_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
viewBox="0 0 497.616 497.616" style="enable-background:new 0 0 497.616 497.616;" xml:space="preserve">
<g id="XMLID_116_">
<path id="XMLID_118_" d="M470.314,392.915l-40.059-0.264c-0.043,0-0.083,0-0.117,0c-9.308,0-16.885,7.512-16.944,16.828
c-0.058,9.365,7.473,16.993,16.829,17.06l18.814,0.123c-5.874,10.357-16.995,17.357-29.727,17.383h-0.141
c-18.814-0.049-34.112-15.356-34.112-34.186V284.557c-10.441,8.107-21.918,16.232-33.888,23.258v102.044
c0,12.51,3.631,24.101,9.546,34.186H179.634c-23.969,0-43.461-19.492-43.461-43.46V87.755c0-12.508-3.631-24.1-9.548-34.185
h180.883c23.969,0,43.462,19.493,43.462,43.46v13.478c10.556-8.033,21.634-15.694,32.927-22.992
c-4.756-38.133-36.999-67.834-76.389-67.834c0,0-239.881,0.049-239.964,0.049C30.255,20.03,0,50.409,0,87.755
c0,9.317,7.519,16.886,16.829,16.944l40.059,0.266c0.042,0,0.083,0,0.117,0c9.308,0,16.885-7.513,16.944-16.829
c0.058-9.365-7.473-16.993-16.829-17.059l-18.815-0.125C44.18,60.594,55.3,53.594,68.032,53.57h0.141
c18.814,0.049,34.112,15.355,34.112,34.185v312.83c0,42.649,34.7,77.349,77.35,77.349c0,0,239.881-0.049,239.964-0.049
c37.288-0.299,67.544-30.68,67.544-68.026C487.143,400.544,479.621,392.972,470.314,392.915z"/>
<path id="XMLID_117_" d="M495.291,70.348c-1.521-1.521-3.548-2.316-5.6-2.316c-1.183,0-2.382,0.264-3.492,0.81
c-34.293,16.846-104.104,53.803-143.586,93.292c-43.767,43.758-71.74,89.8-71.565,114.497l-26.989,26.988l-34.235,34.235
l41.93-5.989l10.358-10.358l26.923-26.922c0.074,0,0.132,0.032,0.206,0.032c24.738,0,70.64-27.957,114.266-71.583
c14.163-14.163,27.962-32.273,40.664-51.204l-9.201-9.2l15.199-0.009c3.433-5.32,6.791-10.615,10.011-15.926l-17.226-5.039
l25.631-9.233c11.781-20.468,21.593-39.49,28.22-52.984C498.304,76.396,497.684,72.739,495.291,70.348z"/>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
</svg>
......@@ -40,6 +40,7 @@ const URI_CARGOS = "cargoLaboral";
const URI_DOCENTES_PROGRAMACION_SEMINARIO = "programacionSeminario";
const URI_DOCENTES_TIPO_SEMINARIO = "tipoSeminario";
const URI_DOCENTES_GRUPO_ACADEMICO = "grupoAcademico";
const URI_DOCENTES_ASISTENCIAS = "asistenciaDocentes";
//</editor-fold>
......
let asistencias = [], sedes = [];
function init(){
sedes.push({"codigo_sede":1, "nombre_sede": "LINCE"});
sedes.push({"codigo_sede":2, "nombre_sede": "AREQUIPA"});
sedes.push({"codigo_sede":3, "nombre_sede": "LINCE"});
sedes.push({"codigo_sede":4, "nombre_sede": "MONTESORI"});
}
function listarSedes(){
let html = ``;
html +=`<label>Sede</label>
<select class="form-control" id="cboSedes">`;
// for(let i in sedes){
// html += `<option>${sedes[]}</option>`;
// }
sedes.forEach(function(item){
html += `<option>${item.nombre_sede}</option>`;
});
html +=`</select>`;
return html;
}
function buscar() {
let busqueda = "";
$("#tblAsistenciaDocentes").DataTable().destroy();
$("#tblAsistenciaDocentes").DataTable({
iDisplayLength: 5,
bStateSave: false,
autoWidth: false,
responsive: true,
stateSave: true,
columnDefs: [{
orderable: false,
width: '100px',
targets: [8]
}],
dom: '<"datatable-header"fl><"datatable-scroll-wrap"t><"datatable-footer"ip>',
"processing": true,
"serverSide": false,
"data": asistencias,
"columns": [{"data": "fila"},
{"data": "nombres"},
{"data": "dni"},
// {"data": "sede"},
{"data": "area"},
{"data": "cargo"},
{
"data": "fecha_asistencia",
"className": 'text-center'
},
{
"data": "hora_ingreso",
"className": 'text-center'
},
{
"data": "hora_salida",
"className": 'text-center'
},
{
"data": "observacion",
"className": 'text-center',
render: function (data) {
let label = '';
let obs = ['', 'Asistió', 'No marcó', 'Falta con aviso', 'Falta sin aviso', 'Tardanza', 'Vacaciones', 'Feriado', 'LSGH', 'LCGH'];
debugger
switch (data) {
case "1"://Asistió
label = "label label-success";
break;
case "2"://No marco
label = 'label label-info';
break;
case "3"://'Falta con aviso'
case "4"://'Falta sin aviso'
label = 'label label-danger';
break;
case "5"://'Tardanza'
label = 'label label-warning';
break;
case "6"://'Vacaciones'
case "7"://'Feriado'
case "8"://'LSGH'
case "9"://'LCGH'
label = 'label label-primary';
break;
default:
label = 'label label-default';
}
debugger
console.log(label);
return `<span class="${label}" style="font-size: 12px">${obs[data]}</span>`;
}
}
],
fnInitComplete: function (settings, data) {
console.log(data);
}
});
}
//$("#dp").datepicker({
// minDate: new Date(1900, 1 - 1, 1), maxDate: '-18Y',
// dateFormat: 'dd/mm/yy',
// defaultDate: new Date(1970, 1 - 1, 1),
// changeMonth: true,
// changeYear: true,
// yearRange: '-110:-18',
// onSelect: function () {
// $(this).valid();
// }
//});
//$("#dtpFechaInicio").datepicker('setDate', 'now');
function seleccionCriterio() {
$("#cboCriterio").change(function () {
let criterio = $(this).val();
console.log(criterio);
debugger;
if (criterio === 'SEDE') {
let html = listarSedes();
$('#divCriterio').html(html);
// debugger
} else if (criterio == 'APELLIDOS') {
let html = `<label id="lblCriterio">Apellidos</label>
<input type="text" class="form-control" id="busqueda" maxlength="50">`;
$('#divCriterio').html(html);
$('#busqueda').validCampo('abcdefghijklmnopqrstuvwxyzñABCDEFGHIJKLMNOPQRSTUVWXYZÑ ');
} else if (criterio == 'DNI') {
let html = `<label id="lblCriterio">DNI</label>
<div class="input-group" style="width:100%">
<input type="text" class="form-control" id="busqueda" maxlength="8">
</div>`;
$('#divCriterio').html(html);
$('#busqueda').validCampo('0123456789');
} else {
$('#divCriterio').html('');
}
});
}
$().ready(function () {
init();
defaultConfigDataTable();
$('.selectpicker').selectpicker({
style: 'btn-info',
size: 4
});
$(".btn.dropdown-toggle.bs-placeholder").removeClass("btn-info");
$(".btn.dropdown-toggle.bs-placeholder").css({
border: "1px solid #ddd",
backgroundColor: "#fff"
});
$("#dpFechaInicio").datepicker({
minDate: new Date(2000, 1 - 1, 1), maxDate: new Date(),
dateFormat: 'dd/mm/yy',
defaultDate: new Date(),
changeMonth: true,
changeYear: true,
yearRange: '-18:+0',
onSelect: function () {
// $(this).valid();
}
});
$("#dpFechaInicio").datepicker('setDate', 'now');
$("#dpFechaFin").datepicker({
minDate: new Date(2000, 1 - 1, 1), maxDate: new Date(),
dateFormat: 'dd/mm/yy',
defaultDate: new Date(),
changeMonth: true,
changeYear: true,
yearRange: '-18:+0',
onSelect: function () {
// $(this).valid();
}
});
$("#dpFechaFin").datepicker('setDate', 'now');
defaultConfigDatePicker();
seleccionCriterio();
});
\ No newline at end of file
function getColumns() {
let columns = [
{
title: `N°`,
data: `id`,
className: 'text-center'
},
{
title: `APELLIDOS Y NOMBRES`,
data: null,
className: `text-center`,
render: (data) => {
let nombresCompletos;
let nombres = data.trabajador_nombres;
let apellidos = data.trabajador_apellidos;
nombresCompletos = `${apellidos} ${nombres}`;
return nombresCompletos;
}
},
{
title: "SEDE",
data: "sede_descripcion",
className: "text-center"
},
{
title: `FECHA`,
data: `fecha_asistencia`,
className: 'text-center'
},
{
title: `HORARIO`,
data: `horario`,
className: 'text-center'
},
{
title: `MARC. ENTRADA`,
data: null,
className: 'text-center',
render: (data) => {
let label = "";
if (data.estadoasistencia_codigo == 3 || data.estadoasistencia_codigo == 4 || data.estadoasistencia_codigo == 6 || data.estadoasistencia_codigo == 7 || data.estadoasistencia_codigo == 8 || data.estadoasistencia_codigo == 9) {
return `-`;
}
if (data.huella_entrada === 1) {
label = "text-migration font-weight-bold";
} else if (data.huella_entrada === 0) {
label = "text-default";
}
if (!data.marcacion_entrada) {
return null;
}
return `<span class="${label}">${data.marcacion_entrada}</span>`;
}
},
{
title: `AULAS`,
data: `aulas`,
className: 'text-center'
},
{
title: `FIRMÓ SALIDA`.split(' ').join('<br>'),
data: `firmo_salida`,
className: 'text-center',
render: (data) => {
let label = "";
let contenido = "";
switch (data) {
case 0:
label = "label label-danger";
contenido = "NO";
break;
case 1:
label = "label label-success";
contenido = "SI";
break;
case "":
label = "label bg-purple";
contenido = "PENDIENTE";
break;
}
return `<span class="${label}">${contenido}</span>`;
}
},
{
title: 'ESTADO ASISTENCIA'.split(' ').join('<br>'),
data: null,
className: "text-center",
render: (data) => {
let label = "";
let estado = "";
switch (data.estadoasistencia_codigo) {
case 1:
label = "label label-success";
estado = "TEMPRANO";
break;
case 2:
label = "label label-warning";
estado = "TARDANZA";
break;
case 3:
label = "label label-danger";
estado = "FCA";
break;
case 4:
label = "label label-danger";
estado = "FSA";
break;
case 5:
label = "label label-default";
estado = "NO MARCÓ";
break;
case 6:
label = "label label-info";
estado = "VACACIONES";
break;
case 7:
label = "label label-info";
estado = "FERIADO";
break;
case 8:
label = "label label-info";
estado = "LCGH";
break;
case 9:
label = "label label-info";
estado = "LSGH";
break;
case 10:
label = "label bg-purple";
estado = "ENTRADA PENDIENTE";
break;
case 11:
label = "label bg-purple";
estado = "SALIDA PENDIENTE";
break;
case null:
case "":
label = "label bg-purple";
estado = "PENDIENTE";
break;
}
return `<span class="${label}">${estado}</span>`;
}
},
{
title: `ACCIONES`,
data: null,
className: 'text-center',
render: (data) => {
let acciones = "";
let firmar = "";
switch (data.estadoasistencia_codigo) {
case 10:
case 11:
case null:
case "":
let registrar = `<span data-toggle="tooltip" data-placement="left" title="Editar" style="cursor: pointer"> <i class='registrar icon-plus-circle2 text-success-700'></i>&nbsp;&nbsp; </span>`;
let editar = `<span data-toggle="tooltip" data-placement="left" title="Editar" style="cursor: pointer"> <i class='editar icon-pencil text-slate-800'></i>&nbsp;&nbsp; </span>`;
let aprobar = `<span data-toggle="tooltip" data-placement="left" title="Aprobar" style="cursor: pointer"> <i class='aprobar icon-checkmark-circle text-success-700'></i>&nbsp;&nbsp; </span>`;
let anular = `<span data-toggle="tooltip" data-placement="left" title="Anular" style="cursor: pointer"> <i class='anular icon-cancel-circle2 text-danger-700'></i>&nbsp;&nbsp; </span>`;
acciones = registrar;
break;
}
firmar = `<span class="" style="cursor:pointer;"><i class="boligrafo text-slate-800"></i></span>`;
acciones += firmar;
return acciones;
}
}
];
return columns;
}
const listarPersonal = (selectorName) => {
initSelect2(selectorName, baseURLRest + URI_TRABAJADORES, {title: "nombresapellidos", subtitle: "documentoidentidad"});
};
const listarSedes = (selectorName) => {
ajaxWebService.get(URI_SEDES).then((result) => {
let sedes = result.data;
sedes = _.orderBy(sedes, s => s.descripcion);
let html = `<option value="">[TODOS]</option>`;
sedes.forEach(sede => html += `<option value="${sede.codigo}">${sede.descripcion}</option>`);
$(`${selectorName}`).html(html);
$(selectorName).select2();
});
};
const listarEstadoAsistencia = (nodeIdentifier) => {
ajaxWebService.get(URI_ESTADO_ASISTENCIA).then((response) => {
let estados = response.data;
let html = "";
estados
.filter(e => e.codigo != 10 && e.codigo != 11)
.forEach(e => html += `<option value="${e.codigo}">${e.descripcion}</option>`);
$(nodeIdentifier).html(html);
$(nodeIdentifier).selectpicker('refresh');
$('.selectpicker').selectpicker({
style: 'btn-info',
size: 4
});
$(".btn.dropdown-toggle.bs-placeholder").removeClass("btn-info");
$(".btn.dropdown-toggle.bs-placeholder").css({
border: "1px solid #ddd",
backgroundColor: "#fff"
});
});
}
const mostrarModalRegistroAsistencia = (data) => {
}
function listarAsistenciaDocentes(objParams = {}){
ajaxWebService.get(URI_DOCENTES_ASISTENCIAS, objParams).then((response) => {
let columns = getColumns();
let wrapsNameDatatable = `divDatatable`;
let classNameForDatatable = `display table table-bordered`;
makeDatatable(
wrapsNameDatatable,
{
data: response.data,
columns,
},
classNameForDatatable,
).then((nodes) => {
nodes.container.off();
nodes.container.on("click", ".registrar", function () {
let data = nodes.datatable.DataTable().row($(this).parents("tr")).data();
mostrarModalRegistroAsistencia(data);
});
});
});
}
const aplicarFiltro = () => {
}
$(document).ready(function () {
initDatePicker("#dpFechaInicioFiltro", "#dpFechaFinFiltro");
listarSedes("#cboSedesFiltro");
listarPersonal("#cboPersonalFiltro");
listarEstadoAsistencia("#cboEstadoAsistenciaFiltro");
$("#btnAplicarFiltro").click(aplicarFiltro);
$("#btnMostrarTodo").click(listarAsistenciaDocentes);
});
\ No newline at end of file
......@@ -2,53 +2,53 @@
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<%@include file="templates/header.jsp" %>
<!--template-core-->
<!--css de la pagina-->
<head>
<%@include file="templates/header.jsp" %>
<!--template-core-->
<!--css de la pagina-->
<link href="../css/lib/sweetalert2.min.css" rel="stylesheet" type="text/css"/>
<!--css-->
</head>
<body>
<%@include file="templates/header-body.jsp" %>
<!-- content -->
<!--css-->
</head>
<body>
<%@include file="templates/header-body.jsp" %>
<!-- content -->
<div class="col-md-6 col-md-offset-3">
<div class="panel panel-primary">
<div class="panel-heading">
<h5 class="panel-title">Filtros</h5>
</div>
<div class="panel panel-primary">
<div class="panel-heading">
<h5 class="panel-title">Filtros</h5>
</div>
<div class="panel-body">
<div class="row">
<div class="col-md-6 form-group">
<label>Personal</label>
<select class="select-search form-control" id="cboPersonalFiltro">
</select>
</div>
<div class="col-md-6 form-group">
<label>Sede</label>
<select id="cboSedesFiltro" class="select-search form-control">
<div class="panel-body">
<div class="row">
<div class="col-md-6 form-group">
<label>Personal</label>
<select class="select-search form-control" id="cboPersonalFiltro">
</select>
</div>
<div class="col-md-6 form-group">
<label>Sede</label>
<select id="cboSedesFiltro" class="select-search form-control">
</select>
</div>
</div>
</select>
</div>
</div>
<div class="row">
<div class="col-md-6 form-group">
<label>Fecha Inicio</label>
<div class="input-group">
<span class="input-group-addon"><i class="icon-calendar"></i></span>
<input type="text" class="form-control" name="dpFechaInicio" id="dpFechaInicio">
</div>
</div>
<div class="col-md-6 form-group">
<label>Fecha Fin</label>
<div class="input-group">
<span class="input-group-addon"><i class="icon-calendar"></i></span>
<input type="text" class="form-control" name="dpFechaFin" id="dpFechaFin">
</div>
</div>
</div>
<div class="row">
<div class="col-md-6 form-group">
<label>Fecha Inicio</label>
<div class="input-group">
<span class="input-group-addon"><i class="icon-calendar"></i></span>
<input type="text" class="form-control" name="dpFechaInicio" id="dpFechaInicio">
</div>
</div>
<div class="col-md-6 form-group">
<label>Fecha Fin</label>
<div class="input-group">
<span class="input-group-addon"><i class="icon-calendar"></i></span>
<input type="text" class="form-control" name="dpFechaFin" id="dpFechaFin">
</div>
</div>
</div>
<div class="row">
<div class="col-md-12 form-group">
......@@ -57,15 +57,15 @@
</select>
</div>
</div>
</div>
<div class="panel-footer">
<div class="text-center">
<button class="btn btn-primary" id="btnAplicarFiltro"><i class="icon-eye4"></i> Aplicar filtro</button>&nbsp;
<button class="btn btn-primary" id="btnMostrarTodo"><i class="icon-eye4"></i> Mostrar Todo</button>&nbsp;
</div>
</div>
</div>
</div>
</div>
<div class="panel-footer">
<div class="text-center">
<button class="btn btn-primary" id="btnAplicarFiltro"><i class="icon-eye4"></i> Aplicar filtro</button>&nbsp;
<button class="btn btn-primary" id="btnMostrarTodo"><i class="icon-eye4"></i> Mostrar Todo</button>&nbsp;
</div>
</div>
</div>
</div>
<div class="col-md-10 col-md-offset-1">
......@@ -76,20 +76,20 @@
<div id="divDatatable"></div>
</div>
</div>
<!-- / content -->
<!-- / content -->
<%@include file="templates/footer-body.jsp"%>
<!--js de la pagina-->
<script src="../plantilla/assets/js/core/libraries/jquery_ui/widgets.min.js" type="text/javascript"></script>
<script src="../plantilla/assets/js/plugins/ui/moment/moment.min.js" type="text/javascript"></script>
<%@include file="templates/footer-body.jsp"%>
<!--js de la pagina-->
<script src="../plantilla/assets/js/core/libraries/jquery_ui/widgets.min.js" type="text/javascript"></script>
<script src="../plantilla/assets/js/plugins/ui/moment/moment.min.js" type="text/javascript"></script>
<script src="../plantilla/assets/js/plugins/pickers/datepicker.js" type="text/javascript"></script>
<script src="../js/lib/bootstrap-select.min.js" type="text/javascript"></script>
<script src="../js/lib/bootstrap-select.min.js" type="text/javascript"></script>
<script src="../plantilla/assets/js/plugins/forms/selects/select2.min.js"></script>
<script src="../js/lib/lodash.js" type="text/javascript"></script>
<script src="../js/lib/lodash.js" type="text/javascript"></script>
<script src="../js/lib/sweetalert2.min.js" type="text/javascript"></script>
<script src="../js/pages/control_asistencia_administrativa.js" type="text/javascript"></script>
<!--js-->
<script src="../js/pages/control_asistencia_administrativa.js" type="text/javascript"></script>
<!--js-->
</body>
</body>
</html>
\ No newline at end of file
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