Code: Select all
function ExpiryTemplate($newsdate,$expirydate,$newstitle,$id) {
$str_E_Temp="";
//if Gig item hasn't expired do:
if (strtotime($expirydate) > time()) {
$str_E_Temp.= "<TR width='95%' bgcolor='#9B3334 style='border-bottom: #C8D4E0 1px solid;' align='center' valign='middle' nowrap>";
$str_E_Temp.="<TD style='font-size: 14px' align='left'><A HREF =\"NewsDetails.php?ID=" .$id. "\" >".$newstitle. "</A></TD>";
$str_E_Temp.="<TD style='font-size: 14px' align='left'>" .$newsdate. "</TD>";
$str_E_Temp.= "</TR>";
}
//if Gig item has expired do:
if (strtotime($expirydate) < time ()) {
$str_E_Temp.= "<TR width='95%' bgcolor='#9B3334' style='border-bottom: #C8D4E0 1px solid;' align='center' valign='middle' nowrap>";
$str_E_Temp.="<TD style='font-size: 14px' align='left'>".$newstitle."</TD>";
$str_E_Temp.="<TD style='font-size: 14px' align='left'>" .$newsdate. "</TD>";
$str_E_Temp.= "</TR>";
}
return $str_E_Temp;
}Code: Select all
function TableMenuList($pstrSQL,$pstrHeaderRowParameters, $pstrHeaderColumnParameters,$pstrDataRowParameters, $pstrDataColumnParameters,$intFieldCount)
{
$datab = new Database();
$strTemp="";
$rst= $datab->Execute ($pstrSQL,$strTemp);
if ($strTemp!="")
{
$strTemp="<TR ".$pstrDataRowParameters . "><TD " .$pstrDataColumnParameters . ">" . $strTemp . "</TD></TR>";
return $strTemp;
}
else
{
$strTemp="";
//$strTemp="";
while ($line = mysql_fetch_array($rst, MYSQL_ASSOC))
{
$strTemp2=$line['News'];
$strTemp1=$line['ID'];
$strTemp3=$line['NewsDate'];
$strTemp4=$line['ExpiryDate'];
$strTemp .= ExpiryTemplate($strTemp3,$strTemp4,$strTemp2,$strTemp1);
}
}
return $strTemp;
}How shoud I do it? Using a boolean?