Redirect finance detail pages to their list when opened without an id

This commit is contained in:
Thanakorn
2026-09-19 06:33:45 +07:00
parent 033846dece
commit 9a8998796c
4 changed files with 36 additions and 4 deletions
+9 -1
View File
@@ -1,9 +1,17 @@
<?php <?php
session_start(); session_start();
require '../config.php'; require '../config.php';
require '../include_header.php';
// A detail-only page: payments are created from the Payments list, so with no
// id there is nothing to show. Send the user there instead of rendering an
// empty page that alerts "Payment id is required."
$payment_id = (int)($_GET['id'] ?? 0); $payment_id = (int)($_GET['id'] ?? 0);
if (!$payment_id) {
header('Location: ' . $server_url . 'finance/payment.php');
exit;
}
require '../include_header.php';
?> ?>
<body> <body>
+9 -1
View File
@@ -1,9 +1,17 @@
<?php <?php
session_start(); session_start();
require '../config.php'; require '../config.php';
require '../include_header.php';
// A detail-only page: payment billings are created from their list, so with
// no id there is nothing to show. Send the user there instead of rendering an
// empty page that alerts "Payment billing id is required."
$billing_id = (int)($_GET['id'] ?? 0); $billing_id = (int)($_GET['id'] ?? 0);
if (!$billing_id) {
header('Location: ' . $server_url . 'finance/payment_billing.php');
exit;
}
require '../include_header.php';
?> ?>
<body> <body>
+9 -1
View File
@@ -1,9 +1,17 @@
<?php <?php
session_start(); session_start();
require '../config.php'; require '../config.php';
require '../include_header.php';
// A detail-only page: receipts are created from the Receipts list, so with no
// id there is nothing to show. Send the user there instead of rendering an
// empty page that alerts "Receipt id is required."
$receipt_id = (int)($_GET['id'] ?? 0); $receipt_id = (int)($_GET['id'] ?? 0);
if (!$receipt_id) {
header('Location: ' . $server_url . 'finance/receipt.php');
exit;
}
require '../include_header.php';
?> ?>
<body> <body>
+9 -1
View File
@@ -1,9 +1,17 @@
<?php <?php
session_start(); session_start();
require '../config.php'; require '../config.php';
require '../include_header.php';
// A detail-only page: receipt billings are created from their list, so with
// no id there is nothing to show. Send the user there instead of rendering an
// empty page that alerts "Receipt billing id is required."
$billing_id = (int)($_GET['id'] ?? 0); $billing_id = (int)($_GET['id'] ?? 0);
if (!$billing_id) {
header('Location: ' . $server_url . 'finance/receipt_billing.php');
exit;
}
require '../include_header.php';
?> ?>
<body> <body>