Location: PHPKode > projects > WebETB > manage_action.php4
<?php
/******************************************************************************/
/*	MODUL:	manage_action.php4             												*/
/*																										*/
/* DATUM:	27.03.2006, Version 0.1															*/
/* BESCHR.:	Dialog/Funktion zum anlegen eines neuen Einsatzes                 */
/*          Zusaetzl. die moeglichkeit sich mit Bestehendem zu verbinden      */
/*																										*/
/*	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                 */
/*																										*/
/******************************************************************************/
include ('_include/header.php4');
include "./config/conf_glbl.php4";

//Check access 
if ( $access != "TRUE" )
{
   echo "<meta http-equiv=\"refresh\" content=\"0; URL=login.php4\">\n";
   exit;
} 
   
if ( $no_act_cnt == 3 )
{
   $action = "NEU";
   echo "<meta http-equiv=\"refresh\" content=\"0; URL=action.php4\">\n";
   exit;
}
   if ( ( $action == "NEU" ) && ( !isset($use_eid)) )
   {
      // Convert date-format from d.m.y to y-m-d
      list ($D, $M, $Y) = split ('[/.-]', $d_start);
      $d_start_conv="$Y-$M-$D";
      
      // Insert new action into db
      $insert_action="Insert into $T_einsaetze values ('%','$d_start_conv','$t_start','$desc','','','Y','NULL')";
      mysql_db_query($database["database"],$insert_action,$db);
      $new_eid=mysql_insert_id();
                     
      // Set finally global vars
      $eid=$new_eid;
      $zeit=date("H:i:s");
      $datum=date("y-m-d");
      $isclosed="FALSE";
      
      // Insert 1st entry to etb
      $insert_etb="insert into $T_etb values ('1','NULL','NULL','ELW','ETB','$datum','$zeit','Einsatz $desc angelegt.','','NULL','$uid','$eid')";
      mysql_db_query($database["database"],$insert_etb,$db);
      echo "<meta http-equiv=\"refresh\" content=\"0; URL=wizzard.php4\">\n";
   }
 
   if ( $use_eid )
   {
         // Set finally global vars
         $eid=$use_eid;
         $select_closed="select closed from $T_einsaetze where eid=$eid";
         $result_closed=@mysql_db_query($database["database"],$select_closed,$db);
         while ( $row=mysql_fetch_array($result_closed) )
         {
               if ( $row['closed'] == "Y" ) 
               {
                  $isclosed="TRUE";
               }
               else
               {
                  $isclosed="FALSE";
               }
         }
         echo "<meta http-equiv=\"refresh\" content=\"0; URL=todo/index.php4\">\n";
   }
   
include ('_include/footer.php4');

?>
Return current item: WebETB