Fix undefined variable $pages in Search() function - move initialization
Moved $pages array initialization outside of if/else block to prevent undefined variable warning when search returns results (if block executes). $pages is now initialized before the conditional logic.
This commit is contained in:
@@ -665,6 +665,17 @@ class Producto extends Main
|
||||
|
||||
$sqlAdd = '';
|
||||
|
||||
$pages = array(
|
||||
'numbers' => array(),
|
||||
'first' => false,
|
||||
'prev' => false,
|
||||
'next' => false,
|
||||
'last' => false,
|
||||
'current' => 1,
|
||||
'items_per_page' => defined('ITEMS_PER_PAGE') ? ITEMS_PER_PAGE : 20,
|
||||
'start' => 0
|
||||
);
|
||||
|
||||
if($this->noProveedor)
|
||||
$sqlAdd .= ' AND prov.noProv = "'.$this->noProveedor.'"';
|
||||
|
||||
@@ -699,16 +710,6 @@ class Producto extends Main
|
||||
|
||||
}else{
|
||||
$result = array();
|
||||
$pages = array(
|
||||
'numbers' => array(),
|
||||
'first' => false,
|
||||
'prev' => false,
|
||||
'next' => false,
|
||||
'last' => false,
|
||||
'current' => 1,
|
||||
'items_per_page' => defined('ITEMS_PER_PAGE') ? ITEMS_PER_PAGE : 20,
|
||||
'start' => 0
|
||||
);
|
||||
}
|
||||
|
||||
$data["items"] = $result;
|
||||
|
||||
Reference in New Issue
Block a user