-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathNewBooksTable.php
More file actions
111 lines (83 loc) · 3.25 KB
/
NewBooksTable.php
File metadata and controls
111 lines (83 loc) · 3.25 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
110
111
<?php
$no = $_GET['no'];
$no = filter_var ( $no, FILTER_SANITIZE_STRING);
$alma_analytics_result_array = simplexml_load_file($no.'_books.xml');
//The above line will pull in the xml file based on how the current URL is strucutured (e.g. "NewBooksTable.php?no=a").
$rowset = $alma_analytics_result_array->QueryResult->ResultXml->rowset;
/* build parameter for each value in the analytics results */
$i=0;
?>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<link rel="stylesheet" type="text/css" href="//netdna.bootstrapcdn.com/bootstrap/3.0.3/css/bootstrap.min.css">
<link rel="stylesheet" type="text/css" href="//cdn.datatables.net/plug-ins/28e7751dbec/integration/bootstrap/3/dataTables.bootstrap.css">
<script type="text/javascript" language="javascript" src="//code.jquery.com/jquery-1.10.2.min.js"></script>
<script type="text/javascript" language="javascript" src="//cdn.datatables.net/1.10-dev/js/jquery.dataTables.min.js"></script>
<script type="text/javascript" language="javascript" src="//cdn.datatables.net/plug-ins/28e7751dbec/integration/bootstrap/3/dataTables.bootstrap.js"></script>
<script type="text/javascript" charset="utf-8">
$(document).ready(function() {
$('#useStats').dataTable({
"aaSorting": [[ 0, "desc" ]],
"iDisplayLength": 100,
});
} );
</script>
</head>
<title>New Books at SDSU</title>
<body>
<div class="container">
<table id="useStats" class="display" cellspacing="0" width="100%">
<thead>
<tr>
<th>Date Added</th>
<th>Title (Link)</th>
<th>Call Number</th>
<th>Location</th>
</tr>
</thead>
<tbody>
<?php
foreach ($rowset->Row as $row_number){
echo "<tr>";
$col5_name[$i] = $row_number->Column5->__toString();
echo '<td>';
echo $col5_name[$i];
echo '</td>';
echo '<td>';
echo '<img src="https://books.google.com/books?vid=OCLC:';
$col8_name[$i] = $row_number->Column8->__toString();
//$imageoclc[$i] = str_replace('(OCoLC)', '', $col8_name[$i]);
//*The (OCoLC) prefix must be removed from the OCLC field in order for the Google Books Covers to Show *//
$imageoclc[$i] = preg_replace('/[^0-9]/', '', $col8_name[$i]);
echo $imageoclc[$i];
echo '&printsec=frontcover&img=1&zoom=1"></img> ';
echo '<div><h2>';
echo '<a href="https://sdsu-primo.hosted.exlibrisgroup.com/primo-explore/search?query=any,contains,';
$col1_name[$i] = $row_number->Column1->__toString();
echo $col1_name[$i];
echo '&context=L&vid=01CALS_SDL&search_scope=EVERYTHING&tab=everything&lang=en_US" target="_blank">';
$col2_name[$i] = $row_number->Column2->__toString();
echo $col2_name[$i];
echo '</a></h2></div></td>';
$col4_name[$i] = $row_number->Column4->__toString();
echo '<td>';
echo $col4_name[$i];
echo '</td>';
echo '<td>';
$col7_name[$i] = $row_number->Column7->__toString();
echo $col7_name[$i];
echo '</td>';
echo '</tr>';
$i++;
}
?>
</tbody>
</table>
</div>
<script type="text/javascript">
// For demo to fit into DataTables site builder...
$('#useStats')
.removeClass( 'display' )
.addClass('table table-striped table-bordered');
</script>
</body>