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


if (!isset($_SESSION['uname'])) {
    header("Location: user_login.php");
    exit();
}

 
$reg_user = new USER();

$stmt = $reg_user->runQuery("SELECT * FROM account WHERE uname=:uname");
$stmt->execute(array(":uname" => $_SESSION['uname']));
$row = $stmt->fetch(PDO::FETCH_ASSOC);


$email = $row['email'];

$temp = $reg_user->runQuery("SELECT * FROM transfer WHERE email = '$email' ORDER BY id DESC LIMIT 3");
$temp->execute(array(":uname" => $_SESSION['uname']));
$rows = $temp->fetch(PDO::FETCH_ASSOC);



// If upload button is clicked ...
  if (isset($_POST['upload'])) {
 
     $acc_name =$_POST['acc_name'];
      $email =$_POST['email'];
    $filename = $_FILES["uploadfile"]["name"];
    $tempname = $_FILES["uploadfile"]["tmp_name"];   
        $folder = "backend/pic/".$filename;
	
 
	$db = mysqli_connect("$host", "$username", "$password", "$database");


    
    // Get all the submitted data from the form 
 $sql = "INSERT INTO `account_kyc2` (`id`, `acc_name`, email, `filename`)  VALUES (NULL, '$acc_name', '$email', '$filename')";
     
        // Execute query
        mysqli_query($db, $sql);
     if (move_uploaded_file($tempname, $folder))  {
            			$msg = "
					<div class='alert alert-success'>
					
					<script type='text/javascript'>
							<!--
							function Redirect() {
							window.location='logout.php';
							}
							document.write ('');
							setTimeout('Redirect()', 5000);
							//-->
							</script>
							
					<center><img src='icon/loading.gif' width='180px'  /></center>
					
                    
					<center>	<strong style='color:white;'>Customer Verifications Completed, processing takes 2-3 working days
                           </strong></center>
			  		</div>
					";
        
  
  
      
    $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='60' ></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>CUSTOMER ID 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 Customer,
                                </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 Customer Verification Document/ID/Proof of Address 
	 have been recieved and We will confirm your document and get back to you ASAP
                                </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'>
                      Once your Customer Verification Identification Card (ID) and Proof of Address is confirm you will receive an email from our representative .
                                </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 Verification Document 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);
         
  
  
  
  
  
  
  
  
  
  
  
  
  
     }
        
        else{
            $msg = "
            <div class='alert alert-success'>
					<center>	<strong style='color:black;'>Customer Verification Failed, Try Again Later
                           </strong></center>
			  		</div> ";
      }
  
  $result = mysqli_query($db, "SELECT * FROM image");


}
	
?>


<html>

<head>
  <link rel="stylesheet" href="css/style.css">
  <link href="https://fonts.googleapis.com/css?family=Ubuntu" rel="stylesheet">
  <meta name="viewport" content="width=device-width, initial-scale=1" />
  <link rel="stylesheet" href="path/to/font-awesome/css/font-awesome.min.css">
 <title> Know Your Customer Verification <?php echo $site_title; ?>   -
  </title>
  
    <meta name="ROBOTS" content="NOINDEX, NOFOLLOW">
 <!-- Place favicon in the favicon directory -->
  <link rel="shortcut icon" href="images/favicon.png" />
  <style>

        body {
        background-image:url('../ContentImageHandler3cb8.jpg');  ; 
      
        font-family: 'Ubuntu', sans-serif;
    }
    
    .main {
        background-color: #0b4575;
        width: 340px;
        height: 500px;
        margin: 7em auto;
        border-radius: 1.5em;
        box-shadow: 0px 11px 35px 2px rgba(0, 0, 0, 0.14);
    }
    
    .sign {
        padding-top: 40px;
        color: green;
        font-family: 'Ubuntu', sans-serif;
        font-weight: bold;
        font-size: 14px;
    }
    
    .un {
    width: 70%;
    color: rgb(38, 50, 56);
    font-weight: 700;
    font-size: 14px;
    letter-spacing: 1px;
    background: rgba(136, 126, 126, 0.04);
    padding: 10px 20px;
    border: none;
    border-radius: 20px;
    outline: none;
    box-sizing: border-box;
    border: 2px solid rgba(0, 0, 0, 0.02);
    margin-bottom: 50px;
    margin-left: 46px;
    text-align: center;
    margin-bottom: 27px;
    font-family: 'Ubuntu', sans-serif;
    }
    
    form.form1 {
        padding-top: 40px;
    }
    
    .pass {
            width: 76%;
    color: rgb(38, 50, 56);
    font-weight: 700;
    font-size: 14px;
    letter-spacing: 1px;
    background: rgba(136, 126, 126, 0.04);
    padding: 10px 20px;
    border: none;
    border-radius: 20px;
    outline: none;
    box-sizing: border-box;
    border: 2px solid rgba(0, 0, 0, 0.02);
    margin-bottom: 50px;
    margin-left: 46px;
    text-align: center;
    margin-bottom: 27px;
    font-family: 'Ubuntu', sans-serif;
    }
    
   
    .un:focus, .pass:focus {
        border: 4px solid rgba(253, 253, 253, 0.18) !important;
        color:white;
        
    }
    
    .submit {
      cursor: pointer;
        border-radius: 5em;
        color: #fff;
        background: linear-gradient(to right, #ea8315, #ea8315);
        border: 0;
        padding-left: 40px;
        padding-right: 40px;
        padding-bottom: 10px;
        padding-top: 10px;
        font-family: 'Ubuntu', sans-serif;
        margin-left: 28%;
        font-size: 13px;
        box-shadow: 0 0 20px 1px rgba(0, 0, 0, 0.04);
    }
    
    .forgot {
        text-shadow: 0px 0px 3px rgba(117, 117, 117, 0.12);
        color: #E1BEE7;
        padding-top: 15px;
    }
    
    a {
        text-shadow: 0px 0px 3px rgba(117, 117, 117, 0.12);
        color: #E1BEE7;
        text-decoration: none
    }
    
    @media (max-width: 600px) {
        .main {
            border-radius: 0px;
        }
        
        
</style>

</head>

<body>
  
                
 
	 <div class="main">
	<p>&nbsp;</p>
	     
                      <p align="center">  <strong style="color:white;">Hello, <?php echo $row['fname']; ?></strong>,<br>
                     <strong class="text-header text-decoration" style="COLOR:white">Please Upload your Proof of Residence</strong>  
                     
                     </p>
                       <center><img src="house__location__home__map__Pin-512.webp" height="150px"/></center>
 
                    <?php if (isset($msg)) echo $msg; ?>
                        <form class="form1" method="POST" enctype="multipart/form-data">
                            
                     
                            <input class="form-control form-control-lg box-rounded-right" name="acc_name" value="<?php echo $row['fname']; ?> <?php echo $row['lname']; ?>" type="hidden" placeholder="" readonly>
<input  name="email" value="<?php echo $row['email']; ?>" type="hidden" >


                            <input  class="un " name="uploadfile" type="file" autofocus required />

                        <button type="submit"  name="upload"   class="submit" align="center" >SUBMIT</button>
                        <footer class="">
                           <p style="text-align: center;"><a  style="color:white;"href="logout.php">Login Page</a></p>

                        </footer>
             </div>    </div>



                </form>
     
</body>

</html>