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,7 +14,7 @@ if ($db->where('usuario_clave', $_POST['mclave'])->has('usuario')) {
|
|||||||
header("Location: ../usuarios.php?error=1");
|
header("Location: ../usuarios.php?error=1");
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
|
try {
|
||||||
$db->insert('usuario', [
|
$db->insert('usuario', [
|
||||||
'usuario_nombre' => mb_strtoupper($_POST['mnombre']),
|
'usuario_nombre' => mb_strtoupper($_POST['mnombre']),
|
||||||
'usuario_correo' => $_POST['mcorreo'],
|
'usuario_correo' => $_POST['mcorreo'],
|
||||||
@@ -22,5 +22,8 @@ $db->insert('usuario', [
|
|||||||
'rol_id' => $_POST['mrol'] ?? null,
|
'rol_id' => $_POST['mrol'] ?? null,
|
||||||
'facultad_id' => empty($facultad) ? null : $facultad,
|
'facultad_id' => empty($facultad) ? null : $facultad,
|
||||||
]);
|
]);
|
||||||
|
|
||||||
header("Location: ../usuarios.php", true, 307);
|
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;
|
$periodo_id = $user->periodo_id;
|
||||||
if (is_null($user->facultad['facultad_id'])) {
|
if (is_null($user->facultad['facultad_id'])) {
|
||||||
$periodos = $db
|
$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')
|
->join('nivel', 'nivel.nivel_id = periodo.nivel_id')
|
||||||
->orderBy('periodo_id')
|
->orderBy('periodo_id')
|
||||||
->get('periodo', null, 'periodo.*, nivel_nombre as nivel');
|
->get('periodo', null, 'periodo.*, nivel_nombre as nivel');
|
||||||
@@ -25,8 +25,8 @@ try {
|
|||||||
"SELECT DISTINCT periodo.*, nivel_nombre as nivel FROM periodo
|
"SELECT DISTINCT periodo.*, nivel_nombre as nivel FROM periodo
|
||||||
JOIN horario_view USING (periodo_id)
|
JOIN horario_view USING (periodo_id)
|
||||||
JOIN nivel ON nivel.nivel_id = periodo.nivel_id
|
JOIN nivel ON nivel.nivel_id = periodo.nivel_id
|
||||||
WHERE CURRENT_DATE BETWEEN periodo.periodo_fecha_inicio AND periodo.periodo_fecha_fin
|
WHERE /*CURRENT_DATE BETWEEN periodo.periodo_fecha_inicio AND periodo.periodo_fecha_fin
|
||||||
AND facultad_id = :facultad_id
|
AND */facultad_id = :facultad_id
|
||||||
ORDER BY periodo_id
|
ORDER BY periodo_id
|
||||||
",
|
",
|
||||||
['facultad_id' => $user->facultad['facultad_id']]
|
['facultad_id' => $user->facultad['facultad_id']]
|
||||||
|
|||||||
@@ -53,13 +53,12 @@ try {
|
|||||||
$data = array_column($db->query(
|
$data = array_column($db->query(
|
||||||
"WITH fechas AS (
|
"WITH fechas AS (
|
||||||
SELECT
|
SELECT
|
||||||
fcc.registro_fecha_ideal,
|
h.horario_id,
|
||||||
fcc.horario_id,
|
fechas_clase(h.horario_id, true) AS registro_fecha_ideal,
|
||||||
hp.profesor_id
|
hp.profesor_id
|
||||||
FROM fechas_clase_cache fcc
|
FROM horario h
|
||||||
JOIN horario_profesor hp USING (horario_id)
|
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 hp.profesor_id <> 0
|
||||||
WHERE (h.PERIODO_ID, h.FACULTAD_ID) = (:periodo_id, :facultad_id) and profesor_id <> 0
|
|
||||||
),
|
),
|
||||||
asistencia_faltas AS (
|
asistencia_faltas AS (
|
||||||
SELECT
|
SELECT
|
||||||
@@ -97,7 +96,8 @@ try {
|
|||||||
FROM asistencia_faltas_con_porcentaje afcp
|
FROM asistencia_faltas_con_porcentaje afcp
|
||||||
JOIN profesor p USING (profesor_id)
|
JOIN profesor p USING (profesor_id)
|
||||||
WHERE $filter
|
WHERE $filter
|
||||||
ORDER BY afcp.porcentaje DESC",
|
ORDER BY afcp.porcentaje DESC;
|
||||||
|
",
|
||||||
[
|
[
|
||||||
'periodo_id' => $user->periodo_id,
|
'periodo_id' => $user->periodo_id,
|
||||||
'facultad_id' => $facultad,
|
'facultad_id' => $facultad,
|
||||||
|
|||||||
@@ -15,7 +15,6 @@ try {
|
|||||||
case 'GET':
|
case 'GET':
|
||||||
// Fetch all puestos
|
// Fetch all puestos
|
||||||
$facultad_id = $user->facultad['facultad_id'] ?? -1;
|
$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(
|
$puestos = array_map(
|
||||||
fn($p) => array(
|
fn($p) => array(
|
||||||
...$p,
|
...$p,
|
||||||
@@ -28,7 +27,7 @@ try {
|
|||||||
),
|
),
|
||||||
$db->orderBy('puesto.nombre', 'desc')
|
$db->orderBy('puesto.nombre', 'desc')
|
||||||
->where('facultad_id', $facultad_id)
|
->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);
|
echo json_encode($puestos);
|
||||||
break;
|
break;
|
||||||
|
|||||||
@@ -153,7 +153,7 @@ switch($edo){
|
|||||||
case 4://Correo a coordinador, profesor y jefe
|
case 4://Correo a coordinador, profesor y jefe
|
||||||
$asunto = "Reposición declinada - ".$reposicion_rs["materia"];
|
$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>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);
|
$to = join(",", $coord_correos).",".join(",", $prof_correos).",".join(",", $jefe_correos);
|
||||||
$ok = 1;
|
$ok = 1;
|
||||||
break;
|
break;
|
||||||
@@ -166,12 +166,13 @@ if($to!= "" && ENVIO_CORREOS){
|
|||||||
</body>';
|
</body>';
|
||||||
|
|
||||||
require_once('../include/phpmailer/PHPMailerAutoload.php');
|
require_once('../include/phpmailer/PHPMailerAutoload.php');
|
||||||
if($_ENV['DB_NAME'] == "paad_pruebas"){
|
/*if($_ENV['DB_NAME'] == "paad_pruebas"){
|
||||||
$asunto = "PRUEBAS-".$asunto;
|
$asunto = "PRUEBAS-".$asunto;
|
||||||
Mailer::enviarCorreo("alejandro.lara@lasalle.mx", $asunto, $texto, true);
|
Mailer::enviarCorreo("alejandro.lara@lasalle.mx", $asunto, $texto, true);
|
||||||
}else{
|
}else{
|
||||||
Mailer::enviarCorreo($to, $asunto, $texto, true);
|
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);//
|
$bloque = filter_input(INPUT_POST, "bloque", FILTER_SANITIZE_NUMBER_INT);//
|
||||||
$ciclo = filter_input(INPUT_POST, "ciclo", 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_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
|
$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
|
$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
|
$hor = filter_input(INPUT_POST, "horario", FILTER_SANITIZE_NUMBER_INT);//limpia texto
|
||||||
$alumnos = filter_input(INPUT_POST, "alumnos", 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
|
$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
|
$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"]))
|
if(empty($_POST["prof"]))
|
||||||
$prof = $user["id"];
|
$prof = $user["id"];
|
||||||
else
|
else
|
||||||
$prof = filter_input(INPUT_POST, "prof", FILTER_SANITIZE_NUMBER_INT);//limpia texto
|
$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
|
$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
|
//Obtiene correo
|
||||||
$correos_rs = $db->querySingle('SELECT coor.usuario_correo, coor.usuario_nombre from usuario coor where rol_id = :rol_coord and facultad_id = (
|
$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 ){
|
if( count($correos_rs) > 0 ){
|
||||||
$to = $correos_rs["usuario_correo"];
|
$to = $correos_rs["usuario_correo"];
|
||||||
@@ -108,20 +112,33 @@ if($tipo == 1){//Reposición
|
|||||||
}
|
}
|
||||||
|
|
||||||
try{
|
try{
|
||||||
|
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)',
|
$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,
|
[':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"],
|
':prof' => $prof, ':desc' => $comentario, ':alumnos' => $alumnos, ':aula' => $aula, ':duracion' => $duracion_tiempo, ':usr'=>$user->user["id"],
|
||||||
':bloque' => $bloque, ':ciclo' => $ciclo
|
':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){
|
}catch(Exception $e){
|
||||||
|
|
||||||
echo $e->getMessage();
|
echo $e->getMessage();
|
||||||
//header("Location: ".$pag."?error=1");
|
//header("Location: ".$pag."?error=1");
|
||||||
exit();
|
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>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>";
|
$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
|
}else{//Cambio salón / hora
|
||||||
|
|
||||||
try{
|
try{
|
||||||
|
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)',
|
$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,
|
[':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"],
|
':prof' => $prof, ':desc' => $comentario, ':alumnos' => $alumnos, ':aula' => $aula, ':duracion' => $duracion_tiempo, ':usr'=>$user->user["id"],
|
||||||
':bloque' => $bloque, ':ciclo' => $ciclo
|
':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){
|
}catch(Exception $e){
|
||||||
|
|
||||||
header("Location: ".$pag."?error=1");
|
header("Location: ".$pag."?error=1");
|
||||||
exit();
|
exit();
|
||||||
}
|
}
|
||||||
$texto = "<p>Se creó un cambio de salón nuevo.</p>";
|
$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>";
|
$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){
|
if($to!= "" && ENVIO_CORREOS){
|
||||||
$asunto = "Reposición nueva - solicitud";
|
$asunto = "Reposición nueva - solicitud";
|
||||||
//crear plantilla
|
//crear plantilla
|
||||||
@@ -166,14 +191,15 @@ if($to!= "" && ENVIO_CORREOS){
|
|||||||
</body>';
|
</body>';
|
||||||
|
|
||||||
require_once('../include/phpmailer/PHPMailerAutoload.php');
|
require_once('../include/phpmailer/PHPMailerAutoload.php');
|
||||||
if($_ENV['DB_NAME'] == "paad_pruebas"){
|
/*if($_ENV['DB_NAME'] == "paad_pruebas"){
|
||||||
$asunto = "PRUEBAS-".$asunto;
|
$asunto = "PRUEBAS-".$asunto;
|
||||||
Mailer::enviarCorreo("alejandro.lara@lasalle.mx", $asunto, $texto, true);
|
Mailer::enviarCorreo("alejandro.lara@lasalle.mx", $asunto, $texto, true);
|
||||||
}else{
|
}else{
|
||||||
Mailer::enviarCorreo($to, $asunto, $texto, true);
|
Mailer::enviarCorreo($to, $asunto, $texto, true);
|
||||||
}
|
}*/
|
||||||
|
Mailer::enviarCorreo("alejandro.rosales@lasalle.mx", $asunto, $texto, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
exit();
|
|
||||||
header("Location: ".$pag."?ok=0");
|
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
|
$id = filter_input(INPUT_POST, "id", FILTER_SANITIZE_NUMBER_INT);//limpia texto
|
||||||
|
|
||||||
try{
|
try{
|
||||||
|
if($user->jefe_carrera){
|
||||||
$rs = $db->query('SELECT * FROM fs_materiasprofesor(:id, :jefe)', [':id' => $id, ':jefe'=>$user->user["id"]] );
|
$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){
|
}catch(Exception $e){
|
||||||
$return["error"] = "Ocurrió un error al leer los datos de las materias.";
|
$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
|
//Valida que profesor no este en 2 reposiciones al mismo tiempo
|
||||||
*/
|
*/
|
||||||
$traslape = $db->querySingle('SELECT * from traslape_profesor_reposicion(:prof, :fecha, :hora, :dur)',
|
$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]
|
[':prof' => $prof, ':fecha'=>DateTime::createFromFormat('d/m/Y', $fecha)->format('Y-m-d'), ':hora'=>$hora, ':dur'=>$duracion_tiempo, ':id'=>$id]
|
||||||
)["traslape_profesor_reposicion"];
|
)["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){
|
if($traslape){
|
||||||
//header("Location:".$pag."?error=9");
|
//header("Location:".$pag."?error=9");
|
||||||
echo "traslape";
|
echo "traslape";
|
||||||
@@ -104,7 +105,7 @@ if($tipo == 1){//Reposición
|
|||||||
}
|
}
|
||||||
|
|
||||||
try{
|
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,
|
[':id'=> $id, ':f_falta' => $fecha_falta, ':f_nueva' => $fecha_new, ':hora_nueva' => $hora,
|
||||||
':desc' => $comentario, ':alumnos' => $alumnos, ':aula' => $aula, ':duracion' => $duracion_tiempo
|
':desc' => $comentario, ':alumnos' => $alumnos, ':aula' => $aula, ':duracion' => $duracion_tiempo
|
||||||
]
|
]
|
||||||
@@ -112,7 +113,7 @@ try{
|
|||||||
}catch(Exception $e){
|
}catch(Exception $e){
|
||||||
//header("Location: ".$pag."?error=2");
|
//header("Location: ".$pag."?error=2");
|
||||||
print_r($e->getMessage());
|
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(
|
print_r(
|
||||||
[':id'=> $id, ':f_falta' => $fecha_falta, ':f_nueva' => $fecha_new, ':hora_nueva' => $hora,
|
[':id'=> $id, ':f_falta' => $fecha_falta, ':f_nueva' => $fecha_new, ':hora_nueva' => $hora,
|
||||||
':desc' => $comentario, ':alumnos' => $alumnos, ':aula' => $aula, ':duracion' => $duracion_tiempo
|
':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 * FROM fs_profesores(null, null, :fac) ORDER BY PROFESOR_NOMBRE', [':fac' => $user->facultad["facultad_id"]]);
|
||||||
$prof_rs = $db->query('SELECT DISTINCT PROFESOR.* FROM PROFESOR
|
$prof_rs = $db->query('SELECT DISTINCT PROFESOR.* FROM PROFESOR
|
||||||
JOIN HORARIO_VIEW USING (PROFESOR_ID_ID)
|
JOIN horario_profesor USING (profesor_id)
|
||||||
WHERE FACULTAD_ID = :fac', [':fac' => $user->facultad["facultad_id"]]);
|
JOIN HORARIO_VIEW USING (horario_id)
|
||||||
|
WHERE FACULTAD_ID = :fac ORDER BY profesor.profesor_nombre', [':fac' => $user->facultad["facultad_id"]]);
|
||||||
//}
|
//}
|
||||||
|
|
||||||
//Duraciones
|
//Duraciones
|
||||||
@@ -51,13 +52,14 @@ if(!is_null($user->periodo_id)){
|
|||||||
if(strtotime($periodo_rs["periodo_fecha_inicio"])>strtotime(date("Y-m-d")) )
|
if(strtotime($periodo_rs["periodo_fecha_inicio"])>strtotime(date("Y-m-d")) )
|
||||||
$fecha_man = date("d/m/Y", strtotime($periodo_rs["periodo_fecha_inicio"]));
|
$fecha_man = date("d/m/Y", strtotime($periodo_rs["periodo_fecha_inicio"]));
|
||||||
else{
|
else{
|
||||||
|
$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;
|
$dias=3;
|
||||||
if( intval(date("w")) >=3 && intval(date("w"))<=5 )//Mie a Vie
|
else if( $dia_actual ==0 )//Do
|
||||||
$dias+=3;
|
$dias=2;
|
||||||
else if( intval(date("w")) ==6 )//Sab
|
|
||||||
$dias+=2;
|
|
||||||
else if( intval(date("w")) ==0 )//Do
|
|
||||||
$dias+=1;
|
|
||||||
|
|
||||||
$fecha_man = date("d/m/Y", strtotime("+".$dias." day"));
|
$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 -->
|
<!-- Botón para abrir el modal -->
|
||||||
<div class="row mb-4">
|
<div class="row mb-4">
|
||||||
<div class="col-12 text-right">
|
<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>
|
||||||
</div>
|
</div>
|
||||||
<?php }?>
|
<?php }?>
|
||||||
@@ -164,7 +166,6 @@ if(!is_null($user->periodo_id)){
|
|||||||
</form>
|
</form>
|
||||||
|
|
||||||
<?php
|
<?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"]]);
|
$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 >
|
<tr >
|
||||||
<th>Estado</th>
|
<th>Estado</th>
|
||||||
<th>Responsable</th>
|
<th>Responsable</th>
|
||||||
<th style="width:160px">Fecha falta</th>
|
<th style="width:160px">Fecha solicitada</th>
|
||||||
<th style="width:160px">Fecha reposición</th>
|
|
||||||
<th style="width:160px">Duración</th>
|
<th style="width:160px">Duración</th>
|
||||||
<th>Salón</th>
|
<th>Salón</th>
|
||||||
<?php if($write){ ?><th>Acciones</th><?php } ?>
|
<?php if($write){ ?><th>Acciones</th><?php } ?>
|
||||||
@@ -207,11 +207,7 @@ if(!is_null($user->periodo_id)){
|
|||||||
</div>
|
</div>
|
||||||
<?php } ?>
|
<?php } ?>
|
||||||
</td>
|
</td>
|
||||||
<td class="align-middle"><?php echo $reposicion["materia_nombre"]; ?></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_clase"]))."<br>".substr($reposicion["horario_hora"],0,-3)." a ".substr($reposicion["horario_hora_fin"],0,-3)." hrs.";;
|
|
||||||
?>
|
|
||||||
</td>
|
|
||||||
<td class="align-middle text-center"><?php
|
<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.";
|
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
|
<?php
|
||||||
|
|
||||||
//no se ha aprobado
|
//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-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>
|
<a href="#" data-toggle="modal" data-target="#modal_confirm" title="Borrar"><?php echo $ICO["cancelar"];?></a>
|
||||||
<?php } ?>
|
<?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-dialog modal-dialog-centered modal-xl" role="document">
|
||||||
<div class="modal-content">
|
<div class="modal-content">
|
||||||
<div class="modal-header">
|
<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">
|
<button type="button" class="close text-white" data-dismiss="modal" aria-label="Close">
|
||||||
<span aria-hidden="true">×</span>
|
<span aria-hidden="true">×</span>
|
||||||
</button></h4>
|
</button></h4>
|
||||||
@@ -294,20 +290,6 @@ if(!is_null($user->periodo_id)){
|
|||||||
</div>
|
</div>
|
||||||
<div class="form-box prof-selected">
|
<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">
|
<div class="form-group row materia-block">
|
||||||
<label for="duracion" class="col-4 col-form-label">Duración</label>
|
<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>
|
<label for="fecha_inicial" class="col-4 col-form-label">Fecha de asignación *</label>
|
||||||
<div class="col-8">
|
<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="">
|
<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.
|
Recuerda que en sábado el límite para terminar la clase es a las 15:00hrs.
|
||||||
</small>
|
</small>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group row materia-block">
|
<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
|
<?php
|
||||||
//define("HORA_FINAL", 22);
|
//define("HORA_FINAL", 22);
|
||||||
//define("FRACCION_HORA", 15);
|
//define("FRACCION_HORA", 15);
|
||||||
@@ -404,7 +386,7 @@ if(!is_null($user->periodo_id)){
|
|||||||
<div class="modal-body">
|
<div class="modal-body">
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col">
|
<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>
|
<p>Esta acción no se puede deshacer.</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -555,26 +537,7 @@ if(!is_null($user->periodo_id)){
|
|||||||
return !error;
|
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(){
|
$(document).ready(function(){
|
||||||
$(".prof-selected").hide();
|
$(".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) {
|
$('#modal_confirm').on('show.bs.modal', function (event) {
|
||||||
var button = $(event.relatedTarget); // Button that triggered the modal
|
var button = $(event.relatedTarget); // Button that triggered the modal
|
||||||
@@ -732,7 +691,7 @@ if(!is_null($user->periodo_id)){
|
|||||||
$("#errorBox_text").html("");
|
$("#errorBox_text").html("");
|
||||||
if(tipo == 1){//alta
|
if(tipo == 1){//alta
|
||||||
$("#submitBtn").data('tipo', 1);
|
$("#submitBtn").data('tipo', 1);
|
||||||
$("#modalLabel").html("Crear Reposición");
|
$("#modalLabel").html("Solicitar Asignación");
|
||||||
modal.find("input[type=text]").val("");
|
modal.find("input[type=text]").val("");
|
||||||
modal.find("#alumnos").val("15");
|
modal.find("#alumnos").val("15");
|
||||||
$("#plan").attr("readonly", false);
|
$("#plan").attr("readonly", false);
|
||||||
@@ -751,7 +710,7 @@ if(!is_null($user->periodo_id)){
|
|||||||
|
|
||||||
}else{//editar
|
}else{//editar
|
||||||
$("#submitBtn").data('tipo', 2);
|
$("#submitBtn").data('tipo', 2);
|
||||||
$("#modalLabel").html("Editar Reposición");
|
$("#modalLabel").html("Editar solicitud");
|
||||||
$("#plan").attr("readonly", true);
|
$("#plan").attr("readonly", true);
|
||||||
$("#sem").attr("readonly", true);
|
$("#sem").attr("readonly", true);
|
||||||
$("#gpo").attr("readonly", true);
|
$("#gpo").attr("readonly", true);
|
||||||
@@ -820,7 +779,7 @@ if(!is_null($user->periodo_id)){
|
|||||||
})
|
})
|
||||||
</script>
|
</script>
|
||||||
<script src="js/messages.js"></script>
|
<script src="js/messages.js"></script>
|
||||||
<script type="module" src="js/reposiciones.js"></script>
|
|
||||||
</body>
|
</body>
|
||||||
|
|
||||||
</html>
|
</html>
|
||||||
@@ -38,7 +38,7 @@ class Login
|
|||||||
return match ($property) {
|
return match ($property) {
|
||||||
'acceso' => $this->access(),
|
'acceso' => $this->access(),
|
||||||
'profesor' => $db->where('profesor_clave', preg_replace('/\D/', '', $this->user['clave']))->getOne("profesor")['profesor_id'] ?? null,
|
'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"],
|
'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"],
|
'admin' => $this->es_usuario() and $db->where('usuario_id', $this->user["id"])->getOne('usuario')["usuario_admin"],
|
||||||
'facultad' => $this->es_usuario()
|
'facultad' => $this->es_usuario()
|
||||||
|
|||||||
@@ -131,9 +131,28 @@ $write = $user->admin || in_array($user->acceso, ['r']);
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<hr>
|
<hr>
|
||||||
<div id="btn-excel-horario" class="mb-2 float-right hidden">
|
<div id="btn-excel-horario" class="mb-2 float-right hidden" v-if="horarios.data.length > 0">
|
||||||
<button class="btn btn-outline-secondary " title="Exportar a Excel" v-if="false">
|
<button class="btn btn-outline-secondary " title="Imprimir PDF" @click="
|
||||||
<span class="ing-descarga ing-fw"></span> Exportar a Excel
|
// 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>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
<div class="table-responsive" v-if="horarios.data.length > 0">
|
<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']; ?>
|
<?= $user->facultad['facultad']; ?>
|
||||||
</i>
|
</i>
|
||||||
<small>
|
<small>
|
||||||
<?= $user->rol['rol']; ?>
|
<?= $user->rol['rol'] ?? 'General' ?>
|
||||||
</small>
|
</small>
|
||||||
</h3>
|
</h3>
|
||||||
<hr>
|
<hr>
|
||||||
|
|||||||
27
puestos.php
27
puestos.php
@@ -66,21 +66,25 @@
|
|||||||
:aria-controls="`puesto-${puesto.puesto_id}`">
|
:aria-controls="`puesto-${puesto.puesto_id}`">
|
||||||
{{puesto.nombre}}
|
{{puesto.nombre}}
|
||||||
</button>
|
</button>
|
||||||
|
<?php if ($user->acceso == 'w') { ?>
|
||||||
<button type="button" class="btn btn-outline-light" data-target="#eliminar-puesto"
|
<button type="button" class="btn btn-outline-light" data-target="#eliminar-puesto"
|
||||||
data-toggle="modal" @click="to_delete = puesto">
|
data-toggle="modal" @click="to_delete = puesto">
|
||||||
<i class="fas fa-trash-alt"></i>
|
<i class="fas fa-trash-alt"></i>
|
||||||
</button>
|
</button>
|
||||||
|
<?php } ?>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div :id="`puesto-${puesto.puesto_id}`" class="collapse"
|
<div :id="`puesto-${puesto.puesto_id}`" class="collapse"
|
||||||
:aria-labelledby="`puesto-${puesto.nombre}`" data-parent="#puestos">
|
:aria-labelledby="`puesto-${puesto.nombre}`" data-parent="#puestos">
|
||||||
<div class="card-body">
|
<div class="card-body">
|
||||||
<!-- Encargado -->
|
<!-- Encargado -->
|
||||||
|
|
||||||
<div class="form-row justify-content-around align-items-center mb-2">
|
<div class="form-row justify-content-around align-items-center mb-2">
|
||||||
<label :for="`encargado-${puesto.puesto_id}`" class="col-2 barra-right">
|
<label :for="`encargado-${puesto.puesto_id}`" class="col-2 barra-right">
|
||||||
Encargado del área
|
Encargado del área
|
||||||
|
<!-- $user->lectura && $user->escritura && $user->none -->
|
||||||
</label>
|
</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">
|
<div class="datalist-input" v-if="puesto.encargado">
|
||||||
({{puesto.encargado.usuario_clave}}) {{ puesto.encargado.usuario_nombre }}
|
({{puesto.encargado.usuario_clave}}) {{ puesto.encargado.usuario_nombre }}
|
||||||
</div>
|
</div>
|
||||||
@@ -101,6 +105,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<hr>
|
<hr>
|
||||||
|
|
||||||
|
<?php if ($user->acceso == 'w') { ?>
|
||||||
<div class="form-row justify-content-around align-items-center mb-2"
|
<div class="form-row justify-content-around align-items-center mb-2"
|
||||||
v-show="carreras.length">
|
v-show="carreras.length">
|
||||||
<label :for="`carrera-${puesto.puesto_id}`" class="col-2 barra-right">
|
<label :for="`carrera-${puesto.puesto_id}`" class="col-2 barra-right">
|
||||||
@@ -125,6 +130,7 @@
|
|||||||
<input type="hidden" id="carrera_id" name="id">
|
<input type="hidden" id="carrera_id" name="id">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="form-row justify-content-around align-items-center"
|
<div class="form-row justify-content-around align-items-center"
|
||||||
v-scope="{to_add_materia: null}">
|
v-scope="{to_add_materia: null}">
|
||||||
<label :for="`materias-${puesto.puesto_id}`" class="col-2 barra-right">
|
<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))"
|
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}`">
|
:value="`${materia.clave_materia} - ${materia.materia_nombre}`">
|
||||||
</datalist>
|
</datalist>
|
||||||
|
<?php } ?>
|
||||||
|
|
||||||
<hr>
|
<hr>
|
||||||
<style>
|
<style>
|
||||||
.list-group-item-action:hover {
|
.list-group-item-action:hover {
|
||||||
|
<?php if ($user->acceso == 'w') { ?>
|
||||||
background-color: rgba(255, 0, 0, 0.1);
|
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 {
|
.list-group-item-action:active {
|
||||||
|
<?php if ($user->acceso == 'w') { ?>
|
||||||
background-color: rgba(255, 0, 0, 0.2);
|
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>
|
</style>
|
||||||
<fieldset class="container mt-4">
|
<fieldset class="container mt-4">
|
||||||
@@ -172,15 +185,19 @@
|
|||||||
style="max-height: 250px; overflow-y: auto;">
|
style="max-height: 250px; overflow-y: auto;">
|
||||||
<li class="list-group-item list-group-item-action d-flex justify-content-between align-items-center"
|
<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"
|
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)"
|
@click="puesto.materias.splice(puesto.materias.indexOf(materia), 1); materias.push(materia)"
|
||||||
|
<?php } ?>
|
||||||
style="cursor: pointer; transition: background-color 0.3s ease;">
|
style="cursor: pointer; transition: background-color 0.3s ease;">
|
||||||
|
|
||||||
<span class="flex-grow-1">
|
<span class="flex-grow-1">
|
||||||
{{materia.clave_materia}} - {{materia.materia_nombre}}
|
{{materia.clave_materia}} - {{materia.materia_nombre}}
|
||||||
</span>
|
</span>
|
||||||
|
<?php if ($user->acceso == 'w') { ?>
|
||||||
<!-- Delete icon - assuming using FontAwesome, replace with your icon system if different -->
|
<!-- 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>
|
<i class="fas fa-trash-alt text-danger ml-3" style="cursor: pointer;"></i>
|
||||||
|
<?php } ?>
|
||||||
|
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
@@ -192,6 +209,7 @@
|
|||||||
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
<?php if ($user->acceso == 'w') { ?>
|
||||||
<div class="card-footer d-flex justify-content-between align-items-center">
|
<div class="card-footer d-flex justify-content-between align-items-center">
|
||||||
<!-- <small class="text-muted">Última actualización: {{ puesto.lastUpdate | formatDate }}</small> -->
|
<!-- <small class="text-muted">Última actualización: {{ puesto.lastUpdate | formatDate }}</small> -->
|
||||||
<button type="button" class="btn btn-primary"
|
<button type="button" class="btn btn-primary"
|
||||||
@@ -199,6 +217,7 @@
|
|||||||
{{ puesto.encargado ? 'Guardar cambios' : 'Guardar sin encargado' }}
|
{{ puesto.encargado ? 'Guardar cambios' : 'Guardar sin encargado' }}
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
|
<?php } ?>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</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'];
|
$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 * 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
|
$prof_rs = $db->query('SELECT DISTINCT PROFESOR.* FROM PUESTO_USUARIO
|
||||||
JOIN PUESTO_MATERIA USING (PUESTO_ID)
|
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 HORARIO_PROFESOR USING (HORARIO_ID)
|
||||||
JOIN PROFESOR USING (PROFESOR_ID)
|
JOIN PROFESOR USING (PROFESOR_ID)
|
||||||
WHERE USUARIO_ID = :usr', [':usr' => $user->user["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
|
//Duraciones
|
||||||
$duracion_rs = $db->query("select * from duracion order by duracion_interval");
|
$duracion_rs = $db->query("select * from duracion order by duracion_interval");
|
||||||
@@ -241,7 +246,7 @@ if(!is_null($user->periodo_id)){
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
//no se ha aprobado
|
//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-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>
|
<a href="#" data-toggle="modal" data-target="#modal_confirm" title="Borrar"><?php echo $ICO["cancelar"];?></a>
|
||||||
<?php } ?>
|
<?php } ?>
|
||||||
@@ -409,6 +414,41 @@ if(!is_null($user->periodo_id)){
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</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">
|
<div class="form-group row materia-block">
|
||||||
<label for="comentario" class="col-4 col-form-label">Comentarios</label>
|
<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");
|
var min = $(this).data("min");
|
||||||
$("#hora_ini").val(hora)
|
$("#hora_ini").val(hora)
|
||||||
$("#min_ini").val(min)
|
$("#min_ini").val(min)
|
||||||
|
console.log("Hora reset");
|
||||||
|
|
||||||
return $.ajax({
|
return $.ajax({
|
||||||
url: './action/asistenciasprofesor_select.php',
|
url: './action/asistenciasprofesor_select.php',
|
||||||
@@ -859,6 +900,17 @@ if(!is_null($user->periodo_id)){
|
|||||||
cambiaTipo($(this).data('id'));
|
cambiaTipo($(this).data('id'));
|
||||||
$(".date-picker" ).datepicker(datepickerOptions);
|
$(".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) {
|
$('#modal_confirm').on('show.bs.modal', function (event) {
|
||||||
var button = $(event.relatedTarget); // Button that triggered the modal
|
var button = $(event.relatedTarget); // Button that triggered the modal
|
||||||
@@ -952,8 +1004,8 @@ if(!is_null($user->periodo_id)){
|
|||||||
|
|
||||||
//$('#salon').val(result["salon"]);
|
//$('#salon').val(result["salon"]);
|
||||||
$("#fecha_falta").val(result["fecha_clase"]);
|
$("#fecha_falta").val(result["fecha_clase"]);
|
||||||
$('#hora_ini').val(result["hora_ini"]);
|
|
||||||
$('#min_ini').val(result["min_ini"]);
|
|
||||||
$('#comentario').val(result["comentario"]);
|
$('#comentario').val(result["comentario"]);
|
||||||
$('#alumnos').val(result["alumnos"]);
|
$('#alumnos').val(result["alumnos"]);
|
||||||
$('#ciclo').val(result["ciclo"]);
|
$('#ciclo').val(result["ciclo"]);
|
||||||
@@ -975,6 +1027,8 @@ if(!is_null($user->periodo_id)){
|
|||||||
|
|
||||||
profCarga.done(function(){
|
profCarga.done(function(){
|
||||||
setDatalist("#horario", result["horario"]);// No se actualiza TODO
|
setDatalist("#horario", result["horario"]);// No se actualiza TODO
|
||||||
|
$('#hora_ini').val(result["hora_ini"]);
|
||||||
|
$('#min_ini').val(result["min_ini"]);
|
||||||
});
|
});
|
||||||
setDatalist("#aula", result["aula"]);
|
setDatalist("#aula", result["aula"]);
|
||||||
modal.modal('show');
|
modal.modal('show');
|
||||||
|
|||||||
16
test.php
16
test.php
@@ -13,20 +13,10 @@
|
|||||||
<!-- -->
|
<!-- -->
|
||||||
|
|
||||||
<body style="display: block;">
|
<body style="display: block;">
|
||||||
<?php
|
hola
|
||||||
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";
|
# throw an uncaught exception
|
||||||
|
throw new Exception('Uncaught Exception');
|
||||||
?>
|
?>
|
||||||
</body>
|
</body>
|
||||||
<script src="js/jquery.min.js"></script>
|
<script src="js/jquery.min.js"></script>
|
||||||
|
|||||||
21
usuarios.php
21
usuarios.php
@@ -87,6 +87,17 @@ $fac = $user->facultad['facultad_id'] ?? null;
|
|||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
<main class="content marco">
|
<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') { ?>
|
<?php if ($user->acceso == 'w') { ?>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-12 text-right">
|
<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) {
|
<li data-id="<?php echo $rol['rol_id']; ?>" class="pl-4 <?php if (isset($filter_rol) && $rol["rol_id"] == $filter_rol) {
|
||||||
echo 'selected';
|
echo 'selected';
|
||||||
} ?>">
|
} ?>">
|
||||||
<?php echo $rol['rol_titulo']; ?></li>
|
<?php echo $rol['rol_titulo']; ?>
|
||||||
|
</li>
|
||||||
<?php } ?>
|
<?php } ?>
|
||||||
</ul>
|
</ul>
|
||||||
<input type="hidden" id="filter_rol" name="rol" value="">
|
<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>
|
<span class="ing-buscar icono"></span>
|
||||||
<ul style="display:none">
|
<ul style="display:none">
|
||||||
<?php foreach ($fs_roles as $rol) { ?>
|
<?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>
|
</li>
|
||||||
<?php } ?>
|
<?php } ?>
|
||||||
</ul>
|
</ul>
|
||||||
@@ -295,7 +308,9 @@ $fac = $user->facultad['facultad_id'] ?? null;
|
|||||||
<ul style="display:none">
|
<ul style="display:none">
|
||||||
<li data-id="" class="pl-4">General</li>
|
<li data-id="" class="pl-4">General</li>
|
||||||
<?php foreach ($fs_facultades as $facultad) { ?>
|
<?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 } ?>
|
<?php } ?>
|
||||||
</ul>
|
</ul>
|
||||||
<input type="hidden" id="dlfacultad" name="dlfacultad" value="">
|
<input type="hidden" id="dlfacultad" name="dlfacultad" value="">
|
||||||
|
|||||||
Reference in New Issue
Block a user