<!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, maximum-scale=1, shrink-to-fit=no">
    <title>Laporan | Aplikasi Gym  </title>
    <link rel="icon" type="image/x-icon" href="<?php echo base_url(); ?>assets/src/assets/img/favicon.ico"/>
    <link href="<?php echo base_url(); ?>assets/layouts/modern-light-menu/css/light/loader.css" rel="stylesheet" type="text/css" />
    <link href="<?php echo base_url(); ?>assets/layouts/modern-light-menu/css/dark/loader.css" rel="stylesheet" type="text/css" />
    <script src="<?php echo base_url(); ?>assets/layouts/modern-light-menu/loader.js"></script>
    <!-- BEGIN GLOBAL MANDATORY STYLES -->
    <link href="https://fonts.googleapis.com/css?family=Nunito:400,600,700" rel="stylesheet">
    <link href="<?php echo base_url(); ?>assets/src/bootstrap/css/bootstrap.min.css" rel="stylesheet" type="text/css" />
    <link href="<?php echo base_url(); ?>assets/layouts/modern-light-menu/css/light/plugins.css" rel="stylesheet" type="text/css" />
    <link href="<?php echo base_url(); ?>assets/layouts/modern-light-menu/css/dark/plugins.css" rel="stylesheet" type="text/css" />
    <!-- END GLOBAL MANDATORY STYLES -->

    <!-- BEGIN PAGE LEVEL STYLES -->
    <link rel="stylesheet" type="text/css" href="<?php echo base_url(); ?>assets/src/plugins/src/table/datatable/datatables.css">

    <link rel="stylesheet" type="text/css" href="<?php echo base_url(); ?>assets/src/plugins/css/light/table/datatable/dt-global_style.css">
    <link rel="stylesheet" type="text/css" href="<?php echo base_url(); ?>assets/src/plugins/css/light/table/datatable/custom_dt_miscellaneous.css">

    <link rel="stylesheet" type="text/css" href="<?php echo base_url(); ?>assets/src/plugins/css/dark/table/datatable/dt-global_style.css">
    <link rel="stylesheet" type="text/css" href="<?php echo base_url(); ?>assets/src/plugins/css/dark/table/datatable/custom_dt_miscellaneous.css">

    <!-- END PAGE LEVEL STYLES -->
</head>
<body class="layout-boxed">
    <!-- BEGIN LOADER -->
    <div id="load_screen"> <div class="loader"> <div class="loader-content">
        <div class="spinner-grow align-self-center"></div>
    </div></div></div>
    <!--  END LOADER -->

    <!--  BEGIN NAVBAR  -->
    <?php include ("navbar.php");?> 
    <!--  END NAVBAR  -->

    <!--  BEGIN MAIN CONTAINER  -->
    <div class="main-container " id="container">

        <div class="overlay"></div>
        <div class="cs-overlay"></div>
        <div class="search-overlay"></div>

        <!--  BEGIN SIDEBAR  -->
        <?php include ("sidebar.php");?> 
        <!--  END SIDEBAR  -->

        <!--  BEGIN CONTENT AREA  -->
        <div id="content" class="main-content">
            <div class="layout-px-spacing">

                <div class="middle-content container-xxl p-0">
                    </br></br>
                    <div class="row">                    
                        <div class="col-xl-12 col-lg-12 col-sm-12  layout-spacing">
                            <h4><b>Laporan Keuangan Gym</b></h4>
                            
                            <div class="row">    
                                <div class="col-xl-4 col-lg-4 col-md-12 col-sm-12 mx-auto">
                                    <div class="card bg-secondary">
                                        <div class="card-body">
                                            <h5 class="card-title">Total : Rp <?php echo number_format($tot[0]['total'] ?? 0,0,',','.'); ?></h5>
                                            <p class="mb-0">Jumlah Pemasukan <b>Tahun</b> ini</p>
                                        </div>
                                    </div>
                                    </br>                                    
                                </div>
                                <div class="col-xl-4 col-lg-4 col-md-12 col-sm-12 mx-auto">
                                    <div class="card bg-info">
                                        <div class="card-body">
                                            <h5 class="card-title">Total : Rp <?php echo number_format($tot[0]['total'] ?? 0,0,',','.'); ?></h5>
                                            <p class="mb-0">Jumlah Pemasukan <b>Bulan</b> Ini</p>
                                        </div>
                                    </div> 
                                    </br>                                   
                                </div>
                                <div class="col-xl-4 col-lg-4 col-md-12 col-sm-12 mx-auto">
                                    <div class="card bg-success">
                                        <div class="card-body">
                                            <h5 class="card-title">Total : Rp <?php echo number_format($tot[0]['total'] ?? 0,0,',','.'); ?></h5>
                                            <p class="mb-0">Jumlah Pemasukan <b>Minggu</b> Ini</p>
                                        </div>
                                    </div>
                                    </br>                                    
                                </div>
                            </div>                                
                            <div class="statbox widget box box-shadow">      
                                <div class="widget-content widget-content-area">
                                    <table id="html5-extension" class="table dt-table-hover" style="width:100%">
                                        <thead>
                                            <tr>                                                
                                                <th>Tanggal</th>
                                                <th>Jenis Transaksi</th>
                                                <th>Nama</th>
                                                <th>Nominal</th>
                                            </tr>
                                        </thead>
                                        <tbody>
                                            <?php
                                                foreach($detil as $row){
                                                    echo "
                                                        <tr>                                                            
                                                            <td>".$row['date']."</td>
                                                            <td><span class='badge badge-info mb-2 me-4'>".$row['type']."</span></td>
                                                            <td>".$row['name_finance']."</td>
                                                            <td>Rp ".number_format($row['nominal'] ?? 0,0,',','.')."</td>
                                                        </tr>
                                                    ";
                                                }
                                            ?>
                                                                                        
                                        </tbody>
                                    </table>
                                </div>
                            </div>
                        </div>    
                    </div>                    
                </div>                
            </div>
            
            <!--  BEGIN FOOTER  -->
            <div class="footer-wrapper">
                <div class="footer-section f-section-1">
                    <p class="">Copyright © <span class="dynamic-year">2022</span> <a target="_blank" href="https://designreset.com/cork-admin/">DesignReset</a>, All rights reserved.</p>
                </div>
                <div class="footer-section f-section-2">
                    <p class="">Coded with <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-heart"><path d="M20.84 4.61a5.5 5.5 0 0 0-7.78 0L12 5.67l-1.06-1.06a5.5 5.5 0 0 0-7.78 7.78l1.06 1.06L12 21.23l7.78-7.78 1.06-1.06a5.5 5.5 0 0 0 0-7.78z"></path></svg></p>
                </div>
            </div>
            <!--  END CONTENT AREA  -->
        </div>
        <!--  END CONTENT AREA  -->
    </div>
    <!-- END MAIN CONTAINER -->
    
    
    
    <!-- BEGIN GLOBAL MANDATORY SCRIPTS -->
    <script src="<?php echo base_url(); ?>assets/src/plugins/src/global/vendors.min.js"></script>
    <script src="<?php echo base_url(); ?>assets/src/bootstrap/js/bootstrap.bundle.min.js"></script>
    <script src="<?php echo base_url(); ?>assets/src/plugins/src/perfect-scrollbar/perfect-scrollbar.min.js"></script>
    <script src="<?php echo base_url(); ?>assets/src/plugins/src/mousetrap/mousetrap.min.js"></script>
    <script src="<?php echo base_url(); ?>assets/src/plugins/src/waves/waves.min.js"></script>
    <script src="<?php echo base_url(); ?>assets/layouts/modern-light-menu/app.js"></script>
    <script src="<?php echo base_url(); ?>assets/src/assets/js/custom.js"></script>
    <!-- END GLOBAL MANDATORY SCRIPTS -->
    
    <!-- BEGIN PAGE LEVEL SCRIPTS -->
    <script src="<?php echo base_url(); ?>assets/src/plugins/src/table/datatable/datatables.js"></script>
    <script src="<?php echo base_url(); ?>assets/src/plugins/src/table/datatable/button-ext/dataTables.buttons.min.js"></script>
    <script src="<?php echo base_url(); ?>assets/src/plugins/src/table/datatable/button-ext/jszip.min.js"></script>    
    <script src="<?php echo base_url(); ?>assets/src/plugins/src/table/datatable/button-ext/buttons.html5.min.js"></script>
    <script src="<?php echo base_url(); ?>assets/src/plugins/src/table/datatable/button-ext/buttons.print.min.js"></script>
    <script src="<?php echo base_url(); ?>assets/src/plugins/src/table/datatable/custom_miscellaneous.js"></script>
    <!-- END PAGE LEVEL SCRIPTS -->    
</body>
</html>