This topic is locked

Using event on Add Page to redirect IF (condition)

4/5/2006 11:15:47 AM
PHPRunner General questions
D
Dale author

Im not a javascript wizard, but if someone can give me a couple of tips.

I have looked over the event samples but I am not quite sure how to accomplish my goal.
I have a record for customer purchases. The field I will need to reference is the 'total_price' field.
I would like, after purchase record added, to prompt, if the user would like to add another purchase. If YES then display empty purchase form as it does now. If the user responds NO, then display the payment_add.php with the total of the purchase record just added. The user may select many purchases so I need to keep a running total of the purchases to help with the payment_add.php.
I would appreciate if anyone could point me in the right direction on how I could accomplish this.
Great forum, great product.

Sergey Kornilov admin 4/6/2006

Dale,
sure, you can do this.
I.e. you can add a button to generated purchases_add.php page - "Save and checkout".

It will save the record just like "Save" does and then redirect to "payments_list.php"
You can pass Total value thru the query string and use @$_GET["total"] as a Default value for

payments.total field.

D
Dale author 4/6/2006

Thanks Sergey,

The tip will help me carry on.
Once I get my project done, I will give access to all phprunner users to the demo. I will be very interested in what fellow users may remark on.