calculation in AppGini with hook
Posted: 2013-10-03 11:57
Hello to all,
I would like to make a calculation in AppGini with hook.
table
id
item PRINTER
price 100
quantity 10
total 1000
I entered this
db_after_insert function ($ data, $ MemberInfo, & $ args) {
/ / Update item price
$id = $data ['SelectedID'];
$price = $data ['price'] * $data ['quantity'];
sql ("update db set price = '$price' where id = '$id'", $eo);
return TRUE;
}
and
db_after_update function ($ data, $ MemberInfo, & $ args) {
return db_after_insert ($ data, $ MemberInfo, $ args);
}
But the total does not appear on the screen.
Where did I go wrong?
Thank you very much.
I would like to make a calculation in AppGini with hook.
table
id
item PRINTER
price 100
quantity 10
total 1000
I entered this
db_after_insert function ($ data, $ MemberInfo, & $ args) {
/ / Update item price
$id = $data ['SelectedID'];
$price = $data ['price'] * $data ['quantity'];
sql ("update db set price = '$price' where id = '$id'", $eo);
return TRUE;
}
and
db_after_update function ($ data, $ MemberInfo, & $ args) {
return db_after_insert ($ data, $ MemberInfo, $ args);
}
But the total does not appear on the screen.
Where did I go wrong?
Thank you very much.