TOPIC:

Get other form values fro database 1 year 7 months ago #242023

  • Topic Author
  • mrperfectpz
  • Offline
  • Gold Breezer
  • Gold Breezer
  • Posts: 411
  • Thanks: 0
Hi Markus

I would need all records and I need to check through all the records to see if the League name and League ID (JOIN_LEAGUE) match the CB League name and LeagueID, then I can display some values from the record.

Please Log in or Create an account to join the conversation.

Get other form values fro database 1 year 7 months ago #242026

  • TheMuffinMan's Avatar
  • TheMuffinMan
  • Offline
  • Developer
  • Developer
  • Posts: 10064
  • Karma: 167
  • Thanks: 808
ok, now that I fully understood everything, please export both breezingforms forms in Configuration => Create Package => choose each of the 2 forms one-by-one and export.

Zip the 2 files and attach them to your next reply.

I will add the code for you because I it will be easier for me to test and give you correct results.

Please Log in or Create an account to join the conversation.

Get other form values fro database 1 year 7 months ago #242028

  • Topic Author
  • mrperfectpz
  • Offline
  • Gold Breezer
  • Gold Breezer
  • Posts: 411
  • Thanks: 0
Hi Markus

I have attached both forms (copy). Please be aware that both forms are in working progress.
Thanks you for your help !

Please Log in or Create an account to join the conversation.

Last edit: Post by mrperfectpz.

Get other form values fro database 1 year 7 months ago #242061

  • TheMuffinMan's Avatar
  • TheMuffinMan
  • Offline
  • Developer
  • Developer
  • Posts: 10064
  • Karma: 167
  • Thanks: 808
Hi,

ok, based on your forms and your description I re-created the case and as described below I was able to pull data from corresponding submissions made with the JOIN_LEAGUE form:
  • In your Create League form, add a hidden input and name it 'displayElement'. Give it a random default value.
  • In your Create League view, add the code below into the content prepare tab.
  • In the content template tab, add the {displayElement:value} tag but do NOT use hide-if-empty
  • Save the view and open a record in a list view
        // clearing the display element first
        $items["displayElement"]["value"]  = '';

        // getting all element values based on the record id
        $db = JFactory::getDbo();
        $db->setQuery("
            Select s.* 
            From
            #__facileforms_subrecords As s 
            Where 
            s.record = " . $db->quote( $items["recID"]["value"] ) );

        $list = $db->loadObjectList();
        $length = count( $list );

        if( $length ){

            for($i = 0; $i < $length; $i++){

                // adding all fields I want to display in the displayElement field
                switch($list[$i]->name){
                    case 'JoinLeagueName':
                        $items["displayElement"]["value"] .= 'Joined League Name: ' . $list[$i]->value . "<br />\n";
                        break;
                    case 'UserID':
                        $items["displayElement"]["value"] .= 'Joined User ID: ' . $list[$i]->value . "<br />\n";
                        break;
                }
            }
        }

As you can see above, with the switch statement you can control what to display in the "displayElement".

Also be aware that the above gets all values by the field names, so it would be best that the field names you want to display are unique otherwise it can happen you gonna pull values from the wrong form.

Regards,
Markus

Please Log in or Create an account to join the conversation.

Last edit: Post by TheMuffinMan.

Get other form values fro database 1 year 7 months ago #242287

  • Topic Author
  • mrperfectpz
  • Offline
  • Gold Breezer
  • Gold Breezer
  • Posts: 411
  • Thanks: 0
Hi Markus

This doesnt seem to work

Please Log in or Create an account to join the conversation.

Get other form values fro database 1 year 7 months ago #242293

  • TheMuffinMan's Avatar
  • TheMuffinMan
  • Offline
  • Developer
  • Developer
  • Posts: 10064
  • Karma: 167
  • Thanks: 808
Hi,

I tested this carefully and it worked for me. Do you get any errors?

However, please make sure to follow the steps I outlined carefully.

Especially naming the elements correctly like "displayElement".

If you want, I can export you everything I got but it will be a complex package with database table, that's why I didn't attach it in the first place.

Regards,
Markus

Please Log in or Create an account to join the conversation.

Moderators: ForumSupport
Time to create page: 0.054 seconds

BreezingForms Pro 1.4.7 for WordPress Released!

Available in the membership section.

September Discount!

Massive discounts on all subscriptions!

Get Your Subscription Here

Quick Links

Downloads

BreezingForms

ContentBuilder

BreezingCommerce

Templates

Documentation

BreezingForms

ContentBuilder

BreezingCommerce

Apprendre BreezingForms (French Community)

Apprendre et maîtriser BreezingForms par des tutoriels et exemples, le tout en français

breezingforms.eddy-vh.com

Questions et réponses sur les forums de l'AFUJ

AFUJ

Special Offer

Summer Sale! All subscriptions at a special price!

Includes prio support, all of our current and future Joomla!® extensions and Joomla!® templates for the duration of your membership.

Get it from here

3rd Party Discount - 25% Off

We help you to keep your costs under control. If you are a new member and purchased a form building tool from a different form vendor, then you'll get a 25% discount on our subscription plans.

How to receive the discount:

Send us a quick email to sales@crosstec.org with a proof of purchase (for example a paypal receipt), await payment instructions and enjoy your membership!