--- /dev/null
+#include <lt2002.style>
+#include "../edit.style"
+#include "jobs.inc"
+
+<build_timeframe>
+<page func="LinuxTag 2002 Organisation" title="Supporter -- Jobs">
+
+<?
+ $limit = '';
+ reset ($ltdays);
+ while (list($key,$day) = each ($ltdays)) {
+ if ($GLOBALS["day_".$key] == 1) {
+ $foo = explode (",", $day);
+ if (strlen ($limit) == 0) {
+ $limit = $foo[0];
+ } else {
+ $limit .= ", " . $foo[0];
+ }
+ }
+ }
+
+ if (strlen ($limit) > 0) {
+ printf ("<p><b>Output limited to</b>: %s</p>", $limit);
+ }
+
+?>
+
+<table cellpadding=0 cellspacing=1 align=center>
+<?
+ $f_header_head = '<tr bgcolor="%s"><th><font face="Helvetica,Arial">Title</font></th>';
+ $f_header_tail = '</tr>';
+ $f_header_day = '<th><strong><font face="Helvetica,Arial">%s</font></strong></th>';
+
+ $f_row_head = '<tr bgcolor="%s"><td align="left"><font face="Helvetica,Arial"><a href="edit_job.php3?id=%d">%s</a></font></td>';
+ $f_row_tail = '</tr>';
+ $f_row_day = '<td><font face="Helvetica,Arial">%s</font></td>';
+
+ printf ($f_header_head, "<colh>");
+ reset ($ltdays);
+ $col = array();
+ while (list($key,$day) = each ($ltdays)) {
+ if ($limitation != 1 || $GLOBALS["day_".$key] == 1) {
+ $foo = explode (",", $day);
+ printf ($f_header_day, $foo[0]);
+ $col[] = $key;
+ }
+ }
+ echo ($f_header_tail);
+
+ $dbh = pg_pconnect ("<dbconnstring>")
+ or die("Unable to connect to SQL server");
+
+ pg_exec ($dbh, "SET DateStyle = 'ISO'") or die("Datenbank-Abfrage!");
+
+ $query = sprintf ("SELECT job.id,title,starttime,endtime FROM job,jobfragment "
+ ."WHERE job.id = jobfragment.jobid "
+ ."ORDER BY upper(title),starttime");
+
+ $sth = pg_exec ($dbh, $query) or die ("Datenbank-Abfrage!");
+
+ $person = array ();
+ $thisname = '';
+ for ($nr = 0; $nr < pg_NumRows($sth); $nr++)
+ {
+ $row = pg_fetch_array($sth, $nr);
+
+ if ($thisname != $row['title']) {
+ if ($thisname != '') {
+ $available[$thisname] = $avail;
+ }
+ $job[] = $row['title'];
+ $avail = array ('id' => $row['id']);
+ $thisname = $row['title'];
+ }
+
+ $foo = explode (" ", $row['starttime']);
+ $time = build_timeframe ($row['starttime'], $row['endtime']);
+ if (strlen ($avail[$foo[0]]) > 0) {
+ $avail[$foo[0]] .= " " . $time;
+ } else {
+ $avail[$foo[0]] = $time;
+ }
+ }
+ $available[$thisname] = $avail;
+
+ $colindex = count ($col);
+ $color = "<cold>";
+ reset ($person);
+ while (list(,$name) = each ($job)) {
+ $color = $color=="<cold>"?"<coln>":"<cold>";
+ printf ($f_row_head, $color, $available[$name]['id'], $name);
+
+ reset ($col);
+ while (list(,$day) = each ($col)) {
+ if (strlen ($available[$name][$day]) > 0) {
+ printf ($f_row_day, $available[$name][$day]);
+ } else {
+ printf ($f_row_day, " ");
+ }
+ }
+
+ echo ($f_row_tail);
+ }
+?>
+</table>
+
+<p>
+<b>Limit Output</b>. You can limit the output to certain days and
+people working on certain tasks.</p>
+<p>Warning: Limiting to sections is not yet implemented.</p>
+
+<form method=get action=jobs.php3>
+<input type=hidden name=limitation value=1>
+
+<center><table cellpadding=0 cellspacing=1>
+
+<?
+ $first = true;
+ reset ($ltdays);
+ while (list($key,$day) = each ($ltdays)) {
+ if ($first) {
+ $first = false;
+?>
+<row_checkbox name="day_<? echo $key; ?>"
+ title="<b>Days</b>"
+ descr="<? echo $day; ?>"
+ checked="checked"
+ >
+<?
+ } else {
+?>
+<row_checkbox name="day_<? echo $key; ?>"
+ title=" "
+ descr="<? echo $day; ?>"
+ checked="checked"
+ >
+<?
+ }
+ }
+?>
+
+<row_checkbox name="section_<? echo $nr; ?>"
+ title="<b>Sections</b>"
+ descr="Any section"
+ value="any"
+ checked="checked"
+ >
+
+<?
+ $query = "SELECT DISTINCT section FROM job WHERE section <> '' ORDER BY section";
+ $sth = pg_exec ($dbh, $query) or die ("Datenbank-Abfrage!");
+
+ for ($nr = 0; $nr < pg_NumRows($sth); $nr++)
+ {
+ $row = pg_fetch_array($sth, $nr);
+?>
+<row_checkbox name="section_<? echo $nr; ?>"
+ title=" "
+ descr="<? echo $row['section']; ?>"
+ value="<? echo $row['section']; ?>"
+ checked=""
+ >
+<?
+ printf ("<input type=\"hidden\" name=\"maxsection\" value=\"%d\">", $nr);
+ }
+?>
+
+<row_submit_plain>
+
+</table></center>
+
+</form>
+
+</page>
+
+# Local variables:
+# mode: text
+# mode: auto-fill
+# end:
+