function ShowThisMessage($idx, &$db) { require $_SERVER['DOCUMENT_ROOT'] . "/" . $_SESSION['SiteFolder'] . "Config/Main.php"; require $_SERVER['DOCUMENT_ROOT'] . "/" . $_SESSION['SiteFolder'] . "Language/{$MainLanguage}/Messages.php"; $dateClass = new Date(); $return = ""; $db->Query("SELECT subject,message,date FROM Z_Messages WHERE memb___id = '" . $this->acc->memb___id . "' AND idx = '{$idx}'"); $NumRows = $db->NumRows(); if ($NumRows < 1) { $return = $MessagesMessage04; } else { $data = $db->GetRow(); $return .= "<p align=\"left\" class=\"MessagesBoxHeader\">{$MessagesMessage05} " . $dateClass->DateFormat($data['date']) . ", " . $dateClass->TimeFormat($data['date'], "h") . ".<br />"; $return .= "{$MessagesMessage02}: " . $data['subject'] . "</p>"; $return .= "<p align=\"justify\" class=\"MessagesBoxMessage\">" . $data['message'] . "</p>"; $db->Query("UPDATE Z_Messages SET status = '1' WHERE idx = '{$idx}'"); } return $return; }
for ($i = 0; $i < $NumRows; $i++) { $data = $EventsData[$i]; $db->Query("SELECT realname FROM Z_Users WHERE id = '" . $data['by'] . "'"); $result = $db->GetRow(); $Admin = $result[0]; $db->Query("SELECT title,description FROM Z_Events WHERE idx = '" . $data['event'] . "'"); $result = $db->GetRow(); $Title = $result[0]; $Description = $result[1]; $Prizes = ""; foreach ($Currencies as $Key => $Value) { if ($data["currency" . $Key] > 0) { $Prizes .= $data["currency" . $Key] . " " . $Value['name'] . "<br />"; } } $return .= "\n\t\t<tr>\n\t\t <td>\n\t\t \t<a href=\"javascript:;\" onclick=\"javascript: ExpandDescription('" . $data['idx'] . "')\">[+] " . $Title . "</a><br />\n\t\t\t<div style=\"display:none\" id=\"EventDescription_" . $data['idx'] . "\">\n\t\t\t\t<strong>{$EventsMsg06}</strong> {$Description}<br />\n\t\t\t\t<strong>{$EventsMsg07}</strong> " . $data['place'] . "<br />\n\t\t\t\t<strong>{$EventsMsg08}</strong>\n\t\t\t\t{$Prizes}\n\t\t\t</div\n\t\t </td>\n\t\t <td align=\"center\" valign=\"middle\" nowrap=\"nowrap\">" . $Admin . "</td>\n\t\t <td align=\"center\" valign=\"middle\" nowrap=\"nowrap\">" . $dt->DateFormat($data['date']) . " " . $dt->TimeFormat($data['date'], "h") . "</td>\n\t\t <td align=\"center\" valign=\"middle\">" . $dt->TimeRemaining($data['date']) . "</td>\n\t\t</tr>"; } $return .= "</table>"; $return .= "\n\t<script>\n\t\tfunction ExpandDescription(idx)\n\t\t{\n\t\t\t\$(\"#EventDescription_\" + idx).toggle();\n\t\t}\n\t</script>\n\t"; $my_array['NextEvents'] = $return; $db->Query("SELECT TOP 30 * FROM Z_EventsSchedule WHERE winner IS NOT NULL ORDER BY date DESC"); $NumRows = $db->NumRows(); $EventsData = array(); for ($i = 0; $i < $NumRows; $i++) { $data = $db->GetRow(); $EventsData[$i] = $data; } $return = "<table class=\"BlockedUsersTable\">\n <tr>\n <th align=\"center\">{$EventsMsg01}</th>\n <th align=\"center\">{$EventsMsg02}</th>\n\t <th align=\"center\">{$EventsMsg03}</th>\n\t <th align=\"center\">{$EventsMsg05}</th>\n\t</tr>"; for ($i = 0; $i < $NumRows; $i++) { $data = $EventsData[$i]; $db->Query("SELECT realname FROM Z_Users WHERE id = '" . $data['by'] . "'");
function ScheduledEvents(&$db) { require_once $_SERVER['DOCUMENT_ROOT'] . "/" . $_SESSION['SiteFolder'] . "System/Date.class.php"; $dateClass = new Date(); require $_SERVER['DOCUMENT_ROOT'] . "/" . $_SESSION['SiteFolder'] . "Config/Main.php"; require $_SERVER['DOCUMENT_ROOT'] . "/" . $_SESSION['SiteFolder'] . "Manager/Language/{$MainLanguage}/Events.php"; require_once $_SERVER['DOCUMENT_ROOT'] . "/" . $_SESSION['SiteFolder'] . "Manager/System/Manager.class.php"; $mn = new Manager(); $db->Query("SELECT * FROM Z_Currencies ORDER BY idx"); $NumCurrencies = $db->NumRows(); $Currencies = array(); for ($i = 0; $i < $NumCurrencies; $i++) { $Currencies[$i + 1] = $db->GetRow(); } $db->Query("SELECT idx,title FROM Z_Events"); while ($data = $db->GetRow()) { $EventNames[$data[0]] = $data[1]; } $return = "\n\t\t<table class=\"BlockListTable\">\n \t<tr>\n\t\t\t\t<th align=\"center\">{$EventsMessage027}</th>\n \t<th align=\"center\">{$EventsMessage028}</th>\n \t<th align=\"center\">{$EventsMessage029}</th>\n\t\t\t\t<th align=\"center\">{$EventsMessage040}</th>\n\t\t\t\t<th align=\"center\">{$EventsMessage031}</th>\n \t<th align=\"center\"></th>\n \t<th></th>\n \t</tr>"; $db->Query("SELECT * FROM Z_EventsSchedule WHERE winner IS NULL ORDER BY date ASC"); $numrows = $db->NumRows(); for ($i = 0; $i < $numrows; $i++) { $ScheduledEvents[$i] = $db->GetRow(); } if (is_array($ScheduledEvents)) { foreach ($ScheduledEvents as $k => $v) { $getColor = ""; if ($v['date'] < date("Y-m-d H:i:s")) { $getColor = "style=\"color:#F00\""; } $disabled = ""; if ($_SESSION['ManagerId'] != $v['by']) { if ($mn->GetUserLevel($_SESSION['ManagerId'], $db) <= $mn->GetUserLevel($v['by'], $db)) { $disabled = "disabled=\"disabled\""; } } $Prizes = ""; foreach ($Currencies as $Key => $Value) { if ($v["currency" . $Key] > 0) { $Prizes .= $v["currency" . $Key] . " " . $Value['name'] . "<br />"; } } $return .= "\n\t\t\t\t<tr>\n\t\t\t\t\t<td align=\"center\">" . $EventNames[$v['event']] . "</td>\n\t\t\t\t\t<td align=\"center\">" . $mn->GetUserName($v['by'], $db) . "</td>\n\t\t\t\t\t<td align=\"center\" {$getColor}>" . $dateClass->DateFormat($v['date']) . " " . $dateClass->TimeFormat($v['date'], "h") . "</td>\n\t\t\t\t\t<td align=\"center\">{$Prizes}</td>\n\t\t\t\t\t<td align=\"center\">\n\t\t\t\t\t\t<input type=\"text\" name=\"winner_" . $v['idx'] . "\" id=\"winner_" . $v['idx'] . "\" size=\"10\" maxlength=\"10\" {$disabled} />\n\t\t\t\t\t</td>\n\t\t\t\t\t<td>\n\t\t\t\t\t\t"; if ($_SESSION['ManagerId'] == $v['by'] || $mn->GetUserLevel($_SESSION['ManagerId'], $db) > $mn->GetUserLevel($v['by'], $db)) { $return .= "\n\t\t\t\t\t\t\t<div id=\"icon\" style=\"cursor:pointer; float:left;\" align=\"center\" class=\"ui-state-default ui-corner-all\" onclick=\"EventPrize('" . $v['idx'] . "')\" title=\"{$EventsMessage032}\">\n\t\t\t\t\t\t\t\t<span class=\"ui-widget ui-icon ui-icon-check\"></span>\n\t\t\t\t\t\t\t</div>\n\t\t\n\t\t\t\t\t\t\t<div id=\"icon\" style=\"cursor:pointer; float:left;\" align=\"center\" class=\"ui-state-default ui-corner-all\" onclick=\"CancelScheduled('" . $v['idx'] . "')\" title=\"{$EventsMessage033}\">\n\t\t\t\t\t\t\t\t<span class=\"ui-widget ui-icon ui-icon-closethick\"></span>\n\t\t\t\t\t\t\t</div>"; } $return .= "\n\t\t\t\t\t</td>\n\t\t\t\t</tr>"; } } $return .= "</table>"; return $return; }
function GetResults(&$db, $post) { $InitTime = microtime(1); require $_SERVER['DOCUMENT_ROOT'] . "/" . $_SESSION['SiteFolder'] . "Config/Main.php"; require $_SERVER['DOCUMENT_ROOT'] . "/" . $_SESSION['SiteFolder'] . "Manager/Language/{$MainLanguage}/WebShop.php"; require $_SERVER['DOCUMENT_ROOT'] . "/" . $_SESSION['SiteFolder'] . "Manager/Language/{$MainLanguage}/CreditShop.php"; $dateClass = new Date(); $whereArray = array(); if (!empty($post['memb___id'])) { array_push($whereArray, " (memb___id = '" . $post['memb___id'] . "') "); } if (!empty($post['starting_date']) && !empty($post['ending_date'])) { $starting_date = explode("/", $post['starting_date']); $starting_date = $starting_date[2] . "-" . $starting_date[1] . "-" . $starting_date[0]; $ending_date = explode("/", $post['ending_date']); $ending_date = $ending_date[2] . "-" . $ending_date[1] . "-" . $ending_date[0] . " 23:59:59"; array_push($whereArray, " ([date] >= '{$starting_date}' AND [date] <= '{$ending_date}') "); } $where = implode("AND", $whereArray); $db->Query("SELECT idx, name FROM Z_CreditShopPacks"); $NumRows = $db->NumRows(); while ($data = $db->GetRow()) { $Packs[$data['idx']] = $data['name']; } $db->Query("SELECT * FROM Z_CreditShopLogs WHERE {$where} ORDER BY [date] DESC"); $NumRows = $db->NumRows(); for ($i = 0; $i < $NumRows; $i++) { $LogData[$i] = $db->GetRow(); } $return = "\n\t\t<table class=\"WebShopLogListTable\">\n \t<tr style=\"background-color:#000; color:#FFF;\">\n \t<th>{$WebShopMessage009}</th>\n \t<th>{$WebShopMessage010}</th>\n\t\t\t\t<th>{$CreditShopMessage53}</th>\t\t\t\t\n\t\t\t\t<th>{$WebShopMessage013}</th>\n\t\t\t\t<th>{$WebShopMessage014}</th>\n\t\t\t</tr>\n\t\t\t<tbody>\n\t\t \t"; for ($i = 0; $i < $NumRows; $i++) { $data = $LogData[$i]; if ($i > 1 && $i % 10 == 0) { $return .= "\n\t\t\t\t\t<tr style=\"background-color:#000; color:#FFF;\">\n\t\t\t\t\t<th>{$WebShopMessage009}</th>\n\t\t\t\t\t<th>{$WebShopMessage010}</th>\n\t\t\t\t\t<th>{$CreditShopMessage53}</th>\t\t\t\t\n\t\t\t\t\t<th>{$WebShopMessage013}</th>\n\t\t\t\t\t<th>{$WebShopMessage014}</th>\n\t\t\t\t</tr>\n\t\t\t\t"; } $return .= "\n\t\t\t<tr>\n\t\t\t\t<td align=\"center\">" . $data['idx'] . "</td>\n\t\t\t\t<td align=\"center\">" . $data['memb___id'] . "</td>\n\t\t\t\t<td align=\"center\">[" . $data['package'] . "] " . $Packs[$data['package']] . "</td>\n\t\t\t\t<td align=\"center\">" . $dateClass->DateFormat($data['date']) . " " . $dateClass->TimeFormat($data['date'], "h") . "</td>\n\t\t\t\t<td align=\"center\">{$CreditShopMessage06}" . $data['paidvalue'] . "{$CreditShopMessage07}</td>\n\t\t\t</tr>\n\t\t\t"; } $return .= "\n\t\t</tbody>\n\t\t</table>\n\t\t<script>\n\t\t\tfunction GoEven()\n\t\t\t{\n\t\t\t\t\$('.WebShopLogListTable tbody tr:even').addClass('HelpDeskTicketRowEven');\n\t\t\t\t\$('.WebShopLogListTable tbody tr:odd').addClass('HelpDeskTicketRowOdd');\n\t\t\t}\n\t\t\t\n\t\t\t\$(function()\n\t\t\t{\n\t\t\t\tsetTimeout(GoEven, 100);\n\t\t\t});\n\t\t</script>"; $FinalTime = microtime(1); $ProcessTime = $FinalTime - $InitTime; $return .= "<p>Proccess time: " . sprintf("%02.3f", $ProcessTime) . "</p>"; return $return; }
function ConfirmDonation(&$db, $idx) { require $_SERVER['DOCUMENT_ROOT'] . "/" . $_SESSION['SiteFolder'] . "Config/Main.php"; require $_SERVER['DOCUMENT_ROOT'] . "/" . $_SESSION['SiteFolder'] . "Config/Donations.php"; require $_SERVER['DOCUMENT_ROOT'] . "/" . $_SESSION['SiteFolder'] . "Manager/Language/{$MainLanguage}/Donations.php"; $db->Query("SELECT * FROM Z_Income WHERE idx = '{$idx}'"); $data = $db->GetRow(); require_once $_SERVER['DOCUMENT_ROOT'] . "/" . $_SESSION['SiteFolder'] . "System/Account.class.php"; $acc = new Account($db); $Amount = $data['amount']; if (isset($DonationsPercentDeposit) && $DonationsPercentDeposit != 100) { $Amount = (int) ($Amount * $DonationsPercentDeposit / 100); } $acc->AddCredits($data['memb___id'], 0, $Amount, $db); $db->Query("UPDATE Z_Income SET status = '1' , date_confirm = getdate() WHERE idx = '{$idx}'"); $dateClass = new Date(); $currentDateTime = $dateClass->DateFormat(date("Y-m-d")) . " " . $dateClass->TimeFormat(date("H:i"), "h"); $replaces = array("[number]" => $idx, "[amount]" => $Amount, "[date]" => $currentDateTime); foreach ($replaces as $Key => $Value) { $DonationsMessage29 = str_replace($Key, $Value, $DonationsMessage29); $DonationsMessage33 = str_replace($Key, $Value, $DonationsMessage33); $DonationsMessage34 = str_replace($Key, $Value, $DonationsMessage34); } if ($DonationsMessage) { $acc->NewUserMessage($db, $data['memb___id'], $DonationsMessage29, $DonationsMessage34); } if ($DonationsMail) { require_once $_SERVER['DOCUMENT_ROOT'] . "/" . $_SESSION['SiteFolder'] . "System/Mail.class.php"; $db->Query("SELECT mail_addr,memb_name FROM MEMB_INFO WHERE memb___id = '" . $data['memb___id'] . "'"); $userData = $db->GetRow(); $mailCass = new Mail(); $mailCass->SendMail($userData['mail_addr'], $userData['memb_name'], $DonationsMessage29, $DonationsMessage33); } return $DonationsMessage35; }
function GetMyFullLastBuys(&$db, &$acc, &$it) { require $_SERVER['DOCUMENT_ROOT'] . "/" . $_SESSION['SiteFolder'] . "Config/Main.php"; require $_SERVER['DOCUMENT_ROOT'] . "/" . $_SESSION['SiteFolder'] . "Config/WebShop.php"; require $_SERVER['DOCUMENT_ROOT'] . "/" . $_SESSION['SiteFolder'] . "Language/{$MainLanguage}/WebShop.php"; require_once $_SERVER['DOCUMENT_ROOT'] . "/" . $_SESSION['SiteFolder'] . "System/Date.class.php"; $dateClass = new Date(); require_once $_SERVER['DOCUMENT_ROOT'] . "/" . $_SESSION['SiteFolder'] . "System/Item.class.php"; $it = new Item(); $db->Query("SELECT * FROM Z_Currencies"); while ($data = $db->GetRow()) { $Currencies[$data['idx']] = $data['name']; } $db->Query("SELECT * FROM Z_WebShopLog WHERE memb___id = '{$acc->memb___id}' AND status = '1' ORDER BY [date] DESC"); $NumRows = $db->NumRows(); for ($i = 0; $i < $NumRows; $i++) { $LogData[$i] = $db->GetRow(); } $return = "\n\t\t<script>\n\t\tvar Working = 0;\n\t\tfunction SearchItem(idx,serial)\n\t\t{\n\t\t\tif(Working == 1) return;\n\t\t\tWorking = 1;\n\t\t\t\$(\"#ItemLocation_\"+idx).html(\"...\");\n\t\t\t\$.post(\"/" . $_SESSION['SiteFolder'] . "System/ItemFinder.php\", { idx:idx, serial:serial, gseisgaefohrhóhg:'segsvsegerblou' }, function(data) {\n\t\t\t\t\$(\"#ItemLocation_\"+idx).html(data);\n\t\t\t\tWorking = 0;\n\t\t\t});\n\t\t}\n\t\t\n\t\tfunction RemoveInsurance(idx)\n\t\t{\n\t\t\tif(confirm('{$WebShopMessage058}'))\n\t\t\t{\n\t\t\t\t\$.post(\"/" . $_SESSION['SiteFolder'] . "?c=WebShop/MyBuys/Insurance\", { idx:idx }, function(data) {\n\t\t\t\t\talert('{$WebShopMessage059}');\n\t\t\t\t\t"; $return .= "LoadContent('index.php?c=WebShop/MyBuys');"; $return .= "\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t\t</script>"; if (isset($WebShopCancelByUser) && $WebShopCancelByUser) { $return .= "\n\t\t\t<p>{$WebShopMessage050}</p>\n\t\t\t<p>{$WebShopMessage055}<br />\n\t\t\t<strong>{$WebShopCancelPercentNoInsurance}" . "%</strong> {$WebShopMessage056}<br />\n\t\t\t<strong>{$WebShopCancelPercentInsurance}" . "%</strong> {$WebShopMessage057}</p>"; } if (isset($WebShopRemoveInsuranceByUser) && $WebShopRemoveInsuranceByUser) { $return .= "<p>{$WebShopMessage060}</p>"; } $return .= "\n\t\t<table class=\"WebShopFullHistoryTable\">\n \t<tr style=\"background-color:#000; color:#FFF;\">\n \t<th>{$WebShopMessage042}</td>\n \t<th>{$WebShopMessage043}</td>\n\t\t\t\t<th>{$WebShopMessage044}</td>\n\t\t\t\t<th>{$WebShopMessage045}</td>\n\t\t\t\t<th>{$WebShopMessage046}</td>\n\t\t\t\t<th></td>\n\t\t\t</tr><tbody>\n\t\t \t"; for ($i = 0; $i < $NumRows; $i++) { $data = $LogData[$i]; if ($data['insurance'] == 1) { if (isset($WebShopRemoveInsuranceByUser) && $WebShopRemoveInsuranceByUser) { $insurance = "<a href=\"javascript:;\" onclick=\"RemoveInsurance('" . $data['idx'] . "')\" style=\"color:#00AA00\" alt=\"{$WebShopMessage048}\" title=\"{$WebShopMessage048}\">[•]</a>"; } else { $insurance = "<span style=\"color:#00AA00\">[•]</a>"; } } else { $insurance = "<span style=\"color:#FF0000\">x</span>"; } $it->AnalyseItemByHex($data['item']); $item = $it->ShowItemName($data['item']) . $it->ShowItemDetails($data['item']); $location = "\n\t\t\t<div id=\"ItemLocation_" . $data['idx'] . "\">\n\t\t\t\t<a href=\"javascript:;\" onclick=\"SearchItem('" . $data['idx'] . "','" . $data['serial'] . "')\" alt=\"{$WebShopMessage049}\" title=\"{$WebShopMessage049}\">[{$WebShopMessage047}]</a>\n\t\t\t</div>"; if ($i > 1 && $i % 10 == 0) { $return .= "\n\t\t\t\t<tr style=\"background-color:#000; color:#FFF;\">\n\t\t\t\t\t<th>{$WebShopMessage042}</td>\n\t\t\t\t\t<th>{$WebShopMessage043}</td>\n\t\t\t\t\t<th>{$WebShopMessage044}</td>\n\t\t\t\t\t<th>{$WebShopMessage045}</td>\n\t\t\t\t\t<th>{$WebShopMessage046}</td>\n\t\t\t\t\t<th></td>\n\t\t\t\t</tr>\n\t\t\t\t"; } $return .= "\n\t\t\t<tr>\n\t\t\t\t<td align=\"center\">" . $dateClass->DateFormat($data['date']) . " " . $dateClass->TimeFormat($data['date'], "h") . "</td>\n\t\t\t\t<td align=\"center\">" . $item . "</td>\n\t\t\t\t<td align=\"center\" nowrap=\"nowrap\">" . number_format($data['price'], 0, "", ".") . " " . $Currencies[$data['currency']] . "</td>\n\t\t\t\t<td align=\"center\"><div id=\"insurance_" . $data['idx'] . "\">" . $insurance . "</div></td>\n\t\t\t\t<td align=\"center\">" . $location . "</td>\n\t\t\t\t<td></td>\n\t\t\t</tr>\n\t\t\t"; } $return .= "\n\t\t</tbody>\n\t\t</table>\n\t\t"; return $return; }
function GetAllNewsModule(&$db, $TemplateFile) { require $_SERVER['DOCUMENT_ROOT'] . "/" . $_SESSION['SiteFolder'] . "Config/Main.php"; require $_SERVER['DOCUMENT_ROOT'] . "/" . $_SESSION['SiteFolder'] . "Config/News.php"; require $_SERVER['DOCUMENT_ROOT'] . "/" . $_SESSION['SiteFolder'] . "Language/{$MainLanguage}/News.php"; $dateClass = new Date(); $replaces = array('title', 'admin', 'date', 'text', 'views', 'link', 'link_url', 'time'); $db->Query("SELECT TOP {$NewsLimitModule} * FROM Z_News WHERE archive = '0' ORDER BY stick DESC, [order] ASC"); $numrows = $db->NumRows(); for ($i = 0; $i < $numrows; $i++) { $data = $db->GetRow(); $my_template = file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/" . $_SESSION['SiteFolder'] . "Templates/{$MainTemplate}/{$TemplateFile}"); $my_complement = $my_template; $link = trim($data['link']); foreach ($replaces as $k => $v) { if ($v == 'date') { $my_complement = str_replace("{date}", $dateClass->DateFormat($data['date']), $my_complement); } if ($v == 'time') { $my_complement = str_replace("{time}", $dateClass->TimeFormat($data['date']), $my_complement); } else { if ($v == 'text') { $my_complement = str_replace("{text}", $this->cutHTML($data['text'], $NewsModuleMaxChars), $my_complement); } else { if ($v == 'link') { if (substr($link, 0, 7) == "http://" && strlen($link) > 12) { $my_complement = str_replace("{link}", "<a href=\"" . $link . "\" target=\"_blank\">{$NewsMsg02}</a>", $my_complement); } else { $my_complement = str_replace("{link}", "<a href=\"/" . $_SESSION['SiteFolder'] . "?c=News/" . $data['idx'] . "\">{$NewsMsg02}</a>", $my_complement); } } else { if ($v == 'link_url') { if (substr($link, 0, 7) == "http://" && strlen($link) > 12) { $my_complement = str_replace("{link_url}", $link, $my_complement); } else { $my_complement = str_replace("{link_url}", "/" . $_SESSION['SiteFolder'] . "?c=News/" . $data['idx'] . "", $my_complement); } } else { if (!is_object($data["{$v}"])) { $my_complement = str_replace("{" . $v . "}", $data["{$v}"], $my_complement); } } } } } } $this->AllNewsReturn .= $my_complement; } return $this->AllNewsReturn; }
function RenameCharLog(&$db, $memb___id) { require $_SERVER['DOCUMENT_ROOT'] . "/" . $_SESSION['SiteFolder'] . "Config/Main.php"; require $_SERVER['DOCUMENT_ROOT'] . "/" . $_SESSION['SiteFolder'] . "Manager/Language/{$MainLanguage}/Users.php"; $dateClass = new Date(); $db->Query("SELECT [oldName],[newName],[date],[ip] FROM [Z_Rename] WHERE memb___id = '{$memb___id}'"); $return = "<hr />\n\t\t<fieldset>\n\t\t<legend>{$UsersMessage138}</legend>\n\t\t<div>\n\t\t\t<span style=\"float:left;\">{$UsersMessage001} {$memb___id}</span>\n\t\t\t<span title=\"Account Info\" style=\"float:left; cursor:pointer\" class=\"ui-icon ui-icon-info\" onclick=\"UserInfo('{$memb___id}')\"></span>\n\t\t</div><br />\n\t\t<hr />\n\t\t<table class=\"UserInfoTable HelpDeskTicketsTable\">\n\t\t\t<tr>\n\t\t\t\t<th>{$UsersMessage139}</th>\n\t\t\t\t<th>{$UsersMessage140}</th>\n\t\t\t\t<th>{$UsersMessage141}</th>\n\t\t\t\t<th>{$UsersMessage142}</th>\n\t\t\t</tr>\n\t\t\t"; while ($data = $db->GetRow()) { $return .= "\n\t\t\t\t<tr>\n\t\t\t\t\t<td>" . $data['oldName'] . "</td>\n\t\t\t\t\t<td>" . $data['newName'] . "</td>\n\t\t\t\t\t<td align=\"center\">" . $dateClass->DateFormat($data['date']) . " " . $dateClass->TimeFormat($data['date'], "h") . "</td>\n\t\t\t\t\t<td align=\"center\">" . $data['ip'] . "</td>\n\t\t\t\t</tr>\n\t\t\t\t"; } $return .= "\n\t\t</table>\n\t\t</fieldset>\n\t\t\n\t\t<script>\n\t\t\tfunction Go()\n\t\t\t{\n\t\t\t\t\$('.UserInfoTable tbody tr:even').addClass('HelpDeskTicketRowEven');\n\t\t\t\t\$('.UserInfoTable tbody tr:odd').addClass('HelpDeskTicketRowOdd');\n\t\t\t}\n\t\t\t\n\t\t\t\$(function()\n\t\t\t{\n\t\t\t\tsetTimeout(Go, 100);\n\t\t\t});\n\t\t</script>"; return $return; }
function GetFindResults(&$db, $post) { require $_SERVER['DOCUMENT_ROOT'] . "/" . $_SESSION['SiteFolder'] . "Config/Main.php"; require $_SERVER['DOCUMENT_ROOT'] . "/" . $_SESSION['SiteFolder'] . "Manager/Language/{$MainLanguage}/HelpDesk.php"; $returnArray = array(); if (!empty($post['TicketId'])) { $db->Query("SELECT * FROM Z_HelpDeskTickets WHERE idx = '" . $post['TicketId'] . "'"); array_push($returnArray, $db->GetRow()); } if (!empty($post['memb___id'])) { $db->Query("SELECT * FROM Z_HelpDeskTickets WHERE memb___id = '" . $post['memb___id'] . "' ORDER BY idx DESC"); while ($data = $db->GetRow()) { if (!in_array($data, $returnArray)) { array_push($returnArray, $data); } } } if (!empty($post['starting_date']) && !empty($post['ending_date'])) { $starting_date = explode("/", $post['starting_date']); $starting_date = $starting_date[2] . "-" . $starting_date[1] . "-" . $starting_date[0]; $ending_date = explode("/", $post['ending_date']); $ending_date = $ending_date[2] . "-" . $ending_date[1] . "-" . $ending_date[0] . " 23:59:59"; $db->Query("SELECT * FROM Z_HelpDeskTickets WHERE created >= '{$starting_date}' AND created <= '{$ending_date}' ORDER BY created DESC"); while ($data = $db->GetRow()) { if (!in_array($data, $returnArray)) { array_push($returnArray, $data); } } } if (!empty($post['ip'])) { $db->Query("SELECT * FROM Z_HelpDeskTickets WHERE idx IN (SELECT ticket_idx FROM Z_HelpDeskMessages WHERE ip = '" . $post['ip'] . "') ORDER BY idx DESC"); while ($data = $db->GetRow()) { if (!in_array($data, $returnArray)) { array_push($returnArray, $data); } } } $dateClass = new Date(); $managerClass = new Manager(); $return = "\n\t\t<table class=\"HelpDeskSearchResultsTable\">\n\t\t<tr><th>{$HelpDeskMessage001}</th><th>{$HelpDeskMessage016}</th><th>{$HelpDeskMessage002}</th><th>{$HelpDeskMessage003}</th><th>{$HelpDeskMessage004}</th><th>{$HelpDeskMessage005}</th></tr><tbody>"; foreach ($returnArray as $Key => $Value) { $return .= "\n\t\t\t<tr onclick=\"OpenTicket('" . $Value['idx'] . "')\" style=\"cursor:pointer\">\n\t\t\t <td align=\"center\"><strong>" . $Value['idx'] . "</strong></td>\n\t\t\t <td align=\"center\">" . $Value['memb___id'] . "</td>\n\t\t\t <td align=\"center\">" . $dateClass->DateFormat($Value['created']) . " " . $dateClass->TimeFormat($Value['created'], "h") . "</td>\n\t\t\t <td align=\"center\">" . $dateClass->DateFormat($Value['last_update']) . " " . $dateClass->TimeFormat($Value['last_update'], "h") . "</td>\n\t\t\t <td align=\"center\">"; $UserName = $managerClass->GetUserName($Value['admin'], $db); if ($UserName == $_SESSION['ManagerName']) { $return .= "<strong>{$UserName}</strong>"; } else { $return .= $UserName; } $return .= "</td>\n\t\t\t <td align=\"center\">" . $this->TicketStatus($Value['status']) . "</td>"; $return .= "</tr>"; } $return .= "</tbody></table>\n\t\t<script>\n\t\t\tfunction Go()\n\t\t\t{\n\t\t\t\t\$('.HelpDeskSearchResultsTable tbody tr:even').addClass('HelpDeskTicketRowEven');\n\t\t\t\t\$('.HelpDeskSearchResultsTable tbody tr:odd').addClass('HelpDeskTicketRowOdd');\n\t\t\t}\n\t\t\t\n\t\t\t\$(function()\n\t\t\t{\n\t\t\t\tsetTimeout(Go, 100);\n\t\t\t});\n\t\t</script>"; return $return; }
function GetResults(&$db, $post) { $InitTime = microtime(1); require $_SERVER['DOCUMENT_ROOT'] . "/" . $_SESSION['SiteFolder'] . "Config/Main.php"; require $_SERVER['DOCUMENT_ROOT'] . "/" . $_SESSION['SiteFolder'] . "Manager/Language/{$MainLanguage}/WebShop.php"; require_once $_SERVER['DOCUMENT_ROOT'] . "/" . $_SESSION['SiteFolder'] . "System/Item.class.php"; $it = new Item(); $dateClass = new Date(); $db->Query("SELECT * FROM Z_Currencies"); while ($data = $db->GetRow()) { $Currencies[$data['idx']] = $data['name']; } $whereArray = array(); if (!empty($post['memb___id'])) { array_push($whereArray, " (memb___id = '" . $post['memb___id'] . "') "); } if (!empty($post['starting_date']) && !empty($post['ending_date'])) { $starting_date = explode("/", $post['starting_date']); $starting_date = $starting_date[2] . "-" . $starting_date[1] . "-" . $starting_date[0]; $ending_date = explode("/", $post['ending_date']); $ending_date = $ending_date[2] . "-" . $ending_date[1] . "-" . $ending_date[0] . " 23:59:59"; array_push($whereArray, " ([date] >= '{$starting_date}' AND [date] <= '{$ending_date}') "); } if ($post['canceled'] != "true") { if ($post['currency'] == "vip_item") { array_push($whereArray, " (deleted = '0') "); } else { array_push($whereArray, " (status = '1') "); } } if ($post['currency'] != "*" && $post['currency'] != "vip_item" && is_numeric($post['currency'])) { array_push($whereArray, " (currency = '" . $post['currency'] . "') "); } $where = implode("AND", $whereArray); if ($post['currency'] == "vip_item") { $db->Query("SELECT * FROM Z_VipItemData WHERE {$where} ORDER BY [date] DESC"); } else { $db->Query("SELECT * FROM Z_WebShopLog WHERE {$where} ORDER BY [date] DESC"); } $NumRows = $db->NumRows(); for ($i = 0; $i < $NumRows; $i++) { $LogData[$i] = $db->GetRow(); } $return = "\n\t\t<table class=\"WebShopLogListTable\">\n \t<tr style=\"background-color:#000; color:#FFF;\">\n \t<th>{$WebShopMessage009}</th>\n \t<th>{$WebShopMessage010}</th>\n\t\t\t\t<th>{$WebShopMessage011}</th>\n\t\t\t\t<th>{$WebShopMessage012}</th>\n\t\t\t\t<th>{$WebShopMessage013}</th>\n\t\t\t\t"; if ($post['currency'] != "vip_item") { $return .= "\n\t\t\t\t\t<th>{$WebShopMessage018}</th>\n\t\t\t\t\t<th>{$WebShopMessage014}</th>\n\t\t\t\t\t<th>{$WebShopMessage015}</th>\n\t\t\t\t\t<th>{$WebShopMessage016}</th>"; } $return .= "\n\t\t\t\t\n\t\t\t\t<th>{$WebShopMessage017}</th>\n\t\t\t\t<th><input type=\"button\" name=\"cancelBt\" id=\"cancelBt\" onclick=\"CancelPurchase()\" value=\"{$WebShopMessage024}\" /></td>\n\t\t\t</tr><tbody>\n\t\t \t"; for ($i = 0; $i < $NumRows; $i++) { $data = $LogData[$i]; if ($data['insurance'] == 1) { $insurance = "\n\t\t\t\t<div id=\"icon\" align=\"center\" class=\"ui-state-default ui-corner-all\">\n\t\t\t\t\t<span class=\"ui-widget\" style=\"color:#000000; font-weigth: bold; float: left; background-color: #00FF00\">O</span>\n\t\t\t\t</div>\t\t\t\t\n\t\t\t\t<div id=\"icon\" style=\"cursor:pointer;\" align=\"center\" class=\"ui-state-default ui-corner-all\" onclick=\"ToggleInsurance('" . $data['idx'] . "')\" title=\"{$WebShopMessage111}\">\n\t\t\t\t\t<span class=\"ui-widget ui-icon ui-icon-circle-close\"></span>\n\t\t\t\t</div>\n\t\t\t\t"; } else { $insurance = "\n\t\t\t\t<div id=\"icon\" align=\"center\" class=\"ui-state-default ui-corner-all\">\n\t\t\t\t\t<span class=\"ui-widget\" style=\"color:#FFFFFF; font-weigth: bold; float: left; background-color: #660000\">X</span>\n\t\t\t\t</div>\t\t\t\t\n\t\t\t\t<div id=\"icon\" style=\"cursor:pointer;\" align=\"center\" class=\"ui-state-default ui-corner-all\" onclick=\"ToggleInsurance('" . $data['idx'] . "')\" title=\"{$WebShopMessage112}\">\n\t\t\t\t\t<span class=\"ui-widget ui-icon ui-icon-circle-check\"></span>\n\t\t\t\t</div>\n\t\t\t\t"; } $it->AnalyseItemByHex($data['item']); $item = $it->ShowItemName($data['item']) . $it->ShowItemDetails($data['item']); $serial = $data['serial']; $location = ""; if (isset($post['Search']) && $post['Search'] == "true") { $WebVault = $it->LocateItemBySerial($db, $serial, "webvault"); if (is_array($WebVault)) { foreach ($WebVault as $key => $value) { $location .= "{$WebShopMessage019} " . $value . "<br />"; } } $WebTrade = $it->LocateItemBySerial($db, $serial, "webtrade"); if (is_array($WebTrade)) { foreach ($WebTrade as $key => $value) { $location .= "{$WebShopMessage020} " . $value . "<br />"; } } $Warehouse = $it->LocateItemBySerial($db, $serial, "warehouse"); if (is_array($Warehouse)) { foreach ($Warehouse as $key => $value) { $location .= "{$WebShopMessage021} " . $value . "<br />"; } } /*$ExtWarehouse = $it->LocateItemBySerial($db, $serial, "extWarehouse"); if(is_array($ExtWarehouse)) foreach($ExtWarehouse as $key=>$value) $location .= "$WebShopMessage023 ". $value ."<br />";*/ $Character = $it->LocateItemBySerial($db, $serial, "character"); if (is_array($Character)) { foreach ($Character as $key => $value) { $location .= "{$WebShopMessage022} " . $value . "<br />"; } } if ($location == "") { $location = "<span style=\"color:#990000; font-weigth: bold;\">X</span>"; } } else { $SearchInto = "currency"; if ($post['currency'] == "vip_item") { $SearchInto = "vip_item"; } $location = "\n\t\t\t\t<div id=\"ItemLocation_" . $data['idx'] . "\">\n\t\t\t\t\t<div id=\"icon\" style=\"cursor:pointer;\" align=\"center\" class=\"ui-state-default ui-corner-all\" onclick=\"SearchItem('" . $data['idx'] . "','{$SearchInto}')\" title=\"{$WebShopMessage110}\">\n\t\t\t\t\t\t<span class=\"ui-widget ui-icon ui-icon-search\"></span>\n\t\t\t\t\t</div>\n\t\t\t\t</div>"; } if ($i > 1 && $i % 10 == 0) { $return .= "\n\t\t\t\t<tr style=\"background-color:#000; color:#FFF;\">\n\t\t\t\t\t<th>{$WebShopMessage009}</td>\n\t\t\t\t\t<th>{$WebShopMessage010}</td>\n\t\t\t\t\t<th>{$WebShopMessage011}</td>\n\t\t\t\t\t<th>{$WebShopMessage012}</td>\n\t\t\t\t\t<th>{$WebShopMessage013}</td>"; if ($post['currency'] != "vip_item") { $return .= "\n\t\t\t\t\t<th>{$WebShopMessage018}</td>\n\t\t\t\t\t<th>{$WebShopMessage014}</td>\n\t\t\t\t\t<th>{$WebShopMessage015}</td>\n\t\t\t\t\t<th>{$WebShopMessage016}</td>"; } $return .= "\n\t\t\t\t\t<th>{$WebShopMessage017}</td>\n\t\t\t\t\t<th><input type=\"button\" name=\"cancelBt\" id=\"cancelBt\" onclick=\"CancelPurchase()\" value=\"{$WebShopMessage024}\" /></td>\n\t\t\t\t</tr>\n\t\t\t\t"; } $return .= "\n\t\t\t<tr>\n\t\t\t\t<td align=\"center\">" . $data['idx'] . "</td>\n\t\t\t\t<td align=\"center\">" . $data['memb___id'] . "</td>\n\t\t\t\t<td align=\"center\">" . $item . "</td>\n\t\t\t\t<td align=\"center\">" . $data['serial'] . "</td>\n\t\t\t\t<td align=\"center\">" . $dateClass->DateFormat($data['date']) . " " . $dateClass->TimeFormat($data['date'], "h") . "</td>"; if ($post['currency'] != "vip_item") { $return .= "\n\t\t\t\t\t<td align=\"center\">" . $Currencies[$data['currency']] . "</td>\n\t\t\t\t\t<td align=\"center\">" . number_format($data['price'], 0, "", ".") . "</td>\n\t\t\t\t\t<td align=\"center\"><div id=\"insurance_" . $data['idx'] . "\">" . $insurance . "</div></td>\n\t\t\t\t\t<td align=\"center\">" . $data['amount'] . "</td>"; } $return .= "\n\t\t\t\t<td align=\"center\">" . $location . "</td>\n\t\t\t\t<td>\n\t\t\t\t\t<div style=\"float:left;\" align=\"center\" class=\"ui-state-default ui-corner-all\" >\n\t\t\t\t\t\t<input type=\"checkbox\" name=\"cancel\" id=\"cancel\" value=\"" . $data['idx'] . "\""; if ($data['status'] == 0) { $return .= " disabled=\"disabled\" "; } $return .= " />\n\t\t\t\t\t</div>\n\t\t\t\t\n\t\t\t\t</td>\n\t\t\t</tr>\n\t\t\t"; } $return .= "\n\t\t</tbody>\n\t\t</table>\n\t\t<script>\n\t\t\tfunction GoEven()\n\t\t\t{\n\t\t\t\t\$('.WebShopLogListTable tbody tr:even').addClass('HelpDeskTicketRowEven');\n\t\t\t\t\$('.WebShopLogListTable tbody tr:odd').addClass('HelpDeskTicketRowOdd');\n\t\t\t}\n\t\t\t\n\t\t\t\$(function()\n\t\t\t{\n\t\t\t\tsetTimeout(GoEven, 100);\n\t\t\t});\n\t\t</script>"; $FinalTime = microtime(1); $ProcessTime = $FinalTime - $InitTime; $return .= "<p>Proccess time: " . sprintf("%02.3f", $ProcessTime) . "</p>"; return $return; }