This commit is contained in:
2023-08-08 17:04:21 +00:00
parent 31ecda89b2
commit ec382e989a
147 changed files with 18206 additions and 18063 deletions

View File

@@ -1,28 +1,28 @@
<?php
$ruta = '../';
require_once '../include/bd_pdo.php';
global $pdo;
$profesores = [];
if(isset($_POST['tipo'])){
foreach($_POST['tipo'] as $tipo){
$profesores_carrera = query("SELECT profesor_id FROM fs_profesor_carrera(:carrera_id)", [':carrera_id' => $tipo], false);
foreach($profesores_carrera as $profesor){
array_push($profesores, $profesor['profesor_id']);
}
}
}
$sql = "SELECT fi_aviso(:fecha_inicial, :fecha_final, :texto, :facultad)";
$params = [':fecha_inicial' => $_POST['fecha_inicial'], ':fecha_final' => $_POST['fecha_final'], ':texto' => $_POST['texto'], ':facultad' => $_POST['facultad']];
$aviso_id = query($sql, $params, true);
$sql = "SELECT fi_aviso_profesor(:aviso_id, :profesor_id)";
foreach($profesores as $profesor_id){
$params = [':aviso_id' => $aviso_id['fi_aviso'], ':profesor_id' => $profesor_id];
query($sql, $params, false);
}
header("Location: ../avisos.php");
exit();
<?php
$ruta = '../';
require_once '../include/bd_pdo.php';
global $pdo;
$profesores = [];
if(isset($_POST['tipo'])){
foreach($_POST['tipo'] as $tipo){
$profesores_carrera = query("SELECT profesor_id FROM fs_profesor_carrera(:carrera_id)", [':carrera_id' => $tipo], false);
foreach($profesores_carrera as $profesor){
array_push($profesores, $profesor['profesor_id']);
}
}
}
$sql = "SELECT fi_aviso(:fecha_inicial, :fecha_final, :texto, :facultad)";
$params = [':fecha_inicial' => $_POST['fecha_inicial'], ':fecha_final' => $_POST['fecha_final'], ':texto' => $_POST['texto'], ':facultad' => $_POST['facultad']];
$aviso_id = query($sql, $params, true);
$sql = "SELECT fi_aviso_profesor(:aviso_id, :profesor_id)";
foreach($profesores as $profesor_id){
$params = [':aviso_id' => $aviso_id['fi_aviso'], ':profesor_id' => $profesor_id];
query($sql, $params, false);
}
header("Location: ../avisos.php");
exit();
?>