function invoice_manager(){ if (!isset($_SESSION['loggedin'])) die(''); $displayname = $_SESSION['displayname']; $username = $_SESSION['username']; include"template/top.php" ; echo ('
Last 30 Service Reports
') ; $query="SELECT * FROM `invoices_web` WHERE `username` = '$username' ORDER BY inv_date DESC"; $result=mysql_query($query) or die(mysql_error()); $num=mysql_numrows($result); $i=0; while ($i < $num) { $crow++; $row_color = (((1&$crow)) ? "#666666" : "#999999"); $invoice_no = stripslashes(mysql_result($result,$i,"invoice_no")); $inv_date = htmlentities(mysql_result($result,$i,"inv_date")); $inv_amount = htmlentities(mysql_result($result,$i,"inv_amount")); $amount_paid = htmlentities(mysql_result($result,$i,"amount_paid")); $display = 'onclick="window.location=\'invoices.php?act='.$invoice_no.'\';" onmouseover="this.style.cursor=\'hand\';"' ; echo(''); $i++; } echo ('
Invoice Number: '.$invoice_no.' | Invoice Date: '.$inv_date.' | Invoice Amount: $'.$inv_amount.'
Status: '); if ($amount_paid == $inv_amount) ( echo 'Paid'; ) else ( echo 'Unpaid'; ) echo ('
') ; include"template/bottum.php" ; }