Jump to content

What's wrong with this?


kenny724

Recommended Posts

 

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

 

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 != "")) {

 

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;


}

Archived

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

×
×
  • 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.