kenny724 Posted February 3, 2012 Share Posted February 3, 2012 What's wrong with this statement? It works with the md_date_string...., but there is not always an other...so if the other is blank then it needs not to show. if($md_date_string != "") && ($other_name_string != "") { echo ' <tr> <td><br /><center><b>TREATMENT TEAM SIGNATURES</b></center> <table border="0" width="100%"> <tr><td colspan="2"><b>Services ordered are Appropriate—See SMI/SED for additional explanation</b></td></tr> <tr> <td valign="bottom">'. $md_sig. '<hr />Psychiatrist: '. $md_name_string. '</td> <td valign="bottom">'. $md_date_string. '<hr />Date:</td> </tr> <tr> <td valign="bottom">'. $case_manager_sig. '<hr />Case Manager: '. $case_manager_name_string. '</td> <td valign="bottom">'. $md_date_string. '<hr />Date:</td> </tr> <tr> <td valign="bottom">'. $therapist_sig. '<hr />Therapist: '. $therapist_name_string. '</td> <td valign="bottom">'. $md_date_string. '<hr />Date:</td> </tr> <tr> <td valign="bottom">'. $activity_therapist_sig. '<hr />Activity Therapist: '. $activity_therapist_name_string. '</td> <td valign="bottom">'. $md_date_string. '<hr />Date:</td> </tr> <tr> <td valign="bottom">'. $other_sig. '<hr />Other: '. $other_name_string. '</td> <td valign="bottom">'. $md_date_string. '<hr />Date:</td> </tr> <tr> <td colspan="2"><br />NEXT TREATMENT PLAN REVIEW: <font class="dbd">$next_review</font></td> </tr> </table> </td> </tr>'; } elseif ($md_date_string = "") && ($other_name_string != "") { echo ' <tr> <td><br /><center><b>TREATMENT TEAM SIGNATURES</b></center> <table border="0" width="100%"> <tr><td colspan="2"><b>Services ordered are Appropriate—See SMI/SED for additional explanation</b></td></tr> <tr> <td valign="bottom"><hr />Psychiatrist: '. $md_name_string. '</td> <td valign="bottom">'. $md_date_string. '<hr />Date:</td> </tr> <tr> <td valign="bottom"><hr />Case Manager: '. $case_manager_name_string. '</td> <td valign="bottom">'. $md_date_string. '<hr />Date:</td> </tr> <tr> <td valign="bottom"><hr />Therapist: '. $therapist_name_string. '</td> <td valign="bottom">'. $md_date_string. '<hr />Date:</td> </tr> <tr> <td valign="bottom"><hr />Activity Therapist: '. $activity_therapist_name_string. '</td> <td valign="bottom">'. $md_date_string. '<hr />Date:</td> </tr> <tr> <td valign="bottom"><hr />Other: '. $other_name_string. '</td> <td valign="bottom">'. $md_date_string. '<hr />Date:</td> </tr> <tr> <td colspan="2"><br />NEXT TREATMENT PLAN REVIEW: <font class="dbd">$next_review</font></td> </tr> </table> </td> </tr>'; } elseif ($md_date_string = "") && ($other_name_string = "") echo ' <tr> <td><br /><center><b>TREATMENT TEAM SIGNATURES</b></center> <table border="0" width="100%"> <tr><td colspan="2"><b>Services ordered are Appropriate—See SMI/SED for additional explanation</b></td></tr> <tr> <td valign="bottom"><hr />Psychiatrist: '. $md_name_string. '</td> <td valign="bottom">'. $md_date_string. '<hr />Date:</td> </tr> <tr> <td valign="bottom"><hr />Case Manager: '. $case_manager_name_string. '</td> <td valign="bottom">'. $md_date_string. '<hr />Date:</td> </tr> <tr> <td valign="bottom"><hr />Therapist: '. $therapist_name_string. '</td> <td valign="bottom">'. $md_date_string. '<hr />Date:</td> </tr> <tr> <td valign="bottom"><hr />Activity Therapist: '. $activity_therapist_name_string. '</td> <td valign="bottom">'. $md_date_string. '<hr />Date:</td> </tr> <tr> <td colspan="2"><br />NEXT TREATMENT PLAN REVIEW: <font class="dbd">$next_review</font></td> </tr> </table> </td> </tr>'; } else { echo ' <tr> <td><br /><center><b>TREATMENT TEAM SIGNATURES</b></center> <table border="0" width="100%"> <tr><td colspan="2"><b>Services ordered are Appropriate—See SMI/SED for additional explanation</b></td></tr> <tr> <td valign="bottom">'. $md_sig. '<hr />Psychiatrist: '. $md_name_string. '</td> <td valign="bottom">'. $md_date_string. '<hr />Date:</td> </tr> <tr> <td valign="bottom">'. $case_manager_sig. '<hr />Case Manager: '. $case_manager_name_string. '</td> <td valign="bottom">'. $md_date_string. '<hr />Date:</td> </tr> <tr> <td valign="bottom">'. $therapist_sig. '<hr />Therapist: '. $therapist_name_string. '</td> <td valign="bottom">'. $md_date_string. '<hr />Date:</td> </tr> <tr> <td valign="bottom">'. $activity_therapist_sig. '<hr />Activity Therapist: '. $activity_therapist_name_string. '</td> <td valign="bottom">'. $md_date_string. '<hr />Date:</td> </tr> <tr> <td colspan="2"><br />NEXT TREATMENT PLAN REVIEW: <font class="dbd">$next_review</font></td> </tr> </table> </td> </tr>'; } } Link to comment https://forums.phpfreaks.com/topic/256346-whats-wrong-with-this/ Share on other sites More sharing options...
kicken Posted February 3, 2012 Share Posted February 3, 2012 elseif ($md_date_string = "") && ($other_name_string != "") { You use == to compare. = is an assignment. You also need to enclose the whole condition in parenthesis: elseif (($md_date_string=="") && ($other_name_string != "")) { Link to comment https://forums.phpfreaks.com/topic/256346-whats-wrong-with-this/#findComment-1314185 Share on other sites More sharing options...
kenny724 Posted February 3, 2012 Author Share Posted February 3, 2012 Got it fixed. Thanks. I need to put a break in heredoc...I thought this would work, but it isn't. Any comments? Thanks. $frm_str = <<<EOP <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> *alot of *stuff* </html> EOP; $message .= $frm_str; if(($md_date_string != "") && ($other_name_string != "")) { echo ' <tr> what I need in the middle } $frm_str = <<<EOP <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> second part </html> EOP; $message .= $frm_str; } Link to comment https://forums.phpfreaks.com/topic/256346-whats-wrong-with-this/#findComment-1314215 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.