diff --git a/legacy/delete_data.php b/legacy/delete_data.php deleted file mode 100644 index 8cc6d53..0000000 --- a/legacy/delete_data.php +++ /dev/null @@ -1,48 +0,0 @@ - query("DELETE FROM buildings WHERE webgis_id = '$webgis_id'"); - - } catch (PDOException $e) { - echo "ERROR ".$e->getMessage(); - } - } - - if ($request == 'pipelines') { - $webgis_id = htmlspecialchars($_POST['webgis_id'], ENT_QUOTES); - - try { - - $pdo -> query("DELETE from pipelines where webgis_id= '$webgis_id' "); - - } catch(PDOException $e) { - echo "ERROR ".$e->getMessage(); - } - } - - if ($request == 'valves') { - $webgis_id = htmlspecialchars($_POST['webgis_id'], ENT_QUOTES); - - try { - - $pdo -> query("DELETE from valves where webgis_id= '$webgis_id' "); - - } catch(PDOException $e) { - echo "ERROR ".$e->getMessage(); - } - } - -?> \ No newline at end of file diff --git a/legacy/find_data.php b/legacy/find_data.php deleted file mode 100644 index f9fce34..0000000 --- a/legacy/find_data.php +++ /dev/null @@ -1,52 +0,0 @@ - query("SELECT *, ST_AsGeoJSON(geom) as geojson FROM $table WHERE $field = '$value'"); - - $features = []; - - foreach($result as $row) { - // PHP-Objekt erstellen - $geometry = json_decode($row['geojson']); - - // PHP-Objekt bereinigen - unset($row['geom']); - unset($row['geojson']); - - // JSON-Feature hinzufügen - $feature = [ - "type"=>"Feature", - "geometry"=>$geometry, - "properties"=>$row - ]; - - array_push($features, $feature); - }; - - // Feature-Collection hinzufügen - $featureCollection = [ - "type"=>"FeatureCollection", - "features"=>$features - ]; - - echo json_encode($featureCollection); - - // Fehlernachricht ausgeben - } catch(PDOException $e) { - echo "ERROR ".$e->getMessage(); - - } - -?> \ No newline at end of file diff --git a/legacy/insert_data.php b/legacy/insert_data.php deleted file mode 100644 index 54742c8..0000000 --- a/legacy/insert_data.php +++ /dev/null @@ -1,73 +0,0 @@ - query("SELECT * FROM valves WHERE valve_id = '$valve_id'"); - - if ($result->rowCount()>0) { - echo "ERROR: Valve ID already exists. Please type in another ID!"; - } else { - // Datenbankabfrage - $result = $pdo -> query("INSERT INTO valves(valve_id, valve_type, valve_dma_id, valve_diameter, valve_location, valve_visibility, geom) VALUES ('$valve_id', '$valve_type', '$valve_dma_id', '$valve_diameter', '$valve_location', '$valve_visibility', ST_SetSRID(ST_GeomFromGeoJSON('$valve_geometry'), 4326))"); - } - } - - if ($request == 'pipelines') { - $pipeline_id = htmlspecialchars($_POST['pipeline_id'], ENT_QUOTES); - $pipeline_category = htmlspecialchars($_POST['pipeline_category'], ENT_QUOTES); - $pipeline_dma_id = htmlspecialchars($_POST['pipeline_dma_id'], ENT_QUOTES); - $pipeline_diameter = htmlspecialchars($_POST['pipeline_diameter'], ENT_QUOTES); - $pipeline_method = htmlspecialchars($_POST['pipeline_method'], ENT_QUOTES); - $pipeline_location = htmlspecialchars($_POST['pipeline_location'], ENT_QUOTES); - $pipeline_geometry = $_POST['pipeline_geometry']; - - $result = $pdo -> query("SELECT * FROM pipelines WHERE pipeline_id = '$pipeline_id'"); - - if ($result->rowCount()>0) { - echo "ERROR: Pipeline ID already exists. Please type in another ID!"; - } else { - // Datenbankabfrage - $result = $pdo -> query("INSERT INTO pipelines(pipeline_id, pipeline_category, pipeline_dma_id, pipeline_diameter, pipeline_method, pipeline_location, geom) VALUES ('$pipeline_id', '$pipeline_category', '$pipeline_dma_id', '$pipeline_diameter', '$pipeline_method', '$pipeline_location', ST_SetSRID(ST_GeomFromGeoJSON('$pipeline_geometry'), 4326))"); - } - } - - if ($request == 'buildings') { - - $account_no = htmlspecialchars($_POST['account_no'], ENT_QUOTES); - $building_category = htmlspecialchars($_POST['building_category'], ENT_QUOTES); - $building_dma_id = htmlspecialchars($_POST['building_dma_id'], ENT_QUOTES); - $building_storey = htmlspecialchars($_POST['building_storey'], ENT_QUOTES); - $building_population = htmlspecialchars($_POST['building_population'], ENT_QUOTES); - $building_location = htmlspecialchars($_POST['building_location'], ENT_QUOTES); - $building_geometry = $_POST['building_geometry']; - - $result = $pdo -> query("SELECT *from buildings where account_no= '$account_no'"); - - if ($result->rowCount()>0) { - echo "ERROR: Building ID already exists. Please type in another ID!"; - } else { - $sql = $pdo -> query("INSERT INTO buildings(account_no, building_category, building_dma_id, building_storey, building_population, building_location, geom) VALUES ('$account_no', '$building_category', '$building_dma_id', '$building_storey', '$building_population', '$building_location', ST_Force3DZ(ST_SetSRID(ST_GeomFromGeoJSON('$building_geometry'), 4326)))"); - } - } - - - - - - - ?> \ No newline at end of file diff --git a/legacy/load_data.php b/legacy/load_data.php deleted file mode 100644 index 2d8b17d..0000000 --- a/legacy/load_data.php +++ /dev/null @@ -1,63 +0,0 @@ - query("SELECT *, ST_AsGeoJSON(geom) as geojson FROM $table WHERE $dma_id_field = '$dma_id'"); - - $features = []; - - foreach($result as $row) { - // PHP-Objekt erstellen - $geometry = json_decode($row['geojson']); - - // PHP-Objekt bereinigen - unset($row['geom']); - unset($row['geojson']); - - // JSON-Feature hinzufügen - $feature = [ - "type"=>"Feature", - "geometry"=>$geometry, - "properties"=>$row - ]; - - array_push($features, $feature); - }; - - // Feature-Collection hinzufügen - $featureCollection = [ - "type"=>"FeatureCollection", - "features"=>$features - ]; - - echo json_encode($featureCollection); - - // Fehlernachricht ausgeben - } catch(PDOException $e) { - echo "ERROR ".$e->getMessage(); - - } - -?> \ No newline at end of file diff --git a/legacy/test.html b/legacy/test.html deleted file mode 100644 index 8a65c7b..0000000 --- a/legacy/test.html +++ /dev/null @@ -1,97 +0,0 @@ - - -
- - -