Example #1
0
    // Get all steps
    if ($action == "getSteps") {
        $allSteps = $steps->getSteps();
        echo $allSteps;
    }
} else {
    if (isset($_POST['action'])) {
        $action = $_POST['action'];
        if ($action == "createStep") {
            $newStep = $steps->createStep();
            echo $newStep;
        }
        if (isset($_POST['id'])) {
            $id = $_POST['id'];
            if ($action == "startStep") {
                $theStep = $steps->startStep($id);
                echo $theStep;
            }
            if ($action == "stopStep") {
                $theStep = $steps->stopStep($id);
                echo $theStep;
            }
            if ($action == "ifStartedStep") {
                $theStep = $steps->getState($id);
                echo $theStep;
            }
        }
    } else {
        echo 'error undefined parameter';
    }
}