<?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($today); ?>" 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($pending); ?></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($colombo); ?></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($tot); ?></h3>
                <p>Today Total Sale</p>
              <?php elseif(Auth::user()->type == "Confirm Department"): ?>
                <h3><?php echo e($confirm); ?></h3>
                <p>Today Total Sale</p>
              <?php elseif(Auth::user()->type == "Printing Department"): ?>
                <h3><?php echo e($print); ?></h3>
                <p>Today Total Sale</p>
              <?php elseif(Auth::user()->type == "Packing Department"): ?>
                <h3><?php echo e($pack); ?></h3>
                <p>Today Total Sale</p>
              <?php elseif(Auth::user()->type == "Dispatched Department"): ?>
                <h3><?php echo e($dispa); ?></h3>
                <p>Today Total Sale</p>
              <?php elseif(Auth::user()->type == "Return Department"): ?>
                <h3><?php echo e($return); ?></h3>
                <p>Today Total Sale</p>
              <?php else: ?>
                <h3><?php echo e($dispatched); ?></h3>
                <p>Today Total Sale</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-secondary"><i class="fa fa-tasks" aria-hidden="true"></i></span>

              <div class="info-box-content">
                <span class="info-box-text">Dispatched Orders</span>
                <span class="info-box-number"><?php echo e($dispatched); ?></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-shopping-cart" aria-hidden="true"></i></span>

              <div class="info-box-content">
                <span class="info-box-text">Deliverd Orders</span>
                <span class="info-box-number"><?php echo e($delivered); ?></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="fa fa-spinner" aria-hidden="true"></i></span>

              <div class="info-box-content">
                <span class="info-box-text">Money Recived Orders</span>
                <span class="info-box-number"><?php echo e($moneyre); ?></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-tty" aria-hidden="true"></i></span>

              <div class="info-box-content">
                <span class="info-box-text">Paid Orders</span>
                <span class="info-box-number"><?php echo e($paid); ?></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 $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 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>
                    <?php $__currentLoopData = $resllerd; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $redata): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                      <?php if($redata->id == $dataordata->seller_id): ?>
                      <?php echo e($redata->companyname); ?>

                      <?php break; ?>;
                      <?php endif; ?>
                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                    </td>
                    <td><?php echo e($dataordata->pro_name); ?></td>
                    <td><?php echo e($dataordata->qty); ?></td>
                  </tr>
                  <?php if($key == 5): ?>
                  <?php break; ?>;
                  <?php endif; ?>
                  
                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                

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

          </div>
        </div>


    
      </div>
    </section>

  </div>

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

<?php echo $chart2->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>


