

<?php $__env->startSection('title', 'List Inventory Item'); ?>

<?php $__env->startSection('content'); ?>

        <div class="row">
            <div class="col-lg-12">
                <div class="d-flex flex-wrap flex-wrap align-items-center justify-content-between mb-4">
                    <div>
                        <h4 class="mb-3">Item List</h4>
                        <p class="mb-0">The items list effectively dictates Item presentation and provides space<br> to list your inventory items and offering in the most appealing way.</p>
                    </div>
<?php
    $isAdmin = auth()->user()->role &&
               strtolower(auth()->user()->role->role_name) === 'admin';
?>

<?php if($isAdmin): ?>
    <a href="<?php echo e(route('inventory.add')); ?>" class="btn btn-primary add-list">
        <i class="las la-plus mr-3"></i>Add Item
    </a>
<?php endif; ?>                </div>
            </div>
            <div class="col-lg-12">
                <div class="table-responsive rounded mb-3">
                <table class="data-tables table mb-0 tbl-server-info">
                    <thead class="bg-white text-uppercase">
                        <tr class="ligth ligth-data">
                            <th>
                                <div class="checkbox d-inline-block">
                                    <input type="checkbox" class="checkbox-input" id="checkbox1">
                                    <label for="checkbox1" class="mb-0"></label>
                                </div>
                            </th>
                            <th>Item name</th>
                            <th>ItemCode</th>
                            <th>Category</th>
                            <th>Purchase Price </th>
                            <th>Sale Price </th>
                            <th>Stock Quantity</th>
                            <th>Action</th>
                        </tr>
                    </thead>
<tbody class="ligth-body">

    <?php $__empty_1 = true; $__currentLoopData = $items; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $item): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); $__empty_1 = false; ?>

        <tr>

            <td>
                <div class="checkbox d-inline-block">
                    <input
                        type="checkbox"
                        class="checkbox-input"
                        id="checkbox<?php echo e($item->item_id); ?>"
                    >

                    <label
                        for="checkbox<?php echo e($item->item_id); ?>"
                        class="mb-0"
                    ></label>
                </div>
            </td>

            <td>
                <?php echo e($item->item_name); ?>

            </td>

            <td>
                <?php echo e($item->item_code); ?>

            </td>

            <td>
                <?php echo e($item->category->category_name ?? 'N/A'); ?>

            </td>

            <td>
                RS <?php echo e(number_format($item->item_purchase_price, 2)); ?>

            </td>

            <td>
                RS <?php echo e(number_format($item->item_saleprice, 2)); ?>

            </td>

            <td>
                <?php echo e($item->item_quantity); ?>

            </td>

<td>
    <div class="d-flex align-items-center list-action">

        
        <a
            class="badge badge-info mr-2"
            data-toggle="tooltip"
            data-placement="top"
            title="View"
            href="<?php echo e(route('inventory.show', $item->item_id)); ?>"
        >
            <i class="ri-eye-line mr-0"></i>
        </a>


        <?php if($isAdmin): ?>

            
            <a
                class="badge bg-success mr-2"
                data-toggle="tooltip"
                data-placement="top"
                title="Edit"
                href="<?php echo e(route('inventory.edit', $item->item_id)); ?>"
            >
                <i class="ri-pencil-line mr-0"></i>
            </a>


            
            <form
                action="<?php echo e(route('inventory.destroy', $item->item_id)); ?>"
                method="POST"
                style="display: inline;"
                onsubmit="return confirm('Are you sure you want to delete this item?');"
            >
                <?php echo csrf_field(); ?>
                <?php echo method_field('DELETE'); ?>

                <button
                    type="submit"
                    class="badge bg-warning mr-2 border-0"
                    data-toggle="tooltip"
                    data-placement="top"
                    title="Delete"
                >
                    <i class="ri-delete-bin-line mr-0"></i>
                </button>
            </form>

        <?php endif; ?>

    </div>
</td>
        </tr>

    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); if ($__empty_1): ?>

        <tr>
            <td colspan="8" class="text-center">
                No inventory items found.
            </td>
        </tr>

    <?php endif; ?>

</tbody>                </table>
                </div>
            </div>
        </div>
        <!-- Page end  -->
    </div>
    
    <div class="modal fade" id="edit-note" tabindex="-1" role="dialog" aria-hidden="true">
        <div class="modal-dialog modal-dialog-centered" role="document">
            <div class="modal-content">
                <div class="modal-body">
                    <div class="popup text-left">
                        <div class="media align-items-top justify-content-between">                            
                            <h3 class="mb-3">Item</h3>
                            <div class="btn-cancel p-0" data-dismiss="modal"><i class="las la-times"></i></div>
                        </div>
                        <div class="content edit-notes">
                            <div class="card card-transparent card-block card-stretch event-note mb-0">
                                <div class="card-body px-0 bukmark">
                                    <div class="d-flex align-items-center justify-content-between pb-2 mb-3 border-bottom">                                                    
                                        <div class="quill-tool">
                                        </div>
                                    </div>
                                    <div id="quill-toolbar1">
                                        <p>Virtual Digital Marketing Course every week on Monday, Wednesday and Saturday.Virtual Digital Marketing Course every week on Monday</p>
                                    </div>
                                </div>
                                <div class="card-footer border-0">
                                    <div class="d-flex flex-wrap align-items-ceter justify-content-end">
                                        <div class="btn btn-primary mr-3" data-dismiss="modal">Cancel</div>
                                        <div class="btn btn-outline-primary" data-dismiss="modal">Save</div>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
      </div>
        <!-- Page end  -->
    </div>
      </div>
   
<?php $__env->stopSection(); ?>
<?php echo $__env->make('layouts.app', array_diff_key(get_defined_vars(), ['__data' => 1, '__path' => 1]))->render(); ?><?php /**PATH C:\xampp\htdocs\zt-stationery\resources\views/inventory/list.blade.php ENDPATH**/ ?>