<!-- Main content -->
<section class="content">
    <div class="row">
        <div class="col-sm-12">
            <div class="tabbable">
                <div class="tab-content no-border padding-24">
                    <div class="tab-pane fade in active" id="faq-tab-1">
                        <div class="space-8"></div>
                        <div class="panel-group accordion-style1 accordion-style2" id="faq-list-1">
                            <div class="panel panel-default">
                                <div class="panel-headingnew">Driver Ledger</div>
                                <div class="left_panel col-sm-12 padding_margin0 pull-left bg-white" id="add_detail">
                                    <ul class="nav nav-tabs nav-tabs1 tab_ul col-sm-2 paddig-right0 margin-top15px">
                                        <?php echo $this->partial('menu.phtml'); ?>
                                    </ul>
                                    <div class="tab-content tab_editprofile col-sm-10 padding-left0 marginbott10px margintop10px">
                                        <div id="home" class="tab-pane fade in tab_editprofile tab_editprofile1 active">
                                            <div class="change_password tab_editprofile">
                                                <div class="tab-content" id="myTabContent">
                                                    <div id="home" class="tab-pane fade active in">
                                                        <div class="col-sm-col-sm-offset-1 margin-10auto0 paddingRL10px">

                                                            <?php
                                                            $form = $this->form;
                                                            $form->prepare();
                                                            $form->setAttribute('action', $this->url('usermanagement', ['action' => 'driver-ledger']));
                                                            echo $this->form()->openTag($form);
                                                            echo $this->formHidden($form->get('user_id'));
                                                            ?>
                                                            <div class="row">
                                                                <div class="col-sm-12">
                                                                    <div class="form-group clearfix margintopbottom20">
                                                                        <label class="col-sm-3 control-label labelalign col-sm-3-new" id="Categorie Name"><?php echo $this->translate($this->formLabel($form->get('from_date'))); ?></label>
                                                                        <div class="col-sm-3 col-sm-4-new">
                                                                            <?php echo $this->FormElement($form->get('from_date')); ?>
                                                                        </div>
                                                                        <label class="col-sm-3 control-label labelalign col-sm-3-new" id="point_airport"><?php echo $this->translate($this->formLabel($form->get('to_date'))); ?></label>
                                                                        <div class="col-sm-3 col-sm-4-new">
                                                                            <?php echo $this->FormElement($form->get('to_date')); ?>
                                                                        </div>
                                                                    </div>
                                                                </div>

                                                                <div class="form-group clearfix margintopbottom20">
                                                                    <label class="col-sm-3 control-label labelalign col-sm-3-new" id="">  </label>
                                                                    <div class="col-sm-4 col-sm-4-new">

                                                                    </div>

                                                                    <label class="col-sm-3 control-label labelalign col-sm-3-new" id="update_profiel"></label>
                                                                    <div class="col-sm-3 col-sm-4-new " align="right">
                                                                        <?php echo $this->FormElement($form->get('search')); ?>
                                                                    </div>
                                                                </div>
                                                            </div>

                                                            <?php echo $this->form()->closeTag(); ?>

                                                            <div class="row">

                                                                <div class="col-sm-12">
                                                                    <div class="panel panel-default">
                                                                        <div class="panel-headingnew"> Driver Ledger</div>
                                                                        <div id="faq-1-3" class="panel-collapse collapse in" aria-expanded="false" >

                                                                            <div class="box">

                                                                                <!-- /.box-header -->
                                                                                <div class="box-body">
                                                                                    <table id="myTable" class="table table-bordered table-striped example3">
                                                                                        <thead>
                                                                                            <tr>
                                                                                                <th>S.No</th>
                                                                                                <th>Date</th>
                                                                                                <th>Booking Ref No.</th>
                                                                                                <th>Credit Amount</th>
                                                                                                <th>Debit Amount</th>
                                                                                                <th>Current Amount</th>
                                                                                            </tr>
                                                                                        </thead>
                                                                                        <tbody>

                                                                                        <?php
                                                                                            if ($driverLedger) {
                                                                                                $i = 1;
                                                                                                $balance_amt= 0;
                                                                                                foreach ($driverLedger as $listing) { 
                                                                                                    
                                                                                                    ?>
                                                                                            <tr>
                                                                                                <td><?php echo $i; ?></td>                                                                                                
                                                                                                <td><?php echo date('Y-m-d',strtotime($listing['created_date']));?></td>
                                                                                                <td><?php echo $listing['reference_number'];?></td>
                                                                                                <td><i class="fa fa-inr"></i> <?php echo $listing['credit_amount'];?></td>
                                                                                                <td><i class="fa fa-inr"></i> <?php echo $listing['debit_amount'];?></td>
                                                                                                
                                                                                                <td><i class="fa fa-inr"></i> <?php echo $listing['balance'];?></td>
                                                                                            </tr>
 <?php
                                                                                                    $i++;
                                                                                                }
                                                                                            } else {
                                                                                                ?>
                                                                                                <tr><th colspan="7" style="text-align: center;">No Record Found</th></tr>
                                                                                                    <?php } ?>


                                                                                        </tbody>
                                                                                        <tfoot>
                                                                                            <tr>
                                                                                               <th>S.No</th>
                                                                                                <th>Date</th>
                                                                                                <th>Booking Ref No.</th>
                                                                                                <th>Credit Amount</th>
                                                                                                <th>Debit Amount</th>
                                                                                                <th>Current Amount</th>
                                                                                            </tr>
                                                                                        </tfoot>
                                                                                    </table>
                                                                                    <div class="col-sm-12 no-padding">
                                                                                        <a href="#" class="btn btn-default marginright export_status_history" style="margin-left: 10px;"><i class="fa fa-download marginright"></i>Download CSV</a>

                                                                                    </div>
                                                                                </div>
                                                                                <!-- /.box-body -->
                                                                            </div>
                                                                        </div>
                                                                    </div>
                                                                </div>
                                                            </div>
                                                        </div>
                                                    </div>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                    <br>
                    <!-- /.widget-box -->
                </div>
                <!-- /.col -->
</section>