<?
session_start();
$brcode=$_SESSION['brcode'];
$user=$_SESSION['user'];
if(strlen($user)<=0)
{
    print "<script> alert('You are not logged in') </script>";
    include("logout.php");
    return;
}

include("opendb.php");
?>
<CENTER>
<link rel="stylesheet" href="style.css" type="text/css" />
 - DUPLICATE ACCOUNT HEADS -
<table cellspacing=1 cellpadding=3 bgcolor='lightsteelblue'>
<th>No. <th>Name <th>A/C Name<th>Address <th>Dist <th>State <th> Pin <th>Phone <th>Mobile <th>Del
<?
$re=mysqli_query($db,"select *,count(acname) as num from customer group by acname having num>1")or die(mysqli_error($db));
$i=1;
if(mysqli_num_rows($re)<=0)
{
    print "<tr><td colspan=10 align=center bgcolor=white><font color=red> Duplicates not found</td></tr>";
    return;
}
while($row=mysqli_fetch_array($re))
{
    print "\n<form action='editcust.php'>\n<input type=hidden name='code' value='$row[1]'>";
    print "\n<tr bgcolor=aliceblue><td>".$i++."</td><td>$row[cname]</td><td>$row[acname]</td><td>$row[addr1]</td><td>$row[dist1]</td><td>$row[state1]</td><td>$row[pin1]</td><td>$row[phone1]</td>";
    print "<td>$row[mob]</td><td>\n<input type=submit value='Edit' name='edit'></td></tr></form>";
}
?>
</table>
