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'];
14 function getTransByPid($pid, $cols = "*")
16 $res = sqlStatement("select $cols from transactions where pid = ? " .
17 "order by date DESC", array($pid));
18 for ($iter = 0; $row = sqlFetchArray($res); $iter++) {
20 "SELECT field_id, field_value FROM lbt_data WHERE form_id = ?",
23 while ($frow = sqlFetchArray($fres)) {
24 $row[$frow['field_id']] = $frow['field_value'];
33 function newTransaction(
42 $body = add_escape_custom($body);
43 $id = sqlInsert("insert into transactions ( " .
44 "date, title, pid, user, groupname, authorized " .
46 "NOW(), '$title', '$pid', '" . $_SESSION['authUser'] .
47 "', '" . $_SESSION['authProvider'] . "', '$authorized' " .
50 "INSERT INTO lbt_data (form_id, field_id, field_value) VALUES (?, ?, ?)",
51 array($id, 'body', $body)
56 function authorizeTransaction($id, $authorized = "1")
58 sqlQuery("update transactions set authorized = '$authorized' where " .