private function Warning() { global $CTM_Template, $CTM; $Check = $this->NumQuery("SELECT * FROM dbo.{$CTM[5]}"); $CTM_BBCode = new CTM_BBCode(); if ($Check > 0 && constant("Show_Warning") == TRUE) { $Load = $this->FetchQuery("SELECT Date,Text,Account FROM dbo.{$CTM[5]}"); $Character = $this->FetchQuery("SELECT name FROM dbo.{$CTM[0]} WHERE account='{$Load[2]}'"); $Open = fopen("templates/" . $CTM_Template->Open() . "/pages/home[WARNING].pag.php", "r"); $CTM_Template->Set("%SHOW_WARNING%", fread($Open, filesize("templates/" . $CTM_Template->Open() . "/pages/home[WARNING].pag.php"))); $CTM_Template->Set("%WARNING_MESSAGE%", nl2br($CTM_BBCode->Replace(base64_decode($Load[1])))); $CTM_Template->Set("%WARNING_LINK%", urlencode($Character[0])); $CTM_Template->Set("%WARNING_CHAR%", $Character[0]); $CTM_Template->Set("%WARNING_DATE%", date("d/m/Y", $Load[0])); $CTM_Template->Set("%WARNING_TIME%", date("H:i", $Load[0])); } else { $CTM_Template->Set("%SHOW_WARNING%", NULL); } }
private function Resp_Payment() { global $CTM_General, $CTM_Template, $CTM; $CTM_BBCode = new CTM_BBCode(); if ($_GET["cmd"] == TRUE) { $Id = $_GET["id"]; $Text = base64_encode(str_replace("\\", "", $_POST["Text"])); $Character = $this->FetchQuery("SELECT Character FROM dbo.{$CTM[10]} WHERE Id='{$Id}'"); if (empty($Text)) { exit("<div class=\"warning-box\"> Digite a mensagem.</div>"); } else { $this->Query("INSERT INTO dbo.{$CTM[11]} (Date,Character,PaymentID,Text) VALUES(" . strtotime("now") . ",'{$Character[0]}',{$Id},'{$Text}')"); exit("<div class=\"success-box\"> Resposta enviada com Sucesso</div>"); } } $Id = $_GET["id"]; $Query = $this->Query("SELECT * FROM dbo.{$CTM[10]} WHERE Id='{$Id}'"); $Check = $this->NumRow($Query); if ($Check < 1) { exit("<div class=\"error-box\"> Este Pagamento não existe.</div>"); } $Load = $this->FetchArray($Query); $Image = $CTM_General->Image($Load["Character"]); $Resp_Query = $this->Query("SELECT Date,Character,Text FROM dbo.{$CTM[11]} WHERE PaymentID='{$Id}' ORDER BY Id DESC"); switch ($Load["Status"]) { case 0: $Status = "<strong><font color=\"blue\">Aberto</font></strong>"; break; case 1: $Status = "<strong><font color=\"green\">Confirmado</font></strong>"; break; case 2: $Status = "<strong><font color=\"red\">Rejeitado</font></strong>"; break; } $CTM_Template->Set("Payment_Post#Date", date("d/m/Y", $Load["Time"])); $CTM_Template->Set("Payment_Char#Image", $Image); $CTM_Template->Set("Payment_Char", $Load["Character"]); $CTM_Template->Set("Payment_Post#Time", date("H:i", $Load["Time"])); $CTM_Template->Set("Payment_Amount", $Load["Golds"]); $CTM_Template->Set("Payment_Bank", base64_decode($Load["Bank"])); $CTM_Template->Set("Payment_Type", $Load["Payment"]); $CTM_Template->Set("Payment_Date", $Load["Date"]); $CTM_Template->Set("Payment_Price", $Load["Price"]); $CTM_Template->Set("Payment_Master", $Load["Master"]); $CTM_Template->Set("Payment_Document", $Load["Document"]); $CTM_Template->Set("Payment_Message", @nl2br($CTM_BBCode->Replace(@base64_decode($Load["Text"])))); $CTM_Template->Set("Payment_ID", $Load["Id"]); $CTM_Template->Set("Payment_Status", $Status); while ($Resp = $this->Fetch($Resp_Query)) { $New_Img = $CTM_General->Image($Resp[1]); $Staff = $this->NumQuery("SELECT Name FROM dbo.{$CTM[0]} WHERE Name='{$Resp[1]}'"); $Payment = $Staff > 0 ? " style=\"background-color:#CFE6FF\"" : NULL; $Return .= "<blockquote{$Payment}>\r\n\t<table border=\"0\">\r\n \t\t\t <tr>\r\n \t\t\t <td width=\"135\"><img src=\"" . $New_Img . "\" width=\"120\" height=\"120\" style=\"border: 1px solid #B3B3B3;\" class=\"image\" /></td>\r\n \t\t\t <td width=\"493\"><table border=\"0\">\r\n\t\t\t\t <tr>\r\n \t\t\t <td><blockquote>Postado por: <b class=\"colr\">" . $Resp[1] . "</b> em <b class=\"colr\">" . date("d/m/Y", $Resp[0]) . "</b> as <b class=\"colr\">" . date("H:i", $Resp[0]) . "</b></blockquote></td>\r\n\t\t\t\t </tr>\r\n\t\t\t\t <tr>\r\n \t\t\t <td><blockquote>" . nl2br($CTM_BBCode->Replace(base64_decode($Resp[2]))) . "</blockquote></td>\r\n\t\t\t\t </tr>\r\n \t\t\t</table>\r\n\t\t\t\t</td>\r\n \t\t\t</tr>\r\n\t\t\t</table>\r\n\t\t</blockquote>"; } $CTM_Template->Set("Payment_Resp", $Return); unset($Return); }
private function Show_Comments() { global $CTM_General, $CTM; $CTM_BBCode = new CTM_BBCode(); $Id = $_GET["id"]; $Account = $_SESSION["Hash_Account"]; $Find_Comments = $this->Query("SELECT * FROM dbo.{$CTM[23]} WHERE NoticeID='{$Id}' ORDER BY Id DESC"); while ($Comments = $this->FetchArray($Find_Comments)) { $Return .= "<blockquote>\r\n\t<table width=\"638\" border=\"0\">\r\n \t\t\t <tr>\r\n \t\t\t <td width=\"135\"><img src=\"" . $CTM_General->Image($Comments["User_Char"]) . "\" width=\"120\" height=\"120\" style=\"border: 1px solid #B3B3B3;\" class=\"image\" /></td>\r\n \t\t\t <td width=\"493\"><table width=\"445\" border=\"0\">\r\n\t\t\t\t <tr>\r\n \t\t\t <td><blockquote>Postado por: <a href=\"javascript: void(EffectWeb);\" onclick=\"CTM_Load('?pag=search&char=" . urlencode($Comments["User_Char"]) . "','conteudo','GET');\"><b class=\"colr\">" . $Comments["User_Char"] . "</b></a> em <b class=\"colr\">" . date("d/m/Y", $Comments["Comment_Date"]) . "</b></blockquote></td>\r\n\t\t\t\t </tr>\r\n\t\t\t\t <tr>\r\n \t\t\t <td><blockquote>" . nl2br($CTM_BBCode->Replace(strip_tags(base64_decode($Comments["Text"])))) . "</blockquote></td>\r\n\t\t\t\t </tr>\r\n \t\t\t</table>\r\n\t\t\t\t</td>\r\n \t\t\t</tr>\r\n\t\t\t</table>\r\n\t\t</blockquote>"; } exit($Return); unset($Return); }
private function Manage_Payment() { global $CTM_General, $CTM_Template, $CTM, $_PanelAdmin; $CTM_BBCode = new CTM_BBCode(); $Id = $_GET["id"]; $Query = $this->Query("SELECT * FROM dbo.{$CTM[10]} WHERE Id='{$Id}'"); $Check = $this->NumRow($Query); if ($Check < 1) { exit("<div class=\"error-box\"> Este Pagamento não existe.</div>"); } if ($_GET["cmd"] == "resp") { $Id = $_GET["id"]; $Text = base64_encode(str_replace("\\", "", $_POST["Text"])); $Character = $this->FetchQuery("SELECT name FROM dbo.{$CTM[0]} WHERE account='{$this->Login}'"); if (empty($Text)) { exit("<div class=\"warning-box\"> Digite a mensagem.</div>"); } else { $this->Query("INSERT INTO dbo.{$CTM[11]} (Date,Character,PaymentID,Text) VALUES(" . strtotime("now") . ",'{$Character[0]}',{$Id},'{$Text}')"); exit("<div class=\"success-box\"> Resposta enviada com Sucesso</div>"); } } if ($_GET["cmd"] == "confirm") { $Id = $_GET["id"]; $Payment = $this->FetchQuery("SELECT Golds,Account,Status FROM dbo.{$CTM[10]} WHERE Id='{$Id}'"); if ($Payment[2] == 1) { exit("<div class=\"info-box\"> Este pagamento já se encontra Confirmado</div>"); } elseif ($Payment[2] == 2) { exit("<div class=\"error-box\"> Este pagamento se encontra Rejeitado</div>"); } else { if ($_PanelAdmin["Payment"]["Auto_Credit"] == TRUE) { $CTM_General->Check_Coin_Table($Payment[1]); $this->Query("UPDATE " . GL_DB . ".dbo." . GL_Table . " SET " . GL_Column_1 . "=" . GL_Column_1 . "+{$Payment[0]} WHERE " . GL_Login . "='{$Payment[1]}'"); } $Credit = $_PanelAdmin["Payment"]["Auto_Credit"] == TRUE ? "<br />Creditado <b>{$Payment[0]} " . Gold . "</b> na conta <b>{$Payment[1]}</b>" : NULL; $this->Query("UPDATE dbo.{$CTM[10]} SET Status=1 WHERE Id='{$Id}'"); exit("<div class=\"success-box\"> Pagamento Confirmado com Sucesso!{$Credit}</div>"); } } if ($_GET["cmd"] == "rejet") { $Id = $_GET["id"]; $Payment = $this->FetchQuery("SELECT Status FROM dbo.{$CTM[10]} WHERE Id='{$Id}'"); if ($Payment[0] == 1) { exit("<div class=\"info-box\"> Este pagamento se encontra Confirmado</div>"); } elseif ($Payment[0] == 2) { exit("<div class=\"error-box\"> Este pagamento já se encontra Rejeitado</div>"); } else { $this->Query("UPDATE dbo.{$CTM[10]} SET Status=2 WHERE Id='{$Id}'"); exit("<div class=\"success-box\"> Pagamento Rejeitado com Sucesso!</div>"); } } if ($_GET["cmd"] == "delete") { if ($this->Privilegy($_PanelAdmin["Payment"]["Delete"], 1) == FALSE) { exit("<div class=\"error-box\"> Você não tem permisão para executar este comando.</div>"); } else { $this->Query("DELETE dbo.{$CTM[10]} WHERE Id='{$Id}'"); $this->Query("DELETE dbo.{$CTM[11]} WHERE PaymentID='{$Id}'"); exit("<div class=\"success-box\"> Pagamento deletado com Sucesso!</div>"); } } $Load = $this->FetchArray($Query); $Image = $CTM_General->Image($Load["Character"]); $Resp_Query = $this->Query("SELECT Date,Character,Text FROM dbo.{$CTM[11]} WHERE PaymentID='{$Id}' ORDER BY Id DESC"); switch ($Load["Status"]) { case 0: $Status = "<strong><font color=\"blue\">Aberto</font></strong>"; break; case 1: $Status = "<strong><font color=\"green\">Confirmado</font></strong>"; break; case 2: $Status = "<strong><font color=\"red\">Rejeitado</font></strong>"; break; } while ($Resp = $this->Fetch($Resp_Query)) { $New_Img = $CTM_General->Image($Resp[1]); $Staff = $this->NumQuery("SELECT Name FROM dbo.{$CTM[0]} WHERE Name='{$Resp[1]}'"); $Payment = $Staff > 0 ? " style=\"background-color:#CFE6FF\"" : NULL; $Return .= "<blockquote{$Payment}>\n\t<table border=\"0\">\n \t\t\t <tr>\n \t\t\t <td width=\"135\"><img src=\"" . $New_Img . "\" width=\"120\" height=\"120\" style=\"border: 1px solid #B3B3B3;\" class=\"image\" /></td>\n \t\t\t <td width=\"493\"><table border=\"0\">\n\t\t\t\t <tr>\n \t\t\t <td><blockquote>Postado por: <b class=\"colr\">" . $Resp[1] . "</b> em <b class=\"colr\">" . date("d/m/Y", $Resp[0]) . "</b> as <b class=\"colr\">" . date("H:i", $Resp[0]) . "</b></blockquote></td>\n\t\t\t\t </tr>\n\t\t\t\t <tr>\n \t\t\t <td><blockquote>" . nl2br($CTM_BBCode->Replace(base64_decode($Resp[2]))) . "</blockquote></td>\n\t\t\t\t </tr>\n \t\t\t</table>\n\t\t\t\t</td>\n \t\t\t</tr>\n\t\t\t</table>\n\t\t</blockquote>\n\r"; } $CTM_Template->Set("Payment_Post#Date", date("d/m/Y", $Load["Time"])); $CTM_Template->Set("Payment_Char#Image", $Image); $CTM_Template->Set("Payment_Char", $Load["Character"]); $CTM_Template->Set("Payment_Time", date("H:i", $Load["Time"])); $CTM_Template->Set("Payment_Status", $Status); $CTM_Template->Set("Payment_Amounts", $Load["Golds"]); $CTM_Template->Set("Payment_Bank", base64_decode($Load["Bank"])); $CTM_Template->Set("Payment_Type", $Load["Payment"]); $CTM_Template->Set("Payment_Date", $Load["Date"]); $CTM_Template->Set("Payment_Price", $Load["Price"]); $CTM_Template->Set("Payment_Master", $Load["Master"]); $CTM_Template->Set("Payment_Document", $Load["Document"]); $CTM_Template->Set("Payment_Message", @nl2br($CTM_BBCode->Replace(@base64_decode($Load["Text"])))); $CTM_Template->Set("Resp_List", $Return); $CTM_Template->Set("Payment_ID", $Load["Id"]); $CTM_Template->Set("%DELETE_BUTTON%", $this->Privilegy($_PanelAdmin["Payment"]["Delete"], 1) == TRUE ? " <input type=\"button\" value=\"Deletar Pagamento\" onclick=\"Delete_Payment();\" />" : NULL); unset($Return); }
public function View_ScreenShot() { global $CTM_General, $CTM_Template, $CTM; $CTM_BBCode = new CTM_BBCode(); $Id = $_GET["view"]; $Query = $this->Query("SELECT * FROM dbo.{$CTM[20]} WHERE Id='{$Id}'"); $Check = $this->NumRow($Query); if ($Check < 1) { exit("<div class=\"error-box\"> Esta ScreenShot não existe.</div>"); } else { if ($_GET["cmd"] == "vote") { if ($CTM_General->Check_Logged(2) == TRUE) { exit("<div class=\"error-box\"> Para votar é preciso estar Logado.<div>"); } else { $Votes = $_POST["Votes"]; $Find_Votes = $this->FetchQuery("SELECT Votes FROM dbo.{$CTM[20]} WHERE Id='{$Id}'"); $Check_Vote = $this->NumQuery("SELECT * FROM dbo.{$CTM[21]} WHERE ScreenID='{$Id}' and Account='{$this->Login}'"); if ($Check_Vote > 0) { exit("<div class=\"info-box\"> Você já votou nesta ScreenShot.</div>"); } else { $Screen_Votes = $Find_Votes[0] + $Votes; $this->Query("INSERT INTO dbo.{$CTM[21]} (Account,Vote,ScreenID) VALUES ('{$this->Login}',{$Votes},{$Id})"); $this->Query("UPDATE dbo.{$CTM[20]} SET Votes=Votes+{$Votes} WHERE Id='{$Id}'"); exit("<div class=\"success-box\"> Voto computado com Sucesso!</div>\n\t\t\t\t\t\t<script>document.getElementById('Screen_Votes').innerHTML = '" . $Screen_Votes . "';</script>"); } } } if ($_GET["cmd"] == "comment") { if ($CTM_General->Check_Logged(2) == TRUE) { exit("<div class=\"error-box\"> Para comentar é preciso estar Logado.<div>"); } else { $Character = $_POST["Character"]; $Comment = base64_encode($_POST["Text"]); if (empty($Character)) { exit("<div class=\"warning-box\"> Selecione o personagem.</div>"); } elseif (empty($Comment)) { exit("<div class=\"warning-box\"> Digite seu comentario.</div>"); } else { $this->Query("INSERT INTO dbo.{$CTM[22]} (ScreenID,Account,User_Char,Comment_Date,Text) VALUES ({$Id},'{$this->Login}','{$Character}'," . time() . ",'{$Comment}')"); exit("<script>CTM_Load('?pag=screenshots&view={$Id}','conteudo','GET');</script>"); } } } $ScreenShot = $this->FetchArray($Query); $Find_Comments = $this->Query("SELECT * FROM dbo.{$CTM[22]} WHERE ScreenID='{$Id}' ORDER BY Id DESC"); $Find_Characters = $this->Query("SELECT Name FROM " . MuGen_DB . ".dbo.Character WHERE AccountID='{$this->Login}'"); $Link .= "http://"; $Link .= $_SERVER["HTTP_HOST"]; $Link .= $_SERVER["PHP_SELF"]; $Link .= "?do=screenshots&id=" . $ScreenShot["Id"]; $Date = date("d/m/Y", $ScreenShot["Up_Date"]); $Description = $ScreenShot["Description"] == "NULL" ? "Sem Informação" : nl2br($CTM_BBCode->Replace(base64_decode($ScreenShot["Description"]))); while ($Comments = $this->FetchArray($Find_Comments)) { $Return .= "<blockquote>\n\t<table width=\"638\" border=\"0\">\n \t\t\t <tr>\n \t\t\t <td width=\"135\"><img src=\"" . $CTM_General->Image($Comments["User_Char"]) . "\" width=\"120\" height=\"120\" style=\"border: 1px solid #B3B3B3;\" class=\"image\" /></td>\n \t\t\t <td width=\"493\"><table width=\"445\" border=\"0\">\n\t\t\t\t <tr>\n \t\t\t <td><blockquote>Postado por: <a href=\"javascript: void(EffectWeb);\" onclick=\"CTM_Load('?pag=search&char=" . urlencode($Comments["User_Char"]) . "','conteudo','GET');\"><b class=\"colr\">" . $Comments["User_Char"] . "</b></a> em <b class=\"colr\">" . date("d/m/Y", $Comments["Comment_Date"]) . "</b></blockquote></td>\n\t\t\t\t </tr>\n\t\t\t\t <tr>\n \t\t\t <td><blockquote>" . nl2br($CTM_BBCode->Replace(base64_decode($Comments["Text"]))) . "</blockquote></td>\n\t\t\t\t </tr>\n \t\t\t</table>\n\t\t\t\t</td>\n \t\t\t</tr>\n\t\t\t</table>\n\t\t</blockquote>"; } while ($Characters = $this->Fetch($Find_Characters)) { $Character .= "<option value=\"{$Characters[0]}\">{$Characters[0]}</option>\n"; } $CTM_Template->Set("ScreenShot[Id]", $ScreenShot["Id"]); $CTM_Template->Set("ScreenShot[Image]", constant("Upload_SS") . $ScreenShot["ScreenShot"]); $CTM_Template->Set("ScreenShot[Description]", $Description); $CTM_Template->Set("ScreenShot[Autor]", $ScreenShot["User_Char"]); $CTM_Template->Set("ScreenShot[Date]", $Date); $CTM_Template->Set("ScreenShot[Votes]", $ScreenShot["Votes"]); $CTM_Template->Set("ScreenShot[Link]", $Link); $CTM_Template->Set("ScreenShot[Comments]", $Return); $CTM_Template->Set("ScreenShot[Characters]", $Character); unset($Link); unset($Return); unset($Character); } }