tieneAcceso()){
$objSesion->terminaSesion();
}
$objSesion->validaPeriodoUsuario();//si no tiene periodo manda a main
/*if(!$objSesion->puedeEditar()){
$errorDesc = "No puedes generar nombramientos.";
}*/
//Obtiene grupos del periodo
$stmt = $pdo->prepare('Select * from fs_grupo(NULL, :periodo)');
$stmt->bindParam(":periodo", $_SESSION["periodo_id"]);
if(!$stmt->execute()){
header("Location: grupos.php?error=4");
exit();
}else{
$grupos_rs = $stmt->fetchAll();
}
$stmt->closeCursor();
if(!is_array($grupos_rs) || count($grupos_rs) == 0){
header("Location: grupos.php?error=5");
exit();
}
?>
printMenu();
//Obtiene fechas de periodo
$stmt = $pdo->prepare('Select * from fs_periodo(:periodo, NULL, NULL, true)');
$stmt->bindParam(":periodo", $_SESSION["periodo_id"]);
if(!$stmt->execute()){
$errorDesc = "Ocurrió un error al cargar las fechas del periodo";
}else{
$periodo_rs = $stmt->fetch();
}
$stmt->closeCursor();
$stmt = null;
if(isset($_POST["hora_inicial"]) && $_POST["hora_inicial"]!=""){
$filter_hini = trim(filter_input(INPUT_POST, "hora_inicial", FILTER_SANITIZE_STRING,array('flags' => FILTER_FLAG_STRIP_LOW)));//limpia texto
}else{
$filter_hini = HORA_INICIO.':00';
}
if(isset($_POST["hora_final"]) && $_POST["hora_final"]!=""){
$filter_hfin = trim(filter_input(INPUT_POST, "hora_final", FILTER_SANITIZE_STRING,array('flags' => FILTER_FLAG_STRIP_LOW)));//limpia texto
}else{
$filter_hfin = HORA_FINAL.':00';
}
if(isset($_POST["hora_final"]) && $_POST["hora_final"]!=""){
$filter_nombre = trim(filter_input(INPUT_POST, "nombre", FILTER_SANITIZE_STRING,array('flags' => FILTER_FLAG_STRIP_LOW)));//limpia texto
}else{
$filter_nombre = "";
}
if(isset($_POST["fecha"])){
$fecha = fechaGuion($_POST["fecha"]);
$stmt = $pdo->prepare('Select * from fs_profesoresfecha(:nom, :periodo, :fecha, :h_ini, :h_fin)');
$stmt->bindParam(":nom", $filter_nombre);
$stmt->bindParam(":periodo", $_SESSION["periodo_id"]);
$stmt->bindParam(":fecha", $fecha);
$stmt->bindParam(":h_ini", $filter_hini);
$stmt->bindParam(":h_fin", $filter_hfin);
if(!$stmt->execute()){
$errorDesc = "Ocurrió un error al cargar los profesores de la fecha";
}else{
$profesores_rs = $stmt->fetchAll();
}
$stmt->closeCursor();
$stmt = null;
}
//--Manejo de errores y mensajes de exito
if(isset($_GET["error"]) && is_numeric($_GET["error"])){
switch ($_GET["error"]){
case 0: $errorDesc = "No se reciberon los datos para justificar la falta."; break;
case 1: $errorDesc = "Ocurrió un error al gruardar la justificación."; break;
case 2: $errorDesc = "No tienes permisos para realizar esa acción."; break;
}
}
if(isset($_GET["ok"]) && is_numeric($_GET["ok"])){
switch ($_GET["ok"]){
case 0: $successDesc = "Las justificaciones se guardaron correctamente."; break;
}
}
?>
Selecciona la fecha que deseas justificar.