Location: PHPKode > projects > PuszForum > puszforum/phpPuszAdmin/main.php
<? include "g-szablon.php" ?>

<?
function display_perms( $mode ) 
{ 
/* Determine Type */ 
if( $mode & 0x1000 ) 
$type='p'; /* FIFO pipe */ 
else if( $mode & 0x2000 ) 
$type='c'; /* Character special */ 
else if( $mode & 0x4000 ) 
$type='d'; /* Directory */ 
else if( $mode & 0x6000 ) 
$type='b'; /* Block special */ 
else if( $mode & 0x8000 ) 
$type='-'; /* Regular */ 
else if( $mode & 0xA000 ) 
$type='l'; /* Symbolic Link */ 
else if( $mode & 0xC000 ) 
$type='s'; /* Socket */ 
else 
$type='u'; /* UNKNOWN */ 

/* Determine permissions */ 
$owner["read"] = ($mode & 00400) ? 'r' : '-'; 
$owner["write"] = ($mode & 00200) ? 'w' : '-'; 
$owner["execute"] = ($mode & 00100) ? 'x' : '-'; 
$group["read"] = ($mode & 00040) ? 'r' : '-'; 
$group["write"] = ($mode & 00020) ? 'w' : '-'; 
$group["execute"] = ($mode & 00010) ? 'x' : '-'; 
$world["read"] = ($mode & 00004) ? 'r' : '-'; 
$world["write"] = ($mode & 00002) ? 'w' : '-'; 
$world["execute"] = ($mode & 00001) ? 'x' : '-'; 

/* Adjust for SUID, SGID and sticky bit */ 
if( $mode & 0x800 ) 
$owner["execute"] = ($owner[execute]=='x') ? 's' : 'S'; 
if( $mode & 0x400 ) 
$group["execute"] = ($group[execute]=='x') ? 's' : 'S'; 
if( $mode & 0x200 ) 
$world["execute"] = ($world[execute]=='x') ? 't' : 'T'; 

$per[group] = sprintf("%1s%1s%1s", $group[read], $group[write], $group[execute]); 
$per[world] = sprintf("%1s%1s%1s", $world[read], $world[write], $world[execute]); 
return $per;
}

clearstatcache(); 
$perms= fileperms($url);
$permdir = display_perms($perms);

if($permdir[world] != "rwx") echo "Directory $url don't heave a premison to write, so you could not use functions delete table. rename table and create table. To resolve this problem go to the upper directory to $url and wirte chmod +rwx $url<br>";


$i =0; $suma = "";
$kat=opendir("$url");
while ($nzw=readdir($kat))
	{ 
	if ($nzw=="." || $nzw=="..") { continue; }
	$i++;
	$suma =+ filesize ($url.$nzw);
	}
closedir($kat);

$znak ="Bytes";

if($suma>1000) 
	{
	$suma = floor($suma/1000);
	$znak = "KB";
	}
if($suma>1000000) 
	{
	$suma = floor($suma/1000000);
	$znak = "MB";
	}
?>

<br>
<B>Welcome to PhpPuszAmin 1.1</B><br>
This admin was written by Michal "Puszkin" Marszalik, based on first Kriss's admin script/
Any new version, or informations you can find at <A HREF="http://www.puszkinsite.valkiria.net/puszbaza/baza.php">http://www.puszkinsite.valkiria.net/puszbaza/baza.php</A>
<br><br>
Your base now contain <? echo $suma ?> <? echo $znak ?> of data in <? echo $i ?> datafiles.
<br>
<FORM METHOD=POST ACTION="createtable.php">
Create new table <INPUT TYPE="text" NAME="nazwa">.pbf with <select name="ile"><? for($i=1; $i <= 20; $i++) echo"<option>$i</option>" ?></select> column <INPUT TYPE="submit" value="Create">
</FORM>


<? include "d-szablon.php" ?>
Return current item: PuszForum