<?php $__env->startSection('content'); ?>
<?php $input['date_range'] = !empty($input['date_range']) ? $input['date_range'] : null; ?>

<div class="wrapper wrapper-content animated fadeInRight">
            <div class="row">
                <div class="col-lg-8">
                <div class="ibox float-e-margins">
                    <div class="ibox-title">
                        <h5>Sales</h5>
                        
                    </div>
                    <div class="ibox-content">

                        <table class="table">
                            <thead>
                           <tr>
                            <th>#</th>
                            <th>Cashier</th>
                            <th>Customer</th>
                            <th>Sales Date</th>
                            <th></th>
                        </tr>
                            </thead>
                            <tbody>
                    <?php if(!empty($sales)): ?>
                        <?php $__empty_1 = true; $__currentLoopData = $sales; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $key => $sale): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); $__empty_1 = false; ?>
                            <tr>
                                <td><?php echo e($key + 1); ?></td>
                                <td><?php echo e($sale->cashier['name']); ?></td>
                               <td><?php echo e($sale->customer['name']); ?></td>
                                <td><?php echo e($sale->created_at->format('d F Y')); ?></td>
                                <td>
                                    <a href="<?php echo e(url('reports/sales/' . $sale->id)); ?>" class="btn btn-primary btn-xs pull-right">Show</a>
                                </td>
                            </tr>
                        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); if ($__empty_1): ?>
                            <?php echo $__env->make('backend.partials.table-blank-slate', ['colspan' => 5], array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>
                        <?php endif; ?>
                    <?php endif; ?>
                    </tbody>
                        </table>

                    </div>
                </div>
            </div>
            
            <div class="col-md-4">
            <div class="panel panel-default">
                 <div class="ibox-title">
                        <h5>Date Range</h5>
                        
                    </div>
                 <div class="ibox-content">    
                    <form action="<?php echo e(url('reports/sales')); ?>" method="GET">
                        <div class="form-group">
                            <label for="price">Date Range</label>
                            <select class="form-control" id="date-range" name="date_range">
                                <option>-- Select Date Range --</option>
                                <option value="today" <?php echo e(($input['date_range'] == 'today') ? 'selected="selected"' : ''); ?>>Today</option>
                                <option value="current_week" <?php echo e(($input['date_range'] == 'current_week') ? 'selected="selected"' : ''); ?>>This Week</option>
                                <option value="current_month" <?php echo e(($input['date_range'] == 'current_month') ? 'selected="selected"' : ''); ?>>This Month</option>
                            </select>
                        </div>

                        

                        <div class="form-group">
                            <button type="submit" class="btn btn-primary">Search</button>
                        </div>
                    </form>
                </div>
            </div>
        </div>
        
    </div>
</div>

<?php $__env->stopSection(); ?>

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