Merge branch 'feature/#63' into devel
This commit is contained in:
3
.gitignore
vendored
3
.gitignore
vendored
@@ -1 +1,2 @@
|
|||||||
/geoapi/nbproject/private/
|
/geoapi/nbproject/private/
|
||||||
|
/geoapi/insert/campustest.csv
|
||||||
2
geoapi/insert/.htaccess
Normal file
2
geoapi/insert/.htaccess
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
RewriteEngine off
|
||||||
|
RewriteRule ^ index.php [QSA,L]
|
||||||
34
geoapi/insert/loadcvs.php
Normal file
34
geoapi/insert/loadcvs.php
Normal file
@@ -0,0 +1,34 @@
|
|||||||
|
<?php
|
||||||
|
if (($handle = fopen("campustest.csv", "r")) !== FALSE) {
|
||||||
|
$firstRow = true;
|
||||||
|
while (($data = fgetcsv($handle, 1000, ",")) !== FALSE) {
|
||||||
|
|
||||||
|
if ($firstRow) {
|
||||||
|
$firstRow = FALSE;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
$plan = $data[0];
|
||||||
|
$id = $data[1];
|
||||||
|
$name = $data[2];
|
||||||
|
$typ = $data[3];
|
||||||
|
$insetPlace = "INSERT INTO `place`(`id`, `plan`) VALUES ($id,GeomFromText('$plan'));\n";
|
||||||
|
$insertAlias = "INSERT INTO `placealias`(`pid`, `alias`) VALUES ($id,$id);\n";
|
||||||
|
$insertDomain = "INSERT INTO `placedomain`(`pid`, `did`) VALUES ($id,1);\n";
|
||||||
|
$insertName = "";
|
||||||
|
$insertTyp ="";
|
||||||
|
if ($name) {
|
||||||
|
$insertName = "INSERT INTO `placeinformation`(`pid`, `iid`, `value`) VALUES ($id,3,'$name');\n";
|
||||||
|
}
|
||||||
|
if ($typ) {
|
||||||
|
$insertTyp = "INSERT INTO `placeinformation`(`pid`, `iid`, `value`) VALUES ($id,4,'$typ');\n";
|
||||||
|
}
|
||||||
|
|
||||||
|
echo $insetPlace;
|
||||||
|
echo $insertAlias;
|
||||||
|
echo $insertDomain;
|
||||||
|
echo $insertName;
|
||||||
|
echo $insertTyp;
|
||||||
|
}
|
||||||
|
fclose($handle);
|
||||||
|
}
|
||||||
|
?>
|
||||||
Reference in New Issue
Block a user