-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdraft1846Next.php
More file actions
executable file
·164 lines (156 loc) · 5.88 KB
/
draft1846Next.php
File metadata and controls
executable file
·164 lines (156 loc) · 5.88 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
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
<?php
/*
* The draft1846Next page is called from an email generated by
* a previous iteration of draft1846Next or by draft1846Cfrm.
* This page deals a new hand and updates the database. It then
* sends an email to the next player for him to take his turn.
*
* This page's URL should contain a urlkey parameter. This is
* a 12 character pseudo random string that begins with the
* draftid and the playerid.
*
* For backwards compatibility it can, for now, also contain
* these two values as seperate integer parameters:
* draftid
* playerid
*
* Copyright (c) 2020 Richard E. Price under the The MIT License.
* A copy of this license can be found in the LICENSE.text file.
*/
$urlkey = filter_input(INPUT_GET, 'urlkey',FILTER_SANITIZE_STRING);
$draftid = intval(substr($urlkey,0,4));
$playerid = intval(substr($urlkey,4,1));
?>
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>DRAFT1846 - Private Company Draft Tool For 1846 Games</title>
<link rel="shortcut icon" href="images/favicon.ico" >
<link rel="stylesheet" href="style/draft1846Com.css" />
<link rel="stylesheet" href="style/draft1846Next.css" />
<script type="text/javascript" src="scripts/jquery.js">
</script>
<script type="text/javascript" src="scripts/draft1846Com.js">
</script>
<script type="text/javascript" src="scripts/draft1846Config.js">
</script>
<script type="text/javascript" src="scripts/draft1846Next.js">
</script>
<script>
$(function() {
$('.error').hide();
D1846.errtxt = "";
D1846.input = [];
D1846.input.draftid = parseInt(<?php echo "$draftid"; ?>);
D1846.input.playerid = parseInt(<?php echo "$playerid"; ?>);
D1846.input.urlkey = '<?php echo "$urlkey"; ?>';
$('#did').append(D1846.input.draftid).append('.');
var cString = "draftid=" + D1846.input.draftid;
$.post("php/getDraft.php", cString, getDraftResult);
$("#button1").on("click",function(){
processSelection();
return false;
}); // end button1 click
$("#button2").on("click",function(){
window.location.assign("draft1846Goodby.html?msgtype=0");
return false;
}); // end button2 click
$("#button3").on("click",function(){
window.location.assign("draft1846Goodby.html?msgtype=0");
return false;
}); // end button3 click
$("#button3b").on("click",function(){
window.location.assign("draft1846Goodby.html?msgtype=0");
return false;
}); // end button3b click
$("#button3c").on("click",function(){
var tryagain = 'draft1846Next.php?draftid=';
tryagain += D1846.input.draftid + '&playerid=';
tryagain += D1846.input.playerid;
window.location.assign(tryagain);
return false;
}); // end button3c click
$("#button4").on("click",function(){
var recallnext = 'draft1846Next.php?draftid=';
recallnext += D1846.input.draftid + '&playerid=';
recallnext += D1846.input.playerid;
window.location.assign(recallnext);
return false;
}); // end button4 click
$("#button5").on("click",function(){
window.location.assign("draft1846Goodby.html?msgtype=0");
return false;
}); // end button5 click
});
</script>
</head>
<body>
<div id="topofpage">
<div id="logo">
<img src="images/logo.png" alt="Logo"/>
</div>
<div id="heading">
<h1>DRAFT1846</h1>
<h1>The Private Company Draft Tool For 1846 Games</h1>
</div>
</div>
<div id="restofpage">
<div id="content">
<div id="toptext">
<p id="pid">
Hello
</p>
<p id="did">
The draft id for this draft is
</p>
</div>
<div id="draftrpt">
</div>
<div id="draftturn">
</div>
<div id="draftform" class="allforms">
Be sure to select your card before you press enter!<br>
<form name="form1" action="" >
<label for="cardsel">Select card by number: </label>
<input type="number" name="cardsel" id="cardsel"
value="1" min="1" max="7"><br>
<input type="button" name="button1" class="pwbutton"
id="button1" value="Enter" >
<input type="button" name="button2" class="pwbutton"
id="button2" value="Cancel" >
</form>
</div>
<div id="canform" class="allforms">
<form name="form2" action="" >
<input type="button" name="button3" class="pwbutton"
id="button3" value="Cancel" >
</form>
</div>
<div id="doneform" class="allforms">
<form name="form3" action="" >
<input type="button" name="button3b" class="pwbutton"
id="button3b" value="exit" >
</form>
</div>
<div id="againform" class="allforms">
<form name="form4" action="" >
<input type="button" name="button3c" class="pwbutton"
id="button3c" value="try again" >
</form>
</div>
<div id="collform" class="allforms"><p id="collp">
Your update collided with another player's update.<br>
Try again. If you get this message repeatedly then
contact the DRAFT1846 webmaster<br><br></p>
<form name="form5" action="" >
<input type="button" name="button4" class="pwbutton"
id="button4" value="Retry" >
<input type="button" name="button5" class="pwbutton"
id="button5" value="Cancel" >
</form>
</div>
</div>
</div>
</body>
</html>