-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.php
159 lines (115 loc) · 4.54 KB
/
index.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
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
<!DOCTYPE html>
<html lang="en">
<?php
session_start();
$_SESSION['PrevPage'] = "index.php";
?>
<head>
<title>STARTSAW</title>
<meta charset="utf-8">
<!-- icon webpage ----------------------------------------->
<link rel="icon" href="favicon.ico" type="image" sizes="16x16">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="css/bootstrap.css"> <!-- aggiunto -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<link href="https://fonts.googleapis.com/css?family=Montserrat" rel="stylesheet" type="text/css">
<link href="https://fonts.googleapis.com/css?family=Lato" rel="stylesheet" type="text/css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
<link rel="stylesheet" href="https://www.w3schools.com/w3css/4/w3.css">
<link rel="stylesheet" media="all" href="css/footer.css" />
<link rel="stylesheet" media="all" href="css/common.css" />
<link rel="stylesheet" media="all" href="css/home.css" />
<script src="js/common.js"></script>
<!-- new message? sse utente è loggato-->
<?php
if(isset($_SESSION['username'])) {
echo '<script src="js/message_updates.js"></script>';
}
?>
</head>
<body id="myPage" data-spy="scroll" data-target=".navbar" data-offset="60">
<!-- NAVBAR ----------------------------------------->
<?php
require "navbar.php";
?>
<img src="img/hero.jpg" class="img-fluid" alt="Responsive image" id="hero">
<!-- Container (INTRO Section) ----------------------------------------->
<div class="container">
<h1 class="title text-center"><span style="color: #0052cc">Bookshare </span>makes reading easier.</h1>
<h3 class="text-center">How is that possible? By sharing your books that you don't use with other people you save money!</h3>
</div>
<!-- Container (GUIDE STEP-BY-STEP Section) ----------------------------------------->
<div class="row">
<a href="login.php" title="Click here to register" style="text-decoration:none">
<div class="col-sm-4" style="background-color: #49cc93;">
<h2>1. Register</h2>
<p>Find more of what you're looking for.</p>
</div>
</a>
<div class="col-sm-4" style="background-color: #0095cc;">
<h2>2. Chat or SHARE</h2>
<p>Connect with the world around you on STARTSAW.</p>
</div>
<div class="col-sm-4" style="background-color: #E74C3C;">
<h2>3. Save your money</h2>
<p>This is a simple way to save money.</p>
</div>
</div>
<!-- Container (ABOUT Section) ----------------------------------------->
<div id="about" class="container-fluid">
<div class="row">
<div class="col-sm-8">
<h2>About STARTSAW</h2><h3>"the best bookstores where you can find great deals on used books"</h3><br>
<h4>We've spent quite a bit of time on our search engine and really hope it will help you search for, refine, and find the title you want.
We give sellers the platform, solutions, and support they need to grow their businesses and thrive. We measure our success by our customers' success.
</h4>
</div>
<div class="col-sm-4">
<!-- immagine laterale libri -->
<img src="img/bstack.jpg" alt="Header" width="100%" height="100%">
</div>
</div>
</div>
<!-- Container (Last ad Added insertion Section) ----------------------------------------->
<div class="content">
<div class='advertisement'>
<h1 class="title" align="center">Last book added</h1>
</div>
<br>
<?php
require "db/mysql_credentials.php";
// Create connection
$conn = new mysqli($servername, $username, $password, $dbname);
//$conn = new mysqli("localhost", "root", "", "university_sharing");
// Check connection
if ($conn->connect_error) {
die("Connection failed: " . $conn->connect_error);
}
$sql = "SELECT * FROM book ORDER BY Id desc LIMIT 4 ";
$result = mySQLi_query($conn, $sql) or die("Error query");
while($row = mySQLi_fetch_array($result)){
echo
"
<div class='book-content' onclick='goToPageBook(".$row['ID'].");'>
<div class='cover'>
<img src='data:image/jpeg;base64,".base64_encode($row['Cover'])."' alt='cover'/>
</div>
<div class='description'>
<h3>".$row['Author']." - ".$row['Title']."</h3>
</div>
<div class='description'>
<p>".$row['Description']."</p>
</div>
</div>
<div class='separation-line'></div>
";
}
?>
</div>
<!-- FOOTER ----------------------------------------->
<?php
require "footer.php";
?>
</body>
</html>