Jump to content

[SOLVED] Print all form results with a single click


levi2613

Recommended Posts

I've written a form that allows employees to enter their timesheets, which, after submitting, get saved to a MySQL table. The results are shown in a nice, printer-friendly page with no company headers (in the print.css stylesheet) and set to an absolute <gasp!> width/height, etc.  The admin wants a one-click way to be able to print all the timesheets submitted.  Is there a way to cycle each of the MySQL entries through my view.php page?  (Making sure that each one gets a completely separate page, of course....)

 

Thank you so much!!

 

Levi  ???

Sorry, I realize now I wasn't very clear.

 

I have a MySQL table with entries for user_id, time_in, time_out, etc.  And I have a great little "view.php" page which takes *one* of those MySQL entries and shows it very nicely on the screen.  When printed, the timesheet comes out on a single piece of paper.  What I need to do is have a single button/click/function that will take multiple MySQL entries, send each of them through the view.php formatting, and print them each on a separate page.  That way, the admin office will have a hardcopy of each employee's timesheet.

 

Thanks!!

You can't do that with just PHP, you need to use CSS, and PHP.

 

so, if my reading is correct, this should work:

 

CSS:

<style type="text/css">
.pageBreak{
page-break-before: always;
}
</style>

 

Page 1

<div class="pageBreak"></div>

Page 2

<div class="pageBreak"></DIV>

Page 3

<div class="pageBreak"></DIV>

Page 4

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.