Fix panel accept page

This commit is contained in:
CHIEFSOFT\ameye
2024-10-26 14:40:34 -04:00
parent 9fa8ca0822
commit 19b5846445
8 changed files with 250 additions and 100 deletions
+9 -4
View File
@@ -7,16 +7,21 @@ use CodeIgniter\Model;
class Product_model extends Model
{
public function getProducts($productId = '') {
if ( $productId == '' ){
$db = db_connect();
if (trim($productId) == '' ){
$mysql = "SELECT * FROM products ORDER BY id ASC ";
$query = $db->query($mysql);
return $query->getResult('array');
}else
{
$mysql = "SELECT * FROM products WHERE product_id='$productId' ";
$query = $db->query($mysql);
return $query->getResult('array')[0];
}
$db = db_connect();
$query = $db->query($mysql);
return $query->getResult('array');
// $query = $db->query($mysql);
// return $query->getResult('array')[0];
}