@extends('hr_main') @section('title', '| ' . $data['pageTitle']) @section('content')
{{-- Center-align the entire form --}}
{!! $data['pageTitle'] !!}
{!! Form::open([ 'files' => false, 'id' => 'formId', 'role' => 'form', 'class' => 'form-horizontal form-groups text-center', ]) !!}
{!! Form::text('name', null, ['class' => 'form-control', 'id' => 'name']) !!}

{{ $errors->first('name') }}

{!! Form::select( 'type', [ '' => 'Select Type', 'All' => 'Applicable For All', 'Specific' => 'Team Specific', ], null, [ 'class' => 'form-control', 'id' => 'type', ], ) !!}

{{ $errors->first('type') }}

{!! Form::select('team_id', $data['team'], null, [ 'class' => 'form-control', 'id' => 'team_id', ]) !!}

{{ $errors->first('team_id') }}

{{-- Supervisor Dropdowns --}} @php function ordinal($number) { $ends = [ 'th', 'st', 'nd', 'rd', 'th', 'th', 'th', 'th', 'th', 'th', ]; if ($number % 100 >= 11 && $number % 100 <= 13) { return $number . 'th'; } else { return $number . $ends[$number % 10]; } } @endphp @for ($i = 1; $i <= $data['noOfBosses']; $i++)
{!! Form::text("supervisor_$i", null, [ 'class' => 'form-control boss_emp_id', 'id' => "supervisor_$i", $i === 1 ? 'readonly' : null, // ✅ Make the first one readonly ]) !!} %

{{ $errors->first("supervisor_$i") }}

@endfor
{!! Form::textarea('remarks', null, ['class' => 'form-control', 'id' => 'remarks', 'rows' => 3]) !!}

{{ $errors->first('remarks') }}

{!! Form::submit('Submit', ['id' => 'add', 'class' => 'btn btn-info submitButton']) !!} Close
{!! Form::close() !!}
@endsection @section('footerAssets') @endsection