1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768 |
- <?php
- /*
- * Obtiene datos de reposición
- */
- $ruta = "../";
- require_once "../class/c_login.php";
- // check if the session is started
- if (!isset($_SESSION['user']))
- die('No se ha iniciado sesión');
- $user = unserialize($_SESSION['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);
- exit();
- }
-
-
- $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_interval"];
- // $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"]=="" ? "-Pendiente-": $rs["salon"];
- $return["ciclo"] = $rs["ciclo"];
- $return["bloque"] = $rs["bloque"];
- $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"]));
- $return["motivo_cancelacion"] = $rs["motivo_cancelacion"];
- $return["estado"] = $rs["estado_reposicion_id"];
- }
- echo json_encode($return);
- ?>
|