-
Notifications
You must be signed in to change notification settings - Fork 1
/
categories.php
219 lines (187 loc) · 9.06 KB
/
categories.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
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
<?php
session_start();
if( !isset($_SESSION['typeCompte']) ){
header("Location: login.php");
}else if( $_SESSION['typeCompte'] == 'Client' ){
header("Location: ccs.php");
}
include("config/consts.php");
//fichier de config
$xml = simplexml_load_file("config/parametres.xml");
$theme = $xml->xpath( '/parametres/themes/theme' )[0];
$favicon = $xml->xpath( '/parametres/themes/favicon' )[0];
?>
<!DOCTYPE html>
<html lang="fr">
<!-- Mirrored from foxythemes.net/preview/products/amaretti/tables-datatables.php by HTTrack Website Copier/3.x [XR&CO'2014], Mon, 27 Mar 2017 09:46:57 GMT -->
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
<meta name="description" content="">
<meta name="author" content="">
<title>Catégories</title>
<link rel="icon" href="<?php echo 'assets/img/' . $favicon; ?>" />
<link rel="stylesheet" type="text/css" href="assets/lib/stroke-7/style.css"/>
<link rel="stylesheet" type="text/css" href="assets/lib/jquery.nanoscroller/css/nanoscroller.css"/><!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
<![endif]-->
<?php
if( $theme == "Twilight" )
echo '<link type="text/css" href="assets/css/themes/theme-twilight.css" rel="stylesheet">';
else if( $theme == "Google" )
echo '<link type="text/css" href="assets/css/themes/theme-google.css" rel="stylesheet">';
else if( $theme == "Sunrise" )
echo '<link type="text/css" href="assets/css/themes/theme-sunrise.css" rel="stylesheet">';
else if( $theme == "Cake" )
echo '<link type="text/css" href="assets/css/themes/theme-cake.css" rel="stylesheet">';
else
echo '<link type="text/css" href="assets/css/style.css" rel="stylesheet">';
?>
<link href="assets/lib/datatables/plugins/KeyTable/css/keyTable.dataTables.min.css" rel="stylesheet" />
<link href="assets/lib/datatables/plugins/Scroller/css/scroller.bootstrap.min.css" rel="stylesheet" />
<link href="assets/lib/datatables/plugins/Buttons/css/buttons.dataTables.min.css" rel="stylesheet" />
<link href="assets/lib/datatables/plugins/Select/css/select.dataTables.min.css" rel="stylesheet" />
<link rel="stylesheet" type="text/css" href="assets/lib/datatables/css/dataTables.bootstrap.min.css"/>
</head>
<body>
<div class="am-wrapper">
<?php include("themes/default/top-nav.php"); ?>
<?php include("themes/default/left-sidebar.php"); ?>
<div class="am-content">
<div class="page-head">
<h2>Catégories</h2>
<ol class="breadcrumb">
<li><a href="#">Accueil</a></li>
<li><a href="#">Catalogue</a></li>
<li class="active">Articles</li>
</ol>
</div>
<div class="main-content">
<div class="row">
<div class="col-sm-12">
<div class="widget widget-fullwidth widget-small" style="padding:10px;">
<div class="col-sm-6"><div class="dataTables_length" id="table3_length">
<label>
<select name="table3_length" id="table3_length" aria-controls="table3" class="form-control input-sm" onclick="changeLength()">
<option value="10">10</option>
<option value="25">25</option>
<option value="50">50</option>
<option value="100">100</option>
</select> </label>
</div>
</div>
<table id="table3" class="display table table-striped table-hover table-fw-widget">
<thead>
<tr>
<th>#</th>
<th>Catégorie</th>
<th>Commentaire</th>
</tr>
</thead>
<tbody>
<?php
include("db.php");
$query = "SELECT categorie, commentaire FROM categories ";
//echo $query;
$res = mysql_query( $query );
$n = 1;
while( $i = mysql_fetch_assoc( $res ) ){
echo "<tr>";
echo "<td>" . $n . "</td>";
echo "<td>" . $i['categorie'] . "</td>";
echo "<td>" . $i['commentaire'] . "</td>";
echo "</tr>";
$n++;
}
?>
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
<?php include("themes/default/right-sidebar.php"); ?>
</div>
<script src="assets/lib/jquery/jquery.min.js" type="text/javascript"></script>
<script src="assets/lib/jquery.nanoscroller/javascripts/jquery.nanoscroller.min.js" type="text/javascript"></script>
<script src="assets/js/main.js" type="text/javascript"></script>
<script src="assets/lib/bootstrap/dist/js/bootstrap.min.js" type="text/javascript"></script>
<script src="assets/lib/datatables/js/jquery.dataTables.min.js" type="text/javascript"></script>
<script src="assets/lib/datatables/js/dataTables.bootstrap.min.js" type="text/javascript"></script>
<script src="assets/lib/datatables/plugins/buttons/js/dataTables.buttons.js" type="text/javascript"></script>
<script src="assets/lib/datatables/plugins/buttons/js/buttons.html5.js" type="text/javascript"></script>
<script src="assets/lib/datatables/plugins/buttons/js/buttons.flash.js" type="text/javascript"></script>
<script src="assets/lib/datatables/plugins/buttons/js/buttons.print.js" type="text/javascript"></script>
<script src="assets/lib/datatables/plugins/buttons/js/buttons.colVis.js" type="text/javascript"></script>
<script src="assets/lib/datatables/plugins/buttons/js/buttons.bootstrap.js" type="text/javascript"></script>
<script src="assets/lib/datatables/plugins/KeyTable/js/dataTables.keyTable.min.js"></script>
<script src="assets/lib/datatables/plugins/Scroller/js/dataTables.scroller.min.js"></script>
<script src="assets/lib/datatables/plugins/ColReorder/js/dataTables.colReorder.min.js"></script>
<script src="assets/lib/datatables/plugins/Select/js/dataTables.select.min.js"></script>
<script type="text/javascript">
$(document).ready(function(){
//initialize the javascript
App.init();
//App.dataTables();
$('#table3').DataTable( {
deferRender: true,
scrollCollapse: true,
scroller: true,
scrollY: '450px',
paging: true,
colReorder: true,
info : true,
pageLength : 10,
lengthMenu : [ [10, 25, 50, -1], [10, 25, 50, "All"] ],
//select: { style: 'multi' },
fixedColumns: {
leftColumns: 1
},
keys: true,
dom: 'Bfrtip',
buttons: [
'copy', 'csv', 'excel', 'pdf', 'print'
]
} );
});
function changeLength(){
var nb = $("#table3_length option:selected").val();
if( nb ){
var table = $('#table3').dataTable({
destroy: true,
scrollY: '500px',
paging: true,
colReorder: true,
info : true,
pageLength : nb,
lengthMenu : [ [10, 25, 50, -1], [10, 25, 50, "All"] ],
//select: { style: 'multi' },
fixedColumns: {
leftColumns: 1
},
keys: true,
dom: 'Bfrtip',
buttons: [ 'copy', 'csv', 'excel', 'pdf', 'print' ]
});
table.draw();
}
}
</script>
<script type="text/javascript">
$(document).ready(function(){
App.livePreview();
});
</script>
<script type="text/javascript">
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','../../../../www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-68396117-1', 'auto');
ga('send', 'pageview');
</script>
</body>
<!-- Mirrored from foxythemes.net/preview/products/amaretti/tables-datatables.php by HTTrack Website Copier/3.x [XR&CO'2014], Mon, 27 Mar 2017 09:47:01 GMT -->
</html>