110 lines
4.7 KiB
PHP
110 lines
4.7 KiB
PHP
<?php
|
|
/**
|
|
* /subs/admin.php
|
|
* @version 1.4
|
|
* @desc Admin tools
|
|
* @author Fándly Gergő Zoltán (fandlygergo@gmail.hu, systemtest.tk)
|
|
* @copy 2017 Fándly Gergő Zoltán
|
|
* License:
|
|
Result Manager for managing results of students in bilingual school systems.
|
|
Copyright (C) 2017 Fándly Gergő Zoltán
|
|
|
|
This program is free software: you can redistribute it and/or modify
|
|
it under the terms of the GNU General Public License as published by
|
|
the Free Software Foundation, either version 3 of the License, or
|
|
(at your option) any later version.
|
|
|
|
This program is distributed in the hope that it will be useful,
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
GNU General Public License for more details.
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
**/
|
|
|
|
?>
|
|
|
|
<div class="selfcenter">
|
|
<!-- import users -->
|
|
<div class="dropdown selfcenter" style="width: 95%" id="dd_filter">
|
|
<div class="dropdown header">
|
|
<a onclick="toggleDropdown('#dd_import_content', '#dd_import_img')">
|
|
<img class="icon" src="./res/plus.png" alt="plusminus" id="dd_import_img">
|
|
<span><?php echo $lang['importUsers'] ?></span>
|
|
</a>
|
|
</div>
|
|
<div class="dropdown content" id="dd_import_content">
|
|
<form method="POST" class="ajaxform" id="dd_import_form" onsubmit="adminImportUsers()">
|
|
<p><?php echo $lang['importnotes'] ?></p>
|
|
<input type="file" name="csv" id="csvFile" accept="text/csv" required>
|
|
<hr>
|
|
<button type="submit" form="dd_import_form"><?php echo $lang['ok'] ?></button>
|
|
</form>
|
|
<div id="statuses">
|
|
<div id="status_fileTooBig" style="display: none">
|
|
<img class="icon" src="./res/remove.png" alt="error">
|
|
<span><?php echo $lang['error'][11] ?></span>
|
|
</div>
|
|
<div id="status_uploading" style="display: none">
|
|
<p><?php echo $lang['uploading']."..." ?></p>
|
|
<div class="progressbar" id="uploadStatus" style="width: 90%; margin: auto">
|
|
<div style="width: 0%">
|
|
<span>0%</span>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div id="status_uploadError" style="display: none">
|
|
<img class="icon" src="./res/remove.png" alt="error">
|
|
<span><?php echo $lang['error'][12] ?></span>
|
|
</div>
|
|
<div id="status_processing" style="display: none">
|
|
<p><?php echo $lang['processing']."..." ?></p>
|
|
<div class="progressbar" id="processStatus" style="width: 90%; margin: auto">
|
|
<div style="width: 0%">
|
|
<span>0%</span>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div id="status_done" style="display: none">
|
|
<p><?php echo $lang['importdone'] ?></p>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<hr class="placeholder">
|
|
<!-- database stats -->
|
|
<div class="dropdown selfcenter" style="width: 95%" id="dd_filter">
|
|
<div class="dropdown header">
|
|
<a onclick="toggleDropdown('#dd_dbsize_content', '#dd_dbsize_img')">
|
|
<img class="icon" src="./res/plus.png" alt="plusminus" id="dd_dbsize_img">
|
|
<span><?php echo $lang['dbsize'] ?></span>
|
|
</a>
|
|
</div>
|
|
<div class="dropdown content" id="dd_dbsize_content">
|
|
<table class="table">
|
|
<thead>
|
|
<tr>
|
|
<th><?php echo $lang['dbname'] ?></th>
|
|
<th><?php echo $lang['size'] ?></th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<?php
|
|
$sql=$db->prepare("SELECT table_schema AS dbname, ROUND(SUM(data_length+index_length)/1024/1024, 2) AS size FROM information_schema.tables GROUP BY table_schema");
|
|
$sql->execute();
|
|
while($row=$sql->fetch(PDO::FETCH_ASSOC)){
|
|
echo "
|
|
<tr>
|
|
<td>".$row['dbname']."</td>
|
|
<td>".$row['size']." MB</td>
|
|
</tr>
|
|
";
|
|
}
|
|
?>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
</div>
|