• Resolved jsa922

    (@jsa922)


    I am trying design a charge-entry system for our company. I have installed Contact Form 7 and CFBD, both of which appear to be capable of meeting my data entry and retrieval needs. However, while I can get charge data in, and have it accessible to our Manager, I can’t figure our how to display a unique client query result first. From a page restricted to authorized partners, I need to have a field by which a client ID can be submitted to query the database and display the unique matching projects/issues list for that client. The partner would need to be able to update that list to the DB when necessary, then copy from it to fill-in a separate form for submission of current charge activity. Are there short-codes that can take a supplied client ID and display the corresponding list, then allow resubmission of an edited/revised list? The list is simply a Text Area with each project or issue on a separate line. FYI, I have very limited PHP/Javascript knowledge, though I’ve done a fair bit of programming in other languages/frameworks. Any suggestions would be most appreciated!

    https://wordpress.org/plugins/contact-form-7-to-database-extension/

Viewing 10 replies - 1 through 10 (of 10 total)
  • Plugin Author Michael Simpson

    (@msimpson)

    You can create a search form on a private page to search for entries by a field such as a client ID. With the (not free) editor extension you can have the search results show in a table where you can click on and edit values then save them. I don’t know if that is what you are looking for.

    Thread Starter jsa922

    (@jsa922)

    This does sound like it is what I’m looking for. THANKS! I’ll try the search form; probably you’ll have a purchaser of the editor extension. I will get back to you if I still have questions. Thanks, again, for the help!

    Plugin Author Michael Simpson

    (@msimpson)

    Yes, try the search form first and see if that does what you want before you purchase. In the search form, use [cfdb-datatable] and if you get the editor add [cfdb-datatable edit=”true”] and then you can click on a table cell and edit its value. Keep that page private or protected so that only those authorized to edit can access it.

    Thread Starter jsa922

    (@jsa922)

    This seems to be getting me close to where I need to be. However, the search results that display are ALL the data, including who posted it, when, the IP address, and so on. All I need is the client project/issues list that corresponds to a given ID, though inclusion of the ID itself in the output is OK. Is limiting which columns actually display something I will need the Editor Extension for, or would it only be used to make entries editable/”re-savable”?

    BTW, I’ll be needing to keep ID’s unique. Your post on that references your “Add Actions and Filters” plugin, which looks like it will solve some other problems (unrelated to DB matters) I’ve been encountering with per-page HTTPS access. Unfortunately, that plugin is not yet listed as compatible with WP 4.1. I noticed that you are the author. Any likelihood of such a compatibility soon?

    Thanks. I love the CFDB plugin.

    Plugin Author Michael Simpson

    (@msimpson)

    Choose the columns you want to display in the short code using “show”
    [cfdb-datatable form="your-form" show="column1,column2,column3"]

    “Add Actions and Filters” is OK with WP 4.1. I just haven’t edited that number.

    Thread Starter jsa922

    (@jsa922)

    Thanks! The column suggestion works.

    I looked at your “Creating a Form” post for more info, since it indicated that I could prevent the display of all the data when the page first renders by adding another conjunctive condition to the filter. Unfortunately, this makes the data disappear entirely, including after entering a search criterion. Here’s what I did:

    <form action=”” method=”POST”>Search ID#: <input name=”id” type=”text” /><input name=”x” type=”hidden” />  <input type=”submit” value=”Go” />

    [cfdb-table form=”P List” filter=”ID~~/.*$_POST(id).*/i&&intval(1)=$_POST(x)” show=”PList”]

    I also tried &&submit_time>$_POST(x) as the addition to the filter. In both cases, if I switch from “Text” view to “Visual” view, then back to “Text” in the page editor, the “&” characters get changed to & and the “>” gets changed to >

    I read in the various posts below your code example in the “Form” post that one user had encountered this as well. You recommended editing the html designators back to the PHP conjunction operators (in the case of the ampersand) with the editor in the “HTML” view, which must be the same as “Text”, as I don’t have any other view options besides “Text” and “Visual” in my editor. Of note, my code, above, does display “PList” as a blank “header” with no data. I’m sure there is something subtly wrong with my code, but my HTML and PHP knowledge is TOO rudimentary to see it at this point. Thanks, again!

    Thread Starter jsa922

    (@jsa922)

    The box changed my entries; I was trying to show that the editor changed my “&&” to “&&” and “>” to “>”. I hope this re-try makes things visible in the reply, as I’d hoped.

    Thread Starter jsa922

    (@jsa922)

    Oh, well…I hope my quandry is clear!

    Plugin Author Michael Simpson

    (@msimpson)

    <input type="hidden" name="x" value="1"/>

    you are missing the value part.

    Thread Starter jsa922

    (@jsa922)

    Thanks, again! Adding the ‘value=”1″‘ did the trick!

    BTW, I installed your Actions and Filters plugin and used the advice from your post on “Preventing Duplicate Entries” to ensure this…it works GREAT! Now I can add other custom actions to secure my pages better.

    Thanks for making this all work so easily. Next up is to move up to the editor extension, as it’s clear I will need to provide a way for my partners to change project lists over time, especially not that I’ve achieved success with limiting clients to one DB entry each.

    I think this specific thread is now “resolved,” as any further questions will pertain to using the editor extension. Thanks so much for your help!

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘Display results of user query’ is closed to new replies.