Mercurial > hg > extraction-interface
comparison views/Extractapp/ExportTabDelimited.php @ 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 | b0cecc104639 |
| children |
comparison
equal
deleted
inserted
replaced
| 115:507070df62e6 | 116:0ef426b5a1b9 |
|---|---|
| 14 * GNU General Public License for more details. | 14 * GNU General Public License for more details. |
| 15 * | 15 * |
| 16 * You should have received a copy of the GNU General Public License | 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/>. | 17 * along with Extraction-interface. If not, see <http://www.gnu.org/licenses/>. |
| 18 */ | 18 */ |
| 19 /*! \file | 19 /*! \file |
| 20 * This is the view for ExportTabDelimited. | 20 * This is the view for ExportTabDelimited. |
| 21 */ | 21 */ |
| 22 | 22 |
| 23 // --- initialize --- | 23 // --- initialize --- |
| 24 $outputTableArray = $viewmodel['outputTableArray']; | 24 $outputTableArray = $viewmodel['outputTableArray']; |
| 30 | 30 |
| 31 | 31 |
| 32 | 32 |
| 33 $count=1; | 33 $count=1; |
| 34 foreach ( $outputTableArray as $trIndex =>$trValue ) { | 34 foreach ( $outputTableArray as $trIndex =>$trValue ) { |
| 35 | 35 |
| 36 if ( $trIndex==0 ) { | 36 if ( $trIndex==0 ) { |
| 37 echo "#\t"; | 37 echo ","; |
| 38 echo "Book ID\t"; | 38 echo "Book ID,"; |
| 39 echo "Section ID\t"; | 39 echo "Section ID,"; |
| 40 echo "Name\t"; | 40 echo "Book Name,"; |
| 41 echo "部\t"; | 41 echo "Section Name,"; |
| 42 echo "Address\t"; | 42 echo "Book Year,"; |
| 43 echo "Longitude\t"; // longitude | 43 echo "Edition Year,"; |
| 44 echo "Latitude\t"; // latitude | 44 echo "Addres,"; |
| 45 echo "Description\t"; // description | 45 echo "Longitude,"; // longitude |
| 46 echo "Latitude,"; // latitude | |
| 47 echo "Description,"; // description | |
| 46 | 48 |
| 47 } else { | 49 } else { |
| 48 echo $count++."\t"; | 50 echo $count++.","; |
| 49 echo $bookId."\t"; | 51 echo $bookId.","; |
| 50 echo $sectionid."\t"; | 52 echo $sectionid.","; |
| 51 echo $bookName."\t"; | 53 echo $bookName.","; |
| 52 echo $sectionName."\t"; | 54 echo $sectionName.","; |
| 53 echo $bookMeta->place_name."\t"; | 55 echo $bookMeta->book_year.","; |
| 54 echo $bookMeta->x."\t"; | 56 echo $bookMeta->edition_year.","; |
| 55 echo $bookMeta->y."\t"; | 57 echo $bookMeta->place_name.","; |
| 56 echo $bookName."_".$sectionName."\t"; // description for LGMap | 58 echo $bookMeta->x.","; |
| 57 | 59 echo $bookMeta->y.","; |
| 60 echo $bookName."_".$sectionName.","; // description for LGMap | |
| 61 | |
| 58 } | 62 } |
| 59 if ( isset( $trValue["page"] ) ) { | 63 if ( isset( $trValue["page"] ) ) { |
| 60 echo $trValue["page"]."\t"; | 64 echo $trValue["page"].","; |
| 61 } else { | 65 } else { |
| 62 echo "\t"; | 66 echo ","; |
| 63 } | 67 } |
| 64 | 68 |
| 65 foreach ( $outputTableArray[0][0] as $index => $value ) { | 69 foreach ( $outputTableArray[0][0] as $index => $value ) { |
| 66 if ( $index == "time" ) { | 70 if ( $index == "time" ) { |
| 67 if ( isset( $trValue[0][$index] ) ) { | 71 if ( isset( $trValue[0][$index] ) ) { |
| 68 echo $trValue[0][$index]."\t"; | 72 echo $trValue[0][$index].","; |
| 69 echo $trValue[0][$index]."\t"; | 73 echo $trValue[0][$index].","; |
| 70 } else { | 74 } else { |
| 71 echo "\t"; | 75 echo ","; |
| 72 echo "\t"; | 76 echo ","; |
| 73 } | 77 } |
| 74 } else { | 78 } else { |
| 75 if ( isset( $trValue[0][$index] ) ) { | 79 if ( isset( $trValue[0][$index] ) ) { |
| 76 echo $trValue[0][$index]."\t"; | 80 echo $trValue[0][$index].","; |
| 77 } else { | 81 } else { |
| 78 echo "\t"; | 82 echo ","; |
| 79 } | 83 } |
| 80 } | 84 } |
| 81 } | 85 } |
| 82 if ( isset( $trValue["other"] ) ) { | 86 if ( isset( $trValue["other"] ) ) { |
| 83 echo $trValue["other"]."\t"; | 87 echo $trValue["other"].","; |
| 84 } else { | 88 } else { |
| 85 echo "\t"; | 89 echo ","; |
| 86 } | 90 } |
| 87 if ( isset( $trValue["full"] ) ) { | 91 if ( isset( $trValue["full"] ) ) { |
| 88 echo $trValue["full"]."\t"; | 92 echo $trValue["full"].","; |
| 89 } else { | 93 } else { |
| 90 echo "\t"; | 94 echo ","; |
| 91 } | 95 } |
| 92 echo "\n"; | 96 echo "\n"; |
| 93 } | 97 } |
| 94 | 98 |
| 95 ?> | 99 ?> |
| 96 |
