Embed data from a List into a Form

marcq

Member
Hi,

I have created the following two forms :

Training Creation Form
Accessible for registered Training Administrator.

Enable the Training Institute to create new Training Course and to add it in its Training Course catalog.

The Form contains among others the following fields :

- Title of the Training Course
- Training session Title
- Training session Date from
- Training session Date to
- Training session Price


Training Course Enroll Form
Accessible for non registered candidates.

Enable non registered candidates to enroll for specif Training Courses.

The Form contains among others the followings fields :
- Contact details (Name, Address, Tel., ZIP, City etc.)

Issue I would like to solve :
I would like that each time a new Training Course is created by the registered Training Administrator with the "Training Course Creation Form", the Training Course appears (embedded) in the "Training Enroll Form" in order to enable the candidate to choose the training (one or more) he would like to enroll.

I need now to find a way to embed the following information into my "Training Course Enroll Form" :

- Title of the Training
- Training session Title
- Training session Date from
- Training session Date to
- Training session Price

Please see screenshot attached how it should be.

Thank you in advance for your suggestions and tips.

Marc
 

Attachments

  • 02122015 - ENROLLFORM.jpg
    02122015 - ENROLLFORM.jpg
    112.8 KB · Views: 261
The only way to do that is with a join element, using checkbox layout, bu it isn't going to get you that neat tabular structure. You can approximate it by using a CONCAT label to create a custom label for each checkbox, like "{thistable}.course_name, ' ', {thistable}.session_title, ' ', etc".

-- hugh
 
The only way to do that is with a join element, using checkbox layout, bu it isn't going to get you that neat tabular structure. You can approximate it by using a CONCAT label to create a custom label for each checkbox, like "{thistable}.course_name, ' ', {thistable}.session_title, ' ', etc".

-- hugh

Thank you Hugh, I will try your way. I'll keep you posted. Marc
 
Hugh,

I forgot to tell that the following fields I would like to embed in the Training Course Enroll Form :

- Title of the Training
- Training session Title
- Training session Date from
- Training session Date to
- Training session Price

are in a repeated group of the Training Creation Form.

Candidate should be able to choose the Training courses and sessions he would like to enroll for by clicking a checkbox.

I should be able to keep the values of the chosen Training courses and sessions in the Candidates table | List I have created. Because I need it in the following process (accept or not the candidate, send invoice to candidate etc.).

I tried many things, but I'm stuck. I can't find a way how I could at the same time enable the candidate to fill in his personal details and to choose the training courses and sessions he would like to enroll for and finally send the form in order that we keep the data in the database for the above exposed purposes.

Perhaps is my process wrong and perhaps did someone have a great idea that would help me to find a solution to this issue.

Thanks a lot for tips and suggestions.

Marc
 
Personally I wouldn't put the training course data in a repeat group. Just have it as a non-repeating part of the main form. Submit one form per course. You are making life difficult by making it a repeat group.

Although it's probably still do-able with a checkbox join, you'd just have to point the join at the table we automatically created for your repeat.

-- hugh
 
Personally I wouldn't put the training course data in a repeat group. Just have it as a non-repeating part of the main form. Submit one form per course. You are making life difficult by making it a repeat group.

Although it's probably still do-able with a checkbox join, you'd just have to point the join at the table we automatically created for your repeat.

-- hugh

Thank you Hugh for your time and explanations. I will try the checkbox join again. I'll keep you posted. Marc
 
Hi Hug,

I have tried to embed my fields (repeated group) into the Training Creation Form.

I have created a group and my database joined elements pointing to my gprh_fabrik_user_training_124_repeat table.

Each field is rendered as a Checkbox.

I'm certainly doing something wrong, since the result is quite funky (please see attached TRAINING pic) :

1. Each record should be displayed horizontally (see attached ENROLLFORM pic.).
2. Each value should be displayed (ex. Prix: two sessions have the same price (2 000) but 2 000 is displayed only once).
3. I shouldn't have checkboxes for every field displayed, but only one in front of each record (since I'm using a repeated group) to enable the candidate to choose one or more training session. And to be able to keep the value of the chosen training courses and sessions.

I know I'm making my life difficult, but I would like to have the following completely automated process :

1. Training institute is creating a new training and it session(s) in the Training Creation Form.
2. Training and sessions are displayed automatically and immediately in the Training Course Enroll Form.
3. Candidate can enroll to several training courses without having to consult each related Training Course web pages (and having multiple enrollment subscriptions forms to create and to create a new one each time a new Training Course is added to the catalog).

I would appreciate some help and I'm ready to pay for that. At the same time I could improve my skills.

Cheers,

Marc

 

Attachments

  • TRAINING.png
    TRAINING.png
    25.5 KB · Views: 202
I tried logging on to your site (as per your My Sites) but ai get a 404.

Are you creating the course selection as a join element set to render as checkboxes?

-- hugh
 
As I said in my first response:

The only way to do that is with a join element, using checkbox layout, bu it isn't going to get you that neat tabular structure. You can approximate it by using a CONCAT label to create a custom label for each checkbox, like "{thistable}.course_name, ' ', {thistable}.session_title, ' ', etc".

In other words, a single join element to the courses table, and building the "name start end price" label using a CONCAT.

What you did was create four separate joins.

I've started it off for you, with just a simple (not very readable) concat:

Code:
{thistable}.intitule_session, ' ', {thistable}.session_du, ' ', {thistable}.session_au, ' ', {thistable}.prix

You can get it to look nicer by including some HTML markup, and optionally add some custom CSS in the template, like ...

Code:
'<span class="sessionTitleSpan">', {thistable}.intitule_session, '</span><span class="sessionDuSpan">', {thistable}.session_du, '</span><span class="sessionAuSpan">', {thistable}.session_au, '</span><span class="sessionPrixSpan">', {thistable}.prix, '</span>'

... and add those classes to a custom_css.php in your template folder, and style them appropriately with margins, padding, whatever you want.

Getting headings in would be harder, although you might be able to do with with a display element just before the join, which uses the same span markup.

-- hugh
 
As I said in my first response:



In other words, a single join element to the courses table, and building the "name start end price" label using a CONCAT.

What you did was create four separate joins.

I've started it off for you, with just a simple (not very readable) concat:

Code:
{thistable}.intitule_session, ' ', {thistable}.session_du, ' ', {thistable}.session_au, ' ', {thistable}.prix

You can get it to look nicer by including some HTML markup, and optionally add some custom CSS in the template, like ...

Code:
'<span class="sessionTitleSpan">', {thistable}.intitule_session, '</span><span class="sessionDuSpan">', {thistable}.session_du, '</span><span class="sessionAuSpan">', {thistable}.session_au, '</span><span class="sessionPrixSpan">', {thistable}.prix, '</span>'

... and add those classes to a custom_css.php in your template folder, and style them appropriately with margins, padding, whatever you want.

Getting headings in would be harder, although you might be able to do with with a display element just before the join, which uses the same span markup.

-- hugh

Thanks a lot for your time and dedication Hugh, it works and it is exactly what I needed !
 
Hi,

I need to reopen this thread since I have an issue with "Group by" a databasejoin field rendered as Checkbox ({gprh_fabrik_user_enrollment___choix_formation}) into one of my list :

http://www.screencast.com/t/TcAvjn4n9sGX

Group heading is empty.

Concat field content :
Code:
'<span class="trainingTitleSpan">', {thistable}.nom_formation, '</span><span class="sessionTitleSpan">', {thistable}.intitule_session, '</span><span class="sessionDuSpan">', DATE_FORMAT({thistable}.session_du, '%d-%m-%Y'), '</span><span class="sessionAuSpan">', DATE_FORMAT({thistable}.session_au, '%d-%m-%Y'), '</span><span class="sessionMethodSpan">', {thistable}.intitule_prix, '</span><span class="sessionPrixSpan">', {thistable}.prix, '</span>'

Is there a solution to display these informations into the heading of the groups ?

Thanks in advance for your reply.

Cheers,

Marc
 
There seem to be several issues with list grouping:
It isn't related to Concat, it doesn't display dbjoin-checkboxes in the group heading and in the grouped list (although displayed correctly if the list is not grouped).
Same with dbjoin-multiselect.

Seems for grouping it doesn't take the repeat_element_table but the "single dbjoin" column of the original table (I have one list which has old entries in this column and here it's showing this value after grouping).


Ajaxfied lists don't show a group header at all (no matter which element).
 
Can you try selecting something for the "order by" in the Group By settings? Something other than the field you are grouping by.

-- hugh
 
Did you try what I asked?

In testing here, I've found what looks like a bug in PHP's mysqli driver, and that by adding extra ORDER BY on the main query, it'll work.

So under the Group By settings, where you select the checkbox join as the group by, try also selecting some other element (like 'id') as the Order By.

-- hugh
 
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top