Cleanup to remove multibox functionality which proved to be confusing in use.
[openemr.git] / library / transactions.inc
blob16ab996da51e29014a8eb8c2fb410b1fcbe4b714
1 <?php
2 require_once("{$GLOBALS['srcdir']}/sql.inc");
4 function getTransById ($id, $cols = "*")
6   return sqlQuery("select $cols from transactions where id='$id' " .
7     "order by date DESC limit 0,1");
10 function getTransByPid ($pid, $cols = "*")
12   $res = sqlStatement("select $cols from transactions where pid='$pid' " .
13     "order by date DESC");
14   for ($iter = 0; $row = sqlFetchArray($res); $iter++)
15     $all[$iter] = $row;
16   return $all;
19 function newTransaction($pid, $body, $title, $authorized = "0",
20   $status = "1", $assigned_to = "*")
22   $body = mysql_escape_string($body);
23   return sqlInsert("insert into transactions ( " .
24     "date, title, body, pid, user, groupname, authorized " .
25     ") values ( " .
26     "NOW(), '$title', '$body', '$pid', '". $_SESSION['authUser'] .
27     "', '". $_SESSION['authProvider'] . "', '$authorized' " .
28     ")");
31 function authorizeTransaction($id, $authorized = "1")
33   sqlQuery("update transactions set authorized = '$authorized' where " .
34     "id = '$id'");