if (isset($step) && $step == "delete") { $result = dbquery("DELETE FROM ".DB_INFUSION_TABLE." WHERE ggcban_id='$ban_id'");
opentable($locale['ggc_116']);
echo "<center><br>
".$locale['ggc_105']."<br><br>
<a href='ggc_ban_admin.php".$aidlink."'>".$locale['ggc_106']."</a><br><br>
<a href='".ADMIN."index.php".$aidlink."'>".$locale['ggc_107']."</a><br><br>
</center>\n";
closetable();
} else {
if (isset($_POST['save_cat'])) {
$ban_data = stripinput($_POST['ban_data']);
$ban_nick = stripinput($_POST['ban_nick']);
$ban_hash = stripinput($_POST['ban_hash']);
$ban_cause = stripinput($_POST['ban_cause']);
if (isset($step) && $step == "edit") {
$result = dbquery("UPDATE ".DB_INFUSION_TABLE." SET ggcban_data='$ban_data', ggcban_nick='$ban_nick', ggcban_hash='$ban_hash', ggcban_cause='$ban_cause' WHERE ggcban_id='$ban_id'");
} else {
$result = dbquery("INSERT INTO ".DB_INFUSION_TABLE." VALUES('', '$ban_data', '$ban_nick', '$ban_hash', '$ban_cause')");
}
header("Location:ggc_ban_admin.php".$aidlink."");
}
if (isset($step) && $step == "edit") {
$result = dbquery("SELECT * FROM ".DB_INFUSION_TABLE." WHERE ggcban_id='$ban_id'");
$data = dbarray($result);
$ban_data = $data['ggcban_data'];
$ban_nick = $data['ggcban_nick'];
$ban_hash = $data['ggcban_hash'];
$ban_cause = $data['ggcban_cause'];
$formaction = FUSION_SELF."".$aidlink."&step=edit&stats_id=".$data['ggcban_id'];
opentable($locale['ggc_108']);
} else {
$ban_data = ""; $ban_nick = ""; $ban_hash = ""; $ban_cause = "";
$formaction = FUSION_SELF."".$aidlink;
opentable($locale['ggc_101']);
}
echo "<form name='addcat' method='post' action='$formaction'>
<table border='0' align='center' width='400px' cellspacing='1' cellpadding='1' class='tbl'>
<tr>
<td width='100%' align='right' valign='top'>
<table border='0' align='center' cellspacing='1' cellpadding='1' class='tbl'>
<tr>
<td width='90px' align='left'>".$locale['ggc_115']."</td>
<td><input type='text' name='ban_data' value='$ban_data' class='textbox' style='width:250px;'></td>
</tr>
<tr>
<td align='left'>".$locale['ggc_116']."</td>
<td><input type='text' name='ban_nick' value='$ban_nick' class='textbox' style='width:250px;'></td>
</tr>
<tr>
<td align='left'>".$locale['ggc_117']."</td>
<td><input type='text' name='ban_hash' value='$ban_hash' class='textbox' style='width:250px;'></td>
</tr>
<tr>
<td align='left'>".$locale['ggc_118']."</td>
<td><input type='text' name='ban_cause' value='$ban_cause' class='textbox' style='width:250px;'></td>
</tr>
</table>
</td>
</tr>
<tr>
<td align='center' colspan='2'>
<input type='submit' name='save_cat' value='".$locale['ggc_111']."' class='button'></td>
</tr>
</table>
</form>\n";
closetable();
// koniec dodawania graczy
tablebreak();
opentable($locale['ggc_102']);
if (!isset($sortby)) $sortby = "all";
$orderby = ($sortby == "all" ? "" : " WHERE ggcban_nick LIKE '$sortby%'");
$result = dbquery("SELECT * FROM ".DB_INFUSION_TABLE."".$orderby."");
$rows = dbrows($result);
if (!isset($rowstart)) $rowstart = 0;
if ($rows != 0) {
echo "<table align='center' width='890px' cellspacing='2'>
<tr>
<td style='width: 30px; text-align: center' class='tbl2'><b>".$locale['ggc_114']."</b></td>
<td style='width: 100px; text-align: center' class='tbl2'><b>".$locale['ggc_115']."</b></td>
<td style='width: 200px; text-align: center' class='tbl2'><b>".$locale['ggc_116']."</b></td>
<td style='width: 250px; text-align: center' class='tbl2'><b>".$locale['ggc_117']."</b></td>
<td style='width: 250px; text-align: center' class='tbl2'><b>".$locale['ggc_118']."</b></td>
<td style='width: 60px; text-align: center' class='tbl2'><b>".$locale['ggc_110']."</b></td>
</tr>\n";
$result = dbquery("SELECT * FROM ".DB_INFUSION_TABLE."".$orderby." ORDER BY ggcban_id DESC, ggcban_nick LIMIT $rowstart,100");
while ($data = dbarray($result)) {
echo "<tr>\n";
echo "<td class='small' align='center'>".$data['ggcban_id']."</td>\n";
echo "<td class='small' align='center'>".$data['ggcban_data']."</td>\n";
echo "<td> <a href='".FUSION_SELF."".$aidlink."&step=edit&ban_id=".$data['ggcban_id']."'><b> ".$data['ggcban_nick']."</b></a></td>\n";
echo "<td class='small' align='left'> ".$data['ggcban_hash']."</b></a></td>\n";
echo "<td class='small' align='left'> ".$data['ggcban_cause']."</b></a></td>\n";
echo "<td class='small' align='center'><a href='".FUSION_SELF."".$aidlink."&step=delete&ban_id=".$data['ggcban_id']."'>".$locale['ggc_113']."</a></td></tr>";
}
echo "</table>\n";
} else {
echo "<center><br>\n".$locale['ggc_103']." <b>$sortby<b><br><br>\n</center>\n";
}
$search = array(
"A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R",
"S","T","U","V","W","X","Y","Z","0","1","2","3","4","5","6","7","8","9","=","*","_", "["
);
echo "<hr><table align='center' cellpadding='0' cellspacing='1' class='tbl-border'>\n<tr>\n";
echo "<td rowspan='2' class='tbl2'><a href='".FUSION_SELF."".$aidlink."&sortby=all'>".$locale['ggc_109']."</a></td>";
for ($i=0;$i < 40!="";$i++) {
echo "<td align='center' class='tbl1'><div class='small'><a href='".FUSION_SELF."".$aidlink."&sortby=".$search[$i]."'>".$search[$i]."</a></div></td>";
echo ($i==19 ? "<td rowspan='2' class='tbl2'><a href='".FUSION_SELF."".$aidlink."&sortby=all'>".$locale['ggc_109']."</a></td>\n</tr>\n<tr>\n" : "\n");
}
echo "</tr>\n</table>\n";
}
closetable();