Show sourcecode
The following files exists in this folder. Click to view.
bacon-egg-pizza.php
cquiz.php
create-account.php
create-account111.php
create-quiz.php
create-quiz2.php
createaccount.php
delete-quiz.php
drop-rps-tables.php
legacy-code-rps.php
legacy-index.php
login.php
logincheck.php
newpassword-verify.php
newpassword.php
potential-code.txt
quiz-db-init.php
quizhub.php
quizhub2.php
results.php
rpsaccount-ajax-user-search.php
rpsaccount.php
rpsbetting-ajax-match-finder.php
rpsbetting.php
rpsbettingleaderboard.php
rpschangepassword.php
rpschangepassword.txt
rpsgame-ajax.php
rpsgame.php
rpsgameresults.php
rpshostnewgame.php
rpshub.php
rpsleaderboard.php
rpslib.php
rpslogin.php
rpsmaininclude.php
rpsproject/
rpsusersearch.php
table-init.php
verification.php
rpsbetting-ajax-match-finder.php
68 lines UTF-8 Windows (CRLF)
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
<?php require('rpsmaininclude.php');
session_start();
ob_clean();
/*$sKey = $_GET['strInput'];
$sql = "SELECT * FROM rpsusers WHERE username LIKE '$sKey%' ORDER BY username";
$stmt = $dbconn->prepare($sql);
$stmt->execute();
$outputText = "";
while($res = $stmt->fetch(PDO::FETCH_ASSOC)){
$name = $res['username'];
$ratio = $res['ratio'];
if($name!=""){
$outputText .= '<a href="rpsaccount.php?user='.$name.'">'.$name.'</a>'." ".$ratio.'<br>';
}
}
echo $outputText;
*/
function getMatchesBettingVersionV2($dbconn,$userid) {
$sql = "SELECT
m.matchid,
m.player1id,
m.player2id,
m.isactive,
u1.userid AS p1id,
u1.username AS player1name,
u2.userid AS p2id,
u2.username AS player2name,
b.matchid AS bmid,
b.userid AS buid
FROM matches AS m
INNER JOIN rpsusers AS u1 ON m.player1id = u1.userid
INNER JOIN rpsusers AS u2 ON m.player2id = u2.userid
LEFT JOIN bets AS b on m.matchid = b.matchid";
$stmt = $dbconn->prepare($sql);
$stmt->execute();
while ($res = $stmt->fetch(PDO::FETCH_ASSOC)) {
if ($res['player1id'] != null && $res['player2id'] != null && $res['isactive'] == 1 && $userid!=$res['buid']) {
echo "<div>".
"<strong>".$res['player1name']." vs ".$res['player2name']."</strong><br>".
'<form action="" method="POST">'.
'<input type="radio" name="chosenplayer" value="'.$res['player1id'].'"> '.$res['player1name'].'<br>'.
'<input type="radio" name="chosenplayer" value="'.$res['player2id'].'"> '.$res['player2name'].'<br>'.
'<input type="number" name="betamount" placeholder="bettingmängd"><br>'.
'<input type="hidden" name="matchid" value="'.$res['matchid'].'">'.
'<button type="submit">betta</button>'.
'</form>'.
"</div><hr>";
}
else{
//echo "no matches";
}
}
}
if(isset($_GET['userid'])){
getMatchesBettingVersionV2($dbconn,$_GET['userid']);
}
else{
echo "no userid";
}
?>