<?php
$acedemic_session=$this->session->userdata('acedemic_session');


?>
<div class="container-fluid bg-white mt-3 mb-3 ">
    <div class="row">
        <div class="col-sm-12 pt-3 pb-3">
            
            <ul class="breadcrumb">
                <li class="breadcrumb-item"><a href="<?php echo base_url();?>Welcome">Home</a></li>
                <li class="breadcrumb-item"><a href="#">Enquiry</a></li>
                <li class="breadcrumb-item">Invoices</li>
            </ul>
            <table class="table table-bordered">
                <tr>
                    <td><a href="<?php echo base_url();?>Enquiry/invoices">Enquiry and Admission Fee</a></td>
                    <td><a href="<?php echo base_url();?>Fee/invoices">Monthly Fee Invoices</a></td>
                </tr>
            </table>
            
            <div class="table-responsive">
                <table class="table table-bordered" id="mytable">
                    <thead>
                        <tr>
                            <th>Name </th>
                            <th>Father Name</th>
                            <th>Fee No.</th>
                            <th>Est Amount</th>
                            <th>Received Amount</th>
                            <th>Discount</th>
                            <!--<th>Fee Months</th>-->
                            <th>Fee Type</th>
                            <th>Date</th>
                            <th>Invoices</th>
                        </tr>
                    </thead>
                    <tbody>
                        <?php 
                        $fee_table='student_fee';
                        $get_all_fee_invoices=$this->NewFeeModel->get_data($fee_table);
                        if($get_all_fee_invoices){
                            foreach($get_all_fee_invoices as $fee_invoices){
                                if($fee_invoices['enquiry_id'] !=0){
                                    $enquiry_table='enquiry';
                                    $student_name='';
                                    $father_name='';
                                    $enquiry_id=$fee_invoices['enquiry_id'];
                                    
                                    $get_student_info=$this->WelcomeModel->get_item_data($enquiry_id,$enquiry_table);
                                ?>
                                <tr>
                                    
                                    <?php
                                    if($get_student_info){
                                        foreach($get_student_info as $info){
                                    ?>
                                    <td><?php echo $info['first_name']; echo " "; echo $info['last_name'] ?></td>
                                    <td><?php echo $info['father_name']; ?></td>
                                    <?php
                                        }
                                    }
                                    ?>
                                    
                                    <td><?php echo $fee_invoices['fee_no'];?></td>
                                    <td><?php echo $fee_invoices['estimate_amount'];?></td>
                                    <td><?php echo $fee_invoices['received_amount'];?></td>
                                    <td><?php echo $fee_invoices['discount'];?></td>
                                    <td><?php echo $fee_invoices['fee_type'];?></td>
                                    <td><?php echo date('d-m-Y',strtotime($fee_invoices['fee_date']));?></td>
                                    <td>
                                        <a href="<?php echo base_url();?>Enquiry/fee_receipt/<?php echo $fee_invoices['fee_no'];?>" class="btn btn-sm btn-info" style="color:#fff;">
                                            <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-printer-fill" viewBox="0 0 16 16">
                                                <path d="M5 1a2 2 0 0 0-2 2v1h10V3a2 2 0 0 0-2-2H5zm6 8H5a1 1 0 0 0-1 1v3a1 1 0 0 0 1 1h6a1 1 0 0 0 1-1v-3a1 1 0 0 0-1-1z"/>
                                                <path d="M0 7a2 2 0 0 1 2-2h12a2 2 0 0 1 2 2v3a2 2 0 0 1-2 2h-1v-2a2 2 0 0 0-2-2H5a2 2 0 0 0-2 2v2H2a2 2 0 0 1-2-2V7zm2.5 1a.5.5 0 1 0 0-1 .5.5 0 0 0 0 1z"/>
                                            </svg>
                                        </a>
                                    </td>
                                </tr>        
                                <?php
                                     
                                }
                            }
                        }
                        ?>
                        
                    </tbody>
                </table>
            </div>
        </div>
    </div>
</div>


