示例#1
0
        break;
    case $_GET['add']:
        $serviceForm->success("Added new data successfully");
        break;
    case $_GET['delete']:
        $serviceForm->success("Deleted data successfully");
        break;
}
//if the user is editting or viewing and ID, check if there is an update being made. If there are no updates then show them the service information form.
if ($_GET['action'] == edit && $_SESSION['access'] >= 50 || $_GET['action'] == showID) {
    //get the new service corresponding to the ID
    $services = new Service($_GET['ID']);
    //checks to see if this is a valid ID or not
    if ($services->get_service_id() == "") {
        $link = $_SERVER['PHP_SELF'] . "?action=showID&ID=" . $_GET['ID'];
        $serviceForm->error("Warning: Failed to load. Reason: " . $services->get_error(), $link);
    }
    //if this is a service update then update the service
    if (isset($_POST['updateInfo']) && $_SESSION['access'] >= 50) {
        $layer = $services->get_service_layer();
        if ($layer == 2) {
            $services = new Layer2_service($_GET['ID']);
        } else {
            $services = new Layer3_service($_GET['ID']);
        }
        updateService($services);
    } else {
        if (isset($_POST['updateModal']) && $_SESSION['access'] >= 50) {
            $services = new Layer2_service_port($_POST['interfaceID']);
            updateModal($services);
        } else {