Skip to content

Commit

Permalink
Datatables upgrade
Browse files Browse the repository at this point in the history
  • Loading branch information
pavlosb committed May 28, 2024
1 parent 67cc11c commit a04b87a
Show file tree
Hide file tree
Showing 2 changed files with 53 additions and 13 deletions.
14 changes: 12 additions & 2 deletions application/views/header.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<!doctype html>
<html lang="en">
<head>
<title>ITIN</title>
<!-- Required meta tags -->
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
Expand All @@ -10,16 +11,25 @@
<link rel="stylesheet" href="<?php echo base_url(); ?>assets/css/all.min.css">
<link rel="stylesheet" href="<?php echo base_url(); ?>assets/css/formValidation.min.css">
<link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/v/bs4/dt-1.10.18/r-2.2.2/rg-1.1.0/datatables.min.css"/>
<link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/2.0.7/css/dataTables.bootstrap4.css"/>
<link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/buttons/3.0.2/css/buttons.bootstrap4.min.css"/>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/tempusdominus-bootstrap-4/5.0.0-alpha14/css/tempusdominus-bootstrap-4.min.css" />
<link type="text/css" rel="stylesheet" href="<?php echo base_url(); ?>assets/css/featherlight.css" />
<link type="text/css" rel="stylesheet" href="<?php echo base_url(); ?>assets/css/featherlight.gallery.css" />
<link rel="stylesheet" href="<?php echo base_url(); ?>assets/css/custom.css">
<script src="<?php echo base_url(); ?>assets/js/jquery-3.3.1.min.js"></script>
<script src="<?php echo base_url(); ?>assets/js/webcam.min.js"></script>
<script src="<?php echo base_url(); ?>assets/js/qrcode.min.js"></script>
<script type="text/javascript" src="https://cdn.datatables.net/v/bs4/dt-1.10.18/r-2.2.2/rg-1.1.0/datatables.min.js"></script>
<script type="text/javascript" src="https://cdn.datatables.net/2.0.7/js/dataTables.js"></script>
<script type="text/javascript" src="https://cdn.datatables.net/2.0.7/js/dataTables.bootstrap4.js"></script>
<!--<script type="text/javascript" src="https://cdn.datatables.net/v/bs4/dt-1.10.18/r-2.2.2/rg-1.1.0/datatables.min.js"></script> -->
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.29.2/moment.min.js"></script>
<title>ITIN</title>
<script type="text/javascript" src="https://cdn.datatables.net/buttons/3.0.2/js/dataTables.buttons.js"></script>
<script type="text/javascript" src="https://cdn.datatables.net/buttons/3.0.2/js/buttons.bootstrap4.min.js"></script>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/jszip/3.10.1/jszip.min.js"></script>
<script type="text/javascript" src="https://cdn.datatables.net/buttons/3.0.2/js/buttons.html5.min.js"></script>
<script type="text/javascript" src="https://cdn.datatables.net/buttons/3.0.2/js/buttons.print.min.js"></script>

</head>
<body>
<div class="content">
Expand Down
52 changes: 41 additions & 11 deletions application/views/inspectionslist.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,22 +61,52 @@
</div>
</div>
<script>
$(document).ready(function() {
$("#spinner").removeClass("d-flex").hide();
$('.prep').hide();
var ulang = '<?= ucfirst($user_lang) ?>';
var ulang = '<?= ucfirst($user_lang) ?>';
const date = new Date();

$('#inspectlist').DataTable({
"language": {
"url": "//cdn.datatables.net/plug-ins/1.10.19/i18n/"+ ulang +".json"
let day = date.getDate();
let month = date.getMonth() + 1;
let year = date.getFullYear();

// This arrangement can be altered based on how we want the date's format to appear.
let currentDate = day + '-' + month + '-' + year;
new DataTable('#inspectlist', {
layout: {
topStart: {
buttons: [{
extend: 'excel',
className: 'btn btn-success',
filename: "itin-inspection_list_"+currentDate,
title: "ITIN - Κατάλογος Επιθεωρήσεων",
exportOptions: {
modifier: {
page: 'current'
},

}
}, 'print'],

}, bottomStart: 'pageLength'
},
order: [[1, 'desc']],
language: {
url: "//cdn.datatables.net/plug-ins/1.10.19/i18n/"+ ulang +".json"
},
"stateSave": true,
"columnDefs": [
{"searchable": false, "orderable": false, "targets": 6 }
stateSave: true,
columnDefs: [
{searchable: false, orderable: false, targets: [4,5,6] },
{targets: 1, render: DataTable.render.date('YYYY-MM-DD', 'DD-MM-YYYY', 'el')}
],
"lengthMenu": [ 25, 50, 100 ]
lengthMenu: [ 25, 50, 100 ]
});

$(document).ready(function() {
$("#spinner").removeClass("d-flex").hide();
$('.prep').hide();





$( ".createrpt" ).click(function() {
var inspid =$(this).data("inspid");
Expand Down

0 comments on commit a04b87a

Please sign in to comment.