updated tar.gz of CAMOS directory
[openemr.git] / library / lists.inc
blobf9e73cc01a4446139ef2633d7bb871a62ee9ad60
1 <?php
2 require_once("{$GLOBALS['srcdir']}/sql.inc");
4 $ISSUE_TYPES = array(
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")
20         if($active == "all")
21                 $sql = "select $cols from lists where pid='$pid' and type='$type' order by date DESC";
22         else
23                 $sql = "select $cols from lists where pid='$pid' and type='$type' and activity='$active' order by date DESC";
24         if ($limit != "all")
25                 $sql .= " limit $offset,$limit";
26         
28         $res = sqlStatement($sql);
29         for($iter =0;$row = sqlFetchArray($res);$iter++)
30                 $all[$iter] = $row;
31         return $all;
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'");
43         return true;
46 function reappearList ($id)
48         sqlStatement("update lists set activity = '1' where id='$id'");
49         return true;