internationalized units in vitals form - supports both us and metric units
[openemr.git] / interface / reports / players_report.php
blob72db233dde75ae8494627572e83834ad737f8e21
1 <?
2 // Copyright (C) 2005 Rod Roark <rod@sunsetsystems.com>
3 //
4 // This program is free software; you can redistribute it and/or
5 // modify it under the terms of the GNU General Public License
6 // as published by the Free Software Foundation; either version 2
7 // of the License, or (at your option) any later version.
9 // This report simply lists all players/patients who are members
10 // of a squad. It is applicable only for sports teams.
12 include_once("../globals.php");
13 include_once("../../library/patient.inc");
15 $squads = array(
16 'None',
17 'Senior',
18 'Academy',
19 'Ladies'
22 $fitnesses = array(
23 'Full Play',
24 'Full Training',
25 'Restricted Training',
26 'Injured Out'
29 $fitcolors = array(
30 '#00ff00',
31 '#ffff00',
32 '#ff8800',
33 '#ff3333'
36 $alertmsg = ''; // not used yet but maybe later
38 $query = "SELECT * FROM patient_data " .
39 "ORDER BY squad, lname, fname";
40 $res = sqlStatement($query);
42 <html>
43 <head>
44 <link rel=stylesheet href="<?echo $css_header;?>" type="text/css">
46 <script language="JavaScript">
48 function gopid(pid) {
49 opener.top.location = '../patient_file/patient_file.php?set_pid=' + pid;
50 window.close();
53 </script>
55 <title>Team Roster</title>
56 </head>
58 <body leftmargin='0' topmargin='0' marginwidth='0' marginheight='0'>
59 <center>
61 <form method='post' action='players_report.php'>
63 <table border='0' cellpadding='5' cellspacing='0' width='98%'>
65 <tr>
66 <td height="1" colspan="2">
67 </td>
68 </tr>
70 <tr bgcolor='#ddddff'>
71 <td align='left'>
72 <h2>Team Roster</h2>
73 </td>
74 <td align='right'>
75 <b><? echo date('l, F j, Y') ?></b>
76 </td>
77 </tr>
79 <tr>
80 <td height="1" colspan="2">
81 </td>
82 </tr>
84 </table>
86 <table border='0' cellpadding='1' cellspacing='2' width='98%'>
88 <tr bgcolor="#dddddd">
89 <td class="dehead">
90 &nbsp;Squad
91 </td>
92 <td class="dehead">
93 &nbsp;Player
94 </td>
95 <td class="dehead">
96 &nbsp;Fitness
97 </td>
98 <td class="dehead">
99 &nbsp;Last Encounter
100 </td>
101 </tr>
103 if ($res) {
104 $lastsquad = '';
105 while ($row = sqlFetchArray($res)) {
106 $patient_id = $row['pid'];
107 $squad = $squads[$row['squad']];
108 $fitness = $row['fitness'];
109 if (! $fitness) $fitness = 1;
110 $query = "SELECT date, reason " .
111 "FROM form_encounter WHERE " .
112 "pid = '$patient_id' " .
113 "ORDER BY date DESC LIMIT 1";
114 $erow = sqlQuery($query);
116 <tr bgcolor="<? echo $fitcolors[$fitness-1] ?>">
117 <td class="detail">
118 &nbsp;<? echo ($squad == $lastsquad) ? "" : $squad ?>
119 </td>
120 <td class="detail">
121 &nbsp;<a href='javascript:gopid(<? echo $patient_id ?>)'><? echo $row['lname'] . ", " . $row['fname'] ?></a>
122 </td>
123 <td class="detail">
124 <? echo $fitnesses[$fitness-1] ?>&nbsp;
125 </td>
126 <td class="detail">
127 &nbsp;<? echo substr($erow['date'], 0, 10) . ' ' . $erow['reason'] ?>&nbsp;
128 </td>
129 </tr>
131 $lastsquad = $squad;
136 </table>
138 </form>
139 </center>
140 <script>
142 if ($alertmsg) {
143 echo " alert('$alertmsg');\n";
146 </script>
147 </body>
148 </html>