TOPIC:

Sum attached files sent 2 weeks 6 days ago #263120

  • Luisserafim's Avatar Topic Author
  • Luisserafim
  • Offline
  • Expert Breezer
  • Expert Breezer
  • Posts: 201
  • Thanks: 1
Hi

Is there a way to Sum the attached files and show the result in Thank you page?

"You form as the ID 596 and as 50 attached files"

Something like:

Let var total = 0

On file upload : let var total = total + 1 (my upoads just accept 1 file)

But if user delete the file or change the number of uploads needed must refresh the total.

I think is better to sum on send.

Please help. I dont know what path to follow.

Thanx in advance

Please Log in or Create an account to join the conversation.

Sum attached files sent 2 weeks 6 days ago #263128

  • tihana.krivic's Avatar
  • tihana.krivic
  • Offline
  • Moderator
  • Moderator
  • Posts: 6926
  • Karma: 3
  • Thanks: 493
Hi,

for this files must be saved on server (form must be submitted, and then count uploaded values from database).

Please go to form->Advanced->More options->Submit pieces->End submit and put:
$this->execPieceByName('ff_InitLib'); //Include BreezingForms Library
$db = JFactory::getDBO();//Get Database Object
$session = JFactory::getSession();

$db->setQuery('Select count(value) From #__facileforms_subrecords WHERE name ="nameofuploadfile" '); 
$result = $db->loadResult(); 
$session->set('count', $result);
Please replace nameofuploadfile with name of your upload file (not title)

Then go to your form->Advanced->More options->Form pieces->Before form->check Custom and put:
$this->execPieceByName('ff_InitLib'); //Include BreezingForms Library
$session = JFactory::getSession();
    
if (JRequest::getInt('ff_status', -1) == 0) {
$count = $session->get('count');    
echo 'Your form has attached files: '.$count;
}

Hope this helps

Regards,
Tihana
The following user(s) said Thank You: Luisserafim

Please Log in or Create an account to join the conversation.

Sum attached files sent 2 weeks 6 days ago #263147

  • Luisserafim's Avatar Topic Author
  • Luisserafim
  • Offline
  • Expert Breezer
  • Expert Breezer
  • Posts: 201
  • Thanks: 1
Hi Tihana

I think this one is for multiple uploads.

But I have 79 diferent nameofuploadfile . I have just 1 document in each fileupload.

Do i have to do 79 diferent blocks?

Regards

Please Log in or Create an account to join the conversation.

Sum attached files sent 2 weeks 6 days ago #263149

  • tihana.krivic's Avatar
  • tihana.krivic
  • Offline
  • Moderator
  • Moderator
  • Posts: 6926
  • Karma: 3
  • Thanks: 493
Hi,

ugh, you have 79 file upload element?

Regards,
Tihana
The following user(s) said Thank You: Luisserafim

Please Log in or Create an account to join the conversation.

Sum attached files sent 2 weeks 6 days ago #263157

  • Luisserafim's Avatar Topic Author
  • Luisserafim
  • Offline
  • Expert Breezer
  • Expert Breezer
  • Posts: 201
  • Thanks: 1
Hi.

Yes. The appication may have 9 family elements and the max uploadfiles possible are 79, because you only can send 1 file for upload field, so you don't make a mistake when choosing files as it happened many times in the past.

Since BF creates a folder for each record (I use folder mask), can't we count the files in the folder?

Best Regards

Please Log in or Create an account to join the conversation.

Sum attached files sent 2 weeks 6 days ago #263159

  • tihana.krivic's Avatar
  • tihana.krivic
  • Offline
  • Moderator
  • Moderator
  • Posts: 6926
  • Karma: 3
  • Thanks: 493
Hi,

I am not sure this is possible, but I will investigate it and come back to you

Regards,
Tihana

Please Log in or Create an account to join the conversation.

  • Page:
  • 1
  • 2
Time to create page: 0.052 seconds

BreezingForms Pro 1.4.7 for WordPress Released!

Available in the membership section.

September Discount!

Massive discounts on all subscriptions!

Get Your Subscription Here

Quick Links

Downloads

BreezingForms

ContentBuilder

BreezingCommerce

Templates

Documentation

BreezingForms

ContentBuilder

BreezingCommerce

Apprendre BreezingForms (French Community)

Apprendre et maîtriser BreezingForms par des tutoriels et exemples, le tout en français

breezingforms.eddy-vh.com

Questions et réponses sur les forums de l'AFUJ

AFUJ

Special Offer

Summer Sale! All subscriptions at a special price!

Includes prio support, all of our current and future Joomla!® extensions and Joomla!® templates for the duration of your membership.

Get it from here

3rd Party Discount - 25% Off

We help you to keep your costs under control. If you are a new member and purchased a form building tool from a different form vendor, then you'll get a 25% discount on our subscription plans.

How to receive the discount:

Send us a quick email to sales@crosstec.org with a proof of purchase (for example a paypal receipt), await payment instructions and enjoy your membership!