delete(); $message = "Probe '".$probe->service->name." on ".$probe->host->name."' deleted!"; $link = "company.php?company_id=".$probe->company->id."&action=edit"; $timeout = $config->redir_timeout; include('message.php'); // ============ INSERT } else if (isset($_GET['action']) && $_GET['action'] == "insert") { $message = ""; $timeout = $config->redir_timeout; if (isset($_GET['company_id']) && $_GET['company_id'] != "" && isset($_GET['service']) && $_GET['service'] != "" && isset($_GET['host']) && $_GET['host'] != "" && isset($_GET['active']) && $_GET['active'] != "") { $company = $_GET['company_id']; $service = $_GET['service']; $host = $_GET['host']; $active = $_GET['active']; $probe = new Probe($config); if ($probe->create($company, $service, $host, $active)) $message = "Probe created!"; else { $timeout = $config->redir_timeout_error; $message = "Cannot create duplicated probes!"; } } else { $timeout = $config->redir_timeout; $message = "Cannot create a probe without a company, service and host!"; } $link = "company.php?action=edit&company_id=".$company_id; include('message.php'); // ============ SAVE } else if (isset($_GET['action']) && $_GET['action'] == "save") { $probe = new Probe($config, $probe_id); $oldService = $probe->service; $oldHost = $probe->host; $message = ""; $timeout = $config->redir_timeout; if (isset($_GET['company_id']) && $_GET['company_id'] != "" && isset($_GET['service']) && $_GET['service'] != "" && isset($_GET['host']) && $_GET['host'] != "") { $probe->company = new Company($config, $_GET['company_id']); $probe->service = new Service($config, $_GET['service']); $probe->host = new Host($config, $_GET['host']); $probe->active = $_GET['active']; if ($oldService->id != $probe->service->id || $oldHost->id != $probe->host->id) { $probe->clearLogs(); $mrtg = new Mrtg($config, $probe->company->id); $mrtg->reloadConfig(); } $probe->update(); $message = "Probe data updated!"; } else { $timeout = $config->redir_timeout_error; $message = "Cannot update a probe without a company, service and host!"; } $link = "company.php?action=edit&company_id=".$probe->company->id; include('message.php'); // ============ EDIT } else { $probe = new Probe($config, $probe_id); $selected = ""; ?>

Company company->name ?>
Service
Host
Active