-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathrecord.php
More file actions
37 lines (29 loc) · 806 Bytes
/
record.php
File metadata and controls
37 lines (29 loc) · 806 Bytes
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
<?php
include('app/app.php');
include('rest/EBSCOAPI.php');
$api = new EBSCOAPI();
$db = $_REQUEST['db'];
$an = $_REQUEST['an'];
$highlight = $_REQUEST['highlight'];
$highlight = str_replace(array(" ","&","-"), array(",",",",","), $highlight);
$result = $api->apiRetrieve($an, $db, $highlight);
$debug = isset($_REQUEST['debug'])? $_REQUEST['debug']:'';
// Set error
if (isset($result['error'])) {
$error = $result['error'];
} else {
$error = null;
}
//save debug into session
if($debug == 'y'||$debug == 'n'){
$_SESSION['debug'] = $debug;
}
// Variables used in view
$variables = array(
'result' => $result,
'error' => $error,
'id' => 'record',
'debug' => isset($_SESSION['debug'])? $_SESSION['debug']:''
);
render('record.html', 'layout.html', $variables);
?>