2 require_once("{$GLOBALS['srcdir']}/sql.inc");
4 if (empty($GLOBALS['athletic_team'])) {
6 // table type plural singular abbrev style
7 'medical_problem' => array('Medical Problems', 'Problem' , 'P', 0),
8 'allergy' => array('Allergies' , 'Allergy' , 'A', 0),
9 'medication' => array('Medications' , 'Medication', 'M', 0),
10 'surgery' => array('Surgeries' , 'Surgery' , 'S', 0),
11 'dental' => array('Dental Issues' , 'Dental' , 'D', 0),
14 // 0 - Normal, as in 2.8.1.
15 // 1 - Simplified: only title, start date, comments and an Active checkbox;
16 // no diagnosis, occurrence, end date, referred-by or sports fields.
17 // Internally we'll still use a null end date to indicate active.
18 // 2 - Football Injury.
22 else { // sports team version
24 'football_injury' => array('Football Injuries', 'Injury' , 'I', 2),
25 'medical_problem' => array('Medical Problems' , 'Problem' , 'P', 0),
26 'general' => array('General' , 'General' , 'G', 1),
30 $ISSUE_OCCURRENCES = array(
31 0 => xl('Unknown or N/A'),
33 6 => xl('Early Recurrence (<2 Mo)'),
34 7 => xl('Late Recurrence (2-12 Mo)'),
35 8 => xl('Delayed Recurrence (> 12 Mo)'),
38 4 => xl('Chronic/Recurrent'),
39 5 => xl('Acute on Chronic')
42 $ISSUE_CLASSIFICATIONS = array(
43 0 => xl('Unknown or N/A'),
48 function getListById ($id, $cols = "*")
50 return sqlQuery("select $cols from lists where id='$id' order by date DESC limit 0,1");
53 function getListByType ($pid, $type, $cols = "*", $active = "all", $limit = "all", $offset="0")
56 $sql = "select $cols from lists where pid='$pid' and type='$type' order by date DESC";
58 $sql = "select $cols from lists where pid='$pid' and type='$type' and activity='$active' order by date DESC";
60 $sql .= " limit $offset,$limit";
63 $res = sqlStatement($sql);
64 for($iter =0;$row = sqlFetchArray($res);$iter++)
70 function addList ($pid, $type, $title, $comments, $activity = "1")
72 return sqlInsert("insert into lists (date, pid, type, title, activity, comments, user, groupname) values (NOW(), '$pid', '$type', '$title', '$activity', '$comments', '".$_SESSION['authUser']."', '".$_SESSION['authProvider']."')");
75 function disappearList ($id)
77 sqlStatement("update lists set activity = '0' where id='$id'");
81 function reappearList ($id)
83 sqlStatement("update lists set activity = '1' where id='$id'");