<!DOCTYPE html>
<html>
    <head>
        <title>Fee Invoice</title>
        <link rel="preconnect" href="https://fonts.googleapis.com">
        <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
        <link href="https://fonts.googleapis.com/css2?family=Inconsolata:wght@200;300;400;500;600;700&display=swap" rel="stylesheet"> 
        <style>
            .w-100{width:100%;}
            .w-50-1{width:50%;float:left;height:100%;border-right:1px dotted red;
                 background-image: url("<?php echo school_logo_full; ?>");
                opacity: 0.1;
                background-repeat: no-repeat;
                background-size: 40% auto;
                background-position: center;
                z-index: -1;
            }
            .w-50-2{
                width:50%;
                float:left;
                height:100%;
                background-image: url("<?php echo school_logo_full; ?>");
                opacity: 0.1;
                background-repeat: no-repeat;
                background-size: 40% auto;
                background-position: center;
                z-index: -1;
            }
            .w-2{width:0%;float:left;}
            img{height:80px;width:auto;}
            html{
                padding:0px;
                margin:0px;
                font-family: 'Inconsolata', monospace; 
                
            }
            body{padding:10px;margin:0px;font-size:13px;}
        </style>
    </head>
    <body>

    <div class="w-100">
    <?php
    $tid=$this->session->userdata('tid');
    $staff_table='school_staff';
    $get_user_info=$this->InvoiceModel->get_item_data($tid,$staff_table);
    $user_name='';
    $user_salutation='';
    
    $fee_staff_name='';
    if($get_user_info){
        foreach($get_user_info as $user_info){
            $user_salutation=$user_info['salutation'];
            $user_name=$user_info['name'];
        }
    }
    $fee_no=$this->uri->segment('3');
    $get_fee_invoice_data=$this->InvoiceModel->get_fee_data($fee_no);
    if($get_fee_invoice_data){
        foreach($get_fee_invoice_data as $fee){
            $sid=$fee['sid'];
            $student_table='student';
            $get_student_course_info=$this->NewFeeModel->get_studdents_current_course_data($sid,$fee['acedemic_session']);
            $fee_staff_id=$fee['tid'];
            
            $get_fee_staff_info=$this->InvoiceModel->get_item_data($fee_staff_id,$staff_table);
            if($get_fee_staff_info){
                foreach($get_fee_staff_info as $fee_staff_info){
                    $fee_staff_name=$fee_staff_info['salutation']." ".$fee_staff_info['name'];
                }
            }
            
            if($get_student_course_info){
                foreach($get_student_course_info as $course_info){
                    
                    $new_admission=$course_info['new_admission'];
                    
            //     }
            // }
            
            $get_student_info=$this->InvoiceModel->get_item_data($sid,$student_table);
            if($get_student_info){
                foreach($get_student_info as $info){
            ?>
            <div class="w-50-1" style="">
                <table style="width:100%;margin:0px;padding:0px;">
                    <tr style="width:100% !important;padding:0px !important;">
                        <td style="width:20%;background:;padding:0px;border-bottom:1px solid red;padding-left:20px;">
                            <img src="<?php echo school_logo_full; ?>" style="margin:auto;width:85%;height:auto;">
                        </td>
                        <td style="width:80%;height:80px;background:;margin:0px;text-align:center;padding:0px;border-bottom:1px solid red;padding-right:20px;">
                            <p style="padding:0px;margin:0px;font-size:16px;font-weight:700;"><?php echo school_full_name; ?></p>
                            <p style="padding:0px;margin:0px;font-size:11px;font-weight:500;"><?php echo school_address;?></p>
                            <!--<p style="padding:0px;margin:0px;font-size:11px;font-weight:500;font-style:italic;">-->
                            <?php 
                            // echo school_affiliation;
                            ?>
                            <!--</p>-->
                            <p style="padding:0px;margin:0px;font-size:11px;font-weight:500;">Contact :<?php echo contact1;?>, <?php echo contact2;?></p>
                
                            <?php
                            $acedemic_session_table='academic_session_details';
                            $get_ac_sess_data=$this->InvoiceModel->get_item_data($fee['acedemic_session'],$acedemic_session_table);
                            if($get_ac_sess_data){
                                foreach($get_ac_sess_data as $ac_sess_data){
                            ?>
                            <p style="text-align:center;padding:0px;margin:0px;font-size:11px;font-weight:500;">Academic Year : <?php echo $ac_sess_data['year_long'];?></p>
                            <?php
                                }
                            }
                            ?>
                        </td>
                    </tr>
                </table>
                <table style="width:100%;margin:0px;padding-left:;padding:0px;">
                    <tr style="width:100% !important;padding:0px !important;">
                        <td style="height:;background:;margin:0px;text-align:left;padding:0px;padding-left:20px;">No. : <?php echo $fee_no;?></td>
                
                        <td style="width:;height:;background:;margin:0px;text-align:left;padding:0px;padding-right:20px;">Date : <?php echo date('d-m-Y',strtotime($fee['fee_date']));?></td>
                    </tr>
                    <tr>
                        <td style="margin:0px;padding:0px;padding-left:20px;" colspan="2">Name : <?php echo $info['student_name'];
                        if($info['gender'] == 'male'){
                            echo "<b> S/o : Mr. </b>".$info['father_name'];
                        }else if($info['gender'] == 'female'){
                            echo " <b>D/o : Mr. </b>".$info['father_name'];
                        }else{
                            echo "<b> Father's Name : Mr. </b>".$info['father_name'];
                        }
                        ?>
                
                        </td>
                    </tr>
                    
                    <tr>
                        <td style="width:;height:;background:;margin:0px;text-align:left;padding:0px;padding-left:20px;">Class : <?php echo $fee['student_class'];?></td>
                        <?php
                        $fee_months=$fee['months'];
                        $array = explode(",",$fee_months);
                        $first_word = $array[0];
                        $last_word  = $array[count($array)-1];
                        $count_months=count($array);
                        if($count_months >1){
                        ?>
                        <td style="padding-right:20px;">Months : <span style="text-transform:uppercase;"><?php  echo $first_word; echo '</span> to <span style="text-transform:uppercase;">'; echo $last_word;?></span>
                        </td>

                    <?php
                        }else{
                    ?>
                    <td>Fee Months : <span style="text-transform:uppercase;"><?php echo $fee_months;?></span></td>
                    <?php
                    }
                    ?>
                </tr>
            
            </table>
            <table style="width:100%;padding:0px;margin:0px;">
            
                <tr style="">
                    <th style="text-align:left;border-right:1px solid red;border-bottom:1px solid red;padding-left:20px;border-top:1px solid red;">Particulars</th>
                    <th style="text-align:left;border-bottom:1px solid red;padding-right:20px;border-top:1px solid red;">Total Rs.</th>
                </tr>
                <?php
                $apr_fee=$fee['april'];
                $may_fee=$fee['may'];
                $jun_fee=$fee['june'];
                $jul_fee=$fee['july'];
                $aug_fee=$fee['august'];
                $sep_fee=$fee['september'];
                $oct_fee=$fee['october'];
                $nov_fee=$fee['november'];
                $dec_fee=$fee['december'];
                $jan_fee=$fee['january'];
                $feb_fee=$fee['february'];
                $mar_fee=$fee['march'];
        
                $term_charge=0;
                $monthly_fee=0;
                $computer_fee=0;
                $lab_fee=0;
                $other_fee=0;
                $total_fee=0;
                $fee_head_table='fee_heads';
                $get_fee_heads=$this->InvoiceModel->get_table_data($fee_head_table);
                if($get_fee_heads){
                    foreach($get_fee_heads as $fee_head){
                
                        if($fee_head['status']==1){
                            $aplicable_months=0;
                            $fee_head_amount= 0;
                            $fee_head_amount_total=0;
                            $fee_head_id=$fee_head['id'];
                            $acedemic_session=$fee['acedemic_session'];
                
                            $course=$info['class'];
                            $course_id=$course_info['course_id'];
                            $get_fee_structure = $this->InvoiceModel->get_fee_structure($fee_head_id,$acedemic_session,$course_id);
                            if($get_fee_structure){
                                foreach($get_fee_structure as $structure){
                                    
                                    if($structure['april'] ==1){
                                        
                                        if($new_admission == "Yes"){
                                            $fee_head_amount = $fee_head_amount + $structure['amount'];
                                        }else{
                                            if($structure['fee_head'] == 2){
                                            
                                            }else{
                                                $fee_head_amount = $fee_head_amount + $structure['amount'];
                                            }
                                        }
                                    
                                        
                                    }else{
                                        $fee_head_amount = $fee_head_amount + $structure['amount'];
                                    }
                                    
                                    
                                    // $fee_head_amount = $fee_head_amount + $structure['amount'];
                    
                                    if($fee['april'] == 1 && $structure['april'] == 1){
                                        $aplicable_months= $aplicable_months + 1;
                                    }
                                    if($fee['may'] == 1 && $structure['may'] == 1){
                                        $aplicable_months= $aplicable_months + 1;
                                    }
                                    if($fee['june'] == 1 && $structure['june'] == 1){
                                        $aplicable_months= $aplicable_months + 1;
                                    }
                                if($jul_fee ==1 && $structure['july'] == 1){
                                    $aplicable_months= $aplicable_months + 1;
                                }
                                if($aug_fee ==1 && $structure['august'] == 1){
                                    $aplicable_months= $aplicable_months + 1;
                                }
                                if($sep_fee == 1 && $structure['september'] == 1){
                                    $aplicable_months= $aplicable_months + 1;
                                }
                                if($oct_fee == 1 && $structure['october'] == 1){
                                    $aplicable_months= $aplicable_months + 1;
                                }
                                if($nov_fee == 1 && $structure['november'] == 1){
                                    $aplicable_months= $aplicable_months + 1;
                                }
                                if($dec_fee == 1 && $structure['december'] == 1){
                                    $aplicable_months= $aplicable_months + 1;
                                }
                                if($jan_fee == 1 && $structure['january'] == 1){
                                    $aplicable_months=$aplicable_months + 1;
                                }
                                if($feb_fee == 1 && $structure['february'] == 1){
                                    $aplicable_months= $aplicable_months + 1;
                                }
                                if($mar_fee == 1 && $structure['march'] == 1){
                                    $aplicable_months= $aplicable_months + 1;
                                }
                    
                    
                            }
                        }
                    if($fee_head['fee_type']=='monthly'){
                        $fee_head_amount_total =$fee_head_amount * $aplicable_months;
                        $total_fee=$total_fee + $fee_head_amount_total;
                            echo '<tr style="">';
                                echo '<td style="border-right:1px solid red;padding-left:20px;">'.$fee_head['title'].'</td>';
                                echo '<td style="padding-right:20px;">Rs. '.($fee_head_amount_total).'</td>';        
                            echo '</tr>';
                    }                    
                    
                    // echo '<tr style="">';
                    // echo '<td style="border-right:1px solid red;padding-left:20px;">'.$fee_head['title'].'</td>';
                    // if($fee_head['fee_type']=='monthly'){
                    // $fee_head_amount_total =$fee_head_amount * $aplicable_months;
                    // $total_fee=$total_fee + $fee_head_amount_total;
                    // echo '<td style="padding-right:20px;">Rs. '.($fee_head_amount_total).'</td>';
                    // }else{
                    //     echo '<td>-</td>';
                    // }
                    // echo '</tr>';
                    
                    }
                }
            }
              
            echo '<tr>
            <td style="border-right:1px solid red;border-top:1px solid red;text-align:right;padding-left:20px;">Total </td>
            <td style="border-top:1px solid red;padding-right:20px;">'.$fee['estimate_amount'].'</td>
            </tr>';  
            if($fee['balance_amount_added'] !=0){
                echo '<tr>
                        <td colspan="" style="text-align:right;border-top:1px solid red;border-right:1px solid red;padding-left:20px;">Previous Balance &nbsp;</td>
                        <td style="border-bottom:1px solid red !important;border-top:1px solid red;padding-right:20px;">'.$fee['balance_amount_added'].'</td>
                    </tr>';
            }
            
            if($fee['extra_amount_used'] !=0){
                echo '<tr>
                        <td colspan="" style="text-align:right;border-top:1px solid red !important;border-right:1px solid red;">Previous Extra &nbsp;</td>
                        <td style="border-top:1px solid red !important;">'.$fee['extra_amount_used'].'</td>
                    </tr>';                
            }

            if($fee['discount'] !=0){
                echo '<tr>
                        <td style="text-align:right;border-right:1px solid red;border-top:1px solid red;">Discount &nbsp;</td>
                        <td style="border-top:1px solid red;">'.$fee['discount'].'</td>
                    </tr>';                
            }

        
        $total_fee = $fee['received_amount'];
        echo '<tr>
        <td colspan="" style="text-align:right;border-right:1px solid red;border-top:1px solid red !important;">Received Rs.</td>
        <td style="border-top:1px solid red !important;">'.$total_fee.'</td>
        </tr>';
            
            if($fee['balance_amount'] !=0){
                echo '<tr>
                        <td style="text-align:right;border-right:1px solid red;border-top:1px solid red !important;">Balance</td>
                        <td style="border-top:1px solid red !important;">'.$fee['balance_amount'].'</td>
                    </tr>';                
            }

        if($fee['extra_amount'] !=0){
        echo '<tr>
            <td style="text-align:right;border-right:1px solid red;border-top:1px solid red;">Extra</td>
            <td style="border-top:1px solid red;">'.$fee['extra_amount'].'</td>
        </tr>';
        }    
            ?>
            <tr>
            </tr>
        </table>
        <table style="margin:0px;width:100%;">
            <tr style="padding:0px;margin:0px;">
                <th style="padding:0px;margin:0px;">Fee Received By</th>
                <th style="padding:0px;margin:0px;"><?php echo $fee_staff_name; ?></th>
            </tr>
            <tr>
                <td colspan="2" style="border-top:1px solid red;padding-left:20px;margin:0px;"><b>Note:</b>Receipt should be reserved for the academic year.</td>
            </tr>
            <tr>
                <td colspan="2" style="border-top:1px dotted red; text-align:center;font-size:6px;">Printed by : <?php echo $user_salutation; echo " "; echo $user_name; echo " "; echo date('d-M-Y H:i:sa'); ?></td>
            </tr>
            <tr>
                <td colspan="2" style="padding:0px;margin:0px;text-align:center;">
                    <img src="<?php echo base_url(); ?>barcode/<?php echo $info['barcode']; ?>" style="height:50px;width:auto;">
                </td>
            </tr>
        </table>
        </div>
        <div class="w-2"></div>
        <div class="w-50-2">

            <table style="width:100%;margin:0px;padding:0px;">
                <tr style="width:100% !important;padding:0px !important;">
                    <td style="width:20%;background:;padding:0px;border-bottom:1px solid red;padding-left:20px;">
                        <img src="<?php echo school_logo_full;?>" style="margin:auto;width:85%;height:auto;">
                    </td>
                    <td style="width:80%;height:80px;background:;margin:0px;text-align:center;padding:0px;border-bottom:1px solid red;padding-right:20px;">
                        <p style="padding:0px;margin:0px;font-size:16px;font-weight:700;"><?php echo school_full_name;?></p>
                        <p style="padding:0px;margin:0px;font-size:11px;font-weight:500;"><?php echo school_address;?></p>
                        <!--<p style="padding:0px;margin:0px;font-size:11px;font-weight:450;font-style:italic;">-->
                        <?php 
                        // echo school_affiliation;
                        ?>
                        <!--</p>-->
                        <p style="padding:0px;margin:0px;font-size:11px;font-weight:500;">Contact :<?php echo contact1;?>, <?php echo contact2;?></p>
                
                    <?php
                    $acedemic_session_table='academic_session_details';
                    $get_ac_sess_data=$this->InvoiceModel->get_item_data($fee['acedemic_session'],$acedemic_session_table);
                    if($get_ac_sess_data){
                        foreach($get_ac_sess_data as $ac_sess_data){
                    ?>
                    <p style="text-align:center;padding:0px;margin:0px;font-size:11px;font-weight:500;">Academic Year : <?php echo $ac_sess_data['year_long'];?></p>
                    <?php
                        }
                    }
                    ?>
                    </td>
                </tr>
            </table>
            <table style="width:100%;margin:0px;padding:0px;">
            <tr style="width:100% !important;padding:0px !important;">
                <td style="height:;background:;margin:0px;text-align:left;padding:0px;padding-left:20px;">No. : <?php echo $fee_no;?></td>
                
                <td style="width:;height:;background:;margin:0px;text-align:left;padding:0px;padding-right:20px;">Date : <?php echo date('d-m-Y',strtotime($fee['fee_date']));?></td>
            </tr>
            <tr>
                <td style="margin:0px;padding:0px;padding-left:20px;" colspan="2">Name : <?php echo $info['student_name'];
                if($info['gender'] == 'male'){
                    echo "<b> S/o : Mr. </b>".$info['father_name'];
                }else if($info['gender'] == 'female'){
                    echo " <b>D/o : Mr. </b>".$info['father_name'];
                }else{
                    echo "<b> Father's Name : Mr. </b>".$info['father_name'];
                }
                ?>
                </td>
            </tr>
            
            <tr>
                <td style="width:;height:;background:;margin:0px;text-align:left;padding:0px;padding-left:20px;">Class : <?php echo $fee['student_class'];?></td>
                <?php
                
        $fee_months=$fee['months'];
        
        
        $array = explode(",",$fee_months);
        $first_word = $array[0];
        $last_word  = $array[count($array)-1];
        $count_months=count($array);
        if($count_months >1){
        ?>
        <td style="padding-right:20px;">Months : <span style="text-transform:uppercase;"><?php 
        echo $first_word; echo '</span> to <span style="text-transform:uppercase;">'; echo $last_word;?></span>
        </td>

        <?php
        }else{
            ?>
            <td>Fee Months : <span style="text-transform:uppercase;"><?php echo $fee_months;?></span></td>
            <?php
        }
        
        ?>
        </tr>
            
        </table>
        <table style="width:100%;padding:0px;margin:0px;">
            
            <tr>
                <th style="text-align:left;border-right:1px solid red;border-bottom:1px solid red;padding-left:20px;border-top:1px solid red;">Particulars</th>
                <th style="text-align:left;border-bottom:1px solid red;padding-right:20px;border-top:1px solid red;">Total Rs.</th>
            </tr>
            <?php
            $apr_fee=$fee['april'];
            $may_fee=$fee['may'];
            $jun_fee=$fee['june'];
            $jul_fee=$fee['july'];
            $aug_fee=$fee['august'];
            $sep_fee=$fee['september'];
            $oct_fee=$fee['october'];
            $nov_fee=$fee['november'];
            $dec_fee=$fee['december'];
            $jan_fee=$fee['january'];
            $feb_fee=$fee['february'];
            $mar_fee=$fee['march'];
        
            $term_charge=0;
            $monthly_fee=0;
            $computer_fee=0;
            $lab_fee=0;
            $other_fee=0;
            $total_fee=0;
            $fee_head_table='fee_heads';
            $get_fee_heads=$this->InvoiceModel->get_table_data($fee_head_table);
            if($get_fee_heads){
                foreach($get_fee_heads as $fee_head){
                
                    if($fee_head['status']==1){
                        $aplicable_months=0;
                        $fee_head_amount= 0;
                        $fee_head_amount_total=0;
                        $fee_head_id=$fee_head['id'];
                        $acedemic_session=$fee['acedemic_session'];
                
                        $course=$info['class'];
                        $get_fee_structure = $this->InvoiceModel->get_fee_structure($fee_head_id,$acedemic_session,$course_id);
                        if($get_fee_structure){
                            foreach($get_fee_structure as $structure){
                                if($structure['april'] ==1){
                                        
                                    if($new_admission == "Yes"){
                                        $fee_head_amount = $fee_head_amount + $structure['amount'];
                                    }else{
                                        if($structure['fee_head'] == 2){
                                        }else{
                                            $fee_head_amount = $fee_head_amount + $structure['amount'];
                                        }
                                    }
                                }else{
                                    $fee_head_amount = $fee_head_amount + $structure['amount'];
                                }
                                    
                                // $fee_head_amount = $fee_head_amount + $structure['amount'];
                    
                                if($fee['april'] == 1 && $structure['april'] == 1){
                                    $aplicable_months= $aplicable_months + 1;
                                }
                                if($fee['may'] == 1 && $structure['may'] == 1){
                                    $aplicable_months= $aplicable_months + 1;
                                }
                                if($fee['june'] == 1 && $structure['june'] == 1){
                                    $aplicable_months= $aplicable_months + 1;
                                }
                                if($jul_fee ==1 && $structure['july'] == 1){
                                    $aplicable_months= $aplicable_months + 1;
                                }
                                if($aug_fee ==1 && $structure['august'] == 1){
                                    $aplicable_months= $aplicable_months + 1;
                                }
                                if($sep_fee == 1 && $structure['september'] == 1){
                                    $aplicable_months= $aplicable_months + 1;
                                }
                                if($oct_fee == 1 && $structure['october'] == 1){
                                    $aplicable_months= $aplicable_months + 1;
                                }
                                if($nov_fee == 1 && $structure['november'] == 1){
                                    $aplicable_months= $aplicable_months + 1;
                                }
                                if($dec_fee == 1 && $structure['december'] == 1){
                                    $aplicable_months= $aplicable_months + 1;
                                }
                                if($jan_fee == 1 && $structure['january'] == 1){
                                    $aplicable_months=$aplicable_months + 1;
                                }
                                if($feb_fee == 1 && $structure['february'] == 1){
                                    $aplicable_months= $aplicable_months + 1;
                                }
                                if($mar_fee == 1 && $structure['march'] == 1){
                                    $aplicable_months= $aplicable_months + 1;
                                }
                    
                    
                            }
                        }
                        
                        if($fee_head['fee_type']=='monthly'){
                            $fee_head_amount_total =$fee_head_amount * $aplicable_months;
                            $total_fee=$total_fee + $fee_head_amount_total;
                            echo '<tr style="">';
                                echo '<td style="border-right:1px solid red;padding-left:20px;">'.$fee_head['title'].'</td>';
                                echo '<td style="padding-right:20px;">Rs. '.($fee_head_amount_total).'</td>';        
                            echo '</tr>';
                        }
                    // echo '<tr style="">';
                    // echo '<td style="border-right:1px solid red;padding-left:20px;">'.$fee_head['title'].'</td>';
                    // if($fee_head['fee_type']=='monthly'){
                    // $fee_head_amount_total =$fee_head_amount * $aplicable_months;
                    // $total_fee=$total_fee + $fee_head_amount_total;
                    // echo '<td style="padding-right:20px;">Rs. '.($fee_head_amount_total).'</td>';
                    // }
                    // else{
                    //     echo '<td>-</td>';
                    // }
                    
                    // echo '</tr>';
                    
                    }
                }
            }
              
            echo '<tr>
            <td style="border-right:1px solid red;border-top:1px solid red;text-align:right;padding-left:20px;">Total  </td>
            <td style="border-top:1px solid red;padding-right:20px;">'.$fee['estimate_amount'].'</td>
            </tr>';  
            if($fee['balance_amount_added'] !=0){
                echo '<tr>
                        <td colspan="" style="text-align:right;border-top:1px solid red;border-right:1px solid red;padding-left:20px;">Previous Balance &nbsp;</td>
                        <td style="border-bottom:1px solid red !important;border-top:1px solid red;padding-right:20px;">'.$fee['balance_amount_added'].'</td>
                    </tr>';
            }
            
            if($fee['extra_amount_used'] !=0){
                echo '<tr>
                        <td colspan="" style="text-align:right;border-top:1px solid red !important;border-right:1px solid red;">Previous Extra &nbsp;</td>
                        <td style="border-top:1px solid red !important;">'.$fee['extra_amount_used'].'</td>
                    </tr>';                
            }

            if($fee['discount'] !=0){
                echo '<tr>
                        <td style="text-align:right;border-right:1px solid red;border-top:1px solid red;">Discount &nbsp;</td>
                        <td style="border-top:1px solid red;">'.$fee['discount'].'</td>
                    </tr>';                
            }

        
        $total_fee = $fee['received_amount'];
        echo '<tr>
        <td colspan="" style="text-align:right;border-right:1px solid red;border-top:1px solid red !important;">Received Rs.</td>
        <td style="border-top:1px solid red !important;">'.$total_fee.'</td>
        </tr>';
        
            if($fee['balance_amount'] !=0){
                echo '<tr>
                        <td style="text-align:right;border-right:1px solid red;border-top:1px solid red !important;">Balance</td>
                        <td style="border-top:1px solid red !important;">'.$fee['balance_amount'].'</td>
                    </tr>';
            }
        ?>
        
        <?php

        if($fee['extra_amount'] ==0){}else{
        ?>
        <tr>
            <td style="text-align:right;border-right:1px solid red;border-top:1px solid red;">Extra</td>
            <td style="border-top:1px solid red;"><?php echo $fee["extra_amount"];?></td>
        </tr>
        <?php
                    }    
                    ?>
                    <!--<tr>-->
                    <!--</tr>-->
                </table>
        
        
                    <table style="margin:0px;width:100%;">
                        <tr style="padding:0px;margin:0px;">
                            <th style="padding:0px;margin:0px;">Received By :</th>
                            <th style="padding:0px;margin:0px;"><?php echo $fee_staff_name; ?></th>
                        </tr>
                        <tr>
                            <td style="border-top:1px solid red;padding-left:20px;margin:0px;" colspan="2"><b>Note:</b>Receipt should be reserved for the academic year.</td>
                        </tr>
                        <tr>
                            <td colspan="2" style="border-top:1px dotted red; text-align:center;font-size:6px;">Printed by : <?php echo $user_salutation; echo " "; echo $user_name; echo " "; echo date('d-M-Y H:i:sa'); ?></td>
                        </tr>
                        <tr>
                <td colspan="2" style="padding:0px;margin:0px;text-align:center;">
                    <img src="<?php echo base_url(); ?>barcode/<?php echo $info['barcode']; ?>" style="height:50px;width:auto;">
                </td>
            </tr>
                    </table>
                </div>            
        <?php
                }
            }
                }
            }
        }
    }
    ?>
    
    
    
            <!--<div class="w-50" style="border-right:1px dotted red;"></div>-->
            <!--<div class="w-50"></div>-->
        </div>
    </body>
</html>