Jump to content

Archived

This topic is now archived and is closed to further replies.

sylunt1

multiple conditions

Recommended Posts

Greetings:

I have a hopefully simple question.

What I want to do is this...  If a date is 9999-12-12 then print a "-" - this part I have and it works fine.  But what I want to do is add a 2nd condition - if upgrade = 0 then use a different font.  I am not sure how to add another condition without printing the whole line again.

Any help would be appreciated.


[code]
if ($exp_date == "December 31, 9999"){
print '<table border="0" width="80%" cellspacing="0" cellpadding="0">';
echo '<tr><td width="40%">' . $sw_name . '</td><td width="20%"><a href="file:///\\endps\License Confirmations/' . $lic_num . '.rtf" target="_blank">' . $lic_num . '</a></td><td width="20%">' . $po_num . '</td><td width="20%">-</td></tr></table>';
}

else{
print '<table border="0" width="80%" cellspacing="0" cellpadding="0">';
echo '<tr><td width="40%">' . $sw_name . '</td><td width="20%"><a href="file:///\\endps\License Confirmations/' . $lic_num . '.rtf" target="_blank">' . $lic_num . '</a></td><td width="20%">' . $po_num . '</td><td width="20%">' . $exp_date . '</td></tr></table>';

} [/code]

Share this post


Link to post
Share on other sites
$echo_table1='<table border="0" width="80%" cellspacing="0" cellpadding="0">';
echo '<tr><td width="40%">' . $sw_name . '</td><td width="20%"><a href="file:///\\endps\License Confirmations/' . $lic_num . '.rtf" target="_blank">' . $lic_num . '</a></td><td width="20%">' . $po_num . '</td><td width="20%">-</td></tr></table>';



$echo_table2='<table border="0" width="80%" cellspacing="0" cellpadding="0">';
echo '<tr><td width="40%">' . $sw_name . '</td><td width="20%"><a href="file:///\\endps\License Confirmations/' . $lic_num . '.rtf" target="_blank">' . $lic_num . '</a></td><td width="20%">' . $po_num . '</td><td width="20%">' . $exp_date . '</td></tr></table>';



if ($exp_date == "December 31, 9999") {

echo $table1;

}else{

echo $table2;

}elseif($upgrade=="0"){

str_replace(" '\ .\ $lic_num \.\ '\.\rtf\", "what_ever.rtf", $table1);
echo $table1;

}else{

str_replace(" '\.\ $lic_num\ .\ '\.\rtf\", "what_ever.rtf", $table2);
echo $table2;
}

good starting point anyway.

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.