View Single Post
Join Date: Jun 2008
Posts: 62
Reputation: PomonaGrange is an unknown quantity at this point 
Solved Threads: 3
PomonaGrange PomonaGrange is offline Offline
Junior Poster in Training

show club presidents info hide everyone else's

 
0
  #1
Aug 7th, 2008
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.

  1. if (($sub_office =="President")||($sub_office =="Vice President")||($sub_office =="Secretery")){
  2. $officer_show = "YES";}
  3. ELSE{$officer_show = "NO";}
  4.  
  5. if ($officer_show == YES){
  6. $hphone = $homephone;
  7. $cphone = $cellphone;
  8. $adress = $address;
  9. $cty = $city;
  10. $st = $state;
  11. $zp = $zip;
  12. $eml = $email;
  13. }
  14. ELSE
  15. {
  16. $hphone = " ";
  17. $cphone = " ";
  18. $adress = " ";
  19. $cty = " ";
  20. $st = " ";
  21. $zp = " ";
  22. $eml = " ";
  23. }
  24. if($_SESSION['auth']['status'] == 1){
  25. // do stuff here
  26. $display_block .= "
  27. <tr>
  28. <td>$sub_office</td>
  29. <td>$fname $lname</td>
  30. <td>$hphone / $cphone</td>
  31. <td>$eml</td>
  32. <td>$adress, $cty, $st $zp</td>
  33. <td>$sub_name</td>
  34. </tr>";
  35. }
  36.  
  37. ELSE {
  38. $display_block .= "
  39. <tr>
  40. <td>$sub_office</td>
  41. <td>$fname $lname</td>
  42. <td>$hphone / $cphone</td>
  43. <td>$eml</td>
  44. <td>$adress, $cty, $st $zp</td>
  45. <td>$sub_name</td>
  46. </tr>";
  47. }
  48. }

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.
Last edited by peter_budo; Aug 7th, 2008 at 4:16 pm. Reason: Keep It Organized - please use [code] tags
There are alot of people smarter than me, BUT at least I try to be of some help. Of coarse I'm not perfect, I need help too.
Reply With Quote