-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathjournalDB.php
More file actions
106 lines (87 loc) · 1.95 KB
/
Copy pathjournalDB.php
File metadata and controls
106 lines (87 loc) · 1.95 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
<html>
<head>
<?php header('Access-Control-Allow-Origin: *'); ?>
</head>
<title>Keyes</title>
<link rel="stylesheet" type="text/css" href="css/itempages.css" />
<?php $keyesDB = new PDO('sqlite:keyes.db');
$result = "SELECT titleInfo_title, extension, recordInfo_recordIdentifier, subject_topic4 FROM JOURNAL";
$id = $_GET['item'];
$date = '';
$output ='';
$imageURL ='';
foreach($keyesDB->query($result) as $row)
{
if ($row['recordInfo_recordIdentifier']== $id)
{ $date = $row['titleInfo_title'];
$output =$row['extension'];
$imageURL = $row['subject_topic4'];
}
}
$keyesDB =null;
$prev = $id;
$next = $id;
if( $id == 1)
{
$prev = 47;
$next = 0;
}
elseif( $id == 47)
{
$next =1;
$prev = 46;
}
elseif( $id == 0)
{
$prev =1;
$next=2;
}
else
{
$next = ++$next;
$prev = --$prev;
}
$nextString = 'journalDB.php?item='.$next;
$prevString = 'journalDB.php?item='.$prev;
?>
</script>
<body>
<h1 style = " text-align: center;"><?php echo $date; ?></h1>
<section style = "background: #f9f6eb; width: 100%; ">
<br>
<div class ="row">
<div class = "column" style = "width:2%">
</div>
<div class = "column" style = "width:96%">
<hr>
</div>
<div class = "column" style = "width:2%">
</div>
<div class="row">
<div class="column">
<img src = 'images/<?php echo $imageURL ?>' alt = 'Keyes Photograph' class="center">
</div>
<div class="column" style ="background:#f9f6eb;" >
<?php
echo $output."<br>";
?>
</div>
</div>
<div class = "column" style = "width:2%">
</div>
<div class = "column" style = "width:96%">
<hr>
</div>
<div class = "column" style = "width:2%">
</div>
<div class = "row">
<div class = "column" style = "width:2%"></div>
<div class = "column" style = "width:96%">
<a href = <?php echo $prevString; ?> > previous entry </a>
<a href = "keyesIndex.php">Back to contents page </a>
<a href =<?php echo $nextString; ?> > next entry </a>
</div>
</div>
</section>
</body>
</html>