@extends ('layouts.admin')
@section ('title')
SisVentas | Nuevo Cliente
@endsection
@section ('contenido')
<div class="row">
    <div class="col-12">
        <div class="page-title-box">
            <div class="page-title-right">
                <ol class="breadcrumb m-0">
                    <li class="breadcrumb-item"><a href="javascript: void(0);">Inicio</a></li>
                    <li class="breadcrumb-item"><a href="javascript: void(0);">Ventas</a></li>
                    <li class="breadcrumb-item active">Clientes</li>
                </ol>
            </div>
            <h4 class="page-title">Administración de Clientes</h4>
        </div>
    </div>
</div>
<div class="row">
    <div class="col-lg-12">
        <div class="card">
            @if (count($errors) > 0)
            <div class="alert alert-danger">
                <strong>Opps!</strong> Algo salió mal, verifique los errores a continuación.<br><br>
                <ul>
                    @foreach ($errors->all() as $error)
                    <li>{{ $error }}</li>
                    @endforeach
                </ul>
            </div>
            @endif
            <div class="card-body">
                <div class="row mb-2">
                    <div class="col-sm-4">
                        <h4 class="header-title">Agregar Clientes</h4>
                    </div>
                    <div class="col-sm-8">
                        <div class="text-sm-end">
                            <a class="btn btn-primary" href="{{ route('cliente.index') }}"><i class="mdi mdi-reply"></i> Clientes</a>
                        </div>
                    </div><!-- end col-->
                </div>

                <div class="tab-content">
                    <div class="tab-pane show active" id="custom-styles-preview">
                        {!!Form::open(array('url'=>'ventas/cliente','method'=>'POST','autocomplete'=>'off'))!!}
                        {{Form::token()}}
                        <div class="row">
                            <div class="col-lg-6">
                                <div class="mb-3">
                                    <label for="nombre" class="form-label">Tipo Documento:</label>
                                    <select name="tipo_documento" class="form-control select2" data-toggle="select2">
                                        <option value="DNI">DNI</option>
                                        <option value="RUC">RUC</option>
                                        <option value="PAS">PAS</option>
                                    </select>
                                </div>
                            </div>
                            <div class="col-lg-6">
                                <div class="mb-3">
                                    <label for="idcategoria" class="form-label">Numero Documento:</label>
                                    <input type="text" name="num_documento" value="{{old('num_documento')}}" class="form-control" placeholder="Número de Documento...">
                                </div>
                            </div>
                            <div class="col-lg-6">
                                <div class="mb-3">
                                    <label for="codigo" class="form-label">Nombre:</label>
                                    <input type="text" name="nombre" value="{{old('nombre')}}" class="form-control" placeholder="Nombre...">
                                </div>
                            </div>
                            <div class="col-lg-6">
                                <div class="mb-3">
                                    <label for="stock" class="form-label">Dirección:</label>
                                    <input type="text" name="direccion" value="{{old('direccion')}}" class="form-control" placeholder="Dirección...">
                                </div>
                            </div>
                            <div class="col-lg-6">
                                <div class="mb-3">
                                    <label for="descripcion" class="form-label">Teléfono:</label>
                                    <input type="text" name="telefono" value="{{old('telefono')}}" class="form-control" placeholder="Teléfono...">
                                </div>
                            </div>
                            <div class="col-lg-6">
                                <div class="mb-3">
                                    <label for="imagen" class="form-label">Email:</label>
                                    <input type="email" name="email" value="{{old('email')}}" class="form-control" placeholder="Email...">
                                </div>
                            </div>
                            <div class="col-lg-6">
                                <div class="mb-3">
                                    <button class="btn btn-info" type="submit"><i class="mdi mdi-content-save"></i> Guardar</button>
                                    <button class="btn btn-danger" type="reset"><i class="mdi mdi-cancel"></i> Cancelar</button>
                                </div>
                            </div> <!-- end col -->
                        </div>
                        {!! Form::close() !!}
                    </div> <!-- end preview-->
                </div> <!-- end tab-content-->
            </div> <!-- end card-body-->
        </div> <!-- end card-->
    </div> <!-- end col-->
</div>
@push ('scripts')
<script>
$('#liVentas').addClass("sub active");
$('#aVentas').addClass("active");
$('#liClientes').addClass("active");
</script>
@endpush
@endsection