fhiiqm/test/raum_list.php
author Bettina Schwarzer <schwarzer@fhi-berlin.mpg.de>
Fri, 16 Nov 2012 10:40:03 +0100
changeset 32 c2d325791e24
parent 27 d92bbe898f32
permissions -rw-r--r--
+ Mitarbeiter - Telefon

<!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" /> 

	<title>Raumliste</title>
</head>

<body>

<?php

/**
 * @author Bettina Schwarzer, Fritz-Haber-Institut
 * @copyright 07/2011
 * 
 * Liste Raeume
 */

    error_reporting(E_ALL ^ E_NOTICE);

print_r($_SERVER); echo "<br /><br />";    
	include_once($_SERVER['DOCUMENT_ROOT'] ."/fhiiqm/inc/dbconnect.inc.php");
//	include_once("http://achilleus/fhiiqm/inc/dbconnect.inc.php"); //nur wenn 'allow_url_include=1' in php.ini, nicht notwendig
	$dbc = new dbconnection();

    if (!$start) $start=0;
    $sql = "SELECT raum_ID, raum_nr, raum_name, geb_ID, r.raumtyp_ID, raumtyp_bez, raum_flaeche, raum_file 
            FROM `fhiiqm`.`Raum` r LEFT OUTER JOIN fhiiqm.Raum_Typ t ON r.raumtyp_ID = t.raumtyp_ID
            ORDER BY geb_ID, raum_nr ";  // LIMIT $start,20 ;";
    $result = $dbc ->queryObjectArray($sql);
    if ($result)
    {
		$bg1 = "#F8F8F8";
		$bg2 = "#DEDFE1";
		$bg = "#FFFFFF";
        
     
        echo "<div align='center'>\n";
        echo "<p><b>Liste der erfassten R&auml;ume</b></p>\n";
        printf ("<p>Es wurden %s R&auml;ume gefunden.</p>", $dbc->numrows($sql));
        echo "<table>\n";
        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>
        echo "</tr>\n";
        foreach ($result as $row)
        {
			if ($bg == $bg1) $bg = $bg2; else $bg = $bg1;
            echo "<tr bgcolor='" . $bg . "'><td><b>$row->raum_nr</b></td>";    
            echo "<td>$row->raum_name</td>";
            echo "<td>$row->geb_ID</td>";
            echo "<td>$row->raumtyp_bez</td>";
            echo "<td>" . str_replace(".",",",$row->raum_flaeche) . "</td>";
            echo "<td><a href=\"http://achilleus/fhiiqm/raeume/$row->raum_file\">$row->raum_file</td>";
 //           echo "<td><a href='/fhiiqm/raum_upd.php?uid=$row->raum_ID'><img src=\"/fhiiqm/img/edit.gif\" alt='edit' title='edit' border='0'/></a></td></tr>\n";
            echo "</tr>\n";
        }
        echo "</table></div>\n";
    }
    $dbc -> close();
    echo "<p>&nbsp;&nbsp;&nbsp;<a href=\"/fhiiqm/raum_ins.php\" target=\"_self\" title=\"Raum erfassen\">Weiteren Raum erfassen</a></p>\n";    

?>
</body>
</html>