Location: PHPKode > scripts > PHP Online Invoice System > php-online-invoice-system/clients.php
<?
/*
 * Exemplar Web hosting
 * http://www.exemplar.biz
 *
 * Title: PHP Online Invoice System
 * Version: 2.0
 * Author: Exemplar
 * Date: 01-01-2006
 *                 
*/

include('header.php');

?>
  <blockquote> 
  <h1>Clients</h1>
<? 
if ($clientsort1 = $clientsort1) {
$result = mysql_query("SELECT * FROM clients ORDER BY $clientsort1 ASC",$db);

}
if ($clientsort = $clientsort) {
$result = mysql_query("SELECT * FROM clients ORDER BY $clientsort DESC",$db);

}
if (!$clientsort and !$clientsort1) {
$result = mysql_query("SELECT * FROM clients ORDER BY clientid",$db);
}

?>
<div align="left">
<table align="left" width=90% border=1 cellspacing=0 cellpadding=1 bordercolor=#800000>
<tr >
<td class=topHeadrow5 align="center"><b>Client ID</B> <a href='clients.php?clientsort=clientid'><img class=arrows src=images/dn_arrow.gif></a><a href='clients.php?clientsort1=clientid'><img class=arrows src=images/up_arrow.gif></a></td>
<td class=topHeadrow5 align="center"><b>Username</b> <a href='clients.php?clientsort=name'><img class=arrows src=images/dn_arrow.gif></a><a href='clients.php?clientsort1=name'><img class=arrows src=images/up_arrow.gif></a></td>
<td class=topHeadrow5 align="center"><b>Company</b> <a href='clients.php?clientsort=company'><img class=arrows src=images/dn_arrow.gif></a><a href='clients.php?clientsort1=company'><img class=arrows src=images/up_arrow.gif></a></td>
<td class=topHeadrow5 align="center"><b>Email</b> <a href='clients.php?clientsort=email'><img class=arrows src=images/dn_arrow.gif></a><a href='clients.php?clientsort1=email'><img class=arrows src=images/up_arrow.gif></a></td>
<td class=topHeadrow5 align="center"><b>Address</b> <a href='clients.php?clientsort=address'><img class=arrows src=images/dn_arrow.gif></a><a href='clients.php?clientsort1=address'><img class=arrows src=images/up_arrow.gif></a></td>
<td class=topHeadrow5 align="center"><b>Phone</b></td>
<td class=topHeadrow5 align="center"><b>Fax</b></td>
<td class=topHeadrow5 align="center">&nbsp;</td>
<td class=topHeadrow5 align="center">&nbsp;</td></tr></div>
<?
while ($row = mysql_fetch_array($result)) 
{
	
	$id = $row["clientid"]; 
	$name = $row["name"]; 
	$email = $row["email"];
	$company = $row["company"];
	$address = $row["address"];
	$city = $row["city"];
	$state = $row["state"];
	$zip = $row["zip"];
	$phone1 = $row["night_phone_a"];
	$phone2 = $row["night_phone_b"];
	$phone3 = $row["night_phone_c"];
	$phone = "$phone1-$phone2-$phone3";
	$faxphone1 = $row["fax_phone_a"];
	$faxphone2 = $row["fax_phone_b"];
	$faxphone3 = $row["fax_phone_c"];
	$faxphone = "$faxphone1-$faxphone2-$faxphone3";	
	
	if ($alternate == "1") { 
	$color = "#ffffff"; 
	$alternate = "2"; 
	} 
	else { 
	$color = "#e5e5e5"; 
	$alternate = "1"; 
	} 
	$textcolor= "#000080";
	echo '<tr valign=top bgcolor='.$color.'>
	<td bgcolor='.$color.' align="center">'.$id.'</td>
	<td bgcolor='.$color.' align="center"><font color='.$textcolor.'><b>'.$name.'</b></font></td>
	<td bgcolor='.$color.' align="center">'.$company.'</td>
	<td bgcolor='.$color.' align="center">'.$email.'</td>
	<td bgcolor='.$color.' align="center">'.$address.' - '.$city.', '.$state.' '.$zip.'</td>
	<td bgcolor='.$color.' align="center">'.$phone.'</td>
	<td bgcolor='.$color.' align="center">'.$faxphone.'</td>';
	echo '<td bgcolor='.$color.' align="center">[ <a  href=editclient.php?id='.$id.'>View/Edit</a> ]</td>
	<td bgcolor='.$color.' align="center">[ <a  href=deleteclient.php?id='.$id.' onClick="return confirm(\'Are you sure?\')">delete</a> ]</td></tr>'; 
} 
echo "</table>";
?>
</blockquote><br>
<?
include "footer.php";
?>
Return current item: PHP Online Invoice System