|
1 <?php |
|
2 |
|
3 /** |
|
4 * @author Bettina Schwarzer, Fritz-Haber-Institut |
|
5 * @copyright 07/2011 |
|
6 * |
|
7 * Form Raum |
|
8 */ |
|
9 |
|
10 include_once($_SERVER['DOCUMENT_ROOT'] ."/fhiiqm/inc/dbconnect.inc.php"); |
|
11 if (!isset($dbc) || !$dbc) $dbc = new dbconnection(); |
|
12 $okn = true; |
|
13 |
|
14 ?> |
|
15 <div align="center"> |
|
16 <?php |
|
17 if (strpos($_SERVER['PHP_SELF'],"ins") > -1) $text = "Eingabe"; else $text="Ändern"; |
|
18 ?> |
|
19 <h3><font face="Verdana, Arial, Helvetica, sans-serif"><?php echo $text;?> Räume</font></h3> |
|
20 <h5>* - Felder sind erforderlich!</h5> |
|
21 </div> |
|
22 <!-- <form action="<?php $_SERVER['PHP_SELF'] ?>" method="post" enctype="application/x-www-form-urlencoded" name="form_svc"> --> |
|
23 <form action="<?php $_SERVER['PHP_SELF'] ?>" method="post" enctype="multipart/form-data" name="form_raum" target="_self"> |
|
24 <div align="center"> |
|
25 <table width="50%" border="0" cellspacing="3" cellpadding="3"> |
|
26 <tr> |
|
27 <td>Raum-Nummer *</td> |
|
28 <td><input name="raum[rnum]" type="text" size="10" maxlength="10" value="<?php echo $raum['rnum']; ?>"/> |
|
29 <?php |
|
30 if (isset($raum['rnum']) && $raum['rnum']<'!') |
|
31 { |
|
32 echo "<br><span class=\"red\">Raum-Nr. ist erforderlich!</span>\n"; |
|
33 $okn = false; |
|
34 } |
|
35 else |
|
36 if ($okn) $okn = true; else $okn=false; |
|
37 ?> |
|
38 </td> |
|
39 </tr> |
|
40 <tr> |
|
41 <td>Raum-Bezeichnung</td> |
|
42 <td><input name="raum[rbez]" type="text" size="30" maxlength="50" value="<?php echo $raum['rbez']; ?>"/> |
|
43 </td> |
|
44 </tr> |
|
45 <tr> |
|
46 <td>Haus *</td> |
|
47 <td><select name="raum[geb]"> |
|
48 <?php |
|
49 $sql = "SELECT geb_ID, geb_name FROM Haus ORDER BY 1"; |
|
50 if ($result = $dbc->queryObjectArray($sql)) |
|
51 { |
|
52 foreach ($result as $row) |
|
53 { |
|
54 if ($row->geb_ID == $raum['geb']) |
|
55 echo "<option selected value=\"$row->geb_ID\">$row->geb_ID - $row->geb_name</option>\n"; |
|
56 else |
|
57 echo "<option value=\"$row->geb_ID\">$row->geb_ID - $row->geb_name</option>\n"; |
|
58 } |
|
59 } |
|
60 ?> |
|
61 </select> |
|
62 </td> |
|
63 </tr> |
|
64 <tr> |
|
65 <td>Raum-Typ</td> |
|
66 <td><select name="raum[rtyp]"> |
|
67 <?php |
|
68 if ($raum['rtyp'] == -1) $select = " selected "; else $select = ""; |
|
69 echo "<option $select value=\"-1\"></option>\n"; |
|
70 $sql = "SELECT raumtyp_ID, raumtyp_bez FROM fhiiqm.Raum_Typ ORDER BY 2"; |
|
71 if ($result = $dbc->queryObjectArray($sql)) |
|
72 { |
|
73 foreach ($result as $row) |
|
74 { |
|
75 if ($row->raumtyp_ID == $raum['rtyp']) |
|
76 echo "<option selected value=\"$row->raumtyp_ID\">$row->raumtyp_bez</option>\n"; |
|
77 else |
|
78 echo "<option value=\"$row->raumtyp_ID\">$row->raumtyp_bez</option>\n"; |
|
79 } |
|
80 } |
|
81 ?> |
|
82 </select> |
|
83 </td> |
|
84 </tr> |
|
85 <tr> |
|
86 <td>Raum-Fläche (m<sup>2</sup>)</td> |
|
87 <td><input name="raum[rflae]" type="text" size="10" maxlength="10" value="<?php echo $raum['rflae']; ?>"/> |
|
88 </td> |
|
89 </tr> |
|
90 <tr> |
|
91 <td>Dateibezeichnung Raumplan (*)</td> |
|
92 <td><input name="raum[rfname]" type="text" size="50" maxlength="50" value="<?php echo $raum['rfname']; ?>"> |
|
93 <?php |
|
94 echo "<br />bitte <u>keine</u> Umlaute im Dateinamen angeben!"; |
|
95 if (isset($raum['rfname']) && $upd && is_uploaded_file($_FILES["rfile"]["tmp_name"]) && $raum['rfname']<'!') |
|
96 { |
|
97 echo "<br><span class=\"red\">Dateiname ist erforderlich!</span>\n"; |
|
98 $okn = false; |
|
99 } |
|
100 else |
|
101 { |
|
102 if ($raum['rfname']>='!' && file_exists("raeume/".$raum['rfname'])) |
|
103 echo "<br />Dokument anschauen: <a href='raeume/" . $raum['rfname'] ."'>" . $raum['rfname'] . "</a>"; |
|
104 if ($okn) $okn = true; else $okn=false; |
|
105 } |
|
106 ?> |
|
107 </td> |
|
108 </tr> |
|
109 |
|
110 <input type="hidden" name="MAX_FILE_SIZE" value="6000000"/> |
|
111 <input type="hidden" name="raum[okn]" value="<?php echo $okn; ?>"/> |
|
112 |
|
113 <!-- </table> |
|
114 </div> |
|
115 </form> --> |