--- a/fhiiqm/vertrag_flist1.php Fri Jan 17 08:50:55 2014 +0100
+++ b/fhiiqm/vertrag_flist1.php Wed Aug 06 09:42:40 2014 +0200
@@ -1,287 +1,287 @@
-<?php
-
-/**
- * @author Bettina Schwarzer, Fritz-Haber-Institut
- * @copyright 7/2011
- *
- * Liste Vertragsdaten mit Sortierung und Filter
- */
-
- error_reporting(E_ALL ^ E_NOTICE);
-
- session_start();
- if (! isset($_SESSION["userid"]))
- {
- include_once ("inc/func_lib.inc.php");
- login("vertrag_flist1.php");
- exit;
- }
-
- if (is_null($_SESSION["recht"]) || (!is_null($_SESSION["recht"]) && !in_array("vr",$_SESSION["recht"]) && !in_array("ve",$_SESSION["recht"])))
- {
- header("Location: start.php");
- exit;
- }
-
-?>
-
-<!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=1400,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();">
-
-<?php
- echo " ";
- echo "<div class=\"float-br smaller\" valign='top'>";
- echo " user: " . $_SESSION["userid"];
- echo " <a class='sc' href='/fhiiqm/logout.php' title='Session beenden'>logout</a></div>\n";
- echo "<div class=\"float-r\"> <img src=\"img/document_mark_as_final.png\" border=\"0\" alt=\"Verträge\" title=\"Verträge\"/></div>\n";
-
- $mfile = $_GET['g']; // Multifile = mehrere Vertragsdokumente moeglich
- if (!$mfile) $mfile = $_POST['g'];
- $zeil = $_GET["z"];
- if (!$zeil) $zeil = $_POST["z"];
- if (!$zeil) $zeil = 20; // 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",8=>"Partner");
-
- $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 = "";
- // $_GET-Parameter zurueck zur Vertragliste mit den selben Einstellungen wie zuvor fuer Update
- $getp = "s=$sort&d=$dir&f=$fnum&b=$filter&st=$start&z=$zeil&g=$mfile";
-
- // Recht Produktgruppe beruecksichtigen
- if (is_array($_SESSION["prodg"]))
- {
- foreach ($_SESSION["prodg"] as $val)
- $listg .= "," .$val;
- $listg = substr($listg,1);
- }
- else $listg = "";
-
-// echo "sort=$sort, fnum=$fnum, filter=$filter <br />";
- include_once($_SERVER['DOCUMENT_ROOT'] ."/fhiiqm/inc/dbconnect.inc.php");
- include_once ($_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)";
- if ($mfile)
- $sql = "CALL fhiiqm.vertrag_flist1_mf(" . $sort . ",'" . $dir . "', " . $fnum . ", '" . $filter . "', '" . $listg . "', $start,$zeil, @anz)";
- else
- $sql = "CALL fhiiqm.vertrag_flist1_1(" . $sort . ",'" . $dir . "', " . $fnum . ", '" . $filter . "', '" . $listg . "', $start,$zeil, @anz)";
- // Parameter: Nr. Sortfelf, Sortierrichtung, Nr. Filterfeld, Filterbegriff, Liste der berechtigten prodgroup, 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";
-
- $heute = new DateTime();
-
- $vanz = $dbc -> querySingleItem("SELECT @anz");
-
- echo "<p><b>Verträge - Übersicht</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' hight='11'>' - Bearbeiten der Vertragsdaten,
- '<img src='/fhiiqm/img/file_extension_xls.png' border='0' hight='11'>' - Excel-Export</td></tr>\n";
- echo "</table>\n";
- printf ("<p>Anzahl Verträge: %s </p>", $vanz);
- echo "</div>\n";
- echo "<p> <a href=\"/fhiiqm/vertrag_flist12.php?$getp\" class=\"sc\" title=\"Vertragliste 2\" onclick=\"winopen(this.href,'Vertragsliste 2'); return false\">Verträge Teil 2</a></p>\n";
- echo "<div align='center'>\n";
-
-
- if (isset($fnum) && $fnum>1 && !$filter && !$subf)
- {
- // Formular anzeigen fuer Filterbegriff
- $text = $fields[$fnum];
- $azeil = array(10=>'10',20=>'20',25=>'25',50=>'50',100=>'100',9999=>'alle'); // Anzahl gezeigter rows
- 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 "<input type='hidden' name='g' value='$mfile'>";
- echo "<table width=\"40%\" 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\"";
- if ($fnum == 6)
- {
- $sql = "SELECT vtyp_kurz, vtyp_bezeichnung FROM Vertrag_Typ ORDER BY 1";
- if ($res = $dbc->queryObjectArray($sql))
- {
- foreach ($res as $row)
- $title .= ", " . $row->vtyp_kurz." - ".$row->vtyp_bezeichnung;
- echo "title='".substr($title,2)."' ";
- }
- }
- echo "/></td>";
- echo "<td>Zeilen/Seite? <select name='z'>\n";
- foreach ($azeil as $key=>$val)
- {
- if ($key == $zeil) $select = "selected"; else $select = "";
- echo "<option $select value='$key'>$val</option>\n";
- }
- echo "</select></td>\n";
- 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 width='99%'>\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(8,"Partner",$sort,$dir,8,$fnum,$filter,$start,$zeil,"",$mfile);
- tab_column(2,"Bezeichnung",$sort,$dir,2,$fnum,$filter,$start,$zeil,"",$mfile);
- tab_column(3,"Beschreibung",$sort,$dir,0,$fnum,$filter,$start,$zeil,"",$mfile);
- tab_column(6,"Typ",$sort,$dir,6,$fnum,$filter,$start,$zeil,"",$mfile);
- tab_column(7,"zu Produkt",$sort,$dir,7,$fnum,$filter,$start,$zeil,"",$mfile);
- tab_column(4,"Bearbeiter",$sort,$dir,4,$fnum,$filter,$start,$zeil,"",$mfile);
- if ($mfile)
- tab_column(5,"Dokument, Schlagwort",$sort,$dir,5,$fnum,$filter,$start,$zeil,"",$mfile);
- else
- tab_column(5,"Dokument",$sort,$dir,0,$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 . "'>";
- echo "<td>$row->partfirma</td>";
- if ($row->cend)
- {
- $ce = new DateTime($row->cend);
- if ((!$row->cauto || is_null($row->cauto)) && $heute > $ce) $class="class='red'"; else $class="";
- }
- else $class="";
- echo "<td width='17%' $class><b>$row->cname<br /></b></td>";
-// echo "<td>$row->contract_s</td>";
- echo "<td width='22%'>" . nl2br($row->clong) . "</td>";
- echo "<td>$row->typ</td>";
- echo "<td>$row->prod</td>";
- echo "<td>$row->bearb</td>";
- if ($mfile)
- {
- $docsw = explode("; ", $row->doc);
- if (isset($docsw) && is_array($docsw))
- {
- echo "<td>";
- foreach ($docsw as $val)
- {
- $file = substr($val,0,strpos($val,'|'));
- $sw = substr($val,strpos($val,'|')+1);
- if ($fnum == 5 && $filter > '!') // Filterbegriff in Schlagwort hervorheben
- {
- $sw = str_replace(lcfirst($filter),"<b>".lcfirst($filter)."</b>",$sw);
- $sw = str_replace(ucfirst($filter),"<b>".ucfirst($filter)."</b>",$sw);
- }
- if ($sw) $sw = " → <em>$sw</em>"; else $sw = "";
- if (file_exists("documents/$file"))
- {
- $doc = substr($file,strpos($file,"_")+1);
- echo "<a href='documents/$file'>$doc</a>$sw<br />";
- }
- else
- echo "$file$sw<br />";
- }
- echo "</td>";
- }
- }
- else
- {
- if (file_exists("documents/".$row->doc))
- {
- $doc = substr($row->doc,strpos($row->doc,"_")+1);
- echo "<td><a href='documents/$row->doc'>$doc</a></td>";
- }
- else
- echo "<td>$row->doc</td>";
- }
- if ($mfile) $part = "ed"; else $part = "upd";
- echo "<td><a href='/fhiiqm/vertrag_$part.php?uid=$row->contract_ID&$getp'><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);
-
- // Export csv-Datei
- echo " <span class='sc'><a href='/fhiiqm/vertrag_list12_csv.php?$getp'>
- <img src='/fhiiqm/img/file_extension_xls.png' border='0' title='Export dieser Auswahl nach Excel(csv)' /></a></span>";
- }
- 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_flist12.php?$getp\" class=\"sc\" title=\"Vertragliste 2\" onclick=\"winopen(this.href,'Vertragsliste 2'); return false\">Verträge Teil 2</a></p>\n";
- if (!is_null($_SESSION["recht"]) && in_array("ve",$_SESSION["recht"]))
- {
- if ($mfile)
- echo "<p> <a href=\"/fhiiqm/vertrag_ed.php?$getp\" target=\"_self\" class=\"sc\" title=\"Vertrag erfassen\">Weiteren Vertrag erfassen</a></p>\n";
- else
- echo "<p> <a href=\"/fhiiqm/vertrag_ins.php\" target=\"_self\" class=\"sc\" title=\"Vertrag erfassen\">Weiteren Vertrag erfassen</a></p>\n";
- }
-?>
-
-</body>
+<?php
+
+/**
+ * @author Bettina Schwarzer, Fritz-Haber-Institut
+ * @copyright 7/2011
+ *
+ * Liste Vertragsdaten mit Sortierung und Filter
+ */
+
+ error_reporting(E_ALL ^ E_NOTICE);
+
+ session_start();
+ if (! isset($_SESSION["userid"]))
+ {
+ include_once ("inc/func_lib.inc.php");
+ login("vertrag_flist1.php?g=1");
+ exit;
+ }
+
+ if (is_null($_SESSION["recht"]) || (!is_null($_SESSION["recht"]) && !in_array("vr",$_SESSION["recht"]) && !in_array("ve",$_SESSION["recht"])))
+ {
+ header("Location: start.php");
+ exit;
+ }
+
+?>
+
+<!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=1400,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();">
+
+<?php
+ echo " ";
+ echo "<div class=\"float-br smaller\" valign='top'>";
+ echo " user: " . $_SESSION["userid"];
+ echo " <a class='sc' href='/fhiiqm/logout.php' title='Session beenden'>logout</a></div>\n";
+ echo "<div class=\"float-r\"> <img src=\"img/document_mark_as_final.png\" border=\"0\" alt=\"Verträge\" title=\"Verträge\"/></div>\n";
+
+ $mfile = $_GET['g']; // Multifile = mehrere Vertragsdokumente moeglich
+ if (!$mfile) $mfile = $_POST['g'];
+ $zeil = $_GET["z"];
+ if (!$zeil) $zeil = $_POST["z"];
+ if (!$zeil) $zeil = 20; // 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",8=>"Partner");
+
+ $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 = "";
+ // $_GET-Parameter zurueck zur Vertragliste mit den selben Einstellungen wie zuvor fuer Update
+ $getp = "s=$sort&d=$dir&f=$fnum&b=$filter&st=$start&z=$zeil&g=$mfile";
+
+ // Recht Produktgruppe beruecksichtigen
+ if (is_array($_SESSION["prodg"]))
+ {
+ foreach ($_SESSION["prodg"] as $val)
+ $listg .= "," .$val;
+ $listg = substr($listg,1);
+ }
+ else $listg = "";
+
+// echo "sort=$sort, fnum=$fnum, filter=$filter <br />";
+ include_once($_SERVER['DOCUMENT_ROOT'] ."/fhiiqm/inc/dbconnect.inc.php");
+ include_once ($_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)";
+ if ($mfile)
+ $sql = "CALL fhiiqm.vertrag_flist1_mf(" . $sort . ",'" . $dir . "', " . $fnum . ", '" . $filter . "', '" . $listg . "', $start,$zeil, @anz)";
+ else
+ $sql = "CALL fhiiqm.vertrag_flist1_1(" . $sort . ",'" . $dir . "', " . $fnum . ", '" . $filter . "', '" . $listg . "', $start,$zeil, @anz)";
+ // Parameter: Nr. Sortfelf, Sortierrichtung, Nr. Filterfeld, Filterbegriff, Liste der berechtigten prodgroup, 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";
+
+ $heute = new DateTime();
+
+ $vanz = $dbc -> querySingleItem("SELECT @anz");
+
+ echo "<p><b>Verträge - Übersicht</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' hight='11'>' - Bearbeiten der Vertragsdaten,
+ '<img src='/fhiiqm/img/file_extension_xls.png' border='0' hight='11'>' - Excel-Export</td></tr>\n";
+ echo "</table>\n";
+ printf ("<p>Anzahl Verträge: %s </p>", $vanz);
+ echo "</div>\n";
+ echo "<p> <a href=\"/fhiiqm/vertrag_flist12.php?$getp\" class=\"sc\" title=\"Vertragliste 2\" onclick=\"winopen(this.href,'Vertragsliste 2'); return false\">Verträge Teil 2</a></p>\n";
+ echo "<div align='center'>\n";
+
+
+ if (isset($fnum) && $fnum>1 && !$filter && !$subf)
+ {
+ // Formular anzeigen fuer Filterbegriff
+ $text = $fields[$fnum];
+ $azeil = array(10=>'10',20=>'20',25=>'25',50=>'50',100=>'100',9999=>'alle'); // Anzahl gezeigter rows
+ 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 "<input type='hidden' name='g' value='$mfile'>";
+ echo "<table width=\"40%\" 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\"";
+ if ($fnum == 6)
+ {
+ $sql = "SELECT vtyp_kurz, vtyp_bezeichnung FROM Vertrag_Typ ORDER BY 1";
+ if ($res = $dbc->queryObjectArray($sql))
+ {
+ foreach ($res as $row)
+ $title .= ", " . $row->vtyp_kurz." - ".$row->vtyp_bezeichnung;
+ echo "title='".substr($title,2)."' ";
+ }
+ }
+ echo "/></td>";
+ echo "<td>Zeilen/Seite? <select name='z'>\n";
+ foreach ($azeil as $key=>$val)
+ {
+ if ($key == $zeil) $select = "selected"; else $select = "";
+ echo "<option $select value='$key'>$val</option>\n";
+ }
+ echo "</select></td>\n";
+ 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 width='99%'>\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(8,"Partner",$sort,$dir,8,$fnum,$filter,$start,$zeil,"",$mfile);
+ tab_column(2,"Bezeichnung",$sort,$dir,2,$fnum,$filter,$start,$zeil,"",$mfile);
+ tab_column(3,"Beschreibung",$sort,$dir,0,$fnum,$filter,$start,$zeil,"",$mfile);
+ tab_column(6,"Typ",$sort,$dir,6,$fnum,$filter,$start,$zeil,"",$mfile);
+ tab_column(7,"zu Produkt",$sort,$dir,7,$fnum,$filter,$start,$zeil,"",$mfile);
+ tab_column(4,"Bearbeiter",$sort,$dir,4,$fnum,$filter,$start,$zeil,"",$mfile);
+ if ($mfile)
+ tab_column(5,"Dokument, Schlagwort",$sort,$dir,5,$fnum,$filter,$start,$zeil,"",$mfile);
+ else
+ tab_column(5,"Dokument",$sort,$dir,0,$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 . "'>";
+ echo "<td>$row->partfirma</td>";
+ if ($row->cend)
+ {
+ $ce = new DateTime($row->cend);
+ if ((!$row->cauto || is_null($row->cauto)) && $heute > $ce) $class="class='red'"; else $class="";
+ }
+ else $class="";
+ echo "<td width='17%' $class><b>$row->cname<br /></b></td>";
+// echo "<td>$row->contract_s</td>";
+ echo "<td width='22%'>" . nl2br($row->clong) . "</td>";
+ echo "<td>$row->typ</td>";
+ echo "<td>$row->prod</td>";
+ echo "<td>$row->bearb</td>";
+ if ($mfile)
+ {
+ $docsw = explode("; ", $row->doc);
+ if (isset($docsw) && is_array($docsw))
+ {
+ echo "<td>";
+ foreach ($docsw as $val)
+ {
+ $file = substr($val,0,strpos($val,'|'));
+ $sw = substr($val,strpos($val,'|')+1);
+ if ($fnum == 5 && $filter > '!') // Filterbegriff in Schlagwort hervorheben
+ {
+ $sw = str_replace(lcfirst($filter),"<b>".lcfirst($filter)."</b>",$sw);
+ $sw = str_replace(ucfirst($filter),"<b>".ucfirst($filter)."</b>",$sw);
+ }
+ if ($sw) $sw = " → <em>$sw</em>"; else $sw = "";
+ if (file_exists("documents/$file"))
+ {
+ $doc = substr($file,strpos($file,"_")+1);
+ echo "<a href='documents/$file'>$doc</a>$sw<br />";
+ }
+ else
+ echo "$file$sw<br />";
+ }
+ echo "</td>";
+ }
+ }
+ else
+ {
+ if (file_exists("documents/".$row->doc))
+ {
+ $doc = substr($row->doc,strpos($row->doc,"_")+1);
+ echo "<td><a href='documents/$row->doc'>$doc</a></td>";
+ }
+ else
+ echo "<td>$row->doc</td>";
+ }
+ if ($mfile) $part = "ed"; else $part = "upd";
+ echo "<td><a href='/fhiiqm/vertrag_$part.php?uid=$row->contract_ID&$getp'><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);
+
+ // Export csv-Datei
+ echo " <span class='sc'><a href='/fhiiqm/vertrag_list12_csv.php?$getp'>
+ <img src='/fhiiqm/img/file_extension_xls.png' border='0' title='Export dieser Auswahl nach Excel(csv)' /></a></span>";
+ }
+ else
+ {
+ echo "<p class='red'>Leider wurde nichts gefunden mit Ihrem Suchbegriff '$filter'!</p>\n";
+ echo "<p><a href=\"vertrag_flist1.php?g=1\" title=\"Vertragliste 1\" >Vertragsliste zeigen</a></p>\n";
+ echo "</div>\n";
+ }
+
+ $dbc -> close();
+
+ echo "<p> <a href=\"/fhiiqm/vertrag_flist12.php?$getp\" class=\"sc\" title=\"Vertragliste 2\" onclick=\"winopen(this.href,'Vertragsliste 2'); return false\">Verträge Teil 2</a></p>\n";
+ if (!is_null($_SESSION["recht"]) && in_array("ve",$_SESSION["recht"]))
+ {
+ if ($mfile)
+ echo "<p> <a href=\"/fhiiqm/vertrag_ed.php?$getp\" target=\"_self\" class=\"sc\" title=\"Vertrag erfassen\">Weiteren Vertrag erfassen</a></p>\n";
+ else
+ 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