<style>
    .table thead tr th{
        border-top:2px solid #eee;
        border-bottom:2px solid #eee;
        background: #fcfcfc;
    }
    .table tfoot tr th{
        border-top:2px solid #eee;
        border-bottom:2px solid #eee;
        background: #fcfcfc;
    }
</style>
<div class="wrapper">
    <div class="container">
        <div class="row m-t-20">
            <div class="col-sm-12 ">
                <div class="btn-group pull-right m-t-15">
                </div>
                <h4 class="page-title">Program Invoices</h4>
            </div>
        </div>

        
        
        <div class="row ">
            <div class="col-md-12">
                <div class="panel panel-default m-t-20">
                    <div class="panel-body">
                        <div class="row">
                            <div class="col-md-12 hidden-print m-t-20">
                                <form method="POST" action='<?php echo base_url(); ?>program_invoice_report'>
                                    <input type="hidden" name="csrf_test_name" id="daily_sheet_csrf" value=""/>
                                    
                                    <div class='col-md-4'>
                                        <label class='form-label'>Start</label>                                               
                                        <input id='startdate' class='datepicker form-control' name='startdate'>
                                    </div>
                                    
                                    <div class='col-md-4'>
                                        <label class='form-label'>End</label>
                                        <input id='enddate' class='datepicker form-control' name='enddate'>
                                    </div>
                                    
                                    <div class="col-md-4">
                                         
                                        <button type='submit' onclick="$('#daily_sheet_csrf').val($('#cook').val());" class="btn btn-pink btn-bordred waves-effect w-md waves-light m-t-20">Run</button>
                                    </div>
                                </form>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div> <!--row end-->
        <div class="clearfix"></div>


        <div class="row">

            <div class="col-md-12">
                <div class="panel panel-default m-t-20">
                    <div class="panel-body">

                        <table class="table m-t-10"  id='sheet1'>
                            <tr>
                                <td>
                                    <table class="table" id='tblInvoices'>
                                        <thead>
                                            <tr>
                                                <th>Invoice ID</th>
                                                <th>Invoice Date</th>
                                                <th>Customer ID</th>
                                                <th>Customer Name</th>
                                                <th>Enrolled On</th>
                                                <th>Program</th>
                                                <th>Session</th>
                                                <th>For the Month</th>
                                                <th>Payment Mode</th>
                                                <th>Cash</th>
                                                <th>Card</th>
                                                <th>Check</th>
                                                <th>Paid Total</th>
                                            </tr>
                                        </thead>
                                        <tbody>
                                            <?php
                                            if (isset($program_invoices) && !empty($program_invoices)) {                                                
                                                foreach ($program_invoices as $invoice) {?>
                                                <tr>
                                                    <td><?php echo $invoice['id_program_invoices'];?></td>
                                                    <td><?php echo $invoice['invoice_date'];?></td>
                                                    <td><?php echo $invoice['id_customers'];?></td>
                                                    <td><?php echo $invoice['customer_name'];?></td>
                                                    <td><?php echo $invoice['enrolled_on'];?></td>
                                                    <td><?php echo $invoice['program'];?></td>
                                                    <td><?php echo $invoice['session_name'];?></td>
                                                    <td><?php echo $invoice['for_the_month'];?></td>
                                                    <td><?php echo $invoice['payment_mode'];?></td>
                                                    <td><?php echo $invoice['paid_cash'];?></td>
                                                    <td><?php echo $invoice['paid_card'];?></td>
                                                    <td><?php echo $invoice['paid_check'];?></td>
                                                    <td><?php echo $invoice['paid_amount'];?></td>
                                                </tr>    
                                            <?php } } ?>
                                        </tbody>
                                        <tfoot>

                                        </tfoot>
                                    </table>
                                </td>
                                
                            </tr>

                        </table>
                    </div>
                </div>
            </div>      
        </div>
        <!-- end row -->
    </div>




    <script>


    $(document).ready(function(){

        $('.datepicker').datepicker({
            autoclose: true,
            todayHighlight: true,
            format: 'yyyy-mm-dd'            
        });

        $('#startdate').datepicker("setDate", new Date() );
        $('#enddate').datepicker("setDate", new Date() );

        $('#tblInvoices').DataTable({
                    lengthMenu: [[10, 25, 50, -1], [10, 25, 50, "All"]],
                    stateSave: true, fixedHeader: {header: true},
                    dom: "Bfrtlip",
                    buttons: [{extend: "copy", className: "btn-sm btn-custom btn-trans"},
                        {extend: "csv", className: "btn-sm btn-pink btn-trans"},
                        {extend: "pdf", className: "btn-sm btn-purple btn-trans"},                    
                        {extend: "print", className: "btn-sm btn-warning btn-trans"}
                ],
                    responsive: 0                    
                });
    
    });

  

  

    </script>