annotate views/Extractapp/ExportTable.php @ 94:b0cecc104639 extractapp

new: modified tags can work on tagged text
author Zoe Hong <zhong@mpiwg-berlin.mpg.de>
date Mon, 09 Nov 2015 12:00:24 +0100
parents 3e11a9c5a672
children e6b516fa7b60
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
47
886f43b26ee2 move/remove develop folder
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
1 <?php
81
f1f849d31272 book_id as string
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 78
diff changeset
2 /*
f1f849d31272 book_id as string
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 78
diff changeset
3 * ExportTable.php
f1f849d31272 book_id as string
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 78
diff changeset
4 * This file is part of Extraction-interface.
f1f849d31272 book_id as string
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 78
diff changeset
5 *
f1f849d31272 book_id as string
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 78
diff changeset
6 * Extraction-interface is free software: you can redistribute it and/or modify
f1f849d31272 book_id as string
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 78
diff changeset
7 * it under the terms of the GNU General Public License as published by
f1f849d31272 book_id as string
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 78
diff changeset
8 * the Free Software Foundation, either version 3 of the License, or
f1f849d31272 book_id as string
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 78
diff changeset
9 * (at your option) any later version.
f1f849d31272 book_id as string
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 78
diff changeset
10 *
f1f849d31272 book_id as string
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 78
diff changeset
11 * Extraction-interface is distributed in the hope that it will be useful,
f1f849d31272 book_id as string
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 78
diff changeset
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
f1f849d31272 book_id as string
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 78
diff changeset
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
f1f849d31272 book_id as string
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 78
diff changeset
14 * GNU General Public License for more details.
f1f849d31272 book_id as string
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 78
diff changeset
15 *
f1f849d31272 book_id as string
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 78
diff changeset
16 * You should have received a copy of the GNU General Public License
f1f849d31272 book_id as string
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 78
diff changeset
17 * along with Extraction-interface. If not, see <http://www.gnu.org/licenses/>.
f1f849d31272 book_id as string
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 78
diff changeset
18 */
77
97c1e5102a22 New: export table for a file from LGService
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 47
diff changeset
19 /*! \file
78
960ba96efce1 Update: click to popup remove-tag-window; select to popup tag-window
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 77
diff changeset
20 * This is the view for ExportTable.
960ba96efce1 Update: click to popup remove-tag-window; select to popup tag-window
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 77
diff changeset
21 * It shows a html table with each row as a topic object and each column as a tag/attribute.
77
97c1e5102a22 New: export table for a file from LGService
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 47
diff changeset
22 */
97c1e5102a22 New: export table for a file from LGService
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 47
diff changeset
23
47
886f43b26ee2 move/remove develop folder
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
24 // --- initialize ---
886f43b26ee2 move/remove develop folder
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
25 $outputTableArray = $viewmodel['outputTableArray'];
886f43b26ee2 move/remove develop folder
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
26 $bookId = $viewmodel['bookId'];
886f43b26ee2 move/remove develop folder
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
27 $sectionid = $viewmodel['section_id'];
886f43b26ee2 move/remove develop folder
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
28 $bookName = $viewmodel['bookName'];
886f43b26ee2 move/remove develop folder
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
29 $sectionName = $viewmodel['sectionName'];
91
3e11a9c5a672 new: explore table for using on LGMap
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 81
diff changeset
30 $bookMeta = $viewmodel['bookMeta'];
47
886f43b26ee2 move/remove develop folder
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
31
886f43b26ee2 move/remove develop folder
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
32 ?>
886f43b26ee2 move/remove develop folder
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
33
886f43b26ee2 move/remove develop folder
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
34 <html>
886f43b26ee2 move/remove develop folder
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
35 <head>
886f43b26ee2 move/remove develop folder
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
36 <title></title>
886f43b26ee2 move/remove develop folder
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
37
886f43b26ee2 move/remove develop folder
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
38 </head>
886f43b26ee2 move/remove develop folder
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
39
886f43b26ee2 move/remove develop folder
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
40 <body>
886f43b26ee2 move/remove develop folder
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
41 <table width="100%" border="1" id="tableMain">
886f43b26ee2 move/remove develop folder
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
42
886f43b26ee2 move/remove develop folder
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
43 <?php
886f43b26ee2 move/remove develop folder
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
44 $count=1;
886f43b26ee2 move/remove develop folder
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
45 foreach ( $outputTableArray as $trIndex =>$trValue ) {
886f43b26ee2 move/remove develop folder
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
46 echo "<tr>";
886f43b26ee2 move/remove develop folder
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
47 if ( $trIndex==0 ) {
886f43b26ee2 move/remove develop folder
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
48 echo "<td>#</td>";
886f43b26ee2 move/remove develop folder
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
49 echo "<td>Book ID</td>";
886f43b26ee2 move/remove develop folder
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
50 echo "<td>Section ID</td>";
886f43b26ee2 move/remove develop folder
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
51 echo "<td>方志</td>";
886f43b26ee2 move/remove develop folder
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
52 echo "<td>部</td>";
91
3e11a9c5a672 new: explore table for using on LGMap
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 81
diff changeset
53 echo "<td>方志地點</td>";
3e11a9c5a672 new: explore table for using on LGMap
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 81
diff changeset
54 echo "<td>經度(x)</td>"; // longitude
3e11a9c5a672 new: explore table for using on LGMap
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 81
diff changeset
55 echo "<td>緯度(y)</td>"; // latitude
94
b0cecc104639 new: modified tags can work on tagged text
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 91
diff changeset
56 echo "<td>Description</td>"; // description
b0cecc104639 new: modified tags can work on tagged text
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 91
diff changeset
57
47
886f43b26ee2 move/remove develop folder
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
58 } else {
886f43b26ee2 move/remove develop folder
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
59 echo "<td>".$count++."</td>";
886f43b26ee2 move/remove develop folder
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
60 echo "<td>".$bookId."</td>";
886f43b26ee2 move/remove develop folder
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
61 echo "<td>".$sectionid."</td>";
886f43b26ee2 move/remove develop folder
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
62 echo "<td>".$bookName."</td>";
886f43b26ee2 move/remove develop folder
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
63 echo "<td>".$sectionName."</td>";
91
3e11a9c5a672 new: explore table for using on LGMap
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 81
diff changeset
64 echo "<td>".$bookMeta->place_name."</td>";
3e11a9c5a672 new: explore table for using on LGMap
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 81
diff changeset
65 echo "<td>".$bookMeta->x."</td>";
3e11a9c5a672 new: explore table for using on LGMap
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 81
diff changeset
66 echo "<td>".$bookMeta->y."</td>";
94
b0cecc104639 new: modified tags can work on tagged text
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 91
diff changeset
67 echo "<td>".$bookName."_".$sectionName."</td>"; // description for LGMap
b0cecc104639 new: modified tags can work on tagged text
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 91
diff changeset
68
47
886f43b26ee2 move/remove develop folder
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
69 }
886f43b26ee2 move/remove develop folder
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
70 if ( isset( $trValue["page"] ) ) {
886f43b26ee2 move/remove develop folder
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
71 echo "<td>".$trValue["page"]."</td>";
886f43b26ee2 move/remove develop folder
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
72 } else {
886f43b26ee2 move/remove develop folder
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
73 echo "<td>&nbsp;</td>";
886f43b26ee2 move/remove develop folder
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
74 }
886f43b26ee2 move/remove develop folder
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
75 /*
886f43b26ee2 move/remove develop folder
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
76 foreach ( $outputTableArray[0][1] as $index => $value ) {
886f43b26ee2 move/remove develop folder
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
77 if ( isset( $trValue[1][$index] ) ) {
886f43b26ee2 move/remove develop folder
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
78 echo "<td>".$trValue[1][$index]."</td>";
886f43b26ee2 move/remove develop folder
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
79 } else {
886f43b26ee2 move/remove develop folder
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
80 echo "<td>&nbsp;</td>";
886f43b26ee2 move/remove develop folder
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
81 }
886f43b26ee2 move/remove develop folder
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
82 }
886f43b26ee2 move/remove develop folder
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
83 */
886f43b26ee2 move/remove develop folder
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
84 foreach ( $outputTableArray[0][0] as $index => $value ) {
886f43b26ee2 move/remove develop folder
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
85 if ( $index == "time" ) {
886f43b26ee2 move/remove develop folder
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
86 if ( isset( $trValue[0][$index] ) ) {
886f43b26ee2 move/remove develop folder
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
87 echo "<td>".$trValue[0][$index]."</td>";
886f43b26ee2 move/remove develop folder
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
88 echo "<td>".$trValue[0][$index]."</td>";
886f43b26ee2 move/remove develop folder
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
89 } else {
886f43b26ee2 move/remove develop folder
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
90 echo "<td>&nbsp;</td>";
886f43b26ee2 move/remove develop folder
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
91 echo "<td>&nbsp;</td>";
886f43b26ee2 move/remove develop folder
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
92 }
886f43b26ee2 move/remove develop folder
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
93 } else {
886f43b26ee2 move/remove develop folder
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
94 if ( isset( $trValue[0][$index] ) ) {
886f43b26ee2 move/remove develop folder
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
95 echo "<td>".$trValue[0][$index]."</td>";
886f43b26ee2 move/remove develop folder
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
96 } else {
886f43b26ee2 move/remove develop folder
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
97 echo "<td>&nbsp;</td>";
886f43b26ee2 move/remove develop folder
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
98 }
886f43b26ee2 move/remove develop folder
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
99 }
886f43b26ee2 move/remove develop folder
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
100 }
94
b0cecc104639 new: modified tags can work on tagged text
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 91
diff changeset
101
b0cecc104639 new: modified tags can work on tagged text
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 91
diff changeset
102
47
886f43b26ee2 move/remove develop folder
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
103 if ( isset( $trValue["other"] ) ) {
886f43b26ee2 move/remove develop folder
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
104 echo "<td>".$trValue["other"]."</td>";
886f43b26ee2 move/remove develop folder
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
105 } else {
886f43b26ee2 move/remove develop folder
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
106 echo "<td>&nbsp;</td>";
886f43b26ee2 move/remove develop folder
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
107 }
886f43b26ee2 move/remove develop folder
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
108 if ( isset( $trValue["full"] ) ) {
886f43b26ee2 move/remove develop folder
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
109 echo "<td>".$trValue["full"]."</td>";
886f43b26ee2 move/remove develop folder
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
110 } else {
886f43b26ee2 move/remove develop folder
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
111 echo "<td>&nbsp;</td>";
886f43b26ee2 move/remove develop folder
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
112 }
94
b0cecc104639 new: modified tags can work on tagged text
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 91
diff changeset
113
b0cecc104639 new: modified tags can work on tagged text
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents: 91
diff changeset
114
47
886f43b26ee2 move/remove develop folder
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
115 echo "</tr>";
886f43b26ee2 move/remove develop folder
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
116 }
886f43b26ee2 move/remove develop folder
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
117 ?>
886f43b26ee2 move/remove develop folder
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
118 </table>
886f43b26ee2 move/remove develop folder
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
119 </body>
886f43b26ee2 move/remove develop folder
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff changeset
120 </html>