Willkommen, Gast
Angemeldet bleiben:

THEMA:

Get other form values fro database 3 Monate 2 Wochen her #244335

  • Autor
  • mrperfectpz
  • Offline
  • Gold Breezer
  • Gold Breezer
  • Beiträge: 340
  • Dank erhalten: 0
Sorry Markus I am not very good with coding, can you tell where I need to place it within the code please

Bitte Anmelden oder Registrieren um der Konversation beizutreten.

Get other form values fro database 3 Monate 2 Wochen her #244352

  • TheMuffinMans Avatar
  • TheMuffinMan
  • Offline
  • Developer
  • Developer
  • Beiträge: 10064
  • Karma: 167
  • Dank erhalten: 803
Sure, can you please post the current state of the editable prepare code? I will add what I think should work then.

Bitte Anmelden oder Registrieren um der Konversation beizutreten.

Get other form values fro database 3 Monate 2 Wochen her #244354

  • Autor
  • mrperfectpz
  • Offline
  • Gold Breezer
  • Gold Breezer
  • Beiträge: 340
  • Dank erhalten: 0
Ok here is the code:
// ADD TEAMS HERE

// 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.`name` = 'JoinLeagueID' and
            s.`value`= " . $db->quote( $record_id ) );

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

 $all_joins = array();

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

             $db->setQuery("
            Select s.* 
            From
            #__facileforms_subrecords As s 
            Where 
            s.`record`= " . $db->quote( $list[$i]->record ) );
                     $all_joins[] = $db->loadObjectList();
          }

$length = count($all_joins);

        if( $length ){

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

                // adding all fields I want to display in the displayElement field

              $length2 = count($all_joins[$i]);

              $join_record = 0;

              for($j = 0; $j < $length2; $j++){

                $join_record  = $all_joins[$i][$j]->record;

                switch($all_joins[$i][$j]->name){






                    case 'JoinTeamName':
                        $items["displayElement"]["value"] .= '<div style="font-family: Arial;">'  . $all_joins[$i][$j]->value .'  </div>'  ;       
                       break;

                    case 'Owner':
                        $items["displayElement"]["value"] .= '<div style="font-family: Arial;">'  . $all_joins[$i][$j]->value .' </div>'   ;
                        break;



                     case 'TeamTotal':
                        $items["displayElement"]["value"] .= '<div style="font-family: Arial;">'  . $all_joins[$i][$j]->value .' </div>'   ;
                        break;

                  
                }
              }

$items["displayElement"]["value"] .= 'ID: ' . $join_record . "</br>\n";

                $items["displayElement"]["value"] .= '<div style="border-bottom: solid 1px; border-color: #dddddd;"></div> '    ;





            }
        }


As you can see I have bee playing a little to get the values to display horizontally within a div, im not sure if thats the way to go about it.
Also, how would I add numbers (1-end) to the beginning of each line

Bitte Anmelden oder Registrieren um der Konversation beizutreten.

Letzte Änderung: Post by mrperfectpz.

Get other form values fro database 3 Monate 2 Wochen her #244370

  • TheMuffinMans Avatar
  • TheMuffinMan
  • Offline
  • Developer
  • Developer
  • Beiträge: 10064
  • Karma: 167
  • Dank erhalten: 803
Hi,

please try this. I had to change the db result-sets being returned as array instead of objects so I can apply ksort() on them.

I also added an incremental number, think you mean this?
// ADD TEAMS HERE

// 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.`name` = 'JoinLeagueID' and
            s.`value`= " . $db->quote( $record_id ) );

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

$all_joins = array();

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

    $db->setQuery("
            Select s.* 
            From
            #__facileforms_subrecords As s 
            Where 
            s.`record`= " . $db->quote( $list[$i]['record'] ) );
    $all_joins[] = $db->loadAssocList();
}

$length = count($all_joins);

if( $length ){

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

        // adding all fields I want to display in the displayElement field

        ksort($all_joins[$i], SORT_NATURAL);

        $length2 = count($all_joins[$i]);

        $join_record = 0;

        for($j = 0; $j < $length2; $j++){

            $join_record  = $all_joins[$i][$j]['record'];

            switch($all_joins[$i][$j]['name']){

                case 'JoinTeamName':
                    $items["displayElement"]["value"] .= '<div style="font-family: Arial;">'  . $all_joins[$i][$j]['value'].'  </div>'  ;
                    break;

                case 'Owner':
                    $items["displayElement"]["value"] .= '<div style="font-family: Arial;">'  . $all_joins[$i][$j]['value'] .' </div>'   ;
                    break;

                case 'TeamTotal':
                    $items["displayElement"]["value"] .= '<div style="font-family: Arial;">'  . $all_joins[$i][$j]['value'] .' </div>'   ;
                    break;

            }
        }

        $items["displayElement"]["value"] .= 'Number: ' . ($i + 1) . "</br>\n";

        $items["displayElement"]["value"] .= '<div style="border-bottom: solid 1px; border-color: #dddddd;"></div> '    ;

        $items["displayElement"]["value"] .= 'ID: ' . $join_record . "</br>\n";

        $items["displayElement"]["value"] .= '<div style="border-bottom: solid 1px; border-color: #dddddd;"></div> '    ;

    }
}

Bitte Anmelden oder Registrieren um der Konversation beizutreten.

Get other form values fro database 3 Monate 2 Wochen her #244379

  • Autor
  • mrperfectpz
  • Offline
  • Gold Breezer
  • Gold Breezer
  • Beiträge: 340
  • Dank erhalten: 0
Thanks for adding the numbers thats great but still no effect on the sorting

As you can see from the screenshot ID's 37, 35 are how it should be but they seem to swap so that team is at bottom
Anhänge:

Bitte Anmelden oder Registrieren um der Konversation beizutreten.

Letzte Änderung: Post by mrperfectpz.

Get other form values fro database 3 Monate 2 Wochen her #244381

  • TheMuffinMans Avatar
  • TheMuffinMan
  • Offline
  • Developer
  • Developer
  • Beiträge: 10064
  • Karma: 167
  • Dank erhalten: 803
Try this
// ADD TEAMS HERE

// 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.`name` = 'JoinLeagueID' and
            s.`value`= " . $db->quote( $record_id ) );

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

 $all_joins = array();

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

             $db->setQuery("
            Select s.* 
            From
            #__facileforms_subrecords As s 
            Where 
            s.`record`= " . $db->quote( $list[$i]->record ) . " Order by s.`value`" );
                     $all_joins[] = $db->loadObjectList();
          }

$length = count($all_joins);

        if( $length ){

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

                // adding all fields I want to display in the displayElement field

              $length2 = count($all_joins[$i]);

              $join_record = 0;

              for($j = 0; $j < $length2; $j++){

                $join_record  = $all_joins[$i][$j]->record;

                switch($all_joins[$i][$j]->name){






                    case 'JoinTeamName':
                        $items["displayElement"]["value"] .= '<div style="font-family: Arial;">'  . $all_joins[$i][$j]->value .'  </div>'  ;       
                       break;

                    case 'Owner':
                        $items["displayElement"]["value"] .= '<div style="font-family: Arial;">'  . $all_joins[$i][$j]->value .' </div>'   ;
                        break;



                     case 'TeamTotal':
                        $items["displayElement"]["value"] .= '<div style="font-family: Arial;">'  . $all_joins[$i][$j]->value .' </div>'   ;
                        break;

                  
                }
              }

$items["displayElement"]["value"] .= 'ID: ' . $join_record . "</br>\n";

                $items["displayElement"]["value"] .= '<div style="border-bottom: solid 1px; border-color: #dddddd;"></div> '    ;





            }
        }

Bitte Anmelden oder Registrieren um der Konversation beizutreten.

Moderatoren: ForumSupport
Ladezeit der Seite: 0.061 Sekunden

Angebot

Sommer Special! Alle Mitgliedschaften zum Sonderpreis!

Prio Support, alle Extensions und alle Templates in einem Paket.

Hier geht's zur Bestellung

Crosstec hilft sparen!

Falls Sie neu bei Crosstec sind aber bereits einen Formulargenerator bei einem anderen Hersteller gekauft haben, dann bekommen sie von uns einen Rabatt von 25% auf unsere 1-Jahres und Pro-Mitgliedschaften

Wie Sie an den Rabatt kommen?

Schreiben Sie uns einfach eine kurze Email mit beigelegten Kaufbeleg (z.B. PayPal Quittung) an sales@crosstec.org.

Wir unterstützen die Joomla Community

Crosstec unterstützt weltweit alle offiziellen Joomla! User Groups und Organisatoren von Joomla! Days die bei Joomla.org registriert sind.

Falls das auf dich zutrifft und du eines unserer Produkte brauchst, schreib uns eine kurze Email an info@crosstec.org und du bekommst eine Flatrate-Mitgliedschaft geschenkt!