2 require_once("{$GLOBALS['srcdir']}/sql.inc");
4 function getTransById ($id, $cols = "*")
6 return sqlQuery("select $cols from transactions where id='$id' order by date DESC limit 0,1");
9 function getTransByPid ($pid, $cols = "*")
11 $res = sqlStatement("select $cols from transactions where pid='$pid' order by date DESC");
12 for ($iter = 0;$row = sqlFetchArray($res);$iter++)
17 function newTransaction($pid, $body, $title, $authorized = "0")
19 $body = mysql_escape_string($body);
20 return sqlInsert("insert into transactions (date, title, body, pid, user, groupname, authorized) values (NOW(), '$title', '$body', '$pid', '". $_SESSION['authUser'] ."', '". $_SESSION['authProvider'] ."', '$authorized')");
23 function authorizeTransaction($id, $authorized = "1")
25 sqlQuery("update transactions set authorized = '$authorized' where id = '$id'");