Ignore:
Timestamp:
Apr 30, 2005, 4:36:57 PM (19 years ago)
Author:
plg
Message:
  • user list updated : ability to filter list on status. Function get_enums comes back to retrieve the list of possible status in the database.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/admin/user_list.php

    r776 r777  
    156156}
    157157
     158$blockname = 'status_option';
     159
     160$template->assign_block_vars(
     161  $blockname,
     162  array(
     163    'VALUE'=> -1,
     164    'CONTENT' => '------------',
     165    'SELECTED' => ''
     166    ));
     167
     168foreach (get_enums(USERS_TABLE, 'status') as $status)
     169{
     170  $selected = (isset($_GET['status']) and $_GET['status'] == $status) ?
     171    'selected="selected"' : '';
     172  $template->assign_block_vars(
     173    $blockname,
     174    array(
     175      'VALUE' => $status,
     176      'CONTENT' => $lang['user_status_'.$status],
     177      'SELECTED' => $selected
     178      ));
     179}
     180
    158181// +-----------------------------------------------------------------------+
    159182// |                                 filter                                |
     
    187210}
    188211
     212if (isset($_GET['status'])
     213    and in_array($_GET['status'], get_enums(USERS_TABLE, 'status')))
     214{
     215  $filter['status'] = $_GET['status'];
     216}
    189217
    190218// +-----------------------------------------------------------------------+
     
    206234    AND group_id = '.$filter['group'];
    207235}
     236if (isset($filter['status']))
     237{
     238  $query.= '
     239    AND status = \''.$filter['status']."'";
     240}
    208241$query.= '
    209242;';
     
    258291  $query.= '
    259292    AND group_id = '.$filter['group'];
     293}
     294if (isset($filter['status']))
     295{
     296  $query.= '
     297    AND status = \''.$filter['status']."'";
    260298}
    261299$query.= '
Note: See TracChangeset for help on using the changeset viewer.