Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
Asistencia
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Billy Larru
Asistencia
Commits
f1f6a90b
Commit
f1f6a90b
authored
Sep 05, 2018
by
Billy Larru
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
asistencias en eventos
parent
98d1bb80
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
181 additions
and
0 deletions
+181
-0
asistencia_administrativa_eventos.js
...main/webapp/js/pages/asistencia_administrativa_eventos.js
+104
-0
asistenciaAdministrativaEventos.jsp
src/main/webapp/vistas/asistenciaAdministrativaEventos.jsp
+77
-0
No files found.
src/main/webapp/js/pages/asistencia_administrativa_eventos.js
0 → 100644
View file @
f1f6a90b
let
handsonTable
;
// This example creates a date editor that will show MM/YYYY
const
TA_EDITOR_HORA
=
Handsontable
.
editors
.
TextEditor
.
prototype
.
extend
();
TA_EDITOR_HORA
.
prototype
.
createElements
=
function
()
{
Handsontable
.
editors
.
TextEditor
.
prototype
.
createElements
.
apply
(
this
,
arguments
);
// You need to require/import the "inputmask" library
var
im
=
new
Inputmask
(
'99:99'
);
// Create password input and update relevant properties
this
.
TEXTAREA
=
document
.
createElement
(
'input'
);
this
.
TEXTAREA
.
setAttribute
(
'type'
,
'text'
);
this
.
TEXTAREA
.
className
=
'text'
;
im
.
mask
(
this
.
TEXTAREA
);
this
.
textareaStyle
=
this
.
TEXTAREA
.
style
;
this
.
textareaStyle
.
width
=
0
;
this
.
textareaStyle
.
height
=
0
;
// Replace textarea with password input
Handsontable
.
dom
.
empty
(
this
.
TEXTAREA_PARENT
);
this
.
TEXTAREA_PARENT
.
appendChild
(
this
.
TEXTAREA
);
};
function
defaultConfigHandsonTable
()
{
let
container
=
document
.
getElementById
(
"divHandsonTable"
);
handsonTable
=
new
Handsontable
(
container
,
{
data
:
[],
stretchH
:
'all'
,
rowHeaders
:
true
,
colHeaders
:
[
'DNI'
,
'Apellidos y Nombres'
,
'Sede'
,
'Marcacion de entrada'
],
columns
:
[
{
data
:
"trabajador_dni"
},
{
data
:
"trabajador_nombres"
},
{
data
:
"sede_id"
,
className
:
"text-center"
},
{
data
:
"marcacion_entrada"
,
className
:
'text-center'
,
editor
:
TA_EDITOR_HORA
,
type
:
'time'
,
timeFormat
:
'HH:mm'
,
correctFormat
:
true
,
allowInvalid
:
false
}
]
});
}
const
addRowHandsonTable
=
()
=>
{
handsonTable
.
alter
(
'insert_row'
,
handsonTable
.
countRows
());
};
function
agregarEventoTecladoHandsonTable
()
{
Handsontable
.
Dom
.
addEvent
(
document
.
body
,
'keydown'
,
function
(
e
)
{
if
(
e
.
keyCode
===
13
&&
handsonTable
)
{
addRowHandsonTable
()
}
});
}
const
listarSedes
=
(
selectorName
)
=>
{
ajaxWebService
.
get
(
URI_SEDES
).
then
((
result
)
=>
{
let
sedes
=
result
.
data
;
sedes
=
_
.
orderBy
(
sedes
,
s
=>
s
.
descripcion
);
let
html
=
`<option value="">[SELECCIONE]</option>`
;
sedes
.
forEach
(
sede
=>
html
+=
`<option value="
${
sede
.
codigo
}
">
${
sede
.
descripcion
}
</option>`
);
$
(
`
${
selectorName
}
`
).
html
(
html
);
$
(
selectorName
).
select2
();
});
};
function
registrarAsistencias
()
{
swal
(
{
type
:
'success'
,
title
:
'¡Asistencias registradas!'
,
showConfirmButton
:
false
,
timer
:
1500
}
);
}
$
(()
=>
{
defaultConfigHandsonTable
();
agregarEventoTecladoHandsonTable
();
addRowHandsonTable
();
initDatePicker
(
"#dpFechaEvento"
);
listarSedes
(
"#cboSedes"
);
$
(
"#btnRegistrarAsistencias"
).
click
(
registrarAsistencias
);
});
\ No newline at end of file
src/main/webapp/vistas/asistenciaAdministrativaEventos.jsp
0 → 100644
View file @
f1f6a90b
<
%@
include
file=
"templates/validar.jsp"
%
>
<
%@
page
contentType=
"text/html"
pageEncoding=
"UTF-8"
%
>
<!DOCTYPE html>
<html>
<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 -->
<div
class=
"col-md-6 col-md-offset-3"
>
<div
class=
"panel panel-primary"
>
<div
class=
"panel-heading"
>
<h5
class=
"panel-title"
>
Detalles del evento
</h5>
</div>
<div
class=
"panel-body"
>
<div
class=
"row"
>
<div
class=
"col-md-6 form-group"
>
<label>
Descripcion
</label>
<input
type=
"text"
class=
"form-control"
id=
"txtDescripcion"
>
</div>
<div
class=
"col-md-6 form-group"
>
<label>
Sede
</label>
<select
id=
"cboSedes"
class=
"select-search form-control"
>
</select>
</div>
</div>
<div
class=
"row"
>
<div
class=
"col-md-6 form-group"
>
<label>
Fecha
</label>
<div
class=
"input-group"
>
<span
class=
"input-group-addon"
><i
class=
"icon-calendar"
></i></span>
<input
type=
"text"
class=
"form-control"
id=
"dpFechaEvento"
>
</div>
</div>
</div>
</div>
</div>
</div>
<div
class=
"col-md-12"
>
<div
class=
"panel panel-primary card-3"
>
<div
class=
"panel-heading"
>
<h6
class=
"panel-title"
style=
"font-size: 15px; font-family: inherit"
><i
class=
"icon icon-search4"
></i>
LISTA DE ASISTENCIAS
</h6>
<div
class=
"heading-elements"
>
<button
type=
"button"
id=
"btnRegistrarAsistencias"
class=
"btn bg-slate border-slate-600 btn-xs"
><i
class=
"glyphicon glyphicon-plus"
></i>
Registrar Asistencias
</button>
</div>
</div>
<div
id=
"divHandsonTable"
></div>
</div>
</div>
<!-- / 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=
"../js/lib/jquery.inputmask.bundle.min.js"
type=
"text/javascript"
></script>
<script
src=
"../plantilla/assets/js/plugins/tables/handsontable/handsontable.min.js"
></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=
"../plantilla/assets/js/plugins/forms/selects/select2.min.js"
></script>
<script
src=
"../js/lib/lodash.js"
type=
"text/javascript"
></script>
<script
src=
"../js/pages/asistencia_administrativa_eventos.js"
type=
"text/javascript"
></script>
<!--js-->
</body>
</html>
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment