• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 102
  • Last Modified:

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

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
Steven Reid
Asked:
Steven Reid
  • 2
1 Solution
 
Julian HansenCommented:
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
 
Steven ReidAuthor Commented:
Thank you Julian, both great ideas.
0
 
Julian HansenCommented:
You are welcome.
1

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now