# HG changeset patch # User Zoe Hong # Date 1421833784 -3600 # Node ID ef6d0c6a13d730694822d301c97ae763618d21e6 # Parent b12c99b7c3f02c3f7dee6a7b9b787aacd854cbbe (1)Add 'sort_by' time entry in main page. (check_sections.php) Modify check_sections_details page to have level3 option. (2)Modify map to have default dataset loaded. diff -r b12c99b7c3f0 -r ef6d0c6a13d7 index.php --- a/index.php Mon Jan 19 17:13:49 2015 +0100 +++ b/index.php Wed Jan 21 10:49:44 2015 +0100 @@ -69,7 +69,10 @@
Or, you can get to the TOC page for a given book and begin correcting the TOC.
(Please specify a bookID in the URL by yourself.)
- + +
Correct TOCs for 中國方志庫 texts (Sorting by time)
+
+
+
+
Correct TOCs for 中國方志庫 texts
+ +
+
+
Getting coordinates from CHGIS
+ +
+ +
+
中國大陸各省地方志書目查詢系統
+ +
+
+
Visualization
+ +
+
+
Backend Mysql Database
+ +
+ + + diff -r b12c99b7c3f0 -r ef6d0c6a13d7 interface/check_sections.php --- a/interface/check_sections.php Mon Jan 19 17:13:49 2015 +0100 +++ b/interface/check_sections.php Wed Jan 21 10:49:44 2015 +0100 @@ -66,8 +66,41 @@ echo ""; } + +// sorting by the $sort_by parameter +function checkSections_sort_by($sort_by){ + switch ($sort_by) { + case 'time': + $query="(SELECT name AS book_name,level1,level2,period,start_year,id from books ORDER BY start_year)"; + $result = mysql_query($query); + echo mysql_num_rows($result)." result(s)

"; + echo ""; + echo ""; + echo ""; + $str.="
book namelevel1level2periodstart_year"; + while ($row = mysql_fetch_assoc($result)) { + $str="
".$row['book_name']; + $str.="".$row['level1']; + $str.="".$row['level2']; + $str.="".$row['period']; + $str.="".$row['start_year']; + $str.=""."click here".""; + echo $str; + } + echo "
"; + break; + + default: + # code... + echo "no sorting parameter set"; + break; + } +} + ?> + + @@ -87,6 +120,9 @@ if(isset($_GET['find']) && $_GET['count']!='' && is_numeric($_GET['count'])){ checkSections($_GET['count']); } + else if(isset($_GET['sort_by'])){ + checkSections_sort_by($_GET['sort_by']); + } ?> diff -r b12c99b7c3f0 -r ef6d0c6a13d7 interface/check_sections_20150120.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/interface/check_sections_20150120.php Wed Jan 21 10:49:44 2015 +0100 @@ -0,0 +1,94 @@ +=".$count." + ORDER BY COUNT( * ) DESC ";*/ + $query="(SELECT books.name AS book_name, books.level1, books.level2, books.period, books.id, sections.name, start_page, end_page, COUNT( * ) AS count + FROM sections + JOIN books ON sections.books_id = books.id + WHERE NOT EXISTS + (SELECT 1 FROM sections_versions WHERE books_id=sections.books_id) + GROUP BY books_id, start_page, end_page + HAVING COUNT( * ) >=".$count.") + UNION + (SELECT books.name AS book_name, books.level1, books.level2, books.period, books.id, sections_revisions.name, start_page, end_page, COUNT( * ) AS count + FROM sections_revisions + JOIN books ON sections_revisions.books_id = books.id + JOIN ( + SELECT sections_versions.id + FROM sections_versions WHERE sections_versions.version=(SELECT MAX(version) FROM sections_versions) + GROUP BY books_id + ) AS t ON t.id=sections_revisions.versions_id + WHERE deleted=0 + GROUP BY books_id, versions_id,start_page, end_page + HAVING COUNT( * ) >=".$count.") + ORDER BY count DESC "; + $result = mysql_query($query); + echo mysql_num_rows($result)." result(s)

"; + echo ""; + echo ""; + echo ""; + $str.="
book namelevel1level2periodsection namepagecount"; + while ($row = mysql_fetch_assoc($result)) { + $str="
".$row['book_name']; + $str.="".$row['level1']; + $str.="".$row['level2']; + $str.="".$row['period']; + $str.="".$row['name'].""; + $str.="p".$row['start_page']."-".$row['end_page']; + $str.="".$row['count'].""; + echo $str; + } + echo "
"; +} + +?> + + + + + + + + + + +
+ find sections overlapping more than other sections + +
+
+
+ +
+ + + diff -r b12c99b7c3f0 -r ef6d0c6a13d7 interface/check_sections_details.php --- a/interface/check_sections_details.php Mon Jan 19 17:13:49 2015 +0100 +++ b/interface/check_sections_details.php Wed Jan 21 10:49:44 2015 +0100 @@ -101,7 +101,8 @@ - + diff -r b12c99b7c3f0 -r ef6d0c6a13d7 interface/config.php --- a/interface/config.php Mon Jan 19 17:13:49 2015 +0100 +++ b/interface/config.php Wed Jan 21 10:49:44 2015 +0100 @@ -2,12 +2,18 @@ $systemNAME = "interface"; -$mysql_database="Gazetteer"; +// local machine +$mysql_database="Gazetteers"; $mysql_server = "localhost"; $mysql_user = "root"; $mysql_password = "root"; -/* + +/* +// MPIWG server +$mysql_database="Gazetteer"; +$mysql_server = "localhost"; + $mysql_user = "Gazetteer"; $mysql_password = "3333"; */ diff -r b12c99b7c3f0 -r ef6d0c6a13d7 interface/css/check_sections.css --- a/interface/css/check_sections.css Mon Jan 19 17:13:49 2015 +0100 +++ b/interface/css/check_sections.css Wed Jan 21 10:49:44 2015 +0100 @@ -45,7 +45,7 @@ table{ margin-bottom:20px; } -td.level1, td.level2, td.period{ +td.level1, td.level2, td.level3, td.period{ width:70px; } div.entry{ @@ -63,6 +63,9 @@ div.level2 .cell{ padding:5px 0px; } +div.level3 .cell{ + padding:10px 0px; +} div.entry .sequence{ display:inline-block; width:36px; @@ -104,6 +107,11 @@ div.level2 .name{ text-indent:40px; } +div.level3{ +} +div.level3 .name{ + text-indent:80px; +} div.overlapper{ background:#F5A9A9; } diff -r b12c99b7c3f0 -r ef6d0c6a13d7 interface/edit_section_db.php --- a/interface/edit_section_db.php Mon Jan 19 17:13:49 2015 +0100 +++ b/interface/edit_section_db.php Wed Jan 21 10:49:44 2015 +0100 @@ -154,17 +154,41 @@ echo json_encode("Succeeded."); } } + if(isset($_POST['command']) && $_POST['command']!=''){ $command=$_POST['command']; - if($command=="write"){ - if(isset($_POST['bookId'])&&isset($_POST['sectionArray'])&&isset($_POST['version'])&&isset($_POST['editor'])&& + if($command=="write"){ + + $bookId=$_POST['bookId']; + $sectionArray=$_POST['sectionArray']; + $version=$_POST['version']; + $editor=$_POST['editor']; + + foreach ($sectionArray as $key => $value) { + //echo $key.','; + foreach ($value as $key => $inner_val) { + //echo $key.",".$inner_val."\n"; + } + } + + //echo "bookId:".$bookId.", "."editor:".$editor; + if(isset($bookId)&&isset($sectionArray)&&isset($version)&&isset($editor)&&\ + is_numeric($bookId) && sizeof($sectionArray)!=0 && is_numeric($version) && $editor!=""){ + + updateSectionArray($bookId,$sectionArray,$version,$editor); + } + /* + if(isset($_POST['bookId'])&&isset($_POST['sectionArray'])&&isset($_POST['version'])&&isset($_POST['editor'])&&\ is_numeric($_POST['bookId']) && sizeof($_POST['sectionArray'])!=0 && is_numeric($_POST['version']) && $_POST['editor']!=""){ $bookId=$_POST['bookId']; $sectionArray=$_POST['sectionArray']; $version=$_POST['version']; $editor=$_POST['editor']; - updateSectionArray($bookId,$sectionArray,$version,$editor); + + echo "updating db..."; + // updateSectionArray($bookId,$sectionArray,$version,$editor); } + */ } } diff -r b12c99b7c3f0 -r ef6d0c6a13d7 interface/js/check_sections_details.js --- a/interface/js/check_sections_details.js Mon Jan 19 17:13:49 2015 +0100 +++ b/interface/js/check_sections_details.js Wed Jan 21 10:49:44 2015 +0100 @@ -141,9 +141,10 @@ //level var levelObj=$("
").addClass("editLevel").append("