<?php include("includes/header.php"); ?>
<?php
$name = $_POST["name"];
$amount = $_POST["amount"];
$bank_name = $_POST["bank_name"];
$account_number = $_POST["account_number"];
$date = date("Y-M-D");
$account_id = $account_id;


//SEND TO PENDING TRANSFER

$query = mysqli_query($conn, "INSERT INTO pending VALUES('', '$account_id', '$date', '$name', '$bank_name', '$account_number', '$amount')");

//  MAIL TO SEND OTP CODE.
//SEND MAIL CONTAINING USER ID.......

                 $email_to = $email;
                 $subject = "One-time password (OTP) Code";
                 

                 //BIG MESSAGE
                 $message = '
                 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
                    <html xmlns="http://www.w3.org/1999/xhtml">
                     <head>
                      <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
                      <title>Account created.</title>
                      <meta name="viewport" content="width=device-width, initial-scale=1.0"/>
                    </head>
                    <body>
                      <div style="background-color:#f8f8f8;">
                        <img src="https://firststandardplc.com/images/first%20standard.png" class="img-responsive" width="140">
                      </div>
                      <br>
                      
                      <p style="font-size:18px;">
                         Your One-time password (OTP) code is 87530286.
                      </p>
                      
     
                      <br><br>
                      <div style="background-color:#e10514; color:#fff;">&nbsp; &copy; '.date("Y").' copyright, Firststandard</div>
                    </body>
                    </html>
                 ';

                    $headers[] = 'MIME-Version: 1.0';
                    $headers[] = 'Content-type: text/html; charset=iso-8859-1';

                    // Additional headers
                     $headers[] = 'From: Firststandard<info@firststandardplc.com>';

                    //SEND MAIL
                     mail($email_to, $subject, $message,  implode("\r\n", $headers));


                    echo '<script>window.location.assign("otp-code.php?transfer-id=6382894-02833289821hdHGFFDHFDS573fFDSH")</script>';


?>