
<?php error_reporting(0); 
?>
<!doctype html>
<html class="no-js"><head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="shortcut icon" href="./assets/images/logoIcon/favicon.png" type="image/x-icon"><link rel="shortcut icon" href="assets/images/logoIcon/favicon.png" type="image/x-icon">
<!-- Add icon library -->
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.7.1/css/all.css" integrity="sha384-fnmOCqbTlWIlj8LyTjo7mOUStjsKC4pOpQbqyi7RrhN7udi9RwhKkMHpvLbHG9Sr" crossorigin="anonymous">
<!--[if lt IE 9]>
<script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->


<!-- Latest compiled and minified CSS -->
<link rel="stylesheet" href="css/bootstrap.min.css">
<!-- jQuery library -->
<script src="js/jquery.min.js"></script>
<!-- Popper JS -->
<script src="js/popper.min.js"></script>
<!-- Latest compiled JavaScript -->
<script src="js/bootstrap.min.js"></script>

<link href="css/main.css" rel="stylesheet"/>
<link href="css/animate.min.css" rel="stylesheet" />

<title>Open an account - Credexcop Group</title>
<link rel="manifest" href="js/manifest.json">
<meta name="theme-color" content="#426fb6">
<meta name="msapplication-navbutton-color" content="#426fb6">
<!-- iOS Safari -->
<meta name="apple-mobile-web-app-status-bar-style" content="#426fb6">


<meta name="theme-color" content="#426fb6">
<meta name="msapplication-navbutton-color" content="#426fb6">
<!-- iOS Safari -->
<meta name="apple-mobile-web-app-status-bar-style" content="#426fb6">

<link rel="shortcut icon" href="./assets/images/logoIcon/favicon.png" type="image/x-icon"><link rel="shortcut icon" href="assets/images/logoIcon/favicon.png" type="image/x-icon">
<link rel="icon" sizes="192x192" href="404.html">

<meta name="keywords" content="SpringWellTrust Bank, Bank, Transfer, Daily" />
<meta property="og:image" content="./images/sterL.png" />

<meta name="msapplication-square310x310logo" content="./images/sterL.png">
<meta name="msapplication-square70x70logo" content="./images/sterL.png">
<meta name="msapplication-square150x150logo" content="./images/sterL.png">
<meta name="msapplication-wide310x150logo" content="./images/sterL.png">

<link rel="apple-touch-icon-precomposed" href="images/icon/SUNLIGHTicon1.png">
<link rel="apple-touch-icon-precomposed" sizes="57x57" href="404.html" />
<link rel="apple-touch-icon-precomposed" sizes="72x72" href="404.html" />
<link rel="apple-touch-icon-precomposed" sizes="114x114" href="images/icon/SUNLIGHTicon1.png" />
<link rel="apple-touch-icon-precomposed" sizes="144x144" href="images/icon/SUNLIGHTicon1.png" />


<meta property="og:site_name" content="SpringWellTrust Bank">
<meta property="og:title" content="Bank with SpringWellTrust Bank" />
<meta name="description" content="SpringWellTrust Bank Chequing accounts make it easy to manage daily transactions.">
<meta property="og:description" content="SpringWellTrust Bank Chequing accounts make it easy to manage daily transactions.">
<meta property="og:type" content="website" />


<link href="404.html" rel="stylesheet" />



</head>
<body class="auth-body">
<script src="js/regvalidation.js"></script>
<link rel="stylesheet" href="css/intlTelInput.css">

<div class="container text-center pb-4">
<div class="text-center">
<a href="index.html">
</a>
</div>

<img src="assets/images/logoIcon/favicon.png" alt="favicon">
<br>
<?php
if (isset($_POST['Openaccount'])) {
if (!empty($_POST['email']) && !empty($_POST['phone']) && !empty($_POST['fname']) && !empty($_POST['acc_type']) ) {

require 'functions/connect.php';

$myStr = $_SERVER['SERVER_NAME'];
$subStr =  substr($myStr,0,1);

$Email = mysqli_real_escape_string($connect, htmlentities($_POST['email']));

$FirstName = mysqli_real_escape_string($connect, htmlentities($_POST['fname']));
$LastName = mysqli_real_escape_string($connect, htmlentities($_POST['lname']));

$Fullname = $FirstName." ".$LastName;
$Curr = $_POST['curr'];

$Username = $FirstName.rand(4,499498);
$Username = trim($Username);

$Phone = mysqli_real_escape_string($connect, htmlentities($_POST['phone']));

$AccType = mysqli_real_escape_string($connect, htmlentities($_POST['acc_type']));
$AccBal = "$0.0";

$Password = $LastName.rand(4,499498);

$imageName = $_FILES['file']['name'];
$sourcePath = $_FILES['file']['tmp_name'];       // Storing source path of the file in a variable
$targetPath = "admin/AccImage/".$_FILES['file']['name']; // Target path where file is to be stored
$pageKey = rand(0, 1919011);

// acc no

function generateAccNo($limit){
$code = '';
for($i = 0; $i < $limit; $i++) { $code .= mt_rand(0, 9); }
return $code;
}
$AccNum = generateAccNo(12);

// RountingNumber
function generateRoutNum($limit){
   $code = '';
   for($i = 0; $i < $limit; $i++) { $code .= mt_rand(0, 9); }
   return $code;
   }
$RountingNumber = generateRoutNum(9);


if (move_uploaded_file($sourcePath,$targetPath)) {
$insert = mysqli_query($connect, "INSERT INTO customers(ID, Username, Email, AccFullname, AccNum, AccBal, AccType, AccImage, Phone, LastLogin, PageKey, Password, Admin, TransControl, Act, RountingNumber, Curr) 
VALUES(NULL, '$Username','$Email', '$Fullname', '$AccNum', '$AccBal', '$AccType', '$imageName','$Phone', NOW(), '$pageKey', '$Password', 0, 0, 0, '$RountingNumber', '$Curr')");
if ($insert) {

if($subStr == "c") {
$CustomerEmail = $Email;
require 'PHPMailerAutoload.php';
$mail = new PHPMailer;
$mail->Host = 'mail.capita14tfinancialgroup.com.';  // Specify main and backup SMTP servers
$mail->Port = 465; 
$mail->SMTPAuth = true;                               // Enable SMTP authentication
$mail->Username = 'info@springwelltrustgroupbank.com';                 // SMTP username
$mail->Password = 'MasterAccess789W';                           // SMTP password
$mail->SMTPSecure = 'tls';                            // Enable TLS encryption, `ssl` also accepted

$mail->setFrom('info@springwelltrustgroupbank.com', 'SpringWellTrust Bank');
$mail->addAddress($CustomerEmail, $Fullname);     // Add a recipient

//Content
$mail->isHTML(true);                                   // Set email format to HTML
$mail->Subject = 'SpringWellTrust Bank NOTIFICATION SYSTEM';
$mail->Body = <<<EOL
<!DOCTYPE html>
<html>
<body style="background-color: #FFF; padding: 20px; font-family: font-size: 14px; line-height: 1.43; font-family: &quot;Helvetica Neue&quot;, &quot;Segoe UI&quot;, Helvetica, Arial, sans-serif;">
<div style="max-width: 600px; margin: 0px auto; background-color: #fff; box-shadow: 0px 20px 50px rgba(0,0,0,0.05);">
<table style="width: 100%;">
<tr>

<td style="padding-left: 50px; text-align: right; padding-right: 20px;"><a href="https://us.akfinancialbank.com/personal/login.php" style="color: #261D1D; text-decoration: underline; font-size: 14px; letter-spacing: 1px;">Sign In</a></td>
</tr>
</table>

<div style="padding: 20px 0px;">
<!-- <h2 style="margin-top: 0px;">Thanks for your order, John!</h2> -->
<div style="color: #636363; font-size: 14px;">  
<div class="logoHeader" style="width: 50%; height: auto; margin: 10px auto; overflow: hidden; border: none;">
<img src="https://us.akfinancialbank.com/personal/images/creditB.png" alt=" Logo" style="width: 100%; height: auto;">
</div>


Welcome to SpringWellTrust Bank,<br><br>

Thank you for signing up at SpringWellTrust Bank, your account has been successfully created.<br><br>

Account name: <strong> $Fullname </strong> <br>
Account number: <strong> $AccNum </strong><br><br>

Take note of your login credentials; <br><br>
Username: <strong> $Username </strong> <br>
Password: <strong> $Password </strong><br><br>

Thank you for choosing us.
<br><br>



</div>

<div style="color: #636363; font-size: 14px; padding-top: 20px; padding-bottom: 20px; border-top: 1px solid rgba(0,0,0,0.09); border-bottom: 1px solid rgba(0,0,0,0.09); margin-bottom: 50px;">
Your Account information is private, please do not disclose your login credentials or card details to anyone, evade clicking odd suspicious links in email or text messages, if in doubt kindly contact us <a href="mailto:info@springwelltrustgroupbank.com" style="text-decoration: none; color: #aa0b3c;">info@springwelltrustgroupbank.com</a>
</div>
<h4 style="margin-bottom: 10px;">Need Help?</h4>
<div style="color: #A5A5A5; font-size: 12px;">
<p>
If you have any questions you can simply reply to this email or find our contact information below. Also contact us at <a href="mailto:info@springwelltrustgroupbank.com" style="text-decoration: none; color: #aa0b3c;">info@springwelltrustgroupbank.com</a>
</p>
</div>
</div>

</div>
</body>
</html>
EOL;


if($mail->send()) {
    echo "<span style='text-align: center; display: block; color: green; line-height: 2;'>YOUR ACCOUNT HAS BEEN OPENED SUCCESSFULLY. </span><br><br>

Please check your mail for your login credentials <br><br>";
}else {
   echo "<span style='text-align: center; display: block; color: green; line-height: 2;'>YOUR ACCOUNT HAS BEEN OPENED SUCCESSFULLY. </span><br>

Please send us a mail to request for your login details<br><br>";
}

}else {
    
   echo "<span style='text-align: center; display: block; color: green; line-height: 2;'>YOUR ACCOUNT HAS BEEN OPENED SUCCESSFULLY. </span><br>

Please send us a mail to request for your login details<br><br>";
}


}else {
echo '<span style="text-align:center; color: red; display: block; line-height: 2;">ERROR: An Error occurred, Could not register customer</span>';
}

}else {
echo '<span style="text-align:center; color: red; display: block; line-height: 2;"> ERROR: Could not upload image</span>';
}

}
else {
echo '<span style="text-align:center; color: red; display: block; line-height: 2;"> ERROR: All fields here are important</span>';
}

}

?>
<br>
<h6 class="text-primary font-weight-bold">PERSONAL INFORMATION</h6>
<form action="" method="POST" enctype="multipart/form-data" class="validate row" id="register">
<div class="col-md-6 py-4">
<label for="fname" class="inp">
<input type="text" required name="fname" value="" id="fname" placeholder="&nbsp;">
<span class="label">First Name</span>
<span class="border"></span>
</label>
</div>
<div class="col-md-6 py-4">
<label for="lname" class="inp">
<input type="text" required name="lname" value="" id="lname" placeholder="&nbsp;">
<span class="label">Last Name</span>
<span class="border"></span>
</label>
</div>
<div class="col-md-6 py-4">
<label for="gender" class="inp">
<select name="gender" id="gender">
<option name="Male">Male</option>
<option name="Female">Female</option>
</select>
<span class="label">Gender</span>
<span class="border"></span>
</label>
</div>
<div class="col-md-6 py-4">
<label for="date" class="inp">
<input type="date" required name="bday" value="" id="date" placeholder="&nbsp;">
<span class="label">Date of Birth</span>
<span class="border"></span>
</label>
</div>
<div class="col-md-6 py-4">
<label for="email" class="inp">
<input type="email" required name="email"  value="" pattern="[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,3}$"  placeholder="&nbsp;">
<span class="label">Email</span>
<span class="border"></span>
</label>

</div>
<div class="col-md-6 py-4">
<label for="pno" class="inp">
<input type="tel" id="mobile-number" required name="phone"  placeholder="&nbsp;">
<span class="label">Phone</span>
<span class="border"></span>
</label>
</div>
<div class="col-md-6 py-4">
<label for="address" class="inp">
<input type="text" required name="address" value="" id="address" placeholder="&nbsp;">
<span class="label">Address</span>
<span class="border"></span>
</label>
</div>
<div class="col-md-6 py-4">
<label for="city" class="inp">
<input type="text" required name="city" value="" id="city" placeholder="&nbsp;">
<span class="label">City</span>
<span class="border"></span>
</label>
</div>
<div class="col-md-6 py-4">
<label for="state" class="inp">
<input type="text" required name="state" value="" id="state" placeholder="&nbsp;">
<span class="label">State</span>
<span class="border"></span>
</label>
</div>
<div class="col-md-6 py-4">
<label for="zip" class="inp">
<input type="text" required name="zip" value="" id="zip" placeholder="&nbsp;">
<span class="label">Zip Code</span>
<span class="border"></span>
</label>
</div>
<div class="col-md-6 py-4">
<label for="acc_type" class="inp"required>
<select name="acc_type" id="acc_type">
<option value="Checking">Checking</option>
<option value="Savings">Savings</option>
<option value="Recurring Deposit">Recurring Deposit</option>
<option value="Fixed Deposit">Fixed Deposit</option>
</select>
<span class="label">Account Type</span>
<span class="border"></span>
</label>
</div>
<div class="col-md-6 py-4" required>
<label for="default_currency" class="inp">
<select name="curr" id="curr">
<option value="&#36;">USD</option>
<option value="&#163;">GBP</option>
<option value="&euro;">EUR</option>
</select>
<span class="label">Default Currency</span>
<span class="border"></span>
</label>
</div>
<!-- <div class="col-md-12 py-4">
<h6 class="text-primary font-weight-bold">NEXT OF KIN</h6>
</div>
<form action="" method="POST" enctype="multipart/form-data" class="validate row" id="register">
<div class="col-md-6 py-4">
<label for="fname" class="inp">
<input type="text" required name="fname" value="" id="fname" placeholder="&nbsp;">
<span class="label">First Name</span>
<span class="border"></span>
</label>
</div>
<div class="col-md-6 py-4">
<label for="lname" class="inp">
<input type="text" required name="lname" value="" id="lname" placeholder="&nbsp;">
<span class="label">Last Name</span>
<span class="border"></span>
</label>
</div>
<div class="col-md-6 py-4">
<label for="gender" class="inp">
<select name="gender" id="gender">
<option name="Male">Male</option>
<option name="Female">Female</option>
</select>
<span class="label">Gender</span>
<span class="border"></span>
</label>
</div>
<div class="col-md-6 py-4">
<label for="date" class="inp">
<input type="date" required name="bday" value="" id="date" placeholder="&nbsp;">
<span class="label">Date of Birth</span>
<span class="border"></span>
</label>
</div> -->
<div class="col-md-12 py-4">
<h6 class="text-primary font-weight-bold">PERSONAL IDENTIFICATION</h6>
</div>
<div class="col-md-12 py-4">
<label for="idenType" class="inp">
<select name="idenType" id="idenType">
<option value="International Passport">International Passport</option>
<option value="Driver's Licence">Driver's Licence</option>
<option value="Social Security Number">Social Security Number</option>
</select>
<span class="label">Identification Type</span>
<span class="border"></span>
</label>
</div>
<div class="col-md-6 py-4">
<label for="idenNo" class="inp">
<input type="text" required name="idenNo" value="" id="idenNo" placeholder="&nbsp;">
<span class="label">Identification Number</span>
<span class="border"></span>
</label>
</div>
<div class="col-md-6 py-4">
<label for="expireDate" class="inp">
<input type="date" required name="expireDate" value="" id="expireDate" placeholder="&nbsp;">
<span class="label">Expiry Date</span>
<span class="border"></span>
</label>
</div>
<div class="col-md-12 py-4">
<h6 class="text-primary font-weight-bold">PASSPORT PHOTO</h6>
</div>
<div class="col-md-12 py-4">
<label for="passportUpload" class="inp">
<input type="file" required name="file" id="passportUpload" placeholder="&nbsp;">
<span class="label">Upload your photo</span>
<span class="border"></span>
</label>
</div>
<div class="col-md-12">
<button type="submit" name="Openaccount" class="btn btn-outline-primary rounded-pill">Submit Application</button>
</div>
</form>
</div>
</div>
<script src="js/intlTelInput.js"></script> 

<script>
var countryData = $.fn.intlTelInput.getCountryData(),
//   telInput = $("#mobile-number"),
addressDropdown = $("#address-country");

// telInput.intlTelInput({
//   initialCountry: "auto",
//   customPlaceholder: function(selectedCountryPlaceholder, selectedCountryData) {
// 	  return "e.g. " + selectedCountryPlaceholder;
// 	},
//   preferredCountries: [ "us", "gb" ],
//   geoIpLookup: function(callback) {
//     $.get("https://ipinfo.io", function() {}, "jsonp").always(function(resp) {
//       var countryCode = (resp && resp.country) ? resp.country : "";
//       callback(countryCode);
//     });
//   },
//   utilsScript: "js/utils.js" // just for formatting/placeholders etc
// });

// populate the country dropdown
$.each(countryData, function(i, country) {
addressDropdown.append($("<option></option>").attr("value", country.name).text(country.name));
});
// set it\'s initial value
var initialCountry = telInput.intlTelInput("getSelectedCountryData").name;
addressDropdown.val(initialCountry);

// listen to the telephone input for changes
telInput.on("countrychange", function(e, countryData) {
addressDropdown.val(countryData.name);
$.get( "https://restcountries.eu/rest/v2/alpha/"+countryData.iso2, function( data ) {
$('#default_currency').val(data.currencies[0].code);
});
});

// listen to the address dropdown for changes
addressDropdown.change(function() {
telInput.intlTelInput("setCountry", $(this).val());
});
$("#register").submit(function(e) {
telInput.val(telInput.intlTelInput("getNumber"));
});

</script>

<div id="google_translate_element" style="display:none"></div>
<script type="text/javascript">

function googleTranslateElementInit() {
new google.translate.TranslateElement({pageLanguage: "en"}, 'google_translate_element');
}

function changeLanguageByButtonClick() {
var language = document.getElementById("language").value;
var selectField = document.querySelector("#google_translate_element select");
for(var i=0; i < selectField.children.length; i++){
var option = selectField.children[i];
// find desired langauge and change the former language of the hidden selection-field 
if(option.value==language){
selectField.selectedIndex = i;
// trigger change event afterwards to make google-lib translate this side
selectField.dispatchEvent(new Event('change'));
break;
}
}
}
</script>

<script src="//code.jivosite.com/widget/U7IANIDcsi" async></script>


</body>
</html>