2 require_once("{$GLOBALS['srcdir']}/sql.inc");
4 if (!empty($GLOBALS['ippf_specific'])) {
6 // table type plural singular abbrev style
7 'medical_problem' => array(xl('Medical Problems'),xl('Problem') ,xl('P'),0),
8 'allergy' => array(xl('Allergies') ,xl('Allergy') ,xl('Y'),0),
9 'medication' => array(xl('Medications') ,xl('Medication') ,xl('M'),0),
10 'surgery' => array(xl('Surgeries') ,xl('Surgery') ,xl('S'),0),
11 'ippf_gcac' => array(xl('Abortions') ,xl('Abortion') ,xl('A'),3),
12 'contraceptive' => array(xl('Contraception') ,xl('Contraception'),xl('C'),4),
13 // 'ippf_srh' => array(xl('SRH') ,xl('SRH') ,xl('R'),5),
16 else if (!empty($GLOBALS['athletic_team'])) {
18 'football_injury' => array(xl('Football Injuries'),xl('Injury') ,xl('I'),2),
19 'medical_problem' => array(xl('Medical Problems') ,xl('Problem'),xl('P'),0),
20 'allergy' => array(xl('Allergies') ,xl('Allergy'),xl('A'),1),
21 'general' => array(xl('General') ,xl('General'),xl('G'),1),
24 else { // default version
26 // table type plural singular abbrev style
27 'medical_problem' => array(xl('Medical Problems'),xl('Problem') ,xl('P'),0),
28 'allergy' => array(xl('Allergies') ,xl('Allergy') ,xl('A'),0),
29 'medication' => array(xl('Medications') ,xl('Medication'),xl('M'),0),
30 'surgery' => array(xl('Surgeries') ,xl('Surgery') ,xl('S'),0),
31 'dental' => array(xl('Dental Issues') ,xl('Dental') ,xl('D'),0),
34 // 0 - Normal, as in 2.8.1.
35 // 1 - Simplified: only title, start date, comments and an Active checkbox;
36 // no diagnosis, occurrence, end date, referred-by or sports fields.
37 // Internally we'll still use a null end date to indicate active.
38 // 2 - Football Injury.
44 // 06/2009 - BM Migrated the ISSUE_OCCURRENCES to list_options
47 $ISSUE_CLASSIFICATIONS = array(
48 0 => xl('Unknown or N/A'),
53 function getListById ($id, $cols = "*")
55 return sqlQuery("select $cols from lists where id='$id' order by date DESC limit 0,1");
58 function getListByType ($pid, $type, $cols = "*", $active = "all", $limit = "all", $offset="0")
61 $sql = "select $cols from lists where pid='$pid' and type='$type' order by date DESC";
63 $sql = "select $cols from lists where pid='$pid' and type='$type' and activity='$active' order by date DESC";
65 $sql .= " limit $offset,$limit";
68 $res = sqlStatement($sql);
69 for($iter =0;$row = sqlFetchArray($res);$iter++)
75 function addList ($pid, $type, $title, $comments, $activity = "1")
77 return sqlInsert("insert into lists (date, pid, type, title, activity, comments, user, groupname) values (NOW(), '$pid', '$type', '$title', '$activity', '$comments', '".$_SESSION['authUser']."', '".$_SESSION['authProvider']."')");
80 function disappearList ($id)
82 sqlStatement("update lists set activity = '0' where id='$id'");
86 function reappearList ($id)
88 sqlStatement("update lists set activity = '1' where id='$id'");