<?php
include "config/init.php";
include "template/header.php";
//Main Header
include "template/main-header.php";
//Left side column. contains the logo and sidebar -->
include "template/main-sidebar.php";
?>

    <!-- Content Wrapper. Contains page content -->
    <div class="content-wrapper">
        <!-- Content Header (Page header) -->
        <section class="content-header">
            <h1>
                All Pay Global Accounts
            </h1>
            <ol class="breadcrumb">
                <li><a href="#"><i class="fa fa-dashboard"></i> Home</a></li>
                <li class="active">Global Accouns</li>
            </ol>
        </section>

        <!-- Main content -->
        <section class="content">
            <div class="box box-success">
                <div class="box-body">
                    <table class="table" role="table" id="systemCountry">
                        <thead>
                        <tr>
                            <th>id</th>
                            <th>Country</th>
                            <th>Cash Account</th>
                            <th>Cash Account Balance</th>
                            <th>Transit Account</th>
                            <th>Transit Balance</th>
                            <th>Transit Credit</th>
                            <th>Transit Debit</th>
                            <th>Airtime Account</th>
                            <th>Commission Expense</th>
                            <th>AirTime Expense</th>
                        </tr>
                        </thead>
                        <tbody>
                        <?php
                        $globalAccounts = get_all_PayGlobalAccounts($dbc);
                        foreach ($globalAccounts as $globalAccount){
                            ?>
                            <tr>
                                <td><?=$globalAccount['id']?></td>
                                <td><?=$globalAccount['countryCode']?></td>
                                <td class="bg-aqua"><?=$globalAccount['cashGlobalAccount']?></td>
                                <td class="bg-aqua"><?=$globalAccount['cashGlobalAccountBalance']?></td>
                                <td class="bg-lime"><?=$globalAccount['transitAccount']?></td>
                                <td class="bg-lime"><?=$globalAccount['transitAccountBalance']?></td>
                                <td class="bg-lime"><?=$globalAccount['transitAccountCredit']?></td>
                                <td class="bg-lime"><?=$globalAccount['transitAccountDebit']?></td>
                                <td class="bg-red-gradient"><?=$globalAccount['airtimeAccount']?></td>
                                <td class="bg-yellow-gradient"><?=$globalAccount['commissionExpense']?></td>
                                <td class="bg-blue-gradient"><?=$globalAccount['airtimeExpense']?></td>
                            </tr>
                            <?php
                        }
                        ?>
                        </tbody>
                    </table>
                </div>
            </div>
        </section>
        <!-- /.content -->
    </div>
    <!-- /.content-wrapper -->

<?php include "template/footer.php"?>


