49 lines
1.1 KiB
PHP
49 lines
1.1 KiB
PHP
@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
|