prepare($query);
// Check if prepare() returns false, which indicates a problem
if ($stmt === false) {
die('Prepare failed: ' . $mysqli->error);
}
// Bind parameters to the query
$rc = $stmt->bind_param('sssssssssss', $name, $national_id, $client_number, $phone, $email, $password, $address, $zipcode, $gender, $pin, $profile_pic_path);
// Check if bind_param() was successful
if ($rc === false) {
die('Bind param failed: ' . $stmt->error);
}
// Execute the statement and check for errors
if ($stmt->execute()) {
// Success - Display success message and redirect
$success = "Account Created Successfully, Please, Login Now!";
echo "";
} else {
// If execution failed, show the error
$err = "Error executing query: " . $stmt->error;
}
} else {
$err = "Failed to upload profile picture.";
}
} else {
$err = "Error with file upload: " . $_FILES['profile_picture']['error'];
}
}
}
// Persist System Settings On Brand
$ret = "SELECT * FROM `iB_SystemSettings` ";
$stmt = $mysqli->prepare($ret);
$stmt->execute(); //ok
$res = $stmt->get_result();
while ($auth = $res->fetch_object()) {
// Handle login logic
if (isset($_POST['login'])) {
$email = $_POST['email'];
$password = sha1(md5($_POST['password'])); // Double encrypt password for security
$stmt = $mysqli->prepare("SELECT email, password, client_id FROM iB_clients WHERE email=? AND password=?");
$stmt->bind_param('ss', $email, $password);
$stmt->execute();
$stmt->bind_result($email, $password, $client_id);
$rs = $stmt->fetch();
$_SESSION['client_id'] = $client_id;
if ($rs) {
header("Location: core/client/pages_dashboard.php"); // Redirect on successful login
exit;
} else {
$err = "Access Denied. Please check your credentials."; // Display error on failed login
}
}
// Fetch system settings for brand information
$ret = "SELECT * FROM `iB_SystemSettings`";
$stmt = $mysqli->prepare($ret);
$stmt->execute();
$res = $stmt->get_result();
while ($auth = $res->fetch_object()) {
?>
Home | Mobile Banking, Credit Cards, Mortgages, Auto Loan