<?php
$IncomeAccounts = $this->acc->getAccountsByGroup(3);
$ExpenseAccounts = $this->acc->getAccountsByGroup(4);
$IncomesTotal = $this->acc->getAccountBalanceByGroup(3);
$ExpensesTotal = $this->acc->getAccountBalanceByGroup(4);
$PL = $IncomesTotal - $ExpensesTotal;

?>
<div class="content-wrapper">
  
    <section class="content">
        <div class="container-fluid">


            <div id="accordion">
            <div class="card card-primary">
                    <div class="card-header">
                        <h4 class="card-title w-100">
                        <a class="d-block w-100" data-toggle="collapse" href="#collapseOne" aria-expanded="false">
                                Profitability ratios
                            </a>
                        </h4>
                    </div>
                    <div id="collapseOne" class="collapse show" data-parent="#accordion" style="">
                        <div class="card-body p-0">
                            <table class="table table-bordered">
                                <tbody>
                                    <tr>
                                        <td>Gross profit margin </td>
                                        <td>Gross profit margin = Gross profit / Revenue </td>
                                        <td>This ratio measures how much of the revenue is left after deducting the cost of goods sold, such as salaries, materials, and utilities. A higher gross profit margin indicates higher profitability and a lower cost structure </td>
                                    </tr>
                                    <tr>
                                        <td>Operating profit margin </td>
                                        <td>Operating profit margin = Operating profit / Revenue /td&gt;
                                        <td>This ratio measures how much of the revenue is left after deducting all the operating expenses, such as administration, depreciation, and interest. A higher operating profit margin indicates higher profitability and a lower operating cost structure. </td>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>Net profit margin</td>
                                        <td>Net profit margin = Net profit / Revenue</td>
                                        <td>This ratio measures how much of the revenue is left after deducting all the expenses, including taxes. A higher net profit margin indicates higher profitability and a lower overall cost structure. </td>
                                    </tr>
                                    <tr>
                                        <td>Return on assets</td>
                                        <td>Return on assets = Average total assets</td>
                                        <td>This ratio measures how much profit a school earns for each unit of assets. A higher return on assets indicates higher profitability and higher asset efficiency. </td>
                                    </tr>
                                    <tr>
                                        <td>Return on equity</td>
                                        <td>Return on equity = Net profit / Average total equity</td>
                                        <td>This ratio measures how much profit a school earns for each unit of equity. A higher return on equity indicates higher profitability and higher equity efficiency. </td>

                                    </tr>
                                </tbody>
                            </table>
                        </div>
                    </div>
                </div>
                <div class="card card-primary">
                    <div class="card-header">
                        <h4 class="card-title w-100">
                            <a class="d-block w-100" data-toggle="collapse" href="#collapseTwo" aria-expanded="false">
                                Liquidity ratios
                            </a>
                        </h4>
                    </div>
                    <div id="collapseTwo" class="collapse " data-parent="#accordion" style="">
                        <div class="card-body p-0">
                            <table class="table table-bordered">
                                <tbody>
                                    <tr>
                                        <td>Current Ratio</td>
                                       
                                        <td>
                                            <?php
                                            $TCA = $this->myaccounts->getAccountBalanceByAccountCategory(1);
                                            $TCL = abs($this->myaccounts->getAccountBalanceByAccountCategory(10));
                                            $CASH = $this->myaccounts->getAccountBalanceByAccountCategory(10);
                                            $current_ratio = $TCA / $TCL;
                                            ?>
                                            <!-- Total Current Assets: <?php echo $TCA; ?><br/>
                                            Total Current Liabilities: <?php echo $TCL;?><br/> -->
                                            Current ratio =  <?php echo $current_ratio; ?></td>
                                            <td>This ratio compares the current assets (such as cash, receivables, and inventories) to the current liabilities (such as payables, accrued expenses, and short-term debt). A higher current ratio indicates a better liquidity position.</td>

                                    </tr>
                                    <tr>
                                        <td>Quick Ratio</td>
                                       
                                        <!-- <td>Quick ratio = Current assets - Inventories / Current ​liabilities</td> -->
                                        <td>Quick ratio = Current assets - Inventories / Current ​liabilities</td>
                                        <td>This ratio is similar to the current ratio, but it excludes inventories, which are less liquid than other current assets. A higher quick ratio indicates a stronger liquidity position.</td>
                                    </tr>
                                    <tr>
                                        <td>Cash Ratio</td>
                                      
                                        <td>Cash ratio = Cash and cash equivalents / Current liabilities</td>
                                        <td>This ratio is the most conservative measure of liquidity, as it only considers the most liquid current asset, which is cash and cash equivalents. A higher cash ratio indicates a more liquid position. </td>
                                    </tr>
                                </tbody>
                            </table>
                        </div>
                    </div>
                </div>
                <div class="card card-primary">
                    <div class="card-header">
                        <h4 class="card-title w-100">
                            <a class="d-block w-100 collapsed" data-toggle="collapse" href="#collapsethree" aria-expanded="false">
                                Solvency ratios
                            </a>
                        </h4>
                    </div>
                    <div id="collapsethree" class="collapse" data-parent="#accordion" style="">
                        <div class="card-body p-0">
                            <table class="table table-bordered">
                                <tbody>
                                    <tr>
                                        <td>Debt-to-assets ratio </td>
                                        <td>Debt-to-assets ratio = Total debt / Total assets </td>
                                        <td>This ratio compares the total debt (both short-term and long-term) to the total assets (both current and non-current). A lower debt-to-assets ratio indicates lower leverage and a higher solvency. </td>
                                    </tr>
                                    <tr>
                                        <td>Debt-to-equity ratio </td>
                                        <td>Debt-to-equity&nbsp;ratio = Total&nbsp;debt / Total&nbsp;equity ​</td>
                                        <td>This ratio compares the total debt to the total equity (the difference between assets and liabilities). A lower debt-to-equity ratio indicates a lower leverage and a higher solvency. </td>
                                    </tr>
                                    <tr>
                                        <td>Debt service coverage ratio </td>
                                        <td>Income&nbsp;before&nbsp;interest&nbsp;and&nbsp;taxes / Debt&nbsp;service ​</td>
                                        <td>This ratio measures the ability of a school to generate enough income to cover its debt payments, such as interest and principal. A higher debt service coverage ratio indicates a higher solvency and a lower risk of default. </td>
                                    </tr>
                                </tbody>
                            </table>
                        </div>
                    </div>
                </div>
                <div class="card card-primary">
                    <div class="card-header">
                        <h4 class="card-title w-100">
                            <a class="d-block w-100 collapsed" data-toggle="collapse" href="#collapseFour" aria-expanded="false">
                                Efficiency ratios
                            </a>
                        </h4>
                    </div>
                    <div id="collapseFour" class="collapse" data-parent="#accordion" style="">
                        <div class="card-body p-0">
                            <table class="table table-bordered">
                                <tbody>
                                    <tr>
                                        <td>Asset turnover ratio </td>
                                        <td>Asset turnover ratio = Revenue / Average total assets </td>
                                        <td>This ratio measures how much revenue a school generates for each unit of assets. A higher asset turnover ratio indicates higher efficiency and productivity. </td>
                                    </tr>
                                    <tr>
                                        <td>Receivables turnover ratio </td>
                                        <td>Receivables&nbsp;turnover&nbsp;ratio = Revenue / Average&nbsp;receivables​​</td>
                                        <td>
                                            This ratio measures how quickly a school collects its receivables, such as tuition fees, grants, and donations. A higher receivables turnover ratio indicates a faster collection and a lower risk of bad debts.
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>Inventory turnover ratio </td>
                                        <td>Inventory&nbsp;turnover&nbsp;ratio = Cost&nbsp;of&nbsp;goods&nbsp;sold / Average&nbsp;inventory ​</td>
                                        <td>This ratio measures how quickly a school sells its inventories, such as books, supplies, and equipment. A higher inventory turnover ratio indicates a faster turnover and a lower risk of obsolescence. </td>
                                    </tr>
                                </tbody>
                            </table>
                        </div>
                    </div>
                </div>
            
                <div class="card card-primary">
                    <div class="card-header">
                        <h4 class="card-title w-100">
                            <a class="d-block w-100" data-toggle="collapse" href="#collapseFive">
                                Growth ratios
                            </a>
                        </h4>
                    </div>
                    <div id="collapseFive" class="collapse" data-parent="#accordion">
                        <div class="card-body p-0">
                            <table class="table table-bordered">
                                <tbody>
                                    <tr>
                                        <td>Revenue growth rate </td>
                                        <td>Debt-to-assets ratio = Total debt / Total assets </td>
                                        <td>Revenue growth rate = Revenue in current period - Revenue in previous period / Revenue in previous period </td>
                                    </tr>
                                    <tr>
                                        <td>Profit growth rate</td>
                                        <td>This ratio measures the percentage change in profit from one period to another. </td>
                                        <td>This ratio measures the percentage change in profit from one period to another. A higher profit growth rate indicates a higher growth potential and higher profitability. </td>
                                    </tr>
                                    <tr>
                                        <td>Asset growth rate</td>
                                        <td>Asset growth rate = Assets in current period - Assets in previous period / Assets in previous period/td&gt;
                                        <td>This ratio measures the percentage change in assets from one period to another. A higher asset growth rate indicates a higher growth potential and a higher asset efficiency</td>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>Equity growth rate: </td>
                                        <td>Equity growth rate = Equity in current period - Equity in previous period / Equity in previous period</td>
                                        <td>This ratio measures the percentage change in equity from one period to another. A higher equity growth rate indicates a higher growth potential and higher equity efficiency. </td>
                                    </tr>
                                </tbody>
                            </table>
                        </div>
                    </div>
                </div>
            </div>





        </div><!-- /.container-fluid -->
    </section>