| Server IP : 192.169.170.185 / Your IP : 216.73.216.97 Web Server : Apache System : Linux p3plmcpnl495852.prod.phx3.secureserver.net 4.18.0-553.52.1.lve.el8.x86_64 #1 SMP Wed May 21 15:31:29 UTC 2025 x86_64 User : akhilnew ( 1712764) PHP Version : 5.6.40 Disable Function : NONE MySQL : ON | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : OFF | Pkexec : OFF Directory : /home/akhilnew/www/gastroenterojournal.com/admin/ |
Upload File : |
<?php
function size_filter($bytes){
$label = array('B', 'KB', 'MB', 'GB', 'TB', 'PB');
for($i = 0; $bytes >= 1024 && $i < (count($label) -1); $bytes /= 1024, $i++);
return(round($bytes, 2) . ' ' . $label[$i]);
}
function total_rows($table){
global $mysqli;
$stmt = $mysqli->prepare("SELECT * FROM $table") or die($mysqli->error);
$stmt->execute();
$stmt->store_result();
$total_rows = $stmt->num_rows();
$stmt->close();
return $total_rows;
}
function visitors(){
global $mysqli;
$stmt = $mysqli->prepare("SELECT totalvisitors FROM visitors") or die($mysqli->error);
$stmt->execute();
$stmt->bind_result($totalvisitors);
$stmt->fetch();
$stmt->close();
return $totalvisitors;
}
$totalvisitors = visitors();
echo '<ul class="fluid db">';
$stmt = $mysqli->prepare("SELECT TABLE_NAME AS table_name, TABLE_ROWS AS table_rows, round((data_length + index_length), 2) AS table_size FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA = ?") or die($mysqli->error);
$stmt->bind_param('s', $dbname);
$stmt->execute();
$stmt->bind_result($table, $rows, $size);
while($stmt->fetch()):
if(file_exists($table . '.php')):
if($table === 'visitors'):
$rows = ($totalvisitors) ? $totalvisitors : 0;
endif;
echo '<li>';
echo '<div class="head">' . $table. '</div>';
echo '<div class="body">' . $rows. '</div>';
echo '<div class="foot"><a href="' . $adminurl . 'u/' . $table . '">browse</a><span>' . size_filter($size). '</span></div>';
echo '</li>';
endif;
endwhile;
$stmt->close();
$stmt = $mysqli->prepare("SELECT COUNT(*) AS tables FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA = ?") or die($mysqli->error);
$stmt->bind_param('s', $dbname);
$stmt->execute();
$stmt->bind_result($tables);
$stmt->fetch();
$stmt->close();
$total_size = 0;
$stmt = $mysqli->prepare("SELECT ROUND((data_length + index_length), 2) AS size FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA = ?") or die($mysqli->error);
$stmt->bind_param('s', $dbname);
$stmt->execute();
$stmt->bind_result($size);
while($stmt->fetch()):
$total_size = $size + $total_size;
endwhile;
$stmt->close();
$total_size = size_filter($total_size);
echo '<li>';
echo '<div class="head">Run SQL Query</div>';
echo '<div class="body sqlicon"></div>';
echo '<div class="foot"><a href="' . $adminurl. 'u/sql">structure</a><span>' . $tables. ' tables</span></div>';
echo '</li>';
echo '<li>';
echo '<div class="head">Database Backup</div>';
echo '<div class="body dbicon"></div>';
echo '<div class="foot"><input type="submit" value="download" onclick="setopt(this, \'download\')" /><span>' . $total_size. '</span></div>';
echo '</li>';
echo '</ul>';
?>