
<?php $__env->startSection('title', 'Cities'); ?>
<?php $__env->startSection('breadcrumb'); ?>
    <span class="current">Cities</span>
<?php $__env->stopSection(); ?>
<?php $__env->startSection('content'); ?>
<div class="page-header" style="display:flex;align-items:center;justify-content:space-between;">
    <div>
        <h1 class="page-title">
            <span class="title-icon"><i data-lucide="building-2" style="width:20px;height:20px;"></i></span>
            Cities
        </h1>
        <p class="page-subtitle">Manage cities and their planning authorities / DCR versions</p>
    </div>
    <a href="<?php echo e(route('admin.cities.create')); ?>" class="btn btn-primary">
        <i data-lucide="plus" style="width:14px;height:14px;"></i> Add City
    </a>
</div>

<?php if(session('success')): ?>
    <div class="alert alert-success"><i data-lucide="check-circle" class="alert-icon" style="width:15px;height:15px;"></i><?php echo e(session('success')); ?></div>
<?php endif; ?>

<div class="admin-table-wrap">
    <div class="admin-table-header">
        <div class="admin-table-title"><i data-lucide="building-2" class="icon" style="width:14px;height:14px;"></i> All Cities</div>
        <form method="GET" style="display:flex;gap:8px;">
            <select name="state_id" class="form-control" style="width:160px;">
                <option value="">All States</option>
                <?php $__currentLoopData = $states; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $state): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                    <option value="<?php echo e($state->id); ?>" <?php echo e(request('state_id') == $state->id ? 'selected' : ''); ?>><?php echo e($state->name); ?></option>
                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
            </select>
            <button type="submit" class="btn btn-secondary btn-sm"><i data-lucide="filter" style="width:12px;height:12px;"></i></button>
        </form>
    </div>
    <div class="table-responsive">
        <table class="admin-table">
            <thead>
                <tr>
                    <th>City</th>
                    <th>State</th>
                    <th>Planning Authority</th>
                    <th>DCR Version</th>
                    <th>Master Plan</th>
                    <th>Status</th>
                    <th style="text-align:right;">Actions</th>
                </tr>
            </thead>
            <tbody>
                <?php $__empty_1 = true; $__currentLoopData = $cities; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $city): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); $__empty_1 = false; ?>
                <tr>
                    <td style="font-weight:500;color:var(--vsc-text-active);"><?php echo e($city->name); ?>

                        <?php if($city->code): ?> <span style="color:var(--vsc-text-secondary);font-size:11px;">(<?php echo e($city->code); ?>)</span> <?php endif; ?>
                    </td>
                    <td><span class="badge badge-teal"><?php echo e($city->state?->code ?? '—'); ?></span></td>
                    <td style="font-size:12px;color:var(--vsc-text-secondary);"><?php echo e($city->planning_authority ?? '—'); ?></td>
                    <td style="font-size:12px;color:var(--vsc-blue);"><?php echo e($city->dcr_version ?? '—'); ?></td>
                    <td style="font-size:12px;color:var(--vsc-text-secondary);"><?php echo e($city->master_plan_year ?? '—'); ?></td>
                    <td><span class="badge <?php echo e($city->is_active ? 'badge-green' : 'badge-gray'); ?>"><?php echo e($city->is_active ? 'Active' : 'Inactive'); ?></span></td>
                    <td>
                        <div style="display:flex;justify-content:flex-end;gap:4px;">
                            <a href="<?php echo e(route('admin.cities.edit', $city)); ?>" class="btn btn-icon btn-secondary" data-tooltip="Edit">
                                <i data-lucide="edit-2" style="width:13px;height:13px;"></i>
                            </a>
                            <form method="POST" action="<?php echo e(route('admin.cities.destroy', $city)); ?>" onsubmit="return confirm('Delete this city?')">
                                <?php echo csrf_field(); ?> <?php echo method_field('DELETE'); ?>
                                <button type="submit" class="btn btn-icon btn-danger" data-tooltip="Delete">
                                    <i data-lucide="trash-2" style="width:13px;height:13px;"></i>
                                </button>
                            </form>
                        </div>
                    </td>
                </tr>
                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); if ($__empty_1): ?>
                <tr><td colspan="7" style="text-align:center;color:var(--vsc-text-secondary);padding:32px;">No cities found. <a href="<?php echo e(route('admin.cities.create')); ?>" style="color:var(--vsc-blue);">Add one</a>.</td></tr>
                <?php endif; ?>
            </tbody>
        </table>
    </div>
    <?php echo e($cities->links('vendor.pagination.admin')); ?>

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

<?php echo $__env->make('admin.layouts.app', array_diff_key(get_defined_vars(), ['__data' => 1, '__path' => 1]))->render(); ?><?php /**PATH C:\xampp_lite_8_4\www\landfeasibility\resources\views/admin/cities/index.blade.php ENDPATH**/ ?>