42 lines
1.1 KiB
PHP
42 lines
1.1 KiB
PHP
<?php
|
|
session_start();
|
|
require '../../../assets/utils/db_auth.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));
|
|
}
|
|
|
|
$answer['success'] = 1;
|
|
$answer['output'] = $company;
|
|
|
|
} catch (Exception $e) {
|
|
$answer['message'] = 'Failed to load company profile.';
|
|
http_response_code(500);
|
|
}
|
|
|
|
exit(json_encode($answer));
|
|
?>
|