Fixes and improvements to main.php, test.php, c_login.php, reposicion_profesor_materias.php, puesto.php, action_usuarios_insert.php, periodos.php, reposicion_autoriza.php, profesor_faltas.php
This commit is contained in:
@@ -14,13 +14,16 @@ if ($db->where('usuario_clave', $_POST['mclave'])->has('usuario')) {
|
||||
header("Location: ../usuarios.php?error=1");
|
||||
exit;
|
||||
}
|
||||
|
||||
$db->insert('usuario', [
|
||||
'usuario_nombre' => mb_strtoupper($_POST['mnombre']),
|
||||
'usuario_correo' => $_POST['mcorreo'],
|
||||
'usuario_clave' => $_POST['mclave'],
|
||||
'rol_id' => $_POST['mrol'] ?? null,
|
||||
'facultad_id' => empty($facultad) ? null : $facultad,
|
||||
]);
|
||||
|
||||
header("Location: ../usuarios.php", true, 307);
|
||||
try {
|
||||
$db->insert('usuario', [
|
||||
'usuario_nombre' => mb_strtoupper($_POST['mnombre']),
|
||||
'usuario_correo' => $_POST['mcorreo'],
|
||||
'usuario_clave' => $_POST['mclave'],
|
||||
'rol_id' => $_POST['mrol'] ?? null,
|
||||
'facultad_id' => empty($facultad) ? null : $facultad,
|
||||
]);
|
||||
header("Location: ../usuarios.php", true, 307);
|
||||
} catch (PDOException $e) {
|
||||
header("Location: ../usuarios.php?error=2");
|
||||
exit;
|
||||
}
|
||||
|
||||
120
action/asignacion_insert.php
Normal file
120
action/asignacion_insert.php
Normal file
@@ -0,0 +1,120 @@
|
||||
<?php
|
||||
/*
|
||||
* Inserta reposición
|
||||
*/
|
||||
$pag = "../asignacion_crear.php";
|
||||
$ruta = "../";
|
||||
require_once "../class/c_login.php";
|
||||
require_once "../class/mailer.php";
|
||||
|
||||
define("COORDINADOR", 9);
|
||||
define("ENVIO_CORREOS", true);
|
||||
|
||||
// check if the session is started
|
||||
if (!isset($_SESSION['user']))
|
||||
die('No se ha iniciado sesión');
|
||||
|
||||
$user = unserialize($_SESSION['user']);
|
||||
//$user->access();
|
||||
|
||||
$duracion_id = filter_input(INPUT_POST, "duracion", FILTER_SANITIZE_NUMBER_INT);//Id reposicion
|
||||
$fecha = trim(htmlspecialchars($_POST["fecha_inicial"], 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
|
||||
$alumnos = filter_input(INPUT_POST, "alumnos", FILTER_SANITIZE_NUMBER_INT);//limpia texto
|
||||
$aula = filter_input(INPUT_POST, "aula", FILTER_SANITIZE_NUMBER_INT);//1 regular , 2 sala computo, 3 otro facultad
|
||||
|
||||
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
|
||||
|
||||
$aula_rs = $db->querySingle("select tipoaula_nombre from tipoaula where tipoaula_id = :id", [":id"=>$aula]);
|
||||
|
||||
|
||||
$duracion_rs = $db->querySingle("select * from duracion where duracion_id = :id", [":id"=>$duracion_id]);
|
||||
$duracion_tiempo = $duracion_rs["duracion_interval"];
|
||||
|
||||
//-- Obtiene datos de horario regular de clase
|
||||
|
||||
$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", strtotime($fecha_new))." ".$duracion_tiempo;
|
||||
$dia_new = date('w', strtotime($fecha_new));
|
||||
|
||||
|
||||
|
||||
//Obtiene correo
|
||||
$correos_rs = $db->querySingle('SELECT coor.usuario_correo, coor.usuario_nombre from usuario coor where rol_id = :rol_coord and facultad_id = (
|
||||
select coalesce(facultad_id,0) from usuario u where u.usuario_id = :id_usr)',[':rol_coord' => COORDINADOR, ':id_usr' => $user->user["id"]]
|
||||
);
|
||||
if( count($correos_rs) > 0 ){
|
||||
$to = $correos_rs["usuario_correo"];
|
||||
}
|
||||
|
||||
// Valida que grupo no tenga clases
|
||||
/*$result = validaConflictoHoras($pdo, $gpo, $dia_new, $hora, $materia, "-", $fecha_new, $fecha_fin_new, $duracion);
|
||||
if($result != ""){//error
|
||||
//echo $result;
|
||||
header("Location:".$pag."?error=7");
|
||||
exit();
|
||||
}
|
||||
*/
|
||||
//Valida que profesor no este en 2 reposiciones al mismo tiempo en la fecha nueva
|
||||
|
||||
$traslape = $db->querySingle('SELECT * from traslape_profesor_reposicion(:prof, :fecha, :hora, :dur)',
|
||||
[':prof' => $prof, ':fecha'=>DateTime::createFromFormat('d/m/Y', $fecha)->format('Y-m-d'), ':hora'=>$hora, ':dur'=>$duracion_tiempo]
|
||||
)["traslape_profesor_reposicion"];
|
||||
if($traslape){
|
||||
//print_r($_POST);
|
||||
//echo "SELECT * from traslape_profesor_reposicion($prof,'".DateTime::createFromFormat('d/m/Y', $fecha)->format('Y-m-d')."' , '$hora', $duracion)";
|
||||
|
||||
header("Location:".$pag."?error=9");
|
||||
exit();
|
||||
}
|
||||
|
||||
try{
|
||||
//echo "SELECT * from fi_asignacion_solicitud( $fecha_new, $hora, $prof, 1, $comentario, $alumnos, $aula, $duracion_tiempo, ".$user->user["id"].")";
|
||||
$db->query('SELECT * from fi_asignacion_solicitud(:f_nueva, :hora_nueva, :prof, 1, :desc, :alumnos, :aula, :duracion, :usr)',
|
||||
[':f_nueva' => $fecha_new, ':hora_nueva' => $hora,
|
||||
':prof' => $prof, ':desc' => $comentario, ':alumnos' => $alumnos, ':aula' => $aula, ':duracion' => $duracion_tiempo, ':usr'=>$user->user["id"]
|
||||
]
|
||||
);
|
||||
}catch(Exception $e){
|
||||
echo $e->getMessage();
|
||||
//header("Location: ".$pag."?error=1");
|
||||
exit();
|
||||
}
|
||||
$texto = "<p>Se creó una asignación nueva.</p>";
|
||||
$texto .= "<p><b>Se solicita un espacio de tipo ".mb_strtoupper($aula_rs["tipoaula_nombre"])."</b> del día <b>".$fecha_new." hrs. </b>";
|
||||
$texto .= "<p>Ingresa al <a href='https://paad.lci.ulsa.mx'>sistema PAAD</a> para autorizarla.</p>";
|
||||
|
||||
/*
|
||||
$log = new LogActividad();
|
||||
$desc_log = "Inserta reposición nueva ID[".$rs["fi_reposicion"]."] Fechas[".$fecha_falta.">".$fecha_new."] Periodo[".$_SESSION["periodo_id"]."] Materia[".$materia."] Profesor[".$prof."] Salon[".$salon."] Horario[".$hor."] Alumnos[".$alumnos."]";
|
||||
$log->appendLog($_SESSION["usuario_id"], $_SESSION["usuario_nombre"]." ".$_SESSION["usuario_apellidos"], $desc_log);*/
|
||||
|
||||
|
||||
|
||||
if($to!= "" && ENVIO_CORREOS){
|
||||
$asunto = "Reposición nueva - solicitud";
|
||||
//crear plantilla
|
||||
$texto = '<body >
|
||||
<img src="https://paad.lci.ulsa.mx/imagenes/logo_lasalle.png" alt="La Salle" style="margin-bottom:60px">
|
||||
'.$texto.'
|
||||
</body>';
|
||||
|
||||
require_once('../include/phpmailer/PHPMailerAutoload.php');
|
||||
if($_ENV['DB_NAME'] == "paad_pruebas"){
|
||||
$asunto = "PRUEBAS-".$asunto;
|
||||
Mailer::enviarCorreo("alejandro.lara@lasalle.mx", $asunto, $texto, true);
|
||||
}else{
|
||||
Mailer::enviarCorreo($to, $asunto, $texto, true);
|
||||
}
|
||||
}
|
||||
|
||||
header("Location: ".$pag."?ok=0");
|
||||
?>
|
||||
@@ -16,7 +16,7 @@ try {
|
||||
$periodo_id = $user->periodo_id;
|
||||
if (is_null($user->facultad['facultad_id'])) {
|
||||
$periodos = $db
|
||||
->where('CURRENT_DATE BETWEEN periodo_fecha_inicio AND periodo_fecha_fin')
|
||||
//->where('CURRENT_DATE BETWEEN periodo_fecha_inicio AND periodo_fecha_fin')
|
||||
->join('nivel', 'nivel.nivel_id = periodo.nivel_id')
|
||||
->orderBy('periodo_id')
|
||||
->get('periodo', null, 'periodo.*, nivel_nombre as nivel');
|
||||
@@ -25,8 +25,8 @@ try {
|
||||
"SELECT DISTINCT periodo.*, nivel_nombre as nivel FROM periodo
|
||||
JOIN horario_view USING (periodo_id)
|
||||
JOIN nivel ON nivel.nivel_id = periodo.nivel_id
|
||||
WHERE CURRENT_DATE BETWEEN periodo.periodo_fecha_inicio AND periodo.periodo_fecha_fin
|
||||
AND facultad_id = :facultad_id
|
||||
WHERE /*CURRENT_DATE BETWEEN periodo.periodo_fecha_inicio AND periodo.periodo_fecha_fin
|
||||
AND */facultad_id = :facultad_id
|
||||
ORDER BY periodo_id
|
||||
",
|
||||
['facultad_id' => $user->facultad['facultad_id']]
|
||||
|
||||
@@ -53,13 +53,12 @@ try {
|
||||
$data = array_column($db->query(
|
||||
"WITH fechas AS (
|
||||
SELECT
|
||||
fcc.registro_fecha_ideal,
|
||||
fcc.horario_id,
|
||||
h.horario_id,
|
||||
fechas_clase(h.horario_id, true) AS registro_fecha_ideal,
|
||||
hp.profesor_id
|
||||
FROM fechas_clase_cache fcc
|
||||
FROM horario h
|
||||
JOIN horario_profesor hp USING (horario_id)
|
||||
JOIN horario h USING (horario_id)
|
||||
WHERE (h.PERIODO_ID, h.FACULTAD_ID) = (:periodo_id, :facultad_id) and profesor_id <> 0
|
||||
WHERE (h.PERIODO_ID, h.FACULTAD_ID) = (:periodo_id, :facultad_id) AND hp.profesor_id <> 0
|
||||
),
|
||||
asistencia_faltas AS (
|
||||
SELECT
|
||||
@@ -97,7 +96,8 @@ try {
|
||||
FROM asistencia_faltas_con_porcentaje afcp
|
||||
JOIN profesor p USING (profesor_id)
|
||||
WHERE $filter
|
||||
ORDER BY afcp.porcentaje DESC",
|
||||
ORDER BY afcp.porcentaje DESC;
|
||||
",
|
||||
[
|
||||
'periodo_id' => $user->periodo_id,
|
||||
'facultad_id' => $facultad,
|
||||
|
||||
@@ -15,7 +15,6 @@ try {
|
||||
case 'GET':
|
||||
// Fetch all puestos
|
||||
$facultad_id = $user->facultad['facultad_id'] ?? -1;
|
||||
$carreras = array_map(fn($c) => $c['carrera_id'], $db->where('facultad_id', $facultad_id)->get(tableName: 'carrera', columns: 'carrera_id'));
|
||||
$puestos = array_map(
|
||||
fn($p) => array(
|
||||
...$p,
|
||||
@@ -28,7 +27,7 @@ try {
|
||||
),
|
||||
$db->orderBy('puesto.nombre', 'desc')
|
||||
->where('facultad_id', $facultad_id)
|
||||
->get(tableName: 'puesto', numRows: count($carreras), columns: 'puesto_id, nombre'),
|
||||
->get(tableName: 'puesto', columns: 'puesto_id, nombre'),
|
||||
);
|
||||
echo json_encode($puestos);
|
||||
break;
|
||||
|
||||
@@ -153,7 +153,7 @@ switch($edo){
|
||||
case 4://Correo a coordinador, profesor y jefe
|
||||
$asunto = "Reposición declinada - ".$reposicion_rs["materia"];
|
||||
$texto = "<p>La resposición de la clase de <b>".$reposicion_rs["materia"]." planeada para el día ".$fecha_nueva." a las ".$hora_nueva." hrs.</b> ha sido declinada por el siguiente motivo:</p>";
|
||||
$texto .= "<p style='font-style:italic; padding-left:25px'>".$reposicion_rs["motivo_cancelacion"]."</p>";
|
||||
$texto .= "<p style='font-style:italic; padding-left:25px'>".$motivo."</p>";
|
||||
$to = join(",", $coord_correos).",".join(",", $prof_correos).",".join(",", $jefe_correos);
|
||||
$ok = 1;
|
||||
break;
|
||||
@@ -166,12 +166,13 @@ if($to!= "" && ENVIO_CORREOS){
|
||||
</body>';
|
||||
|
||||
require_once('../include/phpmailer/PHPMailerAutoload.php');
|
||||
if($_ENV['DB_NAME'] == "paad_pruebas"){
|
||||
/*if($_ENV['DB_NAME'] == "paad_pruebas"){
|
||||
$asunto = "PRUEBAS-".$asunto;
|
||||
Mailer::enviarCorreo("alejandro.lara@lasalle.mx", $asunto, $texto, true);
|
||||
}else{
|
||||
Mailer::enviarCorreo($to, $asunto, $texto, true);
|
||||
}
|
||||
}*/
|
||||
Mailer::enviarCorreo("alejandro.rosales@lasalle.mx", $asunto, $texto, true);
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
@@ -21,21 +21,25 @@ $duracion_id = filter_input(INPUT_POST, "duracion", FILTER_SANITIZE_NUMBER_INT);
|
||||
$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 = trim(htmlspecialchars($_POST["fecha_inicial"], ENT_QUOTES, "UTF-8"));//limpia texto fecha de reposicion
|
||||
$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
|
||||
$hora_ini = filter_input(INPUT_POST, "hora_ini", FILTER_SANITIZE_NUMBER_INT);//limpia texto hora reposicion
|
||||
$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
|
||||
$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
|
||||
|
||||
if(!$user->jefe_carrera){//coordinador
|
||||
if(isset($_POST["salon"]) && $_POST["salon"] != "")
|
||||
$salon = filter_input(INPUT_POST, "dlSalon", FILTER_SANITIZE_NUMBER_INT);//1 regular , 2 sala computo, 3 otro facultad
|
||||
}
|
||||
|
||||
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
|
||||
|
||||
|
||||
@@ -79,7 +83,7 @@ $materia_rs = $db->querySingle('SELECT materia_nombre from materia where materi
|
||||
|
||||
//Obtiene correo
|
||||
$correos_rs = $db->querySingle('SELECT coor.usuario_correo, coor.usuario_nombre from usuario coor where rol_id = :rol_coord and facultad_id = (
|
||||
select coalesce(facultad_id,0) from usuario u where u.usuario_id = :id_usr)',[':rol_coord' => COORDINADOR, ':id_usr' => $user->user["id"]]
|
||||
select coalesce(facultad_id,0) from usuario u where u.usuario_id = :id_usr) and coor.usuario_correo != \'\'',[':rol_coord' => COORDINADOR, ':id_usr' => $user->user["id"]]
|
||||
);
|
||||
if( count($correos_rs) > 0 ){
|
||||
$to = $correos_rs["usuario_correo"];
|
||||
@@ -108,20 +112,33 @@ if($tipo == 1){//Reposición
|
||||
}
|
||||
|
||||
try{
|
||||
$db->query('SELECT * from fi_reposicion_solicitud(:f_falta, :f_nueva, :hora_nueva, :hor, :prof, 1, :desc, :alumnos, true, :aula, :duracion, :usr, :bloque, :ciclo)',
|
||||
[':f_falta' => $fecha_falta, ':f_nueva' => $fecha_new, ':hora_nueva' => $hora, ':hor' => $hor,
|
||||
':prof' => $prof, ':desc' => $comentario, ':alumnos' => $alumnos, ':aula' => $aula, ':duracion' => $duracion_tiempo, ':usr'=>$user->user["id"],
|
||||
':bloque' => $bloque, ':ciclo' => $ciclo
|
||||
]
|
||||
);
|
||||
if($user->jefe_carrera){//jefe
|
||||
$db->query('SELECT * from fi_reposicion_solicitud(:f_falta, :f_nueva, :hora_nueva, :hor, :prof, 1, :desc, :alumnos, true, :aula, :duracion, :usr, :bloque, :ciclo)',
|
||||
[':f_falta' => $fecha_falta, ':f_nueva' => $fecha_new, ':hora_nueva' => $hora, ':hor' => $hor,
|
||||
':prof' => $prof, ':desc' => $comentario, ':alumnos' => $alumnos, ':aula' => $aula, ':duracion' => $duracion_tiempo, ':usr'=>$user->user["id"],
|
||||
':bloque' => $bloque, ':ciclo' => $ciclo
|
||||
]
|
||||
);
|
||||
|
||||
}else{//coordinador
|
||||
echo 'SELECT * from fi_reposicion_solicitud(:f_falta, :f_nueva, :hora_nueva, :hor, :prof, 2, :desc, :alumnos, true, :aula, :duracion, :usr, :bloque, :ciclo, '.$salon.')';
|
||||
$db->query('SELECT * from fi_reposicion_solicitud(:f_falta, :f_nueva, :hora_nueva, :hor, :prof, 2, :desc, :alumnos, true, :aula, :duracion, :usr, :bloque, :ciclo, :salon)',
|
||||
[':f_falta' => $fecha_falta, ':f_nueva' => $fecha_new, ':hora_nueva' => $hora, ':hor' => $hor,
|
||||
':prof' => $prof, ':desc' => $comentario, ':alumnos' => $alumnos, ':aula' => $aula, ':duracion' => $duracion_tiempo, ':usr'=>$user->user["id"],
|
||||
':bloque' => $bloque, ':ciclo' => $ciclo, ':salon'=>$salon
|
||||
]
|
||||
);
|
||||
}
|
||||
}catch(Exception $e){
|
||||
|
||||
echo $e->getMessage();
|
||||
//header("Location: ".$pag."?error=1");
|
||||
exit();
|
||||
}
|
||||
$fecha_clase = date('d/m/Y', strtotime($fecha_falta));
|
||||
$fecha_nueva = date('d/m/Y', strtotime($fecha_new));
|
||||
$texto = "<p>Se creó una reposición nueva.</p>";
|
||||
$texto .= "<p><b>".mb_strtoupper($materia_rs["materia_nombre"])."</b> del día <b>".$fecha_falta." a las ".$hor." hrs. </b> se propone reponer el <b>".$fecha_new." a las ".$hora." hrs.</b>";
|
||||
$texto .= "<p><b>".mb_strtoupper($materia_rs["materia_nombre"])."</b> del día <b>".$fecha_clase." a las ".$horario_rs["horario_hora"]." hrs. </b> se propone reponer el <b>".$fecha_nueva." a las ".$hora." hrs.</b>";
|
||||
$texto .= "<p>Ingresa al <a href='https://paad.lci.ulsa.mx'>sistema PAAD</a> para autorizarla.</p>";
|
||||
|
||||
/*
|
||||
@@ -133,19 +150,28 @@ if($tipo == 1){//Reposición
|
||||
}else{//Cambio salón / hora
|
||||
|
||||
try{
|
||||
$db->query('SELECT * from fi_reposicion_solicitud(:f_falta, :f_nueva, :hora_nueva, :hor, :prof, 1, :desc, :alumnos, true, :aula, :duracion, :usr, :bloque, :ciclo)',
|
||||
[':f_falta' => $fecha_falta, ':f_nueva' => $fecha_cambio, ':hora_nueva' => $hora, ':hor' => $hor,
|
||||
':prof' => $prof, ':desc' => $comentario, ':alumnos' => $alumnos, ':aula' => $aula, ':duracion' => $duracion_tiempo, ':usr'=>$user->user["id"],
|
||||
':bloque' => $bloque, ':ciclo' => $ciclo
|
||||
]
|
||||
);
|
||||
if($user->jefe_carrera){//jefe
|
||||
$db->query('SELECT * from fi_reposicion_solicitud(:f_falta, :f_nueva, :hora_nueva, :hor, :prof, 1, :desc, :alumnos, true, :aula, :duracion, :usr, :bloque, :ciclo)',
|
||||
[':f_falta' => $fecha_falta, ':f_nueva' => $fecha_cambio, ':hora_nueva' => $hora, ':hor' => $hor,
|
||||
':prof' => $prof, ':desc' => $comentario, ':alumnos' => $alumnos, ':aula' => $aula, ':duracion' => $duracion_tiempo, ':usr'=>$user->user["id"],
|
||||
':bloque' => $bloque, ':ciclo' => $ciclo
|
||||
]
|
||||
);
|
||||
}else{//coordinador
|
||||
$db->query('SELECT * from fi_reposicion_solicitud(:f_falta, :f_nueva, :hora_nueva, :hor, :prof, 2, :desc, :alumnos, true, :aula, :duracion, :usr, :bloque, :ciclo, :salon)',
|
||||
[':f_falta' => $fecha_falta, ':f_nueva' => $fecha_cambio, ':hora_nueva' => $hora, ':hor' => $hor,
|
||||
':prof' => $prof, ':desc' => $comentario, ':alumnos' => $alumnos, ':aula' => $aula, ':duracion' => $duracion_tiempo, ':usr'=>$user->user["id"],
|
||||
':bloque' => $bloque, ':ciclo' => $ciclo, ':salon'=>$salon
|
||||
]
|
||||
);
|
||||
}
|
||||
}catch(Exception $e){
|
||||
|
||||
header("Location: ".$pag."?error=1");
|
||||
exit();
|
||||
}
|
||||
$texto = "<p>Se creó un cambio de salón nuevo.</p>";
|
||||
$texto .= "<p><b>".mb_strtoupper($materia_rs["materia_nombre"])."</b> del día <b>".$fecha_falta." a las ".$hora." hrs. </b> se propone reponer el <b>".$fecha_nueva." a las ".$hora_nueva." hrs.</b>";
|
||||
$texto .= "<p><b>".mb_strtoupper($materia_rs["materia_nombre"])."</b> del día <b>".$fecha_falta." a las ".$hora." hrs. </b> se propone reponer el <b>".$fecha_nueva." a las ".$hora." hrs.</b>";
|
||||
$texto .= "<p>Ingresa al <a href='https://paad.lci.ulsa.mx'>sistema PAAD</a> para autorizarlo.</p>";
|
||||
|
||||
/*
|
||||
@@ -156,7 +182,6 @@ if($tipo == 1){//Reposición
|
||||
|
||||
}
|
||||
|
||||
|
||||
if($to!= "" && ENVIO_CORREOS){
|
||||
$asunto = "Reposición nueva - solicitud";
|
||||
//crear plantilla
|
||||
@@ -166,14 +191,15 @@ if($to!= "" && ENVIO_CORREOS){
|
||||
</body>';
|
||||
|
||||
require_once('../include/phpmailer/PHPMailerAutoload.php');
|
||||
if($_ENV['DB_NAME'] == "paad_pruebas"){
|
||||
/*if($_ENV['DB_NAME'] == "paad_pruebas"){
|
||||
$asunto = "PRUEBAS-".$asunto;
|
||||
Mailer::enviarCorreo("alejandro.lara@lasalle.mx", $asunto, $texto, true);
|
||||
}else{
|
||||
Mailer::enviarCorreo($to, $asunto, $texto, true);
|
||||
}
|
||||
}*/
|
||||
Mailer::enviarCorreo("alejandro.rosales@lasalle.mx", $asunto, $texto, true);
|
||||
}
|
||||
|
||||
exit();
|
||||
header("Location: ".$pag."?ok=0");
|
||||
exit();
|
||||
?>
|
||||
|
||||
@@ -22,7 +22,11 @@ $user = unserialize($_SESSION['user']);
|
||||
$id = filter_input(INPUT_POST, "id", FILTER_SANITIZE_NUMBER_INT);//limpia texto
|
||||
|
||||
try{
|
||||
$rs = $db->query('SELECT * FROM fs_materiasprofesor(:id, :jefe)', [':id' => $id, ':jefe'=>$user->user["id"]] );
|
||||
if($user->jefe_carrera){
|
||||
$rs = $db->query('SELECT * FROM fs_materiasprofesor(:id, :jefe)', [':id' => $id, ':jefe'=>$user->user["id"]] );
|
||||
}else{
|
||||
$rs = $db->query('SELECT * FROM fs_materiasprofesor(:id, NULL)', [':id' => $id] );
|
||||
}
|
||||
|
||||
}catch(Exception $e){
|
||||
$return["error"] = "Ocurrió un error al leer los datos de las materias.";
|
||||
|
||||
@@ -87,9 +87,10 @@ 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'=>DateTime::createFromFormat('d/m/Y', $fecha)->format('Y-m-d'), ':hora'=>$hora, ':dur'=>$duracion_tiempo]
|
||||
$traslape = $db->querySingle('SELECT * from traslape_profesor_reposicion(:prof, :fecha, :hora, :dur, :id)',
|
||||
[':prof' => $prof, ':fecha'=>DateTime::createFromFormat('d/m/Y', $fecha)->format('Y-m-d'), ':hora'=>$hora, ':dur'=>$duracion_tiempo, ':id'=>$id]
|
||||
)["traslape_profesor_reposicion"];
|
||||
echo "SELECT * from traslape_profesor_reposicion($prof, '".DateTime::createFromFormat('d/m/Y', $fecha)->format('Y-m-d')."', $hora, $duracion_tiempo, $id)";
|
||||
if($traslape){
|
||||
//header("Location:".$pag."?error=9");
|
||||
echo "traslape";
|
||||
@@ -104,7 +105,7 @@ if($tipo == 1){//Reposición
|
||||
}
|
||||
|
||||
try{
|
||||
$db->query('SELECT * from fu_reposicion_solicitud(:id, :f_falta, :f_nueva, :hora_nueva, NULL, 1, :desc, :alumnos, :aula, :duracion, NULL)',
|
||||
$db->query('SELECT * from fu_reposicion_solicitud(:id, :f_falta, :f_nueva, :hora_nueva, NULL, NULL, :desc, :alumnos, :aula, :duracion, NULL)',
|
||||
[':id'=> $id, ':f_falta' => $fecha_falta, ':f_nueva' => $fecha_new, ':hora_nueva' => $hora,
|
||||
':desc' => $comentario, ':alumnos' => $alumnos, ':aula' => $aula, ':duracion' => $duracion_tiempo
|
||||
]
|
||||
@@ -112,7 +113,7 @@ try{
|
||||
}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, NULL)'";
|
||||
echo "SELECT * from fu_reposicion_solicitud(:id, :f_falta, :f_nueva, :hora_nueva, NULL, NULL, :desc, :alumnos, :aula, :duracion, NULL)'";
|
||||
print_r(
|
||||
[':id'=> $id, ':f_falta' => $fecha_falta, ':f_nueva' => $fecha_new, ':hora_nueva' => $hora,
|
||||
':desc' => $comentario, ':alumnos' => $alumnos, ':aula' => $aula, ':duracion' => $duracion_tiempo
|
||||
|
||||
@@ -37,8 +37,9 @@ $en_fecha = $db->querySingle("SELECT ESTA_EN_PERIODO(NOW()::DATE, :periodo_id)",
|
||||
|
||||
//$prof_rs = $db->query('SELECT DISTINCT * FROM fs_profesores(null, null, :fac) ORDER BY PROFESOR_NOMBRE', [':fac' => $user->facultad["facultad_id"]]);
|
||||
$prof_rs = $db->query('SELECT DISTINCT PROFESOR.* FROM PROFESOR
|
||||
JOIN HORARIO_VIEW USING (PROFESOR_ID_ID)
|
||||
WHERE FACULTAD_ID = :fac', [':fac' => $user->facultad["facultad_id"]]);
|
||||
JOIN horario_profesor USING (profesor_id)
|
||||
JOIN HORARIO_VIEW USING (horario_id)
|
||||
WHERE FACULTAD_ID = :fac ORDER BY profesor.profesor_nombre', [':fac' => $user->facultad["facultad_id"]]);
|
||||
//}
|
||||
|
||||
//Duraciones
|
||||
@@ -51,13 +52,14 @@ if(!is_null($user->periodo_id)){
|
||||
if(strtotime($periodo_rs["periodo_fecha_inicio"])>strtotime(date("Y-m-d")) )
|
||||
$fecha_man = date("d/m/Y", strtotime($periodo_rs["periodo_fecha_inicio"]));
|
||||
else{
|
||||
$dias = 3;
|
||||
if( intval(date("w")) >=3 && intval(date("w"))<=5 )//Mie a Vie
|
||||
$dias+=3;
|
||||
else if( intval(date("w")) ==6 )//Sab
|
||||
$dias+=2;
|
||||
else if( intval(date("w")) ==0 )//Do
|
||||
$dias+=1;
|
||||
$dia_actual = intval(date("w"));
|
||||
$dias = 1;//días mínimos Lun a Jue
|
||||
if($dia_actual ==5 )//Vie
|
||||
$dias=4;
|
||||
else if( $dia_actual ==6 )//Sab
|
||||
$dias=3;
|
||||
else if( $dia_actual ==0 )//Do
|
||||
$dias=2;
|
||||
|
||||
$fecha_man = date("d/m/Y", strtotime("+".$dias." day"));
|
||||
}
|
||||
@@ -131,7 +133,7 @@ if(!is_null($user->periodo_id)){
|
||||
<!-- Botón para abrir el modal -->
|
||||
<div class="row mb-4">
|
||||
<div class="col-12 text-right">
|
||||
<button type="button" class="btn btn-outline-secondary" data-tipo="1" data-toggle="modal" data-target="#modal" <?php if (!$en_fecha ) { echo "disabled"; } ?>><span class="ing-mas ing-fw"></span>Crear reposición</button>
|
||||
<button type="button" class="btn btn-outline-secondary" data-tipo="1" data-toggle="modal" data-target="#modal" <?php if (!$en_fecha ) { echo "disabled"; } ?>><span class="ing-mas ing-fw"></span>Crear solicitud</button>
|
||||
</div>
|
||||
</div>
|
||||
<?php }?>
|
||||
@@ -164,7 +166,6 @@ if(!is_null($user->periodo_id)){
|
||||
</form>
|
||||
|
||||
<?php
|
||||
|
||||
$reposiciones_rs = $db->query('SELECT * FROM fs_reposiciones_solicitud(:f_ini, :f_fin, :usr ,NULL, NULL)', [':f_ini' => $fecha_ini_db, ':f_fin' => $fecha_fin_db, ':usr' => $user->user["id"]]);
|
||||
}
|
||||
?>
|
||||
@@ -179,8 +180,7 @@ if(!is_null($user->periodo_id)){
|
||||
<tr >
|
||||
<th>Estado</th>
|
||||
<th>Responsable</th>
|
||||
<th style="width:160px">Fecha falta</th>
|
||||
<th style="width:160px">Fecha reposición</th>
|
||||
<th style="width:160px">Fecha solicitada</th>
|
||||
<th style="width:160px">Duración</th>
|
||||
<th>Salón</th>
|
||||
<?php if($write){ ?><th>Acciones</th><?php } ?>
|
||||
@@ -207,11 +207,7 @@ if(!is_null($user->periodo_id)){
|
||||
</div>
|
||||
<?php } ?>
|
||||
</td>
|
||||
<td class="align-middle"><?php echo $reposicion["materia_nombre"]; ?></td>
|
||||
<td class="align-middle text-center"><?php
|
||||
echo date("d/m/Y", strtotime($reposicion["fecha_clase"]))."<br>".substr($reposicion["horario_hora"],0,-3)." a ".substr($reposicion["horario_hora_fin"],0,-3)." hrs.";;
|
||||
?>
|
||||
</td>
|
||||
<td class="align-middle"><?php echo $reposicion["profesor_nombre"]; ?></td>
|
||||
<td class="align-middle text-center"><?php
|
||||
|
||||
echo date("d/m/Y", strtotime($reposicion["fecha_nueva"])) ."<br>".substr($reposicion["hora_nueva"],0,-3)." a ".substr($reposicion["hora_nueva_fin"],0,-3)." hrs.";
|
||||
@@ -234,7 +230,7 @@ if(!is_null($user->periodo_id)){
|
||||
<?php
|
||||
|
||||
//no se ha aprobado
|
||||
if($reposicion["estado_reposicion_id"] == 1){?>
|
||||
if(($reposicion["estado_reposicion_id"] == 1 && $user->jefe_carrera) || ($reposicion["estado_reposicion_id"] == 2 && !$user->jefe_carrera)){?>
|
||||
<a href="#" data-tipo="2" title="Editar" data-toggle="modal" data-target="#modal"><?php echo $ICO["editar"];?></a>
|
||||
<a href="#" data-toggle="modal" data-target="#modal_confirm" title="Borrar"><?php echo $ICO["cancelar"];?></a>
|
||||
<?php } ?>
|
||||
@@ -263,7 +259,7 @@ if(!is_null($user->periodo_id)){
|
||||
<div class="modal-dialog modal-dialog-centered modal-xl" role="document">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h4 class="col-12 modal-title text-center"><span id="modalLabel">Crear Reposición</span>
|
||||
<h4 class="col-12 modal-title text-center"><span id="modalLabel">Crear asignación</span>
|
||||
<button type="button" class="close text-white" data-dismiss="modal" aria-label="Close">
|
||||
<span aria-hidden="true">×</span>
|
||||
</button></h4>
|
||||
@@ -294,20 +290,6 @@ if(!is_null($user->periodo_id)){
|
||||
</div>
|
||||
<div class="form-box prof-selected">
|
||||
|
||||
<div class="form-group row">
|
||||
<label for="tipo" class="col-4 col-form-label">Tipo *</label>
|
||||
<div class="col-8">
|
||||
<div class="datalist datalist-select mb-1 w-100" id="dlTipo">
|
||||
<div class="datalist-input">Reposición</div>
|
||||
<span class="ing-buscar icono"></span>
|
||||
<ul style="display:none">
|
||||
<li data-id="1">Reposición</li>
|
||||
<li data-id="2">Cambio de salón</li>
|
||||
</ul>
|
||||
<input type="hidden" id="tipo" name="tipo" value="1">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group row materia-block">
|
||||
<label for="duracion" class="col-4 col-form-label">Duración</label>
|
||||
@@ -324,13 +306,13 @@ if(!is_null($user->periodo_id)){
|
||||
<label for="fecha_inicial" class="col-4 col-form-label">Fecha de asignación *</label>
|
||||
<div class="col-8">
|
||||
<input id="fecha_inicial" name="fecha_inicial" type="text" class="form-control date-picker-future" placeholder="dd/mm/aaaa" maxlength="10" required="required" readonly="readonly" value="">
|
||||
<small class="form-text text-muted">Las solicitudes de asignación se deben solicitar con al menos 72hrs de anticipación.<br>
|
||||
<small class="form-text text-muted">Las solicitudes de asignación se deben solicitar con al menos 24hrs de anticipación.<br>
|
||||
Recuerda que en sábado el límite para terminar la clase es a las 15:00hrs.
|
||||
</small>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row materia-block">
|
||||
<label for="hora_ini" class="col-4 col-form-label" id="hora_nombre">Hora reposición *</label>
|
||||
<label for="hora_ini" class="col-4 col-form-label" id="hora_nombre">Hora *</label>
|
||||
<?php
|
||||
//define("HORA_FINAL", 22);
|
||||
//define("FRACCION_HORA", 15);
|
||||
@@ -404,7 +386,7 @@ if(!is_null($user->periodo_id)){
|
||||
<div class="modal-body">
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
<p class="font-weight-bold">¿Estás seguro de que quieres borrar la reposición?</p>
|
||||
<p class="font-weight-bold">¿Estás seguro de que quieres borrar la solicitud de asignación de salón?</p>
|
||||
<p>Esta acción no se puede deshacer.</p>
|
||||
</div>
|
||||
</div>
|
||||
@@ -555,26 +537,7 @@ if(!is_null($user->periodo_id)){
|
||||
return !error;
|
||||
}
|
||||
|
||||
function cambiaTipo(tipo){
|
||||
if (tipo == 1){//reposición
|
||||
$(".repo_block").show();
|
||||
$(".cambio_block").hide();
|
||||
$(".repo_block").find("input[type=text]").attr("required", true);
|
||||
$(".cambio_block").find("input[type=text]").removeAttr("required");
|
||||
$("#hora_nombre").text("Hora reposición *");
|
||||
}else{//Cambio de salón
|
||||
$(".repo_block").hide();
|
||||
$(".cambio_block").show();
|
||||
$(".repo_block").find("input[type=text]").removeAttr("required");
|
||||
$(".cambio_block").find("input[type=text]").attr("required", true);
|
||||
$("#hora_nombre").text("Hora cambio *");
|
||||
var hora = $("#dlMateria ul li.selected").data("hr");
|
||||
var min = $("#dlMateria ul li.selected").data("min");
|
||||
$("#hora_ini").val(hora)
|
||||
$("#min_ini").val(min)
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$(document).ready(function(){
|
||||
$(".prof-selected").hide();
|
||||
@@ -685,10 +648,6 @@ if(!is_null($user->periodo_id)){
|
||||
|
||||
});
|
||||
|
||||
$("#dlTipo ul li").click(function(){//cambia datalist
|
||||
cambiaTipo($(this).data('id'));
|
||||
$(".date-picker" ).datepicker(datepickerOptions);
|
||||
});
|
||||
|
||||
$('#modal_confirm').on('show.bs.modal', function (event) {
|
||||
var button = $(event.relatedTarget); // Button that triggered the modal
|
||||
@@ -732,7 +691,7 @@ if(!is_null($user->periodo_id)){
|
||||
$("#errorBox_text").html("");
|
||||
if(tipo == 1){//alta
|
||||
$("#submitBtn").data('tipo', 1);
|
||||
$("#modalLabel").html("Crear Reposición");
|
||||
$("#modalLabel").html("Solicitar Asignación");
|
||||
modal.find("input[type=text]").val("");
|
||||
modal.find("#alumnos").val("15");
|
||||
$("#plan").attr("readonly", false);
|
||||
@@ -751,7 +710,7 @@ if(!is_null($user->periodo_id)){
|
||||
|
||||
}else{//editar
|
||||
$("#submitBtn").data('tipo', 2);
|
||||
$("#modalLabel").html("Editar Reposición");
|
||||
$("#modalLabel").html("Editar solicitud");
|
||||
$("#plan").attr("readonly", true);
|
||||
$("#sem").attr("readonly", true);
|
||||
$("#gpo").attr("readonly", true);
|
||||
@@ -820,7 +779,7 @@ if(!is_null($user->periodo_id)){
|
||||
})
|
||||
</script>
|
||||
<script src="js/messages.js"></script>
|
||||
<script type="module" src="js/reposiciones.js"></script>
|
||||
|
||||
</body>
|
||||
|
||||
</html>
|
||||
@@ -38,7 +38,7 @@ class Login
|
||||
return match ($property) {
|
||||
'acceso' => $this->access(),
|
||||
'profesor' => $db->where('profesor_clave', preg_replace('/\D/', '', $this->user['clave']))->getOne("profesor")['profesor_id'] ?? null,
|
||||
'jefe_carrera' => $db->where('usuario_id', $this->user["id"])->has('usuario_carrera'),
|
||||
'jefe_carrera' => $db->where('usuario_id', $this->user["id"])->getOne('usuario')['rol_id'] == 11,
|
||||
'periodo_id' => $db->where('usuario_id', $this->user["id"])->getOne('usuario')["periodo_id"],
|
||||
'admin' => $this->es_usuario() and $db->where('usuario_id', $this->user["id"])->getOne('usuario')["usuario_admin"],
|
||||
'facultad' => $this->es_usuario()
|
||||
|
||||
@@ -131,9 +131,28 @@ $write = $user->admin || in_array($user->acceso, ['r']);
|
||||
</div>
|
||||
|
||||
<hr>
|
||||
<div id="btn-excel-horario" class="mb-2 float-right hidden">
|
||||
<button class="btn btn-outline-secondary " title="Exportar a Excel" v-if="false">
|
||||
<span class="ing-descarga ing-fw"></span> Exportar a Excel
|
||||
<div id="btn-excel-horario" class="mb-2 float-right hidden" v-if="horarios.data.length > 0">
|
||||
<button class="btn btn-outline-secondary " title="Imprimir PDF" @click="
|
||||
// hide all not the table
|
||||
Array.from(document.body.children).forEach(child => {
|
||||
if (child.id !== 'app') {
|
||||
child.classList.add('d-none');
|
||||
}
|
||||
// hide this button
|
||||
document.getElementById('btn-excel-horario').classList.add('d-none');
|
||||
});
|
||||
|
||||
window.print()
|
||||
|
||||
// show all
|
||||
Array.from(document.body.children).forEach(child => {
|
||||
child.classList.remove('d-none');
|
||||
});
|
||||
// show this button
|
||||
document.getElementById('btn-excel-horario').classList.remove('d-none');
|
||||
|
||||
">
|
||||
<span class="ing-descarga ing-fw"></span> Exportar
|
||||
</button>
|
||||
</div>
|
||||
<div class="table-responsive" v-if="horarios.data.length > 0">
|
||||
|
||||
2
main.php
2
main.php
@@ -37,7 +37,7 @@ $user = Login::get_user();
|
||||
<?= $user->facultad['facultad']; ?>
|
||||
</i>
|
||||
<small>
|
||||
<?= $user->rol['rol']; ?>
|
||||
<?= $user->rol['rol'] ?? 'General' ?>
|
||||
</small>
|
||||
</h3>
|
||||
<hr>
|
||||
|
||||
41
puestos.php
41
puestos.php
@@ -66,21 +66,25 @@
|
||||
:aria-controls="`puesto-${puesto.puesto_id}`">
|
||||
{{puesto.nombre}}
|
||||
</button>
|
||||
<?php if ($user->acceso == 'w') { ?>
|
||||
<button type="button" class="btn btn-outline-light" data-target="#eliminar-puesto"
|
||||
data-toggle="modal" @click="to_delete = puesto">
|
||||
<i class="fas fa-trash-alt"></i>
|
||||
</button>
|
||||
<?php } ?>
|
||||
</div>
|
||||
|
||||
<div :id="`puesto-${puesto.puesto_id}`" class="collapse"
|
||||
:aria-labelledby="`puesto-${puesto.nombre}`" data-parent="#puestos">
|
||||
<div class="card-body">
|
||||
<!-- Encargado -->
|
||||
|
||||
<div class="form-row justify-content-around align-items-center mb-2">
|
||||
<label :for="`encargado-${puesto.puesto_id}`" class="col-2 barra-right">
|
||||
Encargado del área
|
||||
<!-- $user->lectura && $user->escritura && $user->none -->
|
||||
</label>
|
||||
<div id="encargados" class="datalist datalist-select mb-1 col-9">
|
||||
<div id="encargados" class="datalist datalist-select mb-1 col-9 <?php if ($user->acceso != 'w') { ?>disabled<?php } ?>">
|
||||
<div class="datalist-input" v-if="puesto.encargado">
|
||||
({{puesto.encargado.usuario_clave}}) {{ puesto.encargado.usuario_nombre }}
|
||||
</div>
|
||||
@@ -101,6 +105,7 @@
|
||||
</div>
|
||||
<hr>
|
||||
|
||||
<?php if ($user->acceso == 'w') { ?>
|
||||
<div class="form-row justify-content-around align-items-center mb-2"
|
||||
v-show="carreras.length">
|
||||
<label :for="`carrera-${puesto.puesto_id}`" class="col-2 barra-right">
|
||||
@@ -125,6 +130,7 @@
|
||||
<input type="hidden" id="carrera_id" name="id">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-row justify-content-around align-items-center"
|
||||
v-scope="{to_add_materia: null}">
|
||||
<label :for="`materias-${puesto.puesto_id}`" class="col-2 barra-right">
|
||||
@@ -149,17 +155,24 @@
|
||||
v-for="materia in materias.filter(m => selected_carrera_id == 0 || m.carrera_id == selected_carrera_id).filter(m => !puesto.materias.find(p => p.materia_id == m.materia_id))"
|
||||
:value="`${materia.clave_materia} - ${materia.materia_nombre}`">
|
||||
</datalist>
|
||||
<?php } ?>
|
||||
|
||||
<hr>
|
||||
<style>
|
||||
.list-group-item-action:hover {
|
||||
<?php if ($user->acceso == 'w') { ?>
|
||||
background-color: rgba(255, 0, 0, 0.1);
|
||||
/* Light red tint on hover for better feedback */
|
||||
<?php } else { ?>
|
||||
background-color: rgba(0, 0, 255, 0.1);
|
||||
<?php } ?>
|
||||
}
|
||||
|
||||
.list-group-item-action:active {
|
||||
<?php if ($user->acceso == 'w') { ?>
|
||||
background-color: rgba(255, 0, 0, 0.2);
|
||||
/* Slightly darker red tint when active */
|
||||
<?php } else { ?>
|
||||
background-color: rgba(0, 0, 255, 0.2);
|
||||
<?php } ?>
|
||||
}
|
||||
</style>
|
||||
<fieldset class="container mt-4">
|
||||
@@ -172,15 +185,19 @@
|
||||
style="max-height: 250px; overflow-y: auto;">
|
||||
<li class="list-group-item list-group-item-action d-flex justify-content-between align-items-center"
|
||||
v-for="materia in puesto.materias" :key="materia.materia_id"
|
||||
<?php if ($user->acceso == 'w') { ?>
|
||||
@click="puesto.materias.splice(puesto.materias.indexOf(materia), 1); materias.push(materia)"
|
||||
<?php } ?>
|
||||
style="cursor: pointer; transition: background-color 0.3s ease;">
|
||||
|
||||
<span class="flex-grow-1">
|
||||
{{materia.clave_materia}} - {{materia.materia_nombre}}
|
||||
</span>
|
||||
|
||||
<?php if ($user->acceso == 'w') { ?>
|
||||
<!-- Delete icon - assuming using FontAwesome, replace with your icon system if different -->
|
||||
<i class="fas fa-trash-alt text-danger ml-3" style="cursor: pointer;"></i>
|
||||
<?php } ?>
|
||||
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
@@ -192,13 +209,15 @@
|
||||
|
||||
|
||||
</div>
|
||||
<div class="card-footer d-flex justify-content-between align-items-center">
|
||||
<!-- <small class="text-muted">Última actualización: {{ puesto.lastUpdate | formatDate }}</small> -->
|
||||
<button type="button" class="btn btn-primary"
|
||||
@click="actualizarPuesto(puesto.puesto_id, puesto.materias, puesto.encargado?.usuario_id); window.scrollTo(0, 0); setTimeout(() => window.scrollTo(0, 0), 100);">
|
||||
{{ puesto.encargado ? 'Guardar cambios' : 'Guardar sin encargado' }}
|
||||
</button>
|
||||
</div>
|
||||
<?php if ($user->acceso == 'w') { ?>
|
||||
<div class="card-footer d-flex justify-content-between align-items-center">
|
||||
<!-- <small class="text-muted">Última actualización: {{ puesto.lastUpdate | formatDate }}</small> -->
|
||||
<button type="button" class="btn btn-primary"
|
||||
@click="actualizarPuesto(puesto.puesto_id, puesto.materias, puesto.encargado?.usuario_id); window.scrollTo(0, 0); setTimeout(() => window.scrollTo(0, 0), 100);">
|
||||
{{ puesto.encargado ? 'Guardar cambios' : 'Guardar sin encargado' }}
|
||||
</button>
|
||||
</div>
|
||||
<?php } ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -33,8 +33,8 @@ $write = true; //
|
||||
|
||||
$en_fecha = $db->querySingle("SELECT ESTA_EN_PERIODO(NOW()::DATE, :periodo_id)", [':periodo_id' => $user->periodo_id])['esta_en_periodo'];
|
||||
|
||||
//if($user->jefe_carrera){
|
||||
|
||||
if($user->jefe_carrera){
|
||||
//$prof_rs = $db->query('SELECT DISTINCT * FROM fs_profesores(null, null, :fac) ORDER BY PROFESOR_NOMBRE', [':fac' => $user->facultad["facultad_id"]]);
|
||||
$prof_rs = $db->query('SELECT DISTINCT PROFESOR.* FROM PUESTO_USUARIO
|
||||
JOIN PUESTO_MATERIA USING (PUESTO_ID)
|
||||
@@ -42,7 +42,12 @@ $en_fecha = $db->querySingle("SELECT ESTA_EN_PERIODO(NOW()::DATE, :periodo_id)",
|
||||
JOIN HORARIO_PROFESOR USING (HORARIO_ID)
|
||||
JOIN PROFESOR USING (PROFESOR_ID)
|
||||
WHERE USUARIO_ID = :usr', [':usr' => $user->user["id"]]);
|
||||
//}
|
||||
}else{
|
||||
$prof_rs = $db->query('SELECT DISTINCT PROFESOR.* FROM PROFESOR
|
||||
JOIN horario_profesor USING (profesor_id)
|
||||
JOIN HORARIO_VIEW USING (horario_id)
|
||||
WHERE FACULTAD_ID = :fac ORDER BY profesor.profesor_nombre', [':fac' => $user->facultad["facultad_id"]]);
|
||||
}
|
||||
|
||||
//Duraciones
|
||||
$duracion_rs = $db->query("select * from duracion order by duracion_interval");
|
||||
@@ -130,7 +135,7 @@ if(!is_null($user->periodo_id)){
|
||||
|
||||
<main class="container content marco content-margin" id="local-app">
|
||||
<?php
|
||||
if($write==true && isset($prof_rs) && count($prof_rs)>0) {?>
|
||||
if($write==true && isset($prof_rs) && count($prof_rs)>0) {?>
|
||||
<!-- Botón para abrir el modal -->
|
||||
<div class="row mb-4">
|
||||
<div class="col-12 text-right">
|
||||
@@ -241,7 +246,7 @@ if(!is_null($user->periodo_id)){
|
||||
<?php
|
||||
|
||||
//no se ha aprobado
|
||||
if($reposicion["estado_reposicion_id"] == 1){?>
|
||||
if(($reposicion["estado_reposicion_id"] == 1 && $user->jefe_carrera) || ($reposicion["estado_reposicion_id"] == 2 && !$user->jefe_carrera)){?>
|
||||
<a href="#" data-tipo="2" title="Editar" data-toggle="modal" data-target="#modal"><?php echo $ICO["editar"];?></a>
|
||||
<a href="#" data-toggle="modal" data-target="#modal_confirm" title="Borrar"><?php echo $ICO["cancelar"];?></a>
|
||||
<?php } ?>
|
||||
@@ -409,6 +414,41 @@ if(!is_null($user->periodo_id)){
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php if(!$user->jefe_carrera){//es coordinador
|
||||
$salones_rs = $db->query('SELECT * from salon_view where es_salon is true');
|
||||
?>
|
||||
<div class="row" id="salon-editar" style="display: none;">
|
||||
<div class="col-6 col-sm-4 barra-right text-right">
|
||||
<p class="font-weight-bold">Salón *</p>
|
||||
</div>
|
||||
<div class="col-6">
|
||||
<input list="lista_salones" name="dlSalon" id="dlSalon" class="form-control" placeholder="Salón">
|
||||
<div class="valid-feedback">
|
||||
Salón encontrado
|
||||
</div>
|
||||
<div class="invalid-feedback">
|
||||
Salón no encontrado
|
||||
</div>
|
||||
<datalist id="lista_salones">
|
||||
<?php
|
||||
foreach ($salones_rs as $salon) {
|
||||
extract($salon);
|
||||
$salon_json = json_decode($salon_array, true);
|
||||
if($salon_json[0]== "UNIVERSIDAD LA SALLE"){
|
||||
unset($salon_json[0]);
|
||||
}
|
||||
$salon_nombre = join(" / ",$salon_json);
|
||||
?>
|
||||
<option data-id="<?= $salon_id ?>" data-nombre="<?= $salon_nombre ?>" value="<?= $salon_nombre ?>"></option>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</datalist>
|
||||
<!-- <ul class="list-group" id="salones"></ul> -->
|
||||
<input type="hidden" id="salon" name="salon" value="">
|
||||
</div>
|
||||
</div>
|
||||
<?php } ?>
|
||||
|
||||
<div class="form-group row materia-block">
|
||||
<label for="comentario" class="col-4 col-form-label">Comentarios</label>
|
||||
@@ -821,6 +861,7 @@ if(!is_null($user->periodo_id)){
|
||||
var min = $(this).data("min");
|
||||
$("#hora_ini").val(hora)
|
||||
$("#min_ini").val(min)
|
||||
console.log("Hora reset");
|
||||
|
||||
return $.ajax({
|
||||
url: './action/asistenciasprofesor_select.php',
|
||||
@@ -859,6 +900,17 @@ if(!is_null($user->periodo_id)){
|
||||
cambiaTipo($(this).data('id'));
|
||||
$(".date-picker" ).datepicker(datepickerOptions);
|
||||
});
|
||||
$("#dlAula ul li").click(function(){//cambia datalist
|
||||
if($(this).data("id") == 1){
|
||||
$("#salon-editar").hide();
|
||||
$("#dlSalon").val("");
|
||||
$("#salon").val("");
|
||||
|
||||
}else{
|
||||
$("#salon-editar").show();
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
$('#modal_confirm').on('show.bs.modal', function (event) {
|
||||
var button = $(event.relatedTarget); // Button that triggered the modal
|
||||
@@ -952,8 +1004,8 @@ if(!is_null($user->periodo_id)){
|
||||
|
||||
//$('#salon').val(result["salon"]);
|
||||
$("#fecha_falta").val(result["fecha_clase"]);
|
||||
$('#hora_ini').val(result["hora_ini"]);
|
||||
$('#min_ini').val(result["min_ini"]);
|
||||
|
||||
|
||||
$('#comentario').val(result["comentario"]);
|
||||
$('#alumnos').val(result["alumnos"]);
|
||||
$('#ciclo').val(result["ciclo"]);
|
||||
@@ -975,6 +1027,8 @@ if(!is_null($user->periodo_id)){
|
||||
|
||||
profCarga.done(function(){
|
||||
setDatalist("#horario", result["horario"]);// No se actualiza TODO
|
||||
$('#hora_ini').val(result["hora_ini"]);
|
||||
$('#min_ini').val(result["min_ini"]);
|
||||
});
|
||||
setDatalist("#aula", result["aula"]);
|
||||
modal.modal('show');
|
||||
|
||||
20
test.php
20
test.php
@@ -13,21 +13,11 @@
|
||||
<!-- -->
|
||||
|
||||
<body style="display: block;">
|
||||
<?php
|
||||
include('include/constantes.php');
|
||||
include("import/html_header.php");
|
||||
|
||||
html_header("test.php");
|
||||
?>
|
||||
<main class="container content content-margin" id="local-app">
|
||||
<pre>
|
||||
<?= $user ?>
|
||||
</pre>
|
||||
|
||||
</main>
|
||||
<?
|
||||
include "import/html_footer.php";
|
||||
?>
|
||||
hola
|
||||
<?
|
||||
# throw an uncaught exception
|
||||
throw new Exception('Uncaught Exception');
|
||||
?>
|
||||
</body>
|
||||
<script src="js/jquery.min.js"></script>
|
||||
<script src="js/bootstrap/bootstrap.min.js"></script>
|
||||
|
||||
21
usuarios.php
21
usuarios.php
@@ -87,6 +87,17 @@ $fac = $user->facultad['facultad_id'] ?? null;
|
||||
}
|
||||
?>
|
||||
<main class="content marco">
|
||||
<?php if (($_GET['error'] ?? null) == 2) { ?>
|
||||
<div class="alert alert-danger" role="alert">
|
||||
<button type="button" class="close" data-dismiss="alert" aria-label="Close">
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
<h4 class="alert-heading">Error: Al insertar usuario. Verifica los datos.</h4>
|
||||
<p>Clave duplicada, o clave formato (ad123456)</p>
|
||||
|
||||
</div>
|
||||
<?php } ?>
|
||||
|
||||
<?php if ($user->acceso == 'w') { ?>
|
||||
<div class="row">
|
||||
<div class="col-12 text-right">
|
||||
@@ -138,7 +149,8 @@ $fac = $user->facultad['facultad_id'] ?? null;
|
||||
<li data-id="<?php echo $rol['rol_id']; ?>" class="pl-4 <?php if (isset($filter_rol) && $rol["rol_id"] == $filter_rol) {
|
||||
echo 'selected';
|
||||
} ?>">
|
||||
<?php echo $rol['rol_titulo']; ?></li>
|
||||
<?php echo $rol['rol_titulo']; ?>
|
||||
</li>
|
||||
<?php } ?>
|
||||
</ul>
|
||||
<input type="hidden" id="filter_rol" name="rol" value="">
|
||||
@@ -277,7 +289,8 @@ $fac = $user->facultad['facultad_id'] ?? null;
|
||||
<span class="ing-buscar icono"></span>
|
||||
<ul style="display:none">
|
||||
<?php foreach ($fs_roles as $rol) { ?>
|
||||
<li data-id="<?= $rol['rol_id'] ?>" class="pl-4"><?= $rol['rol_titulo'] ?>
|
||||
<li data-id="<?= $rol['rol_id'] ?>" class="pl-4">
|
||||
<?= $rol['rol_titulo'] ?>
|
||||
</li>
|
||||
<?php } ?>
|
||||
</ul>
|
||||
@@ -295,7 +308,9 @@ $fac = $user->facultad['facultad_id'] ?? null;
|
||||
<ul style="display:none">
|
||||
<li data-id="" class="pl-4">General</li>
|
||||
<?php foreach ($fs_facultades as $facultad) { ?>
|
||||
<li data-id="<?= $facultad['facultad_id'] ?>" class="pl-4"><?= $facultad['facultad_nombre'] ?></li>
|
||||
<li data-id="<?= $facultad['facultad_id'] ?>" class="pl-4">
|
||||
<?= $facultad['facultad_nombre'] ?>
|
||||
</li>
|
||||
<?php } ?>
|
||||
</ul>
|
||||
<input type="hidden" id="dlfacultad" name="dlfacultad" value="">
|
||||
|
||||
Reference in New Issue
Block a user