-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathebook.php
105 lines (102 loc) · 3.99 KB
/
ebook.php
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
<?php
if(!isset($_GET['id']) || !is_numeric($_GET['id'])) {
header("Location: /");
}?>
<?php include("includes/session.php"); ?>
<?php include("includes/ebooks.php"); ?>
<?php include_once("templates/header.php"); ?>
<?php
$id = $_GET['id'];
$q = "SELECT * FROM " . TBL_BOOKS . " WHERE id='$id' and license > '0'";
$result = mysql_query($q, $database->connection);
$i = 0;
while($row = mysql_fetch_array($result)) {
if($i % 2) {
$selection_class = 'class="even"';
} else {
$selection_class = 'class="odd"';
}
$id = $row['id'];
$uid = $row['uid'];
$book_owner = $uid;
$title = $row['title'];
$subtitle = $row['subtitle'];
$description = $row['description'];
$author = $row['author'];
$book_image = '/img/placeholder_catalog_cover.png';
if($row['image'] != '') {
$time = time();
$book_image = '/books/' . $uid. '/uploads/cover_'.$id.'.jpg?'.$time;
}
$license = $row['license'];
$url = "/books/$book_owner/$id/Output";
switch($row['country']) {
case 0: $country = "*"; break;
case 1: $country = "Österreich"; break;
case 2: $country = "Deutschland"; break;
case 3: $country = "Schweiz"; break;
case 4: $country = "Liechtenstein"; break;
case 5: $country = "Andere"; break;
}
}
?>
<div id="content">
<h1><?php echo $title;?></h1>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td><img src="<?php echo $book_image;?>" style="width: 170px; height: auto;" /></td>
<td valign="top">
<p><?php echo $subtitle;?></p>
<p> </p>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="21%"><p><strong>Autor</strong></p>
<p><strong>Land</strong></p>
<p><strong>Kategorie</strong></p>
<p><strong>Zielgruppe</strong></p></td>
<td width="61%"><p><?php echo $author;?></p>
<p><?php echo $country;?></p>
<p> </p>
<p> </p>
</td>
<td width="9%"> </td>
<td width="9%"> </td>
</tr>
</table>
</td>
</tr>
</table>
<p> </p>
<p><?php echo $description;?></p>
<p> </p>
<div class="rahmen-reihe">
<a href="<?php echo $url;?>/ebook/book.epub" target="_blank"><div class="rahmen">
<div class="rahmen-loch-oben"></div><div class="rahmen-loch-unten"></div>
<div class="rahmen-content" style="min-width: 100px;"><p><strong>epub</strong></p></div>
</div></a>
<a href="<?php echo $url;?>/kindle/book.mobi" target="_blank"><div class="rahmen">
<div class="rahmen-loch-oben"></div><div class="rahmen-loch-unten"></div>
<div class="rahmen-content" style="min-width: 100px;"><p><strong>mobi</strong></p></div>
</div></a>
<a href="<?php echo $url;?>/print/book.pdf" target="_blank"><div class="rahmen">
<div class="rahmen-loch-oben"></div><div class="rahmen-loch-unten"></div>
<div class="rahmen-content" style="min-width: 100px;"><p><strong>PDF</strong></p></div>
</div></a>
<a href="<?php echo $url;?>/website/book.html" target="_blank"><div style="margin-right: 0;" class="rahmen">
<div class="rahmen-loch-oben"></div><div class="rahmen-loch-unten"></div>
<div class="rahmen-content" style="min-width: 100px;"><p><strong>html</strong></p></div>
</div></a>
</div>
<br><br>
<div class="rahmen-reihe">
<a href="#" onclick="history.go(-1);return false;"><div class="rahmen" style="float: right;">
<div class="rahmen-loch-oben"></div><div class="rahmen-loch-unten"></div>
<div class="rahmen-content" style="min-width: 100px;">
<p><strong>zurück zum Katalog</strong></p></div>
</div></a>
</div>
<p> </p>
</div>
<?php include_once("templates/footer.php"); ?>
</body>
</html>