2 require("config.inc.php");
3 require("header.inc.php");
5 /* validate parameters */
6 if (!isset($_REQUEST['id'])) {
7 echo "no file specified";
8 include("footer.inc.php");
11 $id = $_REQUEST['id'];
12 $res = mysql_query("select path from file where id=$id");
13 if (!list($page)=mysql_fetch_row($res)) {
14 echo "file $id not found";
15 include("footer.inc.php");
18 $d = isset($_REQUEST['d']) ?
$_REQUEST['d'] : 0;
21 <h1
>Dependencies
for <?php
echo $page; ?
></h1
>
23 Current context is highlighted in yellow
.<br
/>
24 <a href
="list.php">back to file
list</a
>
27 <h2
>files that
<?php
echo $page; ?
> depends on
</h2
>
35 $res = mysql_query("select dep.dir,dep.type,dep.dep,file.path from dep left join file on dep.dep=file.id where page=$id order by dep.dir");
36 while (list($dir,$type,$cid,$cpath)=mysql_fetch_row($res)) {
37 $res2 = mysql_query("select path from dir where id=$dir");
38 list($dirname)=mysql_fetch_row($res2);
40 <tr
<?php
if ($d==$dir) echo 'class="current"'; ?
>>
41 <td
><?php
echo $type; ?
></td
>
42 <td
><?php
echo $dirname; ?
></td
>
43 <td
><a href
="file.php?id=<?php echo $cid; ?>&d=<?php echo $dir; ?>"><?php
echo $cpath; ?
></a
></td
>
50 <h2
>files that depend on
<?php
echo $page; ?
></h2
>
58 $res = mysql_query("select dep.dir,dep.type,dep.page,file.path from dep left join file on dep.page=file.id where dep=$id order by dep.dir");
59 while (list($dir,$type,$pid,$ppath)=mysql_fetch_row($res)) {
60 $res2 = mysql_query("select path from dir where id=$dir");
61 list($dirname)=mysql_fetch_row($res2);
63 <tr
<?php
if ($d==$dir) echo 'class="current"'; ?
>>
64 <td
><?php
echo $type; ?
></td
>
65 <td
><?php
echo $dirname; ?
></td
>
66 <td
><a href
="file.php?id=<?php echo $pid; ?>&d=<?php echo $dir; ?>"><?php
echo $ppath; ?
></a
></td
>
75 require("footer.inc.php");