Initial state
This commit is contained in:
33
action/action_justificar.php
Normal file
33
action/action_justificar.php
Normal file
@@ -0,0 +1,33 @@
|
||||
<?php
|
||||
$ruta = "../";
|
||||
require_once "../class/c_login.php";
|
||||
|
||||
extract($_POST);
|
||||
|
||||
/* print_r($claves);
|
||||
exit; */
|
||||
|
||||
$fecha = DateTime::createFromFormat('d/m/Y', $fecha);
|
||||
|
||||
if (isset($hora)) {
|
||||
$claves = [[
|
||||
'clave' => $clave,
|
||||
'hora' => $hora,
|
||||
'id' => $id
|
||||
]];
|
||||
}
|
||||
foreach ($claves as $horario)
|
||||
try {
|
||||
$profesor_id = $horario["clave"];
|
||||
query("SELECT fi_registrar_asistencia(:id::INT, FALSE, ARRAY[ NOW(), :fecha::DATE + :hora::TIME ]::TIMESTAMP[], :profesor_id::INT, TRUE)", [
|
||||
":fecha" => $fecha->format('Y-m-d'),
|
||||
":hora" => $horario["hora"],
|
||||
":id" => $horario["id"],
|
||||
":profesor_id" => $profesor_id
|
||||
]);
|
||||
}
|
||||
catch (Exception $e) {
|
||||
die( json_encode(["error" => $e->getMessage()]) );
|
||||
}
|
||||
|
||||
die(json_encode(["success" => true]));
|
||||
Reference in New Issue
Block a user