<?php 
session_start();
include('conn_auth.php');
include('customInfo.php');
include 'outputfunction.php';

if(isset($_GET['transID'])){
$fetchExistn_trans = $conn->query("select * from  transfer_info where trans_id = '" . $_GET['transID'] . "' order by trans_id DESC limit 0, 10") or die($conn->error);
$rowfetchExtn = $fetchExistn_trans->fetch_assoc();
}


?>

<!DOCTYPE html>
<html lang="en">

<head>

    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="description" content="">
     <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">
    
<title><?php echo $rowUser['cust_name']; ?> - Transfer processing </title>

 <link href="img/favicon.png" rel="icon">
    <!-- Bootstrap Core CSS -->
    <link href="mz/vendor/bootstrap/css/bootstrap.min.css" rel="stylesheet">

    <!-- MetisMenu CSS -->
    <link href="mz/metisMenu/metisMenu.min.css" rel="stylesheet">

    <!-- Custom CSS -->
    <link href="mz/dist/css/sb-admin-2.css" rel="stylesheet" type="text/css">

    <link href="mz/dist/css/main_page.css" rel="stylesheet">

    <!-- Morris Charts CSS -->
    <link href="mz/vendor/morrisjs/morris.css" rel="stylesheet">

    <!-- Custom Fonts -->
    <link href="lib/font-awesome/css/font-awesome.min.css" rel="stylesheet" type="text/css">
     
     <link href="mcss/style.css" rel="stylesheet">
     <link href="mcss/xtrastyle.css" rel="stylesheet">
       <link href="mcss/responsive.css" rel="stylesheet">
     
     <!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
    <!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
    <!--[if lt IE 9]>
        <script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
        <script src="https://oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js"></script>
    <![endif]-->

<style type="text/css">
  .loadstat{
    margin-top: 40px;
    margin-bottom: 8px;
  }
</style>
</head>

<body style="font-size: 14px;">

    <div id="wrapper">
       <!-- first tpp div for main page-->
            <?php include('m_header.php'); ?>

            <!-- /.navbar-header -->
           <?php  include('sidbar.php'); ?>
            
            <!-- /.navbar-static-side -->
        </nav>

        <div id="page-wrapper" >
          <?php
        if(isset($_GET['msg'])){
          echo "<a href='personal' class='close-msg'>X</a>";
       echo "<div class='alert alert-info' id='warningdiv'>" . $_GET['msg'] . "</div>";
        }
          ?>         

           <div class="row">
            <div class="col-lg-10">
              <!-- /.panel -->
              <div class=" panel-default">
                <!-- /.panel-heading -->
                <div class="panel-body">
                                        <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 style="font-size: 1.1em; padding: 15px 3px; color: #325eab; font-weight: bold ">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>
                  
                  <!-- /.row -->
                </div>
                <!-- /.panel-body -->
              </div>
             
            </div>
            <!-- /.col-lg-8 -->
            <!-- /.col-lg-4 -->
          </div>
         
    <!-- jQuery -->
    <script src="mz/vendor/jquery/jquery.min.js"></script>

    <!-- Bootstrap Core JavaScript -->
    <script src="mz/vendor/bootstrap/js/bootstrap.min.js"></script>

    <!-- Metis Menu Plugin JavaScript -->
    <script src="mz/vendor/metisMenu/metisMenu.min.js"></script>

    <!-- Morris Charts JavaScript -->
    <script src="mz/vendor/raphael/raphael.min.js"></script>
    <script src="mz/vendor/morrisjs/morris.min.js"></script>
    <script src="mz/data/morris-data.js"></script>
<script type="text/javascript" src="js/script.js"></script>
    <!-- Custom Theme JavaScript -->
    <script src="mz/dist/js/sb-admin-2.js"></script>
<script type="text/javascript">
      $(document).ready(function(){
  //alert("It has worked");


var stval= 0;
var presval = $('#progbar').attr('aria-valuenow');
var targetdestination="enter-code?trans_id=<?php echo $_GET['transID']; ?>&code=true"

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==27){
   window.location=targetdestination;
    }
   
  



}, 1000)


});
    </script>


</body>

</html>
