<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <style>
        body {
            margin: 0;
            padding: 0;
            font-family: Arial, sans-serif;
        }
        table {
            width: 100%;
            border-collapse: collapse;
        }

        th, td {
            /* border: 1px solid #333; */
            padding: 4px;
        }

        th {
            background: #f0f0f0;
            text-align: center;
        }

        td {
            vertical-align: center;
        }
        .text-left {
            text-align: left;
        }
        .text-right {
            text-align: right;
        }
        p{
            font-size: 14px;
        }
    </style>
</head>
<body>
    <hr style="margin: 0; padding: 0;">
    <table>
        <tr>
            <td width="50%">
                <p>
                    Generado por: {{ Auth::user()->name }}<br>
                    Fecha: {{ date('d/m/Y') }}  - Hora: {{ date('H:i:s') }} 
                </p>
            </td>
            <td width="50%" class="text-right">
                <p>
                    Página <span class="page"></span> de <span class="topage"></span>
                </p>
            </td>
        </tr>
    </table>
    <script>
        var vars = {};
        var query_strings_from_url = document.location.search.substring(1).split('&');
        for (var query_string in query_strings_from_url) {
            if (query_strings_from_url.hasOwnProperty(query_string)) {
                var temp_var = query_strings_from_url[query_string].split('=', 2);
                vars[temp_var[0]] = decodeURI(temp_var[1]);
            }
        }
        var css_selector_classes = ['page', 'topage'];
        for (var css_class in css_selector_classes) {
            if (css_selector_classes.hasOwnProperty(css_class)) {
                var element = document.getElementsByClassName(css_selector_classes[css_class]);
                for (var j = 0; j < element.length; ++j) {
                    element[j].textContent = vars[css_selector_classes[css_class]];
                }
            }
        }
    </script>
</body>
</html>