Ala Dreamweaver:
I have one table called users and I am trying to display a list of the users. When you create a user with Team Member status, their admin_level = 4. The user index displays them with one column titled Assigned to Team Lead (admin_level = 3). They are not assigned to Team Leads upon creation. They are assigned from the user index page and that column's code is below.
<? if ($row_users['assigned_to_team_lead'] == 'undefined') { ?>
<td>
[INDENT]<a href="assign_user.php?id=<? echo $row_users['id']; ?>">Assign to Team Lead</a>[/INDENT]
</td>
<? } else { ?>
<td>[INDENT]<a href="modify_assign_user.php?id=<? echo $row_users['id']; ?">
Reassign</a> <? echo $row_users['assigned_to_team_lead']; ?>[/INDENT]
</td>
<? }; ?>
As you can see, there is a Reassign link beside the Team Lead name. All that works fine.
My dilemma... when I reassign a Team Lead a position other than Team Lead, their admin_level changes. The users that were assigned to the Team Lead on the user index page should now have "Assign to Team Lead" instead of their old Team Lead that was just changed to another admin_level since they are no longer available as a Team Lead.
Should this code be altered, or should I update the modification page where you reassign the Team Lead? Problem there is that I would have to update the Team Lead admin_level (which is no big deal), but then update anyone associated with that Team Lead and change their assigned_to_team_lead variable to "undefined". I could be wrong, but I think my initial way would be easier. Can anyone help with the synatx issue? I'm looking for something like
<? if ($row_users['assigned_to_team_lead'] == 'undefined') { ?>
<td>
[INDENT]<a href="assign_user.php?id=<? echo $row_users['id']; ?>">Assign to Team Lead</a>[/INDENT]
</td>
<? } else { ?>
[B]ENTER IF STATEMENT HERE THAT STATES IF THE TEAM LEAD THEY ARE CURRENTLY ASSIGNED TO DOES NOT HAVE AN AMDIN_LEVEL EQUAL TO 3, THEY SHOULD HAVE "Assign to Team Lead"[/B]
<td>[INDENT]<a href="modify_assign_user.php?id=<? echo $row_users['id']; ?">
Reassign</a> <? echo $row_users['assigned_to_team_lead']; ?>[/INDENT]
</td>
<? }; ?>