function ShowSearchPage() { global $LNG, $db; if ($_GET['delete'] == 'user') { DeleteSelectedUser((int) $_GET['user']); message($LNG['se_delete_succes_p'], '?page=search&search=users&minimize=on', 2); } elseif ($_GET['delete'] == 'planet') { DeleteSelectedPlanet((int) $_GET['planet']); message($LNG['se_delete_succes_p'], '?page=search&search=planet&minimize=on', 2); } $SearchFile = request_var('search', ''); $SearchFor = request_var('search_in', ''); $SearchMethod = request_var('fuki', ''); $SearchKey = request_var('key_user', ''); $Page = request_var('side', 0); $Order = request_var('key_order', ''); $OrderBY = request_var('key_acc', ''); $limit = request_var('limit', 25); $Selector = array('list' => array('users' => $LNG['se_users'], 'planet' => $LNG['se_planets'], 'moon' => $LNG['se_moons'], 'alliance' => $LNG['se_allys'], 'vacation' => $LNG['se_vacations'], 'banned' => $LNG['se_suspended'], 'admin' => $LNG['se_authlevels'], 'inactives' => $LNG['se_inactives'], 'online' => $LNG['online_users'], 'p_connect' => $LNG['se_planets_act']), 'search' => array('name' => $LNG['se_input_name'], 'id' => $LNG['input_id']), 'filter' => array('normal' => $LNG['se_type_all'], 'exacto' => $LNG['se_type_exact'], 'last' => $LNG['se_type_last'], 'first' => $LNG['se_type_first']), 'order' => array('ASC' => $LNG['se_input_asc'], 'DESC' => $LNG['se_input_desc']), 'limit' => array('1' => '1', '5' => '5', '10' => '10', '15' => '15', '20' => '20', '25' => '25', '50' => '50', '100' => '100', '200' => '200', '500' => '500')); $template = new template(); $template->page_header(); if (request_var('minimize', '') == 'on') { $Minimize = "&minimize=on"; $template->assign_vars(array('minimize' => 'checked = "checked"', 'diisplaay' => 'style="display:none;"')); } switch ($SearchMethod) { case 'exacto': $SpecifyWhere = "= '" . $db->sql_escape($SearchKey) . "'"; break; case 'last': $SpecifyWhere = "LIKE '" . $db->sql_escape($SearchKey, true) . "%'"; break; case 'first': $SpecifyWhere = "LIKE '%" . $db->sql_escape($SearchKey, true) . "'"; break; default: $SpecifyWhere = "LIKE '%" . $db->sql_escape($SearchKey, true) . "%'"; break; } if (!empty($SearchFile)) { $ArrayUsers = array("users", "vacation", "admin", "inactives", "online"); $ArrayPlanets = array("planet", "moon", "p_connect"); $ArrayBanned = array("banned"); $ArrayAlliance = array("alliance"); if (in_array($SearchFile, $ArrayUsers)) { $Table = "users"; $NameLang = $LNG['se_search_users']; $SpecifyItems = "id,username,email_2,onlinetime,register_time,user_lastip,authlevel,bana,urlaubs_modus"; $SName = $LNG['se_input_userss']; if ($SearchFile == "vacation") { $SpecialSpecify = "AND urlaubs_modus = '1'"; $SName = $LNG['se_input_vacatii']; } if ($SearchFile == "online") { $SpecialSpecify = "AND onlinetime >= '" . (TIMESTAMP - 15 * 60) . "'"; $SName = $LNG['se_input_connect']; } if ($SearchFile == "inactives") { $SpecialSpecify = "AND onlinetime < '" . (TIMESTAMP - 60 * 60 * 24 * 7) . "'"; $SName = $LNG['se_input_inact']; } if ($SearchFile == "admin") { $SpecialSpecify = "AND authlevel <= '" . $USER['authlevel'] . "' AND authlevel > '0'"; $SName = $LNG['se_input_admm']; } $SearchFor == "name" ? $WhereItem = "WHERE username" : ($WhereItem = "WHERE id"); $ArrayOSec = array("id", "username", "email_2", "onlinetime", "register_time", "user_lastip", "authlevel", "bana", "urlaubs_modus"); $Array0SecCount = count($ArrayOSec); for ($OrderNum = 0; $OrderNum < $Array0SecCount; $OrderNum++) { $OrderBYParse[$ArrayOSec[$OrderNum]] = $LNG['se_search_users'][$OrderNum]; } } elseif (in_array($SearchFile, $ArrayPlanets)) { $Table = "planets"; $TableUsers = "2"; $NameLang = $LNG['se_search_planets']; $SpecifyItems = "id,name,id_owner,last_update,galaxy,system,planet,id_luna"; if ($SearchFile == "planet") { $SpecialSpecify = "AND planet_type = '1'"; $SName = $LNG['se_input_planett']; } if ($SearchFile == "moon") { $SpecialSpecify = "AND planet_type = '3'"; $SName = $LNG['se_input_moonn']; } if ($SearchFile == "p_connect") { $SpecialSpecify = "AND last_update >= '" . (TIMESTAMP - 60 * 60) . "'"; $SName = $LNG['se_input_act_pla']; } $SearchFor == "name" ? $WhereItem = "WHERE name" : ($WhereItem = "WHERE id"); $ArrayOSec = array("id", "name", "id_owner", "id_luna", "last_update", "galaxy", "system", "planet"); $Array0SecCount = count($ArrayOSec); for ($OrderNum = 0; $OrderNum < $Array0SecCount; $OrderNum++) { $OrderBYParse[$ArrayOSec[$OrderNum]] = $LNG['se_search_planets'][$OrderNum]; } } elseif (in_array($SearchFile, $ArrayBanned)) { $Table = "banned"; $NameLang = $LNG['se_search_banned']; $SpecifyItems = "id,who,time,longer,theme,author"; $SName = $LNG['se_input_susss']; $SearchFor == "name" ? $WhereItem = "WHERE who" : ($WhereItem = "WHERE id"); $ArrayOSec = array("id", "who", "time", "longer", "theme", "author"); $Array0SecCount = count($ArrayOSec); for ($OrderNum = 0; $OrderNum < $Array0SecCount; $OrderNum++) { $OrderBYParse[$ArrayOSec[$OrderNum]] = $LNG['se_search_banned'][$OrderNum]; } } elseif (in_array($SearchFile, $ArrayAlliance)) { $Table = "alliance"; $NameLang = $LNG['se_search_alliance']; $SpecifyItems = "id,ally_name,ally_tag,ally_owner,ally_register_time,ally_members"; $SName = $LNG['se_input_allyy']; $SearchFor == "name" ? $WhereItem = "WHERE ally_name" : ($WhereItem = "WHERE id"); $ArrayOSec = array("id", "ally_name", "ally_tag", "ally_owner", "ally_register_time", "ally_members"); $Array0SecCount = count($ArrayOSec); for ($OrderNum = 0; $OrderNum < $Array0SecCount; $OrderNum++) { $OrderBYParse[$ArrayOSec[$OrderNum]] = $LNG['se_search_alliance'][$OrderNum]; } } $RESULT = MyCrazyLittleSearch($SpecifyItems, $WhereItem, $SpecifyWhere, $SpecialSpecify, $Order, $OrderBY, $limit, $Table, $Page, $NameLang, $ArrayOSec, $Minimize, $SName, $SearchFile); } $template->assign_vars(array('Selector' => $Selector, 'limit' => $limit, 'search' => $SearchKey, 'SearchFile' => $SearchFile, 'SearchFor' => $SearchFor, 'SearchMethod' => $SearchMethod, 'Order' => $Order, 'OrderBY' => $OrderBY, 'OrderBYParse' => $OrderBYParse, 'se_search' => $LNG['se_search'], 'se_limit' => $LNG['se_limit'], 'se_asc_desc' => $LNG['se_asc_desc'], 'se_filter_title' => $LNG['se_filter_title'], 'se_search_in' => $LNG['se_search_in'], 'se_type_typee' => $LNG['se_type_typee'], 'se_intro' => $LNG['se_intro'], 'se_search_title' => $LNG['se_search_title'], 'se_contrac' => $LNG['se_contrac'], 'se_search_order' => $LNG['se_search_order'], 'ac_minimize_maximize' => $LNG['ac_minimize_maximize'], 'LIST' => $RESULT['LIST'], 'PAGES' => $RESULT['PAGES'])); $template->show('adm/SearchPage.tpl'); }
} else { $Result = "<br><table border='0px' style='background:url(images/Adm/blank.gif);' width='100%'>"; $Result .= "<tr><th style='color:#00CC33;border: 2px red solid;' height='25px'><font color=red>" . $lang['se_no_data'] . "</font></th></tr>"; $Result .= "</table>"; return $Result; } } // BORRADO include_once $xgp_root . 'includes/functions/DeleteSelectedUser.' . $phpEx; if ($_GET['delete'] == 'user') { DeleteSelectedUser($_GET['user']); $Log .= "\n" . $lang['log_searchindb_del1'] . $_GET['user'] . $lang['log_searchindb_del2'] . $user['username'] . "\n"; LogFunction($Log, "GeneralLog", $LogCanWork); message($lang['se_delete_succes_p'], "SearchingPage.php?search=users&minimize=on", 2); } elseif ($_GET['delete'] == 'planet') { DeleteSelectedPlanet($_GET['planet']); $Log .= "\n" . $lang['log_searchindb_del3'] . $_GET['planet'] . $lang['log_searchindb_del2'] . $user['username'] . "\n"; LogFunction($Log, "GeneralLog", $LogCanWork); message($lang['se_delete_succes_p'], "SearchingPage.php?search=planet&minimize=on", 2); } $SearchFile = $_GET['search']; $SearchFor = $_GET['search_in']; $SearchMethod = $_GET['fuki']; $SpecifyWhere = $parse['Key'] = $_GET['key_user']; $Page = $_GET['Page']; $Order = $_GET['key_order']; $OrderBY = $_GET['key_acc']; !$_GET['Limit'] ? $Limit = '25' : ($Limit = $_GET['Limit']); // TABLA DE BÚSQUEDA $parse['OPT_LIST'] = '<option value="users"' . ($SearchFile == "users" ? " selected" : "") . '>' . $lang['se_users'] . '</option>'; $parse['OPT_LIST'] .= '<option value="planet"' . ($SearchFile == "planet" ? " selected" : "") . '>' . $lang['se_planets'] . '</option>';