changeset 116:0ef426b5a1b9 extractapp

replace delimit character from "tab" to "comma"
author Calvin Yeh <cyeh@mpiwg-berlin.mpg.de>
date Thu, 28 Sep 2017 17:43:13 +0200
parents 507070df62e6
children e6b516fa7b60
files views/Extractapp/ExportTabDelimited.php
diffstat 1 files changed, 40 insertions(+), 37 deletions(-) [+]
line wrap: on
line diff
--- a/views/Extractapp/ExportTabDelimited.php	Thu Sep 28 17:13:39 2017 +0200
+++ b/views/Extractapp/ExportTabDelimited.php	Thu Sep 28 17:43:13 2017 +0200
@@ -16,7 +16,7 @@
  * You should have received a copy of the GNU General Public License
  * along with Extraction-interface.  If not, see <http://www.gnu.org/licenses/>.
 */
-/*! \file 
+/*! \file
  * This is the view for ExportTabDelimited.
 */
 
@@ -32,65 +32,68 @@
 
 $count=1;
 	foreach ( $outputTableArray as $trIndex =>$trValue ) {
-		
-		if ( $trIndex==0 ) {
-			echo "#\t";
-			echo "Book ID\t";
-			echo "Section ID\t";
-			echo "Name\t";
-			echo "部\t";
-			echo "Address\t";
-			echo "Longitude\t";	// longitude
-			echo "Latitude\t";	// latitude
-			echo "Description\t";	// description
+
+        if ( $trIndex==0 ) {
+			echo ",";
+			echo "Book ID,";
+			echo "Section ID,";
+			echo "Book Name,";
+			echo "Section Name,";
+            echo "Book Year,";
+            echo "Edition Year,";
+			echo "Addres,";
+			echo "Longitude,";	// longitude
+			echo "Latitude,";	// latitude
+			echo "Description,";	// description
 
 		} else {
-			echo $count++."\t";
-			echo $bookId."\t";
-			echo $sectionid."\t";
-			echo $bookName."\t";
-			echo $sectionName."\t";
-			echo $bookMeta->place_name."\t";
-			echo $bookMeta->x."\t";
-			echo $bookMeta->y."\t";
-			echo $bookName."_".$sectionName."\t";	// description for LGMap
-			
+			echo $count++.",";
+			echo $bookId.",";
+			echo $sectionid.",";
+			echo $bookName.",";
+			echo $sectionName.",";
+            echo $bookMeta->book_year.",";
+            echo $bookMeta->edition_year.",";
+			echo $bookMeta->place_name.",";
+			echo $bookMeta->x.",";
+			echo $bookMeta->y.",";
+			echo $bookName."_".$sectionName.",";	// description for LGMap
+
 		}
 		if ( isset( $trValue["page"] ) ) {
-			echo $trValue["page"]."\t";
+			echo $trValue["page"].",";
 		} else {
-			echo "\t";
+			echo ",";
 		}
-		
-		foreach ( $outputTableArray[0][0] as $index => $value ) {
+
+        foreach ( $outputTableArray[0][0] as $index => $value ) {
 			if ( $index == "time" ) {
 				if ( isset( $trValue[0][$index] ) ) {
-					echo $trValue[0][$index]."\t";
-					echo $trValue[0][$index]."\t";
+					echo $trValue[0][$index].",";
+					echo $trValue[0][$index].",";
 				} else {
-					echo "\t";
-					echo "\t";
+					echo ",";
+					echo ",";
 				}
 			} else {
 				if ( isset( $trValue[0][$index] ) ) {
-					echo $trValue[0][$index]."\t";
+					echo $trValue[0][$index].",";
 				} else {
-					echo "\t";
+					echo ",";
 				}
 			}
 		}
 		if ( isset( $trValue["other"] ) ) {
-			echo $trValue["other"]."\t";
+			echo $trValue["other"].",";
 		} else {
-			echo "\t";
+			echo ",";
 		}
 		if ( isset( $trValue["full"] ) ) {
-			echo $trValue["full"]."\t";
+			echo $trValue["full"].",";
 		} else {
-			echo "\t";
+			echo ",";
 		}
 		echo "\n";
 	}
 
 ?>
-