mirror of
https://github.com/Piwigo/Piwigo.git
synced 2026-08-12 03:33:01 +02:00
- user list updated : ability to filter list on status. Function get_enums
comes back to retrieve the list of possible status in the database. git-svn-id: http://piwigo.org/svn/trunk@777 68402e56-0260-453c-a942-63ccdbb3a9ee
This commit is contained in:
@@ -155,6 +155,29 @@ while ($row = mysql_fetch_array($result))
|
||||
));
|
||||
}
|
||||
|
||||
$blockname = 'status_option';
|
||||
|
||||
$template->assign_block_vars(
|
||||
$blockname,
|
||||
array(
|
||||
'VALUE'=> -1,
|
||||
'CONTENT' => '------------',
|
||||
'SELECTED' => ''
|
||||
));
|
||||
|
||||
foreach (get_enums(USERS_TABLE, 'status') as $status)
|
||||
{
|
||||
$selected = (isset($_GET['status']) and $_GET['status'] == $status) ?
|
||||
'selected="selected"' : '';
|
||||
$template->assign_block_vars(
|
||||
$blockname,
|
||||
array(
|
||||
'VALUE' => $status,
|
||||
'CONTENT' => $lang['user_status_'.$status],
|
||||
'SELECTED' => $selected
|
||||
));
|
||||
}
|
||||
|
||||
// +-----------------------------------------------------------------------+
|
||||
// | filter |
|
||||
// +-----------------------------------------------------------------------+
|
||||
@@ -186,6 +209,11 @@ if (isset($_GET['group'])
|
||||
$filter['group'] = $_GET['group'];
|
||||
}
|
||||
|
||||
if (isset($_GET['status'])
|
||||
and in_array($_GET['status'], get_enums(USERS_TABLE, 'status')))
|
||||
{
|
||||
$filter['status'] = $_GET['status'];
|
||||
}
|
||||
|
||||
// +-----------------------------------------------------------------------+
|
||||
// | navigation bar |
|
||||
@@ -205,6 +233,11 @@ if (isset($filter['group']))
|
||||
$query.= '
|
||||
AND group_id = '.$filter['group'];
|
||||
}
|
||||
if (isset($filter['status']))
|
||||
{
|
||||
$query.= '
|
||||
AND status = \''.$filter['status']."'";
|
||||
}
|
||||
$query.= '
|
||||
;';
|
||||
list($counter) = mysql_fetch_row(pwg_query($query));
|
||||
@@ -258,6 +291,11 @@ if (isset($filter['group']))
|
||||
$query.= '
|
||||
AND group_id = '.$filter['group'];
|
||||
}
|
||||
if (isset($filter['status']))
|
||||
{
|
||||
$query.= '
|
||||
AND status = \''.$filter['status']."'";
|
||||
}
|
||||
$query.= '
|
||||
ORDER BY '.$order_by.' '.$direction.'
|
||||
LIMIT '.$start.', '.$conf['users_page'].'
|
||||
|
||||
Reference in New Issue
Block a user