I'm not sure if I'm posting this in the right place, so feel free to move it if needed!
OK, so I'm pretty new to programming, especially to PHP, so I'm probably making a stupid mistake or something, because I don't think this should be so difficult. I'm attempting to set up my files so when a staff member views a ticket, he/she does not see the email address of the user who submitted it. But, I want the admin(s) to see it.
It would be easy enough to delete it from the viewticket.inc.php file, but then nobody would see it, and I want admins to still be able to see it.
So, what I did was I tried to find an "admin only" tag, and I found one in the header.inc.php file. The code below is what I used (it's the one that only displays the 'admin' link in the header if the user is actually an admin.
<?php
if($thisuser->isAdmin() && !defined('ADMINPAGE')) { ?>
| <a href="admin.php">Admin Panel</a>
<?}
So then what I did was I changed the part about the admin link so that it would fit (so I thought) by the "email:" section of the viewticket.inc.php file.
I tried several different variations, including the following:
<?php
if($thisuser->isAdmin() && !defined('ADMINPAGE')) { ?>
<tr>
<th>Email:</th>
<td><?=$ticket->getEmail()?></td>
</tr>
<?}
The one above is the one I thought would do it, but when I use that, only the header is visible when I try to view a ticket, whether as an admin or as a regular staff member.
Can someone please kindly help me put the code in correctly???
Thanks so much!!!
Joe