Location: PHPKode > projects > WebETB > patient/list_pat.php4
<?php
/******************************************************************************/
/*	MODUL:	patient/pat_list.php4   														*/
/*																										*/
/* DATUM:	27.03.2006, Version 0.1															*/
/* BESCHR.:	Uebersicht der diesem Einsatz zugeordneten Patienten              */
/*          Subfunktion von index.php4                                        */
/*																										*/
/*	AUTOR:   Marcus Groh																			*/
/*	LIZENZ:  GPL v2 vom Juni 1991 															*/
/*																										*/
/*	AENDERUNGEN:	13.01.2006        -initiale Version								   */
/*                27.03.2006 v 0.1, -Versionskennzeichnung eingefuehrt        */
/*                                  -Code unter GPL v2 gestellt               */
/*                                  -Tabellenname dynamisiert                 */
/*																										*/
/******************************************************************************/
$allowed_groups=array("elw","san");
include ('../_include/header_2.php4');

   // Set group-depending target-link
      switch ($mygroup)
      {
      case "elw":      $PATMOD="all.php4";
                       break;                   
      case "san":      $PATMOD="san.php4";
                       break;
      case "reg":      $PATMOD="reg.php4";
                       break;
      case "trans":    $PATMOD="trans.php4";
                       break;                                        
      default:         $PATMOD="";
      }
      
      
   echo "      </center><table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"720\">\n";
   
           // Abgeschlossene oder ausstehende Behandlung
           if ( $last_list_order == "2" )
           {
              $list_criteria="";
              $time_sort_field="reg_time";
           }
           elseif ( $last_list_order == "1" )
           {
              $list_criteria=" and fzg_typ >='1'";
              $time_sort_field="fzg_zeit";
           }
           else
           {
              $list_criteria=" and fzg_typ <='0'";
              $time_sort_field="reg_time";
           }
           
            // Belegte patientennummern aus db holen
            $no_act_cnt = 0;
            if ( ( ! isset($dire)) || ( $dire == "u" ) )
            {
               $sort_dir="";
            }
            else
            {
               $sort_dir="DESC";
            }

            if ( ( ! isset($order)) || ( $order == "num" ) )
            {
               $sort_order="pat_nr";
            }            
            elseif ( $order == "nname" )
            {
               $sort_order="pat_nname";
            }
            elseif ( $order == "vname" )
            {
               $sort_order="pat_vname";
            }
            elseif ( $order == "times" )
            {
               $sort_order=$time_sort_field;
            }
            
            $select_fields="pid, pat_nr, pat_nname, pat_vname, san_diag, reg_time, fzg_zeit";
            $select_patienten="select $select_fields from $T_patient where eid=$eid and used like 'Y' $list_criteria order by $sort_order $sort_dir";
            $result=@mysql_db_query($database["database"],$select_patienten,$db);
            $anzahl=mysql_num_rows($result);
            if ( $anzahl <= 0 )
            {
               $no_act_cnt++;
               echo "<tr>\n<td colspan=\"5\">Keine Patientennummern vergeben.</td>\n</tr>\n";
            }
            else
            {
               while ( $row=mysql_fetch_array($result) )
               {
                  $db_pid=$row['pid'];
                  $db_pat_nr=$row['pat_nr'];
                  $db_pat_nname=checkval ($row['pat_nname']);
                  $db_pat_vname=checkval ($row['pat_vname']);
                  $db_san_diag=checkval  ($row['san_diag']);
                  $db_reg_time=checkval  ($row['reg_time']);
                  if ( $db_reg_time == "00:00:00" )
                     { $db_reg_time="";   }
                  $db_fzg_zeit=checkval  ($row['fzg_zeit']);
                  if ( $db_fzg_zeit == "00:00:00" )
                     { $db_fzg_zeit="";   }
                  ?>
                  <tr>
                     <td width="100"><a href="<? echo $PATMOD; ?>?view=true&pid=<?echo $db_pid; ?>" target="_parent" onFocus=blur(); style="text-decoration: none;"><? echo $db_pat_nr; ?></a></td>
                     <td width="150"><p id="sw10_s"><? echo $db_pat_nname; ?></p></td>
                     <td width="130"><p id="sw10_s"><? echo $db_pat_vname; ?></p></td>
                     <td width="250"><p id="sw10_s"><? echo $db_san_diag; ?></p></td>
                     <td width="70"><p id="sw10_s"><? 
                                                      if ( $last_list_order == "1" )
                                                         {  echo $db_fzg_zeit;   }
                                                      else
                                                         {  echo $db_reg_time;   }
                                                   
                                                   ?></p></td>
                     <td width="20"><a href="<? echo $PATMOD; ?>?view=true&pid=<? echo $db_pid; ?>" target="_parent" onFocus=blur(); style="text-decoration: none;"><img src="../_img/props.png" border="0" title="&Auml;ndern"></a></td>
                  </tr>
                  <tr>
                     <td colspan="6" height="1" width="700" style="background-color: #999999;"><img src="../_img/spacer.gif" height="1" width="720" border="0"></td>
                  </tr>
                  <?
               }
            }
   ?>
   </table>
   <?
   
include ('../_include/footer_1.php4');

?>            
Return current item: WebETB