

<?php $__env->startSection('page_title', 'Edit Project: ' . $project->name); ?>

<?php $__env->startSection('content'); ?>
    <div class="row">
        <div class="col-lg-12">
            <div class="mb-4">
                <a href="<?php echo e(route('admin.projects.index')); ?>" class="text-decoration-none text-muted small">
                    <i class="bi bi-arrow-left me-1"></i> Back to projects list
                </a>
            </div>

            <div class="card border-0 shadow-sm">
                <div class="card-header bg-white border-bottom p-4">
                    <h5 class="fw-bold mb-0">Edit Project: <?php echo e($project->name); ?></h5>
                </div>
                <div class="card-body p-4">
                    <form action="<?php echo e(route('admin.projects.update', $project->id)); ?>" method="POST">
                        <?php echo csrf_field(); ?>
                        <?php echo method_field('PUT'); ?>

                        <div class="row mb-4">
                            <div class="col-md-8">
                                <label class="form-label fw-bold small text-uppercase text-muted">Project Name</label>
                                <input type="text" name="name" class="form-control"
                                    value="<?php echo e(old('name', $project->name)); ?>" required>
                            </div>
                            <div class="col-md-4">
                                <label class="form-label fw-bold small text-uppercase text-muted">Department</label>
                                <select name="department_id" class="form-select" required>
                                    <option value="">Select Department</option>
                                    <?php $__currentLoopData = $departments; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $dept): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                        <option value="<?php echo e($dept->id); ?>"
                                            <?php echo e($project->department_id == $dept->id ? 'selected' : ''); ?>><?php echo e($dept->name); ?>

                                        </option>
                                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                </select>
                            </div>
                        </div>

                        <div class="mb-4">
                            <label class="form-label fw-bold small text-uppercase text-muted">Description</label>
                            <textarea name="description" class="form-control" rows="4"><?php echo e(old('description', $project->description)); ?></textarea>
                        </div>

                        <div class="row mb-4">
                            <div class="col-md-4">
                                <label class="form-label fw-bold small text-uppercase text-muted">Start Date</label>
                                <input type="date" name="start_date" class="form-control"
                                    value="<?php echo e(old('start_date', $project->start_date?->format('Y-m-d'))); ?>" required>
                            </div>
                            <div class="col-md-4">
                                <label class="form-label fw-bold small text-uppercase text-muted">End Date</label>
                                <input type="date" name="end_date" class="form-control"
                                    value="<?php echo e(old('end_date', $project->end_date?->format('Y-m-d'))); ?>">
                            </div>
                            <div class="col-md-4">
                                <label class="form-label fw-bold small text-uppercase text-muted">Status</label>
                                <select name="status" class="form-select" required>
                                    <option value="active" <?php echo e($project->status == 'active' ? 'selected' : ''); ?>>Active
                                    </option>
                                    <option value="on_hold" <?php echo e($project->status == 'on_hold' ? 'selected' : ''); ?>>On Hold
                                    </option>
                                    <option value="completed" <?php echo e($project->status == 'completed' ? 'selected' : ''); ?>>
                                        Completed</option>
                                    <option value="cancelled" <?php echo e($project->status == 'cancelled' ? 'selected' : ''); ?>>
                                        Cancelled</option>
                                </select>
                            </div>
                        </div>

                        <div class="d-flex justify-content-end gap-2 border-top pt-4">
                            <a href="<?php echo e(route('admin.projects.index')); ?>" class="btn btn-light px-4">Cancel</a>
                            <button type="submit" class="btn btn-primary px-4">Update Project</button>
                        </div>
                    </form>
                </div>
            </div>
        </div>
    </div>
<?php $__env->stopSection(); ?>

<?php echo $__env->make('layouts.admin', array_diff_key(get_defined_vars(), ['__data' => 1, '__path' => 1]))->render(); ?><?php /**PATH G:\wamp64\www\projects\attendance\resources\views/admin/projects/edit.blade.php ENDPATH**/ ?>