PHP
  Home arrow PHP arrow Page 2 - Invoice Management in a PHP Invoicing ...
Administration  
AJAX  
Apache  
BrainDump  
DHTML  
Flash  
Java  
JavaScript  
Multimedia  
MySQL  
Oracle  
Perl  
PHP  
Practices  
Python  
Reviews  
Security  
Style-Sheets  
Web Services  
XML  
Zend  
Zope  
Forums Sitemap 
IBM® developerWorks 
Sun Developer Network 
E-Commerce Hosting 
Linux Web Hosting 
Managed Hosting 
Small Business Hosting 
Mobile Linux 
App Generation ROI 
VPS Hosting 
Weekly Newsletter

 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
PHP

Invoice Management in a PHP Invoicing System
By: Leidago
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 3 stars3 stars3 stars3 stars3 stars / 22
    2006-09-13

    Table of Contents:
  • Invoice Management in a PHP Invoicing System
  • Finishing the Invoice Page
  • Generating a Table
  • Code for Creating an Invoice
  • Creating Unpaid.php
  • Creating a new invoice

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
    ADVERTISEMENT


    Invoice Management in a PHP Invoicing System - Finishing the Invoice Page


    (Page 2 of 6 )

    The rest of the page looks like this:

    <tr valign="top" class="tblheadings">
              <td width="9%"><strong>Invoice # </strong></td>
              <td width="14%"><strong>Client Name </strong></td>
              <td width="8%"><strong>Status</strong></td>
              <td width="11%"><strong>Date Issued </strong></td>
              <td width="11%"><strong>Total(excl VAT)</strong></td>
              <td width="13%"><strong>Total(incl VAT)</strong></td>
              <td width="20%"><strong> Action </strong></td>
            </tr>
    <?
    if($num_invoice > 0){
    while($invoice = mysql_fetch_assoc($result_invoice)){
                            ?>
            <tr valign="top" class="tblinfo">
              <td><?=$invoice['invno'];?></td>
              <td><?=$invoice['name'];?></td>
              <td><? if($td > $invoice['duedate']){
                              echo "<font color=\"#FF0000\">Overdue</font>";
                              $email="yes"; 
                              }else{
                              echo $invoice['status'];}
                              ?></td>
              <td><?=$invoice['idate'];?></td>
                              <? $query_invdetails = "SELECT * FROM clientinv WHERE
    finv='".$invoice['invno']."'";
    if(!$result_invdetails= mysql_query($query_invdetails)){
    echo mysql_error();
    }else{
    $num_invdetails = mysql_num_rows($result_invdetails);
    $invdetails=mysql_fetch_assoc($result_invdetails);}
    ?>
              <td>£<?=$invdetails['totxVAT'];?></td>
              <td>£<?=$invdetails['totwVAT'];?></td>
              <td><a href="invView.php?iid=<?=$invoice['invno']?>">View </a> |<a
    href="delinvoice.php?iid=<?=$invoice['invno']?>">Delete</a> <a href="edInv.php?
    iid=<?=$invoice['invno']?>">Update</a> <? if($td > $invoice['duedate']){
                              echo "<img src=\"images/RedFlag.gif\" height = \"10\"/>"; 
                              }
                              ?>
                              <? if(isset($email)){?>
                              <a href="emailInv.php?iid=<?=$invoice['invno']?>">Email
    Reminder</a>
                              <? }?>
                               <a href="pdf.php?cid=<?=$invoice['cid']?>"><img
    src="images/pdf.gif" width="18" height="18" border="0"/></a></td>
            </tr>
                            <? }
                            }else{ ?>
                            <tr>
                            <td colspan="7"><p>No invoices available at present.</p></td>
                            </tr>
                            <? }?>
          </table>

    So, what is happening here? Basically, we are creating a table that will list all the invoices based on the results from the query. In other words, part of the table will be dynamically generated. The first section of the table shows  the headings of the different columns. The columns that we want listed are:

    • Invoice number.
    • Client name.
    • Status – Shows if a  invoice is paid or unpaid.
    • Date issued.
    • Total (excluding VAT).
    • Total (including VAT) .
    • Action - Actions that can be taken, which include viewing, updating or deleting a invoice.

    The headings are created by the following HTML code:

    <tr valign="top" class="tblheadings">
              <td width="9%"><strong>Invoice # </strong></td>
              <td width="14%"><strong>Client Name </strong></td>
              <td width="8%"><strong>Status</strong></td>
              <td width="11%"><strong>Date Issued </strong></td>
              <td width="11%"><strong>Total(excl VAT)</strong></td>
              <td width="13%"><strong>Total(incl VAT)</strong></td>
              <td width="20%"><strong> Action </strong></td>
            </tr>

    More PHP Articles
    More By Leidago


       · As one can read in the comments on the first of this series, there is no data...
       · Minor Snark - 17.5% does equal x times 17.5 divided by 100, but it would be better...
       · Thanks for the observation. Will keep it in mind next time around!
     

       

    PHP ARTICLES

    - Working With Different Namespaces in PHP 5
    - User Management Explained: Overview
    - Using Namespaces in PHP 5
    - Database Security: Guarding Against SQL Inje...
    - Building a Modular Exception Class in PHP 5
    - Database and Password Security for Web Appli...
    - Handling MySQL Data Set Failures in PHP 5
    - Building Site Registration for Web Applicati...
    - Intercepting Customized Exceptions in PHP 5
    - Securing Your Web Application Against Attacks
    - Sub Classing Exceptions in PHP 5
    - Authentication for Web Application Security
    - Building a Content Management System with Co...
    - Filters and Login Systems for Web Applicatio...
    - Working with the Email Class in Code Igniter





    © 2003-2008 by Developer Shed. All rights reserved. DS Cluster 2 hosted by Hostway
    Stay green...Green IT