The following warnings occurred: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Warning [2] Undefined array key "avatartype" - Line: 783 - File: global.php PHP 8.1.31 (Linux)
|
![]() |
Submission Count - Printable Version +- Form Tools (https://forums.formtools.org) +-- Forum: Form Tools (https://forums.formtools.org/forumdisplay.php?fid=1) +--- Forum: General Discussion (https://forums.formtools.org/forumdisplay.php?fid=5) +--- Thread: Submission Count (/showthread.php?tid=924) |
Submission Count - walkingby - Nov 9th, 2010 Is it possible to somehow show the submission count (or quantity of submissions within that database table) within a field? For example...under the "Edit Submission" page of a certain form...could I create a field which displays the submission count? Thanks! Brian RE: Submission Count - Ben - Nov 9th, 2010 Hi Brian, Hmm... you could do it with the Hooks Manager / Submission Pre-Parser I think... But wouldn't every submission then have the same value for that field - and it would be updated for all records each time a new submission is added / deleted? That does seem awfully wasteful. - Ben RE: Submission Count - walkingby - Nov 10th, 2010 (Nov 9th, 2010, 9:00 PM)Ben Wrote: Hi Brian, Thanks for the response Ben. Its a client request that really doesn't make all that much sense to myself...but what the client wants...the client gets. ![]() I ended up adding this directly to the core. It works...just not the route I wanted to take. Thanks again! RE: Submission Count - moorezilla - Nov 10th, 2010 I have a client that wants something similar... albeit not exactly. Is there an easy way to get the number of submissions by day, or month, or year and print this out somewhere else on a website automatically... maybe by crontab or something? One of my clients wants to be able to say something like, "X number of people have contacted us today, this week, this year, etc.," but I'm not sure how to go about pulling that information out of formtools and pushing it to another section of the site. Any ideas? Possible? Not worth it? RE: Submission Count - Ben - Nov 10th, 2010 Hmm... interesting... Probably the simplest solution would be install the Pages module and in it, create a PHP page that calls a core function to find out the number of results in a form, and View. For example, this would work: PHP Code: echo "Form ID 7, View ID 10: " . ft_get_submission_count(7, 10) . "<br />"; However, that would require you to set up a View for each form that have a Standard Filter set to only return submissions within a certain date range. Lastly, you'd need to add that page to the client's menu, so they'd see it when logging in. This would certainly work! - Ben RE: Submission Count - moorezilla - Nov 11th, 2010 (Nov 10th, 2010, 6:31 PM)Ben Wrote: Hmm... interesting... Thanks, Ben! I'm actually thinking about something for a public display, however. Instead of the client logging into the admin area to see the totals, she wants to publish the information on the public facing site along the lines of, "already x people signed up today, this month, this year... etc." RE: Submission Count - Ben - Nov 12th, 2010 Ah, sorry Andy - I missed that. But the idea is still sound: all you'd need to do is include the API (/global/api/api.php) before calling that code. That will give you access to all the core functionality and that code I posted will give you the info you want. Still, it's a pain having to manually create Views for each time period that you want stats on... hmm. Let me know if the above works. If not, I could look into updating the API to add a "get stats" function or something. - Ben RE: Submission Count - moorezilla - Nov 13th, 2010 Great! I will give this a try and report back the results/link! am This works! http://headlice.org/ftforms/stats.php I may have found a bug with the views functionality, however. If I set the filter to be "show me all the submissions that have nothing in the comments section" I get a number less than the total number of submissions, which is probably correct. However, if I set the filter to be "show me all the submissions that do not have nothing in the comments section," I get the total number of submissions. Could this be an issue with a textarea being used in a filter? Basically, I'd like to be able to get all the submissions that HAVE something in the comments field, but setting a filter to "not equals nothing" for the comments field seems to just pull up all of them, despite this not being the case... hope that makes sense. Edit: I've tried to demonstrate this here: http://headlice.org/ftforms/stats.php 224 is the total number of submissions, and there are definitely at least 12 or so with comments in the comments field. RE: Submission Count - Ben - Nov 18th, 2010 Hi Andy, No, that sounds like a bug. You should get the exact opposite in each case. I've logged it as a bug here: http://bugs.formtools.org/index.php?cmd=view&id=263 Is this important for you to fix now? If so, no worries - let me know and I'll look into it. Otherwise I'll get it into 2.0.5. - Ben RE: Submission Count - moorezilla - Nov 19th, 2010 2.0.5 would be fantastic! Thanks, Ben. am |