Jump to content

print php report


88f615f6

Recommended Posts

 Hi, Someone please tell me how to resolve this issue ? following is error derived from
my code which then follows:
 

Notice: Undefined variable: rows in C:\xampp\htdocs\invoice\apdueprnt.php on line 62
Warning: Invalid argument supplied for foreach() in C:\xampp\htdocs\invoice\apdueprnt.php on line 62

 

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
    <html
        xmlns="http://www.w3.org/1999/xhtml"
        lang="en"
        xml:lang="en"
    ><head>
     
    <meta
        http-equiv="Content-Type"
        content="text/html; charset=utf-8"
    />
     
    <meta
        http-equiv="Content-Language"
        content="en"
    />
     
    <meta
        name="viewport"
        content="width=device-width; height=device-height; initial-scale=1.0"
    />
     
    <link
        type="text/css"
        rel="stylesheet"
        href="print.css"
        media="print"
    />
     
    <title>
        Accounts Payable Demo
    </title>
     
    </head><body>
     
    <table class="accountsPayable">
        <caption>
            Accounts Payable Report
        </caption><thead>
            <tr>
                <th>recur?</th>
                <th>acct#</th>
                <th>creditor</th>
                <th>purpose</th>
                <th>due</th>
                <th>late</th>
                <th>due</th>
            </tr>
        </thead><tfoot>
            <tr>
                <td colspan="3">', date('m/d/y'), '</td>
                <td colspan="4" class="page"></td>
            </tr>
        </tfoot><tbody>
       
    <?php
       
    $totalDue = 0;
   // **********************************************    
    foreach ($rows as $row) {
        $totalDue += $row['amtdue'];
        echo '
            <tr>
                <td>', $row['status'], '</td>
                <td>', $row['acctno'], '</td>
                <td>', $row['bname'], '</td>
                <td>', $row['purpose'], '</td>
                <td>', $row['duedate'], '</td>  
                <td class="currency">', ($row['dayslate'] > 120 ? 'pastdue' : $row['dayslate']), '</td>
                <td class="currency">', number_format($row['amtdue'], 2, '.', ''), '</td>
            </tr>';
    }
     
    echo '
            <tr class="grandTotal">
                <th scope="row" colspan="6">Grand Total:</th>
                <td class="currency">', number_format($totalDue, 2, '.', ''), '</td>
            </tr>';
    ?>
     
        </tbody>
    </table>
     
    </body></html>
Link to comment
https://forums.phpfreaks.com/topic/288270-print-php-report/
Share on other sites

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.