

<?php $__env->startSection('title', 'Prescription Items Management'); ?>

<?php $__env->startSection('content'); ?>
<div class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8">
    <div class="mb-6 flex flex-col sm:flex-row justify-between items-start sm:items-center gap-4">
        <h1 class="text-3xl font-bold text-gray-800">Prescription Items Management</h1>
        <div class="flex gap-2">
            <a href="<?php echo e(route('admin.dashboard')); ?>" class="bg-gray-600 hover:bg-gray-700 text-white px-4 py-2 rounded">
                <i class="fas fa-arrow-left mr-2"></i>Back to Dashboard
            </a>
            <a href="<?php echo e(route('admin.prescription-items.create', ['type' => $type])); ?>" class="bg-blue-600 hover:bg-blue-700 text-white px-4 py-2 rounded">
                <i class="fas fa-plus mr-2"></i>Add New Item
            </a>
        </div>
    </div>

    <!-- Type Filter Tabs -->
    <div class="mb-6 bg-white rounded-lg shadow p-4">
        <div class="flex gap-2 border-b">
            <a href="<?php echo e(route('admin.prescription-items.index', ['type' => 'quantity'])); ?>" 
               class="px-4 py-2 <?php echo e($type === 'quantity' ? 'border-b-2 border-blue-600 text-blue-600 font-semibold' : 'text-gray-600'); ?>">
                Quantity
            </a>
            <a href="<?php echo e(route('admin.prescription-items.index', ['type' => 'frequency'])); ?>" 
               class="px-4 py-2 <?php echo e($type === 'frequency' ? 'border-b-2 border-blue-600 text-blue-600 font-semibold' : 'text-gray-600'); ?>">
                Frequency
            </a>
            <a href="<?php echo e(route('admin.prescription-items.index', ['type' => 'instruction'])); ?>" 
               class="px-4 py-2 <?php echo e($type === 'instruction' ? 'border-b-2 border-blue-600 text-blue-600 font-semibold' : 'text-gray-600'); ?>">
                Instruction
            </a>
            <a href="<?php echo e(route('admin.prescription-items.index', ['type' => 'duration'])); ?>" 
               class="px-4 py-2 <?php echo e($type === 'duration' ? 'border-b-2 border-blue-600 text-blue-600 font-semibold' : 'text-gray-600'); ?>">
                Duration
            </a>
        </div>
    </div>

    <?php if(session('success')): ?>
        <div class="bg-green-100 border border-green-400 text-green-700 px-4 py-3 rounded mb-4">
            <?php echo e(session('success')); ?>

        </div>
    <?php endif; ?>

    <div class="bg-white rounded-lg shadow overflow-hidden">
        <table class="min-w-full divide-y divide-gray-200">
            <thead class="bg-gray-50">
                <tr>
                    <th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Name</th>
                    <th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Sort Order</th>
                    <th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Status</th>
                    <th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Actions</th>
                </tr>
            </thead>
            <tbody class="bg-white divide-y divide-gray-200">
                <?php $__empty_1 = true; $__currentLoopData = $items; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $item): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); $__empty_1 = false; ?>
                <tr>
                    <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-900"><?php echo e($item->name); ?></td>
                    <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500"><?php echo e($item->sort_order); ?></td>
                    <td class="px-6 py-4 whitespace-nowrap">
                        <span class="px-2 inline-flex text-xs leading-5 font-semibold rounded-full <?php echo e($item->is_active ? 'bg-green-100 text-green-800' : 'bg-red-100 text-red-800'); ?>">
                            <?php echo e($item->is_active ? 'Active' : 'Inactive'); ?>

                        </span>
                    </td>
                    <td class="px-6 py-4 whitespace-nowrap text-sm font-medium">
                        <a href="<?php echo e(route('admin.prescription-items.edit', $item->id)); ?>" class="text-blue-600 hover:text-blue-900 mr-3">Edit</a>
                        <form action="<?php echo e(route('admin.prescription-items.destroy', $item->id)); ?>" method="POST" class="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="text-red-600 hover:text-red-900">Delete</button>
                        </form>
                    </td>
                </tr>
                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); if ($__empty_1): ?>
                <tr>
                    <td colspan="4" class="px-6 py-4 text-center text-sm text-gray-500">
                        No items found. <a href="<?php echo e(route('admin.prescription-items.create', ['type' => $type])); ?>" class="text-blue-600 hover:underline">Create one now</a>.
                    </td>
                </tr>
                <?php endif; ?>
            </tbody>
        </table>
    </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:\Users\BrainTech\Documents\BEAUTEZ SYSTEM\resources\views/admin/prescription-items/index.blade.php ENDPATH**/ ?>