Wizard and cluster delete - #1748

This commit is contained in:
enriquecd 2018-01-29 16:25:08 +01:00
parent 1895c454c9
commit 95ff0e5d2a
2 changed files with 24 additions and 3 deletions

View File

@ -381,7 +381,7 @@ elseif ($step == 4) {
echo "<td class='datos'>".$value."</td>";
echo "<td class='datos'><input class='zero_hundred' value='".get_item_critical_limit_by_item_id($key)."' name='critical_item_".$key."' type='number' max='100' min='0' style='width:60%;' onkeydown='javascript: return event.keyCode == 69 ? false : true'> &nbsp;&nbsp;% are down</td>";
echo "<td class='datos'><input class='zero_hundred' value='".get_item_warning_limit_by_item_id($key)."' name='warning_item_".$key."' type='number' max='100' min='0' style='width:60%;' onkeydown='javascript: return event.keyCode == 69 ? false : true'> &nbsp;&nbsp;% are down</td>";
echo "<td class='datos'><a href='index.php?sec=reporting&sec2=godmode/reporting/cluster_builder&step=4&delete_module=".$key."&id_cluster=".$id_cluster."'><img src='images/cross.png'></a></td>";
echo "<td class='datos'><a href='index.php?sec=reporting&sec2=godmode/reporting/cluster_builder&delete_module_aa=".$key."&id_cluster=".$id_cluster."'><img src='images/cross.png'></a></td>";
echo "</tr>";
}
@ -524,7 +524,7 @@ elseif ($step == 6) {
echo "<td class='datos'><input class='is_critical_check' name='is_critical_item_".$key."' type='checkbox' value='1'></td>";
}
echo "<td class='datos'><a href='index.php?sec=reporting&sec2=godmode/reporting/cluster_builder&step=6&delete_module=".$key."&id_cluster=".$id_cluster."'><img src='images/cross.png'></a></td>";
echo "<td class='datos'><a href='index.php?sec=reporting&sec2=godmode/reporting/cluster_builder&delete_module_ap=".$key."&id_cluster=".$id_cluster."'><img src='images/cross.png'></a></td>";
echo "</tr>";
}

View File

@ -30,6 +30,8 @@ require_once('include/functions_clusters.php');
$step = get_parameter('step',0);
$id_cluster = get_parameter('id_cluster',0);
$delete_cluster = get_parameter('delete_cluster',0);
$delete_module_aa = get_parameter('delete_module_aa',0);
$delete_module_ap = get_parameter('delete_module_ap',0);
if($step == 1){
@ -446,6 +448,8 @@ elseif ($step == 3) {
// $tcluster_modules_delete = db_process_sql('delete from tagente_modulo where custom_integer_1 = '.$delete_cluster);
$tcluster_modules_delete_get = db_process_sql('select id_agente_modulo from tagente_modulo where custom_integer_1 = '.$delete_cluster);
foreach ($tcluster_modules_delete_get as $key => $value) {
$tcluster_modules_delete_get_values[] = $value['id_agente_modulo'];
}
@ -464,8 +468,25 @@ elseif ($step == 3) {
header ("Location: index.php?sec=reporting&sec2=enterprise/operation/cluster/cluster");
}
elseif ($delete_module) {
elseif ($delete_module_aa) {
$delete_module_aa_get = db_process_sql('select id_agente_modulo from tagente_modulo where custom_integer_2 = '.$delete_module_aa);
$delete_module_aa_get_result = modules_delete_agent_module($delete_module_aa_get[0]['id_agente_modulo']);
$delete_item = db_process_sql('delete from tcluster_item where id = '.$delete_module_aa);
header ("Location: index.php?sec=reporting&sec2=godmode/reporting/cluster_builder&step=4&id_cluster=".$id_cluster);
}
elseif($delete_module_ap){
$delete_module_ap_get = db_process_sql('select id_agente_modulo from tagente_modulo where custom_integer_2 = '.$delete_module_ap);
$delete_module_ap_get_result = modules_delete_agent_module($delete_module_ap_get[0]['id_agente_modulo']);
$delete_item = db_process_sql('delete from tcluster_item where id = '.$delete_module_ap);
header ("Location: index.php?sec=reporting&sec2=godmode/reporting/cluster_builder&step=6&id_cluster=".$id_cluster);
}
$active_tab = get_parameter('tab', 'main');