";
}
//Editor form
echo ''.__('Planned Downtime Form').' '.print_help_icon ('planned_downtime', true).'';
print_table ($table);
print_input_hidden ('id_agent', $id_agent);
echo '';
if ($id_downtime) {
print_input_hidden ('update_downtime', 1);
print_input_hidden ('id_downtime', $id_downtime);
print_submit_button (__('Update'), 'updbutton', false, 'class="sub upd"');
}
else {
print_input_hidden ('create_downtime', 1);
print_submit_button (__('Add'), 'crtbutton', false, 'class="sub wand"');
}
echo ' ';
echo '';
if ($id_downtime > 0) {
echo " | ";
// Show available agents to include into downtime
echo ''.__('Available agents').':';
$filter_group = get_parameter("filter_group", 0);
$filter_cond = '';
if($filter_group > 0)
$filter_cond = " AND id_grupo = $filter_group ";
$sql = sprintf ("SELECT tagente.id_agente, tagente.nombre, tagente.id_grupo
FROM tagente
WHERE tagente.id_agente NOT IN (
SELECT tagente.id_agente
FROM tagente, tplanned_downtime_agents
WHERE tplanned_downtime_agents.id_agent = tagente.id_agente
AND tplanned_downtime_agents.id_downtime = %d
) AND disabled = 0 $filter_cond
ORDER by tagente.nombre", $id_downtime);
$downtimes = get_db_all_rows_sql ($sql);
$data = array ();
if ($downtimes)
foreach ($downtimes as $downtime) {
if (check_acl ($config["id_user"], $downtime['id_grupo'], "AR")) {
$data[$downtime['id_agente']] = $downtime['nombre'];
}
}
echo "";
echo "";
echo " |