

<div class="page-content" >
    <br>
    <a href="<?php echo base_url('admin/extraincomesetup/dueInstallment');?>"><b>Back to Search</b></a>

    <div class="row">
        <?php
        $message = $this->session->userdata('message');
        if (!empty($message)) {
            ?>
            <div class="alert alert-block alert-success">
                <h6 class="lighter arial green"><b>
                        <?php echo $message;
                        $this->session->unset_userdata('message');
                        ?>
                    </b></h6>
            </div>
            <?php
        }
        $errormessage = $this->session->userdata('errormessage');
        if (!empty($errormessage)) {
            ?>
            <div class="alert alert-block alert-danger">
                <h6 class="lighter arial red"><b>
                        <?php echo $errormessage;
                        $this->session->unset_userdata('errormessage');
                        ?>
                    </b></h6>
            </div>
            <?php
        }
        ?>

        <?php if(!empty($dues_info)){?>
            <div class="col-xs-12">
                <div class="row">
                    <div class="col-xs-12">
                        <?php $adminLebel=$this->session->userdata('admin_level');?>

                        <div class="clearfix">
                            <div class="pull-right tableTools-container"></div>
                        </div>


                        <div class="table-header" style="height:60px;">
                            <h3 style="text-align:center;">Un-Paid Customer List
                                <br>On
                                <?php
                                    $month_list  = array('January','February','March','April','May','June','July','August','September','October','November','December');
                                    $month_array = explode("-",$given_date);
                                    $counter     = $month_array[1]-1;
                                    $month       = $month_list[$counter];
                                    echo $month_array[0].' '.$month;
                                ?>
                                <?php if(isset($year)){echo 'Year : '.$year;}?>
                                <?php if(isset($from_date) && isset($to_date)){echo '<br>From '.$from_date.' To '.$to_date;}?>
                            </h3>
                        </div>


                        <div>
                            <table id="dynamic-table" class="table table-striped table-bordered table-hover">
                                <thead>
                                <tr style="color:red;">
                                    <th style="color:red;">CustomerId & Name</th>
                                    <th>
                                        Total Cost
                                    </th>
                                    <th>
                                        Total Paid
                                    </th>
                                    <th>Contact Info</th>
                                </tr>
                                </thead>

                                <tbody>
                                <?php


                                    $i=0;
                                    foreach($dues_info as $value){
                                        $givens_date     = date("Y m", strtotime($given_date));
                                        $last_pay        = date("Y m", strtotime($value['Last_pay_date']));
                                        $last_pay        = explode(" ", $last_pay);
                                        $last_pay        = $last_pay[0].$last_pay[1];
                                        $givens_date     = explode(" ", $givens_date);
                                        $givens_date     = $givens_date[0].$givens_date[1];

//                                        echo $last_pay."<br>";
//                                        echo $given_date;
//                                        exit();
                                        if($value['total_cost'] > $value['Total_paid'] &&
                                             $givens_date > $last_pay
                                           ){
                                ?>
                                    <tr>
                                        <td style="color:red;"><?php echo ++$i.'  .';?>
                                            Id :&nbsp;&nbsp;<?php echo $value['customerId'];?><br/>
                                            Name:&nbsp;&nbsp;
                                            <a href="<?php echo base_url('admin/landcustomerRegistration/viewProfile').'/'.$value['id']?>">
                                                <?php
                                                    $app_name=getlandCustomerNameById($value['customerId']);
                                                    echo $app_name['applicant_name'];
                                                ?>
                                            </a>
                                        </td>
                                        <td><span class="label label-warning"><?php  echo $value['total_cost'];?></span></td>
                                        <td><span class="label label-success"><?php  echo $value['Total_paid'];?></span></td>
                                        <td>
                                            <?php echo $value['mobile'];?>
                                        </td>
                                    </tr>
                                <?php } } ?>
                                </tbody>
                            </table>
                        </div>
                    </div>
                </div>
            </div><!-- PAGE CONTENT ENDS -->
        <?php }else{echo '<span id="not-found-error">No Data is Found</span>';}?>
    </div><!-- /.col -->
</div><!-- /.row -->




