diff --git a/CONTENT/ROOT_URI/Admin/Report.php b/CONTENT/ROOT_URI/Admin/Report.php
index a50cb6e..88da4cf 100644
--- a/CONTENT/ROOT_URI/Admin/Report.php
+++ b/CONTENT/ROOT_URI/Admin/Report.php
@@ -12,7 +12,7 @@
connect_error) die("Connection failed: " . $conn->connect_error);
@@ -84,11 +84,12 @@ function report_view($type, $dt) {
| Transaction ID |
- Agent |
+ '.($_SESSION['type'] === 'admin' ? "Agent | " : "").'
Time |
AC No |
Name |
Amount |
+ '.($_SESSION['type'] === 'admin' ? "Remarks | " : "").'
';
@@ -96,12 +97,12 @@ function report_view($type, $dt) {
// ----- base query -----
$sql = "SELECT * FROM `".$GLOBALS['arif_tran']."` INNER JOIN `".$GLOBALS['arif_ac']."` ON `".$GLOBALS['arif_tran']."`.`AT_ACID`=`".$GLOBALS['arif_ac']."`.`AA_ACNO` WHERE `AT_TIMESTAMP` BETWEEN '".$dateFrom." 00:00:00' AND '".$dateTo." 00:00:00'";
- // ----- agent হলে নিজের report -----
+ // ----- individual agent report -----
if($_SESSION['type'] === 'agent') {
$sql .= " AND `AA_AGENT`='".$_SESSION['user_id']."'";
}
- // ----- admin হলে filter option -----
+ // ----- if admin filter option -----
if($_SESSION['type'] === 'admin' && isset($_GET['agent']) && $_GET['agent']!="") {
$agentId = $conn->real_escape_string($_GET['agent']);
$sql .= " AND `AA_AGENT`='".$agentId."'";
@@ -113,14 +114,15 @@ function report_view($type, $dt) {
if ($result && $result->num_rows > 0) {
while($row = $result->fetch_assoc()) {
echo "
-
- | ".$row["AT_ID"]." |
- ".$row["AA_AGENT"]." |
- ".$row["AT_TIMESTAMP"]." |
- ".$row["AT_ACID"]." |
- ".$row["AA_NAME"]." |
- ".$row["AT_AMOUNT"]." |
-
";
+
+ | ".$row["AT_ID"]." |
+ ".($_SESSION['type'] === 'admin' ? "".$row["AA_AGENT"]." | " : "")."
+ ".$row["AT_TIMESTAMP"]." |
+ ".$row["AT_ACID"]." |
+ ".$row["AA_NAME"]." |
+ ".$row["AT_AMOUNT"]." |
+ ".($_SESSION['type'] === 'admin' ? "".($row["REMARKS"] ?? '')." | " : "")."
+
";
$totalAmount += $row["AT_AMOUNT"];
$rowsData[] = [$row["AT_ID"], $row["AT_TIMESTAMP"], $row["AT_ACID"], $row["AA_NAME"], $row["AT_AMOUNT"]];
}
diff --git a/CONTENT/ROOT_URI/Admin/Trans_New.php b/CONTENT/ROOT_URI/Admin/Trans_New.php
index 947c957..e8b1349 100644
--- a/CONTENT/ROOT_URI/Admin/Trans_New.php
+++ b/CONTENT/ROOT_URI/Admin/Trans_New.php
@@ -263,14 +263,14 @@ if ($_SESSION['type'] === 'admin' && isset($_GET["no"]) && isset($_GET["type"])
$userType = 'admin';
// Entry 1: Deduction from recurring
- $remarksText1 = "Deducted ₹$loanEMIAmount from recurring balance to pay Loan Account No: $paidToLoanAccountNumber EMI";
+ $remarksText1 = "₹$loanEMIAmount deducted from Recurring for Loan A/c $paidToLoanAccountNumber EMI";
$stmt = $conn->prepare("INSERT INTO `$table` (AT_ADMIN, AT_ACID, AT_AMOUNT, REMARKS) VALUES (?, ?, ?, ?)");
$stmt->bind_param("ssds", $userType, $accountId, $deductAmount, $remarksText1);
$stmt->execute();
$stmt->close();
// Entry 2: Credit to loan account
- $remarksText2 = "Credited ₹$loanEMIAmount to Loan Account No: $paidToLoanAccountNumber EMI from recurring balance";
+ $remarksText2 = "₹$loanEMIAmount credited to Loan A/c $paidToLoanAccountNumber EMI (from Recurring $accountId)";
$stmt = $conn->prepare("INSERT INTO `$table` (AT_ADMIN, AT_ACID, AT_AMOUNT, REMARKS) VALUES (?, ?, ?, ?)");
$stmt->bind_param("ssds", $userType, $paidToLoanAccountNumber, $loanEMIAmount, $remarksText2);
$stmt->execute();
@@ -285,9 +285,7 @@ if ($_SESSION['type'] === 'admin' && isset($_GET["no"]) && isset($_GET["type"])
$stmt->close();
// Update Recurring Account
- $sql = "UPDATE `" . $GLOBALS['arif_ac'] . "`
- SET `AA_BAL` = `AA_BAL` - ?
- WHERE `AA_ACNO` = ?";
+ $sql = "UPDATE `" . $GLOBALS['arif_ac'] . "` SET `AA_BAL` = `AA_BAL` - ? WHERE `AA_ACNO` = ?";
$stmt = $conn->prepare($sql);
$stmt->bind_param("ds", $loanEMIAmount, $accountId);
$stmt->execute();