Initial Commit
This commit is contained in:
87
action/reposicion_select.php
Normal file
87
action/reposicion_select.php
Normal file
@@ -0,0 +1,87 @@
|
||||
<?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{
|
||||
if($user->rol["rol_id"] == 7){//es supervisor
|
||||
$rs = $db->querySingle('SELECT * from fs_reposicion_solicitud(:id, NULL, NULL, NULL, NULL, NULL, NULL, NULL, :sup)',
|
||||
[':id' => $id, ':sup'=>$user->user["id"]]
|
||||
);
|
||||
}else{//coordinador
|
||||
$rs = $db->querySingle('SELECT * from fs_reposicion_solicitud(:id, :fac, NULL, NULL, NULL, NULL, NULL, NULL, null)',
|
||||
[':id' => $id, ":fac"=>$user->facultad["facultad_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"];
|
||||
if($rs["salon_id"]==""){
|
||||
$return["salon_desc"] = "Pendiente";
|
||||
}else{
|
||||
$salon_json = json_decode($rs["salon_array"], true);
|
||||
if($salon_json[0]== "UNIVERSIDAD LA SALLE"){
|
||||
unset($salon_json[0]);
|
||||
}
|
||||
$return["salon_desc"] = join(" / ",$salon_json);
|
||||
}
|
||||
|
||||
//$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"];
|
||||
$return["facultad"] = $rs["facultad_nombre"];
|
||||
$return["carrera"] = $rs["carrera_nombre"];
|
||||
$return["grupo"] = $rs["horario_grupo"];
|
||||
}
|
||||
echo json_encode($return);
|
||||
?>
|
||||
Reference in New Issue
Block a user