-
Notifications
You must be signed in to change notification settings - Fork 1
/
main.php
87 lines (86 loc) · 2.03 KB
/
main.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
<?php
include "db_connect.php";
include "menu.php";
?>
<div class=content>
<h2>Patches & Incentives</h2>
<table>
<tr>
<td>1-149 Boxes Sold</td>
<td>Participation Patch</td>
</tr>
<tr>
<td>150-169 Boxes Sold</td>
<td>150+ patch & Giraffe</td>
</tr>
<tr>
<td>170+ Boxes Sold</td>
<td>Super Seller Patch & Giraffe & Travel Case</td>
</tr>
<tr>
<td>500+ Boxes Sold</td>
<td>Super Seller Patch & Giraffe & Travel Case & Pop Art Tote</td>
</tr>
<tr>
<td>2 Booth Sales</td>
<td>Booth Sale Patch</td>
</tr>
<tr>
<td>Gift of Caring Donation</td>
<td>Gift of Caring Patch</td>
</tr>
</table>
<br/>
<br/>
<h2>Events</h2>
<html>
<head>
<title>Troop Manager Home</title>
</head>
<body>
<?php
$query = "SELECT * FROM attending WHERE girlId = (SELECT girlId FROM users WHERE email='$e');";
$attending = Array();
$result = mysqli_query($db,$query);
while($row = mysqli_fetch_array($result))
{
$attending[] = $row["eventId"];
}
$query = "SELECT name,description,DATE_FORMAT(dateOfEvent,'%m/%d') as dateOfEvent,TIME_FORMAT(timeOfEvent,'%l:%i') as timeOfEvent,eventId FROM events WHERE name <>'Booth Sale' AND DATEDIFF(dateOfEvent,CURRENT_DATE()) > 0;";
$result = mysqli_query($db,$query);
echo "<form action='mainController.php'>";
echo "<table>";
$row = Array("name" => "<b>Name</b>","description"=>"<b>Description</b>","attending"=>"Attend?", "dateOfEvent"=>"<b>Date</b>", "timeOfEvent"=>"<b>Time</b>");
do
{
echo "<tr>";
echo "<td>".$row["name"]."</td>";
echo "<td>".$row["description"]."</td>";
echo "<td>".$row["dateOfEvent"]." </td>";
echo "<td>".$row["timeOfEvent"]."</td>";
if($row["attending"] != "")
{
echo "<td>".$row["attending"]."</td>";
}
else
{
$eid = $row["eventId"];
echo "<td>";
echo "<input type='checkbox' name='$eid'";
if(in_array($row["eventId"],$attending))
{
echo "checked";
}
echo ">";
echo "</td>";
}
echo "</tr>";
}
while($row = mysqli_fetch_array($result));
echo "</form>";
?>
</table>
<input type="submit" value="Attending?">
</div>
</body>
</html>