HI All, I've been trying to make a membership management type script. This script would have a database with the members contact info and which office they hold, if any. The problem I am having is I would like the script to show the president's and vice president's Contact info all the time, but hide the contact info for everyone else when viewed by the general public, then if the user logs in all contact information is displayed.
Below is the part of the script that I have so far, The if logged in / out part works like I want, but I can't get it to show the President's info but hide the other members info.
if (($sub_office =="President")||($sub_office =="Vice President")||($sub_office =="Secretery")){
$officer_show = "YES";}
ELSE{$officer_show = "NO";}
if ($officer_show == YES){
$hphone = $homephone;
$cphone = $cellphone;
$adress = $address;
$cty = $city;
$st = $state;
$zp = $zip;
$eml = $email;
}
ELSE
{
$hphone = " ";
$cphone = " ";
$adress = " ";
$cty = " ";
$st = " ";
$zp = " ";
$eml = " ";
}
if($_SESSION['auth']['status'] == 1){
// do stuff here
$display_block .= "
<tr>
<td>$sub_office</td>
<td>$fname $lname</td>
<td>$hphone / $cphone</td>
<td>$eml</td>
<td>$adress, $cty, $st $zp</td>
<td>$sub_name</td>
</tr>";
}
ELSE {
$display_block .= "
<tr>
<td>$sub_office</td>
<td>$fname $lname</td>
<td>$hphone / $cphone</td>
<td>$eml</td>
<td>$adress, $cty, $st $zp</td>
<td>$sub_name</td>
</tr>";
}
}
I Have also seen the if ($sub_office =="President") done like this if ($sub_office !="President")
I can't seem to get it to work either way. If there is a better way of doing any of this, let me know. I would appreciate any help.