-
Notifications
You must be signed in to change notification settings - Fork 0
/
allianceoptions.php
executable file
·114 lines (96 loc) · 3.13 KB
/
allianceoptions.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
<?php
include('ingamehead.php');
$query="SELECT * FROM `players` WHERE `username`='$username'";
$result=mysql_query($query);
$userresult=mysql_fetch_array($result);
$query="SELECT * FROM `alliance` WHERE `name`='$alliance'";
$result=mysql_query($query);
$allianceresult=mysql_fetch_array($result);
$privi=explode('|',$userresult['allianceoptions']);
foreach ($privi as $priv){
$opt[$priv]='yes';
}
?>
<h1>Allaince Options</h1>
<a href="alliance.php">Overview</a> |
<a href="allianceoptions.php">Options</a>
<?php
$opto=$_POST['option'];
if ($opto == 'quit'){
if (md5($_POST['password']) == $userresult['password']){
$query="UPDATE `players` SET `alliance`='',`allianceoptions`='' WHERE `username`='$username'";
$result=mysql_query($query);
echo '';
}
}
if ($opt['in'] == 'yes' || $opt['all'] == 'yes'){
if ($opto == 'invite'){
$alliance=$userresult['alliance'];
$query="INSERT INTO `invitations` ( `id` , `to` , `alliance` ) VALUES (NULL , '{$_POST['player']}', '$alliance')";
$result=mysql_query($query);
echo 'You have invited '.$_POST['player'];
}
}
if ($opt['ki'] == 'yes' || $opt['all'] == 'yes'){
if ($opto == 'kick'){
if (md5($_POST['password']) == $userresult['password']){
$query="UPDATE `players` SET `alliance`='', `allianceoptions`='' WHERE `username`='{$_POST['player']}'";
$result=mysql_query($query);
echo 'You have kicked '.$_POST['player'];
}
}
}
?>
<br/><br/>
<b>Quit Alliance</b>
<form action="allianceoptions.php" method="post">
Password (for security): <input type="password" name="password"><br/>
<input type="hidden" name="option" value="quit">
<input type="submit" value="Quit alliance"><br/><br/>
</form>
<?php
if ($opt['in'] == 'yes' || $opt['all'] == 'yes'){
?>
<b>Invite player</b>
<form action="allianceoptions.php" method="post">
Invite Player: <input type="text" name="player"><br/>
<input type="hidden" name="option" value="invite">
<input type="submit" value="Invite"><br/><br/>
</form>
<?php
}
if ($opt['ki'] == 'yes' || $opt['all'] == 'yes'){
?>
<b>Kick player</b>
<form action="allianceoptions.php" method="post">
Kick Player: <input type="text" name="player"><br/>
Password (for security): <input type="password" name="password"><br/>
<input type="hidden" name="option" value="kick">
<input type="submit" value="Kick"><br/><br/>
</form>
<?php
}
if ($opt['de'] == 'yes' || $opt['all'] == 'yes'){
?>
<b>Change description</b>
<form action="allianceoptions.php" method="post">
<textarea cols="50" rows="7"><?php echo $allianceresult['description'];?></textarea><br/>
<input type="hidden" name="option" value="kick">
<input type="submit" value="Change"><br/><br/>
</form>
<?php
}
if ($opt['pr'] == 'yes' || $opt['all'] == 'yes'){
?>
<form action="privs.php" method="post">
<b>Set privileges</b><br/>
Player: <input type="text" name="player"><br/>
<input type="submit" value="Change Privileges"><br/><br/>
</form>
<?php
}
?>
</div>
<div id="right">
<?php include('stat.php'); ?>
<?php include('foot.php'); ?>