using fabrik 3.1 how to save several records from only one form

radvla

Member
I am trying to do the next thing using fabrik 3.1( I am also trying to do it using fabrik 3.0 and for this other issueI opened a different thread in the 3.0 forum because the solution cold not be the same)

1?) I have a table an list that is a set of categories and products we can call category1,2,3,.... and product11,12,13...21,22,23,.....31,32,33......

Each product has its atributes, we can call atribute11,12,13....,atribute 21,22,23,......three of them are the unit_price11,12,13....21,22,23,..., the number of units number_units11,12,13....,21,22,23.... and the total price, total_price11,12,13....21,22,23 ,this last field it is a calculated field got as unit_price11*number_units11, and so on.

how can I implement the following session with the user:

2?) the user select the category by menas of a scroll field.

3?) after this a form arises with the follow columns in a atable form:
PRODUCTS UNIT_PRICE NUMBER_UNITS TOTAL_PRICE

Line(ij) -> products(ij).........unit_price(ij).......number_units(ij)......total_ price(ij).

for all the products that belong to this category.

4?) te start filling tha colum number_units(ij) and so is doing the total_price(ij) caculated field is displaied.

5?) when he finish, confirm and save, in the table are registerd and saved as many records as product lines he have filled.

An early response willbe highly appreciated
thank you
radvla
 
It sounds like you have created each category and product as a set of elements in a list. Is this the case?

If so, it would be normal to create a List of categories (id,category), and another List of products keyed on category (id, category_id, unit_price), and then use a repeat group to create the list of products in the order (id, parent_id, category, product, unit_price, number_units, total_price), using a cascading dropdown to select the category and then the product.

Does this help?

S
 
No it is not that the goal:

Only the category is selected by the user somehow or another, but after that is done, being the number of product very large, all the products belonging to the selected category are shown in secuencial lines within only one screen , to let the user introduce the number of units for each products, confirm and save the whole order with only one click.

Doing so you avoid the user to save and edit many times, one by each products he wants to by, the form, what can be endless.

When the whole order is saved, each product belonging to he order must be registerd as an independent record. Al this product records will have in comon the date ,category and order number.

An early reply will be highly appriciated
Thanks
 
No. I am just another user like you and don't have the time for that. I'm afraid that as this is Open Source software, you need to be a little more self sufficient and read whatever you can find in the wiki and then experiment.

S
 
Dear Rob,

1?) the last message of the tutorial you sent me , says does it does NOT DO exactly what i asked in the thread,here I attached the screenshot and i copy the message literaly:

Under the hood, repeated droups may not work the way you expect them do.They do NOT create any kind of multiple row entry, or automatically generate a one-to-many table linkage.(this wha i want!!!!)
Each repeated antry is stored in the same field in the same row, using a special separator string. TO BE CONTINUED.

2?) I also attached a screenshot showing the interation of the user I need.

I need a multiple row entry.this is what needi.jpg

?) if there is a continuation pf the tutorla(TO BE CONTINUED), I would like to know it for information
 

Attachments

  • last-message-tutorial.jpg
    last-message-tutorial.jpg
    59 KB · Views: 331
I thought in one solution that seems he only one.
1?) to use fabrick to create the tables.
2?) To use html or php, to manipulate them creating a new fabrik plgin

a) Let suppose for the sake of simplicity, you have onle onetable with the elements order number,categories, products and products atributes,unit prices,quantities and total prices.

Le t say the user select one categories.

b) i need only 4 sentences in php for:

- open a form with so many rows as products belong to the categori selected, and as colums ,productc name,number units, total price(calculated field), atributes. Pcik up the dates of the user with the form and astore them in a matrix

- open the data base

-Register in the databse the data of the matrix, b ading as many records as rows had the form.

-close the databsa.

c) Can you tell me which sentences of php can do that?.
haow can install in fabrik a new plugin or modulus composed by thi 4 former sentences?
 
The statement in the tutorial probably relates to an old version of Fabrik. In 3.x repeat groups ARE stored in a separate table. I suggest you create the new table as a List and set the Group to Repeatable and manually join it to the base list.

Fabrik is capable of achieving what you want without writing complex php code or new fabrik plugins.

S
 
We are in need of some funding.
More details.

Thank you.

Members online

No members online now.
Back
Top