Added $info array initialization with default values for proveedorId and prodCatId to prevent 'Trying to access array offset on null' warnings in search-productos.tpl and enumProdCatSearch.tpl templates.
47 lines
1.0 KiB
PHP
Executable File
47 lines
1.0 KiB
PHP
Executable File
<?php
|
|
|
|
$empresa->AuthUser();
|
|
|
|
$p = intval($_GET["p"] ?? 0);
|
|
$producto->SetPage($p);
|
|
$productos = $producto->Enumerate();
|
|
|
|
$items = array();
|
|
foreach($productos['items'] as $res){
|
|
|
|
$proveedor->setProveedorId($res['proveedorId']);
|
|
$infPv = $proveedor->Info();
|
|
|
|
$res['proveedor'] = $infPv['nombre'];
|
|
$res['noProv'] = $infPv['noProv'];
|
|
|
|
$prodCat->setProdCatId($res['prodCatId']);
|
|
$res['departamento'] = $prodCat->GetNameById();
|
|
|
|
if($res['prodSubcatId']){
|
|
$prodSubcat->setProdSubcatId($res['prodSubcatId']);
|
|
$res['linea'] = $prodSubcat->GetNameById();
|
|
}
|
|
|
|
$items[] = $res;
|
|
}
|
|
$productos['items'] = $items;
|
|
|
|
$categorias = $prodCat->EnumerateAll();
|
|
$proveedores = $proveedor->EnumerateAll();
|
|
|
|
$msg = $_SESSION['msgP'];
|
|
$_SESSION['msgP'] = '';
|
|
|
|
$info = array(
|
|
'proveedorId' => '',
|
|
'prodCatId' => ''
|
|
);
|
|
|
|
$smarty->assign('msg', $msg);
|
|
$smarty->assign('info', $info);
|
|
$smarty->assign('categorias', $categorias);
|
|
$smarty->assign('proveedores', $proveedores);
|
|
$smarty->assign('productos', $productos);
|
|
|
|
?>
|