-
Notifications
You must be signed in to change notification settings - Fork 7
/
applyguild.php
58 lines (53 loc) · 2.29 KB
/
applyguild.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
<?php
//////////////////////////////////////////////////
//Please allow me to build this entire system. //
//I want to have fun with it. //
//////////////////////////////////////////////////
//Deus //
//////////////////////////////////////////////////
session_name("icsession");
session_start();
include('db.php');
include('varset.php');
if($chargold >= "1000000") //1m
{
$guildname = $_POST['guildname'];
$getguild = mysql_query("SELECT * FROM guilds WHERE id='".$guildname."'");
if(mysql_num_rows($getguild) == "1")
{
$guild = mysql_fetch_assoc($getguild);
$getmembers = mysql_query("SELECT * FROM characters WHERE guild='".$guild['name']."'");
$members = mysql_num_rows($getmembers);
if($guild['recruiting'] == "Yes" && $members < "10")
{
if($guild['accept'] == "Approve")
{
$data = "<font color=\'#00FF00\'>You have sent your application to ".$guild['name'].".</font><br />";
$newgold = $chargold - "1000000";
$updatechar = mysql_query("UPDATE characters SET gold='".$newgold."' WHERE id='".$_SESSION['userid']."'");
$setapplication = mysql_query("INSERT INTO applications (`guild`, `username`) VALUES ('".$guild['name']."', '".$charname."')");
}
elseif($guild['accept'] == "Auto")
{
$data = "<center><font color=\'#00FF00\'>Your application for ".$guild['name']." has been automatically approved.</font><br />";
$data .= "<a href=\'javascript: viewGuild();\'>Click Here</a> to go to ".$guild['name']."\'s Guild Portal.</center>";
$newgold = $chargold - "1000000";
$updatechar = mysql_query("UPDATE characters SET gold='".$newgold."', guild='".$guild['name']."' WHERE id='".$_SESSION['userid']."'");
}
}
else
{
$data = "<font color=\'#FF0000\'>".$guild['name']." is not currently recruiting.</font>";
}
}
else
{
$data = "<font color=\'#FF0000\'>This Guild does not exist.</font>";
}
}
else
{
$data = "<font color=\'#FF0000\'>You do not have the 1,000,000 Gold required to join a Guild.</font>";
}
print("fillDiv('guildinfo','".$data."');");
?>