<div class="row">
    <div class="col-md-12">
        <div class="row">

            <div class="col-xs-12 col-sm-8 col-md-6">

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

                <?php echo Form::open(['method'=>'post', 'action'=>'ManageReportsController@product_sales', 'onsubmit'=>'submit_button.disabled = true; submit_button.value = "' . __('Please Wait...') . '"; return true;']); ?>


                <div class="form-group">
                    <div class="product_box">
                        <label for="product[]"><?php echo app('translator')->getFromJson('Product:'); ?></label>
                        <select class="form-control" name="product" id="product">
                            <option value="">------------ <?php echo app('translator')->getFromJson('All Products'); ?> ------------</option>
                            <?php $__currentLoopData = $products; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $key=>$product): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                <option value="<?php echo e($key); ?>"><?php echo e($product); ?> <?php echo e('(' . __('ID:') . ' '.$key.')'); ?></option>
                            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                        </select>
                    </div>
                </div>

                <hr>
                <div class="form-group<?php echo e($errors->has('period') ? ' has-error' : ''); ?>">
                    <?php echo Form::label('period', __('Period:')); ?>

                    <?php echo Form::select('period', [
                    'Today'=>__('Today'),
                    'Yesterday'=>__('Yesterday'),
                    'Last 7 Days'=>__('Last 7 Days'),
                    'Last 15 Days'=>__('Last 15 Days'),
                    'Last Month'=>__('Last Month'),
                    'Last 6 Months'=>__('Last 6 Months'),
                    'Last Year'=>__('Last Year'),
                    'Current Month' =>__('Current Month'),
                    'Current Year'=>__('Current Year')
                    ], null, ['class'=>'form-control selectpicker', 'data-style'=>'btn-default']); ?>

                </div>

                <hr>
                <div class="form-group<?php echo e($errors->has('group') ? ' has-error' : ''); ?>">
                    <?php echo Form::label('group', __('Group:')); ?>

                    <?php echo Form::select('group', ['Year'=>__('Year'), 'Month'=>__('Month'), 'Day'=>__('Day')], null, ['class'=>'form-control selectpicker', 'data-style'=>'btn-default']); ?>

                </div>

                <div class="form-group">
                    <?php echo Form::submit(__('Get Sales Report'), ['class'=>'btn btn-primary btn-block', 'name'=>'submit_button']); ?>

                </div>

                <?php echo Form::close(); ?>

            </div>

            <div class="clearfix"></div>
            <?php if(isset($chartjs_sales)): ?>
            <div class="col-lg-10 col-md-12">
                <hr>
                <div class="col-md-12">
                    <div class="chartjs_product_sales">
                        <div class="panel-chart">
                            <div class="panel-heading"><pre><?php echo app('translator')->getFromJson('Sales for'); ?> <strong class="text-primary"><?php echo e($product_name); ?></strong> - <strong class="text-danger"><em><?php echo e($period); ?></em></strong></pre></div>
                            <div class="panel-body">
                                <?php echo $chartjs_sales->render(); ?>

                            </div>
                        </div>
                    </div>
                </div>
            </div>
            <?php endif; ?>

        </div>
    </div>
</div>
<script>
    document.getElementById("period").value = 'Today';
    document.getElementById("group").value = 'Year';
</script>