tieneAcceso()){ $objSesion->terminaSesion(); } $objSesion->validaPeriodoUsuario();//si no tiene periodo manda a main ?> APSA - Facultad de Ingeniería
printMenu(); //Area $stmt = $pdo->prepare('Select * from fs_areaacademica(NULL, :nivel)'); $stmt->bindParam(":nivel", $_SESSION["nivel_id"]); if(!$stmt->execute()){ $errorDesc = "Ocurrió un error al cargar las áreas académicas"; }else{ $area_rs = $stmt->fetchAll(); } $stmt->closeCursor(); //Obtiene profesores $query = ""; if(isset($_POST["area"]) && is_numeric($_POST["area"]) && trim($_POST["area"]) != ""){ $query .= ":area,"; $filter_area = filter_input(INPUT_POST, "area", FILTER_SANITIZE_NUMBER_INT);//limpia texto }else{ $query .= "NULL,"; } if(isset($_POST["desc"]) && trim($_POST["desc"]) != ""){ $query .= ":desc,"; $filter_desc = trim(filter_input(INPUT_POST, "desc", FILTER_SANITIZE_STRING,array('flags' => FILTER_FLAG_STRIP_LOW)));//limpia texto }else{ $query .= "NULL,"; } $stmt = $pdo->prepare('Select * from fs_profesoresareahoras(:per, '.$query.' 1, 0, '.MAX_ROWS.')');//sólo activos $stmt->bindParam(":per", $_SESSION["periodo_id"]); if(isset($filter_area)) $stmt->bindParam(":area", $filter_area); if(isset($filter_desc)) $stmt->bindParam(":desc", $filter_desc); if(!$stmt->execute()){ $errorDesc = "Ocurrió un error al cargar los profesores"; //print_r($stmt->errorInfo()); }else{ $profesores_rs = $stmt->fetchAll(); } $stmt->closeCursor(); ?>
>
1){ ?>

Se muestran los primeros resultados. Utiliza los filtros para encontrar el usuario que buscas.

prepare('Select * from fs_mihorario(:usr, :per, 3) WHERE "TipoHorario_id" = 3 '.$query);//Obtiene calendario docente $stmt->bindParam(":per", $_SESSION["periodo_id"]); if($query != "") $stmt->bindParam(":area", $filter_area); foreach($profesores_rs as $profesor){ // if($i >= MAX_ROWS) break; $stmt->bindParam(":usr", $profesor["Usuario_id"]); if(!$stmt->execute()){ //$t = $stmt->errorInfo(); echo "Ocurrió un error al obtener los horarios de los profesores"; //print_r($stmt->errorInfo()); break; } $horario_rs = $stmt->fetchAll(); $materiasArr = array(); if(count($horario_rs) > 0){ //$i++; for($rs_i = 0; $rs_i < count($horario_rs);){ if((!isset($filter_area) || $filter_area=="" ) || (isset($filter_area) && $filter_area == $horario_rs[$rs_i]["Area_id"])){ $horas = $horario_rs[$rs_i]["Duracion"]/60; $nombreArr = array(); $key = "";//lave para guardar cuáles se agruparán do{ $nombreArr[] = $horario_rs[$rs_i]["Materia_desc"]." (".$horario_rs[$rs_i]["Carrera_prefijo"].")"; $key .= $horario_rs[$rs_i]["Materia_desc"].$horario_rs[$rs_i]["Carrera_prefijo"]; $rs_i++; }while($rs_i < count($horario_rs) && date('H:i', strtotime($horario_rs[$rs_i-1]["Hora_inicio"])) == date('H:i', strtotime($horario_rs[$rs_i]["Hora_inicio"])) && $horario_rs[$rs_i]["Dia_id"] == $horario_rs[$rs_i-1]["Dia_id"]); $materiasArr[] = array("key"=>md5($key), "nombreArr" => $nombreArr, "horas"=>$horas); } } //fusiona horarios por llaves iguales for($ii = 0; $ii < count($materiasArr)-1; $ii++){ for($jj = $ii+1; $jj < count($materiasArr); ){ if($materiasArr[$ii]["key"] == $materiasArr[$jj]["key"]){ $materiasArr[$ii]["horas"] += $materiasArr[$jj]["horas"]; array_splice($materiasArr, $jj, 1); }else $jj++; } } ?> closeCursor(); //--------------- ?>
Clave ULSA Profesor
Materias
Horas
Total
"; } $sumMat+=$materia["horas"]; ?>
hrs.
hrs.