69 lines
3.9 KiB
PHP
69 lines
3.9 KiB
PHP
{{-- resources/views/forms/submit-tech-maker.blade.php --}}
|
|
@extends('layouts.master')
|
|
|
|
@section('content')
|
|
<div class="container">
|
|
<form action="{{ route('rfp.store') }}" method="POST">
|
|
@csrf
|
|
@foreach ($formFields ?? [] as $section)
|
|
@if ($section['type'] == 'section')
|
|
<h3>{{ $section['title'] }}</h3>
|
|
@foreach ($section['fields'] as $field)
|
|
<div class="form-group">
|
|
<label for="{{ $field['name'] }}">{{ $field['label'] }}</label>
|
|
@switch($field['type'])
|
|
@case('textarea')
|
|
<textarea name="{{ $field['name'] }}" class="form-control {{ $errors->has($field['name']) ? 'is-invalid' : '' }}" id="{{ $field['name'] }}" placeholder="{{ $field['placeholder'] ?? '' }}">{{ old($field['name']) }}</textarea>
|
|
@break
|
|
|
|
@case('select')
|
|
<select name="{{ $field['name'] }}" class="form-control {{ $errors->has($field['name']) ? 'is-invalid' : '' }}" id="{{ $field['name'] }}">
|
|
@foreach ($field['options'] as $option)
|
|
<option value="{{ $option['value'] }}">{{ $option['label'] }}</option>
|
|
@endforeach
|
|
</select>
|
|
@break
|
|
|
|
@case('checkbox-group')
|
|
@foreach ($field['options'] as $option)
|
|
<div class="form-check">
|
|
<input class="form-check-input" type="checkbox" name="{{ $field['name'] }}[]" value="{{ $option['value'] }}" id="{{ $option['value'] }}">
|
|
<label class="form-check-label" for="{{ $option['value'] }}">
|
|
{{ $option['label'] }}
|
|
</label>
|
|
</div>
|
|
@endforeach
|
|
@break
|
|
|
|
@case('radio-group')
|
|
@foreach ($field['options'] as $option)
|
|
<div class="form-check">
|
|
<input class="form-check-input" type="radio" name="{{ $field['name'] }}" value="{{ $option['value'] }}" id="{{ $option['value'] }}">
|
|
<label class="form-check-label" for="{{ $option['value'] }}">
|
|
{{ $option['label'] }}
|
|
</label>
|
|
</div>
|
|
@endforeach
|
|
@break
|
|
|
|
@case('range')
|
|
<input type="range" name="{{ $field['name'] }}" class="form-control-range" id="{{ $field['name'] }}" min="{{ $field['min'] }}" max="{{ $field['max'] }}" step="{{ $field['step'] }}" value="{{ old($field['name']) ?? $field['min'] }}">
|
|
@break
|
|
|
|
@default
|
|
<input type="{{ $field['type'] }}" name="{{ $field['name'] }}" class="form-control {{ $errors->has($field['name']) ? 'is-invalid' : '' }}" id="{{ $field['name'] }}" placeholder="{{ $field['placeholder'] ?? '' }}" value="{{ old($field['name']) }}">
|
|
@endswitch
|
|
@if ($errors->has($field['name']))
|
|
<div class="invalid-feedback">
|
|
{{ $errors->first($field['name']) }}
|
|
</div>
|
|
@endif
|
|
</div>
|
|
@endforeach
|
|
@endif
|
|
@endforeach
|
|
<button type="submit" class="btn btn-primary">Submit</button>
|
|
</form>
|
|
</div>
|
|
@endsection
|