<?php
function ListCustomer ($startchar) {
if ($startchar == "All") $sql = "SELECT * FROM `customers` Order by `Customer_Name`";
if ($startchar != "All") $sql = "SELECT * FROM `customers` WHERE mid(`Customer_Name`,1,1) = '".$startchar."' Order by `Customer_Name`";
if($rows == 0) {
echo "<BR><BR><P Align=Center>There are no entries in your customer.";
} else {
?>
<Table width="90%" align="center" bgcolor="#F1F2ED" ><TR Align="Center">
<? for($i=65; $i <= 90; $i++) { ?>
<TD bgcolor
="#ECE9D8" bordercolor
="#ACA899" Width
="25"><font face
="Arial" size
="2pt"> <B
><a href
=Customerdb
.php?action
=Show
&startchar
=<? echo chr($i) ?
>><?
echo chr($i) ?
></B
></a
></font
></TD
>
<? } ?>
</TR></table>
<table bgcolor="#F1F2ED" width=90% align=center>
<tr align="Center" bgcolor="#CECECE"><th><font face="Arial" size="2pt">ID</th>
<th><font face="Arial" size="2pt">Customer Name</font></th>
<th><font face="Arial" size="2pt">Add1</font></th>
<th><font face="Arial" size="2pt">Add2</font></th>
<th><font face="Arial" size="2pt">Add3</font></th>
<th><font face="Arial" size="2pt">City</font></th>
<th><font face="Arial" size="2pt">Pin</font></th>
<th><font face="Arial" size="2pt">E</font></th>
<th><font face="Arial" size="2pt">D</font></th></tr>
<?
$i=1;
<tr>
<?if (fmod ($i,2) == 0) echo '<td bgcolor="#F1EFE2"><font face="Tahoma" size="2pt">'.$row['CustomerID']; else echo '<td bgcolor="#FFFFFF"><font face="Tahoma" size="2pt">'.$row['CustomerID'];?
></td
>
<?if (fmod ($i,2) == 0) echo '<td bgcolor="#F1EFE2"><font face="Tahoma" size="2pt">'.substr($row['Customer_Name'],0,25); else echo '<td bgcolor="#FFFFFF"><font face="Tahoma" size="2pt">'.substr($row['Customer_Name'],0,25);?
></b
></td
>
<?if (fmod ($i,2) == 0) echo '<td bgcolor="#F1EFE2"><font face="Tahoma" size="2pt">'.substr($row['Add1'],0,25); else echo '<td bgcolor="#FFFFFF"><font face="Tahoma" size="2pt">'.substr($row['Add1'],0,25);?
></td
>
<?if (fmod ($i,2) == 0) echo '<td bgcolor="#F1EFE2"><font face="Tahoma" size="2pt">'.substr($row['Add2'],0,20); else echo '<td bgcolor="#FFFFFF"><font face="Tahoma" size="2pt">'.substr($row['Add2'],0,20);?
></td
>
<?if (fmod ($i,2) == 0) echo '<td bgcolor="#F1EFE2"><font face="Tahoma" size="2pt">'.substr($row['Add3'],0,20); else echo '<td bgcolor="#FFFFFF"><font face="Tahoma" size="2pt">'.substr($row['Add3'],0,20);?
></td
>
<?if (fmod ($i,2) == 0) echo '<td bgcolor="#F1EFE2"><font face="Tahoma" size="2pt">'.substr($row['City'],0,10); else echo '<td bgcolor="#FFFFFF"><font face="Tahoma" size="2pt">'.substr($row['City'],0,10);?
></td
>
<?if (fmod ($i,2) == 0) echo '<td bgcolor="#F1EFE2"><font face="Tahoma" size="2pt">'.substr($row['Pin'],0,7); else echo '<td bgcolor="#FFFFFF"><font face="Tahoma" size="2pt">'.substr($row['Pin'],0,7);?
></td
>
<?if (fmod ($i,2) == 0) echo '<td bgcolor="#F1EFE2"><font face="Tahoma" size="2pt"> <a href=Customerdb.php?action=Modify&cid='.$row['CustomerID'].'><img src="images/b_edit.png" alt="Edit" border=0></a>';?
></td
>
<?if (fmod ($i,2) != 0) echo '<td bgcolor="#FFFFFF"><font face="Tahoma" size="2pt"> <a href=Customerdb.php?action=Modify&cid='.$row['CustomerID'].'><img src="images/b_edit.png" alt="Edit" border=0></a>';?
></td
>
<?if (fmod ($i,2) == 0) echo '<td bgcolor="#F1EFE2"><font face="Tahoma" size="2pt"> <a href=Customerdb.php?action=Delete&cid='.$row['CustomerID'].'&cname='.urlencode($row['Customer_Name']).'><img src="images/b_drop.png" alt="Delete" border=0></a>';?
></td
>
<?if (fmod ($i,2) != 0) echo '<td bgcolor="#FFFFFF"><font face="Tahoma" size="2pt"> <a href=Customerdb.php?action=Delete&cid='.$row['CustomerID'].'&cname='.urlencode($row['Customer_Name']).'><img src="images/b_drop.png" alt="Delete" border=0></a>';?
></td
>
<?$i++;?>
</font></tr>
<? } ?>
</table></font>
<?
}
}
?>