-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfetch_usuarios.php
45 lines (32 loc) · 1.1 KB
/
fetch_usuarios.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
<?php
require_once("funciones.php");
if(!permiso($perfil,"usuarios")){
echo "Permisos insuficientes";
exit;
}
$sql = "select U.id as id,
U.nombre as nombre,
U.apellido as apellido,
concat(U.nombre,' ',U.apellido) as nombreapellido,
U.email as email,
U.telegram as telegram,
U.telefono as telefono,
U.impresoras as impresoras,
U.fecha_login as ultimo_ingreso,
if(activo=1,'Si','No') as activo,
U.activo as activo_id,
P.nombre_abr as perfil,
U.perfil as perfil_id,
U.direccion as direccion,
D.nombre as departamento,
U.departamento_id as departamento_id
from users as U,
departamentos as D,
perfiles as P
where U.perfil = P.perfil AND
U.departamento_id = D.id;";
$Result = mysqli_query($mysqli_link,$sql);
$rows = mysqli_fetch_all($Result,MYSQLI_ASSOC);
$array = Array("data" => $rows);
echo json_encode($array);
?>