Mercurial > hg > extraction-interface
annotate views/Extractapp/ExportTable.php @ 78:960ba96efce1 extractapp
Update: click to popup remove-tag-window; select to popup tag-window
author | Zoe Hong <zhong@mpiwg-berlin.mpg.de> |
---|---|
date | Mon, 20 Apr 2015 15:44:54 +0200 |
parents | 97c1e5102a22 |
children | f1f849d31272 |
rev | line source |
---|---|
47
886f43b26ee2
move/remove develop folder
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
1 <?php |
77
97c1e5102a22
New: export table for a file from LGService
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
47
diff
changeset
|
2 /*! \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
|
3 * 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
|
4 * 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
|
5 */ |
97c1e5102a22
New: export table for a file from LGService
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
47
diff
changeset
|
6 |
47
886f43b26ee2
move/remove develop folder
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
7 // --- initialize --- |
886f43b26ee2
move/remove develop folder
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
8 $outputTableArray = $viewmodel['outputTableArray']; |
886f43b26ee2
move/remove develop folder
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
9 $bookId = $viewmodel['bookId']; |
886f43b26ee2
move/remove develop folder
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
10 $sectionid = $viewmodel['section_id']; |
886f43b26ee2
move/remove develop folder
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
11 $bookName = $viewmodel['bookName']; |
886f43b26ee2
move/remove develop folder
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
12 $sectionName = $viewmodel['sectionName']; |
886f43b26ee2
move/remove develop folder
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
13 |
886f43b26ee2
move/remove develop folder
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
14 ?> |
886f43b26ee2
move/remove develop folder
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
15 |
886f43b26ee2
move/remove develop folder
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
16 <html> |
886f43b26ee2
move/remove develop folder
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
17 <head> |
886f43b26ee2
move/remove develop folder
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
18 <title></title> |
886f43b26ee2
move/remove develop folder
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
19 |
886f43b26ee2
move/remove develop folder
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
20 </head> |
886f43b26ee2
move/remove develop folder
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
21 |
886f43b26ee2
move/remove develop folder
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
22 <body> |
886f43b26ee2
move/remove develop folder
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
23 <table width="100%" border="1" id="tableMain"> |
886f43b26ee2
move/remove develop folder
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
24 |
886f43b26ee2
move/remove develop folder
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
25 <?php |
886f43b26ee2
move/remove develop folder
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
26 $count=1; |
886f43b26ee2
move/remove develop folder
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
27 foreach ( $outputTableArray as $trIndex =>$trValue ) { |
886f43b26ee2
move/remove develop folder
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
28 echo "<tr>"; |
886f43b26ee2
move/remove develop folder
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
29 if ( $trIndex==0 ) { |
886f43b26ee2
move/remove develop folder
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
30 echo "<td>#</td>"; |
886f43b26ee2
move/remove develop folder
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
31 echo "<td>Book ID</td>"; |
886f43b26ee2
move/remove develop folder
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
32 echo "<td>Section ID</td>"; |
886f43b26ee2
move/remove develop folder
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
33 echo "<td>方志</td>"; |
886f43b26ee2
move/remove develop folder
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
34 echo "<td>部</td>"; |
886f43b26ee2
move/remove develop folder
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
35 } else { |
886f43b26ee2
move/remove develop folder
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
36 echo "<td>".$count++."</td>"; |
886f43b26ee2
move/remove develop folder
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
37 echo "<td>".$bookId."</td>"; |
886f43b26ee2
move/remove develop folder
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
38 echo "<td>".$sectionid."</td>"; |
886f43b26ee2
move/remove develop folder
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
39 echo "<td>".$bookName."</td>"; |
886f43b26ee2
move/remove develop folder
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
40 echo "<td>".$sectionName."</td>"; |
886f43b26ee2
move/remove develop folder
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
41 } |
886f43b26ee2
move/remove develop folder
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
42 if ( isset( $trValue["page"] ) ) { |
886f43b26ee2
move/remove develop folder
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
43 echo "<td>".$trValue["page"]."</td>"; |
886f43b26ee2
move/remove develop folder
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
44 } else { |
886f43b26ee2
move/remove develop folder
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
45 echo "<td> </td>"; |
886f43b26ee2
move/remove develop folder
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
46 } |
886f43b26ee2
move/remove develop folder
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
47 /* |
886f43b26ee2
move/remove develop folder
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
48 foreach ( $outputTableArray[0][1] as $index => $value ) { |
886f43b26ee2
move/remove develop folder
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
49 if ( isset( $trValue[1][$index] ) ) { |
886f43b26ee2
move/remove develop folder
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
50 echo "<td>".$trValue[1][$index]."</td>"; |
886f43b26ee2
move/remove develop folder
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
51 } else { |
886f43b26ee2
move/remove develop folder
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
52 echo "<td> </td>"; |
886f43b26ee2
move/remove develop folder
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
53 } |
886f43b26ee2
move/remove develop folder
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
54 } |
886f43b26ee2
move/remove develop folder
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
55 */ |
886f43b26ee2
move/remove develop folder
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
56 foreach ( $outputTableArray[0][0] as $index => $value ) { |
886f43b26ee2
move/remove develop folder
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
57 if ( $index == "time" ) { |
886f43b26ee2
move/remove develop folder
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
58 if ( isset( $trValue[0][$index] ) ) { |
886f43b26ee2
move/remove develop folder
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
59 echo "<td>".$trValue[0][$index]."</td>"; |
886f43b26ee2
move/remove develop folder
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
60 echo "<td>".$trValue[0][$index]."</td>"; |
886f43b26ee2
move/remove develop folder
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
61 } else { |
886f43b26ee2
move/remove develop folder
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
62 echo "<td> </td>"; |
886f43b26ee2
move/remove develop folder
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
63 echo "<td> </td>"; |
886f43b26ee2
move/remove develop folder
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
64 } |
886f43b26ee2
move/remove develop folder
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
65 } else { |
886f43b26ee2
move/remove develop folder
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
66 if ( isset( $trValue[0][$index] ) ) { |
886f43b26ee2
move/remove develop folder
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
67 echo "<td>".$trValue[0][$index]."</td>"; |
886f43b26ee2
move/remove develop folder
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
68 } else { |
886f43b26ee2
move/remove develop folder
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
69 echo "<td> </td>"; |
886f43b26ee2
move/remove develop folder
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
70 } |
886f43b26ee2
move/remove develop folder
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
71 } |
886f43b26ee2
move/remove develop folder
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
72 } |
886f43b26ee2
move/remove develop folder
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
73 if ( isset( $trValue["other"] ) ) { |
886f43b26ee2
move/remove develop folder
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
74 echo "<td>".$trValue["other"]."</td>"; |
886f43b26ee2
move/remove develop folder
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
75 } else { |
886f43b26ee2
move/remove develop folder
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
76 echo "<td> </td>"; |
886f43b26ee2
move/remove develop folder
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
77 } |
886f43b26ee2
move/remove develop folder
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
78 if ( isset( $trValue["full"] ) ) { |
886f43b26ee2
move/remove develop folder
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
79 echo "<td>".$trValue["full"]."</td>"; |
886f43b26ee2
move/remove develop folder
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
80 } else { |
886f43b26ee2
move/remove develop folder
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
81 echo "<td> </td>"; |
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 echo "</tr>"; |
886f43b26ee2
move/remove develop folder
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
84 } |
886f43b26ee2
move/remove develop folder
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
85 ?> |
886f43b26ee2
move/remove develop folder
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
86 </table> |
886f43b26ee2
move/remove develop folder
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
87 </body> |
886f43b26ee2
move/remove develop folder
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
88 </html> |