/
materialeZona.php
executable file
·117 lines (100 loc) · 3.79 KB
/
materialeZona.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
<?php
include('php/session.php');
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- The above 3 meta tags *must* come first in the head; any other head content must come *after* these tags -->
<meta name="description" content="">
<meta name="author" content="">
<link rel="icon" href="../../favicon.ico">
<meta name="theme-color" content="#0d3c55">
<title>Materiale</title>
<link href="dist/css/bootstrap.min.css" rel="stylesheet">
<link href="dist/css/customcss.css" rel="stylesheet">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>
<script src="dist/js/bootstrap.min.js"></script>
<link rel="stylesheet" type="text/css" href="dist/css/datatables.min.css"/>
<link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/1.10.13/css/dataTables.bootstrap.min.css"/>
<script type="text/javascript" src="dist/js/datatables.min.js"></script>
<script>
$(document).ready(function($) {
var table = $('#materiali').DataTable( {
responsive:true,
bLengthChange: false,
language: {
"lengthMenu": "Mostra _MENU_ elementi",
"zeroRecords": "Nessun materiale trovato",
"info": "Mostra pagina _PAGE_ di _PAGES_",
"infoEmpty": "Nessun materiale presente",
"infoFiltered": "(filtra al massimo _MAX_ materiali')",
"search": "Cerca:",
"paginate": {
"first": "Prima",
"last": "Ultima",
"next": "Prossima",
"previous": "Precedente"
},
},
columnDefs: [
{
"targets": [ 3 ],
"visible": false,
"searchable": false
}],
columns: [
{ data: 'Nome' },
{ data: 'Descrizione' },
{ data: 'Qta' },
{ data: 'id' },
{ data: 'url',"render": function ( data, type, row, meta ) {
return "<a href='calendar.php?id=" + row['id']+ "'>" + "Apri" + '</a>';}}
]
} );
$.ajax({
url: "php/materialiRetrieve.php",
dataType: "json",
success: function(response){
$.each(response, function (i,o) {
table.row.add({
"Nome": o.Nome,
"Descrizione":o.Descrizione,
"Qta":o.Qta,
"id":o.id,
}).draw();
});
},
error: function(){
alert('errore carico materiali');
}
});
});
</script>
</head>
<body>
<div id="wrapper">
<div id="navbar">
<?php include_once('navbar.php'); ?>
</div>
<div class="container">
<div align="center"><h2 class="sub-header">Materiale di Zona </h2></div>
<div class="table-responsive">
<table class="table table-striped table-hover table-bordered" id = "materiali" name="materiali" cellspacing="0" width="100%">
<thead>
<tr>
<th>Nome</th>
<th>Descrizione</th>
<th>Qta</th>
<th>id</th>
<th>Disponibilita'</th>
</tr>
</thead>
<tbody>
</tbody>
</table>
</div>
</body>
</html>