$query = "select lastname from tblusers where lastname != '' and lastname not like '%Gail' and lastname not like '1%' order by lastname asc";
$result = mysql_query($query);
$alpha = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ';
echo "";
while($row = mysql_fetch_object($result))
{
$count = strlen($alpha);
$x = 0;
while($x < $count)
{
if (strtoupper($row->lastname[0]) == $alpha[$x]) // C
{
for($y = 0; $y < $x; $y++)
{
echo " ".$alpha[$y]." "; // E
}
echo "
".$alpha[$x].""; //e
$alpha = substr_replace($alpha, '', 0, $x+1);
$x = 27;
}
else $x++;
}
}
$alpharemain = strlen($alpha);
for($z = 0; $z < $alpharemain; $z++)
{
echo " ".$alpha[$z]." "; // E
}
echo "
";
$query = "select * from tblusers where isactive = 1 order by lastname, firstname";
$result = mysql_query($query);
function imagecell($uid)
{
$iquery = "select * from tblusers where userid = ".$uid;
$iresult = mysql_query($iquery);
//echo $iquery;
$iline = mysql_fetch_array($iresult, MYSQL_ASSOC);
echo " ";
echo "";
if($iline['photo'])
{
echo " 
";
}
else
{
echo ' 
';
}
echo ' ' .$iline['firstname'] .' ' .stripslashes($iline['lastname']) .' ';
echo $iline['ag'];
echo ' | ';
}
function datacell($uid)
{
global $one, $two, $three, $four, $five;
$dquery = "select * from tblusers where userid = " .$uid;
$dresult = mysql_query($dquery);
$dline = mysql_fetch_array($dresult, MYSQL_ASSOC);
//echo $dquery;
// $line = mysql_fetch_array($result, MYSQL_ASSOC);
echo '';
if($one!='')
{
echo " $one: ";
echo stripslashes($dline['one']) .' ';
echo ' ';
}
if($two !='')
{
echo "$two: ";
echo stripslashes($dline['two']);
echo ' ';
}
if($three !='')
{
echo "$three: ";
echo stripslashes($dline['three']) .' ';
echo ' ';
}
if($four !='')
{
echo "$four: ";
echo stripslashes($dline['four']) .' ';
echo ' ';
}
if($five!='')
{
echo "$five: ";
echo stripslashes($dline['five']) .' ';
echo ' ';
}
if($dline['email'])
{
echo 'My Email: ';
echo ' ' .$dline['email'] .'';
}
/*echo ' ';
$nquery = "select * from tblwebsites where userid=" .$dline['userid'];
$nresult = mysql_query($nquery);
if($nresult > 1)
{
echo 'WebSites: ';
while($webline = mysql_fetch_array($nresult, MYSQL_ASSOC))
{
if($webline[type] == 0) { $type = 'http://'; }
elseif($webline[type] == 1) { $type = 'https://'; }
echo "' .$type .$webline['website'] ." ";
}
}
else
{
echo "http://" .$nresult ."";
}
echo ' ';*/
echo ' | ';
}
if($result >0)
{
echo '';
echo '
| ';
echo '
';
$tick = 0;
$nullvalue = '';
while($wline = mysql_fetch_array($result, MYSQL_ASSOC))
{
echo '';
if($tick == 0)
{
imagecell($wline['userid']);
datacell($wline['userid']);
$tick = 1;
}
else
{
datacell($wline['userid']);
imagecell($wline['userid']);
$tick = 0;
}
echo '
';
echo '';
echo '
| ';
echo '
';
flush();
ob_flush();
}
}
else
{
echo 'There are no members in Mastermind list
';
}
?>