@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">Editando Parceiro</h4>
                    <p class="text-muted">Editando Parceiro no Sistema</p>
                    <a class="btn btn-outline-primary w-100" type="button" href="{{ route('parceiros.index') }}"
                        role="button">Ver
                        todos</a>
                </div>
                <div class="card">
                    <div class="card-body">
                        <form action="{{ route('parceiros.update', $parceiro->id) }}" method="POST"
                            class="form-horizontal">
                            @method('PUT')
                            @csrf
                            <div class="box box-info">

                                <div class="form-group">
                                    <label class="col-form-label">Nome</label>
                                    <input type="text" name="nome" value="{{ $parceiro->nome }}"
                                        class="form-control @error('$parceiro->nome') is-invalid @enderror">
                                </div>

                                <div class="form-group">
                                    <div class="row">
                                        <div class="col-md-7">
                                            <label class="col-form-label">Url</label>
                                            <input type="text" name="url" value="{{ $parceiro->url }}"
                                                class="form-control @error('url') is-invalid @enderror">
                                        </div>
                                        <div class="col-md-3">
                                            <label class="col-form-label">Parceiro ícone</label>
                                            <input type="text" name="icone" value="{{ $parceiro->icone }}"
                                                class="form-control @error('icone') is-invalid @enderror">
                                        </div>

                                        <div class="col-md-2">
                                            <label class="control-label">Nova página</label>
                                            <select class="form-control" name="novapagina"
                                                value="{{ $parceiro['novapagina'] }}">
                                                <option value="">Selecione</option>
                                                <option value="N" @if ($parceiro['novapagina'] == 'N') selected @endif>Não
                                                </option>
                                                <option value="S" @if ($parceiro['novapagina'] == 'S') selected @endif>Sim
                                                </option>
                                            </select>
                                        </div>
                                    </div>
                                    <br>
                                    <div class="form-group">
                                        <input type="submit" value="Gravar"
                                            class="btn btn-sm btn-block btn-outline-success w-100">
                                    </div>
                        </form>
                    </div>
                </div>
            </div>
        </div>
    </div>
@endsection
