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); ?>