$ids = updateFeatures($component, $features);
            mysql_close($dbHandle);
            $updatedFeatures = getProcessedFeatures($features, $ids);
            //echo serializeFeatures($updatedFeatures);
            echo json_encode($updatedFeatures[0]);
        } else {
            if ($requestType == 'DELETE') {
                $network = $_GET["network"];
                //in openlayers in delete method feature id is attached with url with "/" may be to make restfull
                $componentWithId = explode("/", $_GET["component"]);
                $component = $componentWithId[0];
                $id = $componentWithId[1];
                //$featureCollection = file_get_contents("php://input");
                //$features = deserializeFeatures($featureCollection);
                $dbHandle = connectDB($network);
                $deletedFeatures = deleteFeatures($component, array($id));
                mysql_close($dbHandle);
                //$updatedFeatures = getProcessedFeatures($features,$ids);
                //echo serializeFeatures($updatedFeatures);
                echo json_encode($deletedFeatures[0]);
            }
        }
    }
}
function processGetLock($network)
{
    $filePath = "../data/" . $network . ".lck";
    //$lockFile = fopen($filePath,"r");
    if (file_exists($filePath)) {
        $lockFile = fopen($filePath, "r");
        $fileSize = filesize($filePath);
Example #2
0
    if ($errors != '') {
        redirectMsg('./features.php?item=' . $item, _AS_DT_ERRORS . $errors, 1);
        die;
    } else {
        redirectMsg('./features.php?item=' . $item, _AS_DT_DBOK, 0);
        die;
    }
}
$action = rmc_server_var($_REQUEST, 'action', '');
switch ($action) {
    case 'new':
        dt_form_features();
        break;
    case 'edit':
        dt_form_features(1);
        break;
    case 'save':
        dt_save_features();
        break;
    case 'saveedit':
        dt_save_features(1);
        break;
    case 'delete':
        deleteFeatures();
        break;
    case 'newfeat':
        newFeatures();
        break;
    default:
        dt_show_features();
}