<div class="page-content" >
    <br>
    <a href="<?php echo base_url('admin/expensesetup/expenseSearch');?>"><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($expense_list)){?>
            <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;">Expense On Office In
                                <?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>Payment Process</th>-->
                                    <th>
                                        Amount
                                    </th>

                                    <th >Date</th>
                                    <th>
                                        Payment Description
                                    </th>
<!--                                    <th>-->
<!--                                        Receiver Id & Name-->
<!--                                    </th>-->
                                    <th>Action</th>
                                </tr>
                                </thead>

                                <tbody>

                                <?php
                                    $i=0;
                                    foreach($expense_list as $value){?>
                                        <tr>
                                            <td style="color:red;"><?php echo ++$i.'  .';?>
                                                Id :&nbsp;&nbsp;<?php echo $value['employee_id'];?><br/>
                                                Name:&nbsp;&nbsp;
                                                <?php
                                                    $app_name=getlandCustomerNameById($value['employee_id']);
                                                    echo $app_name['applicant_name'];
                                                ?>
                                            </td>
                                            <td><span class="label label-warning"><?php  echo $value['expenseAmount'];?></span></td>
                                            <td><?php  echo $value['date'];?></td>
                                            <td><?php  echo $value['expenseDescription'];?></td>
                                            <td>
                                                <div class="hidden-sm hidden-xs action-buttons">

                                                    <?php if($adminLebel==1){?>
                                                        <a class="green" href="<?php echo admin_url()?>/landincomesetup/edit_landincome/<?php echo $value['expenseId'];?>">
                                                            <i class="ace-icon fa fa-pencil bigger-130"></i>
                                                        </a>

                                                        <a class="red" href="<?php echo admin_url()?>/landincomesetup/delete_landincome/<?php echo $value['expenseId'];?>" onclick="return ConfirmDelete()">
                                                            <i class="ace-icon fa fa-trash-o bigger-130"></i>
                                                        </a>
                                                    <?php }?>
                                                    <a class="red" href="<?php echo admin_url()?>/landincomesetup/invoice/<?php echo $value['expenseId'];?>">
                                                        <i class="ace-icon glyphicon glyphicon-print  bigger-130"></i>
                                                    </a>
                                                </div>
                                            </td>
                                        </tr>
                                <?php }
                                    if(!empty($salary_expense)){
                                           foreach ($salary_expense as $salary){ ?>
                                               <tr>
                                                   <td style="color:red;"><?php echo ++$i.'  .';?>
                                                       Id :&nbsp;&nbsp;<?php echo $salary['employee_id'];?><br/>
                                                       Name:&nbsp;&nbsp;
                                                       <?php
                                                            echo $salary['name'];
                                                       ?>
                                                   </td>
                                                   <td><span class="label label-warning"><?php  echo $salary['salaryAmount'];?></span></td>
                                                   <td><?php  echo $salary['date'];?></td>
                                                   <td><?php  echo 'For Salary';?></td>
                                                   <td>
                                                       <div class="hidden-sm hidden-xs action-buttons">

                                                           <?php if($adminLebel==1){?>
                                                               <a class="green" href="<?php echo admin_url()?>/landincomesetup/edit_landincome/<?php echo $salary['expenseId'];?>">
                                                                   <i class="ace-icon fa fa-pencil bigger-130"></i>
                                                               </a>

                                                               <a class="red" href="<?php echo admin_url()?>/landincomesetup/delete_landincome/<?php echo $salary['expenseId'];?>" onclick="return ConfirmDelete()">
                                                                   <i class="ace-icon fa fa-trash-o bigger-130"></i>
                                                               </a>
                                                           <?php }?>
                                                           <a class="red" href="<?php echo admin_url()?>/landincomesetup/invoice/<?php echo $salary['expenseId'];?>">
                                                               <i class="ace-icon glyphicon glyphicon-print  bigger-130"></i>
                                                           </a>
                                                       </div>
                                                   </td>
                                               </tr>
                                    <?php } } ?>
                                </tbody>
                            </table>
                        </div>
                    </div>
                </div>
                <div class="row">
                    <table class="table table-bordered">
                        <tbody>
                        <tr class="danger">
                            <td width=50%>
                            </td>
                            <td width=50%>
                                Total Expense :
                                    <?php
                                        if(isset($get_amount[0]['expenseAmount'])){
                                            echo $get_amount[0]['expenseAmount'].' Taka';
                                        }
                                        if(isset($get_amount['expenseAmount'])){
                                            echo $get_amount['expenseAmount'];
                                        }?>
                            </td>
                        </tr>
                        </tbody>
                    </table>
                </div>
            </div><!-- PAGE CONTENT ENDS -->
        <?php }else{echo '<span id="not-found-error">No Data is Found</span>';}?>
    </div><!-- /.col -->
<!--===================================-->




<!--===================================-->
</div><!-- /.row -->
