<?php
echo "<!DOCTYPE HTML>
<html lang='en-US'>
<head>
    <style>
        html,body
        {
            height: 100%;
            margin: 0px;
        }
        body > div
        {
            height: 100%;
            display: block;
            position: relative;
        }
        body > div > div 
        {
            position: absolute;
            bottom: 0px;
            left: 0px;
			
        }

		@page {

        margin-bottom: 40px;
        counter-increment: page;

        @bottom-right {
            border-top: 1px solid black;
            padding-right:20px;
            font-size: 12px !important;
            content: 'Page ' counter(page) ' of ' counter(pages);
        }
        @bottom-left {
            content: 'Footer content goes here.';
            border-top: 1px solid #000000;
        }

    }
		
    </style>
</head>
<body>
    <div>
	
       <table><tr><td>assaas</td></tr>
			<tr><td>assaas</td></tr>
			<tr><td>assaas</td></tr>
			<tr><td>assaas</td></tr>
			<tr><td>assaas</td></tr>
			<tr><td>assaas</td></tr>
			<tr><td>assaas</td></tr>
			<tr><td>assaas</td></tr>
			<tr><td>assaas</td></tr>
			<tr><td>assaas</td></tr>
			<tr><td>assaas</td></tr><tr><td>assaas</td></tr>
			<tr><td>assaas</td></tr>
			<tr><td>assaas</td></tr>
				<tr><td>assaas</td></tr>
			<tr><td>assaas</td></tr>
			<tr><td>assaas</td></tr>
			<tr><td>assaas</td></tr>
			<tr><td>assaas</td></tr>
			<tr><td>assaas</td></tr>
			<tr><td>assaas</td></tr>
			<tr><td>assaas</td></tr>
			<tr><td>assaas</td></tr>
			<tr><td>assaas</td></tr><tr><td>assaas</td></tr>
			<tr><td>assaas</td></tr>
			<tr><td>assaas</td></tr>
				<tr><td>assaas</td></tr>
			<tr><td>assaas</td></tr>
			<tr><td>assaas</td></tr>
			<tr><td>assaas</td></tr>
			<tr><td>assaas</td></tr>
			<tr><td>assaas</td></tr>
			<tr><td>assaas</td></tr>
			<tr><td>assaas</td></tr>
			<tr><td>assaas</td></tr>
			<tr><td>assaas</td></tr><tr><td>assaas</td></tr>
			<tr><td>assaas</td></tr>
			<tr><td>assaas</td></tr>
				<tr><td>assaas</td></tr>
			<tr><td>assaas</td></tr>
			<tr><td>assaas</td></tr>
			<tr><td>assaas</td></tr>
			<tr><td>assaas</td></tr>
			<tr><td>assaas</td></tr>
			<tr><td>assaas</td></tr>
			<tr><td>assaas</td></tr>
			<tr><td>assaas</td></tr>
			<tr><td>assaas</td></tr><tr><td>assaas</td></tr>
			<tr><td>assaas</td></tr>
			<tr><td>assaas</td></tr>
				<tr><td>assaas</td></tr>
			<tr><td>assaas</td></tr>
			<tr><td>assaas</td></tr>
			<tr><td>assaas</td></tr>
			<tr><td>assaas</td></tr>
			<tr><td>assaas</td></tr>
			<tr><td>assaas</td></tr>
			<tr><td>assaas</td></tr>
			<tr><td>assaas</td></tr>
			<tr><td>assaas</td></tr><tr><td>assaas</td></tr>
			<tr><td>assaas</td></tr>
			<tr><td>assaas</td></tr>
				<tr><td>assaas</td></tr>
			<tr><td>assaas</td></tr>
			<tr><td>assaas</td></tr>
			<tr><td>assaas</td></tr>
			<tr><td>assaas</td></tr>
			<tr><td>assaas</td></tr>
			<tr><td>assaas</td></tr>
			<tr><td>assaas</td></tr>
			<tr><td>assaas</td></tr>
			<tr><td>assaas</td></tr><tr><td>assaas</td></tr>
			<tr><td>assaas</td></tr>
			<tr><td>assaas</td></tr>
				<tr><td>assaas</td></tr>
			<tr><td>assaas</td></tr>
			<tr><td>assaas</td></tr>
			<tr><td>assaas</td></tr>
			<tr><td>assaas</td></tr>
			<tr><td>assaas</td></tr>
			<tr><td>assaas</td></tr>
			<tr><td>assaas</td></tr>
			<tr><td>assaas</td></tr>
			<tr><td>assaas</td></tr><tr><td>assaas</td></tr>
			<tr><td>assaas</td></tr>
			<tr><td>assaas</td></tr>
			
	   </table>
        <div>nnnnnnnnnnnnn</div>
    </div>
    <div>
        
        <div>Page2Footer</div>
    </div>
    <div>
        
        <div>Page3Footer</div>
    </div>
";

print <<< HERE

<script language=javascript>
if (typeof(window.print) != 'undefined')
{
    window.print();
}
</script>
</BODY>
</HTML>
HERE;
?>