-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathshow_event - Copy.php
112 lines (102 loc) · 4.34 KB
/
show_event - Copy.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
<?php
include('header.php');
if (isset($_SESSION['ownerId'])) {
$type = "Owner";
$sid = $_SESSION['ownerId'];
} else if (isset($_SESSION['rentId'])) {
$type = "Rent";
$sid = $_SESSION['rentId'];
}
?>
<?php
$query = "select * from `tblevent` where `isApproved`=1 order by `event_id` desc";
$getquery = mysqli_query($conn, $query);
while ($row = mysqli_fetch_array($getquery)) {
$id = $row['event_id'];
$enddate = $row['end_date'];
$current = date("Y-m-d", time());
if ($current > $enddate) {
$query1 = "update tblevent set isApproved=2 where event_id=$id";
$getquery1 = mysqli_query($conn, $query1);
}
}
?>
<div class="container">
<h2 style="text-align: center;margin: 10px;">Event Dashboard</h2>
<br>
<!-- Nav pills -->
<div style="padding-left: 3%">
<ul class="nav nav-pills" role="tablist">
<li class="nav-item">
<a class="nav-link active" data-toggle="pill" href="#home1">General Events</a>
</li>
<li class="nav-item">
<a class="nav-link" data-toggle="pill" href="#past">Past Events <i class="material-icons">events</i></a>
</li>
</ul>
</div>
<!-- Tab panes -->
<div class="tab-content">
<!--General Events -->
<div id="home1" class="container tab-pane active"><br>
<?php
$query = "select * from `tblevent` where `isApproved`=1 order by `event_id` desc";
$getquery = mysqli_query($conn, $query);
while ($row = mysqli_fetch_array($getquery)) {
$oname = $row['name'];
$title = $row['event_name'];
$details = $row['desceiption'];
$date = $row['event_date'];
$enddate = $row['end_date'];
$id = $row['event_id'];
$location = $row['location'];
$strtime = $row['start_time'];
$endtime = $row['complete_time'];
$type1 = $row['type'];
?>
<div class="container">
<div class="jumbotron">
<div class="card-block">
<h2 class="card-title" style="color:black"> <?php echo $title; ?></h2>
<h4 class="card-text"><?php echo $oname; ?></h4>
<p class="card-text"><?php echo $location; ?></p>
<p class="card-text"><?php echo $details; ?></p>
<p class="card-text">Date: <b><?php echo $date ?></b> <b><?php echo $strtime ?></b> To <b><?php echo $enddate ?></b> <b><?php echo $endtime ?></b></p>
</div>
</div>
</div>
<?php
}
?>
</div>
<!--Past Events-->
<div id="past" class="container tab-pane fade"><br>
<?php
$query = "select * from `tblevent` where `isApproved`=2 order by `event_id` desc";
$getquery = mysqli_query($conn, $query);
while ($row = mysqli_fetch_array($getquery)) {
$oname = $row['name'];
$title = $row['event_name'];
$details = $row['desceiption'];
$date = $row['event_date'];
$enddate = $row['end_date'];
$id = $row['event_id'];
$location = $row['location'];
$type1 = $row['type'];
?>
<div class="container">
<div class="jumbotron">
<div class="card-block">
<h2 class="card-title" style="color:black"> <?php echo $title; ?></h2>
<h4 class="card-text"><?php echo $oname; ?></h4>
<p class="card-text"><?php echo $location; ?></p>
<p class="card-text"><?php echo $details; ?></p>
<p class="card-text">Date: <b><?php echo $date ?></b> <b><?php echo $strtime ?></b> To <b><?php echo $enddate ?></b> <b><?php echo $endtime ?></b></p>
<button type="button" class="btn btn-primary">View Photos</button>
</div>
</div>
</div>
<?php } ?>
</div>
</div>
</div>