-
Notifications
You must be signed in to change notification settings - Fork 0
/
viewProfile.php
84 lines (64 loc) · 2.62 KB
/
viewProfile.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
<?php
//attach user id with name search
include 'db.php';
$nameSearched = $_SERVER["QUERY_STRING"];
$new = str_replace("%20", " ", $nameSearched);
$nameArr = explode(" ", $new);
$first = $nameArr[0];
$last = $nameArr[1];
$uid = $nameArr[2];
$sql = "SELECT * FROM stats ORDER BY Id DESC";
$query = $pdo->prepare($sql);
$query->execute();
?>
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" type="text/css" href="table.css" />
</head>
<body>
<div class="form">
<h1><?= $first.' '.$last ?>'s Statistics</h1>
<p>
<?php
// Display message about account verification link only once
if ( isset($_SESSION['message']) )
{
echo $_SESSION['message'];
// Don't annoy the user with more messages upon page refresh
unset( $_SESSION['message'] );
}
?>
</p>
<p><?= 'User id: '.$uid ?></p>
</div>
<a href="searchMembers.php?<?php echo $uid;?>"><button class="searchBtn" name="search">Request as Friend</button></a>
</body>
</html>
<?php
echo "<table>";
echo "<tr>";
echo "<th>Golf Course</th>";
echo "<th>Score</th>";
echo "<th>Fairways</th>";
echo "<th>GIR's</th>";
echo "<th>Sand Saves</th>";
echo "<th>Up & Downs</th>";
echo "<th>Putts</th>";
while ($row = $query->fetch(PDO::FETCH_ASSOC)) {
if ($uid == $row['uid']) {
echo "<tr>";
echo "<td class=\"data\">"; ?><div class="golfcourse" id="golfcourse<?php echo $row["id"]; ?>"> <?php echo $row['golfcourse']; ?> </div> <?php echo "</td>";
echo "<td class=\"data\">"; ?><div class="score" id="score<?php echo $row["id"]; ?>"> <?php echo $row['score']; ?> </div> <?php echo "</td>";
echo "<td class=\"data\">"; ?><div class="fairways" id="fairways<?php echo $row["id"]; ?>"> <?php echo $row['fairways']; ?> </div> <?php echo "</td>";
echo "<td class=\"data\">"; ?><div class="gir" id="gir<?php echo $row["id"]; ?>"> <?php echo $row['gir']; ?> </div> <?php echo "</td>";
echo "<td class=\"data\">"; ?><div class="sandsaves" id="sandsaves<?php echo $row["id"]; ?>"> <?php echo $row['sandsaves']; ?> </div> <?php echo "</td>";
echo "<td class=\"data\">"; ?><div class="upanddowns" id="upanddowns<?php echo $row["id"]; ?>"> <?php echo $row['upanddowns']; ?> </div> <?php echo "</td>";
echo "<td class=\"data\">"; ?><div class="putts" id="putts<?php echo $row["id"]; ?>"> <?php echo $row['putts']; ?> <?php echo "</td>";
echo "<td>"; ?>
<?php echo "</td>";
echo "<tr>";
}
}
echo "</table>";
?>