-
Notifications
You must be signed in to change notification settings - Fork 1
/
play.php
executable file
·67 lines (55 loc) · 2.01 KB
/
play.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
<?php
// Include files
include(__DIR__ . '/php/Player.php');
require_once(__DIR__ . '/php/Helpers.php');
// Start the session
session_start();
// Make sure the user is already logged in
if (!isset($_SESSION[Helpers::LOGGED_IN]) && !isset($_SESSION[Helpers::PLAYER_SESSION])) {
// Redirect user to the login page if invalid session variables
$address = Helpers::get_address();
header("Location: http://$address/login.php");
} else {
$player = $_SESSION[Helpers::PLAYER_SESSION];
$player->load_information();
}
?>
<!DOCTYPE HTML>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1, user-scalable=0">
<title>Make Bets</title>
<link href='https://fonts.googleapis.com/css?family=Lato:400,100,900' rel='stylesheet' type='text/css'>
<!-- Lato Light, Normal, Bold -->
<link id="bid_style" rel="stylesheet" href="style/bid_page_desktop.css">
</head>
<body>
<input type="hidden" value="<?php echo $player->get_id() ?>" id="player-id">
<div id="main_container">
<div id="current_bid_container">
<!-- Displays the players name -->
<div id="name">
Player
</div>
<!-- Displays player current chips and bid amounts -->
<div id="current_bid">
0
</div>
<div id="current_chips">
0
</div>
<div id="bid_amounts">
<button id="bid_button" onclick="add_bid(1)">+1</button>
<button id="bid_button" onclick="add_bid(5)">+5</button>
<button id="bid_button" onclick="add_bid(10)">+10</button>
<button id="bid_button" onclick="add_bid(50)">+50</button>
<button id="clear_bid_button" onclick="reset_bid()">Clear</button>
</div>
<button id="make_bid" onclick="make_bid()">Submit Bid</button>
</div>
</div>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script>
<script src="js/bid_client.js"></script>
<script src="js/mobile_dection.js"></script>
</body>
</html>