<?php echo $__env->make('dashboard.include.header', array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>

  <!-- Content Wrapper. Contains page content -->
  <div class="content-wrapper">
    <!-- Content Header (Page header) -->
    <div class="content-header">
      <div class="container-fluid">
        <div class="row mb-2">
          <div class="col-sm-6">
            <h1 class="m-0">Dashboard</h1>
          </div><!-- /.col -->
          <div class="col-sm-6">
            <ol class="breadcrumb float-sm-right">
              <li class="breadcrumb-item"><a href="/home">Home</a></li>
              <li class="breadcrumb-item active">Dashboard</li>
            </ol>
          </div><!-- /.col -->
        </div><!-- /.row -->
      </div><!-- /.container-fluid -->
    </div>
    <!-- /.content-header -->

    <!-- Main content -->
    <section class="content">
      <div class="container-fluid">
        <!-- Small boxes (Stat box) -->
        <?php $__currentLoopData = $notice; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $noticedata): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
        <div class="alert alert-warning alert-dismissible">
          <button type="button" class="close" data-dismiss="alert" aria-hidden="true">&times;</button>
          <h5><i class="icon fas fa-bullhorn"></i><?php echo e($noticedata->heading); ?></h5>
          <?php echo e($noticedata->body); ?>

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

        <form method="post" id="myform33" action="/dashboardfilter">
        <?php echo e(csrf_field()); ?>

        <div class="row">
        <div class="col-lg-3 col-6"></div>
        <div class="col-lg-3 col-6"></div>
        <div class="col-lg-3 col-6"></div>
        <div class="col-lg-3 col-12">
          <div class="form-group">
            <div class="input-group">
                <div class="input-group-prepend">
                <span class="input-group-text">
                    <i class="far fa-calendar-alt"></i>
                </span>
                </div>
                <input type="text" class="form-control float-right" id="reservation" value="<?php echo e($dateval); ?>" name="daterange">
            </div>
            </div>
        </div>
        </div>
      </form>

      
        <div class="row">
          <div class="col-lg-3 col-6">
            <!-- small box -->
            <div class="small-box bg-info">
              <div class="inner">
                <h3><?php echo e($panding); ?></h3>

                <p>Pending</p>
              </div>
              <div class="icon">
                <i class="ion ion-refresh"></i>
              </div>
              <a href="/home" class="small-box-footer">More info <i class="fas fa-arrow-circle-right"></i></a>
            </div>
          </div>
          <!-- ./col -->
          <div class="col-lg-3 col-6">
            <!-- small box -->
            <div class="small-box bg-success">
              <div class="inner">
              <h3><?php echo e($colo); ?></h3>

                <p>Colombo Confirmed</p>
              </div>
              <div class="icon">
                <i class="ion ion-settings"></i>
              </div>
              <a href="/home" class="small-box-footer">More info <i class="fas fa-arrow-circle-right"></i></a>
            </div>
          </div>
          <!-- ./col -->
          <div class="col-lg-3 col-6">
            <!-- small box -->
            <div class="small-box bg-warning">
              <div class="inner">
                <h3><?php echo e($out); ?></h3>

                <p>Out Confirmed</p>
              </div>
              <div class="icon">
                <i class="ion ion-arrow-graph-up-right"></i>
              </div>
              <a href="/home" class="small-box-footer">More info <i class="fas fa-arrow-circle-right"></i></a>
            </div>
          </div>

          <div class="col-lg-3 col-6">

            <div class="small-box bg-danger">
              <div class="inner">
              <?php if((Auth::user()->type=="super_admin")): ?>
                <h3><?php echo e($comtot); ?></h3>
                <p>Today Total Sale</p>
                <?php else: ?>
                <h3><?php echo e($confirmcount); ?></h3>
                <p><?php echo e(Auth::user()->name); ?> Confirm Count</p>
                <?php endif; ?>
                
              </div>
              <div class="icon">
                <i class="ion ion-checkmark-circled"></i>
              </div>
              <a href="/home" class="small-box-footer">More info <i class="fas fa-arrow-circle-right"></i></a>
            </div>
          </div>

        </div>
        <div class="row">
          <div class="col-md-3 col-sm-6 col-12">
            <div class="info-box">
              <span class="info-box-icon bg-primary"><i class="fa fa-tasks" aria-hidden="true"></i></span>

              <div class="info-box-content">
                <span class="info-box-text">All Pending</span>
                <span class="info-box-number"><?php echo e($panding); ?></span>
              </div>
            </div>
          </div>
          <div class="col-md-3 col-sm-6 col-12">
            <div class="info-box">
              <span class="info-box-icon bg-secondary"><i class="fa fa-shopping-cart" aria-hidden="true"></i></span>

              <div class="info-box-content">
                <span class="info-box-text">All 1st Attempt</span>
                <span class="info-box-number"><?php echo e($attemp1st); ?></span>
              </div>
            </div>
          </div>
          <div class="col-md-3 col-sm-6 col-12">
            <div class="info-box">
              <span class="info-box-icon bg-success"><i class="fa fa-spinner" aria-hidden="true"></i></span>

              <div class="info-box-content">
                <span class="info-box-text">Colombo Confirmed</span>
                <span class="info-box-number"><?php echo e($colocon); ?></span>
              </div>
            </div>
          </div>
          <div class="col-md-3 col-sm-6 col-12">
            <div class="info-box">
              <span class="info-box-icon bg-danger"><i class="fa fa-tty" aria-hidden="true"></i></span>

              <div class="info-box-content">
                <span class="info-box-text">Out Confirmed</span>
                <span class="info-box-number"><?php echo e($outconf); ?></span>
              </div>
            </div>
          </div>
        </div>
      
        <div class="row">
          <div class="col-md-3 col-sm-6 col-12">
            <div class="info-box">
              <span class="info-box-icon bg-warning"><i class="fa fa-share" aria-hidden="true"></i></span>

              <div class="info-box-content">
                <span class="info-box-text">Colombo Assigned</span>
                <span class="info-box-number"><?php echo e($colomboassig); ?></span>
              </div>
            </div>
          </div>
          <div class="col-md-3 col-sm-6 col-12">
            <div class="info-box">
              <span class="info-box-icon bg-info"><i class="fa fa-share-alt-square" aria-hidden="true"></i></span>

              <div class="info-box-content">
                <span class="info-box-text">Out Assigned</span>
                <span class="info-box-number"><?php echo e($outassign); ?></span>
              </div>
            </div>
          </div>
          <div class="col-md-3 col-sm-6 col-12">
            <div class="info-box">
              <span class="info-box-icon bg-dark"><i class="fa fa-ship" aria-hidden="true"></i></span>

              <div class="info-box-content">
                <span class="info-box-text">Colombo Dispatched</span>
                <span class="info-box-number"><?php echo e($colombodis); ?></span>
              </div>
            </div>
          </div>
          <div class="col-md-3 col-sm-6 col-12">
            <div class="info-box">
              <span class="info-box-icon bg-primary"><i class="fa fa-truck" aria-hidden="true"></i></span>

              <div class="info-box-content">
                <span class="info-box-text">Out Dispatched</span>
                <span class="info-box-number"><?php echo e($outdispa); ?></span>
              </div>
            </div>
          </div>
        </div>



    <div class="row">
          <div class="col-md-3 col-sm-6 col-12">
            <div class="info-box">
              <span class="info-box-icon bg-info"><i class="fab fa-opencart"></i></span>

              <div class="info-box-content">
                <span class="info-box-text">1st Attempt</span>
                <span class="info-box-number"><?php echo e($attemp1st); ?></span>
              </div>
            </div>
          </div>
          <div class="col-md-3 col-sm-6 col-12">
            <div class="info-box">
              <span class="info-box-icon bg-success"><i class="fab fa-digital-ocean"></i></span>

              <div class="info-box-content">
                <span class="info-box-text">2nd Attempt</span>
                <span class="info-box-number"><?php echo e($attemp2st); ?></span>
              </div>
            </div>
          </div>
          <div class="col-md-3 col-sm-6 col-12">
            <div class="info-box">
              <span class="info-box-icon bg-warning"><i class="fab fa-cloudscale"></i></span>

              <div class="info-box-content">
                <span class="info-box-text">3rd Attempt</span>
                <span class="info-box-number"><?php echo e($attemp3st); ?></span>
              </div>
            </div>
          </div>
          <div class="col-md-3 col-sm-6 col-12">
            <div class="info-box">
              <span class="info-box-icon bg-danger"><i class="fas fa-circle-notch"></i></span>

              <div class="info-box-content">
                <span class="info-box-text">Incomplete Orders</span>
                <span class="info-box-number"><?php echo e($incompl); ?></span>
              </div>
            </div>
          </div>
        </div>

        <div class="row">
          <div class="col-md-3 col-sm-6 col-12">
            <div class="info-box">
              <span class="info-box-icon bg-secondary"><i class="fas fa-dumpster"></i></span>

              <div class="info-box-content">
                <span class="info-box-text">Colombo Orders</span>
                <span class="info-box-number"><?php echo e($colo); ?></span>
              </div>
            </div>
          </div>
          <div class="col-md-3 col-sm-6 col-12">
            <div class="info-box">
              <span class="info-box-icon bg-primary"><i class="fas fa-shipping-fast"></i></span>

              <div class="info-box-content">
                <span class="info-box-text">Out Orders</span>
                <span class="info-box-number"><?php echo e($out); ?></span>
              </div>
            </div>
          </div>
          <div class="col-md-3 col-sm-6 col-12">
            <div class="info-box">
              <span class="info-box-icon bg-dark"><i class="fas fa-box-open"></i></span>

              <div class="info-box-content">
                <span class="info-box-text">Packing Orders</span>
                <span class="info-box-number"><?php echo e($packing); ?></span>
              </div>
            </div>
          </div>
          <div class="col-md-3 col-sm-6 col-12">
            <div class="info-box">
              <span class="info-box-icon bg-info"><i class="fab fa-docker"></i></span>

              <div class="info-box-content">
                <span class="info-box-text">Dispatched Orders</span>
                <span class="info-box-number"><?php echo e($dis); ?></span>
              </div>
            </div>
          </div>
        </div>

         <div class="row">
          <div class="col-md-3 col-sm-6 col-12">
            <div class="info-box">
              <span class="info-box-icon bg-warning"><i class="fas fa-university"></i></span>

              <div class="info-box-content">
                <span class="info-box-text">Payment Recive Orders</span>
                <span class="info-box-number"><?php echo e($money); ?></span>
              </div>
            </div>
          </div>
          <div class="col-md-3 col-sm-6 col-12">
            <div class="info-box">
              <span class="info-box-icon bg-danger"><i class="fas fa-warehouse"></i></span>

              <div class="info-box-content">
                <span class="info-box-text">Cancel Orders</span>
                <span class="info-box-number"><?php echo e($cans); ?></span>
              </div>
            </div>
          </div>
          <div class="col-md-3 col-sm-6 col-12">
            <div class="info-box">
              <span class="info-box-icon bg-secondary"><i class="fas fa-redo-alt"></i></span>

              <div class="info-box-content">
                <span class="info-box-text">Return Orders</span>
                <span class="info-box-number"><?php echo e($return); ?></span>
              </div>
            </div>
          </div>
          <div class="col-md-3 col-sm-6 col-12">
            <div class="info-box">
              <span class="info-box-icon bg-success"><i class="fas fa-dollar-sign"></i></span>

              <div class="info-box-content">
                <span class="info-box-text">Total Sale</span>
                <span class="info-box-number"><?php echo e($nettotal); ?></span>
              </div>
            </div>
          </div>
        </div>

           <div class="row">
          <div class="col-md-3 col-sm-6 col-12">
            <div class="info-box">
              <span class="info-box-icon bg-info"><i class="far fa-pause-circle"></i></span>

              <div class="info-box-content">
                <span class="info-box-text">Hold Orders</span>
                <span class="info-box-number"><?php echo e($hold); ?></span>
              </div>
            </div>
          </div>
          <div class="col-md-3 col-sm-6 col-12">
            <div class="info-box">
              <span class="info-box-icon bg-dark"><i class="fas fa-window-close"></i></span>

              <div class="info-box-content">
                <span class="info-box-text">Reject Orders</span>
                <span class="info-box-number"><?php echo e($reject); ?></span>
              </div>
            </div>
          </div>

        </div>

        <div class="row">
          <div class="col-md-12 col-sm-12 col-12">
          <?php echo $chart2->html(); ?>

          </div>

        </div>



        <div class="row">
        <div class="col-md-6 col-sm-12 col-12">
        <br>
        <?php echo $pie->html(); ?>


                <br><br>
        <?php echo $weekdaychart->html(); ?>

        </div>
          <div class="col-md-6 col-sm-12 col-12">
          <br>
          <div class="card card-secondary">
            <div class="card-header">
              <h6 class="card-title">Top Selling Products</h6>
            </div>
            <div class="card-body p-0">
              <table class="table">
                <thead>
                  <tr>
                    <th>Product Image</th>
                    <th>Product Name</th>
                    <th>Count</th>
                  </tr>
                </thead>
                <tbody>

                <?php $__currentLoopData = $dataor; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $key => $dataordata): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                  <tr>
                    <td><img style="height:30px;" src="<?php echo e(URL::asset("storage/{$dataordata->img}")); ?>" /></td>
                    <td><?php echo e($dataordata->name); ?></td>
                    <td><?php echo e($dataordata->qty); ?></td>
                  </tr>
                  <?php if($key == 13): ?>
                  <?php break; ?>;
                  <?php endif; ?>
                  
                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                

                </tbody>
              </table>
            </div>
          </div>
          </div>
        </div>


        <div class="row">
          <div class="col-md-6 col-sm-12 col-12">
          <?php echo $ordersource2->html(); ?>

          </div>
          <div class="col-md-6 col-sm-12 col-12">
          <?php echo $ordersource->html(); ?>

          </div>

        </div>








<br>


        <div class="row">
          <div class="col-md-4 col-sm-6 col-12">
          <div class="card card-info">
            <div class="card-header">
              <h6 class="card-title">Call Center Confirm Count</h6>
            </div>
            <div class="card-body p-0">
              <table class="table">
                <thead>
                  <tr>
                    <th>User Name</th>
                    <th>Count</th>
                  </tr>
                </thead>
                <tbody>
                <?php $__currentLoopData = $allconfirmcount; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $alldata): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                  <tr>
                    <td><?php echo e($alldata->username); ?></td>
                    <td><?php echo e($alldata->count); ?></td>
                  </tr>
                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>

                </tbody>
              </table>
            </div>
          </div>
          </div>
          <div class="col-md-4 col-sm-6 col-12">
          <div class="card card-warning">
            <div class="card-header">
              <h6 class="card-title">Call Center Attempt Count</h6>
            </div>
            <div class="card-body p-0">
              <table class="table">
                <thead>
                  <tr>
                    <th>User Name</th>
                    <th>Count</th>
                  </tr>
                </thead>
                <tbody>

                <?php $__currentLoopData = $all1; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $alldata): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                  <tr>
                    <td><?php echo e($alldata->username); ?></td>
                    <td><?php echo e($alldata->count); ?></td>
                  </tr>
                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
  

                </tbody>
              </table>
            </div>
          </div>

          </div>
          <div class="col-md-4 col-sm-6 col-12">
          <div class="card card-dark">
            <div class="card-header">
              <h6 class="card-title">Call Center Cancel Count</h6>
            </div>
            <div class="card-body p-0">
              <table class="table">
                <thead>
                  <tr>
                    <th>User Name</th>
                    <th>Count</th>
                  </tr>
                </thead>
                <tbody>

                <?php $__currentLoopData = $all2; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $alldata): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                  <tr>
                    <td><?php echo e($alldata->username); ?></td>
                    <td><?php echo e($alldata->count); ?></td>
                  </tr>
                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
  

                </tbody>
              </table>
            </div>
          </div>

          </div>
          <!-- <div class="col-md-3 col-sm-6 col-12">
          <div class="card card-secondary">
            <div class="card-header">
              <h6 class="card-title">Call Center Total Count</h6>
            </div>
            <div class="card-body p-0">
              <table class="table">
                <thead>
                  <tr>
                    <th>User Name</th>
                    <th>Count</th>
                  </tr>
                </thead>
                <tbody>

  

                </tbody>
              </table>
            </div>
          </div>

          </div> -->

        </div>




      






    
      </div>
    </section>

  </div>

  
  
<?php echo Charts::scripts(); ?>

<?php echo $pie->script(); ?>

<?php echo $chart2->script(); ?>

<?php echo $ordersource->script(); ?>

<?php echo $ordersource2->script(); ?>

<?php echo $weekdaychart->script(); ?>



  <?php echo $__env->make('dashboard.include.footer', array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>

  <script>
    $('#reservation').daterangepicker({
        locale: {
            format: 'YYYY/MM/DD'
        }
    });

    document.getElementById('reservation').onchange = function(){ 
    $("#myform33").submit();
}

  </script>


