diff interface/check_sections_details.php @ 7:0e9a7c69f22c

add editing records/log into TOC correction list page, more editing records could be shown on the TOC page
author Zoe Hong <zhong@mpiwg-berlin.mpg.de>
date Fri, 06 Feb 2015 09:44:17 +0100
parents 883ad980a43b
children da10158c6d0a
line wrap: on
line diff
--- 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 @@
 		<td class='period'>period
 		<td class='bookId'>pages
 		<td class='bookId'>version
-		<td class='bookName'>editor
+		<td class='bookName'>last_editor
 		<td class='bookName'>date";
 	$str.="<tr>";
 	$str.="<td>".$bookInfo['id'];
@@ -94,57 +94,130 @@
 	echo $str;
 }
 
+function show_history() {
+
+}
+
 ?>
 
 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
 <html>
-        <head>
-                <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
-                <link href="https://code.jquery.com/ui/1.10.4/themes/smoothness/jquery-ui.css" type="text/css" rel="stylesheet"/>
-                <!-- <link href="css/search.css" type="text/css" rel="stylesheet"/>
-            	-->
-                <link href="css/check_sections.css" type="text/css" rel="stylesheet"/>
-                <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js" type="text/javascript"></script>
-                <script src="js/check_sections_details.js" type="text/javascript"></script>
-                <script src="https://code.jquery.com/ui/1.10.4/jquery-ui.js" type="text/javascript"></script>
-                <!--<script src="js/check_sections.js" charset="utf-8"></script>!-->
-        </head>
-        <body>
+<head>
+        <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
+        <link href="https://code.jquery.com/ui/1.10.4/themes/smoothness/jquery-ui.css" type="text/css" rel="stylesheet"/>
+        <!-- <link href="css/search.css" type="text/css" rel="stylesheet"/>
+    	-->
+        <link href="css/check_sections.css" type="text/css" rel="stylesheet"/>
+        <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js" type="text/javascript"></script>
+        <script src="js/check_sections_details.js" type="text/javascript"></script>
+        <script src="https://code.jquery.com/ui/1.10.4/jquery-ui.js" type="text/javascript"></script>
+        <!--<script src="js/check_sections.js" charset="utf-8"></script>!-->
+        
+
+
+</head>
+<body>
 		<div id="loading">...</div>
 		<div id="container">
-                <?php
+            <?php
 			$version=0;
 			$editor="";
 			$date="";
-                        if(isset($_GET['book_id']) && isset($_GET['count']) && is_numeric($_GET['count'])){
-				$bookId=$_GET['book_id'];
-				$count=$_GET['count'];
-				$bookInfo=getBookInfo($bookId);
+            	if(isset($_GET['book_id']) && isset($_GET['count']) && is_numeric($_GET['count'])){
+					$bookId=$_GET['book_id'];
+					$count=$_GET['count'];
+					$bookInfo=getBookInfo($bookId);
+
+					$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."<br>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."<br>last editor: ".$editor;
-				$missingPageArray=checkMissingPage($bookInfo,$info);
-		?>
-                	<div id="searchResults">
-		<?php
+				?>
+				<table>
+					<thead>Show editing record:
+						<button id="show_all">Show all</button>
+						<button id="close">Close</button>
+					</thead>
+					<tbody>
+						<tr>
+							<td>Editor(version)</td>
+							<td>Date/Time</td>
+						</tr>
+						<tr>
+							<td><div id="editor"></div></td>
+							<td><div id="date"></div></td>
+						</tr>
+					</tbody>
+				</table>
+
+            	<div id="searchResults">
+
+				<?php
 				
 				$sectionArray=getSectionArray($bookId,$count,$info);
 				printSectionArray($sectionArray,$missingPageArray);
-                        }else{
-				echo "Cannot process the data due to incomplete input.";
-			}
+              	}else{
+					echo "Cannot process the data due to incomplete input.";
+				}
+
                 ?>
-                	</div>
+            </div>
+            
+
 		</div>
 		<div id="panel"></div>
 		<script>var version=<?php echo $version;?>;</script>
-        </body>
+
+
+	<script type="text/javascript">
+
+		/*
+        document.getElementById("participator").onclick = function(){participator()};
+
+		function participator() {
+			document.getElementById("editor").innerHTML = 'some_one\'s_name('+1+')';
+			document.getElementById("date").innerHTML = Date()+"<br>"+"asdfasdf"+"<br>"+"asdfasdf"+"<br>"+"asdfasdf";
+		}
+		*/
+		document.getElementById("show_all").onclick = function(){showAll()};
+
+		function showAll() {
+			
+			<?php
+				$editors = "";
+				$editing_time = "";
 
+				$query_editor = "(SELECT editor, date, version from sections_versions WHERE books_id='".$bookId."' ORDER BY version DESC)";
+				$result = mysql_query($query_editor);
+				
+				while ($row = mysql_fetch_assoc($result)) {
+					$editor = $row['editor'];
+					$edit_time = $row['date'];
+					$version = $row['version'];
+					?>
+					document.getElementById("editor").innerHTML += '<?php echo $editor; ?>' +'('+'<?php echo $version;?>' +')<br>';
+					document.getElementById("date").innerHTML += '<?php echo $edit_time; ?>' + '<br>';
+					<?php
+		
+				}
+			?>
+
+		}
+
+		document.getElementById("close").onclick = function(){closeAll()};
+
+		function closeAll() {
+			document.getElementById("editor").innerHTML = "";
+			document.getElementById("date").innerHTML = "";
+		}
+    </script>
+
+</body>
 
 </html>