Initial state
This commit is contained in:
22
action/action_usuario.php
Normal file
22
action/action_usuario.php
Normal file
@@ -0,0 +1,22 @@
|
||||
<?php
|
||||
$ruta = "../";
|
||||
require_once '../class/c_login.php';
|
||||
|
||||
// print_r($_POST); exit;
|
||||
|
||||
if (($user = Login::validUser($_POST['username'], $_POST['passwd'])) === false) {
|
||||
echo json_encode("error");
|
||||
exit;
|
||||
}
|
||||
|
||||
$facultades = queryAll("SELECT DISTINCT ID, FACULTAD FROM FS_FACULTAD WHERE ACTIVA");
|
||||
|
||||
for ($i = 0; $i < count($facultades); $i++) {
|
||||
# print_r($facultades[$i]);
|
||||
$facultades[$i]['usuarios'] = queryAll(
|
||||
"SELECT ID, USERNAME FROM FS_USUARIO WHERE facultad = :facultad",
|
||||
array(":facultad" => $facultades[$i]["id"])
|
||||
);
|
||||
}
|
||||
|
||||
echo json_encode($facultades);
|
||||
Reference in New Issue
Block a user