-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathbaza_danych.php
More file actions
128 lines (104 loc) · 3.27 KB
/
baza_danych.php
File metadata and controls
128 lines (104 loc) · 3.27 KB
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
<?php
//--- dolaczenie plikow
if(file_exists('config.php')) {
include('config.php');
include('inc/baza_polacz.php');
}
include('funkcje/funkcje.php');
include('funkcje/funkcje_odczytu.php');
include("inc/sesje.php");
?>
<!doctype html>
<html lang="pl">
<head>
<?php
//--- dolaczenie plikow
include('inc/head.php');
?>
</head>
<body>
<?php
//--- dolaczenie plikow
if(file_exists('config.php')) {
include('inc/menu.php');
include('inc/baner.php');
include('operacje/!_spis.php');
include('inc/pole_alerts.php');
}
?>
<?php
if(file_exists('config.php')) {
//zainstalowany
?>
<div class="container tresc">
<?php
if(isset($_SESSION['sesja_uzyt']['zalogowany'])){
?>
<div class="page-header">
<h1>Baza Danych <span></span></h1>
</div>
<?php
$stmt = $db->query("SHOW TABLE STATUS FROM ".NAZWA_BAZY."");
echo
<div class="table-responsive">
<table class="table table-striped table-hover small table-sm">
<tr>
<th>Name</th> <th>Rows</th> <th>Avg_row_length</th> <th>Data_length</th> <th>Index_length</th> <th>Auto_increment</th> <th>Create_time</th> <th>Update_time</th>
</tr>';
while($wiersz = $stmt->fetch(PDO::FETCH_ASSOC)){
$suma_rows += $wiersz['Rows'];
$suma_Avg_row_length += $wiersz['Avg_row_length'];
$suma_Data_length += $wiersz['Data_length'];
$suma_Index_length += $wiersz['Index_length'];
$suma_wielkosci += $wiersz['Data_length'] + $wiersz['Index_length'];
echo
<tr>
<td><span class="text-muted">'.$wiersz['Name'].'</td> <td><span class="text-muted">'.$wiersz['Rows'].'</span></td> <td><span class="text-muted">'.formatSize($wiersz['Avg_row_length']).'</span></td> <td><span class="text-muted">'.formatSize($wiersz['Data_length']).'</span></td> <td><span class="text-muted">'.formatSize($wiersz['Index_length']).'</span></td> <td><span class="text-muted">'.$wiersz['Auto_increment'].'</span></td> <td><span class="text-muted">'.$wiersz['Create_time'].'</span></td> <td><span class="text-muted">'.$wiersz['Update_time'].'</span></td>
</tr>';
}
echo
<tr>
<th>suma:</th> <th>'.$suma_rows.'</th> <th>'.formatSize($suma_Avg_row_length).'</th> <th>'.formatSize($suma_Data_length).'</th> <th>'.formatSize($suma_Index_length).'</th> <th></th> <th></th> <th></th>
</tr>
<tr>
<th colspan="3">wielkość Bazy:</th> <th>'.formatSize($suma_wielkosci).'</th> <th></th> <th></th> <th></th> <th></th>
</tr>
</table>
</div>
';
?>
<hr />
<p>
<button class="btn btn-primary" type="button" data-toggle="collapse" data-target="#collapseExample" aria-expanded="false" aria-controls="collapseExample">
<i class="material-icons">live_help</i> Pomoc
</button>
</p>
<div class="collapse" id="collapseExample">
<div class="card card-body">
Zakładka techniczna, dzięki niej można poznać nazwy tabel w Bazie Danych, ich wielkość, ilość rekordów itp.
</div>
</div>
</div>
<?php
}else{
include('inc/form_logowania.php');
}
?>
</div>
<?php
if(isset($_SESSION['sesja_uzyt']['zalogowany'])){
include('inc/zalogowany_jako.php');
}
}else{
//instalacja
include('instalacja/index.php');
}
?>
<?php
if(file_exists('config.php')) {
include('inc/stopka.php');
}
include('inc/stopka_bootstrap.php');
?>
</body>
</html>