Stable 2-ago-2023
This commit is contained in:
@@ -2,4 +2,5 @@
|
||||
<link rel="stylesheet" href="css/bootstrap-ulsa.min.css" type="text/css">
|
||||
<link rel="stylesheet" href="css/indivisa.css" type="text/css">
|
||||
<link rel="stylesheet" href="css/sgi.css?rand=<?php echo rand(); ?>" type="text/css">
|
||||
<link rel="stylesheet" href="css/style.css">
|
||||
<link rel="stylesheet" href="css/style.css">
|
||||
<link rel="stylesheet" href="css/jquery-ui.css">
|
||||
@@ -6,8 +6,12 @@ require_once 'class/c_login.php';
|
||||
$ruta = "../";
|
||||
require_once 'include/bd_pdo.php';
|
||||
|
||||
if (!isset($_SESSION['user']))
|
||||
die(header('Location: index.php'));
|
||||
if (!isset($_SESSION['user'])) {
|
||||
if (isset($redirect))
|
||||
$_SESSION['ruta'] = $redirect;
|
||||
|
||||
header('Location: index.php');
|
||||
}
|
||||
|
||||
$user = unserialize($_SESSION['user']);
|
||||
|
||||
@@ -21,10 +25,11 @@ function html_header($title, $header = null)
|
||||
else
|
||||
$paginas = queryAll("SELECT * FROM PERMISO_VIEW WHERE id = :id ORDER BY pagina_ruta", array(":id" => $user->user['id']));
|
||||
|
||||
?>
|
||||
?>
|
||||
<aside id="sidebar" class="bg-light defaultShadow d-flex flex-column p-4">
|
||||
<div class="d-flex align-items-center mb-5">
|
||||
<div class="logotipo"><a href="https://lasalle.mx/" target="_blank"><img src="imagenes/logo_lasalle.png"></a></div>
|
||||
<div class="logotipo"><a href="https://lasalle.mx/" target="_blank"><img src="imagenes/logo_lasalle.png"></a>
|
||||
</div>
|
||||
<div class="flex-grow-1 d-flex justify-content-end">
|
||||
<nav class="navbar navbar-expand d-none d-flex">
|
||||
<ul class="navbar-nav">
|
||||
@@ -33,10 +38,12 @@ function html_header($title, $header = null)
|
||||
</nav>
|
||||
<div class="d-flex mainMenu justify-content-center align-items-center">
|
||||
<div class="max-h iconSesion">
|
||||
<a href="salir.php" class="iconOff max-h pl-3 d-flex justify-content-start align-items-center"><i class="ing-salir"></i></a>
|
||||
<a href="salir.php" class="iconOff max-h pl-3 d-flex justify-content-start align-items-center"><i
|
||||
class="ing-salir"></i></a>
|
||||
</div>
|
||||
<div class="max-h">
|
||||
<div class="bg-primary rounded-circle pointer max-h max-w d-flex justify-content-center align-items-center" id="dismiss">
|
||||
<div class="bg-primary rounded-circle pointer max-h max-w d-flex justify-content-center align-items-center"
|
||||
id="dismiss">
|
||||
<span class="text-white iconMenuSidebar ing-cancelar"></span>
|
||||
</div>
|
||||
</div>
|
||||
@@ -51,7 +58,7 @@ function html_header($title, $header = null)
|
||||
</p>
|
||||
|
||||
<?php
|
||||
if($user->admin){ ?>
|
||||
if ($user->admin) { ?>
|
||||
<p class="mb-0 mt-3 ml-4 pl-1">
|
||||
<a href="permisos.php" class="d-block side-menu">
|
||||
<span class="ing-pass"></span> Permisos
|
||||
@@ -60,11 +67,13 @@ function html_header($title, $header = null)
|
||||
<?php }
|
||||
$cont = 0;
|
||||
foreach ($grupos as $grupo) {
|
||||
?>
|
||||
?>
|
||||
<p class="mb-0 mt-3">
|
||||
<a class="d-block side-menu collapsed" data-toggle="collapse" href="#menu_<?= $cont ?>" role="button" aria-expanded="flase">
|
||||
<a class="d-block side-menu collapsed" data-toggle="collapse" href="#menu_<?= $cont ?>" role="button"
|
||||
aria-expanded="false">
|
||||
<i class="ing-caret ing-fw mr-2"></i>
|
||||
<span class="<?= $grupo['grupo_icon'] ?>"></span> <?= ucfirst($grupo['grupo_nombre']) ?>
|
||||
<span class="<?= $grupo['grupo_icon'] ?>"></span>
|
||||
<?= ucfirst($grupo['grupo_nombre']) ?>
|
||||
</a>
|
||||
</p>
|
||||
<div id="menu_<?= $cont ?>" class="collapse" data-parent="#accordionMenu" style>
|
||||
@@ -76,57 +85,74 @@ function html_header($title, $header = null)
|
||||
$user->access($pagina['pagina_ruta'] ?? '');
|
||||
if ($grupo['grupo_id'] == $pagina['grupo_id']) {
|
||||
if ($user->admin || $user->acceso != 'n') {
|
||||
?>
|
||||
?>
|
||||
<li class="mt-1">
|
||||
<a href="<?= $pagina['pagina_ruta'] ?>.php">
|
||||
<?= $page ?>
|
||||
</a>
|
||||
</li>
|
||||
<?php }
|
||||
<?php }
|
||||
}
|
||||
}
|
||||
?>
|
||||
</ul>
|
||||
</div>
|
||||
<?php $cont++;
|
||||
}
|
||||
<?php $cont++;
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
</aside>
|
||||
<div class="overlay"></div>
|
||||
<header class="sticky-top bg-white">
|
||||
<div class="container marco menu d-flex align-items-center">
|
||||
<div class="logotipo"><a href="https://lasalle.mx/" target="_blank"><img src="imagenes/logo_lasalle.png"></a></div>
|
||||
<div class="logotipo">
|
||||
<a href="https://lasalle.mx/" target="_blank">
|
||||
<img src="imagenes/logo_lasalle.png">
|
||||
</a>
|
||||
</div>
|
||||
<div class="flex-grow-1 d-flex justify-content-end">
|
||||
<nav class="navbar navbar-expand d-none d-flex">
|
||||
<ul class="navbar-nav">
|
||||
|
||||
</ul>
|
||||
<nav class="navbar navbar-expand-lg d-flex">
|
||||
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarNav"
|
||||
aria-controls="navbarNav" aria-expanded="false" aria-label="Toggle navigation">
|
||||
<span class="navbar-toggler-icon"></span>
|
||||
</button>
|
||||
<div class="collapse navbar-collapse" id="navbarNav">
|
||||
<ul class="navbar-nav">
|
||||
<!-- Add your navigation items here -->
|
||||
</ul>
|
||||
</div>
|
||||
</nav>
|
||||
<div class="d-flex mainMenu justify-content-center align-items-center">
|
||||
<div class="max-h iconSesion">
|
||||
<a href="salir.php" class="iconOff max-h pl-3 d-flex justify-content-start align-items-center"><i class="ing-salir"></i></a>
|
||||
<a href="salir.php" class="iconOff max-h pl-3 d-flex justify-content-start align-items-center">
|
||||
<i class="ing-salir"></i>
|
||||
</a>
|
||||
</div>
|
||||
<div class="max-h">
|
||||
<span id="sidebarCollapse" style="font-size: 44px;" class="ing-menu bg-white rounded-circle pointer max-w d-flex justify-content-center align-items-center"></span>
|
||||
<span id="sidebarCollapse" style="font-size: 44px;"
|
||||
class="ing-menu bg-white rounded-circle pointer max-w d-flex justify-content-center align-items-center"></span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</header>
|
||||
|
||||
<div class="row bg-info mx-0 barra-gris d-flex flex-column">
|
||||
<?php
|
||||
if ($header != null) {
|
||||
?>
|
||||
?>
|
||||
<div class="marco">
|
||||
<div class="col-sm-12">
|
||||
<h2 class="text-muted"><?= $header; ?>
|
||||
<h2 class="text-muted">
|
||||
<?= $header; ?>
|
||||
</div>
|
||||
</div>
|
||||
<?php } ?>
|
||||
<div class="marco">
|
||||
<div class="col-sm-12 py-3">
|
||||
<h2 class="text-uppercase"><?= $title; ?></h2>
|
||||
<h2 class="text-uppercase">
|
||||
<?= $title; ?>
|
||||
</h2>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -5,10 +5,14 @@
|
||||
<div class="col-12">
|
||||
<?php
|
||||
$target = $target ?? strtok($_SERVER["REQUEST_URI"], '?');
|
||||
$periodos = queryAll("SELECT * FROM FS_PERIODO WHERE FACULTAD_ID = COALESCE(:fac, FACULTAD_ID) ORDER BY INICIO DESC", [":fac" => $user->admin ? null : $user->facultad['facultad_id']]);
|
||||
$niveles = array_map(
|
||||
fn($nivel) => array_merge(
|
||||
$nivel,
|
||||
['periodos' => $db->where('nivel_id', $nivel['nivel_id'])->get('periodo_view')]
|
||||
), $db->get("nivel")
|
||||
);
|
||||
|
||||
// collect facultad_id's with facultad from $periodos
|
||||
if ($user->admin)
|
||||
$facultades = array_unique(array_column($periodos, 'facultad', 'facultad_id'));
|
||||
?>
|
||||
<input type="hidden" name="target" value="<?= $target ?>">
|
||||
<div class="form-box">
|
||||
@@ -19,27 +23,26 @@
|
||||
<div class="datalist-input">Selecciona un periodo</div>
|
||||
<span class="ing-buscar icono"></span>
|
||||
<ul style="display:none">
|
||||
<?php if (!$user->admin) foreach ($periodos as $periodo) { ?>
|
||||
|
||||
<li data-id="<?= $periodo['id'] ?>">
|
||||
<?= "{$periodo['nivel']} - {$periodo['periodo']} ({$periodo['estado']})" ?>
|
||||
</li>
|
||||
<?php }
|
||||
else {
|
||||
foreach ($facultades as $facultad_id => $facultad) {
|
||||
<?php
|
||||
foreach ($niveles as $nivel) {
|
||||
?>
|
||||
<li class="facultad not-selectable" data-id="<?= $facultad_id ?>">
|
||||
<?= $facultad ?>
|
||||
</li>
|
||||
<?php
|
||||
foreach (array_filter($periodos, fn ($p) => $p['facultad_id'] == $facultad_id) as $periodo) {
|
||||
<li data-id="<?= $nivel['nivel_id'] ?>" class="not-selectable disable">
|
||||
<?= $nivel['nivel_nombre'] ?>
|
||||
</li>
|
||||
<?
|
||||
$periodos_rs = $db->query(
|
||||
'SELECT * FROM fs_periodo(NULL, :nivel, 4)',
|
||||
[':nivel' => $nivel['nivel_id']]
|
||||
);
|
||||
foreach ($periodos_rs as $per) {
|
||||
?>
|
||||
<li data-id="<?= $periodo['id'] ?>">
|
||||
<?= "{$periodo['nivel']} - {$periodo['periodo']} ({$periodo['estado']})" ?>
|
||||
</li>
|
||||
<?php }
|
||||
}
|
||||
} ?>
|
||||
<li data-id="<?= $per['periodo_id'] ?>" <?php if ($user->periodo == $per["periodo_id"]) {
|
||||
echo 'class="selected"';
|
||||
} ?>>
|
||||
<?= $per['periodo_nombre'] ?>
|
||||
</li>
|
||||
<?php } ?>
|
||||
<?php } ?>
|
||||
</ul>
|
||||
<input type="hidden" id="periodo" name="id" value="">
|
||||
</div>
|
||||
@@ -55,7 +58,7 @@
|
||||
setDatalist('#periodo', <?php echo $user->periodo; ?>)
|
||||
makeRequiredDatalist("#periodo", true);
|
||||
|
||||
$(document).on('click', '#dlPeriodo ul li', function() {
|
||||
$(document).on('click', '#dlPeriodo ul li', function () {
|
||||
$('#formaPeriodo').submit();
|
||||
});
|
||||
</script>
|
||||
Reference in New Issue
Block a user