PHP
  Home arrow PHP arrow Page 2 - Client Management for a PHP Invoicing ...
Dev Shed Forums 
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

Client Management for a PHP Invoicing System
By: Leidago
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 4 stars4 stars4 stars4 stars4 stars / 14
    2006-09-20

    Table of Contents:
  • Client Management for a PHP Invoicing System
  • Building a table
  • Deleting clients and viewing their details
  • Updating client information
  • Adding a new client

  • 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


    Client Management for a PHP Invoicing System - Building a table


    (Page 2 of 5 )

    The next step is to build an HTML table that will display the following headers:

    • Client Name
    • Number of Invoices
    • Action

    Here's the HTML to build the table:

    </tr>
                <tr class="tblheadings">
            <td><strong>Client Name</strong> </td>
                <td><strong>Number of Invoices</strong></td>
            <td><strong>Action</strong></td>
      </tr>

    Next we built the dynamic side of the table according to the results from the query:

    <?
                            if($num_clients > 0){
                            while($clients = mysql_fetch_assoc
    ($result_clients)){
                            ?>
            <tr class="tblinfo">
              <td><?=$clients['name'];?> </td>
                               <td><? $query_invoices = "SELECT *
    FROM invoices WHERE cid = '".$clients['id']."' "; 
                               $qi=mysql_query($query_invoices);
                               $numqi=mysql_num_rows($qi);
                               if($numqi > 0){
                               echo $numqi;
                               }else{
                               echo "0";                     
                               }?>  </td>
              <td><a href="cdetails.php?cid=<?=$clients['id']?>">View
    Details </a> |<a href="delclient.php?cid=<?=$clients['id']?
    >">Delete</a> <a href="edClient.php?cid=<?=$clients['id']?
    >">Edit</a></td>
            </tr>
                            <? } 
                            }else{?>
                            <tr>
                            <td colspan="2"><p>There are currently no
    client details available.</p></td>
                            </tr>
                            <? }?>

    The reason why we always list the contents of a particular table is because it gives us the means to delete and update the information. If you look at the Action column of the table you will see several actions that can be taken regarding a particular record. You can either delete, view or update a record. Let's deal with all three actions and see how it's done.

    More PHP Articles
    More By Leidago


       · A couple of things:- shorttags will not work on all servers. It's always better to...
       · What tags are you referring to? And also where exactly is escaping not...
       · With shorttags I mean <? instead of the full tags <?php (hope that comes through the...
       · Thanks will keep this in mind.
     

       

    PHP ARTICLES

    - Authentication Scripts for a User Management...
    - Utilizing the Use Keyword for Namespaces in ...
    - Building a User Management Application
    - 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





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