<!-- begin:: Subheader -->
<div class="kt-subheader   kt-grid__item" id="kt_subheader">
<div class="kt-container  kt-container--fluid ">
    <div class="kt-subheader__main">
        <div class="kt-subheader__breadcrumbs">
            <a class="kt-subheader__breadcrumbs-link">
                Reports </a>
            <span class="kt-subheader__breadcrumbs-separator"></span>
            <a  class="kt-subheader__breadcrumbs-link">
                All Activity List </a>
            <span class="kt-subheader__breadcrumbs-separator"></span>
            
        </div>
    </div>
    <div class="kt-subheader__toolbar">        
         
    </div>                                        
</div>
</div>
<!-- end:: Subheader -->
<!-- begin:: Content -->
<div class="kt-container  kt-container--fluid  kt-grid__item kt-grid__item--fluid">
   <div class="kt-portlet">
      <div class="kt-portlet__body kt-portlet__body--fit">
       <div class="kt-portlet__body">
       <form name="filter" method="get">          
            <div class="row justify-content-between">                
                <div class="col-sm-3" style="margin-bottom: 10px;">
                    <input type="text" name="cdate_from" class="form-control" placeholder="Assigned Date From" aria-controls="kt_table_1" id="datepicker" value="<?=(isset($_GET['cdate_from']) && $_GET['cdate_from']!='' ? $_GET['cdate_from']:'');?>"autocomplete="off" >
                </div>
                <div class="col-sm-3" style="margin-bottom: 10px;">
                    <input type="text" name="cdate_to" class="form-control" placeholder="Assigned Date To" aria-controls="kt_table_1" id="datepicker1" value="<?=(isset($_GET['cdate_to']) && $_GET['cdate_to']!='' ? $_GET['cdate_to']:'');?>" autocomplete="off">
                </div>
                <div class="col-sm-3" style="margin-bottom: 10px;">
                    <select name="page" aria-controls="kt_table_1" class="custom-select form-control form-control-sm">
                        <option value="">Show Entries</option>
                        <option value="30" <?=(isset($_GET['page']) && $_GET['page']=='30' ?'selected':'');?>>30</option>
                        <option value="60" <?=(isset($_GET['page']) && $_GET['page']=='60' ?'selected':'');?>>60</option>
                        <option value="90" <?=(isset($_GET['page']) && $_GET['page']=='90' ?'selected':'');?>>90</option>
                    </select>
                </div>
                <div class="col-sm-3" style="margin-bottom: 10px;">
                    <button type="submit" class="btn btn-info" style="width: 100%;">Apply</button>
                </div>
            </div>
        </form>
        <div class="row">
            <div class="col-sm-12 table-scrollable">
                 <!--begin: Datatable -->
                <table class="table table-striped- table-bordered table-hover table-checkable" id="kt_table_1">
                    <thead>
                        <tr>                      
                            <th> Created Date </th>
                            <th> Owner Name  </th>
                            <th> Total Leads </th>
                            <?php $dispos = get_disposition();
                             foreach($dispos as $dis){ ?>
                             <th><?=$dis['name']?></th> 
                            <?php }  ?>                                                                                  
                        </tr>
                    </thead>
                    <tbody>
                    <?php
                    if(empty($report_data) ===FALSE){
                    foreach ($report_data as $key=>$value){
                       
                          foreach($value as $report){
                    ?>
                            <tr>                        
                                <td><?=$key;?></td>
                                <td><?php 
                                if($report['user_id']=='1'){
                                    echo "Admin";
                                }else{
                                    $center_details    = get_center_by_id($report['user_id']); ?>
                                    <?=ucfirst($center_details[0]['user_name']);?>
                                <?php } ?>
                                </td>
                                <td><?=$report['total_lead'];?></td>                   
                                
                                <?php foreach($dispos as $dis){                     
                                if(isset($report['activity_type'][$dis['id']])){
                                    echo '<td>'.$report['activity_type'][$dis['id']].'</td>';
                                }else{
                                    echo '<td></td>';
                                } } ?>
                                </td>
                    
                            </tr>
                    <?php  }}}else{ ?>
                        <tr class="odd"><td valign="top" colspan="13" style="color: #595d6e;text-align: center;">No matching records found.</td></tr>
                        <?php } ?>                                            
                        </tbody>
                </table>
            </div>
        </div>
        <div class="row">
               <div class="col-sm-12 col-md-5">
                  <div class="dataTables_info" id="kt_table_1_info" role="status" aria-live="polite">
                    <?//=$showing_result;?>

                  </div>
               </div>
               <div class="col-sm-12 col-md-7">
                  <div class="dataTables_paginate paging_full_numbers" id="kt_table_1_paginate">
                     <?//=$paging;?>
                  </div>
               </div>
            </div>
            <!--end: Datatable -->
        </div>
      </div>
   </div>
</div>
