Fix usuarios module: resolve PHP 8 warnings and fatal errors
- Fixed undefined array key warnings in usuarios-agregar.php - Fixed undefined variable warnings (, , ) - Fixed null array offset warnings in db.class.php GetSingle() - Added default parameter to ValidateMail() in util.class.php - Fixed PrintErrors() return value for proper error handling - Fixed integer constraint errors for codigoPostal and sucursalId - Added missing identificacion and comprobante fields to INSERT query - Fixed undefined variable in IsEmailTaked()
This commit is contained in:
@@ -7,10 +7,10 @@
|
||||
exit;
|
||||
}
|
||||
|
||||
if($_POST['type'] == 'saveUsuario'){
|
||||
|
||||
if(isset($_POST['type']) && $_POST['type'] == 'saveUsuario'){
|
||||
|
||||
$tipo = $_POST['tipo'];
|
||||
$idSuc = $_POST['idSuc'];
|
||||
$idSuc = isset($_POST['idSuc']) ? $_POST['idSuc'] : array();
|
||||
|
||||
$usuario->setTipo($tipo);
|
||||
$usuario->setNombre($_POST['nombre']);
|
||||
@@ -109,20 +109,29 @@
|
||||
exit;
|
||||
|
||||
}
|
||||
|
||||
|
||||
$nomSuc = '';
|
||||
$info = array('type' => '', 'sucursalId' => '');
|
||||
$post = array('sucursalId' => '');
|
||||
|
||||
if($Usr['type'] == 'gerente'){
|
||||
$sucursal->setSucursalId($Usr['sucursalId']);
|
||||
$nomSuc = $sucursal->GetNameById();
|
||||
$nomSuc = strtoupper(utf8_decode(urldecode($nomSuc)));
|
||||
}
|
||||
|
||||
|
||||
$sucursales = $sucursal->GetSucursalesByEmpresaId();
|
||||
foreach ($sucursales as $key => $sucursal ){
|
||||
$sucursales[$key]['nombre'] = utf8_decode(urldecode($sucursal['nombre']));
|
||||
$sucursalesFiltered = array();
|
||||
foreach ($sucursales as $item ){
|
||||
if($item){
|
||||
$item['nombre'] = utf8_decode(urldecode($item['nombre']));
|
||||
$sucursalesFiltered[] = $item;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$smarty->assign('info', $info);
|
||||
$smarty->assign('post', $post);
|
||||
$smarty->assign('nomSuc', $nomSuc);
|
||||
$smarty->assign('usuarios', $usuarios);
|
||||
$smarty->assign('sucursales', $sucursales);
|
||||
$smarty->assign('sucursales', $sucursalesFiltered);
|
||||
|
||||
?>
|
||||
Reference in New Issue
Block a user