Location: PHPKode > projects > WebETB > stats/print_etb.php4
<?php
/******************************************************************************/
/*	MODUL:	stats/print.php4           													*/
/*																										*/
/* DATUM:	27.03.2006, Version 0.1															*/
/* BESCHR.:	Druckfreundliche Ausgabe des ETBs                                 */
/*																										*/
/*	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/printer.php4');

// Define in this script the requested selections
include ('./get_stats.php4');

?>
<br>
<center>
   <table border="0" cellspacing="0" cellpadding="0">
   <tr>
      <th colspan="3">Einsatzdaten</th>
   </tr>
   <tr>
      <td>&nbsp;Einsatzbeschreibung:</td>
      <td width="30">&nbsp;</td>
      <td><? echo $einsatz_name ; ?>&nbsp;</td>      
   </tr>
   <tr>
      <td>&nbsp;Einsatzbeginn:</td>
      <td width="30">&nbsp;</td>
      <td><? echo $result_etb_first_date . '&nbsp;&nbsp;-&nbsp;&nbsp;' . $result_etb_first_time; ?></td>      
   </tr>
   <tr>
      <td>&nbsp;Einsatzende:</td>
      <td width="30">&nbsp;</td>
      <td><? echo $result_etb_last_date . '&nbsp;&nbsp;-&nbsp;&nbsp;' . $result_etb_last_time; ?></td>      
   </tr>     
   <tr>
      <td>&nbsp;Einsatzdauer:</td>
      <td width="30">&nbsp;</td>
      <td><? echo $result_etb_diff_h . ':' . $result_etb_diff_m . ':' . $result_etb_diff_s ; ?>&nbsp; h</td>      
   </tr>
   <tr>
      <td>&nbsp;Anzahl disponierte Abschnitte:</td>
      <td width="30">&nbsp;</td>
      <td><? echo $result_max_abs_eintr ; ?></td>      
   </tr>   
   <tr>
      <td>&nbsp;Anzahl disponierte Fahrzeuge:</td>
      <td width="30">&nbsp;</td>
      <td><? echo $result_max_fzg_eintr ; ?></td>      
   </tr>
   <tr>
      <td>&nbsp;Anzahl disponierte Teams:</td>
      <td width="30">&nbsp;</td>
      <td><? echo $result_max_team_eintr ; ?></td>      
   </tr>
   <tr>
      <td>&nbsp;Anzahl Auftr&auml;ge:</td>
      <td width="30">&nbsp;</td>
      <td><? echo $max_auftr_eintr ; ?></td>      
   </tr> 
   <tr>
      <td>&nbsp;Anzahl erfasster Patienten:</td>
      <td width="30">&nbsp;</td>
      <td><? echo $result_max_pat_eintr ; ?></td>      
   </tr>
   <tr>
      <td>&nbsp;Anzahl Transporte:</td>
      <td width="30">&nbsp;</td>
      <td><? echo $result_max_pat_trans ; ?></td>      
   </tr>         
      </table>
   <br>
   <table border="0" cellspacing="0" cellpadding="0">
   <tr>
      <th colspan="3">webETB Statistiken</th>
   </tr>
   <tr>
      <td>&nbsp;Anzahl Tagebucheintr&auml;ge:</td>
      <td width="30">&nbsp;</td>
      <td><? echo $max_etb_eintr ; ?></td>      
   </tr> 
   <tr>
      <td colspan="3" align="left"><p id="sw08_s">&nbsp;Ermittelt anhand von 15 min. Rasterungen:</p></td>
   </tr>    
   <tr>
      <td>&nbsp;Eintr&auml;ge pro Minute (MIN):</td>
      <td width="30">&nbsp;</td>
      <td valign="top"><? echo $actions_per_minute_min ; ?>&nbsp;</td>      
   </tr>
   <tr>
      <td>&nbsp;Eintr&auml;ge  pro Minute (MAX):</td>
      <td width="30">&nbsp;</td>
      <td valign="top"><? echo $actions_per_minute_max ; ?>&nbsp;</td>      
   </tr>  
   <tr>
      <td>&nbsp;Eintr&auml;ge  pro Minute (MEAN):</td>
      <td width="30">&nbsp;</td>
      <td valign="top"><? echo $actions_per_minute_mean ; ?>&nbsp;</td>      
   </tr>      
   </table>   
   <br><br>
   <center>
   <table border="0" cellpadding="0" cellspacing="0" width="950">
   <tr>
      <th colspan="9">Einsatztagebuch - Verlauf</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="100" align="left"><p id="GR07">Bemerkung</p></td>
      <td width="100" align="middle"><p id="GR07">Patient</p></td>
      <td width="30"  align="middle"><p id="GR07">Bearbeiter</p></td>
   </tr>
   <tr>
      <td colspan="9" height="1" width="950" style="background-color: #000000;"><img src="../_img/spacer.gif" height="1" width="950" border="0"></td>
   </tr>  
   
   <?
  
   $select_etb_log="select * from $T_etb where eid=$eid order by lfdnr";
   $result_etb_log=@mysql_db_query($database["database"],$select_etb_log,$db);
   while ( $row=mysql_fetch_array($result_etb_log) )
   {
           // sort fields
        $lfdnr=$row['lfdnr'];
        $von_kid=$row['von_kid'];
        $an_kid=$row['an_kid'];
        $von_txt=$row['von_txt'];
        $an_txt=$row['an_txt'];
        list ($Y, $M, $D) = split ('[/.-]', $row['datum']);
        $datum="$D-$M-$Y";
        $zeit=$row['zeit'];
        $text=$row['text'];
        $bemerkung=$row['bemerkung'];
        $bezug=$row['bezug'];
        $db_uid=$row['uid'];

        // set readable text for field "VON"
        if ( $von_kid == "0" )
        {
              $von=$von_txt;
        }
        else
        {
           $select_von="select rufname from $T_kraefte where eid=$eid and kid=$von_kid";
           $result_von=@mysql_db_query($database["database"],$select_von,$db);
           while ( $row=mysql_fetch_array($result_von) )
           {
              $von=$row['rufname'];
           }
        }

        // set readable text for field "AN"
        if ( $an_kid == "0" )
        {
              $an=$an_txt;
        }
        else
        {
           $select_an="select rufname from $T_kraefte where eid=$eid and kid=$an_kid";
           $result_an=@mysql_db_query($database["database"],$select_an,$db);
           while ( $row=mysql_fetch_array($result_an) )
           {
              $an=$row['rufname'];
           }
        }

        // set readable text for field "BEARBEITER"
        $select_user="select u_name from $T_user where uid=$db_uid";
        $result_user=@mysql_db_query($database["database"],$select_user,$db);
        while ( $row=mysql_fetch_array($result_user) )
        {
           $user=$row['u_name'];
        }

        // set readable text for field "BEZUG"
        $select_bezug="select pat_nr from $T_patient where eid=$eid and pid=$bezug";
        $result_bezug=@mysql_db_query($database["database"],$select_bezug,$db);
        $count_bezug=mysql_num_rows($result_bezug);
        if ( $count_bezug <= 0 )
        {
           $aufgabe="";
        }
        else
        {
            while ( $row=mysql_fetch_array($result_bezug) )
            {
               $aufgabe=$row['pat_nr'];
            }
        }

        // print values
        ?>
        <tr>
           <td width="30"  valign="top" align="middle"><p id="sw10_s"><? echo $lfdnr; ?></td>
           <td width="70"  valign="top" align="middle"><p id="sw10_s"><? echo $datum; ?></td>
           <td width="60"  valign="top" align="middle"><p id="sw10_s"><? echo $zeit; ?></td>
           <td width="80"  valign="top" align="middle"><p id="sw10_s"><? echo $von; ?></td>
           <td width="80"  valign="top" align="middle"><p id="sw10_s"><? echo $an; ?></td>
           <td width="360" valign="top" align="left"  ><p id="sw10_s"><? echo $text; ?></td>
           <td width="100" valign="top" align="left"  ><p id="sw10_s"><? echo $bemerkung; ?></td>
           <td width="100" valign="top" align="middle"><p id="sw10_s"><? echo $aufgabe; ?></td>
           <td width="30"  valign="top" align="middle"><p id="sw10_s"><? echo $user; ?></td>
        </tr>
        <tr>
           <td colspan="9" height="1" width="950" style="background-color: #999999;"><img src="../_img/spacer.gif" height="1" width="950" border="0"></td>
        </tr>
        <?   
   }    
   
   ?>
     </table>
   <br><br>
   <p align="center" id="sw7_s"><? echo $FOOTNOTE; ?><BR>(c) 2005-2006 by Marcus Groh</p>
   </center>
<?
include ('../_include/footer_2.php4');
?>
Return current item: WebETB