@extends('admin.layouts.layout')

@section('content')
    <div class="row match-height">
        <div class="col-md-12 col-12">
            <div class="card">
                <div class="card-header">
                    <h4 class="card-title text-primary">Cadastrando Secretário</h4>
                    <p class="text-muted">Cadastrando Secretário no Sistema</p>
                    <a class="btn btn-outline-primary w-100" type="button" href="{{ route('secretarios.index') }}"
                        role="button">Ver todos</a>
                </div>
                <div class="card">
                    <div class="card-body">

                        <!-- Formulário para criar o secretário -->
                        <form action="{{ route('secretarios.store') }}" method="POST" enctype="multipart/form-data">
                            @csrf
                            <div class="form-group">
                                <label for="nome">Nome:</label>
                                <input type="text" name="nome" id="nome" class="form-control"
                                    value="{{ old('nome') }}" required>
                            </div>

                            <div class="row">
                                <div class="form-group col-md-6">
                                    <label for="id_cargo">Cargo:</label>
                                    <select name="id_cargo" id="id_cargo" class="form-control" required>
                                        <option value="">Selecione</option>
                                        @foreach ($cargos as $cargo)
                                            <option value="{{ $cargo->id }}"
                                                {{ old('id_cargo') == $cargo->id ? 'selected' : '' }}>
                                                {{ $cargo->descricao }}
                                            </option>
                                        @endforeach
                                    </select>
                                </div>
                                <div class="form-group col-md-6">
                                    <label for="foto">Foto:</label>
                                    <input type="file" name="foto" id="foto" class="form-control">
                                </div>
                            </div>
                            <div class="row">
                                <div class="form-group col-md-6">
                                    <label for="detalhes">Detalhes:</label>
                                    <input type="url" name="detalhes" id="detalhes" class="form-control"
                                        value="{{ old('detalhes') }}">
                                </div>
                                <div class="form-group col-md-6">
                                    <label for="facebook">Facebook:</label>
                                    <input type="url" name="facebook" id="facebook" class="form-control"
                                        value="{{ old('facebook') }}">
                                </div>
                            </div>
                            <div class="row">
                                <div class="form-group col-md-6">
                                    <label for="twitter">Twitter:</label>
                                    <input type="url" name="twitter" id="twitter" class="form-control"
                                        value="{{ old('twitter') }}">
                                </div>
                                <div class="form-group col-md-6">
                                    <label for="instagram">Instagram:</label>
                                    <input type="url" name="instagram" id="instagram" class="form-control"
                                        value="{{ old('instagram') }}">
                                </div>
                            </div>
                            <div class="row">
                                <div class="form-group col-md-6">
                                    <label for="youtube">YouTube:</label>
                                    <input type="url" name="youtube" id="youtube" class="form-control"
                                        value="{{ old('youtube') }}">
                                </div>
                                <div class="form-group col-md-6">
                                        <label for="linkedin">LinkedIn:</label>
                                        <input type="url" name="linkedin" id="linkedin" class="form-control" value="{{ old('linkedin') }}">
                                </div>                                    
                            </div>                                          
                            <button type="submit" class="btn btn-sm btn-outline-success w-100">Salvar</button>
                        </form>
                    </div>
                </div>
            </div>
        </div>
    </div>
@endsection
