<div class="form-group {{ $errors->has('nom') ? 'has-error' : ''}}">
    <label for="nom" class="control-label">{{ 'Nom' }}</label>
    <input class="form-control" name="nom" type="text" id="nom" value="{{ isset($signataire->nom) ? $signataire->nom : ''}}" >
    {!! $errors->first('nom', '<p class="help-block">:message</p>') !!}
</div>
<div class="form-group {{ $errors->has('prenoms') ? 'has-error' : ''}}">
    <label for="prenoms" class="control-label">{{ 'Prenoms' }}</label>
    <input class="form-control" name="prenoms" type="text" id="prenoms" value="{{ isset($signataire->prenoms) ? $signataire->prenoms : ''}}" >
    {!! $errors->first('prenoms', '<p class="help-block">:message</p>') !!}
</div>
<div class="form-group {{ $errors->has('email') ? 'has-error' : ''}}">
    <label for="email" class="control-label">{{ 'Email' }}</label>
    <input class="form-control" name="email" type="text" id="email" value="{{ isset($signataire->email) ? $signataire->email : ''}}" >
    {!! $errors->first('email', '<p class="help-block">:message</p>') !!}
</div>
<div class="form-group {{ $errors->has('phone') ? 'has-error' : ''}}">
    <label for="phone" class="control-label">{{ 'Phone' }}</label>
    <input class="form-control" name="phone" type="text" id="phone" value="{{ isset($signataire->phone) ? $signataire->phone : ''}}" >
    {!! $errors->first('phone', '<p class="help-block">:message</p>') !!}
</div>
<div class="form-group {{ $errors->has('sexe') ? 'has-error' : ''}}">
    <label for="sexe" class="control-label">{{ 'Sexe' }}</label>
    <select name="sexe" class="form-control" id="sexe" >
        <option value="M" {{ (isset($signataire->sexe) && $signataire->sexe == "M") ? 'selected' : ''}}>M</option>
        <option value="F" {{ (isset($signataire->sexe) && $signataire->sexe == "F") ? 'selected' : ''}}>F</option>
    </select>
    {!! $errors->first('sexe', '<p class="help-block">:message</p>') !!}
</div>
<div class="form-group {{ $errors->has('id_grade') ? 'has-error' : ''}}" required="required">
    <label for="id_grade" class="control-label">{{ 'grade' }}</label>
    <select name="id_grade" class="form-control" id="id_grade"  required>
    @foreach ($grades as $grade)
        <option
            value="{{ $grade->sigleGrade }}"
            {{ (isset($signataire->grade) && $signataire->grade == $grade->sigleGrade) ? 'selected' : ''}}
        >
                {{ $grade->nomGrade }}
        </option>
    @endforeach
    </select>
    {!! $errors->first('id_grade', '<p class="help-block">:message</p>') !!}
</div>
<div class="form-group {{ $errors->has('idFonction') ? 'has-error' : ''}}" required="required">
    <label for="idFonction" class="control-label">{{ 'Fonction' }}</label>
    <select name="idFonction" class="form-control" id="idFonction"  required>
    @foreach ($fonctions as $fonction)
        <option
            value="{{ $fonction->idFonction }}"
            {{ (isset($signataire->fonction) && $signataire->fonction == $fonction->idFonction) ? 'selected' : ''}}
        >
                {{ $fonction->nomFonction }}
        </option>
    @endforeach
    </select>
    {!! $errors->first('idFonction', '<p class="help-block">:message</p>') !!}
</div>

<div class="form-group">
    <input class="btn btn-primary" type="submit" value="{{ $formMode === 'edit' ? 'Modifier' : 'Créer' }}">
</div>
