Form Submission Count Per User

esl 02 Nov, 2012
I want to be able to create a admin panel that will have a count for each user on how many form submissions each user has. It is basically a quote form that each agent logs in and it automatically loads their user name and details in the quote form and saves it to a database once they submit, the table is called "Form_Quote" and there is a row called "cf_user_id" that associates each users ID with "jos_user" and "jos_userdata". "jos_user" holds basic user info, "jos_userdata" holds their fax#, last name etc.

So I want something like...

John Smith 32 submissions
Larry Hammill 12 submissions
Lisa Palm 46 submissions


is this possible?
Max_admin 03 Nov, 2012
Hi,

This can be done using Connectivity, you will have to understand how it works first through, we have few tutorials on the FAQs page.

Regards,
Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
esl 12 Nov, 2012
Thanks Max I figured it out using chronoforms .... I have one problem tho

I used:
$user =& JFactory::getUser();
$userid=$user->id;

$result= mysql_query("SELECT DISTINCT name, COUNT(*) AS rowcount FROM Submissions GROUP BY cf_user_id");
$result_array=array();
while($row = mysql_fetch_assoc($result))


and this gives me a count of submissions for each user like this

Bob 27
Larry 19
Claire 14



Now I need to try to join the table that contains their last name "jos_userdata" using:

$user =& JFactory::getUser();
$userid=$user->id;

$result= mysql_query("SELECT * 
FROM jos_users 
JOIN jos_userdata ON jos_users.id = jos_userdata.cf_user_id");
$result_array=array();
while($row = mysql_fetch_assoc($result))


I got their last name now im stuck on how to get it to have the count as well like this....

Bob Jagger 27
Larry Smith 19

esl 12 Nov, 2012
So i tried doing this in CC, I get

[Users] => Array
(
[id] => 65
[name] => George
[username] => gsmith
[email] => [email]my@email.com[/email]
[usertype] => Registered
[block] => 0
[sendEmail] => 0
[gid] => 18
[registerDate] => 2012-10-24 02:38:14
[lastvisitDate] => 2012-10-24 10:56:34
[activation] =>
[params] =>

)

[Profile] => Array
(
[cf_id] => 2
[cf_uid] => ***********
[cf_user_id] => 65
[last_name] => Smith
[phone] => 76768
[fax] => 78686


In Chrono Connectivity I only see the user names and everything else is blank...
Users.name,User.username,Profile.last_name
what am i doing wrong? Please help
GreyHead 14 Nov, 2012
Hi esl,

Should this Users.name,User.username,Profile.last_name have an extra 's'
Users.name,Users.username,Profile.last_name

Bob
This topic is locked and no more replies can be posted.