<form class="row g-3 auto-width form create-package" method="post" action="{{ route('test-packages.store') }}">
    @csrf
    @method('post')

    <div class="col-md-12">
        <label for="name" class="form-label">Package Name
            <span class="text-danger"><b>*</b></span>
        </label>
        <input type="text" value="{{ old('name') }}" class="form-control name" name="name" aria-describedby="inputGroupPrepend">
        <span class="text-danger error_test_package_name" style="display:none;">This field is required.</span>
    </div>

    <div class="col-md-6">
        <label for="description" class="form-label">Dept/Profile
            <span class="text-danger"><b>*</b></span>
        </label>
        <select class="single-select department form-control" name="department_id">
            <option value="">- Select Department - </option>
            @foreach ($departments as $department)
            <option value='{{ $department->id }}'>{{ $department->name }}</option>
            @endforeach
        </select>
        <span class="text-danger error_department" style="display:none;">This field is required.</span>
    </div>

    <div class="col-md-6">
        <label for="description" class="form-label">Sample Type
            <span class="text-danger"><b>*</b></span>
        </label>
        <select class="single-select sample_type form-control" name="sample_type_id">
            <option value="">- Select Sample Type - </option>
            @foreach ($sample_types as $sample_type)
                <option value='{{ $sample_type->id }}'>{{ $sample_type->name }}</option>
            @endforeach
        </select>
        <span class="text-danger error_sample_type" style="display:none;">This field is required.</span>
    </div>

    <div class="col-md-6">
        <label for="description" class="form-label">Test Method
            <span class="text-danger"><b>*</b></span>
        </label>
        <select class="single-select sample_type form-control" name="test_method_id">
            <option value="">- Select Test Method - </option>
            @foreach ($test_methods as $test_method)
                <option value='{{ $test_method->id }}'>{{ $test_method->name }}</option>
            @endforeach
        </select>
        <span class="text-danger error_test_method" style="display:none;">This field is required.</span>
    </div>

    <div class="col-md-6">
        <label for="package short name" class="form-label">Package Short Name</label>
        <input type="text" value="{{ old('short_name') }}" class="form-control short_name"  name="short_name" aria-describedby="inputGroupPrepend">
    </div>

    <div class="col-md-6">
        <label for="description" value="{{ old('code') }}" class="form-label">Package Code</label>
        <input type="text" class="form-control code" name="code" aria-describedby="inputGroupPrepend">
    </div>

    <div class="col-md-6">
        <label for="report delivery TAT" class="form-label">Report Delivery TAT</label>
        <select class="form-control" name="report_delivery_tat">
            @for($i=1; $i < 31; $i++)
                <option value="{{ $i }}">{{ $i }}</option>
            @endfor
        </select>
    </div>

    <div class="col-md-6">
        <label for="remarks" class="form-label">Remarks
        </label>
        <textarea name="remarks" value="{{ old('remarks') }}" id="remarks" class="form-control remarks" cols="30" rows="2"></textarea>
    </div>
    <div class="col-md-6">
        <label for="priority" class="form-label">Priority </label>
        <input type="deciaml" class="form-control" name="priority" aria-describedby="inputGroupPrepend" required value="{!! $priority + 1 !!}">
        <span class="text-danger error_priority" style="display:none;">This field is required.</span>
    </div>
    <div class="col-md-6" style="margin-top: 41px;">
        <label for="pre booking required" class="form-label">Pre Booking Required</label>
        <input class="form-check-input btn-lg pre_booking_required" name="pre_booking_required" type="checkbox">
    </div>

</form>
<script>
    $.switcher('.pre_booking_required');
</script>
