Initial state
This commit is contained in:
26
action/action_materias.php
Normal file
26
action/action_materias.php
Normal file
@@ -0,0 +1,26 @@
|
||||
<?php
|
||||
$ruta = "../";
|
||||
require_once "../class/c_login.php";
|
||||
|
||||
extract($_POST);
|
||||
# print_r($_POST); exit;
|
||||
|
||||
if (!isset($_SESSION['user']))
|
||||
die(header('Location: index.php'));
|
||||
|
||||
$user = unserialize($_SESSION['user']);
|
||||
|
||||
if (!$user->admin && ($access = $user->access('asistencia')) == 'n')
|
||||
die(json_encode(['error' => true]));
|
||||
|
||||
$user->print_to_log('Consultar materias');
|
||||
$materias = queryAll(
|
||||
"SELECT id, nombre FROM FS_MATERIA WHERE carrera = COALESCE(:carrera, carrera) ORDER BY nombre",
|
||||
[':carrera' => empty($carrera) ? null : $carrera]
|
||||
);
|
||||
?>
|
||||
|
||||
<?= json_encode([
|
||||
'status' => 'success',
|
||||
'materias' => $materias,
|
||||
]); ?>
|
||||
Reference in New Issue
Block a user