-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
19 changed files
with
279 additions
and
86 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,55 +1,134 @@ | ||
<?php | ||
include_once('src/db.php'); | ||
|
||
$body = ""; | ||
|
||
$win = 0; | ||
|
||
$query = $db->prepare('SELECT * FROM coinflip WHERE win = ?'); | ||
$query->bind_param('i', $win); | ||
$query = $db->prepare('SELECT * FROM coinflip'); | ||
|
||
$query->execute(); | ||
$result = $query->get_result(); | ||
if($result->num_rows) { | ||
$body = ""; | ||
while ($row = $result->fetch_assoc()) { | ||
$gameid = $row['ID']; | ||
$player1 = $row['player1']; | ||
$player2 = $row['player2']; | ||
$bet = $row['bet']; | ||
$reward = $row['reward']; | ||
$hash = $row['hash']; | ||
|
||
if($player1 == "") | ||
$players = "Steem - <a href=\"#\" onClick=\"MyWindow=window.open('confirmcoinflip.php?game=".$gameid."','MyWindow',width=600,height=300); return false;\">Enter game</a><br>Bitcoin - ".$player2; | ||
else if($player2 == "") | ||
$players = "Steem - ".$player1."<br>Bitcoin - <a href=\"#\" onClick=\"MyWindow=window.open('confirmcoinflip.php?game=".$gameid."','MyWindow',width=600,height=300); return false;\">Enter game</a>"; | ||
else | ||
$players = $player1."<br>".$player2."<br><a href=\"#\">View game</a>"; | ||
|
||
$body .= " | ||
<div> | ||
<h1>Game #".$gameid."</h1> | ||
<h3>Players<br>".$players."<br><br> | ||
Bet: ".$bet." SBD (Reward:".$reward." SBD)<br><a href=\"#\" onClick=\"MyWindow=window.open('hash.php?hash=".$hash."','MyWindow',width=600,height=300); return false;\"> | ||
See hash | ||
</a> | ||
</div> | ||
"; | ||
if(!isset($_GET['past'])) { | ||
$past = 0; | ||
if($result->num_rows) { | ||
while ($row = $result->fetch_assoc()) { | ||
$timestamp = $row['timestamp']; | ||
$timestamper = time() - $timestamp; | ||
if($timestamp == 0) { | ||
$gameid = $row['ID']; | ||
$player1 = $row['player1']; | ||
$player2 = $row['player2']; | ||
$bet = $row['bet']; | ||
$reward = $row['reward']; | ||
$hash = $row['hash']; | ||
|
||
if($player1 == "") | ||
$players = "Steem - <a href=\"#\" onClick=\"MyWindow=window.open('confirmcoinflip.php?game=".$gameid."','MyWindow',width=600,height=300); return false;\">Enter game</a><br>Bitcoin - ".$player2; | ||
else | ||
$players = "Steem - ".$player1."<br>Bitcoin - <a href=\"#\" onClick=\"MyWindow=window.open('confirmcoinflip.php?game=".$gameid."','MyWindow',width=600,height=300); return false;\">Enter game</a>"; | ||
|
||
$body .= " | ||
<div style=\"display:inline;float:left;padding-left:10px\"><center> | ||
<h3>Game #".$gameid."</h3> | ||
<h4>Players<br>".$players."<br><br> | ||
Bet: ".$bet." SBD <br><br><a href=\"#\" onClick=\"MyWindow=window.open('hash.php?hash=".$hash."','MyWindow',width=600,height=300); return false;\"> | ||
See hash | ||
</a></center> | ||
</div> | ||
"; | ||
} else if($timestamper <= 60) { | ||
$gameid = $row['ID']; | ||
$player1 = $row['player1']; | ||
$player2 = $row['player2']; | ||
$bet = $row['bet']; | ||
$reward = $row['reward']; | ||
$hash = $row['hash']; | ||
$secret = $row['secret']; | ||
|
||
$win = $row['win']; | ||
|
||
if($win == 1) | ||
$winner = $player1; | ||
else | ||
$winner = $player2; | ||
|
||
$players = $player1."<br>".$player2."<br><a href=\"#\" onClick=\"MyWindow=window.open('viewcoinflipgame.php?gameid=".$gameid."&player1=".$player1."&player2=".$player2."&bet=".$bet."&reward=".$reward."&hash=".$hash."&secret=".$secret."','MyWindow',width=600,height=300); return false;\">View game</a>"; | ||
|
||
$body .= " | ||
<div style=\"display:inline;float:left;padding-left:10px;\"><center> | ||
<h3>Game #".$gameid."</h3> | ||
<h4>Players<br>".$players."<br> | ||
Jackpot: ".$reward." SBD | ||
<br><br><a href=\"#\" onClick=\"MyWindow=window.open('hash.php?hash=".$hash."&secret=".$secret."','MyWindow',width=600,height=300); return false;\"> | ||
See hash and secret | ||
</a></center> | ||
</div> | ||
"; | ||
} | ||
} | ||
} else { | ||
$body = "<br><center><h1 style=\"color:red\">No games avalabile.</h1></center>"; | ||
} | ||
} else { | ||
$body = "<h1 style=\"color:red\">No games avalabile.</h1>"; | ||
} | ||
else { | ||
$past=1; | ||
if($result->num_rows) { | ||
if($result->num_rows) { | ||
while ($row = $result->fetch_assoc()) { | ||
$gameid = $row['ID']; | ||
$player1 = $row['player1']; | ||
$player2 = $row['player2']; | ||
$bet = $row['bet']; | ||
$reward = $row['reward']; | ||
$hash = $row['hash']; | ||
$secret = $row['secret']; | ||
|
||
$win = $row['win']; | ||
|
||
if($win == 0) | ||
continue; | ||
|
||
if($win == 1) | ||
$winner = $player1; | ||
else | ||
$winner = $player2; | ||
|
||
$players = $player1."<br>".$player2."<br><a href=\"#\" onClick=\"MyWindow=window.open('viewcoinflipgame.php?gameid=".$gameid."&player1=".$player1."&player2=".$player2."&bet=".$bet."&reward=".$reward."&hash=".$hash."&secret=".$secret."','MyWindow',width=600,height=300); return false;\">View game</a>"; | ||
|
||
$body = " | ||
<div style=\"display:inline;float:left;padding-left:10px;\"><center> | ||
<h3>Game #".$gameid."</h3> | ||
<h4>Players<br>".$players."<br> | ||
Jackpot: ".$reward." SBD | ||
<br>Winner: ".$winner."<br><a href=\"#\" onClick=\"MyWindow=window.open('hash.php?hash=".$hash."&secret=".$secret."','MyWindow',width=600,height=300); return false;\"> | ||
See hash and secret | ||
</a></center> | ||
</div>".$body; | ||
} | ||
} | ||
} | ||
else { | ||
$body = "<br><center><h1 style=\"color:red\">No game history avalabile.</h1></center>"; | ||
} | ||
} | ||
|
||
$page = $_SERVER['PHP_SELF']; | ||
$secrefresh = "30"; | ||
?> | ||
|
||
<html> | ||
<head> | ||
<?php include('src/head.php'); ?> | ||
<meta http-equiv="refresh" content="<?php echo $secrefresh?>;URL='<?php echo $page?><?php if($past == 1) echo "?past=1";?>'"> | ||
</head> | ||
<body> | ||
<?php include('navbar.php'); ?> | ||
<div> | ||
<center><h1 style="display:inline">Coinflip </h1><b><a href="games.php" style="display:inline;text-decoration:none;color:black;">(Go back)</a></b></center> | ||
<center><a href="#" style="text-decoration:none;color:black;font-size:24px" onClick="MyWindow=window.open('coinflipaction.php?action=newgame','MyWindow',width=600,height=300); return false;">Start new game</a></center> | ||
<center><?php echo $body; ?></center> | ||
<center><a href="#" style="text-decoration:none;color:black;font-size:24px" onClick="MyWindow=window.open('coinflipaction.php?action=newgame','MyWindow',width=600,height=300); return false;">Start new game </a> | <a href="<?php if($past == 1) echo "coinflip.php"; else echo "?past=1";?>" style="text-decoration:none;color:black;font-size:20px"> <?php if($past == 1) echo "See avalabile games"; else echo "See games that ended"; ?></a></center> | ||
<?php echo $body; ?> | ||
</div> | ||
<?php include('src/footer.php'); ?> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
<html> | ||
<head> | ||
<?php include('src/head.php'); ?> | ||
</head> | ||
<body> | ||
<?php include('navbar.php'); ?> | ||
<div> | ||
<center><h1>Credits</h1> | ||
<h3><a href="steemit.com/@andreistalker">andreistalker</a> - Developer</h3> | ||
</center> | ||
</div> | ||
<?php include('src/footer.php'); ?> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,6 @@ | ||
<?php | ||
echo "<p style=\"word-wrap: break-word\">".$_GET['hash']."</p>"; | ||
echo "Hash :<p style=\"word-wrap: break-word\">".$_GET['hash']."</p>"; | ||
|
||
if(isset($_GET['secret'])) | ||
echo "Secret: <p style=\"word-wrap:break-word\">".$_GET['secret']."</p>"; | ||
?> |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,5 +7,6 @@ | |
<div> | ||
<center><h1>SteemCasino</h1></center> | ||
</div> | ||
<?php include('src/footer.php'); ?> | ||
</body> | ||
</html> |
Oops, something went wrong.