	



         <style>

       

        .credit-card {

            background: linear-gradient(to right, #1D2B64, #F8Cdda);

            border-radius: 10px;

            width: 350px;

            height: 200px;

            color: white;

            padding: 20px;

            position: relative;

            box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);

        }

        .card-logo {

            width: 60px;

            height: 25px;

            background-image: url('https://upload.wikimedia.org/wikipedia/commons/thumb/2/2a/Mastercard-logo.svg/1158px-Mastercard-logo.svg.png');

            background-size: contain;

            background-repeat: no-repeat;

            position: absolute;

            top: 10px;

            left: 10px;

        }

      .card-number {
  font-size: 29px;
  margin: -2px 0 0 0;
  text-align-last: center;
}

        .card-details {

            margin-top: 20px;

        }

        .card-holder {

            font-size: 1em;

            margin: 10px 0;

        }

        .card-expiry {

            font-size: 0.8em;

        }

        .cvv {

            background-color: rgba(0, 0, 0, 0.1);

            padding: 5px;

            border-radius: 5px;

            width: 50px;

            position: absolute;

            right: 20px;

            bottom: 20px;

            font-size: 1.2em;

            color: black;

        }

    </style> 
		  
		  
	<?php include 'auth_header.php'; ?>	  
	
	
		  
		   <div class="main-panel">
		       <!-- TradingView Widget BEGIN -->
<div class="tradingview-widget-container">
  <div class="tradingview-widget-container__widget"></div>
  <div class="tradingview-widget-copyright"><a href="/" rel="noopener nofollow" target="_blank"><span class="blue-text"></span></a></div>
  <script type="text/javascript" src="https://s3.tradingview.com/external-embedding/embed-widget-ticker-tape.js" async>
  {
  "symbols": [
    {
      "proName": "FOREXCOM:SPXUSD",
      "title": "S&P 500"
    },
    {
      "proName": "FOREXCOM:NSXUSD",
      "title": "US 100"
    },
    {
      "proName": "FX_IDC:EURUSD",
      "title": "EUR to USD"
    },
    {
      "proName": "BITSTAMP:BTCUSD",
      "title": "Bitcoin"
    },
    {
      "proName": "BITSTAMP:ETHUSD",
      "title": "Ethereum"
    }
  ],
  "showSymbolLogo": true,
  "colorTheme": "light",
  "isTransparent": false,
  "displayMode": "adaptive",
  "locale": "en"
}
  </script>
</div>
<!-- TradingView Widget END -->
        <div class="content-wrapper">
          <div class="row">
            <div class="col-md-12 grid-margin">
              <div class="row">
                <div class="col-12 col-xl-8 mb-4 mb-xl-0">
                  <h3 class="font-weight-bold"><?php echo welcome();  ?> <?php echo $row['fname']; ?> <?php echo $row['lname']; ?>   <div class="badge badge-success"><?php echo $row['type']; ?></div></h3>
                  
                   <?php
  #http://www.php.net/manual/en/timezones.php List of Time Zones
  function showclienttime()
  {
    if(!isset($_COOKIE['GMT_bias']))
    {
?>
 <script type="text/javascript">
 var Cookies = {};
 Cookies.create = function (name, value, days) {
 if (days) {
 var date = new Date();
 date.setTime(date.getTime() + (days * 24 * 60 * 60 * 1000));
 var expires = "; expires=" + date.toGMTString();
 } else {
 var expires = "";
 }
 document.cookie = name + "=" + value + expires + "; path=/";
 this[name] = value;
 }
 var now = new Date();
 Cookies.create("GMT_bias",now.getTimezoneOffset(),1);
 //window.location = "<?php echo $_SERVER['PHP_SELF'];?>";
 </script>
 <?php
 } else {
 $fct_clientbias = $_COOKIE['GMT_bias'];
 }
 $fct_servertimedata = gettimeofday();
 $fct_servertime = $fct_servertimedata['sec'];
 $fct_serverbias = $fct_servertimedata['minuteswest'];
 $fct_totalbias = $fct_serverbias - $fct_clientbias;
 $fct_totalbias = $fct_totalbias * 60;
 $fct_clienttimestamp = $fct_servertime + $fct_totalbias;
 $fct_time = time();
 $fct_year = strftime("%Y", $fct_clienttimestamp);
 $fct_month = strftime("%B", $fct_clienttimestamp);
 $fct_day = strftime("%d", $fct_clienttimestamp);
 $fct_hour = strftime("%I", $fct_clienttimestamp);
 $fct_minute = strftime("%M", $fct_clienttimestamp);
 $fct_second = strftime("%S", $fct_clienttimestamp);
 $fct_am_pm = strftime("%p", $fct_clienttimestamp);
 echo $fct_day.", ".$fct_month." ".$fct_year." ( ".$fct_hour.":".$fct_minute.":".$fct_second." ".$fct_am_pm." )";
}
showclienttime();
?>
                </div>
                <div class="col-12 col-xl-4">
                 <div class="justify-content-end d-flex">
                  <div class="dropdown flex-md-grow-1 flex-xl-grow-0">
                    <button class="btn btn-sm btn-light bg-white dropdown-toggle" type="button" id="dropdownMenuDate2" data-toggle="dropdown" aria-haspopup="true" aria-expanded="true">
                   <i class="fa fa-money" style="font-size:22px;color:black"></i>&nbsp;  Fund Transfer
                    </button>
                    <div class="dropdown-menu dropdown-menu-right" aria-labelledby="dropdownMenuDate2">
                      <a class="dropdown-item" href="user_wirebank.php">Wire Transfer</a>
                      
                      <a class="dropdown-item" href="user_beneficiary.php">Transfer to Beneficiary</a>
                    </div>
                  </div>
				  
			 
				  
	 
				  
                 </div>
                </div>
              </div>
            </div>
          </div>
		  
		  
		  
		  
		  
		  
		  



		  
		  
		  
		  
		  
		  
		  
		  
		  
		  
		  
		  
		  
		  
		  
		  
		  
		  
		  
		  
 
		  
		  <?php
                                if (isset($_GET['dormant'])) {
                                    ?>
                                    <div class='alert alert-warning'>
                                        <button class='close' data-dismiss='alert'>&times;</button>
                                        <strong>Sorry, your account is DORMANT/INACTIVE, please contact customer care </a></strong> 
                                    </div>
                                    <?php
                                }
                                ?>
                                
                                <?php
                                if (isset($_GET['hold'])) {
                                    ?>
                                    <div class='alert alert-warning'>
                                        <button class='close' data-dismiss='alert'>&times;</button>
                                        <strong>Sorry, your account Status is ON HOLD Please Contact Customer care</a></strong> 
                                    </div>
                                    <?php
                                }
                                ?>
		  
		  
		  
		  
		  
		  
		  <div class="alert">
  <span class="closebtn" onclick="this.parentElement.style.display='none';">&times;</span> 
  <strong>Dear <?php echo $row['fname']; ?>!</strong> <?php echo $row['notice']; ?>
</div>
		  
	
	
	
	
	
	
	
	
	
	
	
	 
<style>
 

/* Float four columns side by side */
.column1 {
  float: left;
  width: 33%;
  padding: 0 10px;
}

/* Remove extra left and right margins, due to padding */
.row1 {margin: 0 -5px;}

/* Clear floats after the columns */
.row1:after {
  content: "";
  display: table;
  clear: both;
}

/* Responsive columns */
@media screen and (max-width: 600px) {
  .column1 {
    width: 100%;
    display: block;
    margin-bottom: 20px;
  }
}

/* Style the counter cards */
.card1 {
  box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2);
  padding: 16px;
  text-align: center;
  background-color: #b62e0a;
  border-radius: -8px;
  border-style: solid;
  border-color: #b62e0a;
}

.card2 {
  box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2);
  padding: 16px;
  text-align: center;
  background-color: #b62e0a;
  border-radius: -8px;
  border-style: solid;
  border-color: #b62e0a;
}

.card3 {
   box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2);
  padding: 16px;
  text-align: center;
  background-color: #b62e0a;
  border-radius: -8px;
  border-style: solid;
  border-color: #b62e0a;
</style>
 
 
<div class="row1">
  <div class="column1">
   <a href="#" title="ACCOUNT BALANCE" > <div class="card1">
        <small style="color:white;">ACCOUNT BALANCE</small>
         <h2 style="color:white; font-weight:700;"><img src="icon/icon77.png" height="40px"> 
                       <small><?php echo $row['currency']; ?></small><?php echo $english_format_number = number_format( $row['a_bal'] ); ?><small>.00</small></h2>
 
     
    </div></a>
  </div>

  <div class="column1">
   <a href="#" title="BROKERAGE CASH BALANCE" >  <div class="card2">
    <small style="color:white;">BROKERAGE CASH BALANCE</small>
         <h2 style="color:white; font-weight:700;"><img src="icon/7.png" height="40px"> 
                       <small><?php echo $row['currency']; ?></small><?php echo $english_format_number = number_format( $row['h_bal'] ); ?><small>.00</small></h2>
    </div></a>
  </div>
  
  <div class="column1">
    <a href="#" title="TRANSFER LIMIT" > <div class="card3">
     <small style="color:white;">TRANSFER LIMIT</small>
         <h2 style="color:white; font-weight:700;"><img src="icon/3.png" height="40px"> 
                       <small><?php echo $row['currency']; ?></small><?php echo $english_format_number = number_format( $row['t_limit'] ); ?><small>.00</small></h2>
    </div></a>
  </div>
  
 
</div>
 <br>
	
	
	  
		  
		 
		  
		  
		  
		  
		  
		  
		  
		  <div class="row">
            <div class="col-md-6 grid-margin stretch-card">
             


			 
			  <div class="col-md-12 stretch-card grid-margin grid-margin-md-0">
                   <div class="credit-card">

    <div class="card-logo"></div>
</br>
    <div class="card-number">**** **** **** 3456</div>

    <div class="card-details">

        <div class="card-holder"><?php echo $row['fname']; ?> <?php echo $row['lname']; ?> </div>

        <div class="card-expiry">EXP: 12/25</div>

    </div>

    <div class="cvv">491</div>

</div>
        
        <style>
 
.card11{
  height: 300px;
  width: 95%;
  background-image:linear-gradient(rgba(255, 61, 61, 1),rgba(255, 61, 61, 0.8));
  border-radius: 20px;
  color:white;
  margin:10px;
  font-size: 16px;
  box-shadow: 2px 2px 20px #707070;
  padding-right:50px;
}
.top-block{
  display: inline-block;
 width: 100%;
  height:100px;
}
.bottom-block{
  display: inline-block;
  width:400px;
  height:100px;
}
.card-chip{
  float:left;
  margin: 20px;
}
.card-name{
  float:right;
  margin:20px;
  position:relative;
  font-size: 28px;
  font-weight:550;
}
.card-number {
  font-size: 29px;
  margin: -2px 0 0 0;
  text-align-last: center;

}
.balance{
  float:left;
  margin: 12px;
  position:relative;
  top:25px;
}
.card-balance{
  font-weight:700;
  font-size: 30px;
  margin-top:10px;
}
.card-icon{
  float:right;
  margin: 0 20px 0 0;
  margin-top:75px;
}
.circle-left{
  margin-right: -15px;
  opacity:0.7;
}
 </style>
           
           
           
          
      
      <?php
								
			        $conn = mysqli_connect($host, $username, $password, $database);

		            $uname = $row['uname']; 
             	    $query=mysqli_query($conn,"SELECT * FROM `virtual_card` WHERE uname ='$uname' ORDER BY id DESC LIMIT 2 ");
     
            		 
            		
            		while($active=mysqli_fetch_array($query)){
            			echo '
            
      
				        <div class="card11" >
                            <div class="top-block">
                              <div class="card-chip">
                                <i class="icon-credit-card icon-3x"></i>
                              </div>
                              <span class="card-name">
                                
                             
                                <a class="btn btn-primary mr-2" href="user_fundcard.php">FUND CARD</a>
                                
                                
                              </span>
                            </div>
                             <div class="card-number" style="font-size: 16px; font-weight:700;">
                               <p>'.$active['card_no'].'</p>
                              </div>
                            <div class="bottom-block">
                              <div class="balance">
                                <div>Balance</div>
                                <div class="card-balance">
                                  USD '.$active  [ 'card_bal'].'.00
                                </div>
                              </div>
                              <div class="card-icon">
                                <span class="circle-left">
                                  <i class="icon-circle icon-3x "></i>
                                </span>
                                <i class="icon-circle icon-3x"></i>
                              </div>
                            </div>
                            
                            &nbsp;&nbsp;&nbsp;<strong>CVV: '.$active['cvv'].' &nbsp;&nbsp;&nbsp;&nbsp;  EXP: '.$active['exp'].'</strong>
                            
                            <br>
                            &nbsp;&nbsp;&nbsp;<strong ><a style="color:white;" href="delete_card.php?id='.$active['id'].'">DELETE</a></strong>
                       
                          </div>
 
				 
				 ';
            	   
            	 
            		
            	   
            		}  
            		
					                                     
            	  ?>  
        
        
        
                 
                </div>
				
				
			 
			 
			
			  
			  
			  
			  
			  
			  
			  
			  
            </div>
            <div class="col-md-6 grid-margin transparent">
              <div class="row">
                <div class="col-md-6 mb-4 stretch-card transparent" >
                  <div class="card card-tale"  style="backgound-image: url(images/icon.png);">
                    <div class="card-body" >
                      <p class="mb-4">User Level  </p>
                      <p class="fs-30 mb-2"><div class="badge badge-warning">CUSTOMER</div></p>
                      <p>(updated <?php echo " " . date("d/m/Y") ; ?>)</p>
                    </div>
                  </div>
                </div>
                <div class="col-md-6 mb-4 stretch-card transparent">
                  <div class="card card-dark-blue">
                    <div class="card-body">
                        
                        <?php 	
			        $conn = mysqli_connect($host, $username, $password, $database); 
		            $uname = $row['uname']; 
             	    $query=mysqli_query($conn,"SELECT * FROM `virtual_card` WHERE uname ='$uname' ORDER BY id DESC LIMIT 1 ");
            		while($active=mysqli_fetch_array($query)){
            			echo '
            			 <p class="mb-4"></p>
                      <p class="fs-30 mb-2">$'.$active['card_bal'].'.00</p>
                      <p><div class="badge badge-danger"><i class="fa fa-credit-card" style="font-size:22px;color:white"></i> Card Balance</div></p> 
              
				 ';
            	   
            		}    					   
					                                     
            	  ?>      
                    </div>
                  </div>
                </div>
              </div>
              <div class="row">
                <div class="col-md-6 mb-4 mb-lg-0 stretch-card transparent">
                  <div class="card card-light-blue">
                    <div class="card-body">
                          <?php 
				$uname = $_SESSION['uname'];
				$email = $row['email'];
				$his = $reg_user->runQuery("SELECT * FROM transfer WHERE email = '$email' ORDER BY id DESC LIMIT 1");
				$his->execute(array(":uname"=>$_SESSION['uname']));
				while($rows = $his->fetch(PDO::FETCH_ASSOC)){?>
				
                      <p class="mb-4"><i class="fa fa-bar-chart" style="font-size:22px;color:black"></i>  Last Outflow</p>
                      <p class="fs-30 mb-2"><?php echo $row['currency']; ?>
                
                <?php echo $english_format_number = number_format( $rows['amount'] ); ?>.00</p> <?php } ?>
                      <p>( Updates every seconds)</p>
                    </div>
                  </div>
                </div>
                <div class="col-md-6 stretch-card transparent">
                  <div class="card card-light-danger">
                    <div class="card-body">
                         <?php 
				$uname = $_SESSION['uname'];
				$debcre = $reg_user->runQuery("SELECT * FROM alerts WHERE uname = '$uname' ORDER BY id DESC LIMIT 1");
				$debcre->execute();
				while($rows = $debcre->fetch(PDO::FETCH_ASSOC)){?>
				
				
                      <p class="mb-4"><i class="fa fa-area-chart" style="font-size:22px;color:black"></i> Last Deposit</p>
                      <p class="fs-30 mb-2"><?php echo $row['currency']; ?> <?php echo $english_format_number = number_format( $rows['amount'] ); ?>.00</p>  <?php } ?>
                         <p>( Updates every seconds)</p>
                    </div>
                  </div>
                </div>
              </div>
            </div>
          </div>
 
 
 
 

 
 
 
 
  
         
            
          <div class="row">
            <div class="col-md-12 grid-margin stretch-card">
              <div class="card">
                <div class="card-body">
                  <p class="card-title">Recent Transaction(s)</p>
                  <div class="row">
                    <div class="col-12">
                      <div class="table-responsive">
                        <table  class="display expandable-table" style="width:100%">
                          <thead>
                            <tr>
                              
                              <th>Receiever Name</th>
                              <th>Account</th>
                              <th>Bank</th>
                              <th>Amount</th>
                              <th>Date</th>
							  <th>Ref No.</th>
							  <th>Type</th>
                              <th>Status</th>
                              <th>Comment</th>
                              <th></th>
                            </tr>
                          </thead>
						  
						  
						    <tbody>
						        
						         <?php 
				$uname = $_SESSION['uname'];
				$email = $row['email'];
				$his = $reg_user->runQuery("SELECT * FROM transfer WHERE email = '$email' ORDER BY id DESC LIMIT 10");
				$his->execute(array(":uname"=>$_SESSION['uname']));
				while($rows = $his->fetch(PDO::FETCH_ASSOC)){?>
				
                            <tr>
                             
                              <td><?php echo $rows['acc_name']; ?></th>
                              <td><?php echo $rows['acc_no']; ?></th>
                              <td><?php echo $rows['bank_name']; ?></th>
                              <td><?php echo $row['currency']; ?><?php echo $rows['amount']; ?>.00</th>
                              
                              <td><?php echo $rows['routing']; ?></th>
							  <td>RF<?php echo(rand()); ?></th>
							  <td><div class="badge badge-success"><?php echo $rows['type']; ?></div></th>
                              <td ><div class="badge badge-danger"><?php echo $rows['status']; ?></div></th> 
                              <td><?php echo $rows['remarks']; ?></td>
                            </tr>
                            
                             <?php } ?>
                          </tbody>
						  
						  
                      </table>
                      </div>
                    </div>
                  </div>
                  </div>
                </div>

                
              </div>
            </div>
        </div>
        <!-- content-wrapper ends -->
       <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>

<script>

$(document).ready(function() {

    $('#amountInput').on('input', function() {

        var amount = $(this).val();


        if (!isNaN(amount) && amount !== "") {

            $.ajax({

                type: 'POST',

                url: 'balance_check.php',

                data: { amount: amount },

                dataType: 'json',

                success: function(response) {

                    if (response.status === "error") {

                        $('#balanceMessage').html("<span style='color: red;'>" + response.message + "</span>");

                        $('#proceedButton').prop('disabled', true);

                    } else {

                        $('#balanceMessage').html("<span style='color: green;'>" + response.message + "</span>");

                        $('#proceedButton').prop('disabled', false);

                    }

                },

                error: function(xhr, status, error) {

                    $('#balanceMessage').html("<span style='color: red;'>An error occurred: " + error + "</span>");

                }

            });

        } else {

            $('#balanceMessage').html("");

            $('#proceedButton').prop('disabled', true);

        }

    });

});

</script>
       
       <?php include 'auth_footer.php'; ?>
       
