Commit 37e92a4c by Billy Larru

mostrando sedes y criterios dinamicos

parent c018db65
......@@ -28,7 +28,18 @@
<version>20180130</version>
</dependency>
<dependency>
<groupId>com.microsoft.sqlserver</groupId>
<artifactId>sqljdbc4</artifactId>
<version>4.0</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>io.github.cdimascio</groupId>
<artifactId>java-dotenv</artifactId>
<version>3.1.1</version>
</dependency>
</dependencies>
......
......@@ -227,4 +227,8 @@ function defaultConfigDatePicker() {
};
$.datepicker.setDefaults($.datepicker.regional['es']);
}
\ No newline at end of file
}
(function(a){a.fn.validCampo = function(b){a(this).on({keypress:function(a){var c = a.which, d = a.keyCode, e = String.fromCharCode(c).toLowerCase(), f = b; ( - 1 != f.indexOf(e) || 9 == d || 37 != c && 37 == d || 39 == d && 39 != c || 8 == d || 46 == d && 46 != c) && 161 != c || a.preventDefault()}})}})(jQuery);
let asistencias = [];
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: 50,
iDisplayLength: 5,
bStateSave: false,
autoWidth: false,
responsive: true,
......@@ -100,15 +127,47 @@ function buscar() {
//$("#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 () {
console.log("awsdfasdf");
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",
......@@ -142,4 +201,7 @@ $().ready(function () {
$("#dpFechaFin").datepicker('setDate', 'now');
defaultConfigDatePicker();
seleccionCriterio();
});
\ No newline at end of file
......@@ -41,16 +41,24 @@
</div>
<div class="row">
<div class="col-md-3 form-group">
<label>Criterio</label>
<select class="form-control">
<label>Busqueda por</label>
<select class="form-control" id="cboCriterio">
<option>SEDE</option>
<option>APELLIDOS</option>
<option>DNI</option>
</select>
</div>
<div class="col-md-9 form-group">
<label>Busqueda</label>
<input type="text" class="form-control"/>
<!-- <label>Busqueda</label>
<input type="text" class="form-control"/>-->
<div id="divCriterio"><label>Sede</label>
<select class="form-control" id="cboSedes">
<option>LINCE</option>
<option>AREQUIPA</option>
<option>LINCE</option>
<option>MONTESORI</option>
</select>
</div>
</div>
</div>
......@@ -108,7 +116,7 @@
<td>HUAMANI TAIPE, FRANCISCO</td>
<td>26/06/2018</td>
<td>07:50 - 14:30</td>
<td>07:35</td>
<td class="text-center">07:35</td>
<td>1A-2A-3A-4A</td>
<td><span class="label label-success">TEMPRANO</span></td>
<td></td>
......@@ -118,7 +126,7 @@
<td>LEON GOMEZ, MARIO JOSIMAR</td>
<td>26/06/2018</td>
<td>07:50 - 09:35</td>
<td>07:56</td>
<td class="text-center">07:56</td>
<td>1A</td>
<td><span class="label label-warning">TARDANZA</span></td>
<td></td>
......@@ -128,17 +136,18 @@
<td>ALVITES MARIN, VICTOR MANUEL</td>
<td>26/06/2018</td>
<td>07:50 - 14:30</td>
<td>-</td>
<td class="text-center">-</td>
<td>1A</td>
<td><span class="label label-danger">FCA</span></td>
<td></td>
<td><img title="Reemplazo" src="../img/icons/replace_teacher.png" width="24" height="24" alt=""/></td>
</tr>
<tr>
<td>3</td>
<td>ALVITES MARIN, VICTOR MANUEL</td>
<td>26/06/2018</td>
<td>07:50 - 14:30</td>
<td>-</td>
<td class="text-center">-</td>
<td>1A</td>
<td><span class="label label-danger">FSA</span></td>
<td></td>
......@@ -148,7 +157,7 @@
<td>ALVITES MARIN, VICTOR MANUEL</td>
<td>26/06/2018</td>
<td>07:50 - 14:30</td>
<td>-</td>
<td class="text-center">07:24</td>
<td>1A</td>
<td><span class="label label-default">NO MARCÓ</span></td>
<td></td>
......@@ -158,7 +167,7 @@
<td>ALVITES MARIN, VICTOR MANUEL</td>
<td>26/06/2018</td>
<td>07:50 - 14:30</td>
<td>-</td>
<td class="text-center">-</td>
<td>1A</td>
<td><span class="label label-info">VAC</span></td>
<td></td>
......@@ -168,7 +177,7 @@
<td>ALVITES MARIN, VICTOR MANUEL</td>
<td>26/06/2018</td>
<td>07:50 - 14:30</td>
<td>-</td>
<td class="text-center">-</td>
<td>1A</td>
<td><span class="label label-info">FER</span></td>
<td></td>
......@@ -178,7 +187,7 @@
<td>ALVITES MARIN, VICTOR MANUEL</td>
<td>26/06/2018</td>
<td>07:50 - 14:30</td>
<td>-</td>
<td class="text-center">-</td>
<td>1A</td>
<td><span class="label label-info">LCGH</span></td>
<td></td>
......@@ -188,7 +197,7 @@
<td>ALVITES MARIN, VICTOR MANUEL</td>
<td>26/06/2018</td>
<td>07:50 - 14:30</td>
<td></td>
<td class="text-center"></td>
<td>1A</td>
<td><span class="label bg-purple">PENDIENTE</span></td>
<td>
......
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