forked from TheGamesDB/TheGamesDB
-
Notifications
You must be signed in to change notification settings - Fork 0
/
platforms.php
82 lines (79 loc) · 2.64 KB
/
platforms.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
<?php
include ('include.php');
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Platforms Selector</title>
<link rel=stylesheet href="<?= $baseurl ?>/pngHack/pngHack.css" type="text/css">
<link rel="stylesheet" type="text/css" href="<?= $baseurl ?>/default.css">
<script type="text/javascript" src="<?= $baseurl ?>/xfade2.js"></script>
<script type="text/javascript" src="<?= $baseurl ?>/niftycube.js"></script>
<script type="text/javascript">
window.onload=function(){
Nifty("DIV.section","big");
Nifty("DIV.footer","big");
Nifty("DIV.titlesection","big");
}
</script>
<script type="text/javascript">
function copyplatform() {
var platlist=""
<?
$query = "SELECT count(*) AS amount FROM platforms";
$result = mysql_query($query) or die('Query failed: ' . mysql_error());
$max = mysql_fetch_object($result)->amount;
$counter=0;
while ($max != $counter){
echo " if (document.platformsform.chkplatforms[$counter].checked== true){platlist = platlist+\"|\"+document.platformsform.chkplatforms[$counter].value}\n";
$counter++;
}
?>
if (platlist.length>1){platlist = platlist+"|"}
if (platlist.length>99){
alert("You have selected too many platforms.")
}
else{
opener.document.seriesform.Platform.value = platlist;
opener.document.seriesform.Platformfake.value = platlist;
self.close();
}
return false;
}
</script>
</head>
<body style="color:#fff;">
<table width="95%" cellspacing="0" cellpadding="0" border="0" align="center">
<tr><td>
<div class="titlesection">
<h1>Platforms</h1>
<h3>Please select the platforms for <?=$GameTitle?>.</h3>
</div>
<div class="section">
<form action="#" method="POST" name="platformsform" onSubmit="return false">
<table width="100%" border="0" cellspacing="0" cellpadding="0" align="center" id="datatablelist">
<?
$query = "SELECT * FROM platforms ORDER BY name";
$result = mysql_query($query) or die('Query failed: ' . mysql_error());
$tr = 1;
while ($platforms = mysql_fetch_object($result)) {
if ($tr == 1){echo " <tr>\n";}
?>
<td><?=$platforms->name?>: </td>
<td><INPUT TYPE="checkbox" NAME="chkplatforms" VALUE="<?=$platforms->name?>" <?if (strstr($Platform,"$platforms->name")){echo "checked";}?>></td>
<?
if ($tr == 2){echo " </tr>\n"; $tr = 1;}else{$tr = 2;}
}
?>
<tr>
<td style="text-align: right" colspan="4">
<input type="submit" name="function" value="Accept" class="submit" onClick="return copyplatform()">
</td>
</tr>
</table>
</form>
</div>
</td></tr>
</table>
</body>
</html>