3 function getTransById ($id, $cols = "*")
5 $row = sqlQuery("SELECT $cols FROM transactions WHERE id = ?", array($id));
6 $fres = sqlStatement("SELECT field_id, field_value FROM lbt_data WHERE form_id = ?", array($id));
7 while ($frow = sqlFetchArray($fres)) {
8 $row[$frow['field_id']] = $frow['field_value'];
13 function getTransByPid ($pid, $cols = "*")
15 $res = sqlStatement("select $cols from transactions where pid = ? " .
16 "order by date DESC", array($pid) );
17 for ($iter = 0; $row = sqlFetchArray($res); $iter++) {
18 $fres = sqlStatement("SELECT field_id, field_value FROM lbt_data WHERE form_id = ?",
20 while ($frow = sqlFetchArray($fres)) {
21 $row[$frow['field_id']] = $frow['field_value'];
28 function newTransaction($pid, $body, $title, $authorized = "0",
29 $status = "1", $assigned_to = "*")
31 $body = add_escape_custom($body);
32 $id = sqlInsert("insert into transactions ( " .
33 "date, title, pid, user, groupname, authorized " .
35 "NOW(), '$title', '$pid', '" . $_SESSION['authUser'] .
36 "', '" . $_SESSION['authProvider'] . "', '$authorized' " .
38 sqlStatement("INSERT INTO lbt_data (form_id, field_id, field_value) VALUES (?, ?, ?)",
39 array($id, 'body', $body));
43 function authorizeTransaction($id, $authorized = "1")
45 sqlQuery("update transactions set authorized = '$authorized' where " .