diff --git a/app/Views/activities.php b/app/Views/activities.php index f285088..80d0da5 100644 --- a/app/Views/activities.php +++ b/app/Views/activities.php @@ -31,7 +31,7 @@ -
+

Aktuelle Kontostände

diff --git a/app/Views/layout.php b/app/Views/layout.php index f766515..d98d6e3 100644 --- a/app/Views/layout.php +++ b/app/Views/layout.php @@ -35,21 +35,21 @@ renderSection('content') ?> -
diff --git a/public/js/activities.js b/public/js/activities.js index 7391bc1..f366f41 100644 --- a/public/js/activities.js +++ b/public/js/activities.js @@ -19,7 +19,20 @@ $(document).ready(function(){ d.source = $('#source').val(); }, dataSrc:''}, - dom: '<"toolbar">frt', + layout: { + topStart: { + buttons: [ + {text:'Neu Rechnung',className:'btn-sm',action: function ( e, dt, node, config ) { + location.href = '/newBill/'; + }}, + {text:'Neuer Transfer',className:'btn-sm mx-2',action: function ( e, dt, node, config ) { + location.href = '/newTransfer/'; + }}, + ] + }, + topEnd: 'search' + }, +// dom: '<"toolbar">frt', "createdRow": function ( row, data, index ) { if(data.validate == "t"){ $(row).addClass('text-bg-warning'); @@ -28,7 +41,7 @@ $(document).ready(function(){ columns: colomnspez, }); - $("div.toolbar").html('Neue RechnungNeuer Transfer'); +// $("div.toolbar").html('Neue RechnungNeuer Transfer'); $('#bookings tbody').on('click', 'td.dt-receiver', function () {collapseDetails($(this), datatable);} ); $('#bookings tbody').on('click', 'td.dt-datum', function () {location.href = '/editBill/'+getId($(this),datatable);}); $('#bookings tbody').on('click', 'table.tabdet', function () {location.href = '/editBill/'+$(this).attr('data-bs-id');}); diff --git a/public/js/stopuhr.js b/public/js/stopuhr.js new file mode 100644 index 0000000..6a30750 --- /dev/null +++ b/public/js/stopuhr.js @@ -0,0 +1,78 @@ +let startBtn = document.getElementById('start'); +let stopBtn = document.getElementById('stop'); +let resetBtn = document.getElementById('reset'); + +let hour = 0; +let minute = 0; +let second = 0; +let count = 0; + +startBtn.addEventListener('click', function () { + timer = true; + stopWatch(); +}); + +stopBtn.addEventListener('click', function () { + timer = false; +}); + +resetBtn.addEventListener('click', function () { + timer = false; + hour = 0; + minute = 0; + second = 0; + count = 0; + document.getElementById('hr').innerHTML = "00"; + document.getElementById('min').innerHTML = "00"; + document.getElementById('sec').innerHTML = "00"; + document.getElementById('count').innerHTML = "00"; +}); + +function stopWatch() { + if (timer) { + count++; + + if (count == 100) { + second++; + count = 0; + } + + if (second == 60) { + minute++; + second = 0; + } + + if (minute == 60) { + hour++; + minute = 0; + second = 0; + } + + let hrString = hour; + let minString = minute; + let secString = second; + let countString = count; + + if (hour < 10) { + hrString = "0" + hrString; + } + + if (minute < 10) { + minString = "0" + minString; + } + + if (second < 10) { + secString = "0" + secString; + } + + if (count < 10) { + countString = "0" + countString; + } + + document.getElementById('hr').innerHTML = hrString; + document.getElementById('min').innerHTML = minString; + document.getElementById('sec').innerHTML = secString; + document.getElementById('count').innerHTML = countString; + setTimeout(stopWatch, 10); + } +} diff --git a/public/js/tab_accounts.js b/public/js/tab_accounts.js index d01cb14..d805bb7 100644 --- a/public/js/tab_accounts.js +++ b/public/js/tab_accounts.js @@ -2,11 +2,12 @@ var accounts; $(document).ready(function(){ accounts = $('#accounts').DataTable({ paging: false, - searching:false, + searching:true, scrollX:false, info:false, ajax: { url: '/Ajax/getAccountsBalance', dataSrc:''}, - dom: '<"toolbar">frtip', + layout: { topEnd: 'search' }, +// dom: '<"toolbar">frtip', columns: [ { title: "Konto",orderable:false, data: "description",className:"dt-receiver" }, colBetrag diff --git a/public/js/tables.js b/public/js/tables.js index 7c0b76d..faba663 100644 --- a/public/js/tables.js +++ b/public/js/tables.js @@ -134,7 +134,7 @@ $(document).ready(function(){ myModal.addEventListener('show.bs.modal', function (event) { var button = event.relatedTarget; table = button.closest('table').id; // table row ID - var id = button.getAttribute('data-bs-id'); + var id = button.getAttribute('data-bs-id'); myModal.setAttribute('data-bs-id',id); myModal.setAttribute('data-bs-table',table); var modalTitle = myModal.querySelector('.modal-title'); diff --git a/public/js/tabs_overview.js b/public/js/tabs_overview.js index edae836..9686fc1 100644 --- a/public/js/tabs_overview.js +++ b/public/js/tabs_overview.js @@ -9,10 +9,20 @@ $(document).ready(function(){ info:false, order: [[ 1, 'desc' ]], ajax: { url: '/Ajax/getOverviewData', dataSrc:''}, - dom: '<"toolbar">frt', + layout: { + topStart: { + buttons: [ + {text:'Neue Rechnung',className:'btn-sm',action: function ( e, dt, node, config ) { + location.href = '/newBill/'; + }}, + ] + }, + topEnd: 'search' + }, +// dom: '<"toolbar">frt', columns: columns, }); - $("div.toolbar").html('Neuer Eintrag'); +// $("div.toolbar").html('Neuer Eintrag'); // Add event listener for opening and closing details $('#bookings tbody').on('click', 'td.dt-receiver', function () {collapseDetails($(this), datatable);} ); $('#bookings tbody').on('click', 'td.dt-datum', function () {location.href = '/editBill/'+getId($(this),datatable);}); @@ -25,10 +35,20 @@ $(document).ready(function(){ info:true, order: [[ 1, 'desc' ]], ajax: { url: '/Ajax/getToDosData', dataSrc:''}, - dom: '<"top"i<"syncbutton">>frt<"bottom"lp><"clear">', + layout: { + topStart: { + buttons: [ + {text:'Sync',className:'btn-sm',action: function ( e, dt, node, config ) { + location.href = '/syncScheduled/'; + }}, + ] + }, + topEnd: 'search' + }, +// dom: '<"top"i<"syncbutton">>frt<"bottom"lp><"clear">', columns: columns, }); - $("div.syncbutton").html('Sync'); +// $("div.syncbutton").html('Sync'); // Add event listener for opening and closing details $('#todos tbody').on('click', 'td.dt-receiver', function () {collapseDetails($(this), todos);} ); $('#todos tbody').on('click', 'td.dt-datum', function () {location.href = '/editBill/'+getId($(this),todos);});