Home arrow PHP arrow Page 2 - Client Management for a PHP Invoicing System

Building a table - PHP

What's an invoicing system that can't manage the data for the clients you're invoicing? This article, the third of four parts, shows how to make managing your clients easy. This part of the system allows you to view a full list of client names, and add, update or remove clients from your database.

  1. Client Management for a PHP Invoicing System
  2. Building a table
  3. Deleting clients and viewing their details
  4. Updating client information
  5. Adding a new client
By: Leidago
Rating: starstarstarstarstar / 15
September 20, 2006

print this article



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 class="tblheadings">
        <td><strong>Client Name</strong> </td>
            <td><strong>Number of Invoices</strong></td>

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
        <tr class="tblinfo">
          <td><?=$clients['name'];?> </td>
                           <td><? $query_invoices = "SELECT *
FROM invoices WHERE cid = '".$clients['id']."' "; 
                           if($numqi > 0){
                           echo $numqi;
                           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']?
                        <? } 
                        <td colspan="2"><p>There are currently no
client details available.</p></td>
                        <? }?>

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

blog comments powered by Disqus
escort Bursa Bursa escort Antalya eskort


- Hackers Compromise PHP Sites to Launch Attac...
- Red Hat, Zend Form OpenShift PaaS Alliance
- PHP IDE News
- BCD, Zend Extend PHP Partnership
- PHP FAQ Highlight
- PHP Creator Didn't Set Out to Create a Langu...
- PHP Trends Revealed in Zend Study
- PHP: Best Methods for Running Scheduled Jobs
- PHP Array Functions: array_change_key_case
- PHP array_combine Function
- PHP array_chunk Function
- PHP Closures as View Helpers: Lazy-Loading F...
- Using PHP Closures as View Helpers
- PHP File and Operating System Program Execut...
- PHP: Effects of Wrapping Code in Class Const...

Developer Shed Affiliates


Dev Shed Tutorial Topics: