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

<?php $__env->startSection('content'); ?>
<div class="row mt-4">
<div class="col-lg-8">
    <h1 class="text-2xl font-semibold text-slate-800 mb-4">Add Staff</h1>

    <form method="post" action="<?php echo e(route('staff.store')); ?>" class="bg-white rounded-xl shadow-sm border border-slate-200 p-6 space-y-4">
        <?php echo csrf_field(); ?>

        <div class="grid grid-cols-1 sm:grid-cols-2 gap-4">
            <div>
                <label class="block text-sm font-medium text-slate-700">First name *</label>
                <input type="text" name="first_name" value="<?php echo e(old('first_name')); ?>" required class="mt-1 block w-full rounded-lg border-slate-300 shadow-sm text-sm">
            </div>
            <div>
                <label class="block text-sm font-medium text-slate-700">Last name</label>
                <input type="text" name="last_name" value="<?php echo e(old('last_name')); ?>" class="mt-1 block w-full rounded-lg border-slate-300 shadow-sm text-sm">
            </div>
        </div>

        <div class="grid grid-cols-1 sm:grid-cols-2 gap-4">
            <div>
                <label class="block text-sm font-medium text-slate-700">Mobile</label>
                <input type="text" name="mobile" value="<?php echo e(old('mobile')); ?>" class="mt-1 block w-full rounded-lg border-slate-300 shadow-sm text-sm">
            </div>
            <div>
                <label class="block text-sm font-medium text-slate-700">Email</label>
                <input type="email" name="email" value="<?php echo e(old('email')); ?>" class="mt-1 block w-full rounded-lg border-slate-300 shadow-sm text-sm">
            </div>
        </div>

        <div class="grid grid-cols-1 sm:grid-cols-3 gap-4">
            <div>
                <label class="block text-sm font-medium text-slate-700">Gender</label>
                <select name="gender" class="mt-1 block w-full rounded-lg border-slate-300 shadow-sm text-sm">
                    <option value="">Not set</option>
                    <option value="male" <?php echo e(old('gender') === 'male' ? 'selected' : ''); ?>>Male</option>
                    <option value="female" <?php echo e(old('gender') === 'female' ? 'selected' : ''); ?>>Female</option>
                    <option value="other" <?php echo e(old('gender') === 'other' ? 'selected' : ''); ?>>Other</option>
                </select>
            </div>
            <div>
                <label class="block text-sm font-medium text-slate-700">Designation</label>
                <input type="text" name="designation" value="<?php echo e(old('designation')); ?>" class="mt-1 block w-full rounded-lg border-slate-300 shadow-sm text-sm">
            </div>
            <div>
                <label class="block text-sm font-medium text-slate-700">Specialization</label>
                <input type="text" name="specialization" value="<?php echo e(old('specialization')); ?>" class="mt-1 block w-full rounded-lg border-slate-300 shadow-sm text-sm">
            </div>
        </div>

        <div class="grid grid-cols-1 sm:grid-cols-2 gap-4">
            <div>
                <label class="block text-sm font-medium text-slate-700">Branch *</label>
                <select name="branch_id" required class="mt-1 block w-full rounded-lg border-slate-300 shadow-sm text-sm">
                    <option value="">Select branch</option>
                    <?php $__currentLoopData = $branches; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $b): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                        <option value="<?php echo e($b->id); ?>" <?php echo e(old('branch_id', $branchId) == $b->id ? 'selected' : ''); ?>><?php echo e($b->name); ?></option>
                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                </select>
            </div>
            <div>
                <label class="block text-sm font-medium text-slate-700">Joining date</label>
                <input type="date" name="joining_date" value="<?php echo e(old('joining_date')); ?>" class="mt-1 block w-full rounded-lg border-slate-300 shadow-sm text-sm">
            </div>
        </div>

        <div class="grid grid-cols-1 sm:grid-cols-2 gap-4">
            <div>
                <label class="block text-sm font-medium text-slate-700">Employment type</label>
                <input type="text" name="employment_type" value="<?php echo e(old('employment_type')); ?>" class="mt-1 block w-full rounded-lg border-slate-300 shadow-sm text-sm">
            </div>
            <div>
                <label class="block text-sm font-medium text-slate-700">Basic salary</label>
                <input type="number" step="0.01" name="basic_salary" value="<?php echo e(old('basic_salary')); ?>" min="0" class="mt-1 block w-full rounded-lg border-slate-300 shadow-sm text-sm">
            </div>
        </div>

        <div class="grid grid-cols-1 sm:grid-cols-3 gap-4">
            <div>
                <label class="block text-sm font-medium text-slate-700">Commission type</label>
                <input type="text" name="commission_type" value="<?php echo e(old('commission_type')); ?>" class="mt-1 block w-full rounded-lg border-slate-300 shadow-sm text-sm">
            </div>
            <div>
                <label class="block text-sm font-medium text-slate-700">Commission value</label>
                <input type="number" step="0.01" name="commission_value" value="<?php echo e(old('commission_value')); ?>" min="0" class="mt-1 block w-full rounded-lg border-slate-300 shadow-sm text-sm">
            </div>
            <div>
                <label class="block text-sm font-medium text-slate-700">Weekly off day</label>
                <input type="text" name="weekly_off_day" value="<?php echo e(old('weekly_off_day')); ?>" class="mt-1 block w-full rounded-lg border-slate-300 shadow-sm text-sm" placeholder="e.g. Sunday">
            </div>
        </div>

        <div class="grid grid-cols-1 sm:grid-cols-2 gap-4">
            <div>
                <label class="block text-sm font-medium text-slate-700">Shift start time</label>
                <input type="time" name="shift_start_time" value="<?php echo e(old('shift_start_time')); ?>" class="mt-1 block w-full rounded-lg border-slate-300 shadow-sm text-sm">
            </div>
            <div>
                <label class="block text-sm font-medium text-slate-700">Shift end time</label>
                <input type="time" name="shift_end_time" value="<?php echo e(old('shift_end_time')); ?>" class="mt-1 block w-full rounded-lg border-slate-300 shadow-sm text-sm">
            </div>
        </div>

        <div class="grid grid-cols-1 sm:grid-cols-2 gap-4">
            <div>
                <label class="block text-sm font-medium text-slate-700">Status *</label>
                <select name="status" required class="mt-1 block w-full rounded-lg border-slate-300 shadow-sm text-sm">
                    <option value="active" <?php echo e(old('status', 'active') === 'active' ? 'selected' : ''); ?>>Active</option>
                    <option value="inactive" <?php echo e(old('status') === 'inactive' ? 'selected' : ''); ?>>Inactive</option>
                    <option value="on_leave" <?php echo e(old('status') === 'on_leave' ? 'selected' : ''); ?>>On Leave</option>
                </select>
            </div>
            <div>
                <label class="block text-sm font-medium text-slate-700">Availability</label>
                <select name="availability_status" class="mt-1 block w-full rounded-lg border-slate-300 shadow-sm text-sm">
                    <option value="">Not set</option>
                    <option value="available" <?php echo e(old('availability_status') === 'available' ? 'selected' : ''); ?>>Available</option>
                    <option value="busy" <?php echo e(old('availability_status') === 'busy' ? 'selected' : ''); ?>>Busy</option>
                    <option value="on_break" <?php echo e(old('availability_status') === 'on_break' ? 'selected' : ''); ?>>On Break</option>
                    <option value="off" <?php echo e(old('availability_status') === 'off' ? 'selected' : ''); ?>>Off</option>
                </select>
            </div>
        </div>

        <div>
            <label class="block text-sm font-medium text-slate-700">Notes</label>
            <textarea name="notes" rows="3" class="mt-1 block w-full rounded-lg border-slate-300 shadow-sm text-sm"><?php echo e(old('notes')); ?></textarea>
        </div>

        <div>
            <label class="block text-sm font-medium text-slate-700 mb-1">Services this staff can perform</label>
            <div class="grid grid-cols-1 sm:grid-cols-2 gap-2 max-h-48 overflow-y-auto border border-slate-200 rounded-lg p-3">
                <?php $__currentLoopData = $services; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $service): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                <label class="flex items-center gap-2 text-sm text-slate-700">
                    <input type="checkbox" name="service_ids[]" value="<?php echo e($service->id); ?>" class="rounded border-slate-300"
                        <?php echo e(in_array($service->id, old('service_ids', [])) ? 'checked' : ''); ?>>
                    <span><?php echo e($service->name); ?></span>
                </label>
                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
            </div>
        </div>

        <div class="flex gap-3 pt-2">
            <button type="submit" class="px-4 py-2 bg-slate-800 text-white text-sm font-medium rounded-lg">Save</button>
            <a href="<?php echo e(route('staff.index')); ?>" class="px-4 py-2 bg-slate-200 rounded-lg text-sm">Cancel</a>
        </div>
    </form>
</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/staff/create.blade.php ENDPATH**/ ?>