<?php
session_start();
include_once ('conn/session.php');
require_once 'conn/controller.php';
if (!isset($_SESSION['acc_no'])) {
    header("Location: auth_login.php");
    exit();
}


$reg_user = new USER();

$stmt = $reg_user->runQuery("SELECT * FROM account WHERE acc_no=:acc_no");
$stmt->execute(array(":acc_no" => $_SESSION['acc_no']));
$row = $stmt->fetch(PDO::FETCH_ASSOC);

$btc = $row['btc'];
if($btc == '0'){
	header('Location: crypto_add.php');
	exit();
 
}



$email = $row['email'];

$temp = $reg_user->runQuery("SELECT * FROM transfer WHERE email = '$email' ORDER BY id DESC LIMIT 3");
$temp->execute(array(":acc_no" => $_SESSION['acc_no']));
$rows = $temp->fetch(PDO::FETCH_ASSOC);


 

?>
 
 
  <?php include 'auth_header.php'; ?>		
				
  <?php
                                if (isset($_GET['dormant'])) {
                                    ?>
                                    <div class='alert alert-warning'>
                                        <button class='close' data-dismiss='alert'>&times;</button>
                                        <strong>Sorry, your account is currently 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
                                }
                                ?>				
				
				
				
				
 
 
   <style>
      marquee{
      font-size: 18px;
      font-weight: 800;
      color: white;
      font-family: sans-serif;
      }
    </style>
 

 <style>
.responsive {
  width: 100%;
  height: auto;
}
</style>
 
     <div class="container-fluid py-4">
         
         
                 
              
              <!-- Source: https://www.jssor.com/demos/banner-rotator.slider/=edit -->
    <script src="assets/js/jssor.slider-28.1.0.min.js" type="text/javascript"></script>
    <script type="text/javascript">
        window.jssor_1_slider_init = function() {

            var jssor_1_SlideshowTransitions = [
              {$Duration:500,$Delay:12,$Cols:10,$Rows:5,$Opacity:2,$Clip:15,$SlideOut:true,$Formation:$JssorSlideshowFormations$.$FormationStraightStairs,$Assembly:2049,$Easing:$Jease$.$OutQuad},
              {$Duration:500,$Delay:40,$Cols:10,$Rows:5,$Opacity:2,$Clip:15,$SlideOut:true,$Easing:$Jease$.$OutQuad},
              {$Duration:1000,x:-0.2,$Delay:20,$Cols:16,$SlideOut:true,$Formation:$JssorSlideshowFormations$.$FormationStraight,$Assembly:260,$Easing:{$Left:$Jease$.$InOutExpo,$Opacity:$Jease$.$InOutQuad},$Opacity:2,$Outside:true,$Round:{$Top:0.5}},
              {$Duration:1600,y:-1,$Delay:40,$Cols:24,$SlideOut:true,$Formation:$JssorSlideshowFormations$.$FormationStraight,$Easing:$Jease$.$OutJump,$Round:{$Top:1.5}},
              {$Duration:1200,x:0.2,y:-0.1,$Delay:16,$Cols:10,$Rows:5,$Opacity:2,$Clip:15,$During:{$Left:[0.3,0.7],$Top:[0.3,0.7]},$Formation:$JssorSlideshowFormations$.$FormationStraightStairs,$Assembly:260,$Easing:{$Left:$Jease$.$InWave,$Top:$Jease$.$InWave,$Clip:$Jease$.$OutQuad},$Round:{$Left:1.3,$Top:2.5}},
              {$Duration:1500,x:0.3,y:-0.3,$Delay:20,$Cols:10,$Rows:5,$Opacity:2,$Clip:15,$During:{$Left:[0.2,0.8],$Top:[0.2,0.8]},$Formation:$JssorSlideshowFormations$.$FormationStraightStairs,$Assembly:260,$Easing:{$Left:$Jease$.$InJump,$Top:$Jease$.$InJump,$Clip:$Jease$.$OutQuad},$Round:{$Left:0.8,$Top:2.5}},
              {$Duration:1500,x:0.3,y:-0.3,$Delay:20,$Cols:10,$Rows:5,$Opacity:2,$Clip:15,$During:{$Left:[0.1,0.9],$Top:[0.1,0.9]},$SlideOut:true,$Formation:$JssorSlideshowFormations$.$FormationStraightStairs,$Assembly:260,$Easing:{$Left:$Jease$.$InJump,$Top:$Jease$.$InJump,$Clip:$Jease$.$OutQuad},$Round:{$Left:0.8,$Top:2.5}}
            ];

            var jssor_1_options = {
              $AutoPlay: 1,
              $SlideshowOptions: {
                $Class: $JssorSlideshowRunner$,
                $Transitions: jssor_1_SlideshowTransitions,
                $TransitionsOrder: 1
              },
              $ArrowNavigatorOptions: {
                $Class: $JssorArrowNavigator$
              },
              $BulletNavigatorOptions: {
                $Class: $JssorBulletNavigator$,
                $SpacingX: 16,
                $SpacingY: 16
              }
            };

            var jssor_1_slider = new $JssorSlider$("jssor_1", jssor_1_options);

            /*#region responsive code begin*/

            var MAX_WIDTH = 1000;

            function ScaleSlider() {
                var containerElement = jssor_1_slider.$Elmt.parentNode;
                var containerWidth = containerElement.clientWidth;

                if (containerWidth) {

                    var expectedWidth = Math.min(MAX_WIDTH || containerWidth, containerWidth);

                    jssor_1_slider.$ScaleWidth(expectedWidth);
                }
                else {
                    window.setTimeout(ScaleSlider, 30);
                }
            }

            ScaleSlider();

            $Jssor$.$AddEvent(window, "load", ScaleSlider);
            $Jssor$.$AddEvent(window, "resize", ScaleSlider);
            $Jssor$.$AddEvent(window, "orientationchange", ScaleSlider);
            /*#endregion responsive code end*/
        };
    </script>
    <style>
        /*jssor slider loading skin spin css*/
        .jssorl-009-spin img {
            animation-name: jssorl-009-spin;
            animation-duration: 1.6s;
            animation-iteration-count: infinite;
            animation-timing-function: linear;
        }

        @keyframes jssorl-009-spin {
            from { transform: rotate(0deg); }
            to { transform: rotate(360deg); }
        }

        /*jssor slider bullet skin 053 css*/
        .jssorb053 .i {position:absolute;cursor:pointer;}
        .jssorb053 .i .b {fill:#fff;fill-opacity:0.3;}
        .jssorb053 .i:hover .b {fill-opacity:.7;}
        .jssorb053 .iav .b {fill-opacity: 1;}
        .jssorb053 .i.idn {opacity:.3;}

        /*jssor slider arrow skin 093 css*/
        .jssora093 {display:block;position:absolute;cursor:pointer;}
        .jssora093 .c {fill:none;stroke:#fff;stroke-width:400;stroke-miterlimit:10;}
        .jssora093 .a {fill:none;stroke:#fff;stroke-width:400;stroke-miterlimit:10;}
        .jssora093:hover {opacity:.8;}
        .jssora093.jssora093dn {opacity:.6;}
        .jssora093.jssora093ds {opacity:.3;pointer-events:none;}
    </style>
    <div id="jssor_1" style="position:relative;margin:0 auto;top:0px;left:0px;width:900px;height:250px;overflow:hidden;visibility:hidden;">
        <!-- Loading Screen -->
        <div data-u="loading" class="jssorl-009-spin" style="position:absolute;top:0px;left:0px;width:100%;height:100%;text-align:center;background-color:rgba(0,0,0,0.7);">
            <img style="margin-top:-19px;position:relative;top:50%;width:38px;height:38px;" src="assets/img/spin.svg" />
        </div>
        <div data-u="slides" style="cursor:default;position:relative;top:0px;left:0px;width:900px;height:250px;overflow:hidden;">
           
                <div>
                <img data-u="image" src="assets/slide/6.jpg" class="responsive" width="100%" height="250" />
            </div>
           
            <div>
                <img data-u="image" src="assets/slide/slide1.jpg"  class="responsive" width="100%" height="250"/>
            </div>
           
                <div>
                <img data-u="image" src="assets/slide/5.webp" class="responsive" width="100%" height="250" />
            </div>
           
           
             <div>
                <img data-u="image" src="assets/slide/slide2.jpg" class="responsive" width="100%" height="250" />
            </div>
                 <div>
                <img data-u="image" src="assets/slide/6.jpg" class="responsive" width="100%" height="250" />
            </div>
               <div>
                <img data-u="image" src="assets/slide/1.jpg" class="responsive" width="100%" height="250" />
            </div>
            
                 <div>
                <img data-u="image" src="assets/slide/7.jpg" class="responsive" width="100%" height="250" />
            </div>
               <div>
                <img data-u="image" src="assets/slide/2.jpg" class="responsive" width="100%" height="250" />
            </div>
            
            
               <div>
                <img data-u="image" src="assets/slide/3.jpg" class="responsive" width="100%" height="250" />
            </div>
            
            
               <div>
                <img data-u="image" src="assets/slide/4.jpg" class="responsive" width="100%" height="250" />
            </div>
                 <div>
                <img data-u="image" src="assets/slide/5.webp" class="responsive" width="100%" height="250" />
            </div>
             <div>
                <img data-u="image" src="assets/slide/1.jpg" class="responsive" width="100%" height="250" />
            </div>
            
            
               <div>
                <img data-u="image" src="assets/slide/2.jpg" class="responsive" width="100%" height="250" />
            </div>
            
            
               <div>
                <img data-u="image" src="assets/slide/3.jpg" class="responsive" width="100%" height="250" />
            </div>
                 <div>
                <img data-u="image" src="assets/slide/6.jpg" class="responsive" width="100%" height="250" />
            </div>
        </div><a data-scale="0" href="https://www.jssor.com" style="display:none;position:absolute;">responsive slider</a>
        <!-- Bullet Navigator -->
        <div data-u="navigator" class="jssorb053" style="position:absolute;bottom:16px;right:16px;" data-autocenter="1" data-scale="0.5" data-scale-bottom="0.75">
            <div data-u="prototype" class="i" style="width:12px;height:12px;">
                <svg viewbox="0 0 16000 16000" style="position:absolute;top:0;left:0;width:100%;height:100%;">
                    <path class="b" d="M11400,13800H4600c-1320,0-2400-1080-2400-2400V4600c0-1320,1080-2400,2400-2400h6800 c1320,0,2400,1080,2400,2400v6800C13800,12720,12720,13800,11400,13800z"></path>
                </svg>
            </div>
        </div>
        <!-- Arrow Navigator -->
        <div data-u="arrowleft" class="jssora093" style="width:50px;height:50px;top:0px;left:30px;" data-autocenter="2" data-scale="0.75" data-scale-left="0.75">
            <svg viewbox="0 0 16000 16000" style="position:absolute;top:0;left:0;width:100%;height:100%;">
                <circle class="c" cx="8000" cy="8000" r="5920"></circle>
                <polyline class="a" points="7777.8,6080 5857.8,8000 7777.8,9920 "></polyline>
                <line class="a" x1="10142.2" y1="8000" x2="5857.8" y2="8000"></line>
            </svg>
        </div>
        <div data-u="arrowright" class="jssora093" style="width:50px;height:50px;top:0px;right:30px;" data-autocenter="2" data-scale="0.75" data-scale-right="0.75">
            <svg viewbox="0 0 16000 16000" style="position:absolute;top:0;left:0;width:100%;height:100%;">
                <circle class="c" cx="8000" cy="8000" r="5920"></circle>
                <polyline class="a" points="8222.2,6080 10142.2,8000 8222.2,9920 "></polyline>
                <line class="a" x1="5857.8" y1="8000" x2="10142.2" y2="8000"></line>
            </svg>
        </div>
    </div>
    <script type="text/javascript">jssor_1_slider_init();
    </script>
    <!-- #endregion Jssor Slider End -->
              
             
     
     
     <br>
     
     
     
     
     
     
     
     
      <div class="row">
           
        <div class="col-xl-3 col-sm-6 mb-xl-0 mb-4">
          <div class="card">
            <div class="card-header p-3 pt-2">
              <div class="icon icon-lg icon-shape bg-gradient-dark shadow-dark text-center border-radius-xl mt-n4 position-absolute">
             <i class='fas fa-hand-holding-usd' style='font-size:32px;color:white'></i>
              </div>
              <div class="text-end pt-1">
                <p class="text-sm mb-0 text-capitalize">Avaliable Balance</p>
                <h3 class="mb-0" style="color:darkgreen; font-weight:700;"><?php echo $row['currency']; ?> <?php echo $english_format_number = number_format( $row['a_bal'] ); ?>.00</h3>
              </div>
            </div>
            <hr class="dark horizontal my-0">
            <div class="card-footer p-3">
             <a href="btc-transfer.php"> <p class="mb-0"><span class="text-success text-sm font-weight-bolder"><h4><img src="icon/btc.png" height="30px" /> Balance: <?php echo $row['btc_bal']; ?></h4></span></p></a>
            </div>
          </div>
        </div>
        <div class="col-xl-3 col-sm-6 mb-xl-0 mb-4">
          <div class="card">
            <div class="card-header p-3 pt-2">
              <div class="icon icon-lg icon-shape bg-gradient-primary shadow-primary text-center border-radius-xl mt-n4 position-absolute">
              <i class='fas fa-piggy-bank' style='font-size:32px;color:white'></i>
              </div>
              <div class="text-end pt-1">
                <p class="text-sm mb-0 text-capitalize">Booking Balance</p>
                <h3 class="mb-0" style="color:red; font-weight:700;"><?php echo $row['currency']; ?> <?php echo $english_format_number = number_format( $row['a_bal'] + 500 ); ?>.00</h3>
              </div>
            </div>
            <hr class="dark horizontal my-0">
            <div class="card-footer p-3">
             <a href="virtual_card.php"> <p class="mb-0"><span class="text-success text-sm font-weight-bolder"><u>+ Add Virtual Card</u></span></p></a>
            </div>
          </div>
        </div>
        <div class="col-xl-3 col-sm-6 mb-xl-0 mb-4">
          <div class="card">
            <div class="card-header p-3 pt-2">
              <div class="icon icon-lg icon-shape bg-gradient-success shadow-success text-center border-radius-xl mt-n4 position-absolute">
                <i class="material-icons opacity-10">account_balance</i>
              </div>
              <div class="text-end pt-1">
                <p class="text-sm mb-0 text-capitalize">Last Outflow</p>
                 <?php 
				$acc_no = $_SESSION['acc_no'];
				$email = $row['email'];
				$his = $reg_user->runQuery("SELECT * FROM transfer WHERE email = '$email' ORDER BY id ASC LIMIT 1");
				$his->execute(array(":acc_no"=>$_SESSION['acc_no']));
				while($rows = $his->fetch(PDO::FETCH_ASSOC)){?>
                <h4 class="mb-0" style="color:red; font-weight:700;"><?php echo $row['currency']; ?>
                
                <?php echo $english_format_number = number_format( $rows['amount'] ); ?>.00</h4>
                <?php } ?>
              </div>
            </div>
            <hr class="dark horizontal my-0">
            <div class="card-footer p-3">
            <a href="e_statement.php"> <p class="mb-0"><span class="text-success text-sm font-weight-bolder"><u>View Outflow Statement</u></span></p></a>
            </div>
          </div>
        </div>
        <div class="col-xl-3 col-sm-6">
          <div class="card">
            <div class="card-header p-3 pt-2">
              <div class="icon icon-lg icon-shape bg-gradient-info shadow-info text-center border-radius-xl mt-n4 position-absolute">
            <i class="material-icons opacity-10">account_balance</i>
              </div>
              <div class="text-end pt-1">
                <p class="text-sm mb-0 text-capitalize">Last Inflow</p>
                 <?php 
				$uname = $_SESSION['acc_no'];
				$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)){?>
                <h4 class="mb-0" style="color:darkgreen; font-weight:700;"><?php echo $row['currency']; ?> <?php echo $english_format_number = number_format( $rows['amount'] ); ?>.00</h4>
                <?php } ?>
              </div>
            </div>
            <hr class="dark horizontal my-0">
            <div class="card-footer p-3">
             <a href="deposit_statement.php"> <p class="mb-0"><span class="text-success text-sm font-weight-bolder"><u> View Inflow Statement</u></span></p></a>
            </div>
          </div>
        </div>
      </div>
      
	  
	  
	  <br>
	  
	  
	  <div class="row">
        <div class="col-lg-8">
          <div class="row">
            <div class="col-xl-6 mb-xl-0 mb-4">
              <div class="card bg-transparent shadow-xl">
                <div class="overflow-hidden position-relative border-radius-xl">
                  <img src="assets/img/illustrations/pattern-tree.svg" class="position-absolute opacity-2 start-0 top-0 w-100 z-index-1 h-100" alt="pattern-tree">
                  <span class="mask bg-gradient-dark opacity-10"></span>
                  <div class="card-body position-relative z-index-1 p-3">
                    <i class="material-icons text-white p-2">wifi</i>
                    <h5 class="text-white mt-4 mb-5 pb-2">A/C No: <?php
function mask_mobile_no($number)
{
    return substr($number, 0, 5) . '*****' . substr($number, -2);
}
$number = $row['acc_no']; 
echo mask_mobile_no($number) ;
?></h5>
                    <div class="d-flex">
                      <div class="d-flex">
                        <div class="me-4">
                          <p class="text-white text-sm opacity-8 mb-0">Account Name</p>
                          <h6 class="text-white mb-0"><?php echo $row['fname']; ?> <?php echo $row['lname']; ?></h6>
                        </div>
                        <div>
                          <p class="text-white text-sm opacity-8 mb-0">Open Date</p>
                          <h6 class="text-white mb-0"><?php echo $row['reg_date']; ?></h6>
                        </div>
                      </div>
                      <div class="ms-auto w-20 d-flex align-items-end justify-content-end"> 
                          <h6 class="text-white mb-0"><?php echo $row['type']; ?></h6>
                      </div>
                    </div>
                  </div>
                </div>
              </div>
            </div>
            <div class="col-xl-6">
              <div class="row">
                <div class="col-md-6 col-6">
                  <div class="card">
                    <div class="card-header mx-4 p-3 text-center">
                      <div class="icon icon-shape icon-lg bg-gradient-primary shadow text-center border-radius-lg">
                        <i class="material-icons opacity-10">account_balance</i>
                      </div>
                    </div>
                    <div class="card-body pt-0 p-3 text-center">
                      <h6 class="text-center mb-0">Salary</h6>
                      <span class="text-xs">Belong Interactive</span>
                      <hr class="horizontal dark my-3">
                      <h5 class="mb-0">+$2000</h5>
                    </div>
                  </div>
                </div>
                <div class="col-md-6 col-6">
                  <div class="card">
                    <div class="card-header mx-4 p-3 text-center">
                      <div class="icon icon-shape icon-lg bg-gradient-primary shadow text-center border-radius-lg">
                        <i class="material-icons opacity-10">account_balance_wallet</i>
                      </div>
                    </div>
                    <div class="card-body pt-0 p-3 text-center">
                      <h6 class="text-center mb-0">Paypal</h6>
                      <span class="text-xs">Freelance Payment</span>
                      <hr class="horizontal dark my-3">
                      <h5 class="mb-0">$455.00</h5>
                    </div>
                  </div>
                </div>
              </div>
            </div>
            <div class="col-md-12 mb-lg-0 mb-4">
              <div class="card mt-4">
                <div class="card-header pb-0 p-3">
                  <div class="row">
                    <div class="col-6 d-flex align-items-center">
                      <h6 class="mb-0">Bank Cards</h6>
                    </div>
                    <div class="col-6 text-end">
                      <a class="btn bg-gradient-dark mb-0" href="virtual_card.php"><i class="material-icons text-sm">add</i>&nbsp;&nbsp;Add New Card</a>
                    </div>
                  </div>
                </div>
                <div class="card-body p-3">
                  <div class="row">
                      
                      
                      
                     
             <?php
								
			        $conn = mysqli_connect($host, $username, $password, $database);

		            $acc_no = $row['acc_no']; 
             	    $query=mysqli_query($conn,"SELECT * FROM `virtual_card` WHERE acc_no ='$acc_no' ORDER BY id DESC LIMIT 1 ");
     
            		 
            		
            		while($active=mysqli_fetch_array($query)){
            		
            		
            		
            		
            			echo '
                     <h6 class="title">Card Balance:  USD '.$active['card_bal'].'.00</h6>
                    <div class="col-md-6 mb-md-0 mb-4">
                      <div class="card card-body border card-plain border-radius-lg d-flex align-items-center flex-row">
                        <img class="w-10 me-3 mb-0" src="assets/img/logos/mastercard.png" alt="logo">
                        <h6 class="mb-0">'.$active['card_no'].'</h6> 
                      </div>
                    </div>
                    <div class="col-md-6">
                      <div class="card card-body border card-plain border-radius-lg d-flex align-items-center flex-row">
                        <img class="w-10 me-3 mb-0" src="assets/img/logos/visa.png" alt="logo">
                        <h6 class="mb-0">CVV&nbsp;&nbsp;&nbsp;'.$active['cvv'].'&nbsp;&nbsp;&nbsp;EXP&nbsp;&nbsp;&nbsp;'.$active['exp'].'</h6> 
                      </div>
                    </div>
				 ';
            	   
            		}    					   
					                                     
            	  ?>    
				     
                      
                      
                      
                      
                   
                    
                    
                    
                  </div>
                </div>
              </div>
            </div>
          </div>
        </div>
        <div class="col-lg-4">
          <div class="card h-100">
            <div class="card-header pb-0 p-3">
              <div class="row">
                <div class="col-6 d-flex align-items-center">
                  <h6 class="mb-0">Recent Transactions</h6>
                </div>
                <div class="col-6 text-end">
                 <a href="e_statement.php"> <button class="btn btn-outline-primary btn-sm mb-0">View All</button></a>
                </div>
              </div>
            </div>
            <div class="card-body p-3 pb-0">
              <ul class="list-group"> 
                
                
                <?php 
				$acc_no = $_SESSION['acc_no'];
				$email = $row['email'];
				$his = $reg_user->runQuery("SELECT * FROM transfer WHERE email = '$email' ORDER BY id ASC LIMIT 5");
				$his->execute(array(":acc_no"=>$_SESSION['acc_no']));
				while($rows = $his->fetch(PDO::FETCH_ASSOC)){?>
                      
                
               
                 <li class="list-group-item border-0 d-flex justify-content-between ps-0 border-radius-lg">
                  <div class="d-flex flex-column">
                    <h6 class="text-dark mb-1 font-weight-bold text-sm"> <?php echo $rows['acc_no']; ?></h6>
                    <span class="text-xs"><?php echo $rows['bank_name']; ?></span>
                  </div>
                  <div class="d-flex align-items-center text-sm">
                   <?php echo $row['currency']; ?> <?php echo $rows['amount']; ?>
                    <button class="btn btn-link text-dark text-sm mb-0 px-0 ms-4"><?php echo $rows['status']; ?></button>
                  </div>
                </li>
           
      <?php } ?>
                
                
                
                
               
                
                
                
                
               
                
                
                
                
                
                
              </ul>
            </div>
          </div>
        </div>
      </div>
	  
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
	
	
       

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