Slim API
This commit is contained in:
@ -69,8 +69,7 @@
|
||||
@push('scripts')
|
||||
<script type="text/javascript">
|
||||
function findUnidades(proyecto) {
|
||||
$.getJSON('{!!api('unidades', 'unidades_no_reservadas')!!}&proyecto=' + proyecto + '&tipo=1', function(data) {
|
||||
//$.post('{!!nUrl('ajax', 'unidades', ['ajax' => true])!!}', {proyecto: proyecto, tipo: 1}, function(data) {
|
||||
$.getJSON('{!!$locations['api']!!}/unidades/no_reservadas/' + proyecto + '/1', function(data) {
|
||||
var unidades = $('#departamento')
|
||||
unidades.html('')
|
||||
$.each(data, function(i, el) {
|
||||
@ -79,13 +78,12 @@
|
||||
}
|
||||
unidades.append($('<option></option>').attr('value', el.id).html(el.descripcion));
|
||||
})
|
||||
})//, 'json')
|
||||
})
|
||||
}
|
||||
var unis = []
|
||||
function agregarUnidad(tipo) {
|
||||
var proyecto = $('#proyecto').val()
|
||||
$.getJSON('{!!api('unidades', 'unidades_no_reservadas')!!}&proyecto=' + proyecto + '&tipo=' + tipo, function(data) {
|
||||
//$.post('{!!nUrl('ajax', 'unidades', ['ajax' => true])!!}', {proyecto: proyecto, tipo: tipo}, function(data) {
|
||||
$.getJSON('{!!$locations['api']!!}/unidades/no_reservadas/' + proyecto + '/' + tipo, function(data) {
|
||||
var unidades = $('#unidades')
|
||||
var n = unis[unis.length - 1] + 1;
|
||||
if (unis.length == 0) {
|
||||
@ -128,7 +126,7 @@
|
||||
i = $(this).attr('data-id');
|
||||
removeUnidad(i);
|
||||
});
|
||||
})//, 'json')
|
||||
})
|
||||
}
|
||||
function removeUnidad(n) {
|
||||
var unidades = $('#unidades');
|
||||
|
Reference in New Issue
Block a user