-
Notifications
You must be signed in to change notification settings - Fork 0
/
usersTable.php
101 lines (93 loc) · 3.25 KB
/
usersTable.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
<?php
/**
* Created by PhpStorm.
* User: Radon
* Date: 06.01.2019
* Time: 23:17
*/
session_start();
if (!empty($_SESSION['log']) && $_SESSION['log'] == 'logged') {
if( !($_SESSION['level'] == 'regs' || $_SESSION['level'] == 'admin' || $_SESSION['level'] == 'root') ){
header("refresh:0 url=error.php");die();
}
}else{
header("refresh:0 url=index.php");
die();
}
include_once 'mysqlConnector.php';
/*news*/
$dataNews = $mysqli->query("SELECT * FROM $base.news");
$dataUsersAll = $mysqli->query("SELECT * FROM $base.user");
?>
<!DOCTYPE html>
<html lang="en">
<?php include_once 'header.php'?>
<body>
<div class="bodyContent">
<?php include_once 'topmenu.php'?>
<?php include_once 'leftmenu.php'?>
<div class="main">
<!--block for dataTable-->
<div class="block">
<div class="blockTitle">
Registration
</div>
<div class="blockContent" style="padding-bottom: 70px" >
<table id="example" class="display" style="width:100%">
<thead>
<tr>
<th>ID</th>
<th>Name</th>
<th>Region</th>
<th>Balance</th>
<th>Tel</th>
<th>Reg-date</th>
<th>card number</th>
<th>child</th>
<th>passport</th>
</tr>
</thead>
<tbody>
<?php while ($rowUserdata = $dataUsersAll ->fetch_assoc()){
if($rowUserdata['level'] != 'user'){continue;}?>
<tr>
<td><?echo $rowUserdata['id']?></td>
<td><?echo "{$rowUserdata['name']} {$rowUserdata['surname']}"?></td>
<td><?echo $rowUserdata['region']?></td>
<td><?echo $rowUserdata['balance']?></td>
<td><?echo $rowUserdata['tel']?></td>
<td><?echo $rowUserdata['regdate']?></td>
<td><?echo $rowUserdata['cardnumber']?></td>
<td><?echo $rowUserdata['childnumber']?></td>
<td><?echo $rowUserdata['passport']?></td>
</tr>
<?php }?>
</tbody>
<tfoot>
<tr>
<th>ID</th>
<th>Name</th>
<th>Region</th>
<th>Balance</th>
<th>Tel</th>
<th>Reg-date</th>
<th>card number</th>
<th>child</th>
<th>passport</th>
</tr>
</tfoot>
</table>
</div>
</div>
</div>
</div>
</body>
<script src="js/datatables.min.js"></script>
<script>
$(document).ready(function() {
$('#example').DataTable({
"order": [[ 0, "desc" ]]
});
} );
</script>
</html>