2 require_once("{$GLOBALS['srcdir']}/sql.inc");
5 // table type plural singular abbrev
6 'medical_problem' => array('Medical Problems', 'Problem' , 'P'),
7 'allergy' => array('Allergies' , 'Allergy' , 'A'),
8 'medication' => array('Medications' , 'Medication', 'M'),
9 'surgery' => array('Surgeries' , 'Surgery' , 'S'),
10 'dental' => array('Dental Issues' , 'Dental' , 'D')
13 function getListById ($id, $cols = "*")
15 return sqlQuery("select $cols from lists where id='$id' order by date DESC limit 0,1");
18 function getListByType ($pid, $type, $cols = "*", $active = "all", $limit = "all", $offset="0")
21 $sql = "select $cols from lists where pid='$pid' and type='$type' order by date DESC";
23 $sql = "select $cols from lists where pid='$pid' and type='$type' and activity='$active' order by date DESC";
25 $sql .= " limit $offset,$limit";
28 $res = sqlStatement($sql);
29 for($iter =0;$row = sqlFetchArray($res);$iter++)
35 function addList ($pid, $type, $title, $comments, $activity = "1")
37 return sqlInsert("insert into lists (date, pid, type, title, activity, comments, user, groupname) values (NOW(), '$pid', '$type', '$title', '$activity', '$comments', '".$_SESSION['authUser']."', '".$_SESSION['authProvider']."')");
40 function disappearList ($id)
42 sqlStatement("update lists set activity = '0' where id='$id'");
46 function reappearList ($id)
48 sqlStatement("update lists set activity = '1' where id='$id'");