PLEASE NOTE: These forums are no longer utilized and are provided as an archive for informational purposes only. All support issues will be handled via email using our support ticket system. For more detailed information on this change, please see this blog post.

Display Data

  1. I'm having trouble figuring out the best way to output display the data captured in the rg_lead_detail table. Do you have any tips or instructions for showing the data on a separate webpage? Combining the rg_form_meta with the data table is what I'm trying to accomplish so that I can display the labels and data side by side.

    Thanks

    Posted 14 years ago on Sunday January 3, 2010 | Permalink
  2. I'm using this code with exec-php plugin to get an idea for how it might output but nothing appears on the page:

    <?php
    $leadid=2;
    global $wpdb;

    $results = $wpdb->get_results($wpdb->prepare(" SELECT l.*, field_number, value
    FROM wp_rg_lead l
    INNER JOIN wp_rg_lead_detail ld ON l.id = ld.lead_id
    WHERE l.id=%d
    ORDER BY l.id, field_number", $leadid));

    foreach($results as $result){
    echo "


    Entry Id: " . $result->id . "
    ";
    echo "Field Number: " . $result->field_number . "
    ";
    echo "Field Value: " . $result->value . "
    ";
    ?>

    Posted 14 years ago on Monday January 4, 2010 | Permalink
  3. The support team member that can best answer this question is currently traveling. Once he is available he will respond back with information on how you can accomplish this.

    Posted 14 years ago on Monday January 4, 2010 | Permalink
  4. bloomkey,
    I will come up with a code snippet and post it here when I have it.
    It might take me a couple of days, but I will get it done.

    Posted 14 years ago on Monday January 4, 2010 | Permalink
  5. Here we go, try the following code.
    You will need to replace $lead_id and $form_id with the right values.

    $form_id = 18;
        $entry_id = 190;
    
        $form_meta = RGFormsModel::get_form_meta($form_id);
        $entry = RGFormsModel::get_lead($entry_id);
    
        echo "<hr/>Form Title: " . $form_meta["title"] . "<br/>";
    
        //displaying all submitted fields
        foreach($form_meta["fields"] as $field){
    
           if(is_array($field["inputs"])){
    
               //handling multi-input fields such as name and address
               foreach($field["inputs"] as $input){
                   $value = $entry[strval($input["id"])];
                   $label = RGFormsModel::get_label($field, $input["id"]);
                   echo $label . ": " . $value .  "<br/>";
               }
           }
           else{
               //handling single-input fields such as text and paragraph (textarea)
               $value = $entry[$field["id"]];
               echo $field["label"] . ": " . $value .  "<br/>";
           }
        }
        echo "<hr/>";
    Posted 14 years ago on Wednesday January 6, 2010 | Permalink
  6. flameboyuk
    Member

    Is there any way using a similar method to output a number of specific submitted fields (as I don't want to use custom fields)?

    Posted 14 years ago on Thursday June 3, 2010 | Permalink
  7. flameboyuk
    Member

    Anyone?
    Does anyone have a snippet to output display the value for a specific Lead ID and Field No. in the database (without using custom fields)?

    Posted 14 years ago on Thursday June 10, 2010 | Permalink