diff --git a/front/maintenance.php b/front/maintenance.php index 1171a54a..96592d1b 100755 --- a/front/maintenance.php +++ b/front/maintenance.php @@ -118,6 +118,30 @@ if (isset($_POST['submit']) && submit && isset($_POST['skinselector_set'])) { } } } +// Table sizes ----------------------------------------------------------------- + +$tableSizesHTML = ""; + +// Open a connection to the SQLite database +$db = new SQLite3($pia_db); + +// Retrieve the table names from sqlite_master +$query = "SELECT name FROM sqlite_master WHERE type='table'"; +$result = $db->query($query); + +// Iterate over the tables and get the row counts +while ($row = $result->fetchArray(SQLITE3_ASSOC)) { + $tableName = $row['name']; + $query = "SELECT COUNT(*) FROM $tableName"; + $countResult = $db->querySingle($query); + $tableSizesHTML = $tableSizesHTML . "$tableName ($countResult), "; +} + +// Close the database connection +$db->close(); + + + // Language selector ----------------------------------------------------------------- @@ -150,7 +174,13 @@ if (isset($_POST['submit']) && submit && isset($_POST['skinselector_set'])) {
-
+ + +
+
+
+ +
diff --git a/front/php/server/db.php b/front/php/server/db.php index 69a9a4bd..04751fbe 100755 --- a/front/php/server/db.php +++ b/front/php/server/db.php @@ -65,7 +65,7 @@ function OpenDB (...$DBPath) { die ('
Error connecting to the database
'); } - $db->exec('PRAGMA journal_mode = wal;'); + $db->exec('PRAGMA journal_mode = wal;'); } diff --git a/front/php/templates/language/en_us.php b/front/php/templates/language/en_us.php index ce25fa86..3e8a1458 100755 --- a/front/php/templates/language/en_us.php +++ b/front/php/templates/language/en_us.php @@ -250,11 +250,12 @@ $lang['en_us'] = array( ////////////////////////////////////////////////////////////////// 'Maintenance_Title' => 'Maintenance tools', -'Maintenance_version' => 'Application updates', +'Maintenance_version' => 'App updates', 'Maintenance_new_version' => '🆕 A new version is available. Check out the release notes.', 'Maintenance_current_version' => 'You are up-to-date. Check out what I\'m working on.', 'Maintenance_database_path' => 'Database-Path', 'Maintenance_database_size' => 'Database-Size', +'Maintenance_database_rows' => 'Table (Rows)', 'Maintenance_database_lastmod' => 'Last Modification', 'Maintenance_database_backup' => 'DB Backups', 'Maintenance_database_backup_found' => 'backups were found',