-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmywager.php
More file actions
92 lines (88 loc) · 1.73 KB
/
Copy pathmywager.php
File metadata and controls
92 lines (88 loc) · 1.73 KB
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
<?php include 'controllers/authController.php'?>
<?php require 'head.php'; ?>
<!DOCTYPE html>
<html>
<head>
<style>
table {
border: 1px solid black;
width: 80%;
color: #588c7e;
font-family: monospace;
font-size: 25px;
text-align: left;
}
th {
background-color: #588c7e;
color: white;
}
tr:nth-child(even) {background-color: #f2f2f2}
ul{
margin: 0px;
padding: 0px;
list-style: none;
}
ul li{
float: right;
width: 200px;
height: 40px;
line-height: 40px;
text-align: center;
font-size: 20px;
}
ul li a{
text-decoration: none;
color: black;
display: block;
}
.h2{
position: absolute;
}
</style>
<title> wagers </title>
</head>
<body>
<ul>
<li><a href="index.php">home</a></li>
<li><a href="wageresult.php">submit result</a></li>
<li><a href="win.php">winnings</a></li>
</ul>
<table>
<h2>my wagers</h2>
<tr>
<th>id</th>
<th> post id</th>
<th>creator</th>
<th>game</th>
<th>amount</th>
<th>opponent</th>
<th>pot</th>
<?php
$conn = new mysqli('localhost','root','','user-verification');
if($conn-> connect_error){
die("connection failed:". $conn-> connect_error);
}
$username=$_SESSION['username'];
$sql = "SELECT*FROM accepted
WHERE creator='$username' OR opponent='$username'";
$result = $conn-> query($sql) or die($conn->error);
if($result-> num_rows> 0){
while($row = $result-> fetch_assoc()){
echo"<tr>
<td>". $row["id"]."</td>
<td>". $row["postid"]."</td>
<td>". $row["creator"]."</td>
<td>". $row["game"]."</td>
<td>". $row["amount"]."</td>
<td>". $row["opponent"]."</td>
<td>". $row["pot"]."</td>
</tr>";
}
echo "</table>";
}
else{
echo "0 result";
}
$conn-> close();
?>
</table>