<?php $__env->startSection('title', 'Make Sale Dashboard'); ?>


<?php $__env->startSection('internal-js'); ?>
    <script>
        $(document).ready(function () {
            $('#search-list').select2();

            $('#search-list').change(function (e){
                e.preventDefault();
                /**Start to Load**/
                $('#loading-div').show();
                let selectedItem = $(this).val() ?? "";

                $.ajax({
                    method: "GET",
                    url: '/search-inventory-item/'+selectedItem,
                    success: function (res){
                        if(res != ''){
                            $('#loading-div').hide();
                            $('#returned-results-div').show().html(res);
                        }else{
                            $('#returned-results-div').hide();
                        }
                    }
                });



            })
        });


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


<?php $__env->startSection('internal-css'); ?>
    <style>
        .dashboard{
            margin: 10px;

        }
        label{
            margin-left: 15px;
        }
    </style>
<?php $__env->stopSection(); ?>


<?php $__env->startSection('headers'); ?>
    <?php echo $__env->make('headers.dash-header', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>
<?php $__env->stopSection(); ?>


<?php $__env->startSection('heading', 'Data Entry Dashboard'); ?>
<?php $__env->startSection('done-by', ''); ?>


<?php $__env->startSection('content'); ?>
    <div class="guestDetails_inputDivider1"></div>
    <div class="guestDetails_buttons_left">
        <div class="guestDetails_buttons_left">
            <button onclick="makeSale()" class="navButtons" type="button" style="background-color: #2c79ab; margin-left: 0;margin-bottom: 0"><i class="fa fa-cart-plus" aria-hidden="true"></i> &nbsp;&nbsp;Make a Sale</button>
        </div>
    </div>
    <div class="guestDetails_inputDivider2"></div>
    <div class="dashboard">
        <div class="guestDetails_input">
            <div class="guestDetails_inputLabel"><span class="error">Search an Item to View Inventory Status.</span></div>
        </div>
        <div class="guestDetails_inputDividerNone"></div>

        <div class="guestDetails_input">
            <div class="guestDetails_inputLabel">
                Select an Item from the List of Available Stock<span class="error">*</span>
            </div>
            <div class="guestDetails_input">
                <select name="search" id="search-list" style="width: 500px">
                    <option value="">--Select Item--</option>
                    <?php $__currentLoopData = $list; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $row): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                        <option value="<?php echo $row->id; ?>"><?php echo $row->name; ?></option>
                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                </select>
            </div>
        </div>
        <div class="guestDetails_inputDivider"></div><br>
        <div id="search-results-div">
            <div id="loading-div" style="text-align: center; margin: 10px 0 10px 0;display: none" ><img src="<?php echo e(asset('images/loads/loader.gif')); ?>" border=0></div>
            <div class="search_results" id="returned-results-div" style="width: 100%;display: none"></div>
        </div>
    </div>
<?php $__env->stopSection(); ?>


<?php $__env->startSection('modal_heading'); ?>
    <h1>Make Sale Dashboard</h1>
<?php $__env->stopSection(); ?>
<?php $__env->startSection('modal_title'); ?>
    <h3><u>Dashboard Functionalities</u></h3>
    <b>
        <ol>
            <li>Search Item to See Inventory Details</li>
            <li>Make a Sale of Items</li>
        </ol>
    </b>
<?php $__env->stopSection(); ?>

<?php echo $__env->make('layouts.app', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH C:\xampp\htdocs\edwulp_chemist\resources\views/modules/dash.blade.php ENDPATH**/ ?>