-
Notifications
You must be signed in to change notification settings - Fork 0
/
synergyEvents.php
195 lines (142 loc) · 6.92 KB
/
synergyEvents.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
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
<?php
//------------------------------>> CENTRALIZED TECHFEST NAME WITH YEAR
require_once "config/techfestName.php";
//------------------------------>> DB CONFIG
require_once "config/configPDO.php";
//------------------------------>> START SESSION
session_start();
try {
$sql = "SELECT * FROM synergy_events_details";
$result = $conn->prepare($sql);
$result->execute();
} catch (PDOException $e) {
echo "<script>alert('We are sorry, there seems to be a problem with our systems. Please try again.');</script>";
# Development Purpose Error Only
echo "Error " . $e->getMessage();
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title><?php echo $culturalFestName ?> | EVENT REGISTRATION & INFORMATION</title>
<!-- Include Header Scripts -->
<?php include_once "includes/headerScripts.php";?>
</head>
<body>
<!--Include Navbar-->
<?php include_once "includes/navbar.php";?>
<?php
# Checking Record Counts
if ($result->rowCount() > 0) {
?>
<div class="container mt-5">
<h1 class="text-dark text-center text-uppercase mb-5 font-Staatliches-heading">Synergy Events</h1>
<?php if(empty($_SESSION["user"])){ ?>
<div class="text-center mb-5">
<h6 class="alert text-uppercase font-weight-bold alert-danger"><i class="fa fa-exclamation-triangle"></i> You are not logged in, Please Log in for event registration</h6>
</div>
<?php } ?>
<div class="row">
<?php
# Fetching Database Values
$i = 0;
while ($row = $result->fetch(PDO::FETCH_ASSOC)) {
$i++;
?>
<div class="col-md-4 mb-5">
<div class="card shadow text-center">
<!-- Event Image -->
<img src="images/eventImage/synergy/<?php echo $row['eventImage']; ?>" style="height:230px" class="img-fluid">
<!-- Event Name -->
<h5 class="text-uppercase font-time alert alert-info"><?php echo $row["eventName"]; ?></h5>
<!-- Event Prize -->
<h5 class="alert font-sans alert-warning mb-2">Event Prize ₹<?php echo $row["eventPrize"]; ?></h5>
<?php if(!empty($_SESSION['user'])){ ?>
<!-- Synergy Event Register -->
<form action="synergyEventRegister.php" method="post">
<div class="form-group">
<input type="hidden" name="hiddenEventName" value='<?php echo $row["eventName"]; ?>'>
<input class='btn btn-primary btn-block mb-2 rounded-pill text-uppercase' type="submit"
name="registerEvent" value="Register Here">
</div>
</form>
<?php } ?>
<!-- Open Modal -->
<button type='button' data-toggle="modal" data-target='#modal<?php echo $i; ?>' class='btn btn-secondary mb-3 rounded-pill
text-uppercase'>View Event Information</button>
</div>
</div>
<!--Modal Events -->
<div class="modal fade" id="modal<?php echo $i; ?>" tabindex="-1" role="dialog"
aria-labelledby="exampleModalCenterTitle" aria-hidden="true">
<div class="modal-dialog modal-dialog-centered modal-dialog-scrollable modal-lg" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="exampleModalCenterTitle">
<?php echo $row['eventName']; ?>
</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
</div>
<div class="modal-body">
<div class="container">
<div class="row">
<div class="col-md-12 modal1">
<!-- Event Prize -->
<h4
class="font-weight-bold text-center text-uppercase text-danger mb-5 animated heartBeat slow">
Prize: <?php echo $row['eventPrize']; ?></h4>
<!-- Event Description -->
<h4 class="font-weight-bold font-time text-info">Event Description</h4>
<p class="text-justify"><?php echo $row['eventDescription']; ?></p>
<!-- Event Rules -->
<h4 class="font-weight-bold font-time text-info">Event Rules</h4>
<p class="text-justify"><?php echo $row['eventRules']; ?></p>
<!-- Event Coordinators -->
<h4 class="font-weight-bold font-time text-info">Co-ordinators:-</h4>
<p><?php echo $row['eventCoordinator']; ?></p>
<!-- Event Start Date -->
<h4 class="font-weight-bold font-time text-info">Event Start Date</h4>
<p><?php echo $row['eventStartDate']; ?></p>
<!-- Event End Date -->
<h4 class="font-weight-bold font-time text-info">Event Date Date</h4>
<p><?php echo $row['eventEndDate']; ?></p>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary"
data-dismiss="modal">Close</button>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<!-- Modal End -->
<?php
}
} else {
echo "No Records Available in Database";
}
?>
</div>
</div>
<!-- Include Footer & Footer Scripts -->
<?php
include_once "includes/footer.php";
include_once "includes/footerScripts.php";
?>
<!-- Javascript -->
<script src="js/departmentEvent.js"></script>
<script>
if (window.history.replaceState) {
window.history.replaceState(null, null, window.location.href);
}
</script>
<!-- Close Database Connection -->
<?php $conn = null;?>
</body>
</html>