levi2613 Posted August 25, 2008 Share Posted August 25, 2008 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 ??? Quote Link to comment https://forums.phpfreaks.com/topic/121249-solved-print-all-form-results-with-a-single-click/ Share on other sites More sharing options...
Minase Posted August 25, 2008 Share Posted August 25, 2008 be more specific about what you want to do.. you want a script who will print some values from database for every user on diferit paper? Quote Link to comment https://forums.phpfreaks.com/topic/121249-solved-print-all-form-results-with-a-single-click/#findComment-625088 Share on other sites More sharing options...
levi2613 Posted August 25, 2008 Author Share Posted August 25, 2008 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!! Quote Link to comment https://forums.phpfreaks.com/topic/121249-solved-print-all-form-results-with-a-single-click/#findComment-625091 Share on other sites More sharing options...
Minase Posted August 25, 2008 Share Posted August 25, 2008 post your view.php and with each what you mean? for every user or what? Quote Link to comment https://forums.phpfreaks.com/topic/121249-solved-print-all-form-results-with-a-single-click/#findComment-625092 Share on other sites More sharing options...
The Little Guy Posted August 25, 2008 Share Posted August 25, 2008 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 Quote Link to comment https://forums.phpfreaks.com/topic/121249-solved-print-all-form-results-with-a-single-click/#findComment-625094 Share on other sites More sharing options...
levi2613 Posted August 25, 2008 Author Share Posted August 25, 2008 TLG -- Thank you so much!! That's *just* what I needed!! Quote Link to comment https://forums.phpfreaks.com/topic/121249-solved-print-all-form-results-with-a-single-click/#findComment-625110 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.