add agent name in navbar, add matiruty button in recurring

This commit is contained in:
dev@siliconpin.com
2025-08-13 15:35:23 +05:30
parent a3067c5ad4
commit dfa6ffc54f
5 changed files with 102 additions and 3 deletions

View File

@@ -43,7 +43,8 @@ require_login();
</ul>
</ul>
<ul class="nav navbar-nav navbar-right">
<ul class="nav navbar-nav navbar-right" style="display: flex; align-items: center;">
<p class="" style="margin-top: 10px; color: #FFFFFF;"><?php echo $_SESSION['name'] ?? ''; ?></p>
<li><a href="/Admin/Signout">Signout</a></li>
</ul>
</div>

View File

@@ -51,8 +51,24 @@
$spStmt->close();
}
// Handle maturity for recurring accounts
if (isset($_POST['recurring_maturity_submit']) && !empty($_POST['maturity_acno'])) {
$maturityAcno = $_POST['maturity_acno'];
$maturityDate = date('Y-m-d');
$maturitySql = "UPDATE `{$GLOBALS['arif_ac']}` SET STATUS = 'matured', CLOSING_DATE = ? WHERE AA_ACNO = ?";
$maturityStmt = $conn->prepare($maturitySql);
if ($maturityStmt->bind_param("ss", $maturityDate, $maturityAcno) && $maturityStmt->execute()) {
echo "<div class='alert alert-success'>Recurring A/C <strong>{$maturityAcno}</strong> marked as matured.</div>";
} else {
echo "<div class='alert alert-danger'>Failed to mark Recurring A/C <strong>{$maturityAcno}</strong> as matured.</div>";
}
$maturityStmt->close();
}
// Get agent list for dropdown
// $getAgentListsQuery = "SELECT * FROM " . $GLOBALS['arif_users'] . " WHERE type = 'agent'";
$getAgentListsQuery = "SELECT * FROM " . $GLOBALS['arif_users'] . "";
$agentResult = $conn->query($getAgentListsQuery);
$agentList = [];
@@ -158,7 +174,16 @@
} elseif ($row["AA_TYPE"]== "Recurring") {
echo "
<tr><th colspan='2'><span class='text-center'>Recurring A/C of ".$row["AA_NAME"]. "</span></th></tr>
<tr>
<th style='vertical-align: middle;'>Recurring A/C of ".$row["AA_NAME"]. "</th>
<td style='vertical-align: middle; text-align: right;'>
<form method='post' style='display: inline;'>
<input type='hidden' name='maturity_acno' value='".$row["AA_ACNO"]."'>
<button type='submit' name='recurring_maturity_submit' class='btn " . ($row["STATUS"] === 'matured' ? 'btn-success' : 'btn-info') . "'>" . ($row['STATUS'] === 'matured' ? 'Matured' : 'Mark as Matured') . "</button>
" . ($row["STATUS"] === 'matured' ? "<br/><span>" . date('d-m-Y', strtotime($row["CLOSING_DATE"])) . "</span>" : "") . "
</form>
</td>
</tr>
<tr>
<th>ACCOUNT NO.</th>
<td>".$row["AA_ACNO"]. "</td>

View File

@@ -26,6 +26,7 @@
// Login successful
$_SESSION['user_id'] = $user['user_id'];
$_SESSION['type'] = $user['type'];
$_SESSION['name'] = $user['user_name'];
echo "<div class='alert alert-success'>Login successful. Redirecting...</div>";
echo "<script>setTimeout(() => { window.location.href = '/Admin/View_AC?Type=Loan'; }, 2000);</script>";