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 -4
View File
@@ -30,10 +30,8 @@
if (!empty($_FILES['product_image']['name'])) {
if ($id > 0) {
$sql = "SELECT `product_image` FROM md_product WHERE company_id = :company_id AND id = :id";
$sth = $pdo2->prepare($sql);
$sth->execute([':company_id' => $company_id, ':id' => $id]);
$uploader->cleanup($sth->fetchColumn(), '');
$product = new ProductManager($pdo2, $company_id);
$uploader->cleanup($product->getProductImage($id), '');
}
$errors = $uploader->upload('product_image');
+8 -12
View File
@@ -1,21 +1,17 @@
<?php
session_start();
require '../../../assets/utils/db_auth.php';
require '../../../assets/utils/classes/UserManager.php';
require_role($user_role, ['owner', 'admin']);
$sth = $pdo1->prepare(
"SELECT u.user_id, u.name, u.surname, u.email
FROM user u
INNER JOIN company_map_user m
ON m.user_id = u.user_id
AND m.company_id = :company_id
ORDER BY u.name ASC"
);
$sth->execute([':company_id' => $company_id]);
db_check($sth, $answer);
try {
$users = new UserManager($pdo1, $company_id, $user_id);
$answer['output'] = $users->getCompanyUsers();
$answer['success'] = 1;
} catch (Exception $e) {
$answer['message'] = $e->getMessage();
}
$answer['output'] = $sth->fetchAll(PDO::FETCH_ASSOC);
$answer['success'] = 1;
exit(json_encode($answer));
?>