mirror of
https://github.com/pandorafms/pandorafms.git
synced 2025-07-28 00:04:37 +02:00
Add combox filter in search form, view: Manage Agents in Admistration
This commit is contained in:
parent
cd85a998bb
commit
51d45f0db0
@ -23,6 +23,7 @@ $ag_group = get_parameter ("ag_group_refresh", -1);
|
|||||||
$sortField = get_parameter('sort_field');
|
$sortField = get_parameter('sort_field');
|
||||||
$sort = get_parameter('sort', 'none');
|
$sort = get_parameter('sort', 'none');
|
||||||
$recursion = get_parameter('recursion');
|
$recursion = get_parameter('recursion');
|
||||||
|
$disabled = get_parameter('disabled');
|
||||||
|
|
||||||
if ($ag_group == -1 )
|
if ($ag_group == -1 )
|
||||||
$ag_group = (int) get_parameter ("ag_group", -1);
|
$ag_group = (int) get_parameter ("ag_group", -1);
|
||||||
@ -139,6 +140,17 @@ else
|
|||||||
$return_all_group = true;
|
$return_all_group = true;
|
||||||
html_print_select_groups(false, "AR", $return_all_group, "ag_group", $ag_group, 'this.form.submit();', '', 0, false, false, true, '', false, 'width:100px;');
|
html_print_select_groups(false, "AR", $return_all_group, "ag_group", $ag_group, 'this.form.submit();', '', 0, false, false, true, '', false, 'width:100px;');
|
||||||
|
|
||||||
|
echo "<td>";
|
||||||
|
echo __('Show Agents') . ' ';
|
||||||
|
$fields = array(
|
||||||
|
"2" => "Everyone",
|
||||||
|
"1" => "Only disabled",
|
||||||
|
"0" => "Only enabled",
|
||||||
|
);
|
||||||
|
html_print_select($fields,"disabled",$disabled,'this.form.submit()');
|
||||||
|
|
||||||
|
echo "</td>";
|
||||||
|
|
||||||
echo "<td>";
|
echo "<td>";
|
||||||
echo __('Recursion') . ' ';
|
echo __('Recursion') . ' ';
|
||||||
html_print_checkbox ("recursion", 1, $recursion, false, false, 'this.form.submit()');
|
html_print_checkbox ("recursion", 1, $recursion, false, false, 'this.form.submit()');
|
||||||
@ -247,6 +259,16 @@ if ($search != "") {
|
|||||||
LIKE '%$search%' OR direccion LIKE '%$search%') ";
|
LIKE '%$search%' OR direccion LIKE '%$search%') ";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ($disabled==1)
|
||||||
|
{
|
||||||
|
$search_sql = " AND disabled = ". $disabled . $search_sql;
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
if ($disabled==0){
|
||||||
|
$search_sql = " AND disabled = 0" . $search_sql;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Show only selected groups
|
// Show only selected groups
|
||||||
if ($ag_group > 0) {
|
if ($ag_group > 0) {
|
||||||
$sql = sprintf ('SELECT COUNT(*)
|
$sql = sprintf ('SELECT COUNT(*)
|
||||||
@ -385,6 +407,7 @@ else {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
$agents = db_get_all_rows_sql ($sql);
|
$agents = db_get_all_rows_sql ($sql);
|
||||||
|
|
||||||
// Delete rnum row generated by oracle_recode_query() function
|
// Delete rnum row generated by oracle_recode_query() function
|
||||||
@ -395,7 +418,7 @@ if (($config['dbtype'] == 'oracle') && ($agents !== false)) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Prepare pagination
|
// Prepare pagination
|
||||||
ui_pagination ($total_agents, "index.php?sec=gagente&sec2=godmode/agentes/modificar_agente&group_id=$ag_group&recursion=$recursion&search=$search&sort_field=$sortField&sort=$sort", $offset);
|
ui_pagination ($total_agents, "index.php?sec=gagente&sec2=godmode/agentes/modificar_agente&group_id=$ag_group&recursion=$recursion&search=$search&sort_field=$sortField&sort=$sort&disabled=$disabled", $offset);
|
||||||
|
|
||||||
if ($agents !== false) {
|
if ($agents !== false) {
|
||||||
|
|
||||||
@ -548,7 +571,7 @@ if ($agents !== false) {
|
|||||||
echo "</td>";
|
echo "</td>";
|
||||||
}
|
}
|
||||||
echo "</table>";
|
echo "</table>";
|
||||||
ui_pagination ($total_agents, "index.php?sec=gagente&sec2=godmode/agentes/modificar_agente&group_id=$ag_group&search=$search&sort_field=$sortField&sort=$sort", $offset);
|
ui_pagination ($total_agents, "index.php?sec=gagente&sec2=godmode/agentes/modificar_agente&group_id=$ag_group&search=$search&sort_field=$sortField&sort=$sort&disabled=$disabled", $offset);
|
||||||
echo "<table width='98%'><tr><td align='right'>";
|
echo "<table width='98%'><tr><td align='right'>";
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user