<div class="content-header">
   <div class="container-fluid">
      <div class="row mb-2">
         <div class="col-sm-6">
            <h1 class="m-0 text-dark">Organization Reports
            </h1>
         </div>
         <!-- /.col -->
         <div class="col-sm-6">
            <ol class="breadcrumb float-sm-right">
               <li class="breadcrumb-item"><a href="<?= base_url(); ?>organization">Organization</a></li>
               <li class="breadcrumb-item active">Organization Reports</li>
            </ol>
         </div>
         <!-- /.col -->
      </div>
      <!-- /.row -->
   </div>
   <!-- /.container-fluid -->
</div>
<!-- Main content -->
<section class="content">
   <div class="container-fluid">
      <form method="post" id="org_report" class="card basicvalidation" action="<?php echo base_url();?>organization/report_organization">
         <div class="card-body">
            <div class="row">
               <div class="col-md-3">
                  <div class="form-group row">
                     <label for="booking_from" class="col-sm-5 col-form-label">Report From</label>
                     <div class="col-sm-6 form-group">
                        <input type="text" required="true" class="form-control form-control-sm datepicker" value="<?php echo isset($_POST['booking_from']) ? $_POST['booking_from'] : ''; ?>" id="booking_from" name="booking_from" placeholder="Date From">
                     </div>
                  </div>
               </div>
               <div class="col-md-3">
                  <div class="form-group row">
                     <label for="booking_to" class="col-sm-5 col-form-label">Report To</label>
                     <div class="col-sm-6 form-group">
                        <input type="text" required="true" class="form-control form-control-sm datepicker" value="<?php echo isset($_POST['booking_to']) ? $_POST['booking_to'] : ''; ?>" id="booking_to" name="booking_to" placeholder="Date To">
                     </div>
                  </div>
               </div>
               <div class="col-md-4">
                  <div class="form-group row">
                     <label for="booking_to" class="col-sm-4 col-form-label">Organizations</label>
                     <div class="col-sm-8 form-group">
                        <select required="true" id="d_id"  class="form-control selectized"  name="d_id">
                           <option value="all">All Organizations</option>
                           <?php foreach ($organizationlist as $key => $organizationlist) { ?>
                           <option <?php echo (isset($_POST['d_id']) && ($_POST['d_id'] == $organizationlist['d_id'])) ? 'selected':'' ?> value="<?php echo output($organizationlist['org_id']) ?>"><?php echo output($organizationlist['org_name']) ?></option>
                           <?php  } ?>
                        </select>
                     </div>
                  </div>
               </div>
               <input type="hidden" id="org_report" name="org_report" value="1">
               <div class="col-md-2">
                  <button type="submit" class="btn btn-block btn-outline-info btn-sm"> Generate Report</button>
               </div>
            </div>
         </div>
   </div>
   </form>
    <div class="card">

        <div class="card-body p-0">
           <?php if(!empty($triplist)){ ?>
         <div class="table-responsive">
                    <table  class="datatableexport table card-table table-vcenter">
                      <thead>
                        <tr>
                          <th class="w-1">S.No</th>
                          <th>Total Drivers</th>
                          <th>Total Amount Earned</th>
                          <th>Total Trips</th>
                        </tr>
                      </thead>
                      <tbody>

                     <?php
                           $count=1;
                           foreach($triplist as $triplists){
                          
                           ?>
                        <tr>
                           <td> <?php echo output($count); $count++; ?></td> 
                          <td> <?php echo output($triplists['drivers']); ?></td>  
                              <td><?php echo ucfirst($triplists['total_amount'].'Rupees'); ?></td>
                              <td><?php echo ucfirst($triplists['ty']); ?></td>
                        
                    
                        </tr>
                        <?php } ?>
                      </tbody>
                    </table>
                   <?php } ?>
        </div>         
        </div>
        <!-- /.card-body -->
      </div>


   </div>
</section>
