if else statement help
How would i go about doing something like this, I want to show the include file if it's a certain login else show all the html if it's another login???
PHP Code:
<?php if ( login :: $arre_company == 'APS' ) { include( 'task/APS/include/rx_tracker.php' ); } ?>
<div style="border:2px solid #a1a1a1; height: 264px; background:#dde; -moz-border-radius: 10px;
-webkit-border-radius: 10px; border-radius: 10px; /* future proofing */
-khtml-border-radius: 10px; /* for old Konqueror browsers */ .one-edge-shadow
-webkit-box-shadow: 0 8px 6px -6px black;
-moz-box-shadow: 0 8px 6px -6px black;
box-shadow: 0 8px 6px -6px black;">
<form action='<?php echo matry :: here (); ?> ' method='post'>
<input type='hidden' name='image_id' value='<?php echo req ( 'uniqueid' ); ?> ' />
<table><th><br> RX TRACKER</th>
<tr><td> Warfarin Date</td><td><?php inp ( 'warfarin_date' , 10 ); ?> </td>
<!--<td> Verified By</td><td><?php inp ( 'signed_on' , 3 ); ?> </td>
<td> Verified At</td><td><?php inp ( 'verified_at' , 10 ); ?> --><td> Diagnosis Code</td>
<td><?php sbox ( 'diagnosis' , sql :: one_column_array ( "SELECT id FROM " . event_table ( 'dxcode' ) . "" )); ?> </td></tr>
<tr><td style="position: relative; left: 2px; top:20px;"> INR Low</td><td style="position: relative; left: 0px; top:20px;"><?php sbox ( 'inr_low' , sql :: one_column_array ( "SELECT inr_value from event.acs.inr_value" )); ?> </td>
<td style="position: relative; left: 2px; top:20px;"> INR High</td><td style="position: relative; left: 0px; top:20px;"><?php sbox ( 'inr_high' , sql :: one_column_array ( "SELECT inr_value from event.acs.inr_value" )); ?> </td>
<td style="position: relative; top:20px;"> Active</td><td style="position: relative; top:20px;"><?php cbox ( 'active' ); ?> </td></tr>
</tr><tr><td><br><br><br> <?php echo button :: save_narrow ( 'Update' ); ?> </td></tr></table></form></div><br />
If all you want to do is include the other file and be done with it, the simplest thing might be:
PHP Code:
<?php
if( $somethingIsTrue ) {
include "the/include/file.php" ;
exit;
}
?>
<p>rest of page here</p>
Otherwise, just use an else block around whatever needs to be done:
PHP Code:
<?php
if( $somethingIsTrue ) {
include "the/include/file.php" ;
}
else {
?>
<p>rest of page here</p>
<?php
} // need to close up the else block
?>