
<?php $__env->startSection('title'); ?> Inactive Category | SKIN CARE <?php $__env->stopSection(); ?>
<?php $__env->startSection('inactive-medicine-category-list'); ?> active <?php $__env->stopSection(); ?>
<?php $__env->startSection('inactive-medicine-category-list'); ?> active <?php $__env->stopSection(); ?>
<?php $__env->startSection('styles'); ?>
<?php $__env->stopSection(); ?>


<?php $__env->startSection('main_content_section'); ?>
<div class="row py-3 ps-2">
    <div class="heading d-flex justify-content-start align-items-center">
        <h3 class="mb-0"><span> Inactive Category List</span></h3>
    </div>
</div>

<div class="table_wrapper py-1 card">
    <div class="row my-2 aggregate-section-div">
        <div class="px-3 ">
            <div class=" d-flex justify-content-between align-items-center aggregate-section border">
                <div class="d-flex align-items-center">
                    <p class="mb-0"><a href="<?php echo e(route('medicine-category.index')); ?>"
                            class="text-primary py-2 px-3">All(<?php echo e($allMedicineCategoryCount); ?>)</a>
                    </p>

                    <p class="mb-0"><a href="<?php echo e(route('active-medicine-category-list')); ?>"
                            class="text-primary py-2 px-3">Active(<?php echo e($activeMedicineCategoryCount); ?>)</a></p>
                    <p class="mb-0"><a href="<?php echo e(route('inactive-medicine-category-list')); ?>"
                            class="text-primary py-2 px-3 active">Inactive(<?php echo e($inactiveMedicineCategoryCount); ?>)</a></p>
                </div>
                <div class="d-sm-block">
                    <?php if(Auth::user()->can('medicine-category-create')): ?>
                    <a href="javascript:void(0)"
                        class="btn btn-success rounded-0 d-flex align-items-center px-2 border-0" data-bs-toggle="modal"
                        data-bs-target="#addMedicineCategory"><span class="">New Category</span></a>
                    <?php endif; ?>
                </div>
            </div>
        </div>
    </div>



    <div class="row px-3">
        <div class="table-container table-responsive">
            <table id="" class="table table-bordered">
                <thead class="text-uppercase">
                    <tr class="me-3">
                        <th class="text-center" scope="col"><span>Name</span></th>
                        <th class="text-center" scope="col"><span>Status</span></th>
                    </tr>
                </thead>
                <tbody class="text-center">

                    <?php $__currentLoopData = $medicineCategoryData; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $key=>$item): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                    <?php if(isset($item) && $item != null): ?>
                    <tr class="">

                        <td>
                            <div class="row_title">
                                <?php echo e($item->category_name); ?>

                            </div>
                            <div class="row-actions mt-2">

                                <?php if(Auth::user()->can('medicine-category-edit')): ?>
                                <span><button class="text-primary border-0 bg-transparent fw-bolder" value="<?php echo e($item->id); ?>"
                                        onclick="updateMedicineCategory(<?php echo e($item->id); ?>)"> Edit </button></span>
                                <?php endif; ?>

                                <?php if($item->status == true): ?>
                                <span> | <a class="text-warning fw-bolder"
                                        href="<?php echo e(route('medicine-category-inactive', $item->id)); ?>">Inactive</a></span>
                                <?php else: ?>
                                <span> | <a class="text-success fw-bolder"
                                        href="<?php echo e(route('medicine-category-active', $item->id)); ?>">Active</a>
                                </span>
                                <?php endif; ?>
                                <?php if(Auth::user()->can('medicine-category-delete')): ?>
                                
                                <?php endif; ?>
                            </div>
                        </td>

                        <td>
                            <?php if($item->status == true): ?>
                            <span class="badge bg-success">Active</span>
                            <?php else: ?>
                            <span class="badge bg-danger">Inactive</span>
                            <?php endif; ?>
                        </td>

                    </tr>

                    
                    <div class="modal fade" id="updateMedicineCategory<?php echo e($item->id); ?>" tabindex="-1"
                        aria-labelledby="oneInputModalLabel" aria-hidden="true" data-bs-backdrop='static'>
                        <div class="modal-dialog modal-dialog-centered max-width-900px">
                            <div class="modal-content">
                                <div class="modal-header">
                                    <h1 class="modal-title fs-5" id="oneInputModalLabel">Update Expense Category</h1>
                                    <button type="button" class="btn-close" data-bs-dismiss="modal"
                                        aria-label="Close"></button>
                                </div>
                                <form action="<?php echo e(route('medicine-category.update', $item->id)); ?>" method="post"
                                    enctype="multipart/form-data">
                                    <?php echo csrf_field(); ?>
                                    <?php echo method_field('put'); ?>
                                    <div class="modal-body p-0">
                                        <div class="row px-4 my-4">
                                            <div class="col-md-12 mb-3">
                                                <div class="form-group">
                                                    <label for="category_name">Category Name<span
                                                            class="text-danger">(required)</span>
                                                    </label>
                                                    <input type="text" name="category_name" required
                                                        class="form-control form-control-solid"
                                                        value="<?php echo e($item->category_name); ?>" placeholder="Name">
                                                </div>

                                                <?php $__errorArgs = ['category_name'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?>
                                                <span class=text-danger><?php echo e($message); ?></span>
                                                <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="modal-footer">
                                        <button type="submit" class="btn btn-success">Update</button>
                                        <button type="button" class="btn btn-danger"
                                            data-bs-dismiss="modal">Cancel</button>
                                    </div>
                                </form>
                            </div>
                        </div>
                    </div>

                    <?php endif; ?>
                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>


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

        <?php if(isset($inactiveMedicineCategoryCount) && $inactiveMedicineCategoryCount > 10): ?>
        <div class="clearfix d-flex">
            <div class="float-left">
                <p class="text-muted">
                    <?php echo e(__('Showing')); ?>

                    <span class="font-weight-bold"><?php echo e($medicineCategoryData->firstItem()); ?></span>
                    <?php echo e(__('to')); ?>

                    <span class="font-weight-bold"><?php echo e($medicineCategoryData->lastItem()); ?></span>
                    <?php echo e(__('of')); ?>

                    <span class="font-weight-bold"><?php echo e($medicineCategoryData->total()); ?></span>
                    <?php echo e(__('results')); ?>

                </p>
            </div>

            <div class="float-right custom-table-pagination">
                <?php echo $medicineCategoryData->links('pagination::bootstrap-4'); ?>

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



<div class="modal fade" id="addMedicineCategory" tabindex="-1" aria-labelledby="oneInputModalLabel" aria-hidden="true"
    data-bs-backdrop='static'>
    <div class="modal-dialog modal-dialog-centered max-width-900px">
        <div class="modal-content">
            <div class="modal-header">
                <h1 class="modal-title fs-5" id="oneInputModalLabel">New Expense Category</h1>
                <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
            </div>
            <div class="modal-header">
                <p class="fs-5 text-center mb-0" id="oneInputModalLabel">সার্ভিস ক্যাটাগরি একবার তৈরী হয়ে গেলে Delete
                    করা সম্ভব না
                    , প্রয়োজনে
                    edit বা inactive করতে পারবেন। তাই অপ্রয়োজনীয় সার্ভিস ক্যাটাগরি তৈরী থেকে বিরত
                    থাকুন।</p>
            </div>
            <form action="<?php echo e(route('medicine-category.store')); ?>" method="post" enctype="multipart/form-data">
                <?php echo csrf_field(); ?>
                <div class="modal-body p-0">
                    <div class="row px-4 my-4">
                        <div class="col-md-12 mb-3">
                            <div class="form-group">
                                <label for="category_name">Category Name<span class="text-danger">(required)</span>
                                </label>
                                <input type="text" name="category_name" required class="form-control form-control-solid"
                                    value="" placeholder="Name">
                            </div>

                            <?php $__errorArgs = ['category_name'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?>
                            <span class=text-danger><?php echo e($message); ?></span>
                            <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>
                        </div>

                    </div>
                </div>
                <div class="modal-footer">
                    <button type="submit" class="btn btn-success">Save</button>
                    <button type="button" class="btn btn-danger" data-bs-dismiss="modal">Cancel</button>
                </div>
            </form>
        </div>
    </div>
</div>

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

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

<script>
    //To show update modal...
    function updateMedicineCategory(id) {
        $("#updateMedicineCategory"+id).modal('show');
    }
</script>
<?php $__env->stopSection(); ?>
<?php echo $__env->make('admin.master', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH E:\Project\Personal-Project\Office-Project\update\skin-care\resources\views/admin/prescription/medicines/category/inActiveList.blade.php ENDPATH**/ ?>