avec le bon chemin, ça ira mieux ;-)
[old-projects.git] / depview / list.php
index cd1ee4b..38106b0 100644 (file)
@@ -1,6 +1,8 @@
 <?php
 require("config.inc.php");
 require("header.inc.php");
+
+$order = isset($_REQUEST['order']) ? $_REQUEST['order'] : "p";
 switch ($order) {
   case "i":
     $sql_suffix = "order by id";
@@ -9,7 +11,6 @@ switch ($order) {
     $sql_suffix = "order by type";
     break;
   case "p":
-  default:
     $sql_suffix = "order by path";
     break;
 }
@@ -17,19 +18,19 @@ switch ($order) {
 
 <table>
 <tr>
-  <th><a href="<?php echo $PHP_SELF; ?>?order=i">id</a></th>
-  <th><a href="<?php echo $PHP_SELF; ?>?order=t">type</a></th>
-  <th><a href="<?php echo $PHP_SELF; ?>?order=p">path</a></th>
+  <th><a href="<?php echo $_SERVER['PHP_SELF']; ?>?order=i">id</a></th>
+  <th><a href="<?php echo $_SERVER['PHP_SELF']; ?>?order=t">type</a></th>
+  <th><a href="<?php echo $_SERVER['PHP_SELF']; ?>?order=p">path</a></th>
 </tr>
 
 <?php
-$res = mysql_query("select id,path,type from file $sql_suffix");
-while (list($id,$path,$type)=mysql_fetch_row($res)) {
+$res = mysql_query("select id,path,type,dir from file $sql_suffix");
+while (list($id,$path,$type,$dir)=mysql_fetch_row($res)) {
 ?>
 <tr class="<?php echo $type; ?>">
   <td><?php echo $id; ?></td>
   <td><?php echo $type; ?></td> 
-  <td><a href="file.php?id=<?php echo $id; ?>"><?php echo $path; ?></a></td>
+  <td><a href="file.php?id=<?php echo $id; ?>&d=<?php echo $dir; ?>"><?php echo $path; ?></a></td>
 </tr>
 <?php
 }