-
Notifications
You must be signed in to change notification settings - Fork 2
/
marriage.php
129 lines (106 loc) · 4.19 KB
/
marriage.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
<?php
/*
Ceres Control Panel
This is a control pannel program for Athena and Freya
Copyright (C) 2005 by Beowulf and Nightroad
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
To contact any of the authors about special permissions send
an e-mail to cerescp@gmail.com
*/
session_start();
include_once 'config.php'; // loads config variables
include_once 'query.php'; // imports queries
include_once 'functions.php';
if (!empty($_SESSION[$CONFIG_name.'account_id'])) {
if ($_SESSION[$CONFIG_name.'account_id'] > 0) {
if (!empty($GET_opt)) {
if ($GET_opt == 1 && $CONFIG_marry_enable) {
if (is_online())
alert($lang['NEED_TO_LOGOUT_F']);
if (inject($GET_GID1) && inject($GET_GID2))
alert($lang['INCORRECT_CHARACTER']);
if (isset($GET_divorce) && $GET_divorce > 0) {
$query = sprintf(PARTNER_ONLINE, $GET_GID2);
$result = execute_query($query, "marriage.php");
if ($result->fetch_row())
alert($lang['MARRIAGE_COUPLE_OFF']);
$query = sprintf(PARTNER_NULL, $GET_GID1);
$result = execute_query($query, "marriage.php");
$query = sprintf(PARTNER_NULL, $GET_GID2);
$result = execute_query($query, "marriage.php");
$query = sprintf(PARTNER_RING, $GET_GID1);
$result = execute_query($query, "marriage.php");
$query = sprintf(PARTNER_RING, $GET_GID2);
$result = execute_query($query, "marriage.php");
$ban_until = time() + (2 * 60); // 2 minutos pra fazer efeito //testando vicous pucca
$query = sprintf(PARTNER_BAN, $ban_until, $_SESSION[$CONFIG_name.'account_id']);
$result = execute_query($query, "marriage.php");
redir("marriage.php", "main_div", $lang['MARRIAGE_DIVORCE_OK']);
}
alert($lang['MARRIAGE_NOTHING']);
}
}
$query = sprintf(PARTNER_GET, $_SESSION[$CONFIG_name.'account_id']);
$result = execute_query($query, "marriage.php");
if ($result->count() < 1)
redir("motd.php", "main_div", $lang['ONE_CHAR']);
opentable($lang['MARRIAGE']);
echo "
<table width=\"400\">
<tr>
<td align=\"left\" class=\"head\">".$lang['NAME']."</td>
<td align=\"left\" class=\"head\">".$lang['MARRIAGE_PARTNER']."</td>
<td align=\"center\" class=\"head\">".$lang['MARRIAGE_DIVORCE']."</td>
</tr>
";
while ($line = $result->fetch_row()) {
$charname = htmlformat($line[0]);
$GID1 = $line[1];
$partnername = htmlformat($line[2]);
if (strlen($partnername) < 4)
$partnername = $lang['MARRIAGE_SINGLE'];
$GID2 = $line[3];
echo "
<tr>
<td align=\"left\">$charname</td>
<td align=\"left\">$partnername</td>
";
if ($CONFIG_marry_enable && $GID2 > 0) {
echo "
<td align=\"center\">
<form id=\"marriage$GID1\" onsubmit=\"return GET_ajax('marriage.php','main_div','marriage$GID1');\">
<input type=\"checkbox\" name=\"divorce\" value=\"1\" style=\"border-color: #FFFFFF\">
<input type=\"submit\" value=\"Confirm\" class=\"myctl\">
<input type=\"hidden\" name=\"opt\" value=\"1\">
<input type=\"hidden\" name=\"GID1\" value=\"$GID1\">
<input type=\"hidden\" name=\"GID2\" value=\"$GID2\">
</form>
</td>
";
}
echo "</tr>";
}
echo "</table>";
if ($CONFIG_marry_enable)
echo "
<table>
<tr><td align=\"left\">".$lang['MARRIAGE_PS1']."</td></tr>
<tr><td align=\"left\">".$lang['MARRIAGE_PS2']."</td></tr>
</table>";
// <tr><td align=\"left\">".$lang['MARRIAGE_PS3']."</td></tr>
closetable();
}
fim();
}
redir("motd.php", "main_div", $lang['NEED_TO_LOGIN']);
?>