This commit is contained in:
2021-08-16 22:13:15 -04:00
parent 49374254e4
commit b58cda3e4e
12 changed files with 803 additions and 38 deletions

View File

@ -0,0 +1,48 @@
@extends('layout.base')
@section('content')
<h1 class="header">
Ventas
</h1>
<table class="table">
<thead>
<tr>
<th>
Proyecto
</th>
<th>
Inmobiliaria
</th>
</tr>
</thead>
<tbody id="proyectos"></tbody>
</table>
@endsection
@push('scripts')
<script type="text/javascript">
$(document).ready(() => {
const base_url = '{{$urls->base}}/ventas/'
$.ajax({
url: '{{$urls->api}}/proyectos',
method: 'get',
dataType: 'json'
}).then((data) => {
const parent = $('#proyectos')
$.each(data.proyectos, function(i, el) {
parent.append(
$('<tr></tr>').append(
$('<td></td>').append(
$('<a></a>').attr('href', base_url + el.id).html(el.descripcion)
)
).append(
$('<td></td>').append(
$('<a></a>').attr('href', base_url + el.id).html(el.inmobiliaria.abreviacion)
)
)
)
})
})
})
</script>
@endpush