SOFM/index.php

52 lines
1005 B
PHP
Executable File

<?php
session_start();
include("config.php");
function tomb($size, $precision = 2)
{
$base = log($size) / log(1024);
$suffixes = array('', 'KB', 'MB', 'GB', 'TB');
return round(pow(1024, $base - floor($base)), $precision) . $suffixes[floor($base)];
}
$webspace = tomb($config_var[1]);
$max_upload = tomb($config_var[2]);
include_once("header.php");
?>
<div class="navbar">
<?php
if(!isset($_SESSION['hostz-user']) && !isset($_SESSION['hostz-passwd'])) {
?>
<a href="register.php">Register</a>&bull;<a href="login.php">Login</a>
<?php
} else {
?>
<a href="ctrl.php">My Drive</a>&bull;<a href="logout.php">Logout</a>
<?php
}
?>
</div>
<?php
print <<<EOD
<table style="margin:auto;">
<tr>
<td>
<div id="packages">
Web Space: $webspace<br>
Max Upload: $max_upload<br>
</div>
</td>
</tr>
</table>
EOD;
include_once("footer.php");
?>