20 lines
512 B
PHP
20 lines
512 B
PHP
<?php
|
|
session_start();
|
|
require '../../../assets/utils/db_auth.php';
|
|
|
|
$sql = "SELECT
|
|
COUNT(*) AS total,
|
|
SUM(status = 0) AS draft,
|
|
SUM(status = 1) AS sent,
|
|
SUM(status = 2) AS accepted,
|
|
SUM(status = 3) AS rejected
|
|
FROM ac_quotation
|
|
WHERE company_id = :cid";
|
|
$sth = $pdo2->prepare($sql);
|
|
$sth->execute([':cid' => $company_id]);
|
|
$row = $sth->fetch(PDO::FETCH_ASSOC);
|
|
|
|
$answer['success'] = 1;
|
|
$answer['output'] = $row;
|
|
exit(json_encode($answer));
|