41 lines
1010 B
PHP
Executable File
41 lines
1010 B
PHP
Executable File
<?php
|
|
|
|
$empresa->AuthUser();
|
|
|
|
if($Usr['type'] != 'admin' && $Usr['type'] != 'direccion' && $Usr['type'] != 'gerente'){
|
|
header('Location: '.WEB_ROOT);
|
|
exit;
|
|
}
|
|
|
|
$usuarioId = intval($_GET['id']);
|
|
|
|
$usuario->setUsuarioId($usuarioId);
|
|
$info = $usuario->Info();
|
|
|
|
$info['type'] = $util->GetNameUsrType($info['type']);
|
|
|
|
if($info['sucursalId']){
|
|
$sucursal->setSucursalId($info['sucursalId'] );
|
|
$nomSucursal = $sucursal->GetNameById();
|
|
$info['sucursal'] = strtoupper(utf8_decode(urldecode($nomSucursal)));
|
|
} else {
|
|
$info['sucursal'] = ''; // Initialize for users without sucursal
|
|
}
|
|
|
|
$resSuc = $sucursal->GetSucursalesByEmpresaId();
|
|
|
|
$sucursales = array();
|
|
foreach($resSuc as $res){
|
|
$res['nombre'] = utf8_decode(urldecode($res['nombre']));
|
|
|
|
$usuario->setUsuarioId($usuarioId);
|
|
$usuario->setSucursalId($res['sucursalId']);
|
|
$res['checked'] = $usuario->IsSucChecked();
|
|
|
|
$sucursales[] = $res;
|
|
}
|
|
|
|
$smarty->assign('info', $info);
|
|
$smarty->assign('sucursales', $sucursales);
|
|
|
|
?>
|