add agent name in navbar, add matiruty button in recurring
This commit is contained in:
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user