Files
2026-09-16 23:20:08 +07:00

27 lines
1017 B
PHP

<?php
/**
* Application Configuration
*/
// Detect the base URL dynamically or set it manually for production
// For local: http://localhost/จัดการข้อมูลเงินเดือนเจ้าหน้าที่โรงพยาบาล
// For prod: https://intra1.samuihospital.go.th/intranet/sub_system/fn_payroll
$is_https = isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] === 'on';
$protocol = $is_https ? "https://" : "http://";
$host = $_SERVER['HTTP_HOST'];
$script_dirname = dirname($_SERVER['SCRIPT_NAME']);
// Remove '/public' from the end of the script dirname if it exists
$base_dir = preg_replace('/\/public$/', '', $script_dirname);
if ($base_dir === '\\' || $base_dir === '/') {
$base_dir = '';
}
$base_url = $protocol . $host . $base_dir;
define('BASE_URL', $base_url);
define('APP_NAME', 'ระบบจัดการข้อมูลเงินเดือนเจ้าหน้าที่โรงพยาบาล');
define('APP_VERSION', '1.0.0');
?>