Jump to content
freebs

looking to SUM 2 separate columns as each.. not together.

Recommended Posts

If you go back to my original line 29, does it now report the error?

Share this post


Link to post
Share on other sites

let me check.. .. it does now after I restarted httpd.. :)  thanks.. that help me out alot.. lol

Share this post


Link to post
Share on other sites

Hey Barand.. sorry to bug you again.. but how would I get the horizontal lines back in the table? I had them in a style.css.. but this <?=$tdata?> can't seem to be manipulated.

Share this post


Link to post
Share on other sites

Add your styling to the <td>s etc when the $tdata is being built EG

    foreach ($res as $row) {
        $tot_value += $row['value'];
        $tot_balance += $row['balance'];               // accumulate totals as they are fetched
        $tdata .= "<tr><td>{$row['work_order']}</td>
                       <td>{$row['customer']}</td>
                       <td>{$row['description']}</td>";
        $tdata .= '<td class="ra">' . toCurrency($row['value']) . '</td>';               // right-align cell
        $tdata .= '<td class="ra">' . toCurrency($row['balance']) . '</td>';             // right-align cell               
        $tdata .= "<td>{$row['status']}</td>
                   <td>{$row['notes']}</td></tr>";
    }
    $tdata .= "<tr><th colspan='3' class='ra'>Totals</th><td class='ra total'>" . toCurrency($tot_value) . '</td><td class="ra total">' . toCurrency($tot_balance) . "</td><td colspan='2'></td></tr>";

 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×

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.