Mercurial > hg > LGMap
diff coordinates/local_monographs_coordinates.php @ 3:2b5a5cb5d6d1
update books_coordinates.csv
author | Zoe Hong <zhong@mpiwg-berlin.mpg.de> |
---|---|
date | Mon, 20 Apr 2015 11:36:07 +0200 |
parents | 57bde4830927 |
children |
line wrap: on
line diff
--- a/coordinates/local_monographs_coordinates.php Tue Mar 24 16:23:48 2015 +0100 +++ b/coordinates/local_monographs_coordinates.php Mon Apr 20 11:36:07 2015 +0200 @@ -1,6 +1,6 @@ <?php -include_once("../../interface/config.php"); -include_once('../../interface/Lib_mb_utf8.php'); +include_once("../config/config.php"); +include_once("../config/Lib_mb_utf8.php"); set_time_limit(0); ini_set('memory_limit', '-1'); ini_set("auto_detect_line_endings", true); @@ -153,20 +153,21 @@ echo "# of rows: ".$row."<br>"; } function getBookListFromDatabase(){ - $query="SELECT coor.place_name AS Address, coor.admin_type AS ADMIN_TYPE, books.level1 AS LEVEL1, books.level2 AS LEVEL2, + $query="SELECT coor.place_name AS Address, books.admin_type AS ADMIN_TYPE, books.level1 AS LEVEL1, books.level2 AS LEVEL2, books.name AS Name, books.period AS PERIOD, books.start_year AS 'TimeSpan:begin', books.end_year AS 'TimeSpan:end', books.id AS BOOK_ID, coor.x AS Longitude, coor.y AS Latitude, coor.chgis_id AS CHGIS_ID, coor.1820_id AS 1820_ID, coor.1911_id AS 1911_ID, coor.cbdb_id AS CBDB_ID, - info.volume AS VOLUME, info.author AS AUTHOR, info.edition AS EDITION FROM books - JOIN coordinates_books coor ON books.id=coor.books_id - JOIN books_info info ON books.id=info.books_id"; + books.volume AS VOLUME, books.author AS AUTHOR, books.edition AS EDITION FROM books + JOIN coordinates_books coor ON books.id=coor.books_id"; + //JOIN books_info info ON books.id=info.books_id"; $bookArray=array(); $result=mysql_query($query); while($row=mysql_fetch_assoc($result)){ $bookArray[]=$row; } + return $bookArray; } @@ -186,9 +187,10 @@ </head> <body> <?php -$coordinateArray=getCoordinateFromFile(); //Read from local_monographs_coordinates_filtered.txt to get the most updated coordinates -//printCoordinate($coordinateArray); -insertCoordinateIntoDatabase($coordinateArray); //insert them to db +//$coordinateArray=getCoordinateFromFile(); //Read from local_monographs_coordinates_filtered.txt to get the most updated coordinates +////printCoordinate($coordinateArray); +//insertCoordinateIntoDatabase($coordinateArray); //insert them to db + $bookArray=getBookListFromDatabase(); foreach($bookArray as $idx=>$book){ $bookArray[$idx]['Name']="(".$book['PERIOD'].") ".$book['Name'];