<?php
/**
* @author Bettina Schwarzer, Fritz-Haber-Institut
* @copyright 07/2011
*
* Form Raum
*/
include_once($_SERVER['DOCUMENT_ROOT'] ."/fhiiqm/inc/dbconnect.inc.php");
if (!isset($dbc) || !$dbc) $dbc = new dbconnection();
$okn = true;
?>
<div align="center">
<?php
if (!is_null($_SESSION["recht"]) && !in_array("re",$_SESSION["recht"]))
$text="";
else
if (strpos($_SERVER['PHP_SELF'],"ins") > -1) $text = "Eingabe"; else $text="Ändern";
?>
<h3><font face="Verdana, Arial, Helvetica, sans-serif"><?php echo $text;?> Räume</font></h3>
<h5>* - Felder sind erforderlich!</h5>
</div>
<!-- <form action="<?php $_SERVER['PHP_SELF'] ?>" method="post" enctype="application/x-www-form-urlencoded" name="form_svc"> -->
<form action="<?php $_SERVER['PHP_SELF'] ?>" method="post" enctype="multipart/form-data" name="form_raum" target="_self">
<div align="center">
<table width="50%" border="0" cellspacing="3" cellpadding="3">
<tr>
<td>Raum-Nummer *</td>
<td><input name="raum[rnum]" type="text" size="10" maxlength="10" value="<?php echo $raum['rnum']; ?>"/>
<?php
if (isset($raum['rnum']) && $raum['rnum']<'!')
{
echo "<br><span class=\"red\">Raum-Nr. ist erforderlich!</span>\n";
$okn = false;
}
else
if ($okn) $okn = true; else $okn=false;
?>
</td>
</tr>
<tr>
<td>Raum-Bezeichnung</td>
<td><input name="raum[rbez]" type="text" size="30" maxlength="50" value="<?php echo $raum['rbez']; ?>"/>
</td>
</tr>
<tr>
<td>Haus *</td>
<td><select name="raum[geb]">
<?php
$sql = "SELECT geb_ID, geb_name FROM Haus ORDER BY 1";
if ($result = $dbc->queryObjectArray($sql))
{
foreach ($result as $row)
{
if ($row->geb_ID == $raum['geb'])
echo "<option selected value=\"$row->geb_ID\">$row->geb_ID - $row->geb_name</option>\n";
else
echo "<option value=\"$row->geb_ID\">$row->geb_ID - $row->geb_name</option>\n";
}
}
?>
</select>
</td>
</tr>
<tr>
<td>Raum-Typ</td>
<td><select name="raum[rtyp]">
<?php
if ($raum['rtyp'] == -1) $select = " selected "; else $select = "";
echo "<option $select value=\"-1\"></option>\n";
$sql = "SELECT raumtyp_ID, raumtyp_bez FROM fhiiqm.Raum_Typ ORDER BY 2";
if ($result = $dbc->queryObjectArray($sql))
{
foreach ($result as $row)
{
if ($row->raumtyp_ID == $raum['rtyp'])
echo "<option selected value=\"$row->raumtyp_ID\">$row->raumtyp_bez</option>\n";
else
echo "<option value=\"$row->raumtyp_ID\">$row->raumtyp_bez</option>\n";
}
}
?>
</select>
</td>
</tr>
<tr>
<td>Raum-Fläche (m<sup>2</sup>)</td>
<td><input name="raum[rflae]" type="text" size="10" maxlength="10" value="<?php echo $raum['rflae']; ?>"/>
</td>
</tr>
<tr>
<td>Dateibezeichnung Raumplan (*)</td>
<td><input name="raum[rfname]" type="text" size="50" maxlength="50" value="<?php echo $raum['rfname']; ?>">
<?php
echo "<br />bitte <u>keine</u> Umlaute im Dateinamen angeben!";
if (isset($raum['rfname']) && $upd && is_uploaded_file($_FILES["rfile"]["tmp_name"]) && $raum['rfname']<'!')
{
echo "<br><span class=\"red\">Dateiname ist erforderlich!</span>\n";
$okn = false;
}
else
{
if ($raum['rfname']>='!' && file_exists("raeume/".$raum['rfname']))
echo "<br />Dokument anschauen: <a href='raeume/" . $raum['rfname'] ."'>" . $raum['rfname'] . "</a>";
if ($okn) $okn = true; else $okn=false;
}
?>
</td>
</tr>
<input type="hidden" name="MAX_FILE_SIZE" value="6000000"/>
<input type="hidden" name="raum[okn]" value="<?php echo $okn; ?>"/>
<!-- </table>
</div>
</form> -->