All
This commit is contained in:
@@ -2,6 +2,8 @@
|
||||
#input $_GET['id_espacio_sgu']
|
||||
#output rutas: [ ...ruta, salones: [{...salon}] ]
|
||||
header('Content-Type: application/json charset=utf-8');
|
||||
ini_set('memory_limit', '256M');
|
||||
ini_set('post_max_size', '256M');
|
||||
ini_set('display_errors', 1);
|
||||
ini_set('display_startup_errors', 1);
|
||||
error_reporting(E_ALL);
|
||||
|
||||
@@ -12,13 +12,15 @@ $user = unserialize($_SESSION['user']);
|
||||
|
||||
$ruta = "../";
|
||||
require_once "../include/bd_pdo.php";
|
||||
$facultad_id = $user->facultad['facultad_id'];
|
||||
$carreras = $db->query(
|
||||
"SELECT * FROM carrera
|
||||
WHERE
|
||||
(facultad_id = :facultad_id OR :facultad_id IS NULL)
|
||||
ORDER BY carrera_nombre DESC",
|
||||
array('facultad_id' => $facultad_id)
|
||||
);
|
||||
|
||||
$nivel = $db->where("id", $_POST['periodo'])->getOne("fs_periodo", "nivel_id");
|
||||
$carreras = $db
|
||||
->where("nivel", $nivel)
|
||||
->where("facultad", $_POST['facultad'])
|
||||
->get("fs_carrera", null, "id, carrera");
|
||||
|
||||
$user->print_to_log("Crea carrera", old: $_POST);
|
||||
// $user->print_to_log("Crea carrera", old: $_POST);
|
||||
|
||||
die(json_encode($carreras));
|
||||
|
||||
293
action/avisos.php
Normal file
293
action/avisos.php
Normal file
@@ -0,0 +1,293 @@
|
||||
<?
|
||||
require_once "{$_SERVER['DOCUMENT_ROOT']}/class/c_login.php";
|
||||
header('Content-Type: application/json');
|
||||
|
||||
if (!Login::is_logged()) {
|
||||
header('HTTP/1.1 401 Unauthorized');
|
||||
echo json_encode(array('error' => 'No se ha iniciado sesión'));
|
||||
exit();
|
||||
}
|
||||
$user = Login::get_user();
|
||||
try {
|
||||
|
||||
switch ($_SERVER['REQUEST_METHOD']) {
|
||||
case 'GET':
|
||||
$facultad_id = $user->facultad['facultad_id'];
|
||||
$avisos = $db->query(
|
||||
"SELECT * FROM aviso
|
||||
WHERE
|
||||
(CURRENT_DATE BETWEEN aviso_fecha_inicial AND aviso_fecha_final) AND
|
||||
(facultad_id = :facultad_id OR :facultad_id IS NULL) AND
|
||||
aviso_estado
|
||||
ORDER BY aviso_id DESC",
|
||||
array('facultad_id' => $facultad_id)
|
||||
);
|
||||
|
||||
/*
|
||||
if (empty($avisos)) {
|
||||
header('HTTP/1.1 404 Not Found');
|
||||
echo json_encode(array('error' => 'No hay avisos disponibles'));
|
||||
exit();
|
||||
}
|
||||
*/
|
||||
|
||||
$avisos = array_map(fn($aviso) => array(
|
||||
...$aviso,
|
||||
'carreras' => $db->query(
|
||||
"SELECT carrera_id, carrera_nombre FROM aviso_carrera
|
||||
JOIN carrera USING (carrera_id)
|
||||
WHERE aviso_id = :aviso_id",
|
||||
array('aviso_id' => $aviso['aviso_id'])
|
||||
),
|
||||
'profesores' => $db->query(
|
||||
"SELECT profesor_id, profesor_clave, profesor_nombre FROM aviso_profesor
|
||||
JOIN profesor USING (profesor_id)
|
||||
WHERE aviso_id = :aviso_id",
|
||||
array('aviso_id' => $aviso['aviso_id'])
|
||||
),
|
||||
), $avisos);
|
||||
echo json_encode($avisos);
|
||||
break;
|
||||
case 'POST':
|
||||
$raw_input = file_get_contents('php://input');
|
||||
if (empty($raw_input)) {
|
||||
header('HTTP/1.1 400 Bad Request');
|
||||
echo json_encode(array('error' => 'No se recibieron parámetros'));
|
||||
exit();
|
||||
}
|
||||
|
||||
$input_data = json_decode($raw_input);
|
||||
if (json_last_error() !== JSON_ERROR_NONE) {
|
||||
header('HTTP/1.1 400 Bad Request');
|
||||
echo json_encode(array('error' => 'Invalid JSON format'));
|
||||
exit();
|
||||
}
|
||||
|
||||
|
||||
$schema = <<<JSON
|
||||
{
|
||||
"\$schema": "http://json-schema.org/draft-07/schema#",
|
||||
"type": "object",
|
||||
"required": ["aviso_fecha_inicial", "aviso_fecha_final", "aviso_titulo", "aviso_texto"],
|
||||
"properties": {
|
||||
"aviso_fecha_inicial": {
|
||||
"type": "string",
|
||||
"format": "date"
|
||||
},
|
||||
"aviso_fecha_final": {
|
||||
"type": "string",
|
||||
"format": "date"
|
||||
},
|
||||
"aviso_texto": {
|
||||
"type": "string"
|
||||
},
|
||||
"aviso_titulo": {
|
||||
"type": "string"
|
||||
},
|
||||
"carreras": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "integer",
|
||||
"minimum": 1
|
||||
},
|
||||
"minItems": 0,
|
||||
"uniqueItems": true
|
||||
},
|
||||
"profesores": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "integer",
|
||||
"minimum": 1
|
||||
},
|
||||
"minItems": 0,
|
||||
"uniqueItems": true
|
||||
}
|
||||
},
|
||||
"anyOf": [
|
||||
{"required": ["carreras"]},
|
||||
{"required": ["profesores"]}
|
||||
]
|
||||
}
|
||||
JSON;
|
||||
// VALIDATE JSON SCHEMA
|
||||
$validate = new JsonSchema\Validator();
|
||||
$validate->validate($input_data, json_decode($schema));
|
||||
|
||||
if (!$validate->isValid()) {
|
||||
header('HTTP/1.1 400 Bad Request');
|
||||
echo json_encode(
|
||||
array(
|
||||
'error' => 'El formato de la solicitud es incorrecto',
|
||||
'success' => false,
|
||||
'errors' => $validate->getErrors()
|
||||
)
|
||||
);
|
||||
exit();
|
||||
}
|
||||
|
||||
$aviso_id = $db->insert(
|
||||
'aviso',
|
||||
array(
|
||||
'aviso_fecha_inicial' => $input_data->aviso_fecha_inicial,
|
||||
'aviso_fecha_final' => $input_data->aviso_fecha_final,
|
||||
'aviso_texto' => $input_data->aviso_texto,
|
||||
'facultad_id' => $user->facultad['facultad_id'],
|
||||
),
|
||||
'aviso_id'
|
||||
);
|
||||
|
||||
if (isset($input_data->carreras)) {
|
||||
array_walk($input_data->carreras, fn($carrera_id) => $db->insert('aviso_carrera', array('aviso_id' => $aviso_id, 'carrera_id' => $carrera_id)));
|
||||
}
|
||||
if (isset($input_data->profesores)) {
|
||||
array_walk($input_data->profesores, fn($profesor_id) => $db->insert('aviso_profesor', array('aviso_id' => $aviso_id, 'profesor_id' => $profesor_id)));
|
||||
}
|
||||
|
||||
echo json_encode(
|
||||
array(
|
||||
'aviso_id' => $aviso_id,
|
||||
'msg' => 'Aviso creado exitosamente',
|
||||
'success' => true
|
||||
)
|
||||
);
|
||||
break;
|
||||
case 'PUT':
|
||||
$raw_input = file_get_contents('php://input');
|
||||
if (empty($raw_input)) {
|
||||
header('HTTP/1.1 400 Bad Request');
|
||||
echo json_encode(array('error' => 'No se recibieron parámetros'));
|
||||
exit();
|
||||
}
|
||||
|
||||
$input_data = json_decode($raw_input);
|
||||
if (json_last_error() !== JSON_ERROR_NONE) {
|
||||
header('HTTP/1.1 400 Bad Request');
|
||||
echo json_encode(array('error' => 'Invalid JSON format'));
|
||||
exit();
|
||||
}
|
||||
|
||||
$schema = <<<JSON
|
||||
{
|
||||
"\$schema": "http://json-schema.org/draft-07/schema#",
|
||||
"type": "object",
|
||||
"required": ["aviso_id", "aviso_fecha_final"],
|
||||
"properties": {
|
||||
"aviso_id": {
|
||||
"type": "integer",
|
||||
"minimum": 1
|
||||
},
|
||||
"aviso_fecha_final": {
|
||||
"type": "string",
|
||||
"format": "date"
|
||||
}
|
||||
}
|
||||
}
|
||||
JSON;
|
||||
|
||||
// VALIDATE JSON SCHEMA
|
||||
$validate = new JsonSchema\Validator();
|
||||
$validate->validate($input_data, json_decode($schema));
|
||||
|
||||
if (!$validate->isValid()) {
|
||||
header('HTTP/1.1 400 Bad Request');
|
||||
echo json_encode(
|
||||
array(
|
||||
'error' => 'El formato de la solicitud es incorrecto',
|
||||
'errors' => $validate->getErrors(),
|
||||
'success' => false,
|
||||
)
|
||||
);
|
||||
exit();
|
||||
}
|
||||
|
||||
$db->where('aviso_id', $input_data->aviso_id)
|
||||
->update(
|
||||
'aviso',
|
||||
array(
|
||||
'aviso_fecha_final' => $input_data->aviso_fecha_final,
|
||||
),
|
||||
);
|
||||
|
||||
if (isset($input_data->carreras)) {
|
||||
$db->where('aviso_id', $input_data->aviso_id)->delete('aviso_carrera');
|
||||
array_walk($input_data->carreras, fn($carrera_id) => $db->insert('aviso_carrera', array('aviso_id' => $input_data->aviso_id, 'carrera_id' => $carrera_id)));
|
||||
}
|
||||
|
||||
if (isset($input_data->profesores)) {
|
||||
$db->where('aviso_id', $input_data->aviso_id)->delete('aviso_profesor');
|
||||
array_walk($input_data->profesores, fn($profesor_id) => $db->insert('aviso_profesor', array('aviso_id' => $input_data->aviso_id, 'profesor_id' => $profesor_id)));
|
||||
}
|
||||
|
||||
echo json_encode(
|
||||
array(
|
||||
'msg' => 'Aviso actualizado exitosamente',
|
||||
'success' => true
|
||||
)
|
||||
);
|
||||
break;
|
||||
|
||||
case 'DELETE':
|
||||
$raw_input = file_get_contents('php://input');
|
||||
if (empty($raw_input)) {
|
||||
header('HTTP/1.1 400 Bad Request');
|
||||
echo json_encode(array('error' => 'No se recibieron parámetros'));
|
||||
exit();
|
||||
}
|
||||
|
||||
$input_data = json_decode($raw_input);
|
||||
if (json_last_error() !== JSON_ERROR_NONE) {
|
||||
header('HTTP/1.1 400 Bad Request');
|
||||
echo json_encode(array('error' => 'Invalid JSON format'));
|
||||
exit();
|
||||
}
|
||||
|
||||
$schema = <<<JSON
|
||||
{
|
||||
"\$schema": "http://json-schema.org/draft-07/schema#",
|
||||
"type": "object",
|
||||
"required": ["aviso_id"],
|
||||
"properties": {
|
||||
"aviso_id": {
|
||||
"type": "integer",
|
||||
"minimum": 1
|
||||
}
|
||||
}
|
||||
}
|
||||
JSON;
|
||||
|
||||
// VALIDATE JSON SCHEMA
|
||||
$validate = new JsonSchema\Validator();
|
||||
$validate->validate($input_data, json_decode($schema));
|
||||
|
||||
if (!$validate->isValid()) {
|
||||
header('HTTP/1.1 400 Bad Request');
|
||||
echo json_encode(
|
||||
array(
|
||||
'error' => 'El formato de la solicitud es incorrecto',
|
||||
'errors' => $validate->getErrors(),
|
||||
'success' => false,
|
||||
)
|
||||
);
|
||||
exit();
|
||||
}
|
||||
|
||||
$result = $db->where('aviso_id', $input_data->aviso_id)->update('aviso', array('aviso_estado' => false));
|
||||
echo json_encode(
|
||||
array(
|
||||
'msg' => 'Aviso eliminado exitosamente',
|
||||
'success' => true,
|
||||
'result' => $result
|
||||
)
|
||||
);
|
||||
|
||||
break;
|
||||
}
|
||||
} catch (PDOException $e) {
|
||||
echo json_encode(
|
||||
array(
|
||||
'error' => $e->getMessage(),
|
||||
'query' => $db->getLastQuery(),
|
||||
'exception' => $e->getTraceAsString()
|
||||
)
|
||||
);
|
||||
}
|
||||
@@ -13,10 +13,9 @@ if (!isset($_SESSION['user']))
|
||||
$user = unserialize($_SESSION['user']);
|
||||
//$user->access();
|
||||
|
||||
$duracion_id = filter_input(INPUT_POST, "duracion", FILTER_SANITIZE_NUMBER_INT);//1 Repo , 0 Cambio
|
||||
$bloque = filter_input(INPUT_POST, "bloque", FILTER_SANITIZE_NUMBER_INT);//1 Repo , 0 Cambio
|
||||
$ciclo = filter_input(INPUT_POST, "ciclo", FILTER_SANITIZE_NUMBER_INT);//1 Repo , 0 Cambio
|
||||
$fecha_falta = trim(htmlspecialchars($_POST["fecha_falta"], ENT_QUOTES, "UTF-8"));//limpia texto
|
||||
$duracion_id = filter_input(INPUT_POST, "duracion", FILTER_SANITIZE_NUMBER_INT);//Id reposicion
|
||||
$bloque = filter_input(INPUT_POST, "bloque", FILTER_SANITIZE_NUMBER_INT);//
|
||||
$ciclo = filter_input(INPUT_POST, "ciclo", FILTER_SANITIZE_NUMBER_INT);//
|
||||
$fecha_falta = trim(htmlspecialchars($_POST["fecha_falta"], ENT_QUOTES, "UTF-8"));//limpia texto
|
||||
$fecha = trim(htmlspecialchars($_POST["fecha_inicial"], ENT_QUOTES, "UTF-8"));//limpia texto
|
||||
$fecha_cambio = trim(htmlspecialchars($_POST["fecha_cambio"], ENT_QUOTES, "UTF-8"));//limpia texto
|
||||
|
||||
@@ -7,7 +7,12 @@ $ruta = "../";
|
||||
require_once "../class/c_login.php";
|
||||
|
||||
// check if the session is started
|
||||
$user = Login::get_user();
|
||||
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.";
|
||||
@@ -25,6 +30,7 @@ $user = Login::get_user();
|
||||
}catch(Exception $e){
|
||||
$return["error"] = "Ocurrió un error al leer los datos de la reposición.";
|
||||
echo json_encode($return);
|
||||
exit();
|
||||
}
|
||||
|
||||
|
||||
@@ -36,15 +42,16 @@ $user = Login::get_user();
|
||||
$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_total"];
|
||||
$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"];
|
||||
$return["salon_desc"] = $rs["Salon_desc"]=="" ? "-Pendiente-": $rs["Salon_desc"];
|
||||
$return["grupo"] = $rs["horario_grupo"];
|
||||
$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"];
|
||||
@@ -54,6 +61,8 @@ $user = Login::get_user();
|
||||
$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"];
|
||||
}
|
||||
echo json_encode($return);
|
||||
?>
|
||||
|
||||
@@ -8,46 +8,58 @@ $ruta = "../";
|
||||
require_once "../class/c_login.php";
|
||||
|
||||
// check if the session is started
|
||||
$user = Login::get_user();
|
||||
if (!isset($_SESSION['user']))
|
||||
die('No se ha iniciado sesión');
|
||||
|
||||
$user = unserialize($_SESSION['user']);
|
||||
|
||||
|
||||
/*if(!isset($_POST["id"]) || !isset($_POST["fecha_falta"]) || !isset($_POST["fecha_inicial"]) || !isset($_POST["hora_ini"]) || !isset($_POST["min_ini"]) || !isset($_POST["materia"]) || !isset($_POST["grupo"])){
|
||||
header("Location: ".$pag."?error=0");
|
||||
exit();
|
||||
}*/
|
||||
|
||||
$id = filter_input(INPUT_POST, "id", FILTER_SANITIZE_NUMBER_INT);//limpia texto
|
||||
$fecha_falta = trim(filter_input(INPUT_POST, "fecha_falta", FILTER_SANITIZE_STRING,array('flags' => FILTER_FLAG_STRIP_LOW)));//limpia texto
|
||||
$fecha = trim(filter_input(INPUT_POST, "fecha_inicial", FILTER_SANITIZE_STRING,array('flags' => FILTER_FLAG_STRIP_LOW)));//limpia texto
|
||||
$fecha_cambio = trim(filter_input(INPUT_POST, "fecha_cambio", FILTER_SANITIZE_STRING,array('flags' => FILTER_FLAG_STRIP_LOW)));//limpia texto
|
||||
$duracion_id = filter_input(INPUT_POST, "duracion", FILTER_SANITIZE_NUMBER_INT);//Id reposicion
|
||||
$bloque = filter_input(INPUT_POST, "bloque", FILTER_SANITIZE_NUMBER_INT);//
|
||||
$ciclo = filter_input(INPUT_POST, "ciclo", FILTER_SANITIZE_NUMBER_INT);//
|
||||
$fecha_falta = trim(htmlspecialchars($_POST["fecha_falta"], ENT_QUOTES, "UTF-8"));//limpia texto
|
||||
$fecha = trim(htmlspecialchars($_POST["fecha_inicial"], ENT_QUOTES, "UTF-8"));//limpia texto
|
||||
$fecha_cambio = trim(htmlspecialchars($_POST["fecha_cambio"], ENT_QUOTES, "UTF-8"));//limpia texto
|
||||
$hora_ini = filter_input(INPUT_POST, "hora_ini", FILTER_SANITIZE_NUMBER_INT);//limpia texto
|
||||
$min_ini = filter_input(INPUT_POST, "min_ini", FILTER_SANITIZE_NUMBER_INT);//limpia texto
|
||||
$hor = filter_input(INPUT_POST, "horario", FILTER_SANITIZE_NUMBER_INT);//limpia texto
|
||||
$prof = $_SESSION["usuario_id"];
|
||||
//if(isset($_POST["salon"]) && $_POST["salon"] != "")
|
||||
//$salon = trim(filter_input(INPUT_POST, "salon", FILTER_SANITIZE_STRING,array('flags' => FILTER_FLAG_STRIP_LOW)));//limpia texto
|
||||
$comentario = trim(filter_input(INPUT_POST, "comentario", FILTER_SANITIZE_STRING,array('flags' => FILTER_FLAG_STRIP_LOW)));//limpia texto
|
||||
|
||||
$alumnos = filter_input(INPUT_POST, "alumnos", FILTER_SANITIZE_NUMBER_INT);//limpia texto
|
||||
$tipo = filter_input(INPUT_POST, "tipo", FILTER_SANITIZE_NUMBER_INT);//1 Repo , 0 Cambio
|
||||
$aula = filter_input(INPUT_POST, "aula", FILTER_SANITIZE_NUMBER_INT);//1 regular , 2 sala computo, 3 otro facultad
|
||||
$comentario = trim(filter_input(INPUT_POST, "comentario", FILTER_SANITIZE_STRING,array('flags' => FILTER_FLAG_STRIP_LOW)));//limpia texto
|
||||
|
||||
$horario_rs = $db->querySingle('SELECT * from fs_horario_basic where id = :hor',
|
||||
if(empty($_POST["prof"]))
|
||||
$prof = $user["id"];
|
||||
else
|
||||
$prof = filter_input(INPUT_POST, "prof", FILTER_SANITIZE_NUMBER_INT);//limpia texto
|
||||
|
||||
//if(isset($_POST["salon"]) && $_POST["salon"] != "")
|
||||
//$salon = trim(filter_input(INPUT_POST, "salon", FILTER_SANITIZE_STRING,array('flags' => FILTER_FLAG_STRIP_LOW)));//limpia texto
|
||||
$comentario = trim(htmlspecialchars($_POST["comentario"], ENT_QUOTES, "UTF-8"));//limpia texto
|
||||
|
||||
$duracion_rs = $db->querySingle("select * from duracion where duracion_id = :id", [":id"=>$duracion_id]);
|
||||
$duracion_tiempo = $duracion_rs["duracion_interval"];
|
||||
|
||||
$horario_rs = $db->querySingle('SELECT * from horario_view where horario_id = :hor',
|
||||
[':hor' => $hor]
|
||||
);
|
||||
|
||||
$materia = $horario_rs["materia_id"];
|
||||
$gpo = $horario_rs["grupo"];
|
||||
$duracion = $horario_rs["duracion_total"];
|
||||
$dia = $horario_rs["dia"];
|
||||
$dia = $horario_rs["horario_dia"];
|
||||
|
||||
|
||||
$hora = $hora_ini.":".$min_ini.":00";
|
||||
$fecha_new = DateTime::createFromFormat('d/m/Y', $fecha)->format('Y-m-d')." ".$hora;
|
||||
$fecha_fin_new = date("Y-m-d H:i:00", strtotime($fecha_new.' + '.$duracion.' minute'));
|
||||
$fecha_fin_new = date("Y-m-d", strtotime($fecha_new))." ".$duracion_tiempo;
|
||||
$dia_new = date('w', strtotime($fecha_new));
|
||||
|
||||
echo $fecha_new."<br>";
|
||||
echo $fecha_fin_new."<br>";
|
||||
//echo $fecha_new."<br>";
|
||||
//echo $fecha_fin_new."<br>";
|
||||
if($tipo == 1){//Reposición
|
||||
$fecha_falta = DateTime::createFromFormat('d/m/Y', $fecha_falta)->format('Y-m-d');
|
||||
$dia_falta = date('w', strtotime($fecha_falta));
|
||||
@@ -76,40 +88,36 @@ if($tipo == 1){//Reposición
|
||||
//Valida que profesor no este en 2 reposiciones al mismo tiempo
|
||||
*/
|
||||
$traslape = $db->querySingle('SELECT * from traslape_profesor_reposicion(:prof, :fecha, :hora, :dur)',
|
||||
[':prof' => $prof, ':fecha'=>$fecha_falta, ':hora'=>$hora, ':dur'=>$duracion]
|
||||
[':prof' => $prof, ':fecha'=>DateTime::createFromFormat('d/m/Y', $fecha)->format('Y-m-d'), ':hora'=>$hora, ':dur'=>$duracion_tiempo]
|
||||
)["traslape_profesor_reposicion"];
|
||||
if($traslape){
|
||||
header("Location:".$pag."?error=9");
|
||||
//header("Location:".$pag."?error=9");
|
||||
echo "traslape";
|
||||
exit();
|
||||
}
|
||||
|
||||
try{
|
||||
$db->query('SELECT * from fu_reposicion(:id, :f_falta, :f_nueva, :hora_nueva, NULL, 1, :desc, :alumnos, true, :aula)',
|
||||
[':id'=> $id, ':f_falta' => $fecha_falta, ':f_nueva' => $fecha_new, ':hora_nueva' => $hora,
|
||||
':desc' => $comentario, ':alumnos' => $alumnos, ':aula' => $aula
|
||||
]
|
||||
);
|
||||
}catch(Exception $e){
|
||||
header("Location: ".$pag."?error=2");
|
||||
exit();
|
||||
}
|
||||
|
||||
/*
|
||||
$log = new LogActividad();
|
||||
$desc_log = "Actualiza reposición ID[".$id."] Fechas[".$fecha_ini."][".$fecha_fin."] Periodo[".$_SESSION["periodo_id"]."] Materia[".$materia."] Profesor[".$prof."] Salon[".$salon."] Horario[".$hor."]";
|
||||
$log->appendLog($_SESSION["usuario_id"], $_SESSION["usuario_nombre"]." ".$_SESSION["usuario_apellidos"], $desc_log);*/
|
||||
}else{
|
||||
}
|
||||
|
||||
try{
|
||||
$db->query('SELECT * from fu_reposicion(:id, :f_falta, :f_nueva, :hora_nueva, NULL, 1, :desc, :alumnos, true, :aula)',
|
||||
[':id'=> $id, ':f_falta' => $fecha_falta, ':f_nueva' => $fecha_new, ':hora_nueva' => $hora,
|
||||
':desc' => $comentario, ':alumnos' => $alumnos, ':aula' => $aula
|
||||
]
|
||||
);
|
||||
}catch(Exception $e){
|
||||
header("Location: ".$pag."?error=2");
|
||||
exit();
|
||||
}
|
||||
|
||||
try{
|
||||
$db->query('SELECT * from fu_reposicion_solicitud(:id, :f_falta, :f_nueva, :hora_nueva, NULL, 1, :desc, :alumnos, :aula, :duracion_id, NULL)',
|
||||
[':id'=> $id, ':f_falta' => $fecha_falta, ':f_nueva' => $fecha_new, ':hora_nueva' => $hora,
|
||||
':desc' => $comentario, ':alumnos' => $alumnos, ':aula' => $aula, ':duracion_id' => $duracion_id
|
||||
]
|
||||
);
|
||||
}catch(Exception $e){
|
||||
//header("Location: ".$pag."?error=2");
|
||||
print_r($e->getMessage());
|
||||
echo "SELECT * from fu_reposicion_solicitud(:id, :f_falta, :f_nueva, :hora_nueva, NULL, 1, :desc, :alumnos, :aula, :duracion_id, NULL)'";
|
||||
print_r(
|
||||
[':id'=> $id, ':f_falta' => $fecha_falta, ':f_nueva' => $fecha_new, ':hora_nueva' => $hora,
|
||||
':desc' => $comentario, ':alumnos' => $alumnos, ':aula' => $aula, ':duracion_id' => $duracion_id
|
||||
]);
|
||||
exit();
|
||||
}
|
||||
header("Location: ".$pag);
|
||||
exit();
|
||||
|
||||
Reference in New Issue
Block a user