<?php include("includes/header.php"); ?>
<?php
$b_firstname = $_POST["b_firstname"];
$b_middlename = $_POST["b_middlename"];
$b_lastname = $_POST["b_lastname"];
$b_email = $_POST["b_email"];
$b_gender = $_POST["b_gender"];
$b_phone = $_POST["b_phone"];
$b_currency = $_POST["b_currency"];


$b_country = $_POST["b_country"];
$b_state = $_POST["b_state"];
$b_city = $_POST["b_city"];
$b_zip_code = $_POST["b_zip_code"];
$b_address = $_POST["b_address"];


$b_password = $_POST["b_password"];
$b_password2 = $_POST["b_password2"];


$b_account_type = $_POST["b_account_type"];


$b_amount = "0.00";

//Account NUmber
    //Set account number
    $ans = "1234567890";
    $an = str_shuffle($ans);
    $an = substr($an, 1,8);
    $anN = str_shuffle($an);
    $b_account_number = "20".$anN;
$b_profile_pics = "NULL";

//ACCOUNT ID
$account_id = "1234567890";
$account_id = str_shuffle($account_id);
$account_id = substr($account_id, 1,8);
$account_id = str_shuffle($account_id);
$account_id = "FS".$account_id;

//ACCOUNT PIN
$account_pin = "1234567890";
$account_pin = str_shuffle($account_pin);
$account_pin = substr($account_pin, 1,4);
$account_pin = str_shuffle($account_pin);


$account_status = "Active";

/////////////////////////////////////////

$visa_card_balance = 0;
$maestro_card_balance = 0;
$amex_card_balance = 0;
$discover_card_balance = 0;
$card_status = "1";

$car_loan_balance = 0;
$home_loan_balance = 0;
$business_loan_balance = 0;
$medical_loan_balance = 0;
$loan_status = "1";


$bcode_status = 0;
$bcodes_type = "NULL";

//echo "<script>alert('gg');</script>";

//QUERY TO INSERT INTO DB
$query = mysqli_query($conn, "INSERT INTO users VALUES('', '$b_firstname', '$b_middlename', '$b_lastname', '$b_email', '$b_gender', '$b_phone', '$b_country', '$b_state', '$b_city', '$b_zip_code', '$b_address', '$b_amount', '$b_account_number', '$b_account_type', '$b_profile_pics', '$b_password', '$b_password2', '$account_id', '$account_pin', '$account_status', '$b_currency', '$visa_card_balance', '$maestro_card_balance', '$amex_card_balance', '$discover_card_balance', '$card_status', '$car_loan_balance', '$home_loan_balance', '$business_loan_balance', '$medical_loan_balance', '$loan_status', '$bcode_status', '$bcodes_type')");

//SEND MAIL CONTAINING USER ID.......

include("apply-now-mailer.php");

    
                
echo "<script>window.location.assign('signup_success.php');</script>";

echo "<script>$('#hide-fa').hide();</script>";




?>