Fix undefined variable $pages in producto Search functions
Fixed 'Undefined variable $pages' error when no search criteria are provided in Search3(), Search2(), and SearchDuplicados() functions by initializing $pages array with proper pagination structure in the else blocks.
This commit is contained in:
@@ -642,6 +642,16 @@ class Producto extends Main
|
|||||||
|
|
||||||
}else{
|
}else{
|
||||||
$result = array();
|
$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
|
||||||
|
);
|
||||||
}//else
|
}//else
|
||||||
|
|
||||||
$data["items"] = $result;
|
$data["items"] = $result;
|
||||||
@@ -651,7 +661,7 @@ class Producto extends Main
|
|||||||
|
|
||||||
}//Search
|
}//Search
|
||||||
|
|
||||||
function Search(){
|
function Search2(){
|
||||||
|
|
||||||
$sqlAdd = '';
|
$sqlAdd = '';
|
||||||
|
|
||||||
@@ -689,6 +699,16 @@ class Producto extends Main
|
|||||||
|
|
||||||
}else{
|
}else{
|
||||||
$result = array();
|
$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
|
||||||
|
);
|
||||||
}//else
|
}//else
|
||||||
|
|
||||||
$data["items"] = $result;
|
$data["items"] = $result;
|
||||||
@@ -736,6 +756,16 @@ class Producto extends Main
|
|||||||
|
|
||||||
}else{
|
}else{
|
||||||
$result = array();
|
$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
|
||||||
|
);
|
||||||
}//else
|
}//else
|
||||||
|
|
||||||
$data["items"] = $result;
|
$data["items"] = $result;
|
||||||
|
|||||||
Reference in New Issue
Block a user