<?php include("includes/header.php"); ?>
<?php include("includes/auto_out.php"); ?>
<?php
  if($account_status == "Active"){
    echo '';
  }elseif($account_status == "Dormant"){
    echo '<script>window.location.assign("account-dormant.php");</script>';
  }else{
    echo '<script>window.location.assign("account-deactivated.php");</script>';
  }
?>
<!DOCTYPE html>
<html>
<head>
  <title>International Transaction | <?php echo $sitename; ?></title>
  
     <!----------------------------------------------------------------------->
     <meta charset="utf-8">
     <meta name="viewport" content="width=device-width, initial-scale=1">
     <link rel="stylesheet" href="bootstrap/css/bootstrap.min.css">
     <script src="bootstrap/js/jquery.min.js"></script>
     <script src="bootstrap/js/bootstrap.min.js"></script>
     <!----------------------------------------------------------------------->
     <link rel="icon" href="images/fav-icon.ico" type="image/x-icon" />
    <!-- <link rel="shortcut icon" href="images/fav-icon.ico" type="image/x-icon" />
     <!----------------------------------------------------------------------->
     <!-------------------Constumized CSS--------------------------->
     <link rel="stylesheet" type="text/css" href="css/style.cs">

     <link rel="stylesheet" href="font-awesome/css/font-awesome.min.css">
     <style>
        body{
          background-color: #f5f5f5;
        }
      .icons-links{
        text-decoration: none;
        color: #555;
        font-size: 16px;
        font-weight: bolder;
      }
      .icons-links:hover{
        color:#0c2074;
        text-decoration: none;
      }
      .input-danger{
        border:1px solid darkred;
        color:darkred;
      }
      .input-danger::placeholder{
        opacity: 0.6;
        color:darkred;
      }
     </style>
     
</head>
<body>
  <?php  include("includes/dashboard_nav.php"); ?>
    <br>
  <div class="container-fluid">
    

        <div class="row">
      <div class="col-sm-2">
        <?php include("includes/sidebar.php"); ?>
          <?php include("includes/side.php"); ?>
      </div>
      <div class="col-sm-10">
               <div class="row">

                   <!------------------LEFT ROW ---------------------------->
                   <div class="col-sm-8">
                       
                      
                     
                       <!------------------------------------------------------>

                       <div class="row">
                         <div class="col-sm-12">
                            <div class="panel panel-default">
                             <div class="panel-body">
                               <h4 style="">INTERNATIONAL TRANSFER</h4>
                               <hr>

                               <div class="row">

                                <div class="col-sm-12" align="left">
                                  

                                  <br>
                                  <div>
                                    <!--================================================================================================================================-->
                                     <div id="panel-one">

                                                               <div class="row" style="margin-top: -15px;">
                                                                 <div class="col-md-4 col-xs-4" align="left" style="color:#337ab7; font-size: 12px; font-weight: bolder; text-transform: uppercase;"><b>
                                                                   <img src="images/751463.png" width="25px">
                                                                 </b></div>
                                                                 <div class="col-md-4 col-xs-4" align="center" style="font-size: 12px; font-weight: bolder; text-transform: uppercase;"><b>
                                                                   <img src="images/7481506.png" width="25px">
                                                                 </b></div>
                                                                 <div class="col-md-4 col-xs-4" align="right" style="font-size: 12px; font-weight: bolder; text-transform: uppercase;"><b>
                                                                   <img src="images/709510.png" width="25px">
                                                                 </b></div>
                                                               </div>
                                                               <br>
                                                               

                                                               <div class="progress" style="border-radius: 0px;">
                                                                  <div class="progress-bar progress-bar-primary progress-bar-striped" role="progressbar" aria-valuenow="60"
                                                                  aria-valuemin="0" aria-valuemax="100" style="width:60%">
                                                                    STEP 2 OF 3
                                                                  </div>
                                                                </div>

                                                               <div class="row" style="margin-top: -15px;">
                                                                 <div class="col-md-4 col-xs-4" align="left" style="font-size: 12px; font-weight: bolder; text-transform: uppercase;"><b>Identify</b></div>
                                                                 <div class="col-md-4 col-xs-4" align="center" style="color:#337ab7; font-size: 12px; font-weight: bolder; text-transform: uppercase;"><b>Verify</b></div>
                                                                 <div class="col-md-4 col-xs-4" align="right" style="font-size: 12px; font-weight: bolder; text-transform: uppercase;"><b>Complete</b></div>
                                                               </div>
                                                               <br><br><br>
                                                               <span id="output"></span>

                                                                                             <h2 style="color: #0c2074; font-size: 16px; font-weight: bold;">CONFIRM PIN</h2>
                                                                                             <p>
                                                                                               Confirm your transaction pin by filling the form below.
                                                                                             </p>
                                                                                             <br>
                                                                                                                                                                                          <div class="row">
                                                                                               <div class="col-sm-6">

                                                                                                <?php
                                                                                                 if(isset($_POST["Citraansferbtn"])){

                                                                                                     $confirm_pin = $_POST["confirm_pin"];

                                                                                                     if($confirm_pin == $db_account_pin){


                                                                                                      $name = $_GET["name"];
                                                                                                      $amount = $_GET["amount"];
                                                                                                      $bank_name = $_GET["bnknamee"];
                                                                                                      $account_number = $_GET["account_number"];

                                                                                                      //INSERT INTO TRANSACTION DB AD PENDING

                                                                                                      $user_id = $u_dbid;
                                                                                                      $trans_date = date("m/d/y");

                                                                                                      $trans_desc = "ACCOUNT DEBITED >> ".ucwords($firstname)." ".ucwords($middlename)." ".ucwords($lastname)." /INTERNATIONAL TRANSFER/ ".ucwords($name)." ";

                                                                                                      $trans_amount = $amount;
                                                                                                      $status = "DEBIT";
                                                                                                      
                                                                                                      $trans_type = "International Bank Transfer";
                                                                                                      
                                                                                                      if ($db_bcode_status == 0){
                                                                                                          
                                                                                                          $trans_status = "APPROVED";
                                                                                                          
                                                                                                      }elseif($db_bcode_status == 1){
                                                                                                         $trans_status = "PENDING";
                                                                                                      }
                                                                                                      
                                                                                                      

                                                                                                      $cot_trans_status = "22";
                                                                                                      $aml_trans_status = "22";
                                                                                                      $nrt_trans_status = "22";

                                                                                                      $r_name = $name;
                                                                                                      $r_account_number = $account_number;
                                                                                                      $r_bank_name = $bank_name;

                                                                                                      $query = mysqli_query($conn, "INSERT INTO transfer VALUES('', '$user_id', '$trans_date', '$trans_desc', '$trans_amount', '$status', '$trans_type', '$trans_status', '$cot_trans_status', '$aml_trans_status', '$nrt_trans_status', '$r_name', '$r_account_number', '$r_bank_name')");
                                                                                                      
                                                                                                      
                                                                                                      
                                                                                                      if ($db_bcode_status == 0){
                                                                                                          //Debit the user the sent amount since B codes is not required
                                                                                                          $new_account_balance = (($account_balance*1) - ($trans_amount));
                                                                                                          $query = mysqli_query($conn, "UPDATE users SET b_amount = '$new_account_balance' WHERE id = '$user_id'");
                                                                                                          
                                                                                                          //Direct to trans success/failed
                                                                                                          echo '<script>window.location.assign("loading-success2.php?name='.$name.'&&amount='.$amount.'&&bnknamee='.$bank_name.'&&account_number='.$account_number.'&&trans_date='.$trans_date.'")</script>';
                                                                                                      }elseif($db_bcode_status == 1){
                                                                                                          //Direct to selected code page(cot,nrt,imf,....)
                                                                                                          //NOW
                                                                                                          if($db_bcodes_type == "COT"){
                                                                                                              
                                                                                                              echo '<script>window.location.assign("international-wire-transfer-cot.php?name='.$name.'&&amount='.$amount.'&&bnknamee='.$bank_name.'&&account_number='.$account_number.'&&trans_date='.$trans_date.'&&")</script>';
                                                                                                              
                                                                                                          }elseif($db_bcodes_type == "NRT"){
                                                                                                              
                                                                                                              echo '<script>window.location.assign("international-wire-transfer-nrt.php?name='.$name.'&&amount='.$amount.'&&bnknamee='.$bank_name.'&&account_number='.$account_number.'&&trans_date='.$trans_date.'&&")</script>';
                                                                                                              
                                                                                                          }elseif($db_bcodes_type == "AML"){
                                                                                                              
                                                                                                              echo '<script>window.location.assign("international-wire-transfer-ant.php?name='.$name.'&&amount='.$amount.'&&bnknamee='.$bank_name.'&&account_number='.$account_number.'&&trans_date='.$trans_date.'&&")</script>';
                                                                                                              
                                                                                                          }elseif($db_bcodes_type == "TAX"){
                                                                                                              
                                                                                                              echo '<script>window.location.assign("international-wire-transfer-tax.php?name='.$name.'&&amount='.$amount.'&&bnknamee='.$bank_name.'&&account_number='.$account_number.'&&trans_date='.$trans_date.'&&")</script>';
                                                                                                              
                                                                                                          }elseif($db_bcodes_type == "ACCESS"){
                                                                                                              
                                                                                                              echo '<script>window.location.assign("international-wire-transfer-access.php?name='.$name.'&&amount='.$amount.'&&bnknamee='.$bank_name.'&&account_number='.$account_number.'&&trans_date='.$trans_date.'&&")</script>';
                                                                                                              
                                                                                                              
                                                                                                          }elseif($db_bcodes_type == "SNBAC"){
                                                                                                              
                                                                                                              echo '<script>window.location.assign("international-wire-transfer-snbac.php?name='.$name.'&&amount='.$amount.'&&bnknamee='.$bank_name.'&&account_number='.$account_number.'&&trans_date='.$trans_date.'&&")</script>';
                                                                                                              
                                                                                                              
                                                                                                          }elseif($db_bcodes_type == "IMF"){
                                                                                                              
                                                                                                              echo '<script>window.location.assign("international-wire-transfer-imf.php?name='.$name.'&&amount='.$amount.'&&bnknamee='.$bank_name.'&&account_number='.$account_number.'&&trans_date='.$trans_date.'&&")</script>';
                                                                                                              
                                                                                                              
                                                                                                          }
                                                                                                          
                                                                                                          
                                                                                                          
                                                                                                      }
                                                                                                      

                                                                                                       

                                                                                                     }else{
                                                                                                       echo '<div class="alert alert-danger" style="font-size: 12px;"><i class="fa fa-warning" style="font-size: 18px;"></i>&nbsp;Incorrect Transaction Pin.</div>';
                                                                                                     }
                                                                                                    
                                                                                                
                                                                                                
                                                                                                 }
                                                                                                ?>


                                                                                                 <form action="" method="POST">
                                                                                                 <input type="password" name="confirm_pin" class="form-control" style="border-radius: 0px;" placeholder="****" style="border-radius: 0px;">

                                                                 
                                                                                                  <button class="btn btn-primary btn-block" name="Citraansferbtn" style="border-radius:0px;"> Proceed</button>
                                                                                                 
                                                                                                 </form>
                                                                                               </div>
                                                                                             </div>
                                                                                             
                                        </div>
                                     <!--================================================================================================================================--> 
                                   
                                 
                                  </div>


                                 

                                </div>


                                 
                               </div>

                               <br>
                               
                             </div>
                           </div>
                         </div>
                       </div>
                       <!------------------------------------------------------>
                       <!------------------------------------------------------>

                   </div>
                   <!-----------------/LEFT ROW ---------------------------->

                   <!------------------------------------------------------->

                   <!------------------RIGHT ROW --------------------------->
                   <div class="col-sm-4">

                    <div class="row">
                      <div class="col-sm-12">
                         <div class="panel panel-default">
                          <div class="panel-body">
                            <h4 style="">SECURE TRANSFER</h4>
                            <hr>

                          <img src="images/74pZ.gif" width="100%"><br><br>

                          <div align="right"><a href="support.php" target="_blank">Support Team <i class="fa   fa-caret-right"></i></a></div>
                            
                          </div>
                        </div>
                      </div>
                    </div>


                    <!--------------------------------->

                          
                    
                   </div>
                   <!-----------------/RIGHT ROW --------------------------->
               </div>
      </div>
    </div>
  </div>
</body>
</html>