Page 1 of 1

displaying a nice neat table with date from a flatfile...

Posted: Tue May 07, 2002 11:44 am
by romeo
here's what I have

Code: Select all

<?
$filename = "wpba.txt";
$file=file($filename);
while(list(,$value)=each($file))
&#123;
list($First_Name,$Last_Name,$Company,$Address,$City,$State,$Zip_Code,$Active,$Work_Phone,$Home_Phone,$Fax_Phone,$Email,,,,,,,,,,,,,,,,,$type)=split( ",", $value);

$First_Name = ucwords(strtolower($First_Name));
$Last_Name = ucwords(strtolower($Last_Name));
$Company = ucwords(strtolower($Company));
$Address = ucwords(strtolower($Address));
$City = ucwords(strtolower($City));
$State = ucwords(strtolower($State));
$Zip_Code = ucwords(strtolower($Zip_Code));
$Active = ucwords(strtolower($Active));
$Work_Phone = ucwords(strtolower($Work_Phone));
$Home_Phone = ucwords(strtolower($Home_Phone));
$Fax_Phone = ucwords(strtolower($Fax_Phone));
$Email = trim(strtolower($Email));

$type = strtoupper($type);

$turn = "left";

if($x==$type)&#123;

$msg .= '<table width="200" border="1" cellspacing="0" cellpadding="0" bordercolor="#000000" align="'."$turn".'"><tr><td>'.
     '<table width="200"><tr><td bgcolor="yellow" width="200"><b><font face="Arial" size="2">'."$Company".
     '</font></b></td></tr><tr><td><font face="Arial" size="2">'."$First_Name $Last_Name".
     '</font></td></tr><tr><td><font face="Arial" size="2">'."$Address".
     '</font></td></tr><tr><td><font face="Arial" size="2">'."$City, $State $Zip_Code".
     '</font></td></tr><tr><td><font face="Arial" size="2">'."Phone: $Work_Phone <br> Fax: $Fax_Phone <br>".
     '<a href="mailto:'."$Email".'">'."$Email".'</a>'.
     '</font></td></tr></table>'.'</td></tr></table>&nbsp;';

&#125;

&#125;
?>
Then I echo $msg into a table to display the data... the problem is that the list has gotten so ridiculously long (over 200 reocrds)...

I'm having trouble finding a way to display it.... inside of a 450pixel wide table... I was going to offset it (table align $turn (left then right), but it didn't turn out well for those lottle tables over 200px...


any ideas?

Thanks in advance...

Posted: Tue May 07, 2002 1:31 pm
by Gremlin
why not just display 30 records and have a link at bottom to display next 30 or previous 30?

bump

Posted: Wed May 08, 2002 8:58 am
by romeo
:idea: bump - that's an idea but kinda customed to the way it is...