/
organizationLanding.php
97 lines (83 loc) · 2.62 KB
/
organizationLanding.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
<?php
include_once 'phpsqlsearch_dbinfo.php';
?>
<!DOCTYPE html>
<html lang="en" dir="ltr">
<head>
<meta charset="utf-8"/>
<link rel="stylesheet" href="styles.css" type="text/css"/>
<title> Organization Landing Page </title>
</head>
<body>
<?php
$organizationID = $_GET['id'];
//Connect to database
$link = mysql_connect($hostname, $username, $password);
//If connection fails
if(!$link){
die("Connection Error:".mysql_error());
}
$db_selected = mysql_select_db($database,$link);
?>
<div class="wrapper">
<header>
<img src="rsz_cmlogo.jpg"/>
<nav>
<ul>
<li><a href="landingPage.php">Home</a></li>
<?php
echo "<li><a href = 'organizationEdit.php?organizationID=".$organizationID."'>Edit Account</a></li>";
?>
</ul>
</nav>
</header>
</div>
<div class= "ticketbox">
<h1>Organization's Tickets</h1>
<table id="tickets">
<tr>
<th>Ticket ID</th>
<th>Donor First Name</th>
<th>Donor Last Name</th>
<th>Donor Email</th>
<th>Need Description</th>
<th>Need Type</th>
<th>Lattitude</th>
<th>Longitude</th>
<th>Donation Use</th>
<th>Donation Confirmed?</th>
<th>Email Sent?</th>
<th>Edit</th>
</tr>
<?php
$conn = new mysqli($hostname, $username, $password, $database)
or die('Cannot connect to database');
$result = $conn->query("SELECT ticket_status.id, ticket.firstName, ticket.lastName, ticket.email,
ticket.description, ticket.needType, ticket.lattitude, ticket.longitude, ticket_status.useDescription, ticket_status.status, ticket_status.emailSent
FROM ticket_status
INNER JOIN ticket ON ticket_status.ticketID = ticket.id
WHERE ticket_status.organizationID = '$organizationID' ");
while($row = mysqli_fetch_assoc($result)){
echo "<tr>";
echo "<td>".$row['id']."</td>";
echo "<td>".$row['firstName']."</td>";
echo "<td>".$row['lastName']."</td>";
echo "<td>".$row['email']."</td>";
echo "<td>".$row['description']."</td>";
echo "<td>".$row['needType']."</td>";
echo "<td>".$row['lattitude']."</td>";
echo "<td>".$row['longitude']."</td>";
echo "<td>".$row['useDescription']."</td>";
echo "<td>".$row['status']."</td>";
echo "<td>".$row['emailSent']."</td>";
echo "<td><a href = 'ticketEdit.php?ticketNumber=".$row['id']."&organizationID=".$organizationID."'>Edit</a></td>";
echo "</tr>";
}
?>
</table>
</div>
<footer>
<h3>Group 26 Project</h3>
</footer>
</body>
</html>