-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathloadevents.php
76 lines (61 loc) · 1.87 KB
/
loadevents.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
<?php
include("connection.php");
$q=mysqli_query($conn,"select * from events ORDER BY addedat DESC");
$r=mysqli_num_rows($q);
if(!$r)
{
echo "<h2 style='color:red'>No any Notice found in this query !!!</h2>";
}
else{
?>
<table class="table table-striped table-hover">
<thead>
<tr class="success">
<th> serial no. </th>
<th>Organiser</th>
<th>When</th>
<th>Offer</th>
<th>Where</th>
<th>Added By</th>
<th>Interseted:</th>
<th>Going:</th>
</tr>
</thead>
<tbody>
<?php
$i=1;
session_start();
$user=$_SESSION['user'];
while($row=mysqli_fetch_assoc($q)){
echo "<Tr>";
echo "<td>".$i."</td>";
echo "<td>".$row['organiser']."</td>";
echo "<td>".$row['time']."</td>";
echo "<td>".$row['offer']."</td>";
echo "<td>".$row['place']."</td>";
echo "<td>".$row['addedby']."</td>";
$event=$row['id'];
$q1=mysqli_query($conn,"select * from attendevent where eventid='$event'");
$r1=mysqli_num_rows($q1);
echo "<td>".$r1."</td>";
$q2=mysqli_query($conn,"select * from attendevent where eventid='$event' and semail='$user'");
$r2=mysqli_num_rows($q2);
if($r2==0){
?>
<Td>
<a type="brt" href="javascript:Approve('<?php echo $row['id']; ?>')" style='color:green'>
<button id="my_button" class="btn"><span class='glyphicon glyphicon-ok-circle'></span></button></a>
<?php } else{ ?>
<Td>
<a type="brt" href="javascript:disapprove('<?php echo $row['id']; ?>')" style='color:green'>
<button id="my_button" class="btn"><span class='glyphicon glyphicon-remove'></span></button></a>
<?php } ?>
</td>
<?php
echo "</Tr>";
$i++;
?>
</tbody>
<?php } ?>
</table>
<?php } ?>