We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 48171
    • 6 Posts
    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 students 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 smiley )

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

    Thanks in advance.
    Steve Reid
      • 3749
      • 24,544 Posts
      If the data is stored somewhere in the MODX DB, it should be possible to do it with PHP. The method would depend on where and how the data is stored. You'd have to use a third-party library to generate the Word or Excel file.

      It might be a lot easier to generate an HTML invoice if that would work for you. The form for the invoice could be a Tpl chunk with placeholders for the various values.
        Did I help you? Buy me a beer
        Get my Book: MODX:The Official Guide
        MODX info for everyone: http://bobsguides.com/modx.html
        My MODX Extras
        Bob's Guides is now hosted at A2 MODX Hosting