How to show total form submissions?

Permalink
I want to show the total number of form submissions on my web page. I want the number to update with every submission, is this possible?

I would imagine that there is somewhere in the database that has the info and I just have to pull the data but I am a newb at php.

Please help me! :)

 
merge replied on at Permalink Reply
Hey guys show some love. :) Anyone have a suggestion? Did I forget to say pretty please?
12345j replied on at Permalink Reply
12345j
try waiting more than a couple hours- you can't expect to get answers that fast. It looks like this is how the core does it
$c=$this->getCollectionObject();
      $db = Loader::db();
      $tempMiniSurvey = new MiniSurvey();
      $pageBase=DIR_REL.'/' . DISPATCHER_FILENAME . '?cID='.$c->getCollectionID();   
      if( $_REQUEST['action'] == 'deleteForm' ){
         $this->deleteForm($_REQUEST['bID'], $_REQUEST['qsID']);
      }   
      if( $_REQUEST['action'] == 'deleteResponse' ){
         $this->deleteAnswers($_REQUEST['asid']);
      }      
      //load surveys
      $surveysRS=FormBlockStatistics::loadSurveys($tempMiniSurvey);
      //index surveys by question set id
      $surveys=array();
      while($survey=$surveysRS->fetchRow()){

it should work, but that has some inapplicable code as well.
merge replied on at Permalink Reply
I wasn't being impatient I just didn't want my thread to get lost in the sauce. :) I appreciate your response and you for taking the time to answer me.

I will be trying this tonight but I don't really understand it all. I'm a newb at php (and I mean extremely dumb at it) so forgive me.

Thanks
merge replied on at Permalink Reply
I tried dropping that in a div but I have no clue what I am doing here. Can someone chime in please?

Thanks
codingpenguins replied on at Permalink Reply
Not sure what you mean by dropping in in a div, because div is html and the code above is php. So you should do something like <div><?php //code above ?></div> will display the list above. But the code above will just give you a list of numbers (count of file summits, just fyi.
merge replied on at Permalink Reply
Thanks for replying codingpenguins! :)

I did what you suggested earlier but I just checked back and it turns out it was my error. Instead of putting <?php I put <php?. Newb error. Thanks for the help
merge replied on at Permalink Reply 1 Attachment
I pasted in the code and got this message: Parse error: syntax error, unexpected '}', expecting ',' or ';' in /homepages/41/d382624268/htdocs/themes/theme/default.php on line 109

I've attached the actual file that I am experimenting with.
12345j replied on at Permalink Best Answer Reply 1 Attachment
12345j
okay, its not a great solution but it should work. Ended up just going straight through db.
merge replied on at Permalink Reply
Awesome! Thanks a million. I just want to ask you 2 questions.

Can I delete messages in the reports section and the count stay?

Can I reset the number? If so, what table do I have to edit?

Thanks, you guys rock!
merge replied on at Permalink Reply
I found out the answer to my first and second question and it reset it. Is there any harm to letting the entries pile up, like if I had 500 of them?

If so is there anyway to keep the number and be able to delete the entries?
12345j replied on at Permalink Reply
12345j
no harm, but theres no way to delete them and keep the number.
12345j replied on at Permalink Reply
12345j
1) I I think so.
2) Just delete the block and add it again.
merge replied on at Permalink Reply
Fantastic thanks!