\n"; if (!isset($_SESSION["WNUID"])) backtologin("invoices.php"); else { echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "Your Invoices\n"; echo "\n"; echo "\n"; echo "
\n"; echo " \n"; echo " \n"; echo " \n"; echo " \n"; echo " \n"; echo "
 Your Invoices
\n"; echo "
\n"; // Get invoice list for this user $CN = mysql_connect(ADNS_DB_HOST, ADNS_DB_UID, ADNS_DB_PW); mysql_select_db(ADNS_DB_DB, $CN); $strSQL = "SELECT * FROM INVOICE_HEADER WHERE CUSTOMER_HANDLE = '" . $_SESSION["WNUID"] . "' \n" . "ORDER BY INVOICE_DATE DESC, INVOICE_NBR DESC \n"; $rs = mysql_query($strSQL, $CN); if (!mysql_num_rows($rs)) { echo "

\n"; echo "No Invoice found for " . $_SESSION["TITLE"] . " (" . $_SESSION["WNUID"] .") \n"; echo "
Return to Account Menu\n"; echo "

\n"; mysql_close($CN); } else { echo "

\n"; echo " Below is a list of all of the invoices issued to your account in the last 12 months.\n"; echo "

\n"; echo "

\n"; echo "Account Title: " . $_SESSION["TITLE"] . "
\n"; echo " Account Number: " . $_SESSION["WNUID"] . "

\n"; echo "
\n"; echo " \n"; echo " \n"; echo " \n"; echo " \n"; echo " \n"; echo " \n"; echo " \n"; echo " \n"; $ttl = 0.0; for ($i=1; $i<=mysql_num_rows($rs); $i++) { $row = mysql_fetch_row($rs); $strSQL = "SELECT LINE_DESC FROM INVOICE_DETAIL WHERE INVOICE_NBR = " . $row[0] . " \n"; $rs2 = mysql_query($strSQL, $CN); if (mysql_num_rows($rs2)) { // URL - Depends on if its renewal or new if ($row[4] == "REGISTRATION") $strURL = "invoice.php?TYP=REG"; else $strURL = "invoice.php?TYP=RENEW"; echo " \n"; echo " \n"; echo " \n"; echo " \n"; echo " \n"; echo " \n"; echo " \n"; $ttl += $row[6]; } // If there are detail rows } echo " \n"; echo " \n"; echo " \n"; echo " \n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "
\n"; echo " Invoice Number\n"; echo " \n"; echo " Invoice
Date
\n"; echo "
\n"; echo " Purpose of Invoice\n"; echo " \n"; echo " Pay
Method
\n"; echo "
\n"; echo " Amount of
Invoice
\n"; echo "
\n"; echo " \n"; echo " ". $row[0] ."\n"; echo " \n"; echo " " . dt_yyyymmdd_to_printletts($row[2]) . "\n"; echo " \n"; echo " \n"; for ($j=1; $j<=mysql_num_rows($rs2); $j++) { $row2 = mysql_fetch_row($rs2) ; if ($j != mysql_num_rows) echo " " . $row2[0] . "
\n"; else echo " " . $row2[0] . "\n"; } echo "
\n"; echo "
\n"; echo " " . $row[8] . "\n"; echo " \n"; printf(" $%-7.2f\n", $row[6]); echo "
\n"; echo " TOTAL OF INVOICES SHOW ON THIS PAGE\n"; echo " \n"; printf(" $%-9.2f\n", $ttl); echo "
 
\n"; echo "

\n"; echo " Click on an invoice number to view a copy that invoice. The invoice will be displayed in a separate window.\n"; echo "

\n"; echo "
 
\n"; echo "

\n"; echo " Return to Account Menu\n"; echo "

\n"; echo "
\n"; echo "
\n"; mysql_close($CN); } // If there are invoices for this user echo "\n"; echo "\n"; } // If Logged In ?>