<?php $__env->startSection('title', 'Branches'); ?>

<?php $__env->startSection('content'); ?>
<div class="row mt-4">
<div class="col-xl-8">
    <div class="page-header">
        <div>
            <h1 class="page-title">Branches</h1>
            <p class="page-subtitle">Manage salon locations and their basic details.</p>
        </div>
        <div class="page-actions">
            <a href="<?php echo e(route('branches.create')); ?>" class="btn btn-primary"><i class="fe fe-plus me-1"></i>Add Branch</a>
        </div>
    </div>

    <div class="card mb-4">
        <div class="card-body">
            <form method="get" action="<?php echo e(route('branches.index')); ?>" class="row g-3 align-items-end">
                <div class="col-12 col-md-6 col-lg-4">
                    <label class="form-label">Search</label>
                    <input type="text" name="search" value="<?php echo e(request('search')); ?>" placeholder="Name, code..." class="form-control">
                </div>
                <div class="col-12 col-md-6 col-lg-3">
                    <label class="form-label">Status</label>
                    <select name="status" class="form-control form-select">
                        <option value="">All</option>
                        <option value="active" <?php echo e(request('status') === 'active' ? 'selected' : ''); ?>>Active</option>
                        <option value="inactive" <?php echo e(request('status') === 'inactive' ? 'selected' : ''); ?>>Inactive</option>
                    </select>
                </div>
                <div class="col-12 col-lg-auto">
                    <button type="submit" class="btn btn-primary"><i class="fe fe-filter me-1"></i>Filter</button>
                </div>
            </form>
        </div>
    </div>

    <div class="card">
        <div class="card-body">
            <div class="table-responsive">
                <table class="table border text-nowrap text-md-nowrap table-hover mb-0">
                    <thead>
                        <tr>
                            <th>Code</th>
                            <th>Name</th>
                            <th>City</th>
                            <th>Status</th>
                            <th class="text-end">Actions</th>
                        </tr>
                    </thead>
                    <tbody>
                        <?php $__empty_1 = true; $__currentLoopData = $branches; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $branch): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); $__empty_1 = false; ?>
                        <tr>
                            <td><?php echo e($branch->code); ?></td>
                            <td><?php echo e($branch->name); ?></td>
                            <td><?php echo e($branch->city); ?></td>
                            <td>
                                <span class="badge <?php echo e($branch->status === 'active' ? 'badge-success' : 'badge-muted'); ?>">
                                    <?php echo e($branch->status); ?>

                                </span>
                            </td>
                            <td class="text-end table-actions">
                        <a href="<?php echo e(route('branches.show', $branch)); ?>" class="btn btn-icon btn-sm btn-light" title="View"><i class="fe fe-eye"></i></a>
                        <a href="<?php echo e(route('branches.edit', $branch)); ?>" class="btn btn-icon btn-sm btn-light" title="Edit"><i class="fe fe-edit"></i></a>
                        <form action="<?php echo e(route('branches.destroy', $branch)); ?>" method="POST" class="d-inline" onsubmit="return confirm('Delete this branch?');">
                            <?php echo csrf_field(); ?>
                            <?php echo method_field('DELETE'); ?>
                            <button type="submit" class="btn btn-icon btn-sm btn-light text-danger" title="Delete"><i class="fe fe-trash-2"></i></button>
                        </form>
                    </td>
                </tr>
                        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); if ($__empty_1): ?>
                        <tr>
                            <td colspan="5" class="text-center text-muted py-4">No branches found.</td>
                        </tr>
                        <?php endif; ?>
                    </tbody>
                </table>
            </div>
        </div>
    </div>

    <?php if($branches->hasPages()): ?>
    <div class="mt-4">
        <?php echo e($branches->withQueryString()->links()); ?>

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

<?php echo $__env->make('layouts.sash', array_diff_key(get_defined_vars(), ['__data' => 1, '__path' => 1]))->render(); ?><?php /**PATH D:\xampp\htdocs\salon\resources\views/branches/index.blade.php ENDPATH**/ ?>