diff --git a/admin/account_list.php b/admin/account_list.php index 76ba83a..a3caeaf 100644 --- a/admin/account_list.php +++ b/admin/account_list.php @@ -34,173 +34,13 @@ if($_POST['show_types']) require_once('judges.inc.php'); -$user_what = array(); - $query = mysql_query("SELECT `type`, `name` FROM roles"); - while($row = mysql_fetch_assoc($query)){ - $user_what[$row['type']] = $row['name']; - } - - $show_types = $_GET['show_types']; - if(user_valid_role($show_types) == false) $show_types = array('judge'); - - $show_complete = ($_GET['show_complete'] == 'yes') ? 'yes' : 'no'; - $show_all = ($_GET['show_all'] == 'yes') ? 'yes' : 'no'; - $uid = intval($_GET['uid']); - - if($_GET['action']=='remove') { - if(!$uid) { - echo "Invalid uid for delete"; - exit; - } - user_delete($uid); - message_push(happy(i18n('User deleted.'))); - } - - send_header("Account Editor", + send_header("Account List", array('Committee Main' => 'committee_main.php', 'Administration' => 'admin/index.php') ); -?> - - -"; - echo "- ".i18n('Show Display Options').""; - - echo "
"; - - echo "
"; - echo ""; - $x = 0; - foreach($user_what as $k=>$v ) { - $sel = (in_array($k, $show_types)) ? 'checked="checked"' : ''; - echo ""; - if($x) echo ""; - $x = ~$x; - } - echo ""; - - echo ""; - echo "
".i18n('Type').":".i18n($v)."
".i18n('Complete').":"; - echo ""; - - echo "
".i18n('Conference').":"; - echo ""; - echo "
"; - echo "
"; - echo ""; - echo "
"; - echo "
"; - - echo ""; - - - echo "
".i18n('Add New User').""; - echo ''; - echo "
"; - echo "
"; - */ - - /* Grab a list of users */ - $clauses = array(); - $showroles = array(); - foreach($show_types as $t){ - $showroles[] = "type = '$t'"; - } - if(count($showroles) > 0) $clauses[] = 'user_roles.roles_id IN(SELECT id FROM roles WHERE ' . implode(' OR ', $showroles) . ')'; - if($show_complete == 'yes') $clauses[] = 'user_roles.complete = "yes"'; - if($show_all == 'no') $clauses[] = "users.conferences_id={$conference['id']}"; - - $querystr = - "SELECT * FROM accounts ORDER BY username"; + $querystr = "SELECT * FROM accounts ORDER BY username"; /* - "SELECT users.*, - accounts.username, - accounts.email AS emailaddress, - user_roles.accounts_id, user_roles.roles_id, user_roles.active, user_roles.complete, - roles.type, - conferences.name AS conference_name - FROM users - JOIN user_roles ON user_roles.users_id = users.id - JOIN roles ON user_roles.roles_id=roles.id - JOIN conferences ON users.conferences_id = conferences.id - JOIN accounts ON user_roles.accounts_id=accounts.id"; - - if(count($clauses) > 0){ - $querystr .= " WHERE " . implode(' AND ', $clauses) . " "; - } - - $querystr .= " - ORDER BY lastname ASC, firstname ASC, conferences_id DESC "; - -*/ - -/* echo $querystr; echo "
\n"; echo "
\n"; @@ -215,10 +55,12 @@ function neweditor() echo ""; echo ""; echo ""; + echo " "; echo " "; echo " "; echo " "; - echo " "; + echo " "; +// echo " "; echo ""; echo ""; echo ""; @@ -248,7 +90,27 @@ function neweditor() echo ""; - echo ""; + echo ""; + echo ""; } echo ""; echo "
".i18n("Account ID")."".i18n("Username")."".i18n("Email Address")."".i18n("Pending Email")."".i18n("Actions")."".i18n("Roles")."".i18n("Actions")."
"; echo $r['pendingemail']; echo "
"; + $u=user_load_by_accounts_id($r['id']); + if($u) { + echo ""; + foreach($u['roles'] AS $r=>$rd) { + echo ""; + if($rd['active']=="yes"){ $cl="happy"; $cls=""; } else { $cl="error"; $cls="not "; } + echo ""; + if($rd['complete']=="yes"){ $cl="happy"; $cls=""; } else { $cl="error"; $cls="not "; } + echo ""; + echo ""; + } + echo "
"; + echo $rd['name']; + echo "{$cls}active{$cls}complete
"; + } + else { + echo "no roles"; + } + echo "
";