Solved

How to generate and download multiple documents at one time in PHP or MODX

Posted on 2016-10-06
3
59 Views
Last Modified: 2016-10-13
Hi,
I have a course booking site where students and agents are able to book courses.
The agents are able to book a course on the student's behalf.
e.g.
Student 1 - booked direct
Student 2 - booked via agent 1
Student 3 - booked via agent 1
Student 4 - booked via agent 2
Student 5 - booked direct
Student 6 - booked via agent 2
Student 7 - booked via agent 3

After the course is finished, I need to generate invoices to each agent who has booked a student on that course.
What I would like to be able to do is to click a button and 3 Word or Excel invoices are generated and downloaded. (one for each agent)

I would prefer if they were not downloaded as part of a zip file, as I think this will confuse the admin staff (and owner :-)  )

Is there a way to do this, either in MODX or PHP?

Thanks in advance.
Steve Reid
0
Comment
Question by:Steven Reid
  • 2
3 Comments
 
LVL 51

Accepted Solution

by:
Julian Hansen earned 500 total points
ID: 41831765
Option 1
Generate multiple window.open('path/to/document') - one for each document.
This will result in multiple tabs / windows opening - each with its own download.

Option 2
Generate an intermediary page with the links to the docs on them.
0
 

Author Closing Comment

by:Steven Reid
ID: 41841762
Thank you Julian, both great ideas.
0
 
LVL 51

Expert Comment

by:Julian Hansen
ID: 41841780
You are welcome.
1

Featured Post

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

Suggested Solutions

Both Easy and Powerful How easy is PHP? http://lmgtfy.com?q=how+easy+is+php (http://lmgtfy.com?q=how+easy+is+php)  Very easy.  It has been described as "a programming language even my grandmother can use." How powerful is PHP?  http://en.wikiped…
Since pre-biblical times, humans have sought ways to keep secrets, and share the secrets selectively.  This article explores the ways PHP can be used to hide and encrypt information.
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

706 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now