# HG changeset patch # User Zoe Hong # Date 1423212257 -3600 # Node ID 0e9a7c69f22c60f09e6de8677d5fb35170875083 # Parent 63e08b98032f7d20a06ed77396883ff789d58083 add editing records/log into TOC correction list page, more editing records could be shown on the TOC page diff -r 63e08b98032f -r 0e9a7c69f22c interface/add_dynasty.php --- a/interface/add_dynasty.php Thu Feb 05 16:07:53 2015 +0100 +++ b/interface/add_dynasty.php Fri Feb 06 09:44:17 2015 +0100 @@ -37,7 +37,7 @@ $result=mysql_query($query); if(!$result){ - echo json_encode("Failed during querying records."); + echo json_encode("Failed during querying books records."); return; } while($row=mysql_fetch_assoc($result)){ diff -r 63e08b98032f -r 0e9a7c69f22c interface/check_sections.php --- a/interface/check_sections.php Thu Feb 05 16:07:53 2015 +0100 +++ b/interface/check_sections.php Fri Feb 06 09:44:17 2015 +0100 @@ -70,9 +70,14 @@ // sorting by the $sort_by parameter function checkSections_sort_by($sort_by){ switch ($sort_by) { - case 'time': + case '_time': $query="(SELECT name AS book_name,level1,level2,period,dynasty,start_year,id from books ORDER BY start_year)"; $result = mysql_query($query); + if (!$result){ + echo ("Failed during selecting books table."); + } + + echo mysql_num_rows($result)." result(s)

"; echo ""; echo ""; @@ -91,6 +96,41 @@ echo "
"; break; + case 'time': + $query="(SELECT name AS book_name,level1,level2,period,dynasty,start_year,id from books ORDER BY start_year)"; + $result = mysql_query($query); + if (!$result){ + echo ("Failed during selecting books table."); + } + + + echo mysql_num_rows($result)." result(s)

"; + echo ""; + echo ""; + echo ""; + $str.="
book namelevel1level2 perioddynastystart_yearlast_editoredit_time"; + while ($row = mysql_fetch_assoc($result)) { + $str="
".$row['book_name']; + $str.="".$row['level1']; + $str.="".$row['level2']; + $str.="".$row['period']; + $str.="".$row['dynasty']; + $str.="".$row['start_year']; + + // query last_editor and last_edit_time + $query_editor = "(SELECT editor, date from sections_versions WHERE books_id='".$row['id']."' ORDER BY version DESC)"; + $row_sections_versions = mysql_fetch_assoc(mysql_query($query_editor)); // the first one + $last_editor = $row_sections_versions['editor']; + $last_edit_time = $row_sections_versions['date']; + $str.="".$last_editor; + $str.="".$last_edit_time; + + $str.=""."click here".""; + echo $str; + } + echo "
"; + break; + default: # code... echo "no sorting parameter set"; @@ -98,6 +138,7 @@ } } + ?> diff -r 63e08b98032f -r 0e9a7c69f22c interface/check_sections_details.php --- a/interface/check_sections_details.php Thu Feb 05 16:07:53 2015 +0100 +++ b/interface/check_sections_details.php Fri Feb 06 09:44:17 2015 +0100 @@ -31,7 +31,7 @@ period pages version - editor + last_editor date"; $str.=""; $str.="".$bookInfo['id']; @@ -94,57 +94,130 @@ echo $str; } +function show_history() { + +} + ?> - - - - - - - - - - - + + + + + + + + + + + + + +
...
- $version,"editor"=>$editor,"date"=>$date]); + printBookInfo($bookInfo); + //echo "version: ".$version."
last editor: ".$editor; + $missingPageArray=checkMissingPage($bookInfo,$info); - $info=checkSectionInfo($bookId); - $version=$info['version']; - $editor=$info['editor']; - $date=$info['date']; - $bookInfo=array_merge($bookInfo,["version"=>$version,"editor"=>$editor,"date"=>$date]); - printBookInfo($bookInfo); - //echo "version: ".$version."
last editor: ".$editor; - $missingPageArray=checkMissingPage($bookInfo,$info); - ?> -
- + + Show editing record: + + + + + + + + + + + + + +
Editor(version)Date/Time
+ +
+ + -
+
+ +
- + + + + +