I'm using PHP to create a table with the following code:
<?php
class Style
{
var $text;
var $alink;
var $vlink;
var $link;
var $bgcol;
var $face;
var $size;
var $align;
var $valign;
function Style ($text="#000000",$alink="#AA00AA", $vlink="#AA00AA",$link="#000000", $bgcol="#FFFFFF",$face="verdana",$size=3,$align="CENTER",$valign="CENTER")
{
$this->text=$text;
$this->alink=$alink;
$this->vlink=$vlink;
$this->link=$link;
$this->bgcol=$bgcol;
$this->face=$face;
$this->size=$size;
$this->align=$align;
$this->valign=$valign;
}
function Set($varname,$value)
{
$this->$varname=$value;
}
function Body()
{
PRINT "<BODY BGCOLOR=\"$this->bgcol\" ".
"TEXT=\"$this->text\" ".
"LINK=\"$this->link\" VLINK=\"$this->vlink\" ".
"ALINK=\"$this->alink\"><FONT ".
"FACE=\"$this->face\" SIZE=$this->size>\n";
}
function TextOut($message=" ")
{
PRINT "<FONT FACE=\"$this->face\" ".
"SIZE=$this->size COLOR=\"$this->text\">$message</FONT>\n";
}
function TDOut ($message=" ",$colspan=1)
{
PRINT "<TD COLSPAN=$colspan BGCOLOR=\"$this->bgcol\" ".
"ALIGN=\"$this->align\" VALIGN=\"$this->valign\" TEXT=\"$this->text\">";
$this->TextOut($message);
PRINT "</TD>\n";
}
function TROut($message)
{
PRINT "<TR>\n";
$cells=explode("|",$message);
$iterations=count($cells);
$i=0;
while ($i<$iterations)
{
list($message,$span)=explode(":",$cells[$i]);
if (strlen($message)<1) $message=" ";
if ($span)
{
$this->TDOut ($message,$span);
}
else
{
$this->TDOut ($message);
}
$i++;
}
PRINT "</TR>\n";
}
}
?>
then:
$Basic = new Style;
$Basic->Set('size','2');
$Basic->Body();
$Theader = new Style;
$Theader->Set('text','#000000');
$Theader->Set('face','garamond');
$Theader->Set('size',3);
$Theader->Set('bgcol','#dcdcec');
$TErow = new Style;
$TErow->Set('bgcol','#FFFFCC');
$TErow->Set('size',2);
$TOrow = new Style;
$TOrow->Set('bgcol','#CCFFCC');
$TOrow->Set('size',2);
My data looks like:
$Theader->TROut("Name:3|Data:3");
$Theader->TROut("First|Middle/Maiden|Last|Email|Location|More Info");
$Theader->TRout("A:10");
$TErow->TROut("Aaron| |Devaney|dowhattheytellmet@hotmail.com|South Yorkshire, England|yes");
What I want to do is have the last column (more info) be "clickable." How can I generate links so that a "yes" entry in the last column will point to another page while a "no" entry will not? Manually entering the links as data does not work, of course. And each link will be to a different page, so I can't just have a simple if-then.
TIA for any and all assistance!