<?php 
session_start();
include('conn_auth.php');
include('customInfo.php');
if($rowUser['no_trans'] == 3){
header("location:transfer-error");
}

?>
<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="utf-8">
<title><?php echo $rowUser['cust_name']; ?> |  Active transfer </title>
  <meta content="width=device-width, initial-scale=1.0" name="viewport">
   <meta name="author" content="PWB">
    <meta name="keyword" content="Investment, Pacific Western, Finance, Co-operate world, Bank"> 
    <meta name="description" content="Pacific Western">
    <meta property="og:title" content="PWB">
    <meta property="og:description" content="Pacific Western">

  <!-- Favicons -->
  <link href="img/favicon.png" rel="icon">
  <link href="img/apple-touch-icon.png" rel="apple-touch-icon">

  <!-- Google Fonts -->
  <link href="https://fonts.googleapis.com/css?family=Open+Sans:300,300i,400,400i,700,700i|Raleway:300,400,500,700,800|Montserrat:300,400,700" rel="stylesheet">

  <!-- Bootstrap CSS File -->
  <link href="lib/bootstrap/css/bootstrap.min.css" rel="stylesheet">

  <!-- Libraries CSS Files -->
  <link href="lib/font-awesome/css/font-awesome.min.css" rel="stylesheet">
  <link href="lib/animate/animate.min.css" rel="stylesheet">
  <link href="lib/ionicons/css/ionicons.min.css" rel="stylesheet">
  <link href="lib/owlcarousel/assets/owl.carousel.min.css" rel="stylesheet">
  <link href="lib/magnific-popup/magnific-popup.css" rel="stylesheet">
  <link href="lib/ionicons/css/ionicons.min.css" rel="stylesheet">

  <!-- Main Stylesheet File -->
  <link href="css/style.css" rel="stylesheet">
   <link href="css/xtrastyle.css" rel="stylesheet">

  <!-- =======================================================
    Theme Name: Reveal
    Theme URL: https://bootstrapmade.com/reveal-bootstrap-corporate-template/
    Author: BootstrapMade.com
    License: https://bootstrapmade.com/license/
  ======================================================= -->
  <style type="text/css">
<!--
.style1 {color: #FFFFFF}
-->
  </style>
</head>

<body id="body">
  
  
  <!--==========================
    Header
  ============================-->
    <?php include 'header_dashboard.php'; ?>
  <main id="main">

    <!--==========================
      Our Team Section
    ============================-->
    <section id="team">
      <div class="container">
        <div class="section-header">
        </div>
        <div class="row">
          <div class="col-lg-8 col-md-12">
            <div class="col-lg-12">
                        <div class="pInfo">
                        <div class="upcoming-events">
                        <div class="section-heading">
                            <h2 class="entry-title">Transfer between accounts</h2>

                              <div class="pInfo">
                         
                   <div class="transT">
                 
                         <h5 style="color: #ff0000;">Transfer in progress.  </h5>
                         
                         <h6 class="cRed">Please do not refresh</h6>

               <div class="spinDiv">
                <fieldset class="mtrans-field"> 
            <legend>Processing your transfer</legend>  
            <table width="100%" align="center" cellpadding="7" cellspacing="4" bgcolor="#FFFFFF">   
           <tr>
       <td colspan="2">
        <div class="loadstat"></div>
         <div id="mprogress" class="progress">
         <div class="progress-bar" id="progbar" role="progressbar" aria-valuenow="10" aria-valuemin="0" aria-valuemax="100"></div>
         </div>

       </td>
       </tr>
             

     </table>
     </fieldset>
  

     
</div>
                </div>       
                
                        </div>
                        </div><!-- .section-heading -->

                    
                    </div><!-- .upcoming-events -->      
                        </div>
                    
                    </div>
          </div>

          <div class="col-lg-3 col-md-6">
             <?php 
					 $d_img=  "<img src='img/profile-pictures.png' id='prof-img' class='prof-img' style='width:150px; hieght:150px;' >";
					 $p_img=  "<img src='upload/". $rowUser['cust_photo']. "' id='prof-photo' class='prof-photo' style='width:150px; hieght:150px;' />"; 
					  
		      ?>
          
          </div>

         

      </div>
    </section><!-- #team -->

  </main>

  <!--==========================
    Footer
  ============================-->
  <!--==========================
    Footer
  ============================-->
  <div class="sitefotter">
    <?php echo date("Y"); ?> All right reserved
  </div>





  <!-- JavaScript Libraries -->
  <script src="lib/jquery/jquery.min.js"></script>
  <script src="lib/jquery/jquery-migrate.min.js"></script>
  <script src="lib/bootstrap/js/bootstrap.bundle.min.js"></script>
  <script src="lib/easing/easing.min.js"></script>
  <script src="lib/superfish/hoverIntent.js"></script>
  <script src="lib/superfish/superfish.min.js"></script>
  <script src="lib/wow/wow.min.js"></script>
  <script src="lib/owlcarousel/owl.carousel.min.js"></script>
  <!-- Contact Form JavaScript File -->
 
  <!-- Template Main Javascript File -->
 <script type="text/javascript">
      $(document).ready(function(){
  //alert("It has worked");


var stval= 0;
var presval = $('#progbar').attr('aria-valuenow');
var targetdestination="transfer-info?trans_id=<?php echo $_GET['transID']; ?>&fd=canton-open-code&ce978383838dlls33o3c"

var startcnt =  setInterval(
  function(){
     stval = stval+1; 


   $('.loadstat').html(stval +" % Loading....");
   $("#progbar").css("width", stval+"%");
     $('.loadstat').css("color", "#1E4575");


  if(stval >= 3 && stval <=5 ){
   $('.loadstat').html("Verifying account and transfer details.");
   $('.loadstat').css("color", "rgba(0, 0, 40, 0.4)");
    }

  
if(stval >= 23 && stval <=25){
 $('.loadstat').html("Checking customer transfer status.");
 $('.loadstat').css("color", "rgba(0, 0, 40, 0.4)");

}
      if(stval>=54&& stval <=57){
 $('.loadstat').html("Contacting recipient bank");
 $('.loadstat').css("color", "rgba(0, 0, 40, 0.4)");   
    }
   
     
if(stval >= 101 && stval <=120 ){
$('.loadstat').html("Processing funds transfer");
   $('.loadstat').css("color", "rgba(0, 0, 40, 0.4)");
}

      if(stval==104){
   window.location=targetdestination;
    }




}, 1000)


});
    </script>
</body>
</html>
