[cvs] / gkbweb / htdocs / tree.php  

cvs: gkbweb/htdocs/tree.php


1 : tmcnulty 1.1 <?php
2 :     include($DOCUMENT_ROOT."/shared/inc/global.inc");
3 :    
4 :     if (!($dbh = dbconnect())) {
5 :     echo "FATAL ERROR: dbconnect() failed.";
6 :     exit;
7 :     }
8 :    
9 :     if (isset($id)) {
10 :     if ($q = mysql_query("select tree, name, description from treeinfo where id=$id", $dbh)) {
11 :     if ($r = mysql_fetch_object($q)) {
12 :     $tree = $r->tree;
13 :     $name = $r->name;
14 :     $description = $r->description;
15 :     }
16 :     }
17 :     $page = $tree;
18 :     $title = $name;
19 :     } else {
20 :     $page = "error";
21 :     $title = "Error";
22 :     }
23 :    
24 :     include($layout_top);
25 :    
26 :     if (isset($id)) {
27 :     echo "<h2>$name</h2>\n";
28 :     echo "<p>$description</p>\n";
29 :    
30 :     if (!($dbh = dbconnect())) {
31 :     echo "FATAL ERROR: dbconnect() failed.";
32 :     exit;
33 :     }
34 :     //echo "<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\"><tr><td class=\"border\">\n";
35 :    
36 :     echo "<table border=\"0\" cellpadding=\"5\" cellspacing=\"0\">\n";
37 :    
38 : tmcnulty 1.6 if ($q = mysql_query("select name, safename, fullname, description from builds,mastertrees where mastertrees.tree=\"$tree\" and mastertree=mastertrees.name and (configfile=\"\" or configfile is NULL) and (patchfile=\"\" or patchfile is NULL) and (configpath='' or configpath is NULL) and status!='disabled' order by name", $dbh)) {
39 : tmcnulty 1.1 $i=0;
40 :     while ($r = mysql_fetch_object($q)) {
41 :     $i++;
42 :    
43 :     showkernel($r->name, $r->safename, $r->fullname, $r->description, "", "");
44 :    
45 :     if ($i < mysql_num_rows($q))
46 :     echo "<tr><td colspan=\"2\">&nbsp</td></tr>\n";
47 :     }
48 :     } else { echo mysql_error(); }
49 :    
50 :     echo "</table>\n";
51 :     // echo "</table>\n";
52 :     } else {
53 :     echo "<h2>Error</h2>\n";
54 :     echo "<p>No tree ID was specified. What exactly do you want me to do here?</p>\n";
55 :     }
56 :    
57 :     include($layout_tail);
58 :     ?>

Tobias McNulty

Powered by ViewCVS 1.0-dev
(Powered by ViewCVS)

ViewCVS and CVS Help