user_is_admin) { header("Location: login.php"); exit; } include "top.php"; $q = mysql_query_wrapper("select *, count(distinct note_id) count_notes, count(distinct ticket_id) count_open_tickets from users left outer join notes on note_user_id=user_id left outer join tickets on ticket_assigned_to=user_id and ticket_state_id=0 group by user_id order by user_is_admin desc, lower(user_name)"); ?>

User management

user_is_admin != $last_user_is_admin) { $last_user_is_admin = $row->user_is_admin; ?>
user_is_admin ? "Admin" : "Non-admin")?> users
  Name Email Notify: New/ Assign/ Note Open tickets Notes  
  user_name)?>  user_email)?>  user_notify_newticket ? "Y" : "-")?> / user_notify_assign ? "Y" : "-")?> / user_notify_ownticket ? "Y" : "-")?> count_open_tickets?> count_notes?>