handle require_once and include_once, allow single quotes
[old-projects.git] / depview / list.php
1 <?php
2 require("config.inc.php");
3 require("header.inc.php");
4
5 $order = isset($_REQUEST['order']) ? $_REQUEST['order'] : "p";
6 switch ($order) {
7 case "i":
8 $sql_suffix = "order by id";
9 break;
10 case "t":
11 $sql_suffix = "order by type";
12 break;
13 case "p":
14 $sql_suffix = "order by path";
15 break;
16 }
17 ?>
18
19 <table>
20 <tr>
21 <th><a href="<?php echo $_SERVER['PHP_SELF']; ?>?order=i">id</a></th>
22 <th><a href="<?php echo $_SERVER['PHP_SELF']; ?>?order=t">type</a></th>
23 <th><a href="<?php echo $_SERVER['PHP_SELF']; ?>?order=p">path</a></th>
24 </tr>
25
26 <?php
27 $res = mysql_query("select id,path,type,dir from file $sql_suffix");
28 while (list($id,$path,$type,$dir)=mysql_fetch_row($res)) {
29 ?>
30 <tr class="<?php echo $type; ?>">
31 <td><?php echo $id; ?></td>
32 <td><?php echo $type; ?></td>
33 <td><a href="file.php?id=<?php echo $id; ?>&d=<?php echo $dir; ?>"><?php echo $path; ?></a></td>
34 </tr>
35 <?php
36 }
37 ?>
38 </table>
39
40 <?php
41 require("footer.inc.php");
42 ?>