new to appgini v5.51

If you're a new user of AppGini, feel free to ask general usage questions, or look for answers here.
Post Reply
robertahyan
Posts: 5
Joined: 2016-10-28 17:25

new to appgini v5.51

Post by robertahyan » 2016-10-28 17:37

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
Attachments
space2.png
space2.png (144.36 KiB) Viewed 7152 times
payment.png
payment.png (71 KiB) Viewed 7152 times

DevGiu
AppGini Super Hero
AppGini Super Hero
Posts: 151
Joined: 2016-05-27 09:08

Re: new to appgini v5.51

Post by DevGiu » 2016-10-31 12:44

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.
/Giuseppe
Professional Outsourcing Services

robertahyan
Posts: 5
Joined: 2016-10-28 17:25

Re: new to appgini v5.51

Post by robertahyan » 2016-11-19 11:38

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

grimblefritz
AppGini Super Hero
AppGini Super Hero
Posts: 336
Joined: 2015-12-23 16:52

Re: new to appgini v5.51

Post by grimblefritz » 2016-11-19 13:29

The Udemy course shows how to do this. Lessons 27-29

robertahyan
Posts: 5
Joined: 2016-10-28 17:25

Re: new to appgini v5.51

Post by robertahyan » 2016-11-28 17:25

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 : )

DevGiu
AppGini Super Hero
AppGini Super Hero
Posts: 151
Joined: 2016-05-27 09:08

Re: new to appgini v5.51

Post by DevGiu » 2016-11-28 18:08

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}'
/Giuseppe
Professional Outsourcing Services

robertahyan
Posts: 5
Joined: 2016-10-28 17:25

Re: new to appgini v5.51

Post by robertahyan » 2016-12-01 18:11

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?

peebee
AppGini Super Hero
AppGini Super Hero
Posts: 352
Joined: 2013-03-21 04:37

Re: new to appgini v5.51

Post by peebee » 2016-12-01 22:39

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.

robertahyan
Posts: 5
Joined: 2016-10-28 17:25

Re: new to appgini v5.51

Post by robertahyan » 2016-12-06 07:14

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.

Post Reply