--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/fhiiqm/info_flist.php Wed Aug 31 14:22:19 2011 +0200
@@ -0,0 +1,194 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+
+<head>
+ <meta http-equiv="content-type" content="text/html; charset=iso-8859-1" />
+ <link href="css/db.css" rel="STYLESHEET" type="TEXT/CSS" media="screen"/>
+ <link href="css/db_print.css" rel="STYLESHEET" type="TEXT/CSS" media="print"/>
+
+ <title>Infoliste</title>
+</head>
+
+<body onload="document.ffilter.filter.focus();">
+ <div class="float-r"><img src="img/document_image_ver.png" border="0" alt="Infodaten" title="Infodaten"/></div>
+
+<?php
+
+/**
+ * @author Bettina Schwarzer, Fritz-Haber-Institut
+ * @copyright 08/2011
+ *
+ * Liste Infos
+ */
+
+ error_reporting(E_ALL ^ E_NOTICE);
+
+ // Felder, nach denen gefiltert werden kann
+ $fields = array(2=>"Titel",4=>"Info-Typ",5=>"Produkt",6=>"Adressat");
+
+ $zeil = $_GET["z"];
+ if (!$zeil) $zeil = 25; // Anzahl der gezeigten Zeilen
+ $start = $_GET["st"]; // Start bei DS $start+1
+ if (!$start) $start=0;
+
+ $sort = $_GET["s"]; // Sortierung nach Spalte
+ if (!isset($sort) && !$sort) $sort = $_POST["s"];
+
+ $dir = $_GET["d"]; // Sortierrichtung
+ if (!isset($dir) && !$dir) $dir = $_POST["d"];
+
+ $fnum = $_GET["f"]; // Spaltennummer, nach der aktuell gefiltert wird
+ if (!isset($fnum) && !$fnum) $fnum = $_POST["f"];
+
+ $filter = $_POST["filter"];
+ if (!isset($filter) && !$filter) $filter = $_GET["b"];
+
+ $subf = $_POST["subf"]; // submit
+
+ if (!isset($fnum) && !$fnum) $fnum = 1;
+ if (!isset($filter) && !$filter) $filter = "";
+ if (!isset($sort) && !$sort) $sort = 1;
+ if (!isset($dir) && !$dir) $dir = "";
+
+ include_once($_SERVER['DOCUMENT_ROOT'] ."/fhiiqm/inc/dbconnect.inc.php");
+ include ($_SERVER['DOCUMENT_ROOT'] ."/fhiiqm/inc/func_lib.inc.php");
+
+ $dbc = new dbconnection();
+
+ $sql = "CALL info_flist($sort,'" . $dir . "',$fnum, '" . $filter . "',$start,$zeil,@anz);";
+ // Parameter: Nr. Sortfeld, Sortierrichtung, Nr. Filterfeld, Filterbegriff, (StartNr DS) -1, Anzahl Zeilen=DS, Anzahl gefundener Raeume
+ // liefert: info_ID, iname, ilong, ityp, prod, adressat, author, idate, bdate, edate, lang, doc, infrel
+// echo "sql = $sql<br />";
+ $result = $dbc ->queryObjectArray($sql);
+
+ if ($result)
+ {
+ $bg1 = "#F8F8F8";
+ $bg2 = "#DEDFE1";
+ $bg = "#FFFFFF";
+
+ echo "<div align='center'>\n";
+ echo "<p><b>Liste der Informationen</b></p>\n";
+
+ echo "<table border='0' cellspacing='0'>\n";
+ echo "<tr><td class='bigger'>Mittels '<img src='/fhiiqm/img/auf.gif' border='0' width='11' hight='11' />' / '<img src='/fhiiqm/img/ab.gif' border='0' width='11' hight='11' />'
+ können Sie nach bestimmten Spalten auf- bzw. absteigend sortieren</td></tr>
+ <tr><td class='bigger'>'<img src='/fhiiqm/img/filter.gif' border='0' width='14' hight='11' />' ermöglicht das Filtern nach ausgewählten Spalten der Liste</td></tr>
+ <tr><td class='bigger'>Klick auf '<img src='/fhiiqm/img/edit.gif' border='0' width='11' hight='11'>' - Bearbeiten der Infodaten</td></tr>\n";
+ echo "</table>\n";
+
+ $ianz = $dbc -> querySingleItem("SELECT @anz");
+ printf ("<p>Anzahl gefundener Informationen: %s</p>", $ianz);
+
+ if (isset($fnum) && $fnum>1 && !$filter && !$subf)
+ {
+ // Formular anzeigen fuer Filterbegriff
+ $text = $fields[$fnum];
+ echo "<form action=" . $_SERVER['PHP_SELF'] . " method='post' enctype='application/x-www-form-urlencoded' id='ffilter' name='ffilter' target='_self'>\n";
+ echo "<input type='hidden' name='s' value='$sort'>";
+ echo "<input type='hidden' name='d' value='$dir'>";
+ echo "<input type='hidden' name='f' value='$fnum'>";
+ echo "<table width=\"30%\" border=\"0\">\n";
+ echo "<tr><td>filtern nach $text: </td>";
+ echo "<td><input id='filter' name='filter' type=\"text\" size=\"30\" maxlength=\"30\" value=\"$filter\"/></td>";
+ echo "<td><input class=\"button\" type=\"submit\" value=\"finden\" name=\"subf\" title=\"subf\" /></td></tr></table>\n";
+ echo "</form>\n";
+ echo "<p> </p>\n";
+ }
+ echo "<table>\n";
+
+ if ($filter>'!') echo "<tr><td class='bigger' colspan=6>Filter: ". $fields["$fnum"] . " wie '$filter'</td><tr>\n";
+
+ // Listenkopf generieren
+ echo "<tr bgcolor='#68ACBF'>";
+ echo "<th>ID</th>";
+ tab_column(2,"Titel",$sort,$dir,2,$fnum,$filter,$start,$zeil);
+ tab_column(3,"Kurzinfo",$sort,$dir,0,$fnum,$filter,$start,$zeil);
+ tab_column(4,"Info-Typ",$sort,$dir,4,$fnum,$filter,$start,$zeil);
+ tab_column(5,"Produkt",$sort,$dir,5,$fnum,$filter,$start,$zeil);
+ tab_column(6,"Adressat",$sort,$dir,6,$fnum,$filter,$start,$zeil);
+ tab_column(7,"Autor",$sort,$dir,0,$fnum,$filter,$start,$zeil);
+ tab_column(8,"Erst-Datum",$sort,$dir,0,$fnum,$filter,$start,$zeil);
+ tab_column(9,"gilt ab",$sort,$dir,0,$fnum,$filter,$start,$zeil);
+ tab_column(10,"gilt bis",$sort,$dir,0,$fnum,$filter,$start,$zeil);
+ echo "<th>Sprache</th>";
+ echo "<th>Dokument</th>";
+ echo "<th>Bezug</th>";
+ echo "<th> </th></tr>\n";
+
+// echo "<tr bgcolor='#68ACBF'><th>Raum-Nr.</th><th>Bezeichnung</th><th>Haus</th><th>Typ</th><th>Fläche (m<sup>2</sup>)</th><th>Raumplan</th><th> </th>
+// </tr>\n";
+ foreach ($result as $row)
+ {
+ if ($bg == $bg1) $bg = $bg2; else $bg = $bg1;
+ echo "<tr bgcolor='" . $bg . "'><td class=\"left\">$row->info_ID</td>";
+ echo "<td class=\"left\">$row->iname</td>";
+ echo "<td class=\"left\">" . nl2br($row->ilong) . "</td>";
+ echo "<td class=\"left\">$row->ityp</td>";
+ echo "<td class=\"left\">" . str_replace(";","<br />",$row->prod) . "</td>";
+ echo "<td class=\"left\">" . str_replace(";","<br />",$row->adressat) . "</td>";
+ echo "<td class=\"left\">$row->author</td>";
+ if ($row->idate)
+ {
+ $dat = new DateTime($row->idate);
+ echo "<td class=\"left\">" . $dat->format('d.m.Y')."</td>";
+ }
+ else echo "<td> </td>";
+ if ($row->bdate)
+ {
+ $dat = new DateTime($row->bdate);
+ echo "<td class=\"left\">" . $dat->format('d.m.Y')."</td>";
+ }
+ else echo "<td> </td>";
+ if ($row->edate)
+ {
+ $dat = new DateTime($row->edate);
+ echo "<td class=\"left\">" . $dat->format('d.m.Y')."</td>";
+ }
+ else echo "<td> </td>";
+ echo "<td class=\"left\">$row->lang</td>";
+ if (file_exists("infos/".$row->doc))
+ echo "<td class=\"left\"><a href=\"infos/$row->doc\">$row->doc</td>";
+ else
+ echo "<td class=\"left\">$row->doc</td>";
+ echo "<td class=\"left\">$row->infrel</td>";
+ echo "<td><a href='/fhiiqm/info_upd.php?uid=$row->info_ID'><img src=\"/fhiiqm/img/edit.gif\" alt='edit' title='edit' border='0'/></a></td></tr>\n";
+ }
+ echo "</table></div>\n";
+
+ echo "<br /> ";
+
+ // Sortierung und Filter aus $_GET fuer weitere Seiten
+ foreach ($_GET as $key=>$val)
+ {
+ if ($key != "st") $liste .= "&" . $key ."=".$val;
+ }
+ // Sortierung und Filter aus $_POST fuer weitere Seiten
+ if ($subf)
+ foreach ($_POST as $key=>$val)
+ {
+ if ($key != "st" && $key != "subf" && $key != "filter") $liste .= "&" . $key ."=".$val;
+ if ($key == "filter") $liste .= "&b=" . $val;
+ }
+
+ // Links auf andere Seiten generieren
+ liste_links($start,$zeil,$ianz,$liste);
+ }
+ else
+ {
+ if ($dbc -> error)
+ echo "error: " . $dbc -> error . "<br />\n";
+ else
+ {
+ echo "<p class='red'> Leider nichts gefunden für ". $fields["$fnum"] . " wie '$filter'!</p><br />";
+ echo " <a href=\"" . $_SERVER["PHP_SELF"] . "\" target=\"_self\" title=\"Infoliste\" class=\"sc\">Infoliste</a></p>\n";
+ }
+
+ }
+ $dbc -> close();
+
+ echo "<p> <a href=\"info_ins.php\" target=\"_self\" title=\"Info erfassen\" class=\"sc\">Weitere Info erfassen</a></p>\n";
+
+?>
+</body>
+</html>
\ No newline at end of file