<?php
/******************************************************************************/
/* MODUL: etb/logging.php4 */
/* */
/* DATUM: 27.03.2006, Version 0.1 */
/* BESCHR.: Auflisten aller ETB-Eintraege inkl. Seitennavigation */
/* */
/* 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>
<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>
<?
// how many records do we have
$select_etb="select * from $T_etb where eid=$eid";
$result=@mysql_db_query($database["database"],$select_etb,$db);
$max_etb_rec=mysql_num_rows($result);
// initial startvalue should be last entry in etb
if ( ! isset ($NSTART))
{
$NSTART=$max_etb_rec - 19;
}
$select_etb_log="select * from $T_etb where eid=$eid and lfdnr >= '$NSTART' order by lfdnr limit 20";
$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="<a href=\"../patient/all.php4?view=true&pid=$bezug\" target=\"_parent\" onFocus=\"blur();\" style=\"text-decoration: none; \">" . $row['pat_nr'] ."</a>";
}
}
// 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>
<form action="" method=post name="print_etb">
<input type="hidden" name="NSTART" value="<? echo $NSTART; ?>">
<input type="submit" name="beg" value="|<" title="An den Anfang springen" style="width: 20px; border: 1px solid silver; background-color: #CCCCCC;" onClick="fixed_etb_pos(<? echo "1"; ?>);">
<input type="submit" name="for" value="<" title="20 Datensätze zurück" style="width: 20px; border: 1px solid silver; background-color: #CCCCCC;" onClick="backward_etb_step(<? echo $NSTART . ", 1"; ?>);">
<input type="submit" name="bck" value=">" title="20 Datensätze vor" style="width: 20px; border: 1px solid silver; background-color: #CCCCCC;" onClick="forward_etb_step(<? echo $NSTART . "," . $max_etb_rec; ?>);">
<input type="submit" name="lst" value=">|" title="Ans Ende springen" style="width: 20px; border: 1px solid silver; background-color: #CCCCCC;" onClick="fixed_etb_pos(<? echo $max_etb_rec - 19; ?>);">
</form>
</center>
<?
include ('../_include/footer_1.php4');
//echo "<meta http-equiv=\"refresh\" content=\"30; URL=logging.php4\">\n";
?>