<?
include "./auth.inc.php";
if (!$user){
die("No Username");
}
$sql = "SELECT DISTINCT CallingStationId FROM radacct WHERE UserName='$user'";
?><HTML>
<HEAD></HEAD>
<BODY bgcolor=white>
<H2>CallerID Check for <? echo $user ?></H2>
This could take a while.
<P>Caller ID Numbers being used:
<?
$i=0;
$res = mysql_query($sql);
while ($row = mysql_fetch_row($res)){
print "<P>$row[0]";
#should check for common dealer numbers
$number[$i]=$row[0];
$i++;
}
?><P>Now looking for matching numbers.
<P>
<?
for ($j=0;$j<$i;$j++){
if (strlen($number[$j])>7){
print "<P>Number: $number[$j]\n";
$csql = "SELECT DISTINCT UserName FROM radacct WHERE CallingStationId='$number[$j]'";
$cres = mysql_query($csql);
while ($crow = mysql_fetch_row($cres)){
print "<LI>$crow[0] </LI>\n";
}
}
}
?>
</BODY>
</HTML>