-
Notifications
You must be signed in to change notification settings - Fork 11
Expand file tree
/
Copy pathtitles_spreadsheet.php
More file actions
executable file
·109 lines (77 loc) · 2.1 KB
/
titles_spreadsheet.php
File metadata and controls
executable file
·109 lines (77 loc) · 2.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
<?php
include_once 'directory.php';
$titleArray = array();
$resourceType = $_GET['resourceType'];
if (isset($_GET['publisherPlatformID']) && ($_GET['publisherPlatformID'] != '')){
$publisherPlatformID = $_GET['publisherPlatformID'];
$platformID = '';
$obj = new PublisherPlatform(new NamedArguments(array('primaryKey' => $_GET['publisherPlatformID'])));
}else{
$platformID = $_GET['platformID'];
$publisherPlatformID = '';
$obj = new Platform(new NamedArguments(array('primaryKey' => $_GET['platformID'])));
}
$display_name = $obj->reportDisplayName;
$excelfile = $display_name . "_" . $resourceType . "_Titles";
$excelfile = str_replace (' ','_',$excelfile) . '.xls';
header("Content-type: application/vnd.ms-excel");
header("Content-Disposition: attachment; filename=" . $excelfile);
?>
<html>
<head>
</head>
<body>
<h2> <?php echo $display_name . " " . $resourceType; ?> Titles </h2>
<?php
if ($resourceType == "Journal"){
$titleArray = $obj->getJournalTitles;
}else if ($resourceType == "Book"){
$titleArray = $obj->getBookTitles;
}
?>
<table border='1'>
<tr>
<th>Title</th>
<?php if ($resourceType == "Journal"){ ?>
<th>DOI</th>
<th>Print ISSN</th>
<th>Online ISSN</th>
<?php } else if ($resourceType == "Book") {?>
<th>DOI</th>
<th>ISBN</th>
<th>ISSN</th>
<?php }
echo "</tr>";
if ($resourceType == "Journal"){
foreach($titleArray as $title) {
echo "\n<tr>";
echo "\n<td>" . $title['title'] . "</td>";
//get the first Identifier to use for the terms tool lookup
$doi = $title['doi'];
$issn = $title['issn'];
$eissn = $title['eissn'];
echo "\n<td>" . $doi . "</td>";
echo "\n<td>" . $issn . "</td>";
echo "\n<td>" . $eissn . "</td>";
echo "</tr>";
#end Title loop
}
}else{
foreach($titleArray as $title) {
echo "\n<tr>";
echo "\n<td>" . $title['title'] . "</td>";
//get the first Identifier to use for the terms tool lookup
$doi = $title['doi'];
$isbn = $title['isbn'];
$issn = $title['issn'];
echo "\n<td>" . $doi . "</td>";
echo "\n<td>'" . $isbn . "</td>";
echo "\n<td>" . $issn . "</td>";
echo "</tr>";
#end Title loop
}
}
?>
</table>
</body>
</html>