<?php session_start(); error_reporting(0); ?>
<?php if(!isset($_SESSION['j_admin']) && !isset($_SESSION['j_admin'])){ 
    $url = urlencode("http://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]"); header('location:../login/?url='.$url.'');  
} ?>
<!doctype html>
<html lang="en"> 
<head>
	<?php
    require_once("../j_conn/url.php");
    require_once("../j_conn/dbc.php");
    require_once("../j_incs/functions.php");
    $page_name="Account Balance";
    $page_desc="$page_name";
    $page_img="".$dir."j_files/j_img/logo/logo-meta.png";
    $page_author="$company";
    $page_keywords="".$company.", $page_name, $page_desc, ".$company_motto.", $company_desc";
    $page_url="".$dir."wallet/";
    require_once("../j_incs/metas.php");
    require_once("../j_incs/scripts-top.php");
    ?>
</head>
<body>
    
    <div class="app">
        <div class="layout">
            <?php 
            require_once("../j_incs/header.php");
            require_once("../j_incs/nav.php");
            ?>
            <!-- Page Container START -->
            <div class="page-container">
                

                <!-- Content Wrapper START -->
                <div class="main-content">
                    <div class="page-header">
                        <?php /*<h2 class="header-title"><?php echo $page_name; ?></h2>*/ ?>
                        <div class="header-sub-title">
                            <nav class="breadcrumb breadcrumb-dash">
                                <a href="<?php echo $dir; ?>" class="breadcrumb-item"><i class="anticon anticon-dashboard m-r-5"></i>Dashboard</a>
                                <!--<a class="breadcrumb-item" href="#"> </a>-->
                                <span class="breadcrumb-item active"><?php echo $page_name; ?></span>
                            </nav>
                        </div>
                    </div>
                     
                    <div class="container">
                        <div class="tab-content m-t-15">
                            <div class="tab-pane fade show active" id="tab-account">
                                
                                
                                <div class="card">
                                    
                                    <div class="card-body">
                                        <form method="POST" action="" id="form">
                                            
                                            <div class="form-row">
                                                <div class="form-group col-md-3"></div>
                                                <div class="form-group col-md-6">
                                                    
                                                    <h2 align="center">
                                                         <?php 
															if(isset($_SESSION['j_admin'])){ 
															}else{
																$sql25="SELECT sum(j_wallet) as total from j_users WHERE 
																j_deleted < 1"; //  
																$result25 = runSQL($sql25);
																$data25 = mysqli_fetch_array($result25);
																$wallet = $data25['total']; 
																//
																$sql25="SELECT sum(j_wallet_usd) as total from j_users WHERE 
																j_deleted < 1 "; //  
																$result25 = runSQL($sql25);
																$data25 = mysqli_fetch_array($result25);
																$wallet_usd = $data25['total'];
																
																//
																$sql25="SELECT sum(j_wallet_btc) as total from j_users WHERE 
																j_deleted < 1 "; //  
																$result25 = runSQL($sql25);
																$data25 = mysqli_fetch_array($result25);
																$wallet_btc = $data25['total'];
																//
																$sql25="SELECT sum(j_wallet_eth) as total from j_users WHERE 
																j_deleted < 1 "; //  
																$result25 = runSQL($sql25);
																$data25 = mysqli_fetch_array($result25);
																$wallet_eth = $data25['total'];
																//
																$sql25="SELECT sum(j_wallet_ltc) as total from j_users WHERE 
																j_deleted < 1 "; //  
																$result25 = runSQL($sql25);
																$data25 = mysqli_fetch_array($result25);
																$wallet_ltc = $data25['total'];
															}

														?>
                                                        
                                                    </h2>
                                                </div>
                                            </div>
                                            
											<div class="row">
                        
                        
                        
												<div class="col-lg-3"></div>
												<div class="col-lg-6 text-center">
													<h2 class="m-b-20"><?phP echo amount_w_c($wallet,$currency_in_use); ?></h2>
												</div>
												
												
												
											   
											</div>
					
											<?php if(isset($_SESSION['j_admin'])){ ?>
											<p align="center">
												<a href="<?php echo $dir; ?>deposit/" class="btn btn-md btn-primary m-b-20 m-r-20">Make Deposit </a>
												<a href="<?php echo $dir; ?>withdraw/" class="btn btn-danger btn-default m-b-20"> Withdraw Cash </a>
											</p>	
											
											<?php } ?>
                                            
                                            
                                        </form>
                                    </div>
                                </div>

                             
                            </div>
                            
                        </div>
                    </div>
                </div>
                <!-- Content Wrapper END -->

                <?php
                require_once("../j_incs/footer.php");
                ?>

            </div>
            <!-- Page Container END -->
        </div>
    </div>
    
    
    <?php
    require_once("../j_incs/scripts-bottom.php");
    ?>

   
</body>
</html>