s1
This commit is contained in:
34
CONTENT/ROOT_URI/exe/get-loan-details/index.php
Normal file
34
CONTENT/ROOT_URI/exe/get-loan-details/index.php
Normal file
@@ -0,0 +1,34 @@
|
||||
<?php
|
||||
$response = new stdClass();
|
||||
$total = array();
|
||||
|
||||
if (isset($_POST["AA_ACNO"]) && !empty($_POST["AA_ACNO"])) {
|
||||
$AA_ACNO = $_POST["AA_ACNO"];
|
||||
|
||||
$conn = new mysqli($GLOBALS['host'], $GLOBALS['user'], $GLOBALS['pass'], $GLOBALS['db']);
|
||||
if ($conn->connect_error) die("Connection failed: " . $conn->connect_error);
|
||||
|
||||
$sql = "SELECT * FROM `" . $GLOBALS['arif_ac'] . "` WHERE `AA_ACNO` = '" . $conn->real_escape_string($AA_ACNO) . "'";
|
||||
$result = $conn->query($sql);
|
||||
|
||||
if ($result && $result->num_rows > 0) {
|
||||
$rows = array();
|
||||
while ($row = $result->fetch_assoc()) {
|
||||
$rows[] = $row;
|
||||
}
|
||||
$total['status'] = 'Success';
|
||||
$total['data'] = $rows;
|
||||
} else {
|
||||
$total['status'] = 'Error';
|
||||
$total['statusmsg'] = 'No record found for ACNO: ' . $AA_ACNO;
|
||||
}
|
||||
|
||||
$conn->close();
|
||||
} else {
|
||||
$total['status'] = 'Error';
|
||||
$total['statusmsg'] = 'AA_ACNO missing in request!';
|
||||
}
|
||||
|
||||
$response = $total;
|
||||
echo json_encode($response);
|
||||
?>
|
||||
@@ -3,9 +3,13 @@ $response = new stdClass();
|
||||
$total = array();
|
||||
if (isset($_POST["add_i"]) && isset($_POST["AA_ACNO"]) && is_numeric($_POST["add_i"]) && $_POST["add_i"] > 0) {
|
||||
if(isset($_POST["ins_no"])) $ins_no = $_POST["ins_no"]; else $ins_no = 1;
|
||||
|
||||
if(isset($_POST["fine_amount"])) $fine_amt = $_POST["fine_amount"]; else $fine_amt = 0;
|
||||
|
||||
$conn = new mysqli($GLOBALS['host'], $GLOBALS['user'], $GLOBALS['pass'], $GLOBALS['db']);
|
||||
|
||||
if ($conn->connect_error) die("Connection failed: " . $conn->connect_error);
|
||||
|
||||
if ($conn->query("UPDATE `" . $GLOBALS['arif_ac'] . "` SET `AA_FINE` = `AA_FINE` + 5, `AA_BAL` = `AA_BAL`+".$_POST["add_i"]." , `AA_NO_OF_PAYPAID` = `AA_NO_OF_PAYPAID`+".$ins_no." WHERE `AA_ACNO` = '" . $_POST["AA_ACNO"] . "'"));
|
||||
//Add entry to Transaction
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user