fhiiqm/info_flist.php
changeset 29 72f79dab938e
parent 25 482252ff12fd
child 31 0a1eb975fbd9
equal deleted inserted replaced
28:8d8bce56918f 29:72f79dab938e
    65     $filter = $_POST["filter"];
    65     $filter = $_POST["filter"];
    66     if (!isset($filter) && !$filter) $filter = $_GET["b"];   
    66     if (!isset($filter) && !$filter) $filter = $_GET["b"];   
    67 
    67 
    68     $subf   = $_POST["subf"]; // submit
    68     $subf   = $_POST["subf"]; // submit
    69     
    69     
    70     if (!isset($fnum) && !$fnum) $fnum = 1;
    70     if (!isset($fnum) || !$fnum) $fnum = 1;
    71     if (!isset($filter) && !$filter) $filter = "";
    71     if (!isset($filter) || !$filter) $filter = "";
    72     if (!isset($sort) && !$sort) $sort = 15; // Kennzeichen
    72     if (!isset($sort) || !$sort) $sort = 15; // Kennzeichen
    73     if (!isset($dir) && !$dir)  $dir = "";
    73     if (!$dir || $dir < "!")  $dir = "";
    74 
    74 //    print_r ($_GET); echo "<br /><br />";
    75 	include_once($_SERVER['DOCUMENT_ROOT'] ."/fhiiqm/inc/dbconnect.inc.php");
    75 	include_once($_SERVER['DOCUMENT_ROOT'] ."/fhiiqm/inc/dbconnect.inc.php");
    76     include_once ($_SERVER['DOCUMENT_ROOT'] ."/fhiiqm/inc/func_lib.inc.php");
    76     include_once ($_SERVER['DOCUMENT_ROOT'] ."/fhiiqm/inc/func_lib.inc.php");
    77 
    77 
    78 	$dbc = new dbconnection();
    78 	$dbc = new dbconnection();
    79 
    79 
    80     $sql = "CALL info_flist($sort,'" . $dir . "',$fnum, '" . $filter . "',$start,$zeil,@anz);"; 
    80     $sql = "CALL info_flist($sort,'" . $dir . "',$fnum, '" . $filter . "',$start,$zeil,@anz);"; 
    81     // Parameter: Nr. Sortfeld, Sortierrichtung, Nr. Filterfeld, Filterbegriff, (StartNr DS) -1, Anzahl Zeilen=DS, Anzahl gefundener Raeume
    81     // Parameter: Nr. Sortfeld, Sortierrichtung, Nr. Filterfeld, Filterbegriff, (StartNr DS) -1, Anzahl Zeilen=DS, Anzahl gefundener Raeume
    82     // liefert: info_ID, iname, ilong, ityp, prod, adressat, author, idate, bdate, edate, lang, doc, infrel
    82     // liefert: info_ID, iname, ilong, ityp, prod, adressat, author, idate, bdate, edate, lang, doc, infrel, infsort, ityp_ID, raum_ID, geb_ID, al_bez
    83 //    echo "sql = $sql<br />";  
    83 //    echo "sql = $sql<br />";  
    84     $result = $dbc ->queryObjectArray($sql);
    84     $result = $dbc ->queryObjectArray($sql);
    85     
    85     
    86     if ($result)
    86     if ($result)
    87     {
    87     {
   139         tab_column(3,"Kurzinfo",$sort,$dir,0,$fnum,$filter,$start,$zeil);
   139         tab_column(3,"Kurzinfo",$sort,$dir,0,$fnum,$filter,$start,$zeil);
   140         tab_column(4,"Info-Typ",$sort,$dir,4,$fnum,$filter,$start,$zeil);
   140         tab_column(4,"Info-Typ",$sort,$dir,4,$fnum,$filter,$start,$zeil);
   141         tab_column(5,"Produkt",$sort,$dir,5,$fnum,$filter,$start,$zeil);
   141         tab_column(5,"Produkt",$sort,$dir,5,$fnum,$filter,$start,$zeil);
   142         tab_column(6,"Adressat",$sort,$dir,6,$fnum,$filter,$start,$zeil);
   142         tab_column(6,"Adressat",$sort,$dir,6,$fnum,$filter,$start,$zeil);
   143         tab_column(7,"Verantw.",$sort,$dir,7,$fnum,$filter,$start,$zeil);
   143         tab_column(7,"Verantw.",$sort,$dir,7,$fnum,$filter,$start,$zeil);
       
   144         echo "<th>Ort</th>";
   144         tab_column(8,"Autor",$sort,$dir,0,$fnum,$filter,$start,$zeil);
   145         tab_column(8,"Autor",$sort,$dir,0,$fnum,$filter,$start,$zeil);
   145         tab_column(9,"erst. am",$sort,$dir,0,$fnum,$filter,$start,$zeil);
   146         tab_column(9,"erst. am",$sort,$dir,0,$fnum,$filter,$start,$zeil);
   146         tab_column(10,"gilt ab",$sort,$dir,0,$fnum,$filter,$start,$zeil);
   147         tab_column(10,"gilt ab",$sort,$dir,0,$fnum,$filter,$start,$zeil);
   147         tab_column(11,"gilt bis",$sort,$dir,0,$fnum,$filter,$start,$zeil);
   148         tab_column(11,"gilt bis",$sort,$dir,0,$fnum,$filter,$start,$zeil);
   148         echo "<th>Sprache</th>";
   149 //        echo "<th>Sprache</th>";
       
   150         tab_column(12,"Status",$sort,$dir,12,$fnum,$filter,$start,$zeil);
   149         echo "<th>Dokument</th>";
   151         echo "<th>Dokument</th>";
   150         echo "<th>zu ID</th>";
   152         echo "<th>zu ID</th>";
   151         echo "<th>&nbsp;</th>";
   153         echo "<th>&nbsp;</th>";
   152         echo "<th>&nbsp;</th></tr>\n";
   154         echo "<th>&nbsp;</th></tr>\n";
   153         
   155         
   154 //        echo "<tr bgcolor='#68ACBF'><th>Raum-Nr.</th><th>Bezeichnung</th><th>Haus</th><th>Typ</th><th>Fl&auml;che (m<sup>2</sup>)</th><th>Raumplan</th><th>&nbsp;</th>
   156 //        echo "<tr bgcolor='#68ACBF'><th>Raum-Nr.</th><th>Bezeichnung</th><th>Haus</th><th>Typ</th><th>Fl&auml;che (m<sup>2</sup>)</th><th>Raumplan</th><th>&nbsp;</th>
   155 //                </tr>\n";
   157 //                </tr>\n";
       
   158 //      Format $row->prod: 'prod_name | prod_hier; prod_name | prod_hier; prod_name | prod_hier'
   156         foreach ($result as $row)
   159         foreach ($result as $row)
   157         {
   160         {
   158 			if ($bg == $bg1) $bg = $bg2; else $bg = $bg1;
   161 			if ($bg == $bg1) $bg = $bg2; else $bg = $bg1;
   159             echo "<tr bgcolor='" . $bg . "'><td class=\"left\">$row->info_ID</td>";    
   162             echo "<tr bgcolor='" . $bg . "'><td class=\"left\">$row->info_ID</td>";    
   160             echo "<td class=\"left\">$row->infsort</td>";
   163             echo "<td class=\"left\">$row->infsort</td>";
   161             echo "<td class=\"left\">$row->iname</td>";
   164             echo "<td class=\"left\">$row->iname</td>";
   162 //            if (strlen($row->ilong)>60) $row->ilong = substr($row->ilong,0,60)."...";
   165 //            if (strlen($row->ilong)>60) $row->ilong = substr($row->ilong,0,60)."...";
   163             echo "<td class=\"left\">" . nl2br($row->ilong) . "</td>";
   166             if ($row->ityp_ID == 81) $anl = " <b>&rarr; '" . $row->al_bez . "'</b>"; else $anl="";
       
   167             echo "<td class=\"left\">" . nl2br($row->ilong).$anl . "</td>";
   164             echo "<td class=\"left\">$row->ityp</td>";
   168             echo "<td class=\"left\">$row->ityp</td>";
   165             echo "<td class=\"left\">" . str_replace(";",";<br />",$row->prod) . "</td>";
   169             $prod = explode("; ",$row->prod);
       
   170             $prods = "";
       
   171             foreach ($prod as $val)
       
   172                 $prods .= "; " . substr($val,0,strpos($val,"|")-1);
       
   173             $prods = substr($prods,2);
       
   174 //            echo "<td class=\"left\">" . str_replace(";",";<br />",$row->prod) . "</td>";
       
   175             echo "<td class=\"left\">" . str_replace(";",";<br />",$prods) . "</td>";
   166             echo "<td class=\"left\">" . str_replace(";","<br />",$row->adressat) . "</td>";
   176             echo "<td class=\"left\">" . str_replace(";","<br />",$row->adressat) . "</td>";
   167             echo "<td class=\"left\">" . str_replace(";","<br />",$row->verantw) . "</td>";
   177             echo "<td class=\"left\">" . str_replace(";","<br />",$row->verantw) . "</td>";
       
   178             if ($row->ityp_ID == 7 || substr($row->ityp_ID,0,1) == 8)   // 7 = Betriebsstörung, 8 = Betriebsanweisung
       
   179             {    if ($row->raum_ID)
       
   180                 {
       
   181                     $sql = "SELECT geb_ID, raum_nr FROM Raum WHERE raum_ID = $row->raum_ID";
       
   182                     $res = $dbc -> queryObjectArray($sql);
       
   183                     foreach ($res as $ro)
       
   184                         echo "<td>$ro->geb_ID, $ro->raum_nr</td>";
       
   185                 }
       
   186                 elseif ($row->geb_ID && !$row->raum_ID)
       
   187                     echo "<td>$row->geb_ID</td>";
       
   188                 else echo "<td>&nbsp;</td>";
       
   189             }
       
   190             else echo "<td>&nbsp;</td>";
   168             echo "<td class=\"left\">$row->author</td>";
   191             echo "<td class=\"left\">$row->author</td>";
   169             if ($row->idate)
   192             if ($row->idate)
   170             {
   193             {
   171                 $dat = new DateTime($row->idate);    
   194                 $dat = new DateTime($row->idate);    
   172                 echo "<td class=\"left\">" . $dat->format('d.m.Y')."</td>";
   195                 echo "<td class=\"left\">" . $dat->format('d.m.Y')."</td>";
   182             {
   205             {
   183                 $dat = new DateTime($row->edate);    
   206                 $dat = new DateTime($row->edate);    
   184                 echo "<td class=\"left\">" . $dat->format('d.m.Y')."</td>";
   207                 echo "<td class=\"left\">" . $dat->format('d.m.Y')."</td>";
   185             }
   208             }
   186             else  echo "<td>&nbsp;</td>";       
   209             else  echo "<td>&nbsp;</td>";       
   187             echo "<td class=\"left\">$row->lang</td>";
   210 //            echo "<td class=\"left\">$row->lang</td>";
       
   211             echo "<td class=\"left\">$row->freigabe</td>";
   188             if (file_exists("infos/".$row->doc))
   212             if (file_exists("infos/".$row->doc))
   189             {
   213             {
   190                 $doc = substr($row->doc,strpos($row->doc,"_")+1); 
   214                 $doc = substr($row->doc,strpos($row->doc,"_")+1); 
   191                 echo "<td class=\"left\"><a href=\"infos/$row->doc\">$doc</td>";
   215                 echo "<td class=\"left\"><a href=\"infos/$row->doc\">$doc</td>";
   192             }
   216             }
   193             else    
   217             else    
   194                 echo "<td class=\"left\">$row->doc</td>";
   218                 echo "<td class=\"left\">$row->doc</td>";
   195             echo "<td class=\"left\">$row->infrel</td>";
   219             echo "<td class=\"left\">$row->infrel</td>";
   196             echo "<td><a href='/fhiiqm/info_ed.php?i=$row->info_ID'><img src=\"/fhiiqm/img/edit.gif\" alt='edit' title='edit' border='0'/></a></td>";
   220             $getp = "&s=$sort&d=$dir&f=$fnum&b=$filter&st=$start&z=$zeil";
   197             echo "<td><a href='/fhiiqm/info_ed.php?i=$row->info_ID&d=1'><img src=\"/fhiiqm/img/duplicate.gif\" alt='duplizieren' title='duplizieren' border='0'/></a></td></tr>\n";
   221             if ($row->ityp_ID == 7 || substr($row->ityp_ID,0,1) == 8) $ref = "/fhiiqm/info_betrst_ed.php?i=$row->info_ID&t=$row->ityp_ID$getp"; else $ref="/fhiiqm/info_ed.php?i=$row->info_ID$getp";
       
   222             echo "<td><a href='$ref'><img src=\"/fhiiqm/img/edit.gif\" alt='edit' title='edit' border='0'/></a></td>";
       
   223             echo "<td><a href='$ref&dp=1'><img src=\"/fhiiqm/img/duplicate.gif\" alt='duplizieren' title='duplizieren' border='0'/></a></td></tr>\n";
   198         }
   224         }
   199         echo "</table></div>\n";
   225         echo "</table></div>\n";
   200 
   226 
   201         echo "<br />&nbsp;&nbsp;&nbsp;";
   227         echo "<br />&nbsp;&nbsp;&nbsp;";
   202         
   228