- users, SMTP and batch-lock endpoints are owner/admin only - engines answer 400/403/404/409/500 instead of 200 with an error body; database errors no longer leak to the client
20 lines
627 B
PHP
20 lines
627 B
PHP
<?php
|
|
require_once __DIR__ . '/../../../session.php';
|
|
require_once '../../../assets/utils/db_auth.php';
|
|
require_once '../../../assets/utils/classes/QuotationManager.php';
|
|
|
|
try {
|
|
$quotation = new QuotationManager($pdo2, $company_id);
|
|
$answer['output'] = $quotation->getStats();
|
|
$answer['success'] = 1;
|
|
} catch (PDOException $e) {
|
|
error_log('[' . basename(__FILE__) . '] ' . $e->getMessage());
|
|
$answer['message'] = 'Database error, please try again.';
|
|
http_response_code(500);
|
|
} catch (Exception $e) {
|
|
$answer['message'] = $e->getMessage();
|
|
http_response_code(400);
|
|
}
|
|
|
|
exit(json_encode($answer));
|