
@extends('plantilla')

@section('content')


<div class="content-wrapper"> 

    <section class="content-header"> 

        <h1> Gestion de Consultorios  </h1>

    </section>
    
    <div class="content"> 

            <div class="box"> 

                <br>

                <form method="POST" > 

                    @csrf

                    <div class="col-md-6 col-xs-12"> 

                        <input type="text" class="form-control" name="consultorio1" placeholder="Ingrese Nuevo Consultorio" required =""> 
                    
                    </div>

                    <button class="btn btn-primary" type="submit"> Agregar Consultorio</button>

                </form>

                <br>

                <div class="box-body"> 

                    @foreach ($consultoriosall as $consultorio)
        
                        <div class="row"> 

                            <form method="POST" action=" {{ url('Consultorio/'.$consultorio -> id) }}"> 

                                @csrf
                                @method('put')

                                <div class="col-md-4"> 

                                    <input type="text" type="form-control" name="consultorioE" value="{{ $consultorio -> consultorio }}"> 

                                </div>

                                <div class="col-md-1"> 

                                    <button class="btn btn-success" type="submit">Guardar</button>

                                </div>

                            </form>

                            <div class="col-md-1"> 

                                <form method="POST" action="{{ url('borrar-Consultorio/'.$consultorio->id) }}"> 

                                    @csrf
                                    @method('delete')

                                    <button type="submit" class="btn btn-danger">Borrar</button>

                                </form>

                            </div>

                        </div>
                        <br>
                        
                    @endforeach

                </div>

            </div>

    </div>

</div>

@endsection
