comparison views/Extractapp/ExportTabDelimited.php @ 92:f5b0cd4f25b2 extractapp

new: explore table for using on LGMap
author Zoe Hong <zhong@mpiwg-berlin.mpg.de>
date Mon, 14 Sep 2015 14:39:03 +0200
parents
children b0cecc104639
comparison
equal deleted inserted replaced
91:3e11a9c5a672 92:f5b0cd4f25b2
1 <?php
2 /*
3 * ExportTabDelimited.php
4 * This file is part of Extraction-interface.
5 *
6 * Extraction-interface is free software: you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation, either version 3 of the License, or
9 * (at your option) any later version.
10 *
11 * Extraction-interface is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with Extraction-interface. If not, see <http://www.gnu.org/licenses/>.
18 */
19 /*! \file
20 * This is the view for ExportTabDelimited.
21 */
22
23 // --- initialize ---
24 $outputTableArray = $viewmodel['outputTableArray'];
25 $bookId = $viewmodel['bookId'];
26 $sectionid = $viewmodel['section_id'];
27 $bookName = $viewmodel['bookName'];
28 $sectionName = $viewmodel['sectionName'];
29 $bookMeta = $viewmodel['bookMeta'];
30
31
32
33 $count=1;
34 foreach ( $outputTableArray as $trIndex =>$trValue ) {
35
36 if ( $trIndex==0 ) {
37 echo "#\t";
38 echo "Book ID\t";
39 echo "Section ID\t";
40 echo "Name\t";
41 echo "部\t";
42 echo "Address\t";
43 echo "Longitude\t"; // longitude
44 echo "Latitude\t"; // latitude
45 } else {
46 echo $count++."\t";
47 echo $bookId."\t";
48 echo $sectionid."\t";
49 echo $bookName."\t";
50 echo $sectionName."\t";
51 echo $bookMeta->place_name."\t";
52 echo $bookMeta->x."\t";
53 echo $bookMeta->y."\t";
54 }
55 if ( isset( $trValue["page"] ) ) {
56 echo $trValue["page"]."\t";
57 } else {
58 echo "\t";
59 }
60
61 foreach ( $outputTableArray[0][0] as $index => $value ) {
62 if ( $index == "time" ) {
63 if ( isset( $trValue[0][$index] ) ) {
64 echo $trValue[0][$index]."\t";
65 echo $trValue[0][$index]."\t";
66 } else {
67 echo "\t";
68 echo "\t";
69 }
70 } else {
71 if ( isset( $trValue[0][$index] ) ) {
72 echo $trValue[0][$index]."\t";
73 } else {
74 echo "\t";
75 }
76 }
77 }
78 if ( isset( $trValue["other"] ) ) {
79 echo $trValue["other"]."\t";
80 } else {
81 echo "\t";
82 }
83 if ( isset( $trValue["full"] ) ) {
84 echo $trValue["full"]."\t";
85 } else {
86 echo "\t";
87 }
88 echo "\n";
89 }
90
91 ?>
92