<?php
session_start();
require_once 'backend/class.admin.php';
include_once ('backend/session.php');



$reg_user = new USER();

if (isset($_POST['create'])) {


    $fname = trim($_POST['fname']);
    $fname = strip_tags($fname);
    $fname = htmlspecialchars($fname);

    $mname = trim($_POST['mname']);
    $mname = strip_tags($mname);
    $mname = htmlspecialchars($mname);

    $lname = trim($_POST['lname']);
    $lname = strip_tags($lname);
    $lname = htmlspecialchars($lname);

    $uname = trim($_POST['uname']);
    $uname = strip_tags($uname);
    $uname = htmlspecialchars($uname);

    $upass = $_POST['upass'];
    $upass = md5($upass);

    $phone = trim($_POST['phone']);
    $phone = strip_tags($phone);
    $phone = htmlspecialchars($phone);

    $email = trim($_POST['email']);
    $email = strip_tags($email);
    $email = htmlspecialchars($email);

    $type = trim($_POST['type']);
    $type = strip_tags($type);
    $type = htmlspecialchars($type);

    $reg_date = trim($_POST['reg_date']);

    $work = trim($_POST['work']);
    $work = strip_tags($work);
    $work = htmlspecialchars($work);

    $acc_no = trim($_POST['acc_no']);
    $acc_no = strip_tags($acc_no);
    $acc_no = htmlspecialchars($acc_no);

    $addr = trim($_POST['addr']);
    $addr = strip_tags($addr);
    $addr = htmlspecialchars($addr);

    $sex = trim($_POST['sex']);
    $sex = strip_tags($sex);
    $sex = htmlspecialchars($sex);

    $dob = trim($_POST['dob']);
    $dob = strip_tags($dob);
    $dob = htmlspecialchars($dob);

    $marry = trim($_POST['marry']);
    $marry = strip_tags($marry);
    $marry = htmlspecialchars($marry);

    $t_bal = trim($_POST['t_bal']);
    $t_bal = strip_tags($t_bal);
    $t_bal = htmlspecialchars($t_bal);

    $a_bal = trim($_POST['a_bal']);
    $a_bal = strip_tags($a_bal);
    $a_bal = htmlspecialchars($a_bal);

    $currency = trim($_POST['currency']);
    $currency = strip_tags($currency);
    $currency = htmlspecialchars($currency);

    $cot = trim($_POST['cot']);
    $cot = strip_tags($cot);
    $cot = htmlspecialchars($cot);

    $tax = trim($_POST['tax']);
    $tax = strip_tags($tax);
    $tax = htmlspecialchars($tax);

    $imf = trim($_POST['imf']);
    $imf = strip_tags($imf);
    $imf = htmlspecialchars($imf);
    
    $pin_auth = trim($_POST['pin_auth']);
    $pin_auth = strip_tags($pin_auth);
    $pin_auth = htmlspecialchars($pin_auth);

    $pin = trim($_POST['pin']);
    $pin = strip_tags($pin);
    $pin = htmlspecialchars($pin);
    
    $verify = trim($_POST['verify']);
    $verify = strip_tags($verify);
    $verify = htmlspecialchars($verify);
    
    $verify = trim($_POST['verify']);
    $verify = strip_tags($verify);
    $verify = htmlspecialchars($verify);
    
    $status = trim($_POST['status']);
    $status = strip_tags($status);
    $status = htmlspecialchars($status);



    $stmt = $reg_user->runQuery("SELECT * FROM account WHERE email=:email");
    $stmt1 = $reg_user->runQuery("SELECT * FROM account WHERE uname=:uname");
    $stmt->execute(array(":email" => $email));
    $stmt1->execute(array(":uname" => $uname));
    $row = $stmt->fetch(PDO::FETCH_ASSOC);
    $row1 = $stmt1->fetch(PDO::FETCH_ASSOC);


    if ($stmt->rowCount() > 0 || $stmt1->rowCount() > 0) {
        $msg = "
		        <div class='alert alert-danger alert-dismissible text-white' role='alert'>
                <span class='text-sm'>Email or Username Already Exist!!!</span>
                <button type='button' class='btn-close text-lg py-3 opacity-10' data-bs-dismiss='alert' aria-label='Close'>
                  <span aria-hidden='true'>&times;</span>
                </button>
              </div>
			  ";
    } else {
        if ($reg_user->createsign($fname, $mname, $lname, $uname, $upass, $phone, $email, $type, $reg_date, $work, $acc_no, $addr, $sex, $dob, $marry, $t_bal, $a_bal, $currency, $cot, $tax, $imf, $pin_auth, $pin, $verify, $status)) {
            $id = $reg_user->lasdID();



$stmt = $reg_user->runQuery("SELECT * FROM bank_settings WHERE id = '1'");
$stmt->execute();
$row = $stmt->fetch(PDO::FETCH_ASSOC); 
$bank_site_name  = $row["bank_site_name"];
$bank_site_address  = $row["bank_site_address"];
$bank_site_logo  = $row["bank_site_logo"];


            $messag = "	
			
	 <link href='https://fonts.googleapis.com/css?family=Kreon:400,700|Playfair+Display:400,400i,700,700i|Raleway:400,400i,700,700i|Roboto:400,400i,700,700i' rel='stylesheet' />
         
 

</div>   	 
    <!-- INTRODUCTION -->
<table width='100%' border='0' cellspacing='0' cellpadding='0' align='center'>
    <tr>
        <td bgcolor='#fbfdfd'>
            <table width='620' border='0' cellspacing='0' cellpadding='0' align='center' class='scale'>
                <tr>
                    <td bgcolor='#FFFFFF'>
                 
                        <table width='540' border='0' cellspacing='0' cellpadding='0' align='center' class='agile1 scale'>
                            
                           <tr ><td colspan='2' class='wls-5h' style='color:white; background-color:white; text-align:center; border-radius:0px;'><h1><strong><img src='$bank_site_logo' alt='' data-default='placeholder' data-max-width='120' width='200' height='70' ></strong></h1></td></tr> 
                            <tr ><td colspan='2' height='12' style='font-size: 1px;'>&nbsp;</td></tr>
                            <tr>
                                <td class='agile-main' align='center' colspan='2' style='font-family:Bell Gothic Std; color: green; font-size: 22px;' class='scale-center-both'>
								
								<strong style='color:#2e7ca2'><u>ACCOUNT NOTIFICATION</u></strong></td>
                            </tr>
                            <tr><td height='12' style='font-size: 1px;'>&nbsp;</td></tr>
							
							   <tr>
                                <td class='w3l-p2' colspan='2' style='font-family: Candara, sans-serif; color:red; font-size: 20px; line-height: 18px;' class='scale-center-both'>
                                   Dear $fname $lname,
                                </td>
                            </tr>
							<tr><td height='12' style='font-size: 1px;'>&nbsp;</td></tr>
							
                           <tr>
                                <td class='w3l-p2' colspan='2' style='font-family: Candara, sans-serif; color:black; font-size: 18px; line-height: 28px;' class='scale-center-both'>
                            Congratulations,Your Account have been created Successfully, Please, note that your Internet Banking is being process and you will need a 
									  combination of your username and password to access your online banking once it get activated on: https://demo.71mail.online
                                </td>
                            </tr>
                            <tr><td height='12' colspan='2' style='font-size: 1px;'><hr></td></tr>
                             <tr><td height='12' align='left' style='font-size: 14px; line-height: 28px; font-weight:700; color:black;'>ACCOUNT NUMBER:</td> <td style='font-size: 16px; font-weight:700; color:#2e7ca2;'> $acc_no</td></tr>
                             <tr><td height='12' align='left' style='font-size: 14px; line-height: 28px; font-weight:700; color:black;'>ACCOUNT USERID:</td> <td style='font-size: 16px; font-weight:700; color:#2e7ca2;'> $uname</td></tr>
                              <tr><td height='12' align='left' style='font-size: 14px; line-height: 28px; font-weight:700; color:black;'>PASSWORD:</td> <td style='font-size: 16px; font-weight:700; color:#2e7ca2;'> Your Password</td></tr>
                          <tr><td height='12' align='left' style='font-size: 14px; line-height: 28px; font-weight:700; color:black;'>PIN NUMBER:</td> <td style='font-size: 16px; font-weight:700; color:#2e7ca2;'> $pin_auth</td></tr>
                        <tr><td height='12'align='left' style='font-size: 14px; line-height: 28px; font-weight:700;color:black;'>OPENING BALANCE: </td>           <td style='font-size: 16px; font-weight:700; color:#2e7ca2;'>0.00</td></tr> 
                        <tr><td height='12' align='left' style='font-size: 14px; line-height: 28px; font-weight:700; color:black;'>STATUS</td>  <td style='font-size: 16px; font-weight:700; color:red;'>PROCESSING...</td></tr>
                                      
             
             
                            <tr><td height='12' colspan='2' style='font-size: 1px;'><hr></td></tr>
                               <tr>
                                <td class='w3l-p2' colspan='2' style='font-family: Candara, sans-serif; color:black; font-size: 18px; line-height: 28px;' class='scale-center-both'>
                        Please Note that you will be required to login with username, your registered 
                        password and account PIN to enable you access your dashboard
                                </td>
                            </tr>
                                      
                 
                             <tr><td class='wls-5h' height='60' align='left'  colspan='2'  style='font-size: 18px; color:red;'> Warm Regards,</td><td>&nbsp;</td></tr> 
	                        
	                         <tr><td class='wls-5h' height='60'  align='left' colspan='2' style='font-size: 20px; color:#2e7ca2;'><strong>$bank_site_name  </strong></td></tr>
    	             
    	             
								<tr>
                                <td class='w3l-p2' colspan='2' style='font-family: Candara, sans-serif; color:red; font-size: 14px; line-height: 18px; text-align:center;' class='scale-center-both'>
                                   An email really coming from us will address you by your registered first and last name or your business name.
                                </td>
                            </tr>
    	             
                        </table>    
            
                    </td>
                </tr>
            </table>
            
        </td>
    </tr>
</table>				
								
								


";

 

            $subject = "Hello $fname - Your Application have been recieved!"; 
            $send_otp_mobile = preg_replace('/[^0-9]/', '', $_POST['phone']);
            $reg_user->send_mail($email, $messag, $subject);
            //$reg_user->otp($send_otp_mobile, $subject);


 

             header('Location: enroll_success.php');

            
        } else {
            echo "Sorry , Query could no execute...";
        }
    }
}
?>
<?php
session_start();


 
if (isset($_POST['lname'])) { 
    $_SESSION['lname'] = $_POST['lname'];
}

 if (isset($_POST['fname'])) { 
    $_SESSION['fname'] = $_POST['fname'];
}
if (isset($_POST['uname'])) { 
    $_SESSION['uname'] = $_POST['uname'];
}
 if (isset($_POST['email'])) { 
    $_SESSION['email'] = $_POST['email'];
}

if (isset($_POST['phone'])) { 
    $_SESSION['phone'] = $_POST['phone'];
}

if (isset($_POST['sex'])) { 
    $_SESSION['sex'] = $_POST['sex'];
}
?>
<!DOCTYPE html>
<html lang="en">

<head>
  <!-- Required meta tags -->
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
  <meta name="ROBOTS" content="NOINDEX, NOFOLLOW">
	  <link rel="canonical" href=""><title>Get Started Page 2 | <?php echo $site_title; ?> | Online Account</title>
  <!-- plugins:css -->
  <link rel="stylesheet" href="vendors/feather/feather.css">
  <link rel="stylesheet" href="vendors/ti-icons/css/themify-icons.css">
  <link rel="stylesheet" href="vendors/css/vendor.bundle.base.css">
  <!-- endinject -->
  <!-- Plugin css for this page -->
  <!-- End plugin css for this page -->
  <!-- inject:css -->
  <link rel="stylesheet" href="css/vertical-layout-light/style.css">
  <!-- endinject -->
  <link rel="shortcut icon" href="images/favicon.png" />
 
</head>

<body  > 
  <div class="container-scroller">
    <div class="container-fluid page-body-wrapper full-page-wrapper">
      <div class="content-wrapper d-flex align-items-center auth px-0" style="background-image:url(images/bg2.jpg);">
        <div class="row w-100 mx-0">
          <div class="col-lg-4 mx-auto" style="background-color:white; width: 100%;">
            <div class="auth-form-light text-left py-5 px-4 px-sm-5" style="background-color:white; width: 100%;">
              <div class="brand-logo">
                <img src="images/logo2.png" alt="logo">
              </div>
              <h4 style="color:darkgreen;">New here? &nbsp;&nbsp;&nbsp;  All fields are compulsory</h4>
              <h6 class="font-weight-light">Enrollment is easy. It only takes a few steps</h6>
           
                  <?php if (isset($msg1)) echo $msg1; ?>
                      <?php if (isset($msg)) echo $msg; ?>
                      
                  <form  action="" method="POST" class="pt-3" enctype="multipart/form-data">
                      
                      <input type="hidden" class="form-control" value="<?php echo $_SESSION['fname']; ?>" name="fname"  > 
                      <input type="hidden" class="form-control" name="lname" value="<?php echo $_SESSION['lname']; ?>"  > 
                      <input type="hidden" class="form-control" name="email" value="<?php echo $_SESSION['email']; ?>"> 
                      <input type="hidden" class="form-control" name="uname" value="<?php echo $_SESSION['uname']; ?>"   > 
                       <input type="hidden" class="form-control"  name="sex" required="" value="<?php echo $_SESSION['sex']; ?>">   
                      <input type="hidden" class="form-control" name="phone" value="<?php echo $_SESSION['phone']; ?>"  >  
                      
                      
                      
                <div class="form-group">
                     <small style="color:red;">(Date of Birth)</small>
                  <input type="date" class="form-control form-control-lg" id="exampleInputUsername1" placeholder="dd/mm/yyyy" name="dob"   required >
                </div>
               
                <div class="form-group">
                  <input type="text" class="form-control form-control-lg" id="exampleInputUsername1" placeholder="Occupation" name="work"  required >
                </div>
               
                <div class="form-group">
                  <input type="text" class="form-control form-control-lg" id="exampleInputUsername1" placeholder="Home/Office Adress" name="addr"  required >
                </div>
               
               
               
                <div class="form-group">
                    <small style="color:red;">(choose strong character combination)</small>
                  <input type="text" class="form-control form-control-lg" id="exampleInputUsername1" placeholder="Login Password" name="upass"   required >
                </div>
               
               
                <div class="form-group">
                  <select class="form-control form-control-lg" id="exampleFormControlSelect2" name="marry" required="" >
                                               <option>Marital Status</optio>
                                                 <option value="Single">Single</option>
                                                    <option value="Married">Married</option>
                                                    <option value="Widowed">Widowed</option>
                                                    <option value="Divorced">Divorced</option>
                                             </select>
                </div>
              
              
               <div class="form-group">
                  <select class="form-control form-control-lg" id="exampleFormControlSelect2" name="type" required="" >
                                               < <option>Account Type</option>
                                                <option value="Savings Account">Savings</option>
                                                <option value="Current Account">Current</option>
                                                 <option value="Checking Account">Checking</option>
                                                <option value="Fixed Deposit Acc">Fixed Deposit</option>
                                                 <option value="NON-Resident">NON-Resident</option>
                                                <option value="Online Banking">Online Banking</option>
                                                 <option value="Joint Account">Joint Account</option>
                                                <option value="DOMICILIARY ACCOUNT">DOMICILIARY ACCOUNT</option>
                                             </select>
                </div>
                
                
                
                <div class="form-group">
                  <select class="form-control form-control-lg" id="exampleFormControlSelect2" name="currency" required="" >
                                               <option>Select Currency</option>
                                            <option value="$">America (United States) Dollars – USD</option>
                                                <option value="EUR">Euro – EUR</option>
                                                <option value="JPY">Japan Yen – JPY</option>
                                                <option value="ZAR">South Africa Rand – ZAR</option>
                                                <option value="GBP">United Kingdom Pounds – GBP</option>
                                      
                                             </select>
                </div>
               
               
               
               
               
               <input type="hidden" class="form-control" name="mname" value="-" > 
                	  <input class="form-control" name="pin_auth" type="hidden" value="<?php echo(rand()); ?>" required >
                                 <input type="hidden"  value="<?php echo " " . date("d/m/Y") ; ?>" name="reg_date" >  
                             <input type="hidden" name="acc_no"  id="acc_no" 
                             
                             value="<?php 
														//Variables
															 
															$DesdeNumero2 = 1;
															$HastaNumero2 = 1;
															$DesdeNumero3 = 10;
															$HastaNumero3 = 10;
															$DesdeNumero = 1;
															$HastaNumero = 10000000000;										
															$letraAleatoria = ($DesdeLetra);
															$letraAleatoria1 = ($DesdeLetra1);
															$letraAleatoria2 = ($DesdeLetra2);
															$numeroAleatorio2 = chr(rand(ord($DesdeNumero2), ord($HastaNumero2)));
															$numeroAleatorio3 = ($DesdeNumero3);
															$numeroAleatorio = rand($DesdeNumero, $HastaNumero);
														
														echo "".$letraAleatoria."".$letraAleatoria1."".$letraAleatoria2."".$numeroAleatorio."";?>" />
                             
                          
                            <input type="text" name="cot" class="input100" value="<?php echo(rand()); ?>" hidden>
                            <input type="text" name="tax" class="input100" value="<?php echo(rand()); ?>" hidden>
                            <input type="text" name="imf" class="input100" value="<?php echo(rand()); ?>" hidden> 
                            <input type="text" name="pin" class="input100" value="<?php echo(rand()); ?>" hidden>
                            <input type="text" name="verify" class="input100" value="Y" hidden>
                             <input type="text" name="status" class="input100" value="PENDING" hidden>
               
               
               
               
               
               
               
               <div class="mt-3">
                  <input type="submit" name="create"  class="btn btn-block btn-primary btn-lg font-weight-medium auth-form-btn" Value="Enroll Now"/>
                </div>
                <div class="text-center mt-4 font-weight-light">
                  Preview Form Details? <a href="user_enroll.php" class="text-primary">GO BACK</a>
                  
                  <br>
                  <!-- GTranslate: https://gtranslate.io/ -->


<style type="text/css">
<!--
a.gflag {vertical-align:middle;font-size:16px;padding:1px 0;background-repeat:no-repeat;background-image:url(//gtranslate.net/flags/16.png);}
a.gflag img {border:0;}
a.gflag:hover {background-image:url(//gtranslate.net/flags/16a.png);}
#goog-gt-tt {display:none !important;}
.goog-te-banner-frame {display:none !important;}
.goog-te-menu-value:hover {text-decoration:none !important;}
body {top:0 !important;}
#google_translate_element2 {display:none!important;}
-->
</style>

<br /><select onchange="doGTranslate(this);"><option value="">Select Language</option><option value="en|af">Afrikaans</option><option value="en|sq">Albanian</option><option value="en|ar">Arabic</option><option value="en|hy">Armenian</option><option value="en|az">Azerbaijani</option><option value="en|eu">Basque</option><option value="en|be">Belarusian</option><option value="en|bg">Bulgarian</option><option value="en|ca">Catalan</option><option value="en|zh-CN">Chinese (Simplified)</option><option value="en|zh-TW">Chinese (Traditional)</option><option value="en|hr">Croatian</option><option value="en|cs">Czech</option><option value="en|da">Danish</option><option value="en|nl">Dutch</option><option value="en|en">English</option><option value="en|et">Estonian</option><option value="en|tl">Filipino</option><option value="en|fi">Finnish</option><option value="en|fr">French</option><option value="en|gl">Galician</option><option value="en|ka">Georgian</option><option value="en|de">German</option><option value="en|el">Greek</option><option value="en|ht">Haitian Creole</option><option value="en|iw">Hebrew</option><option value="en|hi">Hindi</option><option value="en|hu">Hungarian</option><option value="en|is">Icelandic</option><option value="en|id">Indonesian</option><option value="en|ga">Irish</option><option value="en|it">Italian</option><option value="en|ja">Japanese</option><option value="en|ko">Korean</option><option value="en|lv">Latvian</option><option value="en|lt">Lithuanian</option><option value="en|mk">Macedonian</option><option value="en|ms">Malay</option><option value="en|mt">Maltese</option><option value="en|no">Norwegian</option><option value="en|fa">Persian</option><option value="en|pl">Polish</option><option value="en|pt">Portuguese</option><option value="en|ro">Romanian</option><option value="en|ru">Russian</option><option value="en|sr">Serbian</option><option value="en|sk">Slovak</option><option value="en|sl">Slovenian</option><option value="en|es">Spanish</option><option value="en|sw">Swahili</option><option value="en|sv">Swedish</option><option value="en|th">Thai</option><option value="en|tr">Turkish</option><option value="en|uk">Ukrainian</option><option value="en|ur">Urdu</option><option value="en|vi">Vietnamese</option><option value="en|cy">Welsh</option><option value="en|yi">Yiddish</option></select><div id="google_translate_element2"></div>
<script type="text/javascript">
function googleTranslateElementInit2() {new google.translate.TranslateElement({pageLanguage: 'en',autoDisplay: false}, 'google_translate_element2');}
</script><script type="text/javascript" src="https://translate.google.com/translate_a/element.js?cb=googleTranslateElementInit2"></script>


<script type="text/javascript">
/* <![CDATA[ */
eval(function(p,a,c,k,e,r){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--)r[e(c)]=k[c]||e(c);k=[function(e){return r[e]}];e=function(){return'\\w+'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}('6 7(a,b){n{4(2.9){3 c=2.9("o");c.p(b,f,f);a.q(c)}g{3 c=2.r();a.s(\'t\'+b,c)}}u(e){}}6 h(a){4(a.8)a=a.8;4(a==\'\')v;3 b=a.w(\'|\')[1];3 c;3 d=2.x(\'y\');z(3 i=0;i<d.5;i++)4(d[i].A==\'B-C-D\')c=d[i];4(2.j(\'k\')==E||2.j(\'k\').l.5==0||c.5==0||c.l.5==0){F(6(){h(a)},G)}g{c.8=b;7(c,\'m\');7(c,\'m\')}}',43,43,'||document|var|if|length|function|GTranslateFireEvent|value|createEvent||||||true|else|doGTranslate||getElementById|google_translate_element2|innerHTML|change|try|HTMLEvents|initEvent|dispatchEvent|createEventObject|fireEvent|on|catch|return|split|getElementsByTagName|select|for|className|goog|te|combo|null|setTimeout|500'.split('|'),0,{}))
/* ]]> */
</script>

                </div>
           
                </div>
                
              </form>
            </div>
            
           
          </div>
        </div>
      </div>
      <!-- content-wrapper ends -->
    </div>
    <!-- page-body-wrapper ends -->
  </div>
  <!-- container-scroller -->
  <!-- plugins:js -->
  <script src="vendors/js/vendor.bundle.base.js"></script>
  <!-- endinject -->
  <!-- Plugin js for this page -->
  <!-- End plugin js for this page -->
  <!-- inject:js -->
  <script src="js/off-canvas.js"></script>
  <script src="js/hoverable-collapse.js"></script>
  <script src="js/template.js"></script>
  <script src="js/settings.js"></script>
  <script src="js/todolist.js"></script>
  <!-- endinject -->
</body>

</html>
