-
Notifications
You must be signed in to change notification settings - Fork 0
/
upcoming_events.php
94 lines (74 loc) · 3.2 KB
/
upcoming_events.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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Upcoming Events</title>
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Blinker:wght@300&display=swap" rel="stylesheet">
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Bruno+Ace+SC&family=Chakra+Petch:wght@300&display=swap"
rel="stylesheet">
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Bree+Serif&display=swap" rel="stylesheet">
<link rel="stylesheet" href="events.css">
<link rel="stylesheet" href="footer_styling.css">
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.0.13/css/all.css" integrity="sha384-DNOHZ68U8hZfKXOrtjWvjxusGo9WQnrNx2sqG0tfsghAvtVlRW3tvkXWZh58N9jp" crossorigin="anonymous">
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.0.13/css/all.css"
integrity="sha384-DNOHZ68U8hZfKXOrtjWvjxusGo9WQnrNx2sqG0tfsghAvtVlRW3tvkXWZh58N9jp" crossorigin="anonymous">
<body>
<?php
require_once('header.php');
?>
<br><br><br>
<div class="comppage">
<h1 class="blogtitle" id="heading">UPCOMING EVENTS</h1>
<section class="contentcontainer">
<?php
//making connection with the database
$servername = "localhost";
$username = "root";
$password = "";
$database = "events";
$conn = mysqli_connect($servername, $username, $password, $database);
if ($conn) {
// reading entries from events database
$sql = "SELECT * FROM `events`";
$result = mysqli_query($conn, $sql);
//Initializing the count
$i = 0;
//counting total blogs
$num = mysqli_num_rows($result);
if ($result) {
if ($num > 0) {
while($row = mysqli_fetch_assoc($result)) {
$i++;
if ($row['type'] == "u"){
echo '
<a href="./eventpage.php?sno='.$i.'">
<div class="anevent">
<div class="subheading">'.$row['event_name'].'</div>
<div class="date">'.$row['date_and_venue'].'</div>
<br><div class="read">'.substr($row['content'],0,141)."...".'</div>
</div>
</a>
';
}
}
}
}
}
else {
die("connection with events database was unsuccessful : ".mysqli_connect_error());
}
echo'</div>';
?>
</section>
<?php
require_once('footer.php');
?>
</body>
</html>