This topic is locked
[SOLVED]

 Shopping List

3/26/2009 12:41:06 PM
PHPRunner General questions
C
Cjiggy0326 author

I am having a hard time trying to figure out how i can setup a shopping list with PHPR. Is it even possible to have a field for each record where i can input a number to multiply by my price to get my total?
I need to be able to enter the qty on the page and give me a total
Any help is appreciated in this task.

S
swanside 3/26/2009

Your are best setting up fields in your mysql table, like quantity, cost, then you can write your sql statement similar to quantity*cost to give you a subtotal.

Have you got a MySQL database setup already?

C
Cjiggy0326 author 3/26/2009

Yes i have a MySQL database setup
My table i have setup has
Item_UID

Item_ID, Fixed

Quantity, I want to enter my own qty on the webpage

Price, Fixed
Total - Results of qty * price
Do i need to write my own php script to do this ?

Sergey Kornilov admin 3/26/2009

Answered to your personal email.

C
Cjiggy0326 author 3/26/2009

How Do i add a form field to the list page ?
So that i can do my sql calculation to take what is entered in as qty and give me a total ?

J
Jane 3/27/2009

I'm not sure what "add form on th list" mean.

To calculate value on the edit page use Before record added event on the Events tab.

Here is a sample:

$values["Field1"] = $values["Field2"] * $values["Field3"];



where Field1, Field2 and Field3 are your actual field names.

C
Cjiggy0326 author 3/27/2009

What i meant by form field is a blank box where i can put a amount that i want to purchase than it gets totaled by the Price and displays in Sub_Total box.
Is that the same thing your talking about?

C
Cjiggy0326 author 3/27/2009

Let me try to reword this.
I want to have a ability to just run down my list of items and enter the qty for each item and giving me a total in the sub total.
I dont want my users to have to click on inline Edit, I than want to save for Manager to view and than click submit button to e-mail to sales rep of the company. Its just a list where i want the ability to enter the qty directly from the "list page". Is this possible?
Thanks,
Cory

J
Jane 3/31/2009

Hi,
I'm not sure that I understand your question.

How do you enter the qty directly from the "list page"? Could you show me an example?