Email Form Plugin - PHP Template - Get data with sql query

marcq

Member
Hi,

After a form is submitted an email his sent by the Email Form Plugin / PHP/HTML Template.

Some fields data are sent correctly, but I'm missing data/content from 3 autofill fields (
pbdf_fabrik_user_soumission_ordonnance___name_raw,
pbdf_fabrik_user_soumission_ordonnance___firstname_raw
pbdf_fabrik_user_soumission_ordonnance___no_assure_raw).

I have already read

http://fabrikar.com/forums/index.php?wiki/email-form-plugin/

but it doesn't helped me further.

How can I get to this data ? Is it possible to add an sql query in my template ? If yes could someone give me a short example ?

Thanks in advance

Marc


Array :
pbdf_fabrik_user_soumission_ordonnance___id 84
pbdf_fabrik_user_soumission_ordonnance___date_record 31-01-2015 21:03:00
pbdf_fabrik_user_soumission_ordonnance___usergroup 10
pbdf_fabrik_user_soumission_ordonnance___degreurgence Urgent
pbdf_fabrik_user_soumission_ordonnance___titre Ordonnance 1
pbdf_fabrik_user_soumission_ordonnance___message Ordonnance 1
listid 6
listref 6
rowid 84
Itemid 138
option com_fabrik
task form.process
isMambot
formid 6
returntoform 0
fabrik_referrer http://www.pharmacie-bdf.ch/espaceclients/index.php/ordonnances/mes-ordonnances
fabrik_ajax 0
package fabrik
packageId
bb82173426b0a35060ba0bad636c7ffd 1
format html
fabrik_repeat_group 1
fabrik_vars 47 17E325422 75A4556 540
Submit
pbdf_fabrik_user_soumission_ordonnance___id_raw 84
pbdf_fabrik_user_soumission_ordonnance___date_record_raw 2015-01-31 21:03:00
pbdf_fabrik_user_soumission_ordonnance___usergroup_raw 10
pbdf_fabrik_user_soumission_ordonnance___userid_raw 695
pbdf_fabrik_user_soumission_ordonnance___username_raw Client 1
pbdf_fabrik_user_soumission_ordonnance___name_raw MISSING
pbdf_fabrik_user_soumission_ordonnance___firstname_raw MISSING
pbdf_fabrik_user_soumission_ordonnance___no_assure_raw MISSING
pbdf_fabrik_user_soumission_ordonnance___statut_raw 1
pbdf_fabrik_user_soumission_ordonnance___degreurgence_raw 1
pbdf_fabrik_user_soumission_ordonnance___titre_raw Ordonnance 1
pbdf_fabrik_user_soumission_ordonnance___message_raw Ordonnance 1
pbdf_fabrik_user_soumission_ordonnance___piecesjointes_raw
 
These are the same elements which are not stored. Does your user have add/edit access for these elements?

gesendet mit Tapatalk
 
These are the same elements which are not stored. Does your user have add/edit access for these elements?

gesendet mit Tapatalk


Hi Troester, thanks for your reply.

No the user which submit the form has no add or edit access to these elements in the form. Because I wan't to have these fields readonly.
By the way after store and before calculation I'm updating the database fields name, firstname and no_assure with correct values from the user table. So these 3 informations are stored in the same database has those for the inquiry.
 
If the user shouldn't be able to modify use the elements default, eval, e.g. return '{$my-> email}';
and not the autofill
or better (to have normalized data) use only one dbjoin to the user table and show the data via the concat field.

gesendet mit Tapatalk
 
If the user shouldn't be able to modify use the elements default, eval, e.g. return '{$my-> email}';
and not the autofill
or better (to have normalized data) use only one dbjoin to the user table and show the data via the concat field.

gesendet mit Tapatalk

Thanks Troester, I will try this and I'll keep you informed .

I can get the name {$my->name}, the username {$my->username}
but not the firstname {$my->firstname}and the no d'assur? {$my->no_assure}
All these informations are in the fabrik user table which is synchronized with the juser table.

Concerning your better solution : Should I create a query in the PHP plugin (onload form) that retrieves the needed data and return the value in the default value of the element ?
 
Hi there,
Since I'm a newbie and I have less time to solve this issue, I'm ready to pay in order to solve this as soon as possible.
 
The {$my->something} placeholders only provide access to the data in the standard J! #__users table for the logged on user, not any Fabrik tables.

Did you try Troester's suggestion of using an eval'ed default for the elements?

By the way after store and before calculation I'm updating the database fields name, firstname and no_assure with correct values from the user table. So these 3 informations are stored in the same database has those for the inquiry.

How are you doing that? With a PHP plugin?

If you are truly stuck, find me on Skype (cheesegrits, hugh dot messenger @ gmail dot com) and I'll see what I can do to help.

-- hugh
 
The {$my->something} placeholders only provide access to the data in the standard J! #__users table for the logged on user, not any Fabrik tables.

Did you try Troester's suggestion of using an eval'ed default for the elements?



How are you doing that? With a PHP plugin?

If you are truly stuck, find me on Skype (cheesegrits, hugh dot messenger @ gmail dot com) and I'll see what I can do to help.

-- hugh


Hi Hugh, thanks again for your reply.

In the "G?rer les ordonnances" Form I'm "autofilling" three fields (name, firstname and no_assure) which are part of the fabrik user table which is synchronized with the juser table. I need to display this 3 informations both on customer and company side. It works fine.

After the Form is submitted I'm updating the "pbdf_fabrik_user_soumission_ordonnance" fields name, firstname and no_assure with the correct values in order to have it in this Fabrik table. It works also fine.

The problem I have is that I want to send an email after form submission with the Email Plugin to the company, which contains all the data displayed on that form. I can't get the name, firstname and no_assure variables/datas. I'm learning and have less knowledge how to do it adequately. I guess that I could do it in the Form email plugin and with an HTML PHP template ? I should be able to get the id of the record created after form submission in order to retrieve the correct data from the pbdf_fabrik_user_soumission_ordonnance ?

Thanks in advance Hugh if you could just give me some advise how I could get the record ID after form submission and I will try to do it myself.

Cheers,

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

Thank you.

Members online

Back
Top