<div><a href='manual.html'>Manual</a> - <A href="mailto:zkara@users.sourceforge.net?Cc=dennis@nnsolutions.nl&subject=Navigator class">Suggestions or bugs ?</a></div><hr>
<?php
#
# Example to use Navigator class
#
include "class.navigator.php";
$base="..";
if($_GET[browse]!="") $base=urldecode($_GET[browse]);
$obj= new Navigator($base);
$obj->SortListD($_GET[sortby],$_GET[sortdir]);
$obj->SortListF($_GET[sortby],$_GET[sortdir]);
echo "<h3>Browsing : <u>".$obj->Pwd()."</u> <i>size : ".$obj->ConvertSize($obj->GetDirSize($obj->Pwd()))." </i></h3>" ;
echo "<table border=1>";
echo "<tr><td colspan=6>Total Directories :".$obj->Count("d")."</td></tr>";
while($obj->NextDir())
{
echo "<tr>";
echo "<td><a href=\"$_SERVER[PHP_SELF]?browse=".urlencode($base."/$obj->FieldName")."\" >$obj->FieldName</a></td>";
echo "<td>".$obj->FieldDate."</td>";
echo "<td>".$obj->FieldSize."</td>";
echo "<td>".$obj->FieldPerms."</td>";
echo "<td>".$obj->FieldOwner."</td>";
echo "<td>".$obj->FieldGroup."</td>";
echo "</tr>";
}
echo "</table>";
echo "<br>";
echo "<table border=1>";
echo "<tr><td colspan=6>Total Files :".$obj->Count("f")."</td></tr>";
while($obj->NextFile())
{
echo "<tr>";
echo "<td>".$obj->FieldName."</td>";
echo "<td>".$obj->FieldDate."</td>";
echo "<td>".$obj->FieldSize."</td>";
echo "<td>".$obj->FieldPerms."</td>";
echo "<td>".$obj->FieldOwner."</td>";
echo "<td>".$obj->FieldGroup."</td>";
echo "</tr>";
}
echo "</table>";
?>
<FORM ACTION="<?php echo $_SERVER[PHP_SELF];?>" METHOD="GET">
<SELECT name=sortby>
<option VALUE=N>By name</option>
<option VALUE=D>By Date</option>
<option VALUE=S>By Size</option>
</SELECT>
<SELECT name=sortdir>
<option VALUE=ASC>Asc</option>
<option VALUE=DESC>Desc</option>
</SELECT>
<INPUT TYPE=submit value=Sort>
<INPUT TYPE=hidden name=browse value=<?php echo $_GET[browse]?>>
</FORM>
|