<div class="col-sm-8">
    <div class="row ">
        <div class="col-sm-12 ">
            <span class="col-sm-6 text-left">
                <input type="hidden" id="baseUrl" value="<?php echo base_url(); ?>">
            </span>
            <span class="col-sm-6 text-right"> 
                <a class="form-group btn btn-success" href="<?php echo base_url('user/payment-method') ?>">Payment Method</a>
                <a class="form-group btn btn-success" href="<?php echo base_url() ?>user/total-earning">Total Earning</a>
            </span>
        </div>
        <div class="col-sm-12">
            <hr><br>
        </div>



        <div class="col-sm-12">
            <br>
        </div>

        <div class="col-sm-12">
            <div class="col-sm-12  text-left  "style="margin-bottom: 5px;font-weight: bold;border-bottom: 2px solid limegreen">
                <div class="col-sm-4">Student Name</div>
                <div class="col-sm-2 text-center">Total Amount</div>
                <div class="col-sm-2 text-center">Paid Amount</div>
                <div class="col-sm-2 text-center">Due Amount</div>
                <div class="col-sm-2 text-center">View Invoice</div>
            </div>

            <?php
            if (!empty($student_info)) {
                foreach ($student_info as $value) {
                    ?>
                    <div class="col-sm-12 text-left " style="padding: 10px;background-color:#F2F9EA;border: 1px solid #ededed">
                        <input type="hidden" id="paymentID<?php echo $value->student_roll_number; ?>" value="<?php echo $encrypt_payment_id[$value->student_id]; ?>">
                        <input type="hidden" id="status<?php echo $value->student_roll_number; ?>" value="">
                        <div class="col-sm-4"><a href="<?php echo base_url($person_info[$value->student_id]->url); ?>">
                            <?php
                                //echo $person_info[$value->student_id]->person_first_name . ' ' . $person_info[$value->student_id]->person_last_name 
                                if(strlen($person_info[$value->student_id]->person_first_name) && strlen($person_info[$value->student_id]->person_last_name) < 20){
                                  echo $person_info[$value->student_id]->person_first_name . ' ' . $person_info[$value->student_id]->person_last_name ; 
                                }else{
                                    echo substr($person_info[$value->student_id]->person_first_name, 0, 30).' '.substr($person_info[$value->student_id]->person_last_name, 0, 20);
                                }
                                
                            ?>
                            </a>
                        </div>
                        <div class="col-sm-2 text-center"><?php
                            echo $payable_amount[$value->student_id] . $payment_currency_sign[$value->student_id];
                            ?></div>
                        <div class="col-sm-2 text-center"><?php
                            echo $paid_amount[$value->student_id] . $payment_currency_sign[$value->student_id];
                            ?></div>
                        <div class="col-sm-2 text-center"><?php
                            echo $due_amount[$value->student_id] . $payment_currency_sign[$value->student_id];
                            ?></div>
                        <div class="col-sm-2 text-center" id="viewAllInvoices<?php echo $value->student_roll_number; ?>" style="color: #8DC741; cursor: pointer;">
                            <i class="glyphicon glyphicon-th-list" title="View Invoice"></i>
                        </div>
                    </div>
                    <div class="col-sm-12" style="margin-top: 20px; display: none;" id="loadingImage<?php echo $value->student_roll_number; ?>">
                        <img src="<?php echo base_url('image\invoice.gif'); ?>">
                    </div>
                    <div class="col-sm-12" style="margin-top: 20px; display: none;" id="displayAllInvoice<?php echo $value->student_roll_number; ?>">

                    </div>
                    <div class="col-sm-12 form-group"></div>
                    <?php
                }
            }
            ?>
        </div>
    </div>
</div>
<script type="text/javascript" src="<?php echo base_url() ?>front_end_resource/payment/earning_invoice.js"></script>