allow and disallow multiple payment
This commit is contained in:
@@ -83,6 +83,26 @@
|
||||
}
|
||||
}
|
||||
|
||||
if (isset($_POST['allowMultiple_submit']) && !empty($_POST['allowMultiple_acno'])) {
|
||||
$acno = $_POST['allowMultiple_acno'];
|
||||
$action = $_POST['allowMultiple_action']; // will be 1 or 0
|
||||
|
||||
$sql = "UPDATE `{$GLOBALS['arif_ac']}` SET allowMultiple = ? WHERE AA_ACNO = ?";
|
||||
$stmt = $conn->prepare($sql);
|
||||
|
||||
if ($stmt->bind_param("is", $action, $acno) && $stmt->execute()) {
|
||||
if ($action == 1) {
|
||||
echo "<div class='alert alert-success'>Multiple payments <strong>allowed</strong> for A/C {$acno}.</div>";
|
||||
} else {
|
||||
echo "<div class='alert alert-info'>Multiple payments <strong>disallowed</strong> for A/C {$acno}.</div>";
|
||||
}
|
||||
} else {
|
||||
echo "<div class='alert alert-danger'>Failed to update multiple payment setting for A/C {$acno}.</div>";
|
||||
}
|
||||
|
||||
$stmt->close();
|
||||
}
|
||||
|
||||
// Get agent list for dropdown
|
||||
$getAgentListsQuery = "SELECT * FROM " . $GLOBALS['arif_users'] . "";
|
||||
$agentResult = $conn->query($getAgentListsQuery);
|
||||
@@ -199,7 +219,19 @@
|
||||
<input type='hidden' name='maturity_action' value='".($isMatured ? 'unmature' : 'mature')."'>
|
||||
<button type='submit' name='recurring_maturity_submit' class='btn " . ($isMatured ? 'btn-warning' : 'btn-info') . "'>" . ($isMatured ? 'Mark as Active' : 'Mark as Matured') . "</button>
|
||||
" . ($isMatured ? "<br/><span>Matured on: " . date('d-m-Y', strtotime($row["CLOSING_DATE"])) . "</span>" : "") . "
|
||||
</form>
|
||||
</form>";
|
||||
if (isset($_SESSION['type']) && $_SESSION['type'] === 'admin') {
|
||||
echo "
|
||||
<form method='post' style='display:inline;'>
|
||||
<input type='hidden' name='allowMultiple_acno' value='" . $row['AA_ACNO'] . "'>
|
||||
<input type='hidden' name='allowMultiple_action' value='" . ($row["allowMultiple"] == 0 ? 1 : 0) . "'>
|
||||
<button type='submit' name='allowMultiple_submit'
|
||||
class='btn " . ($row["allowMultiple"] == 0 ? 'btn-warning' : 'btn-primary') . "'>
|
||||
" . ($row["allowMultiple"] == 0 ? 'Allow Multiple' : 'Disallow Multiple') . "
|
||||
</button>
|
||||
</form>";
|
||||
}
|
||||
echo "
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
|
||||
Reference in New Issue
Block a user