fhiiqm/form/anlage_form.inc.php
changeset 18 d0aa14180761
child 19 33ee23fafd4d
equal deleted inserted replaced
17:f990704af47b 18:d0aa14180761
       
     1 <?php
       
     2 
       
     3 /**
       
     4  * @author Bettina Schwarzer, Fritz-Haber-Institut
       
     5  * @copyright 11/2011
       
     6  * 
       
     7  * Form Anlage
       
     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     if (!$al["geb"]) $al["geb"]="A";
       
    14 
       
    15 ?>
       
    16 <div align="center">
       
    17 <table>
       
    18 <tr><td class="bigger">Die Auswahl eines Anlagenverantwortlichen geschieht durch<br />Eingeben von mindesten 2 Zeichen in das Verantwortlicher-Feld.
       
    19 </td></tr>
       
    20 <tr><td class="bigger"><div class="red">Achtung! </div>Umlaute wie '&auml;', '&uuml;', '&ouml;', '&szlig;' werden nicht gefunden, bitte benachbarte Zeichen eingeben.</td></tr>
       
    21 <tr><td class="bigger">&nbsp;</td></tr>
       
    22 </table>
       
    23 </div>
       
    24 <form action="<?php $_SERVER['PHP_SELF'] ?>" method="post" enctype="application/x-www-form-urlencoded" name="fanl"> 
       
    25 <div align="center">
       
    26     <table border="0" cellspacing="3" cellpadding="3">
       
    27 <!--        <div class="ui-widget"> -->
       
    28         <tr><td>Anlagenbezeichnung *</td>
       
    29             <td valign="top"><input type="text" name="al[bez]" id="albez" size="30" maxlength="50" value="<?php echo $al['bez']; ?>"/>
       
    30             <?php 
       
    31 			     if (isset($al['bez']) && $al['bez']<'!')
       
    32 				{
       
    33 					echo "<br><span class=\"red\">Anlagenbezeichnung ist erforderlich!</span>\n";
       
    34 					$okn = false;
       
    35 				}
       
    36 				else
       
    37 					if ($okn) $okn = true; else $okn=false;
       
    38              ?> 
       
    39             </td>
       
    40         </tr>
       
    41         <tr><td>Anlagenbeschreibung</td>
       
    42             <td><textarea name="al[beschr]" cols="50" rows="5"><?php echo $al['beschr']; ?></textarea></td>
       
    43         </tr>
       
    44         <tr><td>Kategorie</td>
       
    45             <td valign="top">
       
    46                  <select name="al[kat]">
       
    47                 <?php 
       
    48                     if ($al['kat'] == -1) $select = " selected "; else $select = "";
       
    49                     echo "<option $select value=\"-1\"></option>\n";
       
    50                     $sql = "SELECT al_kat_bez, al_kat_ID FROM `fhiiqm`.`A_Kategorie` ORDER BY 1";
       
    51                     if ($result = $dbc->queryObjectArray($sql))
       
    52                     {
       
    53                         foreach ($result as $row)
       
    54                         {
       
    55                             if ($row->al_kat_ID == $al['kat'])
       
    56         					   echo "<option selected value=\"$row->al_kat_ID\">$row->al_kat_ID: $row->al_kat_bez</option>\n";
       
    57         				    else
       
    58         					   echo "<option value=\"$row->al_kat_ID\">$row->al_kat_ID: $row->al_kat_bez</option>\n";
       
    59                         }
       
    60                 }
       
    61                 ?>
       
    62                 </select>            
       
    63             </td>
       
    64         </tr>
       
    65         <tr><td>Bef&auml;higungsgrad</td>
       
    66             <td valign="top">
       
    67                  <select name="al[befg]">
       
    68                 <?php 
       
    69                     if ($al['befg'] == -1) $select = " selected "; else $select = "";
       
    70                     echo "<option $select value=\"-1\"></option>\n";
       
    71                     $sql = "SELECT al_befgrad_bez, al_befgrad_ID FROM `fhiiqm`.`A_BefGrad` ORDER BY 1";
       
    72                     if ($result = $dbc->queryObjectArray($sql))
       
    73                     {
       
    74                         foreach ($result as $row)
       
    75                         {
       
    76                             if ($row->al_befgrad_ID == $al['befg'])
       
    77         					   echo "<option selected value=\"$row->al_befgrad_ID\">$row->al_befgrad_ID: $row->al_befgrad_bez</option>\n";
       
    78         				    else
       
    79         					   echo "<option value=\"$row->al_befgrad_ID\">$row->al_befgrad_ID: $row->al_befgrad_bez</option>\n";
       
    80                         }
       
    81                 }
       
    82                 ?>
       
    83                 </select>            
       
    84             </td>
       
    85         </tr>
       
    86         <tr><td>Pr&uuml;fart</td>
       
    87             <td valign="top">
       
    88                  <select name="al[part]">
       
    89                 <?php 
       
    90                     if ($al['part'] == -1) $select = " selected "; else $select = "";
       
    91                     echo "<option $select value=\"-1\"></option>\n";
       
    92                     $sql = "SELECT al_pruefart_bez, al_pruefart_ID FROM `fhiiqm`.`A_PruefArt` ORDER BY 1";
       
    93                     if ($result = $dbc->queryObjectArray($sql))
       
    94                     {
       
    95                         foreach ($result as $row)
       
    96                         {
       
    97                             if ($row->al_pruefart_ID == $al['part'])
       
    98         					   echo "<option selected value=\"$row->al_pruefart_ID\">$row->al_pruefart_ID: $row->al_pruefart_bez</option>\n";
       
    99         				    else
       
   100         					   echo "<option value=\"$row->al_pruefart_ID\">$row->al_pruefart_ID: $row->al_pruefart_bez</option>\n";
       
   101                         }
       
   102                 }
       
   103                 ?>
       
   104                 </select>            
       
   105             </td>
       
   106         </tr>
       
   107         <tr><td>Standort</td>
       
   108             <td valign="top">Haus&nbsp;
       
   109                  <select name="al[geb]" onchange="this.form.submit();">
       
   110                 <?php 
       
   111                     $sql = "SELECT geb_ID, geb_name FROM `fhiiqm`.`Haus` ORDER BY 1";
       
   112                     if ($result = $dbc->queryObjectArray($sql))
       
   113                     {
       
   114                         foreach ($result as $row)
       
   115                         {
       
   116                             if ($row->geb_ID == $al['geb'])
       
   117         					   echo "<option selected value=\"$row->geb_ID\">$row->geb_ID: $row->geb_name</option>\n";
       
   118         				    else
       
   119         					   echo "<option value=\"$row->geb_ID\">$row->geb_ID: $row->geb_name</option>\n";
       
   120                         }
       
   121                 }
       
   122                 ?>
       
   123                 </select>
       
   124                 &nbsp;&nbsp;Raum&nbsp;            
       
   125                  <select name="al[raum]">
       
   126                 <?php 
       
   127                     if ($al['raum'] == -1) $select = " selected "; else $select = "";
       
   128                     echo "<option $select value=\"-1\"></option>\n";
       
   129                     $sql = "SELECT raum_ID, raum_nr, raum_name FROM `fhiiqm`.`Raum` WHERE geb_ID='" . $al['geb'] ."' ORDER BY 2";
       
   130                     if ($result = $dbc->queryObjectArray($sql))
       
   131                     {
       
   132                         foreach ($result as $row)
       
   133                         {
       
   134                             if ($row->raum_ID == $al['raum'])
       
   135         					   echo "<option selected value=\"$row->raum_ID\">$row->raum_nr $row->raum_name</option>\n";
       
   136         				    else
       
   137         					   echo "<option value=\"$row->raum_ID\">$row->raum_nr $row->raum_name</option>\n";
       
   138                         }
       
   139                 }
       
   140                 ?>
       
   141                 </select>
       
   142             </td>
       
   143         </tr>
       
   144         <tr><td>Verantwortlicher</td>
       
   145             <td valign="top"><input class="long20" type="text" name="al[persknr]" id="persknr" value="<?php echo $al['persknr']; ?>"/>
       
   146             </td>
       
   147         </tr>
       
   148     <input type="hidden" name="al[pid]" id="pid" value="<?php echo $al['pid']; ?>"/>
       
   149     <input type="hidden" name="al[okn]" value="<?php echo $okn; ?>"/>
       
   150