1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74
| <?php
session_start();
include('conf/config.php');
include('conf/checklogin.php');
check_login();
$admin_id = $_SESSION['admin_id'];
//register new account
if (isset($_POST['deposit'])) {
$tr_code = $_POST['tr_code'];
$account_id = $_GET['account_id'];
$acc_name = $_POST['acc_name'];
$account_number = $_GET['account_number'];
$acc_type = $_POST['acc_type'];
//$acc_amount = $_POST['acc_amount'];
$tr_type = $_POST['tr_type'];
$tr_status = $_POST['tr_status'];
$client_id = $_GET['client_id'];
$client_name = $_POST['client_name'];
$client_national_id = $_POST['client_national_id'];
$transaction_amt = $_POST['transaction_amt'];
$client_phone = $_POST['client_phone'];
//$acc_new_amt = $_POST['acc_new_amt'];
//Notication
$notification_details = "$client_name Has Deposited Ksh $transaction_amt To Bank Account $account_number";
//Insert Captured information to a database table
$query = "INSERT INTO iB_Transactions (tr_code, account_id, acc_name, account_number, acc_type, tr_type, tr_status, client_id, client_name, client_national_id, transaction_amt, client_phone) VALUES (?,?,?,?,?,?,?,?,?,?,?,?)";
$notification = "INSERT INTO iB_notifications (notification_details) VALUES (?)";
$stmt = $mysqli->prepare($query);
$notification_stmt = $mysqli->prepare($notification);
//bind paramaters
$rc = $notification_stmt->bind_param('s', $notification_details);
$rc = $stmt->bind_param('ssssssssssss', $tr_code, $account_id, $acc_name, $account_number, $acc_type, $tr_type, $tr_status, $client_id, $client_name, $client_national_id, $transaction_amt, $client_phone);
$stmt->execute();
$notification_stmt->execute();
//declare a varible which will be passed to alert function
if ($stmt && $notification_stmt) {
$success = "Money Deposited";
} else {
$err = "Please Try Again Or Try Later";
}
}
if(isset($_POST['deposit']))
{
$account_id = $_GET['account_id'];
$acc_amount = $_POST['acc_amount'];
//Insert Captured information to a database table
$query="UPDATE iB_bankAccounts SET acc_amount=? WHERE account_id=?";
$stmt = $mysqli->prepare($query);
//bind paramaters
$rc=$stmt->bind_param('si', $acc_amount, $account_id);
$stmt->execute();
//declare a varible which will be passed to alert function
if($stmt )
{
$success = "Money Deposited";
}
else
{
$err = "Please Try Again Or Try Later";
}
}
?> |
Partager