Adjust hour field names
authorJoey Schulze <joey@infodrom.org>
Thu, 15 Apr 2010 08:43:28 +0000 (10:43 +0200)
committerJoey Schulze <joey@infodrom.org>
Thu, 15 Apr 2010 08:43:28 +0000 (10:43 +0200)
masks/arbeitsberichte.php

index 93732ae..6a3de29 100644 (file)
@@ -228,7 +228,7 @@ $formular = <<<EOC
 <tr>
  <td width="30%"><select id="edit_geraet" name="geraet" onchange="select_geraet(this)"><option value="">Bitte w√§hlen Sie</option></select></td>
  <td width="30%"><select id="edit_anbaugeraet" name="anbaugeraet"></select></td>
- <td width="30%"><input id="edit_geraetstunden" name="stunden" size="5" type="text"></td>
+ <td width="30%"><input id="edit_geraetstunden" name="geraetstunden" size="5" type="text"></td>
  <td width="10%" align="right"valign="bottom"><button onclick="return replicate_geraete()" style="color: red; font-weight: bold;">+&nbsp;</button></td>
 </tr>
 </table>
@@ -294,6 +294,7 @@ function einsatz_insert($mask)
       $app = ':'.$num;
       if (empty($_POST['personal'.$app])) break;
     }
+    $_POST['stunden'.$app] = str_replace(',','.',$_POST['stunden'.$app]);
     $sql = sprintf("INSERT INTO einsatzpersonal (einsatz,personal,stunden,sys_user,sys_edit) " .
                   "VALUES (%d,%d,%.2f,'%s',now())",
                   $einsatz,
@@ -321,7 +322,7 @@ function einsatz_insert($mask)
                   $einsatz,
                   $_POST['geraet'.$app],
                   empty($_POST['anbaugeraet'.$app]) ? 'NULL' : intval($_POST['anbaugeraet'.$app]),
-                  $_POST['stunden'.$app],
+                  $_POST['geraetstunden'.$app],
                   pg_escape_string($_SESSION['sys']['login']));
 
     $sth = pg_query($sql);