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
+2 -9
View File
@@ -10,10 +10,9 @@ require '../../../assets/utils/db_auth.php';
require '../../../assets/utils/classes/UserManager.php';
$action = $data['action'] ?? '';
$um = new UserManager($pdo1, $company_id, $user_id);
if ($action === 'read') {
$um = new UserManager($pdo1, $company_id, $user_id);
$answer['success'] = 1;
$answer['output'] = $um->getCompanyList();
$answer['current'] = (int)$_SESSION['login_company_id'];
@@ -29,13 +28,7 @@ if ($action === 'update') {
exit(json_encode($answer));
}
$sth = $pdo1->prepare(
"SELECT company_id, role FROM company_map_user
WHERE company_id = :company_id AND user_id = :user_id
LIMIT 1"
);
$sth->execute([':company_id' => $target_company_id, ':user_id' => $user_id]);
$target_map = $sth->fetch(PDO::FETCH_ASSOC);
$target_map = $um->getCompanyAccess($target_company_id);
if (!$target_map) {
$answer['message'] = 'You do not have access to this company.';