redir_timeout; $host = new Host($config, $host_id); if ($host->delete()) { $message = "Host '".$host->name."' deleted!"; } else { $timeout = $config->redir_timeout_error; $message = "Host '".$host->name."' cannot be deleted! Assure there's no probe with it."; } $link = "company.php?company_id=".$company_id."&action=edit"; 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['hostname']) && $_GET['hostname'] != "") { $company_id = $_GET['company_id']; $name = $_GET['hostname']; $ip = $_GET['hostip']; $host = new Host($config); if ($host->create($company_id, $name, $ip)) $message = "Host created!"; else { $timeout = $config->redir_timeout_error; $message = "Cannot create duplicated hosts!"; } } else { $timeout = $config->redir_timeout_error; $message = "Cannot create a host without a name!"; } $link = "company.php?action=edit&company_id=".$company_id; include('message.php'); // ============ SAVE } else if (isset($_GET['action']) && $_GET['action'] == "save") { $host = new Host($config, $host_id); $message = ""; $timeout = $config->redir_timeout; if (isset($_GET['company_id']) && $_GET['company_id'] != "" && isset($_GET['hostname']) && $_GET['hostname'] != "") { $company_id = $_GET['company_id']; $host->name = $_GET['hostname']; $host->ip = $_GET['hostip']; $host->update(); $message = "Host data updated!"; } else { $timeout = $config->redir_timeout_error; $message = "Cannot update a host without a name!"; } $link = "company.php?action=edit&company_id=".$company_id; include('message.php'); // ============ EDIT } else { $host = new Host($config, $host_id); if ($company_id != $host->company->id) { $link = "company.php?action=edit&company_id=".$company_id; $message = "This host does not belongs to that company!"; $timeout = $config->redir_timeout; include('message.php'); } else { ?>

Host
IP