Support for being a sub-project of another project (or a sub-exhibitor
authorJoey Schulze <joey@infodrom.org>
Fri, 16 Jul 2004 18:33:05 +0000 (18:33 +0000)
committerJoey Schulze <joey@infodrom.org>
Fri, 16 Jul 2004 18:33:05 +0000 (18:33 +0000)
of another exhibitor).

src/LinuxTag/2005/projects/edit.wml

index ad5d65f..a1cb12a 100644 (file)
                title="<b>Name</b>"
                value="<? echo $data['name']; ?>"
                >
+<?
+    $query = "SELECT name FROM project WHERE name <> 'Speaker' AND name <> 'Supporter' ";
+    if (isset ($oid)) {
+      $query .= sprintf ("AND name <> '%s' ", $data['name']);
+    }
+    $query .= "ORDER BY name";
+    $sth = pg_exec ($dbh, $query) or die("Datenbank-Abfrage!");
+
+    if (pg_NumRows ($sth) > 0) {
+?>
+<tr><td align=right bgcolor="<colh>"><font face="Helvetica,Arial"><b>Sub-Project</b></font></td>
+<td bgcolor="<cold>"><font face="Helvetica,Arial"><select name=subproject><option value="">-- select one --
+<?
+      for ($nr=0; $nr < pg_NumRows ($sth); $nr++) {
+       $row = pg_fetch_array ($sth, $nr);
+       if ($data['subproject'] == $row['name']) {
+         printf ("<option value=\"%s\" selected>%s\n", $row['name'], $row['name']);
+       } else {
+         printf ("<option value=\"%s\">%s\n", $row['name'], $row['name']);
+       }       
+      }
+?>
+</select>
+</font></td></tr>
+<?
+    }
+?>
+
 <row_input     name=url
                title="<b>URL</b>"
                value="<? echo $data['url']; ?>"