Update App baseURL host handling and report view changes

This commit is contained in:
DevSoftTech Server 2026-03-22 00:56:28 +05:30
parent d2400fc5c2
commit ad70bb2b48
2 changed files with 34 additions and 2 deletions

View File

@ -16,7 +16,20 @@ class App extends BaseConfig
*
* E.g., http://example.com/
*/
public string $baseURL = 'http://localhost:8080/';
public string $baseURL = '';
public function __construct()
{
parent::__construct();
if ($this->baseURL === '') {
$isHttps = ! empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off';
$scheme = $isHttps ? 'https' : 'http';
$host = $_SERVER['HTTP_HOST'] ?? $_SERVER['SERVER_NAME'] ?? 'localhost';
$this->baseURL = $scheme . '://' . $host . '/';
}
}
/**
* Allowed Hostnames in the Site URL other than the hostname in the baseURL.
@ -29,7 +42,11 @@ class App extends BaseConfig
*
* @var list<string>
*/
public array $allowedHostnames = [];
public array $allowedHostnames = [
'localhost',
'hmskrishnaksp.dhms.in',
'hmslocal.devsofttech.co.in',
];
/**
* --------------------------------------------------------------------------

View File

@ -5,6 +5,21 @@
</div>
<div class="row g-3">
<div class="col-xl-3 col-md-6">
<div class="card report-card h-100">
<div class="card-body">
<div class="report-card-head">
<span class="report-icon report-icon-blue"><i class="bi bi-bar-chart-line"></i></span>
<h5 class="report-card-title mb-0">Reports</h5>
</div>
<ul class="report-links">
<li><a href="javascript:load_form('<?= base_url('Report/collection_report') ?>','Collection Report');"><i class="bi bi-arrow-right-short"></i> Total Payment (Cash and Bank)</a></li>
<li><a href="javascript:load_form('<?= base_url('Report/billing_operations_report') ?>','Billing Operations Report');"><i class="bi bi-arrow-right-short"></i> Billing Operations Report</a></li>
<li><a href="javascript:load_form('<?= base_url('Finance/bank_deposits') ?>','Bank Deposit Register');"><i class="bi bi-arrow-right-short"></i> Bank Deposit Register</a></li>
</ul>
</div>
</div>
</div>
<div class="col-xl-3 col-md-6">
<div class="card report-card h-100">
<div class="card-body">