accounting workflows

This commit is contained in:
Thanakorn S
2026-05-20 10:17:02 +07:00
parent 04a683bd02
commit 7396db6ffc
199 changed files with 23539 additions and 5345 deletions
+6 -31
View File
@@ -1,42 +1,17 @@
<?php
session_start();
require '../../../assets/utils/db_auth.php';
require '../../../assets/utils/classes/CompanyProfileManager.php';
try {
$sth = $pdo1->prepare("
SELECT
company_id, channel_name,
company_name, company_name2,
company_logo, company_seal,
branch, branch_no,
fiscal_year, fx,
address, address2,
tax_id, prompt_pay, entrepreneur,
email, phone, fax,
website, facebook_page
FROM company_list
WHERE company_id = :company_id
LIMIT 1
");
$sth->execute([':company_id' => $company_id]);
db_check($sth, $answer);
$company = $sth->fetch(PDO::FETCH_ASSOC);
if (!$company) {
$answer['message'] = 'Company not found.';
http_response_code(404);
exit(json_encode($answer));
}
$company_profile = new CompanyProfileManager($pdo1, $company_id);
$answer['success'] = 1;
$answer['output'] = $company;
$answer['output'] = $company_profile->getProfile();
} catch (Exception $e) {
$answer['message'] = 'Failed to load company profile.';
http_response_code(500);
$answer['message'] = $e->getMessage();
http_response_code($e->getMessage() === 'Company not found.' ? 404 : 500);
}
exit(json_encode($answer));
?>
?>