--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/fhiiqm/vertrag_flist1.php Wed Aug 31 14:22:19 2011 +0200
@@ -0,0 +1,165 @@
+<!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="/fhiiqm/css/db.css" rel="STYLESHEET" type="TEXT/CSS" media="screen" />
+ <link href="/fhiiqm/css/db_print.css" rel="STYLESHEET" type="TEXT/CSS" media="print" />
+
+ <title>Liste Vertragsdaten</title>
+ <script type="text/javascript">
+ function winopen (addr,title)
+ {
+ mywin = window.open(addr,title, "width=1100,height=700,left=400,top=300,menubar=yes,status=yes,scrollbars=yes,resizable=yes,toolbar=yes");
+ mywin.focus();
+ }
+ </script>
+</head>
+
+<body onload="document.ffilter.filter.focus();">
+ <div class="float-r"><img src="img/document_mark_as_final.png" border="0" alt="Verträge" title="Verträge"/></div>
+
+<?php
+
+/**
+ * @author Bettina Schwarzer, Fritz-Haber-Institut
+ * @copyright 7/2011
+ *
+ * Liste Vertragsdaten mit Sortierung und Filter
+ */
+
+ error_reporting(E_ALL ^ E_NOTICE);
+
+ $zeil = $_GET["z"];
+ if (!$zeil) $zeil = 25; // Anzahl der gezeigten Zeilen
+ $start = $_GET["st"]; // Start bei DS $start+1
+ if (!$start) $start=0;
+
+ // Felder, nach denen gefiltert werden kann
+ $fields = array(2=>"Bezeichnung",4=>"Bearbeiter",6=>"Vertragstyp",7=>"Produkt");
+
+ $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($sort) && !$sort) $sort = 2;
+ if (!isset($dir) && !$dir) $dir = "";
+
+// echo "sort=$sort, fnum=$fnum, filter=$filter <br />";
+ include_once($_SERVER['DOCUMENT_ROOT'] ."/fhiiqm/inc/dbconnect.inc.php");
+ include ($_SERVER['DOCUMENT_ROOT'] ."/fhiiqm/inc/func_lib.inc.php");
+ $dbc = new dbconnection();
+
+ echo "<div align='center'>\n";
+//echo "$sort, $dir, $fnum, $filter<br><br>\n";
+ $sql = "CALL fhiiqm.vertrag_flist1(" . $sort . ",'" . $dir . "', " . $fnum . ", '" . $filter . "',$start,$zeil, @anz)";
+ // Parameter: Nr. Sortfelf, Sortierrichtung, Nr. Filterfeld, Filterbegriff, Start bei DS $start+1, Anzahl DS/Seite, Anzahl gefundener Vertraege
+ // liefert Felder: contract_ID,cname,clong,bearb,doc,typ,prod
+ $result = $dbc -> queryObjectArray($sql);
+ if ($result)
+ {
+ $bg1 = "#F8F8F8";
+ $bg2 = "#DEDFE1";
+ $bg = "#FFFFFF";
+
+ $vanz = $dbc -> querySingleItem("SELECT @anz");
+
+ echo "<p><b>Liste der erfassten Verträge</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 jeder Spalte 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 Vertragsdaten</td></tr>\n";
+ echo "</table>\n";
+ printf ("<p>Anzahl Verträge: %s </p>", $vanz);
+
+ 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";
+// echo "<tr bgcolor='#CFDEF0'><th>Bezeichnung</th><th>Titel</th><th>Beschreibung</th><th>Typ</th><th>Beginn</th><th>Ende</th><th>Künd.frist(mon)</th>
+// <th>Dokument</th><th>Bemerkung</th><th> </th></tr>\n";
+
+ echo "<tr bgcolor='#68ACBF'>";
+ tab_column(2,"Bezeichnung",$sort,$dir,2,$fnum,$filter,$start,$zeil);
+ tab_column(3,"Beschreibung",$sort,$dir,0,$fnum,$filter,$start,$zeil);
+ tab_column(4,"Partner FHI",$sort,$dir,4,$fnum,$filter,$start,$zeil);
+ tab_column(5,"Dokument",$sort,$dir,0,$fnum,$filter,$start,$zeil);
+ tab_column(6,"Typ",$sort,$dir,6,$fnum,$filter,$start,$zeil);
+ tab_column(7,"zu Produkt",$sort,$dir,7,$fnum,$filter,$start,$zeil);
+ echo "<th> </th></tr>\n";
+ foreach ($result as $row)
+ {
+ if ($bg == $bg1) $bg = $bg2; else $bg = $bg1;
+ echo "<tr bgcolor='" . $bg . "'><td><b>$row->cname</b></td>";
+// echo "<td>$row->contract_s</td>";
+ echo "<td>" . nl2br($row->clong) . "</td>";
+ echo "<td>$row->bearb</td>";
+ if (file_exists("documents/".$row->doc))
+ echo "<td><a href='documents/$row->doc'>$row->doc</a></td>";
+ else
+ echo "<td>$row->doc</td>";
+ echo "<td>$row->typ</td>";
+ echo "<td>$row->prod</td>";
+ echo "<td><a href='/fhiiqm/vertrag_upd.php?uid=$row->contract_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,$vanz,$liste);
+ }
+ else
+ {
+ echo "<p class='red'>Leider wurde nichts gefunden mit Ihrem Suchbegriff '$filter'!</p>\n";
+ echo "<p><a href=\"vertrag_flist1.php\" title=\"Vertragliste 1\" >Vertragsliste zeigen</a></p>\n";
+ echo "</div>\n";
+ }
+
+ $dbc -> close();
+
+ echo "<p> <a href=\"/fhiiqm/vertrag_flist2.php?s=$sort&d=$dir&f=$fnum&b=$filter&st=$start&z=$zeil\" class=\"sc\" title=\"Vertragliste 2\" onclick=\"winopen(this.href,'Vertragsliste 2'); return false\">Vertragsliste Teil 2</a></p>\n";
+ echo "<p> <a href=\"/fhiiqm/vertrag_ins.php\" target=\"_self\" class=\"sc\" title=\"Vertrag erfassen\">Weiteren Vertrag erfassen</a></p>\n";
+
+?>
+
+</body>
+</html>
\ No newline at end of file