To recall submitted form data for a logined user

Home Forums Quform WordPress To recall submitted form data for a logined user

This topic is: resolved
Viewing 15 posts - 1 through 15 (of 18 total)
  • Author
    Posts
  • #25814
    cheney
    Participant

    Hi there,

    I want to create a page which user can see list of their own submitted forms then click to recall what they did. The list could be a table with submitted date, title and couple key element of the submitted data as identification. If its too complicated, at least the tile and submitted date would be needed. User can tracking back user’s submitted data.

    How should I do to make this page?

    Regards, Cheney

    #25864
    Ally
    Support Staff

    You don't have permission to view this content. Please log in or register and then verify your purchases to gain access.

    #27090
    aaron1988
    Participant

    Hi Ally,

    I did that code in functions.php but does not seem to be returnings the {all_form_data} 🙁

    #27113
    Ally
    Support Staff

    You don't have permission to view this content. Please log in or register and then verify your purchases to gain access.

    #27125
    aaron1988
    Participant

    Thanks, Ally i will try this.

    #27285
    aaron1988
    Participant

    Hi Ally,

    This code works but one thing can it be change so it only shows the information for that specific user? and not everyones?

    As i did 2 tests, 2 different emails and when i logged in i could see both?

    Thanks
    Aaron

    #27306
    Ally
    Support Staff

    You don't have permission to view this content. Please log in or register and then verify your purchases to gain access.

    #27310
    aaron1988
    Participant

    Hi Ally,

    Basically we are using some code from your documentation to Register people on Submission and once submitted then where I have put the shortcode: [user_subscribe_list] it seems to be showing 2 entries when one user is:

    aaronhealey23@gmail.com and second is: facebook@bluegeeks.co.uk as examples then once form is submitted I login with: aaronhealey23@gmail.com shows me 2 entries and then when I login as facebook@bluegkeeks.co.uk I get the same ☹

    Thanks
    Aaron

    #27318
    aaron1988
    Participant

    the code i am using is:

    <?php
    /**
    * Plugin Name: Quform Custom Code
    * Plugin URI: https://www.quform.com
    * Description: Custom code for Quform.
    * Version: 1.0.0
    * Author: ThemeCatcher
    * Author URI: https://www.themecatcher.net
    */
    add_shortcode('show_subscribers_list', function () {
    if ( ! is_user_logged_in()) {
    return '';
    }
    $repository = Quform::getService('repository');
    $formFactory = Quform::getService('formFactory');
    $options = Quform::getService('options');
    $form = $formFactory->create($repository->getConfig(1));
    $entries = $repository->getEntries($form, array('order_by' => 'created_at', 'order' => 'ASC'));
    $output = '';
    if (is_array($entries) && count($entries)) {
    $output .= '<table><tr>';
    $output .= '<th>Overall</th>';
    $output .= '<th>Listening</th>';
    $output .= '<th>Reading</th>';
    $output .= '<th>Writing</th>';
    $output .= '<th>Speaking</th>';
    $output .= '<th>Total</th>';
    $output .= '<th>Gap</th>';
    $output .= '</tr>';
    foreach ($entries as $entry) {
    set_form_values($form, $entry);
    if ($form->getElement('quform_1_11')->isEmpty()) {
    continue;
    }
    $output .= '<tr>';
    $output .= '<td>' . $form->getValueHtml('quform_1_11') . '</td>';
    $output .= '<td>' . $form->getValueHtml('quform_1_18') . '</td>';
    $output .= '<td>' . $form->getValueHtml('quform_1_19') . '</td>';
    $output .= '<td>' . $form->getValueHtml('quform_1_20') . '</td>';
    $output .= '<td>' . $form->getValueHtml('quform_1_21') . '</td>';
    $output .= '<td>' . $form->getValueHtml('quform_1_59') . '</td>';
    $output .= '<td>' . $form->getValueHtml('quform_1_60') . '</td>';
    $output .= '</tr>';
    }
    $output .= '</table>';
    } else {
    $output .= '<p>No subscribers found.</p>';
    }
    return $output;
    });
    function set_form_values(Quform_Form $form, array $entry)
    {
    foreach ($entry as $key => $value) {
    if (preg_match('/^element_\d+/', $key)) {
    $elementId = (int) str_replace('element_', '', $key);
    $form->setValueFromStorage($elementId, $entry[$key]);
    }
    }
    }

    #27477
    aaron1988
    Participant

    Hi Ally,

    Would you like to view my setup?

    Thanks
    Aaron

    #27485
    Ally
    Support Staff

    You don't have permission to view this content. Please log in or register and then verify your purchases to gain access.

    #27487
    aaron1988
    Participant

    Hi Ally,

    I am using Quform 2.5.0 changed the part you said. and now i get: “No Subscribers Found.” and i resubmitted the form just to make sure.

    Thanks
    Aaron

    #27525
    aaron1988
    Participant

    Hi Ally,

    Wondered if you had any update on this 🙂

    Thanks
    Aaron

    #27529
    Ally
    Support Staff

    You don't have permission to view this content. Please log in or register and then verify your purchases to gain access.

    #27534
    aaron1988
    Participant

    Hi Ally,

    Email has been sent 🙂

    Thanks
    Aaron

Viewing 15 posts - 1 through 15 (of 18 total)
  • You must be logged in to reply to this topic.
Be inspired. © 2024 ThemeCatcher Ltd. 20-22 Wenlock Road, London, England, N1 7GU | Company No. 08120384 | Built with React | Privacy Policy