update new Datatable
This commit is contained in:
parent
5cb2bb142b
commit
eb028d1783
@ -31,7 +31,7 @@
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
<table class="table table-sm" id="bookings" cellspacing="0"></table>
|
||||
<table class="table table-sm table-striped" id="bookings" cellspacing="0"></table>
|
||||
</div>
|
||||
<div class="col-xxl-4 col-12 d-none d-xxl-block">
|
||||
<div class="text-white-50"><h2>Aktuelle Kontostände</h2></div>
|
||||
|
||||
@ -35,21 +35,21 @@
|
||||
</header>
|
||||
<?= $this->renderSection('content') ?>
|
||||
<div class="modal" id="mymodal" tabindex="-1">
|
||||
<div class="modal-dialog modal-dialog-centered">
|
||||
<div class="modal-content">
|
||||
<div class="modal-body">
|
||||
<h5 class="modal-title"></h5>
|
||||
<p>Wirklich löschen?</p>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Abbruch</button>
|
||||
<button type="button" id="modal_ok" class="btn btn-primary">Löschen</button>
|
||||
<div class="modal-dialog modal-dialog-centered">
|
||||
<div class="modal-content">
|
||||
<div class="modal-body">
|
||||
<h5 class="modal-title"></h5>
|
||||
<p>Wirklich löschen?</p>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Abbruch</button>
|
||||
<button type="button" id="modal_ok" class="btn btn-primary">Löschen</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- <script src="/assets/vendors/perfect-scrollbar/perfect-scrollbar.min.js"></script>
|
||||
<script src="/assets/js/bootstrap.bundle.min.js"></script> -->
|
||||
<script src="/assets/jquery-3.6.4.min.js" type="text/javascript"></script>
|
||||
|
||||
@ -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('<a class="btn-sm btn-secondary mx-2" href="/newBill" role="button">Neue Rechnung</a><a class="btn-sm btn-secondary" href="/newTransfer" role="button">Neuer Transfer</a>');
|
||||
// $("div.toolbar").html('<a class="btn-sm btn-secondary mx-2" href="/newBill" role="button">Neue Rechnung</a><a class="btn-sm btn-secondary" href="/newTransfer" role="button">Neuer Transfer</a>');
|
||||
$('#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');});
|
||||
|
||||
78
public/js/stopuhr.js
Normal file
78
public/js/stopuhr.js
Normal file
@ -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);
|
||||
}
|
||||
}
|
||||
@ -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
|
||||
|
||||
@ -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');
|
||||
|
||||
@ -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('<a class="btn-sm btn-secondary" href="/newBill" role="button">Neuer Eintrag</a>');
|
||||
// $("div.toolbar").html('<a class="btn-sm btn-secondary" href="/newBill" role="button">Neuer Eintrag</a>');
|
||||
// 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('<a class="btn-sm btn-secondary" href="/syncScheduled" role="button">Sync</a>');
|
||||
// $("div.syncbutton").html('<a class="btn-sm btn-secondary" href="/syncScheduled" role="button">Sync</a>');
|
||||
// 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);});
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user