Compare commits
6 Commits
6b14b2620c
...
e8b1afdb71
| Author | SHA1 | Date | |
|---|---|---|---|
| e8b1afdb71 | |||
| 4dbc9cfc52 | |||
| a0ada73c81 | |||
| d28414cff1 | |||
| c616072d6c | |||
| 5cdfc9c39a |
@@ -661,6 +661,64 @@ class Producto extends Main
|
|||||||
|
|
||||||
}//Search3
|
}//Search3
|
||||||
|
|
||||||
|
function Search(){
|
||||||
|
|
||||||
|
$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.'"';
|
||||||
|
|
||||||
|
if($this->proveedorId)
|
||||||
|
$sqlAdd .= ' AND p.proveedorId = "'.$this->proveedorId.'"';
|
||||||
|
|
||||||
|
if($this->prodCatId)
|
||||||
|
$sqlAdd .= ' AND p.prodCatId = "'.$this->prodCatId.'"';
|
||||||
|
|
||||||
|
if($this->descripcion)
|
||||||
|
$sqlAdd .= ' AND p.modelo LIKE "%'.$this->descripcion.'%"';
|
||||||
|
|
||||||
|
if($this->codigoBarra)
|
||||||
|
$sqlAdd .= ' AND p.codigoBarra LIKE "%'.$this->codigoBarra.'%"';
|
||||||
|
|
||||||
|
if($sqlAdd != ''){
|
||||||
|
|
||||||
|
$sql = 'SELECT p.*
|
||||||
|
|
||||||
|
FROM
|
||||||
|
producto AS p,
|
||||||
|
proveedor AS prov
|
||||||
|
WHERE
|
||||||
|
p.proveedorId = prov.proveedorId
|
||||||
|
AND
|
||||||
|
p.baja = "0"
|
||||||
|
'.$sqlAdd.'
|
||||||
|
ORDER BY
|
||||||
|
descripcion';
|
||||||
|
$this->Util()->DBSelect($_SESSION['empresaId'])->setQuery($sql);
|
||||||
|
$result = $this->Util()->DBSelect($_SESSION['empresaId'])->GetResult();
|
||||||
|
|
||||||
|
}else{
|
||||||
|
$result = array();
|
||||||
|
}
|
||||||
|
|
||||||
|
$data["items"] = $result;
|
||||||
|
$data["pages"] = $pages;
|
||||||
|
|
||||||
|
return $data;
|
||||||
|
|
||||||
|
}//Search
|
||||||
|
|
||||||
function Search2(){
|
function Search2(){
|
||||||
|
|
||||||
$sqlAdd = '';
|
$sqlAdd = '';
|
||||||
|
|||||||
Reference in New Issue
Block a user