diff develop/views/Extractapp/exporttable.php @ 6:63e08b98032f

rewrite extraction interface into PHP MVC architecture. (Although js hasn't been rewritten into MVC, it's fitted into the current PHP MVC architecture.) - The root of the new PHP MVC is at 'develop/'. - extraction interface is called "Extractapp" with several action, eg TaggingText, EditWordlist, EditTaglist, ExportTable.
author Zoe Hong <zhong@mpiwg-berlin.mpg.de>
date Thu, 05 Feb 2015 16:07:53 +0100
parents
children cc36a20a68ab
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/develop/views/Extractapp/exporttable.php	Thu Feb 05 16:07:53 2015 +0100
@@ -0,0 +1,83 @@
+<?php
+// --- initialize ---
+$outputTableArray = $viewmodel['outputTableArray'];
+$bookId = $viewmodel['bookId'];
+$sectionid = $viewmodel['section_id'];
+$bookName = $viewmodel['bookName'];
+$sectionName = $viewmodel['sectionName'];
+
+?>
+
+<html>
+<head>
+<title></title>
+
+</head>
+
+<body>
+<table width="100%" border="1" id="tableMain">
+	
+<?php
+$count=1;
+	foreach ( $outputTableArray as $trIndex =>$trValue ) {
+		echo "<tr>";
+		if ( $trIndex==0 ) {
+			echo "<td>#</td>";
+			echo "<td>Book ID</td>";
+			echo "<td>Section ID</td>";
+			echo "<td>方志</td>";
+			echo "<td>部</td>";
+		} else {
+			echo "<td>".$count++."</td>";
+			echo "<td>".$bookId."</td>";
+			echo "<td>".$sectionid."</td>";
+			echo "<td>".$bookName."</td>";
+			echo "<td>".$sectionName."</td>";
+		}
+		if ( isset( $trValue["page"] ) ) {
+			echo "<td>".$trValue["page"]."</td>";
+		} else {
+			echo "<td>&nbsp;</td>";
+		}
+		/*
+		foreach ( $outputTableArray[0][1] as $index => $value ) {
+			if ( isset( $trValue[1][$index] ) ) {
+				echo "<td>".$trValue[1][$index]."</td>";
+			} else {
+				echo "<td>&nbsp;</td>";
+			}
+		}
+		*/
+		foreach ( $outputTableArray[0][0] as $index => $value ) {
+			if ( $index == "time" ) {
+				if ( isset( $trValue[0][$index] ) ) {
+					echo "<td>".$trValue[0][$index]."</td>";
+					echo "<td>".$trValue[0][$index]."</td>";
+				} else {
+					echo "<td>&nbsp;</td>";
+					echo "<td>&nbsp;</td>";
+				}
+			} else {
+				if ( isset( $trValue[0][$index] ) ) {
+					echo "<td>".$trValue[0][$index]."</td>";
+				} else {
+					echo "<td>&nbsp;</td>";
+				}
+			}
+		}
+		if ( isset( $trValue["other"] ) ) {
+			echo "<td>".$trValue["other"]."</td>";
+		} else {
+			echo "<td>&nbsp;</td>";
+		}
+		if ( isset( $trValue["full"] ) ) {
+			echo "<td>".$trValue["full"]."</td>";
+		} else {
+			echo "<td>&nbsp;</td>";
+		}
+		echo "</tr>";
+	}
+?>
+</table>
+</body>
+</html>