-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmanagegames.php
133 lines (93 loc) · 2.73 KB
/
managegames.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
<?php session_start(); ob_start(); ?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<?php include ("includes/functions.php"); theme_set(); ?>
</head>
<body>
<table align="center" class="main">
<tr>
<td><img src="images/header.png"></td>
</tr>
<!-- row for system stats -->
<tr>
<td>
<?php include("includes/header.php"); ?>
</td>
</tr>
<!-- row for main left and right -->
<?php
if(isset($_POST['gameoption'])) {
$action = $_POST['gameoption'];
// echo $action;
if($action == "New"){
header("location:addgame.php");
}
if($action == "Delete"){
$_SESSION['editgameid'] = $_POST['gameid'];
header("location:utilprogs/gamemod.php?mode=remove");
}
if($action == "Edit"){
$_SESSION['editgameid'] = $_POST['gameid'];
header("location:addgame.php?mode=edit");
}
}
?>
<tr>
<td>
<table align="center" class="inside">
<tr>
<td valign="top" width="200px">
<div class="navigation">
<?php include("includes/sidenav.php"); ?>
</div>
</td>
<td valign="top" width="440">
<!-- new table for showing the body content -->
<table cellspacing="0" cellpadding="0" width="100%">
<tr><td><div class="title">Game Management<br></div></td></tr>
<tr><td><div class="subtitle">Add / Remove / Edit a registered game. </div><br></td></tr>
<tr><td><div>
<form method="post" action="managegames.php">
<table cellpadding="0" class="content" cellspacing="0" width="100%" >
<tr><th>Game</th><th>Lives Per Credit</th><th>Game Type</th><th>Selected</th></tr>
<?php
include("includes/sqlconnect.inc");
$games = mysql_query("SELECT * FROM games") or die(mysql_error());
while($row = mysql_fetch_array( $games )){
$gameid=$row['gameid'];
$game=$row['gamename'];
$lives=$row['livespercredit'];
$gametype=$row['gametype'];
echo "<tr>";
echo '<td>'.$game.'</td>';
echo '<td>'.$lives.'</td>';
echo '<td>'.$gametype.'</td>';
echo '<td><input type="radio" name="gameid" value="'.$gameid.'"></td>';
echo "</tr>";
}
?>
</table>
<br>
<br>
</td></tr></div>
<!-- add div here -->
</table>
<table>
<tr><td><input type="submit" name="gameoption" value="Delete"/></td><td><input type="submit" name="gameoption" value="Edit" label="Edit"/><input type="submit" name="gameoption" value="New"/></td></tr>
</table>
</td>
</tr>
</table>
</form>
</td>
</tr>
<!-- row for footer -->
<tr>
<td>
<?php include("includes/footer.php"); ?>
</td>
</tr>
</table>
</body>
</html>