Commit iniziale
This commit is contained in:
21
public/js/app/altrocontatto.js
Normal file
21
public/js/app/altrocontatto.js
Normal file
@@ -0,0 +1,21 @@
|
||||
$(document).ready(function() {
|
||||
$('#automobili').DataTable({
|
||||
responsive: true,
|
||||
fields: [
|
||||
{
|
||||
label:"Data",
|
||||
type: "datetime"
|
||||
}
|
||||
]
|
||||
});
|
||||
|
||||
$('#contatti').DataTable({
|
||||
responsive: true,
|
||||
fields: [
|
||||
{
|
||||
label:"Data",
|
||||
type: "datetime"
|
||||
}
|
||||
]
|
||||
});
|
||||
});
|
||||
101
public/js/app/auto.js
Normal file
101
public/js/app/auto.js
Normal file
@@ -0,0 +1,101 @@
|
||||
$(document).ready(function() {
|
||||
$('#listaAutomobili').DataTable({
|
||||
responsive: true
|
||||
});
|
||||
});
|
||||
|
||||
$(document).ready(function() {
|
||||
$('#automobili').DataTable({
|
||||
responsive: true,
|
||||
columnDefs: [
|
||||
{
|
||||
target: 0,
|
||||
render: DataTable.render.date(),
|
||||
}
|
||||
],
|
||||
"order": [[0, "desc"]]
|
||||
});
|
||||
});
|
||||
|
||||
$(document).on('click', '.open_modal_new', function() {
|
||||
$('#myModal_new').modal('show');
|
||||
// $('.modal-title').append(' entrata');
|
||||
$('#form').attr('action', 'auto/new');
|
||||
$('#targa').val('');
|
||||
$('#marca').val('');
|
||||
$('#modello').val('');
|
||||
$('#cilindrata').val('');
|
||||
$('#alimentazione').val('');
|
||||
$('#cvfiscali').val('');
|
||||
$('#ntelaio').val('');
|
||||
$('#nmotore').val('');
|
||||
$('#data_acquisto').val('');
|
||||
$('#note').val('');
|
||||
});
|
||||
|
||||
$(document).on('click', '.open_modal_modify', function() {
|
||||
var url = "auto/getAuto";
|
||||
var riga_id = $(this).val();
|
||||
$.getJSON(url + '/' + riga_id, function(data) {
|
||||
|
||||
$('.modal-title').text('Modifica Automobile');
|
||||
// $('#id').val(data.mov_data);
|
||||
$('#targa').val(data.targa);
|
||||
$('#marca').val(data.marca);
|
||||
$('#modello').val(data.modello);
|
||||
$('#cilindrata').val(data.cilindrata);
|
||||
$('#alimentazione').val(data.alimentazione);
|
||||
$('#cvfiscali').val(data.cvfiscali);
|
||||
$('#ntelaio').val(data.ntelaio);
|
||||
$('#nmotore').val(data.nmotore);
|
||||
$('#data_acquisto').val(data.data_acquisto);
|
||||
$('#note').val(data.note);
|
||||
|
||||
$('#myModal_new').modal('show');
|
||||
// $('.panel-heading').text('Modifica movimento');
|
||||
$('#form').attr('action', 'auto/modify');
|
||||
$('#form').append('<input type="hidden" name="id" value="' + riga_id + '">');
|
||||
});
|
||||
});
|
||||
|
||||
$(document).on('click', '.open_modal_rifornimento', function() {
|
||||
var riga_id = $(this).val();
|
||||
|
||||
$('#form_rifornimento').attr('action', 'auto/rifornimento');
|
||||
$('#form_rifornimento').append('<input type="hidden" name=""type" value="rifornimento">');
|
||||
$('#form_rifornimento').append('<input type="hidden" name="auto" value="' + riga_id + '">');
|
||||
$('#myModal_rifornimento').modal('show');
|
||||
});
|
||||
|
||||
$(document).on('click', '.open_modal_revisione', function() {
|
||||
var riga_id = $(this).val();
|
||||
console.log('click su openmodal_revisione' + riga_id);
|
||||
$('#myModal_revisione').modal('show');
|
||||
$('#form_revisione').attr('action', 'auto/revisione');
|
||||
$('#form_revisione').append('<input type="hidden" name="type" value="revisione">');
|
||||
$('#form_revisione').append('<input type="hidden" name="auto" value="' + riga_id + '">');
|
||||
});
|
||||
|
||||
$(document).on('click', '.open_modal_manutenzione', function() {
|
||||
var riga_id = $(this).val();
|
||||
console.log('click su open_modal_manutenzione ' + riga_id);
|
||||
$('#myModal_manutenzione').modal('show');
|
||||
$('#form_manutenzione').attr('action', 'auto/manutenzione');
|
||||
$('#form_manutenzione').append('<input type="hidden" name="type" value="manutenzione">');
|
||||
$('#form_manutenzione').append('<input type="hidden" name="auto" value="' + riga_id + '">');
|
||||
});
|
||||
|
||||
$(document).on('click', '.open_modal_accessori', function() {
|
||||
var riga_id = $(this).val();
|
||||
console.log('click su open_modal_accessori ' + riga_id);
|
||||
$('#myModal_accessori').modal('show');
|
||||
$('#form_accessori').attr('action', 'auto/accessori');
|
||||
$('#form_accessori').append('<input type="hidden" name="type" value="accessori">');
|
||||
$('#form_accessori').append('<input type="hidden" name="auto" value="' + riga_id + '">');
|
||||
});
|
||||
|
||||
$(document).on('click', '.open_modal_nuovo', function() {
|
||||
$('#myModal_nuovo').modal('show');
|
||||
// $('.modal-title').append(' entrata');
|
||||
$('#form').attr('action', 'movimentie');
|
||||
});
|
||||
52
public/js/app/calendario.js
Normal file
52
public/js/app/calendario.js
Normal file
@@ -0,0 +1,52 @@
|
||||
|
||||
|
||||
document.addEventListener('DOMContentLoaded', function() {
|
||||
// import { Calendar } from '@fullcalendar/core';
|
||||
// import googleCalendarPlugin from '@fullcalendar/google-calendar';
|
||||
var calendarEl = document.getElementById('calendar');
|
||||
|
||||
var calendar = new FullCalendar.Calendar(calendarEl, {
|
||||
//timeZone: 'UTC',
|
||||
timeZone: 'Europe/Rome',
|
||||
initialView: 'timeGridWeek',
|
||||
googleCalendarApiKey: 'AIzaSyClqRqDMqD4grSx5HeLq1lXMxan1-UjK_E',
|
||||
events: {
|
||||
googleCalendarId: 'brebar.family@gmail.com'
|
||||
},
|
||||
editable: true,
|
||||
selectable: true,
|
||||
headerToolbar: {
|
||||
left: 'prev,next',
|
||||
center: 'title',
|
||||
right: 'dayGridMonth,timeGridWeek,timeGridDay' // user can switch between the two
|
||||
},
|
||||
|
||||
dateClick: function(info) {
|
||||
var starttime =moment(info.dateStr);
|
||||
var endtime = moment(info.dateStr).add(30,'m');
|
||||
$('#startDay').val(moment(starttime).format("Y-M-D")) ;
|
||||
$('#startHour').val(moment(starttime).format("HH:mm")) ;
|
||||
|
||||
$('#endDay').val(moment(endtime).format("Y-M-D")) ;
|
||||
$('#endHour').val(moment(endtime).format("HH:mm")) ;
|
||||
$('#event').modal('show');
|
||||
console.log(info.dateStr);
|
||||
console.log(endtime.dateStr);
|
||||
}
|
||||
});
|
||||
calendar.setOption('locale', 'it');
|
||||
calendar.render();
|
||||
});
|
||||
|
||||
$(document).ready(function () {
|
||||
var SITEURL = "{{ url('/admin/') }}";
|
||||
// $(".draggable").draggable();
|
||||
|
||||
$.ajaxSetup({
|
||||
headers: {
|
||||
'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
52
public/js/app/conti.js
Normal file
52
public/js/app/conti.js
Normal file
@@ -0,0 +1,52 @@
|
||||
$(document).ready(function() {
|
||||
$('#listaconti').DataTable({
|
||||
"responsive": true,
|
||||
"order": [[0, "desc"]]
|
||||
});
|
||||
});
|
||||
|
||||
$(".draggable").draggable();
|
||||
|
||||
var d = new Date();
|
||||
var month = d.getMonth()+1;
|
||||
var day = d.getDate();
|
||||
var strDate = d.getFullYear() + '-' +
|
||||
(month<10 ? '0' : '') + month + '-' +
|
||||
(day<10 ? '0' : '') + day;
|
||||
|
||||
|
||||
$(document).on('click', '.open_modal_conto', function() {
|
||||
console.log(strDate);
|
||||
$("#nomeConto").empty();
|
||||
$("#Banca").empty();
|
||||
$('#form').find('input[type="text"], textarea, input[type="number"],input[type="date"],option').val("");
|
||||
$('#form').find('input[type="date"]').val(strDate);
|
||||
$('#myModal').modal('show');
|
||||
$('.modal-title').text(' Nuovo Conto');
|
||||
$('#form').attr('action', '/admin/conti');
|
||||
});
|
||||
|
||||
|
||||
$(document).on('click', '.open_modal_modifica', function() {
|
||||
var url = "/admin/conti";
|
||||
var riga_id = $(this).val();
|
||||
$("#Banca").empty();
|
||||
$("#IBAN").empty();
|
||||
$('#form').attr('method', 'POST');
|
||||
$('#form').attr('action', '/admin/conti' + '/' + riga_id+'?_method=PUT');
|
||||
$.getJSON(url + '/' + riga_id +'/edit', function(data) {
|
||||
// success data
|
||||
console.log(data[0]);
|
||||
$('.modal-title').text('Modifica conto');
|
||||
$('#nomeConto').val(data[0].nomeConto);
|
||||
$('#Banca').val(data[0].Banca);
|
||||
$('#IBAN').val(data[0].IBAN);
|
||||
$('#saldo_iniziale').val(data[0].saldo_iniziale);
|
||||
$('#note').val(data[0].note);
|
||||
$('#myModal').modal('show');
|
||||
|
||||
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
6
public/js/app/conti_catanno.js
Normal file
6
public/js/app/conti_catanno.js
Normal file
@@ -0,0 +1,6 @@
|
||||
$(document).ready(function() {
|
||||
$('#listrapporto').DataTable({
|
||||
responsive: true,
|
||||
paging: false
|
||||
});
|
||||
});
|
||||
51
public/js/app/conti_categorie.js
Normal file
51
public/js/app/conti_categorie.js
Normal file
@@ -0,0 +1,51 @@
|
||||
$(document).ready(function() {
|
||||
$('#listrapportoS').DataTable({
|
||||
"responsive": true,
|
||||
"order": [[0, "asc"]]
|
||||
});
|
||||
|
||||
$('#listrapportoE').DataTable({
|
||||
"responsive": true,
|
||||
"order": [[0, "asc"]]
|
||||
});
|
||||
|
||||
$('#categorie').DataTable({
|
||||
responsive: true
|
||||
});
|
||||
});
|
||||
|
||||
$(document).on('click','.open_modal',function(){
|
||||
var url = "/admin/categorie/modify";
|
||||
var riga_id= $(this).val();
|
||||
$.getJSON(url + '/' + riga_id, function (data) {
|
||||
//success data
|
||||
$('#cat_entrata').prop('checked', false);
|
||||
$('#cat_uscita').prop('checked', false);
|
||||
|
||||
|
||||
console.log(data[0]);
|
||||
console.log(data[0].cat_name);
|
||||
|
||||
|
||||
|
||||
if (data[0].cat_uscita === 1)
|
||||
{
|
||||
// $('.myCheckbox').prop('checked', true);
|
||||
$('#cat_uscita').prop('checked', true);
|
||||
}
|
||||
if (data[0].cat_entrata ===1)
|
||||
{
|
||||
$('#cat_entrata').prop('checked', true);
|
||||
}
|
||||
$('#H_cat_id').val(data[0].id);
|
||||
$('#H_cat_cat_name').val(data[0].cat_name);
|
||||
$('#myModal').modal('show');
|
||||
});
|
||||
});
|
||||
|
||||
$(document).on('click','.open_modal_new',function(){
|
||||
console.log('richiesto apertura form');
|
||||
$('#myModal_new').modal('show');
|
||||
|
||||
});
|
||||
|
||||
17
public/js/app/contratti.js
Normal file
17
public/js/app/contratti.js
Normal file
@@ -0,0 +1,17 @@
|
||||
$('#contratti').DataTable({
|
||||
responsive: true,
|
||||
fields: [
|
||||
{
|
||||
label:"Data",
|
||||
type: "datetime"
|
||||
}
|
||||
]
|
||||
});
|
||||
|
||||
$(document).on('click','.open_modal_new',function(){
|
||||
console.log('richiesto apertura form');
|
||||
$('#myModal_new').modal('show');
|
||||
|
||||
});
|
||||
|
||||
$(".draggable").draggable();
|
||||
13
public/js/app/dashboard.js
Normal file
13
public/js/app/dashboard.js
Normal file
@@ -0,0 +1,13 @@
|
||||
// Rende spostabili le varie finestre
|
||||
|
||||
$( function() {
|
||||
$( ".resizable" ).resizable({
|
||||
handles: "se"
|
||||
});
|
||||
} );
|
||||
$(".draggable").draggable();
|
||||
/*$.get('https://www.ansa.it/trentino/notizie/trentino_rss.xml', function(content) {
|
||||
// Insert the content into the specified element
|
||||
$('#contenuto').html(content);
|
||||
});*/
|
||||
// Load the RSS feed
|
||||
19
public/js/app/documenti.js
Normal file
19
public/js/app/documenti.js
Normal file
@@ -0,0 +1,19 @@
|
||||
$(document).ready(function() {
|
||||
$('#tab_documenti').DataTable({
|
||||
"responsive": true,
|
||||
"order": [[0, "desc"]]
|
||||
});
|
||||
|
||||
// $('.select2').select2();
|
||||
|
||||
|
||||
$(document).on('click', '#open_modal_folder', function() {
|
||||
|
||||
$('#form').find('input[type="text"], textarea, input[type="number"],input[type="date"],option').val("");
|
||||
// $('#form').find('input[type="date"]').val(strDate);
|
||||
$('#myModal').modal('show');
|
||||
$('.modal-title').text(' Nuova Cartella');
|
||||
$('#form').attr('action', '/admin/documenti');
|
||||
});
|
||||
|
||||
});
|
||||
12
public/js/app/enel.js
Normal file
12
public/js/app/enel.js
Normal file
@@ -0,0 +1,12 @@
|
||||
$(document).ready(function() {
|
||||
$('#listaLettureEnel').DataTable({
|
||||
"responsive": true,
|
||||
columnDefs: [
|
||||
{
|
||||
target: 0,
|
||||
render: DataTable.render.date(),
|
||||
}
|
||||
],
|
||||
"order": [[0, "desc"]]
|
||||
});
|
||||
});
|
||||
12
public/js/app/gas.js
Normal file
12
public/js/app/gas.js
Normal file
@@ -0,0 +1,12 @@
|
||||
$(document).ready(function() {
|
||||
$('#listaLettureGas').DataTable({
|
||||
"responsive": true,
|
||||
columnDefs: [
|
||||
{
|
||||
target: 0,
|
||||
render: DataTable.render.date(),
|
||||
}
|
||||
],
|
||||
"order": [[0, "desc"]]
|
||||
});
|
||||
});
|
||||
6
public/js/app/listadoc.js
Normal file
6
public/js/app/listadoc.js
Normal file
@@ -0,0 +1,6 @@
|
||||
$(document).ready(function() {
|
||||
$('#listadoc').DataTable({
|
||||
"responsive": true,
|
||||
"order": [[0, "desc"]]
|
||||
});
|
||||
});
|
||||
161
public/js/app/movimenti.js
Normal file
161
public/js/app/movimenti.js
Normal file
@@ -0,0 +1,161 @@
|
||||
$(document).ready(function() {
|
||||
$('#listamovimenti').DataTable({
|
||||
"responsive": true,
|
||||
columnDefs: [
|
||||
{
|
||||
target: 0,
|
||||
render: DataTable.render.date(),
|
||||
}
|
||||
],
|
||||
"order": [[0, "desc"]]
|
||||
});
|
||||
|
||||
// $('.select2').select2();
|
||||
});
|
||||
|
||||
|
||||
$(".draggable").draggable();
|
||||
|
||||
var d = new Date();
|
||||
var month = d.getMonth()+1;
|
||||
var day = d.getDate();
|
||||
var strDate = d.getFullYear() + '-' +
|
||||
(month<10 ? '0' : '') + month + '-' +
|
||||
(day<10 ? '0' : '') + day;
|
||||
|
||||
|
||||
$(document).on('click', '.open_modal_spesa', function() {
|
||||
console.log(strDate);
|
||||
$("#categoria").empty();
|
||||
$("#tags").empty();
|
||||
$('#form').find('input[type="text"], textarea, input[type="number"],input[type="date"],option').val("");
|
||||
$('#form').find('input[type="date"]').val(strDate);
|
||||
$('#myModal').modal('show');
|
||||
$('.modal-title').text(' Nuovo movimento in uscita');
|
||||
$('#form').attr('action', '/admin/movimenti/spesa');
|
||||
$.getJSON("/admin/service/catlistSpesa", {}, function(cats) {
|
||||
$.each(cats, function(i, cat) {
|
||||
$("select[name='mov_fk_categoria']").append(
|
||||
new Option(cat.cat_name, cat.id)
|
||||
)
|
||||
}
|
||||
);
|
||||
});
|
||||
$.getJSON("/admin/service/taglist", {}, function(tags) {
|
||||
$.each(tags, function(i, tag) {
|
||||
$("select[name='mov_fk_tags']").append(
|
||||
new Option(tag.tag_name, tag.id)
|
||||
)
|
||||
});
|
||||
});
|
||||
$.getJSON("/admin/service/contolist", {}, function(contis) {
|
||||
$.each(contis, function(i, conto) {
|
||||
$("select[name='conto_id']").append(
|
||||
new Option(conto.nomeConto, conto.id)
|
||||
)
|
||||
}
|
||||
);
|
||||
});
|
||||
});
|
||||
$(document).on('click', '.open_modal_entrata', function() {
|
||||
console.log(strDate);
|
||||
$("#categoria").empty();
|
||||
$("#tags").empty();
|
||||
$('#form').find('input[type="text"], textarea, input[type="number"],option').val("");
|
||||
$('#form').find('input[type="date"]').val(strDate);
|
||||
$('#myModal').modal('show');
|
||||
$('.modal-title').text('Nuovo movimento in entrata');
|
||||
$('#form').attr('action', '/admin/movimenti/entrata');
|
||||
$.getJSON("/admin/service/catlistEntrata", {}, function(data) {
|
||||
$.each(data, function(i, item) {
|
||||
$("select[name='mov_fk_categoria']").append(
|
||||
new Option(item.cat_name, item.id)
|
||||
)
|
||||
}
|
||||
);
|
||||
});
|
||||
$.getJSON("/admin/service/taglist", {}, function(data) {
|
||||
$.each(data, function(i, item) {
|
||||
$("select[name='mov_fk_tags']").append(
|
||||
new Option(item.tag_name, item.id)
|
||||
)
|
||||
});
|
||||
});
|
||||
$.getJSON("/admin/service/contolist", {}, function(contis) {
|
||||
$.each(contis, function(i, conto) {
|
||||
$("select[name='conto_id']").append(
|
||||
new Option(conto.nomeConto, conto.id)
|
||||
)
|
||||
}
|
||||
);
|
||||
});
|
||||
});
|
||||
|
||||
$(document).on('click', '.open_modal_modifica', function() {
|
||||
var url = "/admin/movimenti/modify";
|
||||
var riga_id = $(this).val();
|
||||
$("#categoria").empty();
|
||||
$("#tags").empty();
|
||||
$.getJSON(url + '/' + riga_id, function(data) {
|
||||
// success data
|
||||
console.log(data[0]);
|
||||
$.getJSON("/admin/service/taglist", {}, function(tags) {
|
||||
$.each(tags, function(i, tag) {
|
||||
$("select[name='mov_fk_tags']").append(
|
||||
new Option(tag.tag_name, tag.id)
|
||||
)
|
||||
$('#tags')
|
||||
.find('option:contains(' + data[0].tag_name + ')')
|
||||
.prop('selected', true)
|
||||
.trigger('change');
|
||||
});
|
||||
});
|
||||
$.getJSON("/admin/service/catlist", {}, function(cats) {
|
||||
$.each(cats, function(i, cat) {
|
||||
$("select[name='mov_fk_categoria']").append(
|
||||
new Option(cat.cat_name, cat.id)
|
||||
)
|
||||
$('#categoria')
|
||||
.find('option:contains(' + data[0].cat_name + ')')
|
||||
.prop('selected', true)
|
||||
.trigger('change');
|
||||
}
|
||||
);
|
||||
});
|
||||
$.getJSON("/admin/service/contolist", {}, function(contis) {
|
||||
$.each(contis, function(i, conto) {
|
||||
$("select[name='conto_id']").append(
|
||||
new Option(conto.nomeConto, conto.id)
|
||||
)
|
||||
$('#conto_id')
|
||||
.find('option:contains(' + data[0].nomeConto + ')')
|
||||
.prop('selected', true)
|
||||
.trigger('change');
|
||||
}
|
||||
);
|
||||
});
|
||||
$('.modal-title').text('Modifica movimento');
|
||||
$('#data').val(data[0].mov_data);
|
||||
$('#descrizione').val(data[0].mov_descrizione);
|
||||
$('#importo').val(data[0].mov_importo);
|
||||
|
||||
$('#myModal').modal('show');
|
||||
// $('.panel-heading').text('Modifica movimento');
|
||||
$('#form').attr('action', '/admin/movimenti/modify');
|
||||
$('#form').append('<input type="hidden" name="id" value="' + riga_id + '">');
|
||||
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
/*
|
||||
|
||||
$.getJSON("/admin/service/taglist", {}, function(data) {
|
||||
$.each(data, function(i, item) {
|
||||
$("select[name='mov_fk_tags']").append(
|
||||
new Option(item.tag_name, item.id)
|
||||
)
|
||||
});
|
||||
});
|
||||
|
||||
*/
|
||||
68
public/js/app/progetti.js
Normal file
68
public/js/app/progetti.js
Normal file
@@ -0,0 +1,68 @@
|
||||
$(document).ready(function() {
|
||||
|
||||
$('#tab_progetti').DataTable({
|
||||
"responsive": true,
|
||||
columnDefs: [
|
||||
{
|
||||
target: 1,
|
||||
render: DataTable.render.date(),
|
||||
}
|
||||
],
|
||||
"order": [[1, "desc"]]
|
||||
});
|
||||
});
|
||||
|
||||
$(document).on('click', '.open_modal_new', function() {
|
||||
// var riga_id = $(this).val();
|
||||
console.log('cliccato');
|
||||
$('#form').find('input[type="text"], textarea, input[type="number"],input[type="date"]').val("");
|
||||
$('#myModal_new').modal('show');
|
||||
$('#form_new').attr('action', 'progetti/new');
|
||||
});
|
||||
|
||||
$(document).on('click', '.open_modal_edit', function()
|
||||
{
|
||||
var riga_id = $(this).val();
|
||||
// console.log('cliccato');
|
||||
$('#form_new').find('input[type="text"], textarea, input[type="number"],input[type="date"]').val("");
|
||||
|
||||
$.getJSON("/admin/progetti/getProgettoById?id="+riga_id, {}, function(progetto) {
|
||||
$('.modal-title').text('Modifica Progetto');
|
||||
$('#nome').val(progetto[0].nome);
|
||||
//$('#coordinatore').val(progetto[0].coordinatore);
|
||||
// SELECT
|
||||
$('#descrizione').val(progetto[0].descrizione);
|
||||
$('#budget').val(progetto[0].budget);
|
||||
$('#stato option[value='+progetto[0].stato+']').attr('selected','selected');
|
||||
$('#data_inizio').val(progetto[0].data_inizio);
|
||||
$('#data_fine').val(progetto[0].data_fine);
|
||||
$('#note').val(progetto[0].note);
|
||||
$('#button_submit').text('Modifica');
|
||||
|
||||
$.getJSON("progetti/coordinatori" , {}, function(coordinatori) {
|
||||
$.each(coordinatori, function(i, coordinatore) {
|
||||
$("select[name='coordinatore']").append(
|
||||
new Option(coordinatore.name, coordinatore.id)
|
||||
)
|
||||
$('#coordinatore')
|
||||
.find('option:contains(' + progetto[0].fk_user + ')')
|
||||
.prop('selected', true)
|
||||
.trigger('change');
|
||||
});
|
||||
});
|
||||
$('#myModal_new').modal('show');
|
||||
$('#form_new').attr('action', '/admin/progetti/modificaProgetto');
|
||||
$('#form_new').append('<input type="hidden" name="id" value="' + riga_id + '">');
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
|
||||
$.getJSON("progetti/coordinatori", {}, function(data) {
|
||||
$.each(data, function(i, item) {
|
||||
$("select[name='coordinatore']").append(
|
||||
new Option(item.name, item.id)
|
||||
)
|
||||
}
|
||||
);
|
||||
});
|
||||
45
public/js/app/rigaProgetti.js
Normal file
45
public/js/app/rigaProgetti.js
Normal file
@@ -0,0 +1,45 @@
|
||||
$(document).ready(function() {
|
||||
$('#tab_progetti').DataTable({
|
||||
"responsive": true,
|
||||
columnDefs: [
|
||||
{
|
||||
target: 0,
|
||||
render: DataTable.render.date(),
|
||||
}
|
||||
],
|
||||
"order": [[0, "desc"]]
|
||||
});
|
||||
});
|
||||
$('#form').click(function() {
|
||||
$('form').toggle();
|
||||
});
|
||||
|
||||
$("#dettaglio").click(function() {
|
||||
$('[hidable]').toggle();
|
||||
});
|
||||
|
||||
$(document).on('click', '.open_modal', function() {
|
||||
var url = '/admin/progetti/detail/edit';
|
||||
var riga_id = $(this).val();
|
||||
$.get(url + '/' + riga_id, function(data) {
|
||||
//success data
|
||||
console.log(url);
|
||||
//console.log(data[0].descrizione);
|
||||
$('#data_u').val(data[0].data);
|
||||
$('#desc_u').val(data[0].descrizione);
|
||||
$('#ore_u').val(data[0].ore);
|
||||
$('#prezzo_u').val(data[0].prezzo);
|
||||
$('#id_progetto_u').val(data[0].fk_id_progetto);
|
||||
$('#idriga').val(riga_id);
|
||||
$('#myModal').modal('show');
|
||||
})
|
||||
});
|
||||
|
||||
$(document).on('click', '.open_modal_addRow', function() {
|
||||
// var riga_id = $(this).val();
|
||||
console.log('cliccato');
|
||||
$('#form').find('input[type="text"], textarea, input[type="number"],input[type="date"]').val("");
|
||||
$('#myModal_addRow').modal('show');
|
||||
// $('#form_new').attr('action', 'progetti/new');
|
||||
});
|
||||
|
||||
21
public/js/app/tag.js
Normal file
21
public/js/app/tag.js
Normal file
@@ -0,0 +1,21 @@
|
||||
$(document).ready(function() {
|
||||
$('#tags').DataTable({
|
||||
responsive: true
|
||||
});
|
||||
$(document).on('click', '.open_modal', function() {
|
||||
var url = "tags/modify";
|
||||
var riga_id = $(this).val();
|
||||
$.getJSON(url + '/' + riga_id, function(data) {
|
||||
//success data
|
||||
console.log(data[0]);
|
||||
console.log(data[0].tag_name);
|
||||
$('#tag_name').val(data[0].tag_name);
|
||||
$('#tag_id').val(data[0].id);
|
||||
$('#myModal').modal('show');
|
||||
});
|
||||
});
|
||||
$(document).on('click', '.open_modal_new', function() {
|
||||
$('#myModal_new').modal('show');
|
||||
|
||||
});
|
||||
});
|
||||
127
public/js/app/task.js
Normal file
127
public/js/app/task.js
Normal file
@@ -0,0 +1,127 @@
|
||||
$(document).ready(function() {
|
||||
$('#listatask').DataTable({
|
||||
"responsive": true,
|
||||
columnDefs: [
|
||||
{
|
||||
target: 0,
|
||||
render: DataTable.render.date(),
|
||||
}
|
||||
],
|
||||
"order": [[0, "desc"]]
|
||||
});
|
||||
});
|
||||
//$(".draggable").draggable();
|
||||
var d = new Date();
|
||||
|
||||
var month = d.getMonth()+1;
|
||||
var day = d.getDate();
|
||||
|
||||
var strDate = d.getFullYear() + '-' +
|
||||
(month<10 ? '0' : '') + month + '-' +
|
||||
(day<10 ? '0' : '') + day;
|
||||
|
||||
|
||||
$(document).on('click', '.open_modal_new', function() {
|
||||
console.log(strDate);
|
||||
$("#titolo").empty();
|
||||
$("#descrizione").empty();
|
||||
$('#form').find('input[type="text"], textarea, input[type="number"],input[type="date"],option').val("");
|
||||
$('#form').find('input[type="date"]').val(strDate);
|
||||
$('#myModal').modal('show');
|
||||
$('.modal-title').text(' Nuova attività');
|
||||
$('#form').attr('action', '/admin/task/new');
|
||||
$.getJSON("/admin/service/getUsers", {}, function(users) {
|
||||
$.each(users, function(i, users) {
|
||||
$("select[name='assegnato_a']").append(
|
||||
new Option(users.name, users.id)
|
||||
)
|
||||
}
|
||||
);
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
|
||||
/*
|
||||
$(document).on('click', '.open_modal_entrata', function() {
|
||||
console.log(strDate);
|
||||
$("#titolo").empty();
|
||||
$("#tags").empty();
|
||||
$('#form').find('input[type="text"], textarea, input[type="number"],option').val("");
|
||||
$('#form').find('input[type="date"]').val(strDate);
|
||||
$('#myModal_new').modal('show');
|
||||
$('.modal-title').text('Nuovo movimento in entrata');
|
||||
$('#form').attr('action', '/admin/movimenti/entrata');
|
||||
$.getJSON("/admin/service/catlistEntrata", {}, function(data) {
|
||||
$.each(data, function(i, item) {
|
||||
$("select[name='mov_fk_categoria']").append(
|
||||
new Option(item.cat_name, item.id)
|
||||
)
|
||||
}
|
||||
);
|
||||
});
|
||||
$.getJSON("/admin/service/taglist", {}, function(data) {
|
||||
$.each(data, function(i, item) {
|
||||
$("select[name='mov_fk_tags']").append(
|
||||
new Option(item.tag_name, item.id)
|
||||
)
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
$(document).on('click', '.open_modal_modifica', function() {
|
||||
var url = "/admin/movimenti/modify";
|
||||
var riga_id = $(this).val();
|
||||
$("#categoria").empty();
|
||||
$("#tags").empty();
|
||||
$.getJSON(url + '/' + riga_id, function(data) {
|
||||
// success data
|
||||
console.log(data[0]);
|
||||
$.getJSON("/admin/service/taglist", {}, function(tags) {
|
||||
$.each(tags, function(i, tag) {
|
||||
$("select[name='mov_fk_tags']").append(
|
||||
new Option(tag.tag_name, tag.id)
|
||||
)
|
||||
$('#tags')
|
||||
.find('option:contains(' + data[0].tag_name + ')')
|
||||
.prop('selected', true)
|
||||
.trigger('change');
|
||||
});
|
||||
});
|
||||
$.getJSON("/admin/service/catlist", {}, function(cats) {
|
||||
$.each(cats, function(i, cat) {
|
||||
$("select[name='mov_fk_categoria']").append(
|
||||
new Option(cat.cat_name, cat.id)
|
||||
)
|
||||
$('#categoria')
|
||||
.find('option:contains(' + data[0].cat_name + ')')
|
||||
.prop('selected', true)
|
||||
.trigger('change');
|
||||
}
|
||||
);
|
||||
});
|
||||
$('.modal-title').text('Modifica movimento');
|
||||
$('#data').val(data[0].mov_data);
|
||||
$('#descrizione').val(data[0].mov_descrizione);
|
||||
$('#importo').val(data[0].mov_importo);
|
||||
|
||||
$('#myModal').modal('show');
|
||||
// $('.panel-heading').text('Modifica movimento');
|
||||
$('#form').attr('action', '/admin/movimenti/modify');
|
||||
$('#form').append('<input type="hidden" name="id" value="' + riga_id + '">');
|
||||
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
/*
|
||||
|
||||
$.getJSON("/admin/service/taglist", {}, function(data) {
|
||||
$.each(data, function(i, item) {
|
||||
$("select[name='mov_fk_tags']").append(
|
||||
new Option(item.tag_name, item.id)
|
||||
)
|
||||
});
|
||||
});
|
||||
|
||||
*/
|
||||
Reference in New Issue
Block a user