Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- private function message(){
- return "<table id="print-area"><tr><td>example</td></tr></table>"}
- ?>
- <?php
- public function PrintReceipt($content) {
- echo"<!DOCTYPE html><script type='application/javascript'>
- window.onload=function(){
- var myWindow = window.open('', 'MsgWindow', 'width=200,height=100');
- myWindow.document.write('" . $content . "');
- myWindow.frames['print_frame'].document.title = document.title;
- myWindow.document.getElementById('print-area').contentWindow.print();
- }
- </script>";
- }
- ?>
- public function PrintReceipt($content) {
- echo"<!DOCTYPE html><script type='application/javascript'>
- window.onload=function(){
- var myWindow = window.open('', 'MsgWindow', 'width=200,height=100');
- myWindow.document.write('" . $content . "');
- myWindow.print();
- myWindow.close();
- }
- </script>";
- }
Add Comment
Please, Sign In to add comment