-
Notifications
You must be signed in to change notification settings - Fork 0
/
departmentalEvents.php
217 lines (155 loc) · 8.11 KB
/
departmentalEvents.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
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
<?php
//------------------------------>> CENTRALIZED TECHFEST NAME WITH YEAR
require_once "config/techfestName.php";
//------------------------------>> DB CONFIG
require_once "config/configPDO.php";
//------------------------------>> START SESSION
session_start();
try {
if (isset($_POST["eventDepartmentName"])) {
$eventDepartmentName = htmlspecialchars($_POST["eventDepartmentName"]);
$_SESSION["eventDepartmentName"] = $eventDepartmentName;
$sql = "SELECT * FROM events_details_information WHERE eventDepartment = :eventDepartment";
$result = $conn->prepare($sql);
$result->bindValue(":eventDepartment", $_SESSION["eventDepartmentName"]);
$result->execute();
} else {
$sql = "SELECT * FROM events_details_information WHERE eventDepartment = :eventDepartment";
$result = $conn->prepare($sql);
$result->bindValue(":eventDepartment", $_SESSION["eventDepartmentName"]);
$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 $techfestName ?> | 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) {
?>
<!-- Promocode Response -->
<div id="responsePromocode"></div>
<div class="container mt-5">
<h1 class="text-info text-center text-uppercase mb-5 font-Staatliches-heading">
<?php echo $_SESSION["eventDepartmentName"]; ?> 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">
<img title="<?php echo $row["eventName"]; ?>" src="images/eventImage/<?php echo $row["eventImage"]; ?>" class="img-fluid">
<h5 class="text-danger my-3" id = "entryFee2<?php echo $row['id']; ?>">Entry Fee ₹<?php echo $row["eventPrice"]; ?></h5>
<?php if(!empty($_SESSION['user'])){ ?>
<div class="input-group my-3 px-2">
<input type="text" class="form-control" id='event<?php echo $row["id"]; ?>' />
<span class="input-group-btn">
<button class="btn btn-secondary applyPromocode" id ='<?php echo $row["id"]; ?>'
type="button">Apply Promocode</button>
</span>
</div>
<form method="post" action="Paytm/PaytmKit/TxnTest.php">
<input type="hidden" name="eventName" value='<?php echo $row["eventName"]; ?>'>
<input type="hidden" name="eventPrice" id = "entryFee3<?php echo $row['id']; ?>" value='<?php echo $row["eventPrice"]; ?>'>
<input type="submit" class="btn btn-primary text-uppercase btn-block mb-2 rounded-pill"
value="Click here to Register">
</form>
<?php } ?>
<button type='button' title='View Event Information' 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">Rules for
<?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">
<h4
class="font-weight-bold text-center text-uppercase text-danger animated heartBeat slow"
id= "entryFee<?php echo $row['id']; ?>">
Entry Fees: <?php echo $row['eventPrice']; ?></h4>
<h4
class="font-weight-bold text-center text-uppercase text-danger mb-5 animated heartBeat slow">
First Prize:<?php echo $row['eventPrize']; ?></h4>
<h4 class="font-weight-bold font-time text-info">Event Description</h4>
<p class="text-justify"><?php echo $row['eventDescription']; ?></p>
<h4 class="font-weight-bold font-time text-info">Event Rules</h4>
<p class="text-justify"><?php echo $row['eventRules']; ?></p>
<h4 class="font-weight-bold font-time text-info">Event Sponsor</h4>
<p class="text-justify"><?php echo $row['eventSponsor']; ?></p>
<h4 class="font-weight-bold font-time text-info">Co-ordinators:-</h4>
<p><?php echo $row['eventCoordinator']; ?></p>
<h4 class="font-weight-bold font-time text-info">Event Start Date</h4>
<p><?php echo $row['eventEndDate']; ?></p>
<h4 class="font-weight-bold font-time text-info">Event Date Date</h4>
<p><?php echo $row['eventStartDate']; ?></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>