function getBalance()
    {
        $app_id = AppAccount::getAppID();
        $app = AppAccount::getActiveAppObject();
        $limit = addslashes($_GET['lmt']);
        if ($limit < 30 || $limit == "") {
            $limit = 30;
        }
        ?>

        <div class="row">
            <div class="col-md-12 ">
                <div class="bg-green" style="padding: 10px; text-align: center;">
                <h1>Current Balance : <b><?php 
        echo $app->app_pulsa;
        ?>
</b> <i class="fa fa-mail-forward"></i> </h1>
                </div>
            </div>
        </div>
        <?php 
        //get transactions
        $apptrans = new AppPulsa();
        $arrB = $apptrans->getWhere("pulsa_app_id = '{$app_id}' ORDER BY pulsa_date DESC LIMIT 0,{$limit} ");
        $arrB = array_reverse($arrB);
        //        pr($arrB);
        ?>
        <div class="row">
        <div class="col-md-12" style="margin-top: 30px;">
        <h1><i class="fa fa-mail-forward"></i> Balance Statement <small>Last <?php 
        echo $limit;
        ?>
 Transactions</small></h1>
            <ol class="breadcrumb">
                <li>
                    <?php 
        echo Lang::t('Select Nr. of Transactions');
        ?>
                </li>
                <li class="active">

                    <select id="nrtransaction">
                        <option  value="30">30</option>
                        <option <?php 
        if ($limit == 60) {
            echo "selected";
        }
        ?>
 value="60">60</option>
                        <option <?php 
        if ($limit == 100) {
            echo "selected";
        }
        ?>
 value="100">100</option>
                        <option <?php 
        if ($limit == 500) {
            echo "selected";
        }
        ?>
 value="500">500</option>
                        <option <?php 
        if ($limit == 1000) {
            echo "selected";
        }
        ?>
 value="1000">1000</option>
                    </select>

                </li>
            </ol>
    <script>
        $('#nrtransaction').change(function(){
           var slc =  $('#nrtransaction').val();
            openLw('Balance','<?php 
        echo _SPPATH;
        ?>
AppBalance/getBalance?lmt='+slc,'fade');
        });
    </script>
        <div class="table-responsive" >
            <table class="table table-bordered" style="background-color: white;">
                <thead>
                <tr>
                    <th>
                        Date
                    </th>
                    <th>
                        Description
                    </th>
                    <th>
                        Debit
                    </th>
                    <th>
                        Credit
                    </th>
                    <th>
                        Balance
                    </th>

                </tr>

                </thead>
                <tbody>
                <?php 
        foreach ($arrB as $bb) {
            ?>
                <tr>
                    <td><?php 
            echo indonesian_date($bb->pulsa_date);
            ?>
</td>
                    <td>
                        <?php 
            if ($bb->pulsa_action == "debit") {
                ?>
                            Used in campaign. <a style="cursor: pointer;" id="camp_id_<?php 
                echo $bb->pulsa_camp_id;
                ?>
" >view campaign</a>
                            <script>
                                $('#camp_id_<?php 
                echo $bb->pulsa_camp_id;
                ?>
').click(function(){
//                                    var slc =  $('#nrtransaction').val();
                                    openLw('campView','<?php 
                echo _SPPATH;
                ?>
AppBalance/campView?camp_id=<?php 
                echo $bb->pulsa_camp_id;
                ?>
','fade');
                                });
                            </script>
                        <?php 
            } else {
                ?>
                                Topped-up
                            <?php 
            }
            ?>
                    </td>
                    <td class="duit">
                        <?php 
            if ($bb->pulsa_action == "debit") {
                echo $bb->pulsa_jumlah;
            }
            ?>
                    </td>
                    <td class="duit">
                        <?php 
            if ($bb->pulsa_action == "credit") {
                echo $bb->pulsa_jumlah;
            }
            ?>
                    </td>
                    <td class="duit">
                        <b><?php 
            echo $bb->pulsa_new;
            ?>
</b>
                    </td>

                </tr>
                    <?php 
        }
        ?>
                </tbody>
            </table>
        </div>
        </div>
        </div>
        <style>
            table.table td.duit{
                text-align: right;
            }
            .breadcrumb {
                padding: 8px 15px;
                margin-bottom: 20px;
                list-style: none;
                background-color: #f5f5f5;
                border-radius: 4px;
            }
            .breadcrumb {
                float: right;
                background: transparent;
                margin-top: 0;
                margin-bottom: 0;
                font-size: 12px;
                padding: 7px 5px;
                position: absolute;
                top: 15px;
                right: 10px;
                border-radius: 2px;
            }
        </style>
        <?php 
    }