2 require_once("{$GLOBALS['srcdir']}/sql.inc");
4 function getTransById ($id, $cols = "*")
6 return sqlQuery("select $cols from transactions where id=? " .
7 "order by date DESC limit 0,1", array($id) );
10 function getTransByPid ($pid, $cols = "*")
12 $res = sqlStatement("select $cols from transactions where pid=? " .
13 "order by date DESC", array($pid) );
14 for ($iter = 0; $row = sqlFetchArray($res); $iter++)
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 " .
26 "NOW(), '$title', '$body', '$pid', '". $_SESSION['authUser'] .
27 "', '". $_SESSION['authProvider'] . "', '$authorized' " .
31 function authorizeTransaction($id, $authorized = "1")
33 sqlQuery("update transactions set authorized = '$authorized' where " .