Jump to content

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]
Link to comment
https://forums.phpfreaks.com/topic/14620-multiple-conditions/
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.
Link to comment
https://forums.phpfreaks.com/topic/14620-multiple-conditions/#findComment-58179
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

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.