[OOP] contact,inventory,ics,dashboard
This commit is contained in:
@@ -1,24 +1,10 @@
|
||||
<?php
|
||||
<?php
|
||||
session_start();
|
||||
|
||||
require '../../../assets/utils/db_auth.php';
|
||||
require '../../../assets/utils/classes/ProductManager.php';
|
||||
|
||||
$sql = "SELECT a.* , IFNULL(SUM(b.total_in-b.total_out),0) AS product_balance
|
||||
FROM md_product a
|
||||
LEFT JOIN warehouse_balance b ON
|
||||
a.company_id = b.company_id AND
|
||||
a.sku = b.product_sku
|
||||
WHERE
|
||||
a.company_id = {$company_id}
|
||||
GROUP BY a.id";
|
||||
$sth = $pdo2->prepare($sql);
|
||||
$sth->execute([
|
||||
":company_id" => $company_id
|
||||
]);
|
||||
db_check($sth, $answer);
|
||||
|
||||
$answer["output"] = $sth->fetchAll(PDO::FETCH_ASSOC);
|
||||
$answer["success"] = 1;
|
||||
$product = new ProductManager($pdo2, $company_id);
|
||||
$answer['output'] = $product->getProductList();
|
||||
$answer['success'] = 1;
|
||||
exit(json_encode($answer));
|
||||
|
||||
?>
|
||||
Reference in New Issue
Block a user