El código de la parte especifica con el problema es el siguiente:
Código PHP:
if($lrows > '0')
{
$ListingTable .= "<table width=\"100%\" cellspacing=0>\n";
$ListingTable .= "<tr>\n\t";
$iter = "";
$i=0;
while($a1 = mysql_fetch_array($r1))
{
if ($i == '3'){$ListingTable .= "</tr><tr>\n\t";}
$i++;
$ListingTable .= "<td height=60 width=\"270\" valign=top>";
$iter++;
$ListingTable .= "<table width=\"100%\" height=\"250\" style=\"";
if ($iter == 2) $ListingTable .= "border-left: 2px dotted #666;";
if ($iter == 3) $ListingTable .= "border-left: 2px dotted #666;";
if ($iter == 4) $ListingTable .= "border-top: 2px dotted #666;";
if ($iter == 5) $ListingTable .= "border-left: 2px dotted #666; border-top: 2px dotted #666;";
if ($iter == 6) $ListingTable .= "border-left: 2px dotted #666; border-top: 2px dotted #666;";
if ($iter == 7) $ListingTable .= "border-top: 2px dotted #666;";
if ($iter == 8) $ListingTable .= "border-left: 2px dotted #666; border-top: 2px dotted #666;";
if ($iter == 9) $ListingTable .= "border-left: 2px dotted #666; border-top: 2px dotted #666;";
$ListingTable .= "\">\n";