forked from richpri/board18v2
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathboard18BoxLoad.php
134 lines (131 loc) · 4.39 KB
/
board18BoxLoad.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
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
<?php
/*
* The board18BoxLoad.php page displays the Load Game Box form.
* This form can be used to upload a zipped game box to BOARD18.
*
* Copyright (c) 2016 Richard E. Price under the The MIT License.
* A copy of this license can be found in the LICENSE.text file.
*/
/*
require_once('auth.php');
if ($playerlevel != 'admin' && $playerlevel != 'author') {
error_log("gameGet: Not an admin or author level player");
echo $errResp;
exit;
}
*/
require_once('php/auth.php');
require_once('php/rm_r.php');
require_once('php/loadGameBox.php');
if ($playerlevel != 'admin' && $playerlevel != 'author') {
error_log("loadGameBox:loadBox: Not an admin or author level player");
$_SESSION['SESS_HEADER_MESSAGE'] = 'Not an admin or author level player';
header("location: board18Admin.php");
exit;
}
if(isset($_POST['submit'])) { // If reload via zform submit.
$reportout = loadBox($_FILES,$loggedinplayer);
}
?>
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>BOARD18 - Remote Play Tool For 18xx Style Games</title>
<link rel="shortcut icon" href="images/favicon.ico" >
<link rel="stylesheet" href="style/board18com.css" />
<link rel="stylesheet" href="style/board18BoxLoad.css" />
<script type="text/javascript" src="scripts/jquery.js">
</script>
<script type="text/javascript" src="scripts/board18com.js">
</script>
<script type="text/javascript" src="scripts/board18BoxLoad.js">
</script>
<script type="text/javascript" >
$(function() {
if (!window.File) { // Check for File API support.
// The File API is not supported.
alert('The file upload API is not supported on this browser.');
}
$('#content .error').hide();
$('#zfile').val('');
<?php
if (isset($_POST['submit'])) { // If reload via zform submit.
echo "zipBoxOk($reportout);";
}
?>
$('#buttonz2').on("click",function() {
$('#content .error').hide();
$('#zfile').val('');
return false;
}); // end buttonz2 click
$('#buttonz3').on("click",function() {
window.location = 'board18Main.php';
return false;
}); // end buttonz3 click
$('#buttonf').on("click",function() {
$('#failmsg').hide();
return false;
}); // end buttonf click
$('#buttons').on("click",function() {
$('#successmsg').hide();
return false;
}); // end buttons click
}); // end ready
</script>
</head>
<body>
<div id="topofpage">
<div id="logo">
<img src="images/logo.png" alt="Logo"/>
</div>
<div id="heading">
<h1>BOARD18 - Remote Play Tool For 18xx Style Games</h1>
</div>
</div>
<div id="leftofpage">
</div>
<div id="rightofpage">
<div id="content">
<form action="board18BoxLoad.php" method="post"
name="loadbox" class="boxform" id="zform"
enctype="multipart/form-data">
<fieldset>
<p>
<label for="zfile">Select ZIP file to upload:</label><br>
<input type="file" id="zfile" name="zfile" required/>
<label class="error" for="zfile" id="zfile_error"></label>
</p>
<p>
<input type="submit" name="submit" class="zfbutton"
id="buttonz1" value="Load Gamebox" >
<input type="button" name="resbutton" class="zfbutton"
id="buttonz2" value="Reset Form">
<input type="button" name="canbutton" class="zfbutton"
id="buttonz3" value="Exit"><br>
</p>
<p>
Loading the Gamebox may take a few minutes. Please be patient.
</p>
</fieldset>
</form>
</div>
<div id="successmsg" class="hidemsg">
<p>The game box creation was successful.
</p>
<p>You will be emailed a detailed report.
</p>
<input type="button" name="buttons" class="zfbutton"
id="buttons" value="Exit">
</div>
<div id="failmsg" class="hidemsg">
<p>The game box creation failed.
</p>
<p>You will be emailed a detailed report.
</p>
<input type="button" name="buttonf" class="zfbutton"
id="buttonf" value="Exit">
</div>
</div>
</body>
</html>