<?php echo $__env->make('admin/partial/header', array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>

        <!-- start page container -->
        <div class="page-container">
      <!-- start sidebar menu -->
      <?php echo $__env->make('admin/partial/nav', array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>
            <!-- end sidebar menu --> 
      <!-- start page content -->
            <div class="page-content-wrapper">
                <div class="page-content">
                    <div class="page-bar">
                        <div class="page-title-breadcrumb">
                            <div class=" pull-left">
                                <div class="page-title">Dashboard</div>
                            </div>
                            <?php echo $__env->make('admin/partial/sub2', array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>
                            <!-- <ol class="breadcrumb page-breadcrumb pull-right">
                                <li><i class="fa fa-home"></i>&nbsp;<a class="parent-item" href="#">Home</a>&nbsp;<i class="fa fa-angle-right"></i>
                                </li>
                                <li class="active">Dashboard</li>
                            </ol> -->
                        </div>
                    </div>
                                           <!-- start widget -->
                     <?php if(Session::get('adminController') == 1 || Session::get('adminController') == 2): ?>                      
                    <div class="state-overview">
                        <div class="row">
                            <div class="col-xl-3 col-md-6 col-12">
                              <div class="info-box bg-blue">
                                <span class="info-box-icon push-bottom"><i class="material-icons">group</i></span>
                                <div class="info-box-content">
                                  <span class="info-box-text">System Admins</span>
                                  <span class="info-box-number"><?php echo e($admins); ?></span>
                                </div>
                                <!-- /.info-box-content -->
                              </div>
                              <!-- /.info-box -->
                            </div>
                            <!-- /.col -->
                            <div class="col-xl-3 col-md-6 col-12">
                              <div class="info-box bg-orange">
                                <span class="info-box-icon push-bottom"><i class="material-icons">card_travel</i></span>
                                <div class="info-box-content">
                                  <span class="info-box-text">Agencies</span>
                                  <span class="info-box-number"><?php echo e($Agency); ?></span>
                                </div>
                                <!-- /.info-box-content -->
                              </div>
                              <!-- /.info-box -->
                            </div>
                            <!-- /.col -->
                            <div class="col-xl-3 col-md-6 col-12">
                              <div class="info-box bg-purple">
                                <span class="info-box-icon push-bottom"><i class="material-icons">phone_in_talk</i></span>
                                <div class="info-box-content">
                                  <span class="info-box-text">Staff</span>
                                  <span class="info-box-number"><?php echo e($Staff); ?></span>
                                </div>
                                <!-- /.info-box-content -->
                              </div>
                              <!-- /.info-box -->
                            </div>
                            <!-- /.col -->
                            <div class="col-xl-3 col-md-6 col-12">
                              <div class="info-box bg-success">
                                <span class="info-box-icon push-bottom"><i class="material-icons">time_to_leave</i></span>
                                <div class="info-box-content">
                                  <span class="info-box-text">Drivers</span>
                                  <span class="info-box-number"><?php echo e($Driver); ?></span>
                                </div>
                                <!-- /.info-box-content -->
                              </div>
                              <!-- /.info-box -->
                            </div>
                            <!-- /.col -->
                          </div>
                        </div>
                        <?php else: ?>
                           
                             <div class="state-overview">
                        <div class="row">
                            <div class="col-xl-3 col-md-6 col-12">
                              <div class="info-box bg-blue">
                                <span class="info-box-icon push-bottom"><i class="material-icons">group</i></span>
                                <div class="info-box-content">
                                  <span class="info-box-text">Timesheets</span>
                                  <span class="info-box-number"><?php echo e($timesheet_new); ?></span>
                                </div>
                                <!-- /.info-box-content -->
                              </div>
                              <!-- /.info-box -->
                            </div>
                            <!-- /.col -->
                            <div class="col-xl-3 col-md-6 col-12">
                              <div class="info-box bg-orange">
                                <span class="info-box-icon push-bottom"><i class="material-icons">card_travel</i></span>
                                <div class="info-box-content">
                                  <span class="info-box-text">Income E-Forms</span>
                                  <span class="info-box-number"><?php echo e($self_certified_new); ?></span>
                                </div>
                                <!-- /.info-box-content -->
                              </div>
                              <!-- /.info-box -->
                            </div>
                            <!-- /.col -->
                            <div class="col-xl-3 col-md-6 col-12">
                              <div class="info-box bg-purple">
                                <span class="info-box-icon push-bottom"><i class="material-icons">phone_in_talk</i></span>
                                <div class="info-box-content">
                                  <span class="info-box-text">Monthly Travel Expenses</span>
                                  <span class="info-box-number"><?php echo e($travel_form_new); ?></span>
                                </div>
                                <!-- /.info-box-content -->
                              </div>
                              <!-- /.info-box -->
                            </div>
                            <!-- /.col -->
                            <div class="col-xl-3 col-md-6 col-12">
                              <div class="info-box bg-success">
                                <span class="info-box-icon push-bottom"><i class="material-icons">time_to_leave</i></span>
                                <div class="info-box-content">
                                  <span class="info-box-text">Drivers</span>
                                  <span class="info-box-number"><?php echo e($drivers_new); ?></span>
                                </div>
                                <!-- /.info-box-content -->
                              </div>
                              <!-- /.info-box -->
                            </div>
                            <!-- /.col -->
                          </div>
                        </div>

                        <?php endif; ?>
                    <!-- end widget -->
                                  
                    <div class="row" style="margin-top: 63px;">
                        <div class="col-md-4 col-sm-12 col-12">
                            <div class="card  card-box">
                                <div class="card-head">
                                   <!--  <canvas id="myChart1" style="width:100%;max-width:700px"></canvas> -->
                                     <header>Income E-Forms</header>
                                    <div class="tools">
                                        <a class="fa fa-repeat btn-color box-refresh" href="javascript:;"></a>
                                        <a class="t-collapse btn-color fa fa-chevron-down" href="javascript:;"></a>
                                        <a class="t-close btn-color fa fa-times" href="javascript:;"></a>
                                    </div>
                                </div> 
                                <div class="card-body no-padding height-9">
                                    <div class="row">
                                        <div class="noti-information notification-menu">
                                            <div class="notification-list mail-list not-list small-slimscroll-style">
                                                <?php $__currentLoopData = $self_certified; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $value): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                                <?php 
                                                 
                                                 $driver = DB::table('drivers')->where('id',$value->driver_id)->first();
                                                 $agency = DB::table('agencies')->where('id',$value->agency)->first();
                                                 if($driver)
                                                 {
                                                    if($agency)
                                                    { ?>
                                                      
                                                      <a href="<?php echo e(url('editcertified')); ?>/<?php echo e($value->id); ?>" class="single-mail"> <span class="icon"> 
                                                       <?php if($driver->profile_image == 'avatar.png'): ?>
                                                        <img src="<?php echo e(url('public/images')); ?>/<?php echo e($driver->profile_image); ?>" width="30" height="30">
                                                       <?php else: ?>
                                                        <img src="<?php echo e($driver->profile_image); ?>" width="30" height="30">
                                                       <?php endif; ?> 
                                                </span> <span class="text-purple"><?php echo e($driver->first_name); ?> <?php echo e($driver->last_name); ?></span> submitted Self Income Certified E-Form to <?php echo e($agency->company_re_name); ?>

                                                    <span class="notificationtime">
                                                        <small><?php echo e($value->created_at); ?></small>
                                                    </span>
                                                </a>

                                                    <?php }
                                                 }

                                                ?>
                                                 
                                                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                            </div>
                                           
                                        </div>
                                    </div>
                                </div> 
                            </div>
                        </div>
                         <?php if(Session::get('adminController') == 1 || Session::get('adminController') == 2): ?>
                           
                        <div class="col-md-4 col-sm-12 col-12">
                            <div class="card  card-box">
                                <div class="card-head">
                                    <!-- <canvas id="myChart2" style="width:100%;max-width:600px"></canvas> -->
                                     <header>Timesheets</header>
                                    <div class="tools">
                                        <a class="fa fa-repeat btn-color box-refresh" href="javascript:;"></a>
                                        <a class="t-collapse btn-color fa fa-chevron-down" href="javascript:;"></a>
                                        <a class="t-close btn-color fa fa-times" href="javascript:;"></a>
                                    </div>
                                </div>
                                <div class="card-body no-padding height-9">
                                    <div class="row">
                                        <div class="noti-information notification-menu">
                                            <div class="notification-list mail-list not-list small-slimscroll-style">
                                                  <?php $__currentLoopData = $timesheet; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $value1): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                                <?php 
                                                  $driver = DB::table('drivers')->where('id',$value1->driver_id)->first();
                                                  $agency = DB::table('agencies')->where('id',$value1->agency)->first();
                                                 if($driver)
                                                 {
                                                    if($agency)
                                                    { ?>
                                                     
                                                      <a href="<?php echo e(url('edittimesheets')); ?>/<?php echo e($value1->id); ?>" class="single-mail"> <span class="icon">
                                                         <?php if($driver->profile_image == 'avatar.png'): ?>
                                                        <img src="<?php echo e(url('public/images')); ?>/<?php echo e($driver->profile_image); ?>" width="30" height="30">
                                                       <?php else: ?>
                                                        <img src="<?php echo e($driver->profile_image); ?>" width="30" height="30">
                                                       <?php endif; ?> 
                                                </span> <span class="text-purple"><?php echo e($driver->first_name); ?> <?php echo e($driver->last_name); ?></span> submitted timesheet to <?php echo e($agency->company_re_name); ?>

                                                    <span class="notificationtime">
                                                        <small><?php echo e($value1->created_at); ?></small>
                                                    </span>
                                                </a>

                                                    <?php }
                                                 }

                                                ?>
                                                 
                                                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </div> 
                        </div>

                         <?php else: ?>
                         
                          <div class="col-md-4 col-sm-12 col-12">
                            <div class="card  card-box">
                                <div class="card-head">
                                    <header>Timesheets</header>
                                    <div class="tools">
                                        <a class="fa fa-repeat btn-color box-refresh" href="javascript:;"></a>
                                        <a class="t-collapse btn-color fa fa-chevron-down" href="javascript:;"></a>
                                        <a class="t-close btn-color fa fa-times" href="javascript:;"></a>
                                    </div>
                                </div>
                                <div class="card-body no-padding height-9">
                                    <div class="row">
                                        <div class="noti-information notification-menu">
                                            <div class="notification-list mail-list not-list small-slimscroll-style">
                                                 <?php $__currentLoopData = $timesheet; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $value1): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                                <?php
                                                 
                                                if(Session::get('UserID') == $value1->agency)
                                                {
                                                     $driver = DB::table('drivers')->where('id',$value1->driver_id)->first();
                                                  $agency = DB::table('agencies')->where('id',$value1->agency)->first();
                                                    if($driver)
                                                    {
                                                    if($agency)
                                                    { ?>

                                                    <a href="<?php echo e(url('edittimesheets')); ?>/<?php echo e($value1->id); ?>" class="single-mail"> <span class="icon"> 
                                                      <?php if($driver->profile_image == 'avatar.png'): ?>
                                                        <img src="<?php echo e(url('public/images')); ?>/<?php echo e($driver->profile_image); ?>" width="30" height="30">
                                                       <?php else: ?>
                                                        <img src="<?php echo e($driver->profile_image); ?>" width="30" height="30">
                                                       <?php endif; ?> 
                                                    </span> <span class="text-purple"><?php echo e($driver->first_name); ?> <?php echo e($driver->last_name); ?></span> submitted timesheet to <?php echo e($agency->company_re_name); ?>

                                                    <span class="notificationtime">
                                                    <small><?php echo e($value1->created_at); ?></small>
                                                    </span>
                                                    </a>

                                                    <?php }
                                                      }
                                                }
                                                 ?>
                                                 
                                                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div> 

                         <?php endif; ?>

                        <div class="col-md-4 col-sm-12 col-12">
                            <div class="card  card-box">
                                <div class="card-head">
                                    <!-- <canvas id="myChart3" style="width:100%;max-width:600px"></canvas> -->
                                    <header>Travel Expenses</header>
                                    <div class="tools">
                                        <a class="fa fa-repeat btn-color box-refresh" href="javascript:;"></a>
                                        <a class="t-collapse btn-color fa fa-chevron-down" href="javascript:;"></a>
                                        <a class="t-close btn-color fa fa-times" href="javascript:;"></a>
                                    </div>
                                </div>
                                <div class="card-body no-padding height-9">
                                    <div class="row">
                                        <div class="noti-information notification-menu">
                                            <div class="notification-list mail-list not-list small-slimscroll-style">
                                              <?php $__currentLoopData = $travel_form; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $value2): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                                <?php 
                                                 
                                                 $driver = DB::table('drivers')->where('id',$value2->driver_id)->first();
                                                 $agency = DB::table('agencies')->where('id',$value2->agency_id)->first();
                                                 if($driver)
                                                 {
                                                    if($agency)
                                                    { ?>
                                                     
                                                      <a href="<?php echo e(url('editexpense')); ?>/<?php echo e($value2->id); ?>" class="single-mail"> <span class="icon"> 
                                                         <?php if($driver->profile_image == 'avatar.png'): ?>
                                                        <img src="<?php echo e(url('public/images')); ?>/<?php echo e($driver->profile_image); ?>" width="30" height="30">
                                                       <?php else: ?>
                                                        <img src="<?php echo e($driver->profile_image); ?>" width="30" height="30">
                                                       <?php endif; ?> 
                                                </span> <span class="text-purple"><?php echo e($driver->first_name); ?> <?php echo e($driver->last_name); ?></span> submitted Monthly Travel Expense to <?php echo e($agency->company_re_name); ?>

                                                    <span class="notificationtime">
                                                        <small><?php echo e($value2->created_at); ?></small>
                                                    </span>
                                                </a>

                                                    <?php }
                                                 }

                                                 ?>
                                                 
                                                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                            </div> 
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>

                    </div>
                  
                
               
                </div>
            </div>
            <!-- end page content -->
            <!-- start chat sidebar -->
           
            <!-- end chat sidebar -->
        </div>
        <!-- end page container -->



        <?php echo $__env->make('admin/partial/footer', array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>

        <!-- <script src="https://cdnjs.cloudflare.com/ajax/libs/Chart.js/2.9.4/Chart.js"></script>
        <script>
var xyValues = [
  {x:50, y:7},
  {x:60, y:8},
  {x:70, y:8},
  {x:80, y:9},
  {x:90, y:9},
  {x:100, y:9},
  {x:110, y:10},
  {x:120, y:11},
  {x:130, y:14},
  {x:140, y:14},
  {x:150, y:15}
];

new Chart("myChart1", {
  type: "scatter",
  data: {
    datasets: [{
      pointRadius: 4,
      pointBackgroundColor: "rgb(0,0,255)",
      data: xyValues
    }]
  },
  options: {
    legend: {display: false},
    scales: {
      xAxes: [{ticks: {min: 40, max:160}}],
      yAxes: [{ticks: {min: 6, max:16}}],
    }
  }
});
</script>
<script>
var xValues = ["Admin", "Staff", "Agencies", "Drivers", "Others"];
var yValues = [55, 49, 44, 24, 15];
var barColors = [
  "#b91d47",
  "#00aba9",
  "#2b5797",
  "#e8c3b9",
  "#1e7145"
];

new Chart("myChart2", {
  type: "pie",
  data: {
    labels: xValues,
    datasets: [{
      backgroundColor: barColors,
      data: yValues
    }]
  },
  options: {
    title: {
      display: true,
      text: "World Wide Wine Production 2018"
    }
  }
});
</script>
<script>
var xValues = ["Italy", "France", "Spain", "USA", "Argentina"];
var yValues = [55, 49, 44, 24, 15];
var barColors = ["red", "green","blue","orange","brown"];

new Chart("myChart3", {
  type: "bar",
  data: {
    labels: xValues,
    datasets: [{
      backgroundColor: barColors,
      data: yValues
    }]
  },
  options: {
    legend: {display: false},
    title: {
      display: true,
      text: "World Wine Production 2018"
    }
  }
});
</script> -->