Location: PHPKode > projects > WebETB > etb/index.php4
<?php
/******************************************************************************/
/*	MODUL:	etb/index.php4          														*/
/*																										*/
/* DATUM:	27.03.2006, Version 0.1															*/
/* BESCHR.:	Eintragen und anzeigen von Daten des Einsatztagebuches            */
/*																										*/
/*	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');

   // Aktuelles Datum und Uhrzeit bei Seitenaufruf ermitteln
   $ACT_TIME=date("Hi");
   $ACT_DATE=date("dmy");
   $FIELD_ONOFF="disabled";
   
?>
   <br>
   <center>
<?
if (!isset($frm_set_date)) {  $frm_set_date=FALSE; }
if (!isset($frm_set_time)) {  $frm_set_time=FALSE; }

if ( ( $writemode == "TRUE" ) && ( $isclosed == "FALSE" ) )
{
    // Datensatz eintragen
    if ( isset($insert) )
    {
       //check "VON"-field
       if ( $vdbval == "true" )
       {
          $von_kid=$dbvon;
          $von_txt="NULL";
       }
       else
       {
          $von_kid="NULL";
          $von_txt="$frm_von";
       }

       //check "AN"-field
       if ( $adbval == "true" )
       {
          $an_kid=$dban;
          $an_txt="NULL";
       }
       else
       {
          $an_kid="NULL";
          $an_txt="$frm_an";
       }
 
       //check "Bezug"-Field
/*
       if ( isset($bezug))
       {
          $bezug=$bezug_nr;
       }
       else
       {
          $bezug="NULL";
       }
*/
       // Get other values from form
      $text=$text;
      $bemerkung=$bemerk;
      $bezug=$bezug_nr;
      $datum=date("y-m-d");
      $zeit=date("H:i:s");
      
      // Datum und Zeit ermitteln oder manuelle vorgabe uebernehmen
      if ( $frm_set_date == TRUE )
      {
         $datum=conv_tactical_date($frm_man_date);
      }
       if ( $frm_set_time == TRUE )
      {
         $zeit=conv_tactical_time($frm_man_time);
      }
      
 
      // Status auswerten
      if ( $frm_status != "" )
      {
         if ($frm_status <= "9" )
         {
            $text="Status $frm_status : $text";
            $sosi=", sosi='N' ";
         }
         else
         {
            $frm_status=$frm_status-10;
            $text="Status $frm_status/S : $text";
            $sosi=", sosi='Y' ";
         }
         $modify_helper="Update $T_kraefte set status='$frm_status' $sosi where kid=$von_kid and eid=$eid";
         mysql_db_query($database["database"],$modify_helper,$db);
      }

      // Calc. new lfdnr
      $select_etb="select lfdnr from $T_etb where eid=$eid";
      $result=@mysql_db_query($database["database"],$select_etb,$db);
      $lfd=mysql_num_rows($result);
      $lfd++;

      // Insert values
      $insert_etb="insert into $T_etb values ('$lfd','$von_kid','$an_kid','$von_txt','$an_txt','$datum','$zeit','$text','$bemerkung','$bezug','$uid','$eid')";
      mysql_db_query($database["database"],$insert_etb,$db);

      // reset value
      $insert="";
    }
   ?>
   <form action="" method=post name="insert_etb">
   <table border="0" cellpadding="0" cellspacing="0" width="800">
   <tr>
      <th colspan="23">Eintrag ins Einsatztagebuch</th>
   </tr>
   <tr>
      <?
         // format table layout
         for ( $i=0; $i <=13; $i++)
         {
            echo "      <td width=\"25\" height=\"1\"><img src=\"../_img/spacer.gif\" width=\"25\" height=\"1\" border=\"0\"></td>\n";
         }
         for ( $i=0; $i <=8; $i++)
         {
            echo "      <td width=\"50\" height=\"1\"><img src=\"../_img/spacer.gif\" width=\"50\" height=\"1\" border=\"0\"></td>\n";
         }         
      ?>
   </tr>
   <tr>
      <td>Von</td>
      <td><input type=radio checked value="true" name="vdbval"></td>
      <td colspan="4"><select name="dbvon" size=1 style="width: 100px; border-width: 1px solid silver;">
         <?
            // Get list of kraefte
            $select_kraefte="select kid, rufname from $T_kraefte where eid=$eid order by rufname";
            $result=@mysql_db_query($database["database"],$select_kraefte,$db);
            while ( $row=mysql_fetch_array($result) )
               {
                  $rufname=$row['rufname'];
                  $kid=$row['kid'];
                  echo "         <option value=\"$kid\">$rufname\n";
               }
         ?>
      </td>
      <td>An:</td>
      <td><input type=radio checked value="true" name="adbval">&nbsp;</td>
      <td colspan="4"><select name="dban" size=1 style="width: 100px; border-width: 1px solid silver;">
         <?
            // Get list of kraefte
            $select_kraefte="select kid, rufname from $T_kraefte where eid=$eid order by rufname";
            $result=@mysql_db_query($database["database"],$select_kraefte,$db);
            while ( $row=mysql_fetch_array($result) )
               {
                  $rufname=$row['rufname'];
                  $kid=$row['kid'];
                  echo "         <option value=\"$kid\">$rufname\n";
               }
         ?>
      </td>
      <td colspan="2" width="70"><select name="frm_status" size=1 style="width: 50px; border-width: 1px solid silver;">
          <option value="">
          <option value="0">S0
          <option value="1">S1
          <option value="2">S2
          <option value="3">S3
          <option value="13">S3/S
          <option value="4">S4
          <option value="14">S4/S
          <option value="5">S5
          <option value="6">S6
          <option value="7">S7
          <option value="17">S7/S
          <option value="8">S8
          <option value="18">S8/S
          <option value="9">S9          
      </td>
      <td>&nbsp;&nbsp;Text:</td>
      <td colspan="8"><input type=text name=text style="width: 430px; border: 1px solid silver;"></td>      
   </tr>
   <tr>
      <td colspan="23" height="1" width="700"><img src="../_img/spacer.gif" width="700" height="1" border="0"></td>
   </tr>
   <tr>
      <td>&nbsp;</td>
      <td><input type=radio value="false" name="vdbval"></td>
      <td colspan="4"><input type=text name="frm_von" style="width: 100px; border: 1px solid silver;"></td>
      <td>&nbsp;</td>
      <td><input type=radio value="false" name="adbval"></td>
      <td colspan="4"><input type=text name="frm_an" style="width: 100px; border: 1px solid silver;"></td>
      <td colspan="3">&nbsp;&nbsp;&nbsp;Bemerkung:</td>
      <td colspan="4"><input type=text name="bemerk" style="width: 200px; border: 1px solid silver;"></td>
      <td>Patient:</td>
      <td colspan="2"><select name="bezug_nr" size=1 style="width: 105px; border-width: 1px solid silver;">
      <option value="">
         <?
            // Get list of patienten
            $select_bezug="select pat_nr,pid from $T_patient where eid=$eid and used like 'Y' order by pat_nr DESC";
            $result=@mysql_db_query($database["database"],$select_bezug,$db);
            while ( $row=mysql_fetch_array($result) )
               {
                  $db_pat_nr=$row['pat_nr'];
                  $db_pid=$row['pid'];
                  echo "         <option value=\"$db_pid\">$db_pat_nr\n";
               }
         ?>
      </td>
      <td>&nbsp;</td>
   </tr>
   <tr>
      <td colspan="23" height="5" width="700"><img src="../_img/spacer.gif" width="700" height="5" border="0"></td>
   </tr>
   <tr>
      <td >&nbsp;</td>
      <td ><input type=checkbox name="frm_set_date" onChange="toggle_frmfield('insert_etb', 'frm_man_date')" value="TRUE"></td>
      <td colspan="4"><input type=text name="frm_man_date" <? echo $FIELD_ONOFF; ?> value="<? echo $ACT_DATE; ?>" maxlength="10" style="width: 80px; border-width: 1px solid silver;">
                      <a href="javascript:insert_tactical_date('insert_etb', 'frm_man_date')" onFocus="blur();" style="text-decoration: none; font-size:15pt;">&larr;</a></td>
      <td >&nbsp;</td>
      <td ><input type=checkbox name="frm_set_time" onChange="toggle_frmfield('insert_etb', 'frm_man_time')" value="TRUE"></td>
      <td colspan="4"><input type=text name="frm_man_time" <? echo $FIELD_ONOFF; ?> value="<? echo $ACT_TIME; ?>"maxlength="10" style="width: 80px; border-width: 1px solid silver;">
                      <a href="javascript:insert_tactical_time('insert_etb', 'frm_man_time')" onFocus="blur();" style="text-decoration: none; font-size:15pt;">&larr;</a></td>           
      <td colspan="11"><p id="RT08">&nbsp;<= Manuelle Zeitstempelung (Taktische Zeit)</p></td>
   </tr>
   <tr>
      <td colspan="23" height="2" width="700"><img src="../_img/spacer.gif" width="700" height="2" 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="10">Die letzten 10 Eintragungen</th>
      <th width="16" style="background-color: #E0E0E0;" ><img src="../_img/spacer.gif" width="16" border="0"></th>
   </tr>
   <tr>
      <td width="30"  align="middle"><p id="GR07">Lfd-Nr.</p></td>
      <td width="70"  align="middle"><p id="GR07">Datum</p></td>
      <td width="60"  align="middle"><p id="GR07">Zeit</p></td>
      <td width="80"  align="middle"><p id="GR07">Von</p></td>
      <td width="80"  align="middle"><p id="GR07">An</p></td>      
      <td width="350" align="left"><p id="GR07">Text</p></td>
      <td width="110" align="left"><p id="GR07">Bemerkung</p></td>
      <td width="100" align="middle"><p id="GR07">Patient</p></td>
      <td width="84"  align="middle" colspan="2"><p id="GR07">Bearbeiter</p></td>
      <td width="16" style="background-color: #E0E0E0;"><img src="../_img/spacer.gif" height="1" width="16" border="0"></td>
   </tr>
   <tr>
      <td colspan="10" 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>
   <tr>
      <td colspan="11">
         <iframe src="list_etb.php4" HEIGHT="300" WIDTH="980" name="_ETB" 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