60 lines
2.2 KiB
PHP
60 lines
2.2 KiB
PHP
<?php
|
|
|
|
/*
|
|
* Obtiene datos de reposición
|
|
*/
|
|
$ruta = "../";
|
|
require_once "../class/c_login.php";
|
|
|
|
// check if the session is started
|
|
$user = Login::get_user();
|
|
//--- Objeto para validar usuario. El id de usuario lo lee desde sesión
|
|
/*if(!$objSesion->tieneAcceso()){
|
|
$return["error"] = "Error! No tienes permisos para realizar esta acción.";
|
|
}else*/ if(!isset($_POST["id"])){
|
|
$return["error"] = "Error! No se recibió la información de la reposición.";
|
|
}else{
|
|
$id = filter_input(INPUT_POST, "id", FILTER_SANITIZE_NUMBER_INT);//limpia texto
|
|
|
|
|
|
try{
|
|
$rs = $db->querySingle('SELECT * from fs_reposicion(:id, NULL, NULL, NULL, NULL, NULL, NULL, NULL)',
|
|
[':id' => $id]
|
|
);
|
|
|
|
}catch(Exception $e){
|
|
$return["error"] = "Ocurrió un error al leer los datos de la reposición.";
|
|
echo json_encode($return);
|
|
}
|
|
|
|
|
|
$return["fecha_clase"] = date('d/m/Y', strtotime($rs["fecha_clase"]));
|
|
$return["fecha_nueva"] = date('d/m/Y', strtotime($rs["fecha_nueva"]));
|
|
$hora_nueva = explode(":",$rs["hora_nueva"]);
|
|
$return["hora_ini"] = $hora_nueva[0];
|
|
$return["min_ini"] = $hora_nueva[1];
|
|
$hora_nueva_fin = explode(":",$rs["hora_nueva_fin"]);
|
|
$return["hora_fin"] = $hora_nueva_fin[0];
|
|
$return["min_fin"] = $hora_nueva_fin[1];
|
|
$return["duracion"] = $rs["duracion_total"];
|
|
|
|
// $return["carrera"] = $rs["PlanEstudio_desc"];
|
|
$return["horario"] = $rs["horario_id"];
|
|
$return["materia"] = $rs["materia_id"];
|
|
$return["materia_desc"] = $rs["materia_nombre"];
|
|
$return["salon"] = $rs["salon_id"];
|
|
$return["salon_desc"] = $rs["Salon_desc"]=="" ? "-Pendiente-": $rs["Salon_desc"];
|
|
$return["grupo"] = $rs["horario_grupo"];
|
|
$return["profesor"] = $rs["profesor_id"];
|
|
$return["profesor_nombre"] = $rs["profesor_nombre"];
|
|
$return["comentario"] = $rs["descripcion"];
|
|
$return["alumnos"] = $rs["alumnos"];
|
|
$return["tipo"] = $rs["es_reposicion"];
|
|
$return["aula"] = $rs["tipoaula_id"];
|
|
$return["aula_desc"] = $rs["tipoaula_nombre"];
|
|
$return["aula_supervisor"] = $rs["tipoaula_supervisor"];
|
|
$return["dia"] = date('w', strtotime($rs["fecha_clase"]));
|
|
}
|
|
echo json_encode($return);
|
|
?>
|