Location: PHPKode > projects > WebETB > auftraege/index.php4
<?php
/******************************************************************************/
/*	MODUL:	auftraege/index.php4    														*/
/*																										*/
/* DATUM:	27.03.2006, Version 0.1															*/
/* BESCHR.: Einsatzauftraege erfassen und offene Auflisten                    */
/*																										*/
/*	AUTOR:   Marcus Groh																			*/
/*	LIZENZ:  GPL v2 vom Juni 1991 															*/
/*																										*/
/*	AENDERUNGEN:	01.07.2004        -initiale Version								   */
/*                27.03.2006 v 0.1, -Versionskennzeichnung eingefuehrt        */
/*                                  -Code unter GPL v2 gestellt               */
/*                                  -Tabellenname dynamisiert                 */
/*																										*/
/******************************************************************************/
$allowed_groups=array("elw");
include ('../_include/header_1.php4');
?>
      <br>
      <center>
<?
if ( ( $writemode == "TRUE" ) && ( $isclosed == "FALSE" ) )
{
   if (isset ($insert) )
   {
      // convert date format
      list ($D, $M, $Y) = split ('[/.-]', $frm_datum);
      $mod_datum="$Y-$M-$D";
 
      // Calc. new lfdnr for etb
      $select_etb="select lfdnr from $T_etb where eid=$eid";
      $result_etb=@mysql_db_query($database["database"],$select_etb,$db);
      $lfd=mysql_num_rows($result_etb);
      $lfd++;

      // insert values
      $insert_auftrag="insert into $T_auftrag values ('%','$frm_meld','$frm_ort','$frm_bem','N','$mod_datum','$frm_zeit','$frm_von','$frm_kid','$frm_pid','$eid')";
      mysql_db_query($database["database"],$insert_auftrag,$db);
 
      $insert_etb="insert into $T_etb values ('$lfd','NULL','$frm_kid','$frm_von','NULL','$mod_datum','$frm_zeit','Auftrag:<BR>Meldung: $frm_meld<BR>Ort: $frm_ort<BR>Bemerkung: $frm_bem','Auftrag eroeffnet','NULL','$uid','$eid')";
      mysql_db_query($database["database"],$insert_etb,$db);
      // reset frm-setting
      $insert="";
   }

   ?>
      <form action="" method=post name="insert_auftrag">
      <table border="0" cellpadding="0" cellspacing="0" width="950">
      <tr>
         <th colspan="13">Neuen Auftrag er&ouml;ffnen</th>
      </tr>
      <tr>
         <td width="5"><img src="../_img/spacer.gif" width="5" height="1" border="0"></td>
         <td width="70" valign="middle">Meldung :</td>
         <td><input type="text" name="frm_meld" style="width: 200px; border: 1px solid silver;"></td>
         <td width="20">&nbsp;</td>
         <td width="50" valign="middle">Ort :</td>
         <td><input type="text" name="frm_ort" style="width: 300px; border: 1px solid silver;"></td>
         <td width="20">&nbsp;</td>
         <td width="50" valign="middle">Zeit :</td>
         <td><input type="text" align="right" name="frm_zeit" value="<? echo date("H:i:s"); ?>" style="width: 60px; border: 1px solid silver;"></td>
         <td width="20">&nbsp;</td>
         <td width="70" valign="middle">Datum :</td>
         <td><input type="text" align="right"   name="frm_datum" value="<? echo date("d.m.y"); ?>" style="width: 60px; border: 1px solid silver;"></td>
         <td width="5"><img src="../_img/spacer.gif" width="5" height="1" border="0"></td>
      </tr>
      <tr>
         <td colspan="13" width="950" height="1"><img src="../_img/spacer.gif" width="950" height="1" border="0"></td>
      </tr>
      <tr>
         <td width="5"><img src="../_img/spacer.gif" width="5" height="1" border="0"></td>
         <td width="70" valign="middle">Geber :</td>
         <td><input type="text" name="frm_von" style="width: 200px; border: 1px solid silver;"></td>
         <td width="20">&nbsp;</td>
         <td width="50" valign="middle">Bem. :</td>
         <td><input type="text" name="frm_bem" style="width: 300px; border: 1px solid silver;"></td>
         <td width="20">&nbsp;</td>
         <td width="90" colspan="2"  valign="middle">Auftragnehmer :</td>
         <td width="20">&nbsp;</td>
         <td colspan="2"><select name="frm_kid" size=1 style="width: 130px; border-width: 1px solid silver;">
            <?
               $select_kid="select kid, rufname from $T_kraefte where eid=$eid";
               $result=@mysql_db_query($database["database"],$select_kid,$db);
               while ( $row=mysql_fetch_array($result) )
               {
                  $kid=$row['kid'];
                  $rufname=$row['rufname'];
                  echo "<option value=\"$kid\">$rufname\n";
               }
            ?>

            </td>
         <td width="5"><img src="../_img/spacer.gif" width="5" height="1" border="0"></td>
      </tr>
      <tr>
         <td colspan="13" width="950" height="1"><img src="../_img/spacer.gif" width="950" height="1" border="0"></td>
      </tr>
      <tr>
         <td width="5"><img src="../_img/spacer.gif" width="5" height="1" border="0"></td>
         <td width="70" valign="middle">Referenz :</td>
         <td colspan="3"><select name="frm_pid" style="width: 270; border: 1px solid silver;">
            <option value="">
            <?
               $select_aid="select aid, meldung from $T_auftrag where eid=$eid and erledigt like 'N'";
               $result=@mysql_db_query($database["database"],$select_aid,$db);
               while ( $row=mysql_fetch_array($result) )
               {
                  $aid=$row['aid'];
                  $meldung=$row['meldung'];
                  echo "<option value=\"$aid\">$meldung\n";
               }
            ?>
            </td>
         <td colspan="7">&nbsp;</td>
         <td width="5"><img src="../_img/spacer.gif" width="5" height="1" border="0"></td>
      </tr>
      <tr>
         <td colspan="13" width="950" height="1"><img src="../_img/spacer.gif" width="950" height="1" border="0"></td>
      </tr>
      </table>
      <br>
      <input type=submit VALUE="Anlegen" style="border: 1px solid silver;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
      <input type=reset VALUE="Abbrechen" style="border: 1px solid silver;">
      <input type=hidden name="insert" value="TRUE">
      </form>
   <?

}
?>   
   <table border="0" cellpadding="0" cellspacing="0" width="980">
   <tr>
      <th colspan="9">Die letzten 10 offenen Auftr&auml;ge</th>
      <th width="16" style="background-color: #E0E0E0;" ><img src="../_img/spacer.gif" width="16" border="0"></th>
   </tr>
   <tr>
      <td width="30"  align="left"><p id="GR07">&nbsp;</p></td>
      <td width="200" align="left"><p id="GR07">Meldung</p></td>
      <td width="200" align="left"><p id="GR07">&nbsp;&nbsp;Ort</p></td>
      <td width="174" align="left"><p id="GR07">&nbsp;&nbsp;&nbsp;&nbsp;Bemerkung</p></td>
      <td width="70"  align="middle"><p id="GR07">&nbsp;Datum</p></td>      
      <td width="60"  align="middle"><p id="GR07">&nbsp;&nbsp;&nbsp;Zeit</p></td>
      <td width="190" align="left"><p id="GR07">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Auftr.-Geber</p></td>
      <td width="20"  align="left" colspan="2"><p id="GR07">&nbsp;</p></td>
      <td width="16"  style="background-color: #E0E0E0;"><img src="../_img/spacer.gif" width="16" border="0"></td>

   </tr>
   <tr>
      <td colspan="9" height="1" width="964" style="background-color: #000000;"><img src="../_img/spacer.gif" height="1" width="964" border="0"></td>
      <td width="16" style="background-color: #E0E0E0;" ><img src="../_img/spacer.gif" height="1" width="16" border="0"></td>
   </tr>
   <?
   
   // Select Auftraege
   $select_auftraege="select * from $T_auftrag where erledigt like 'N' and eid=$eid";
   $result=@mysql_db_query($database["database"],$select_auftraege,$db);
   $select_auftraege_cnt=mysql_num_rows($result);
   
   if ( $select_auftraege_cnt <= 0 )
   {
      echo "<tr><td colspan=\"9\">Zur Zeit sind keine offenen Auftr&auml;ge vorhanden.</td>\n";
      echo "<td width=\"16\" style=\"background-color: #E0E0E0;\" ><img src=\"../_img/spacer.gif\" height=\"1\" width=\"16\" border=\"0\"></td></tr>\n";
   }
   else
   {
      ?>
      <tr>
         <td colspan="10">
         <iframe src="list_auftraege.php4" HEIGHT="280" WIDTH="980" name="_AUFTR" FRAMEBORDER="0" FRAMESPACING="0" BORDER="0" MARGINWIDTH="0" MARGINHEIGHT="0" TOPMARGIN="0" NORESIZE SCROLLING="yes"></iframe>
         </td>
      </tr>
      <?
   }
   ?>
   </table>
   </center>
<?
include ('../_include/footer_1.php4');

?>
Return current item: WebETB