Page 1 of 1

new to appgini v5.51

Posted: 2016-10-28 17:37
by robertahyan
Hi,
can someone help me. price doesn't show in payment.png although it is set as auto-fill in space2.png also how to make total auto calculate i.e. total = price - discount or total = price + adj

Many thanks
Robert

Re: new to appgini v5.51

Posted: 2016-10-31 12:44
by DevGiu
Autofill disable automatically the fields. Internally field is not filled in database with the value, but with the PK of the parent table, for this reason you can't change it. Maybe this is not what you want.

Re: new to appgini v5.51

Posted: 2016-11-19 11:38
by robertahyan
Hi Dev

Thanks for message. I have bought the video tutorial on Udemy and I have been able to do the calculation.

Now I would like that when I update the date field in my payment table, it also update the date field in the customers table. The reason I would like to filter the date in the customer table as there would be only one date whereas the payment table may have more than one.

Anybody who can help me.

Best regards
Robert

Re: new to appgini v5.51

Posted: 2016-11-19 13:29
by grimblefritz
The Udemy course shows how to do this. Lessons 27-29

Re: new to appgini v5.51

Posted: 2016-11-28 17:25
by robertahyan
The code below is from the payments.php file.

function payments_after_insert($data, $memberInfo, &$args){

$customer_id = $data['customer_id'];
sql("update customers set sed='{$data['sub_end_date']} where customer_id='{$customer_id}''", $eo);

return TRUE;

}

I have also updated the customers table field to customer_id in the AppGini application and checked it in phpMyAdmin too.

However, it is still updating for ALL customers.

Does anyone have a clue?

Thanking you in advance : )

Re: new to appgini v5.51

Posted: 2016-11-28 18:08
by DevGiu
didn't Readed all the thread, but, probably, because, if this is a copy paste, you are not closing the string on _end_date']}.. but in customer_id}''

should be
set sed='{$data['sub_end_date']}' where customer_id='{$customer_id}'

Re: new to appgini v5.51

Posted: 2016-12-01 18:11
by robertahyan
Thanks DevGiu

I now see the missing ' at the end of '{$data['sub_end_date']}' however it is still not working. I guess it could instead be as below

$customer_id = $data['SelectedID'];
sql("update customers set sed='{$data['sub_end_date']}' where customer_id='{$customer_id}'", $eo);

Again it is not working.

Any idea why?

Re: new to appgini v5.51

Posted: 2016-12-01 22:39
by peebee
This might be a little obvious but from what I can see in your original image of your Appgini app, your 'customers' table doesn't contain a field named 'sed'?

Have you updated your database to include 'sed' as a field in the 'customers' table? If not, this sql statement will never work: sql("update customers set sed='{$data['sub_end_date']}' where....

If you are copy/pasting from another application somewhere, you will have to ensure that your table/field names correspond to your own database.

Re: new to appgini v5.51

Posted: 2016-12-06 07:14
by robertahyan
Thanks peebee

I did update the database to include 'sed' as a field in the 'customers' table.

I have received several emails from the AppGini Help Desk but so far I have not yet received the solution.