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