internationalized units in vitals form - supports both us and metric units
[openemr.git] / library / lists.inc
blob2f2374c7d1110e7cb1a682a7f9bc3005e472b145
1 <?php
2 require_once("{$GLOBALS['srcdir']}/sql.inc");
4 function getListById ($id, $cols = "*")
6         return sqlQuery("select $cols from lists where id='$id' order by date DESC limit 0,1");
9 function getListByType ($pid, $type, $cols = "*", $active = "all", $limit = "all", $offset="0")
11         if($active == "all")
12                 $sql = "select $cols from lists where pid='$pid' and type='$type' order by date DESC";
13         else
14                 $sql = "select $cols from lists where pid='$pid' and type='$type' and activity='$active' order by date DESC";
15         if ($limit != "all")
16                 $sql .= " limit $offset,$limit";
17         
19         $res = sqlStatement($sql);
20         for($iter =0;$row = sqlFetchArray($res);$iter++)
21                 $all[$iter] = $row;
22         return $all;
26 function addList ($pid, $type, $title, $comments, $activity = "1")
28         return sqlInsert("insert into lists (date, pid, type, title, activity, comments, user, groupname) values (NOW(), '$pid', '$type', '$title', '$activity', '$comments', '".$_SESSION['authUser']."', '".$_SESSION['authProvider']."')");
31 function disappearList ($id)
33         sqlStatement("update lists set activity = '0' where id='$id'");
34         return true;
37 function reappearList ($id)
39         sqlStatement("update lists set activity = '1' where id='$id'");
40         return true;