Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /* decube.xyz*/
- echo "<!-- DARKDEV.EU -->
- <!-- This website is using the premium version of DeviliumWeb CMS -->
- <!-- To purchase contact visit www.darkdev.eu -->
- ";
- $domain = $_SERVER["SERVER_NAME"];
- $ch = curl_init();
- curl_setopt($ch, CURLOPT_URL, "http://darkdev.eu/licenta_web.php");
- curl_setopt($ch, CURLOPT_HEADER, false);
- curl_setopt($ch, CURLOPT_POST, true);
- curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
- curl_setopt($ch, CURLOPT_POSTFIELDS, array("id" => "3", "ip" => "" . $server . "", "domain" => "" . $domain . "", "user_key" => "3", "submit" => "Send"));
- $result = curl_exec($ch);
- echo "$result";
- curl_close($ch);
- if (empty($result)) {
- function error($text)
- {
- echo "<div class=\"msg_error\" align=\"left\" id=\"msg\">" . $text . "</div></div>";
- }
- function succes($text)
- {
- echo "<div class=\"msg_succes\" align=\"left\" id=\"msg\">" . $text . "</div></div>";
- }
- function success($text)
- {
- echo "<div class=\"msg_succes\" align=\"left\" id=\"msg\">" . $text . "</div></div>";
- }
- function login()
- {
- if (isset($_POST["submit"])) {
- $username = replace($_POST["username"]);
- $password = replace($_POST["password"]);
- $sql = "SELECT count(*) FROM account.account where (login='$username' AND password=PASSWORD('" . $password . "'))";
- $res = mysql_query($sql);
- $row = mysql_fetch_array($res);
- $acc = mysql_fetch_object(mysql_query("SELECT id,web_admin,web_aktiviert FROM account.account where (login='$username' AND password=PASSWORD('" . $password . "'))"));
- if (0 < $row[0]) {
- if ($acc->web_aktiviert == "0") {
- error("Cont inactiv");
- echo "<meta http-equiv=\"refresh\" content=\"1;url=index.php?page=email-activare\">";
- }
- else {
- $_SESSION["user"] = $username;
- $_SESSION["pass"] = $password;
- $_SESSION["userid"] = $acc->id;
- $_SESSION["admin"] = $acc->web_admin;
- echo "<center>Logare reusita</center><meta http-equiv=\"refresh\" content=\"1;url=index.php\">";
- }
- }
- else {
- echo "<center>Logare esuata</center>";
- echo "<center>Logare esuata</center><meta http-equiv=\"refresh\" content=\"1;url=index.php\">";
- }
- }
- }
- function retrimite_mail()
- {
- include ("inc/configurare.php");
- if (isset($_POST["trimite"])) {
- $username = replace($_POST["username"]);
- $email = replace($_POST["email"]);
- if (($username != NULL) && ($email != NULL)) {
- $qu = mysql_query("Select * from account.account where login='$username'");
- $in = mysql_fetch_object($qu);
- $aktiv = $in->web_aktiviert;
- $cod_activ = md5(rand(999, 99999));
- if ($aktiv != "1") {
- include ("configurare.php");
- mysql_query("Update account.account set web_aktiviert='$cod_activ' where login='$username'");
- $email = $in->email;
- $to = $email;
- $subject = "Activare cont!";
- $message = "Salut " . $username . "\r\nPentru a activa contul tau acceseaza linkul de mai jos \r\nhttp://" . $website . "/index.php?page=activare-cont&cont=" . $username . "&cod=" . $cod_activ . "\r\n\t\t\t\t\t\t\t";
- new mail($to, $subject, $message);
- echo succes("Verificati adresa de email.");
- }
- else {
- echo error("Contul este deja activ.Va puteti loga.");
- }
- }
- }
- }
- function loadcontent()
- {
- if (isset($_GET["page"])) {
- $page = replace($_GET["page"]);
- include ("modules/" . $page . ".php");
- if (!file_exists("modules/" . $page . ".php")) {
- $error = 1;
- echo error(website_module_off);
- }
- }
- else if ($page == NULL) {
- $page = "acasa";
- include ("modules/" . $page . ".php");
- }
- }
- function acc($usern, $opt)
- {
- $co = mysql_query("Select * from account.account where login='" . $usern . "'");
- $c = mysql_fetch_object($co);
- echo $c->$opt;
- }
- function count_ch($usern)
- {
- include ("configurare.php");
- $cc = mysql_query("Select * from account.account where login='" . $usern . "'");
- $cs = mysql_fetch_object($cc);
- ($my = mysql_query("Select * from player.player where account_id='" . $cs->account_id . "'")) || exit(mysql_error());
- $crs = mysql_num_rows($my);
- echo $crs;
- }
- function clasa_c($clasa)
- {
- if (($clasa == "0") || ($clasa == "4")) {
- echo c_war;
- }
- else {
- if (($clasa == "1") || ($clasa == "5")) {
- echo c_ninja;
- }
- else {
- if (($clasa == "2") || ($clasa == "6")) {
- echo c_sura;
- }
- else {
- if (($clasa == "3") || ($clasa == "7")) {
- echo c_sami;
- }
- }
- }
- }
- }
- function nume_regat($empire)
- {
- if ($empire == "1") {
- echo "<img src='images/regat/reg_rosu.png' border='0'>";
- }
- if ($empire == "2") {
- echo "<img src='images/regat/reg_galben.png' border='0'>";
- }
- if ($empire == "3") {
- echo "<img src='images/regat/reg_albastru.png' border='0'>";
- }
- }
- function recuperare_pw()
- {
- if (isset($_POST["recuperare"])) {
- $username = replace($_POST["username"]);
- $email = replace($_POST["email"]);
- if (($username != NULL) && ($email != NULL)) {
- if (md5($_POST["norobot"]) == $_SESSION["randomnr2"]) {
- include ("configurare.php");
- $ch = mysql_query("Select * from account.account where login='$username' and email='$email'");
- if (mysql_num_rows($ch) == 1) {
- $rec = md5(rand(99999, 9999999));
- mysql_query("Update account.account set passlost_token='$rec' where login='$username'");
- $to = $email;
- $subject = "Confirm email!";
- $message = "\r\n\t\t\t\t\t\t\t\r\n\t\t\tHi " . $username . "\r\n\r\n\t\t\tIf you want to reset your password you must confirm by clicking the link bellow : \r\n\r\n\t\t\thttp://" . $website . "/index.php?page=recuperare-pw&cont=" . $username . "&cod=" . $rec . "\r\n\t\t\t\t\t\t\t";
- $headers = "Do not reply.";
- new mail($to, $subject, $message, $headers);
- echo succes(check_email_and);
- }
- else {
- echo error(acc_or_email);
- }
- }
- else {
- echo error(spam);
- }
- }
- }
- }
- function schimbare_pw()
- {
- if (isset($_POST["passwordchangerequest"])) {
- $log = $_SESSION["user"];
- include ("configurare.php");
- $tr = mysql_fetch_object(mysql_query("Select * from account.account where login='$log'"));
- $cod = md5(rand(999, 999999));
- mysql_query("Update account.account set passchange_token='$cod' where login='$log'");
- echo succes(check_email_and);
- $email = $tr->email;
- $to = $email;
- $subject = "Confirm password change!";
- $message = "If you want to reset your password please click the link bellow :\r\n\t\t\r\nhttp://$website/index.php?page=schimbare-pw&cod=" . $cod . "";
- new mail($to, $subject, $message);
- }
- }
- function schimbare_pw_confirmata()
- {
- if (isset($_POST["SubmitLostPasswordCodeForm"])) {
- $cont = $_SESSION["user"];
- $newpw = replace($_POST["newPassword"]);
- if ($newpw != NULL) {
- mysql_query("Update account.account set password=PASSWORD('$newpw') where login='$cont'");
- mysql_query("Update account.account set passchange_token='1' where login='$cont'");
- $data = date("h:i:s d/m/Y");
- mysql_query("Insert into web.dev_player_log (account,data,actiune) values ('$cont','$data','Parola a fost schimbata in $newpw.')");
- echo succes(password_changed);
- }
- else {
- echo error(insert_new_password);
- }
- }
- }
- function parola_depozit()
- {
- if (isset($_POST["sendStoragePassword"])) {
- $log = $_SESSION["user"];
- ($s = mysql_fetch_object(mysql_query("Select id,email from account.account where login='$log'"))) || exit(mysql_error());
- $id = $s->id;
- $email = $s->email;
- $com = mysql_query("Select * from player.safebox where account_id='$id'");
- $dep = mysql_fetch_array($com);
- if ($dep["password"] == NULL) {
- $password = "000000";
- }
- else {
- $password = $dep["password"];
- }
- $to = $email;
- $subject = "Warehouse password.";
- $message = "Your warehouse password is : " . $password . "";
- new mail($to, $subject, $message);
- $data = date("h:i:s d/m/Y");
- echo succes(check_email . " " . $email . ".");
- }
- }
- function cod_securitate()
- {
- if (isset($_POST["sendSocialcodeDisplayLink"])) {
- include ("configurare.php");
- echo succes(check_email_and);
- $log = $_SESSION["user"];
- ($xx = mysql_fetch_object(mysql_query("Select * from account.account where login='$log'"))) || exit(mysql_error());
- $cod = $xx->social_id;
- $email = $xx->email;
- $to = $email;
- $subject = "Social ID.!";
- $message = "Hi " . $log . "!\r\n\r\n\t\tFor security reasons you need you need to enter a code in order to delete a character.\r\n\r\n\t\tYour code is : " . $cod . "\r\n\r\n\r\n\t\tWrite it on something or remember it!\r\n\r\n\r\n\r\n\t\tWith welcome\r\n\r\n\t\t" . $titlu . ".";
- new mail($to, $subject, $message);
- $data = date("h:i:s d/m/Y");
- }
- }
- function sterge_cont()
- {
- if (isset($_POST["accountdeletion_submit"])) {
- echo succes(check_email_and);
- $log = $_SESSION["user"];
- ($aa = mysql_fetch_object(mysql_query("Select * from account.account where login='$log'"))) || exit(mysql_error());
- $email = $aa->email;
- $cod = md5(rand(999, 99999));
- $bb = mysql_query("Update account.account set cod_stergere_account='$cod' where login='$log'");
- $to = $email;
- include ("configurare.php");
- $subject = "Confirm account delete.!";
- $message = "Salut " . $log . "!\r\n\r\n\t\t\tIf you want to delete your account press the link bellow :\r\n\r\n\t\t\thttp://$website/index.php?page=stergere-cont&cont=" . $log . "&cod=" . $cod . "\r\n\r\n\t\t\tYou can cancel this operation in less then 7 days!\r\n\r\n\r\n\r\n\t\t\tWith welcome\r\n\r\n\t\t\t" . $titlu . "";
- new mail($to, $subject, $message);
- }
- }
- function stergere_cont_final()
- {
- if (($_GET["cont"] != NULL) && ($_GET["cod"] != NULL)) {
- $cod = replace($_GET["cod"]);
- $log = $_SESSION["user"];
- $query = mysql_query("Select * from account.account where cod_stergere_account='$cod' and login='$log'");
- if (mysql_num_rows($query) == 1) {
- $nextWeek = time() + (7 * 24 * 60 * 60);
- $delete = date("d/m/Y", $nextWeek);
- mysql_query("Update account.account set data_stergere='$delete' where login='$log'");
- echo succes(delete_in_7)."<meta http-equiv=\"refresh\" content=\"0;url=index.php?page=stergere-cont\">";
- }
- else {
- echo error("ERROR");
- echo error("ERROR")."<meta http-equiv=\"refresh\" content=\"0;url=index.php?page=stergere-cont\">";
- }
- }
- }
- function stergere_cont_cancel()
- {
- if (isset($_POST["accountdeletion_cancel"])) {
- $log = $_SESSION["user"];
- mysql_query("Update account.account set stergere_account='' where login='$log'");
- echo succes(delete_cancel)."<meta http-equiv=\"refresh\" content=\"1;url=index.php?page=panou-user\">";
- }
- }
- function debug()
- {
- if (isset($_GET["page"]) && isset($_GET["debug"])) {
- $char = replace($_GET["debug"]);
- $const = mysql_fetch_object(mysql_query("Select * from player.player where id='$char'"));
- $chek = mysql_fetch_object(mysql_query("Select * from account.account where id='" . $const->account_id . "'"));
- $aid = $chek->id;
- if (isset($_GET["debug"])) {
- $sqlCmd = "SELECT * FROM player.player WHERE id='" . $char . "' AND account_id ='" . $aid . "'";
- $sqlQry = mysql_query($sqlCmd);
- if (0 < mysql_num_rows($sqlQry)) {
- $resetPos = array();
- $resetPos[1]["map_index"] = 1;
- $resetPos[1]["x"] = 468779;
- $resetPos[1]["y"] = 962107;
- $resetPos[2]["map_index"] = 21;
- $resetPos[2]["x"] = 55700;
- $resetPos[2]["y"] = 157900;
- $resetPos[3]["map_index"] = 41;
- $resetPos[3]["x"] = 969066;
- $resetPos[3]["y"] = 278290;
- $getChar = mysql_fetch_object($sqlQry);
- $pid = $getChar->id;
- ($query2 = mysql_query("SELECT * FROM player.player_index WHERE pid1='$pid' or pid2='$pid' or pid3='$pid' or pid4='$pid'")) || exit("ERROR");
- $row2 = mysql_fetch_array($query2);
- $empire = $row2["empire"];
- $lp = strtotime($getChar->timeStamp);
- $difSpielzeit = time() - $lp;
- $toGoTime = (5 * 60) - $difSpielzeit;
- $toGoMin = floor($toGoTime / 60);
- $toGoSek = $toGoTime % 60;
- $sqlUpdate = "UPDATE player.player SET map_index='" . $resetPos["\$empire"]["map_index"] . "', x='" . $resetPos[$empire]["x"] . "', y='" . $resetPos[$empire]["y"] . "', \texit_x='" . $resetPos[$empire]["x"] . "', exit_y='" . $resetPos[$empire]["y"] . "', exit_map_index='" . $resetPos[$empire]["map_index"] . "', horse_riding='0' WHERE id='" . $char . "' LIMIT 1";
- ($updatePos = mysql_query($sqlUpdate)) || exit(mysql_error());
- if ($updatePos) {
- echo succes(char_debug_ok);
- }
- else {
- echo error(char_debug_er);
- }
- }
- else {
- echo "<p class=\"meldung\">" . char_debug_er . "</p>";
- }
- }
- echo "<p><a href=\"javascript:history.back()\">« " . go_back . "</a></p>";
- }
- }
- function admin_debug()
- {
- if (isset($_GET["page"]) && isset($_GET["debug"])) {
- $char = replace($_GET["debug"]);
- $const = mysql_fetch_object(mysql_query("Select * from player.player where id='$char'"));
- $chek = mysql_fetch_object(mysql_query("Select * from account.account where id='" . $const->account_id . "'"));
- $aid = $chek->id;
- if (isset($_GET["debug"])) {
- $sqlCmd = "SELECT * FROM player.player WHERE id='" . $char . "' AND account_id ='" . $aid . "'";
- $sqlQry = mysql_query($sqlCmd);
- if (0 < mysql_num_rows($sqlQry)) {
- $resetPos = array();
- $resetPos[1]["map_index"] = 1;
- $resetPos[1]["x"] = 468779;
- $resetPos[1]["y"] = 962107;
- $resetPos[2]["map_index"] = 21;
- $resetPos[2]["x"] = 55700;
- $resetPos[2]["y"] = 157900;
- $resetPos[3]["map_index"] = 41;
- $resetPos[3]["x"] = 969066;
- $resetPos[3]["y"] = 278290;
- $getChar = mysql_fetch_object($sqlQry);
- $pid = $getChar->id;
- ($query2 = mysql_query("SELECT * FROM player.player_index WHERE pid1='$pid' or pid2='$pid' or pid3='$pid' or pid4='$pid'")) || exit("ERROR");
- $row2 = mysql_fetch_array($query2);
- $empire = $row2["empire"];
- $lp = strtotime($getChar->timeStamp);
- $difSpielzeit = time() - $lp;
- $toGoTime = (5 * 60) - $difSpielzeit;
- $toGoMin = floor($toGoTime / 60);
- $toGoSek = $toGoTime % 60;
- ($sqlUpdate = "UPDATE player.player SET map_index='" . $resetPos["\$empire"]["map_index"] . "', x='" . $resetPos[$empire]["x"] . "', y='" . $resetPos[$empire]["y"] . "', \texit_x='" . $resetPos[$empire]["x"] . "', exit_y='" . $resetPos[$empire]["y"] . "', exit_map_index='" . $resetPos[$empire]["map_index"] . "', horse_riding='0' WHERE id='" . $char . "' LIMIT 1") || exit(mysql_error());
- ($updatePos = mysql_query($sqlUpdate)) || exit(mysql_error());
- if ($updatePos) {
- echo succes(char_debug_ok);
- }
- else {
- echo error(char_debug_er);
- }
- }
- else {
- echo error(char_debug_er);
- }
- }
- }
- }
- function adauga_acces()
- {
- if (isset($_POST["adauga"])) {
- $utilizator = replace($_POST["utilizator"]);
- $nivel = $_POST["nivel"];
- $mys = mysql_query("Select * from account.account where login='$utilizator'");
- if (0 < mysql_num_rows($mys)) {
- if ($utilizator != NULL) {
- mysql_query("Update account.account set web_admin='$nivel' where login='$utilizator'");
- echo succes(level_1 . " $nivel " . level_2 . " $utilizator .");
- }
- }
- else {
- echo error(user_noexist);
- }
- }
- }
- function cauta_cont()
- {
- if (isset($_POST["cauta"])) {
- $cont = r_text($_POST["cont"]);
- if ($cont != NULL) {
- $ques = mysql_query("Select * from account.account where login like '%$cont%'");
- if (mysql_num_rows($ques) == 0) {
- echo error(user_noexist);
- }
- else {
- echo "<table width=\"100%\" border=\"0\" align=\"center\" cellspacing=\"1\" cellpadding=\"1\">";
- echo "<table width=\"100%\" border=\"0\" align=\"center\" cellspacing=\"1\" cellpadding=\"1\"><tr class=\"top\"><td class=\"iR_stats_level\">Userid</td><td class=\"iR_stats_level\">Cont</td><td class=\"iR_stats_level\">Email</td><td class=\"iR_stats_level\">Data inregistrari</td><td class=\"iR_stats_level\">Status</td><td> </td></tr>";
- while ($cont = mysql_fetch_object($ques)) {
- echo "<tr class=\"top\"><td class=\"iR_stats_reset\">" . $cont->id . "</td><td class=\"iR_stats_reset\">" . $cont->login . "</td><td class=\"iR_stats_reset\">" . $cont->email . "</td><td class=\"iR_stats_reset\">" . $cont->create_time . "</td><td class=\"iR_stats_reset\">" . $cont->status . "</td><td class=\"collect\" align=\"center\"><a href=\"index.php?page=edit_cont&cont=" . $cont->id . "\"><font color=\"white\">Vizualizare</font></a></td></tr>";
- }
- echo "</table>";
- }
- }
- }
- }
- function cauta_caracter()
- {
- if (isset($_POST["cauta"])) {
- $char = r_text($_POST["caracter"]);
- if ($char != NULL) {
- $qu = mysql_query("Select * from player.player where name like '%$char%'");
- if (mysql_num_rows($qu) == 0) {
- echo error(char_noexist);
- }
- else {
- echo "<table width=\"100%\" border=\"0\" align=\"center\" cellspacing=\"1\" cellpadding=\"1\">";
- echo "<table width=\"100%\" border=\"0\" align=\"center\" cellspacing=\"1\" cellpadding=\"1\"><tr class=\"top\"><td class=\"iR_stats_level\">Owner</td><td class=\"iR_stats_level\">Nume</td><td class=\"iR_stats_level\">Level</td><td class=\"iR_stats_level\">Ip</td><td> </td></tr>";
- while ($ch = mysql_fetch_object($qu)) {
- $acs = mysql_fetch_object(mysql_query("Select * from account.account where id='$ch->account_id'"));
- echo "<tr class=\"top\"><td class=\"iR_stats_reset\"><a href=\"index.php?page=edit_cont&cont=" . $ch->account_id . "\"><font color=\"white\">[" . $ch->account_id . "]" . $acs->login . "</font></a></td><td class=\"iR_stats_reset\">" . $ch->name . "</td><td class=\"iR_stats_reset\">" . $ch->level . "</td><td class=\"iR_stats_reset\"><a href=\"index.php?page=cauta_ip&ip=" . $ch->ip . "\"><font color=\"white\">" . $ch->ip . "</font></a></td><td class=\"collect\" align=\"center\"><a href=\"index.php?page=a_caracter&id=" . $ch->id . "\"><font color=\"white\">Vizualizare</font></a></td></tr>";
- }
- echo "</table>";
- }
- }
- }
- }
- function ban_char()
- {
- if (isset($_POST["baneaza"])) {
- $cont = replace($_GET["cont"]);
- $motiv = replace($_POST["motiv"]);
- $perioada = $_POST["perioada"];
- $query2 = mysql_query("Select * from account.account where id='$cont'");
- $nrs = mysql_fetch_object($query2);
- if (($motiv != NULL) && (mysql_num_rows($query2) == 1)) {
- if ($perioada == "saptamana") {
- $per = time() + (7 * 24 * 60 * 60);
- }
- else if ($perioada == "luna") {
- $per = time() + (30 * 24 * 60 * 60);
- }
- else if ($perioada == "zi") {
- $per = time() + (24 * 60 * 60);
- }
- else if ($perioada == "3zi") {
- $per = time() + (3 * 24 * 60 * 60);
- }
- $ban = date("d/m/Y", $per);
- $data = date("H:i:s d-M-y ");
- if ($perioada != "permanent") {
- mysql_query("Update account.account set unban_date='$ban',motiv_ban='$motiv',status='BLOCK' where id='$cont'");
- echo succes(banned_1 . " $ban " . banned2);
- mysql_query("Insert into web.dev_ban_log (admin,player,motiv,durata,data) values('" . $_SESSION["user"] . "','$nrs->login','$motiv','$per','$data')") || exit(mysql_error());
- }
- else {
- mysql_query("Update account.account set unban_date='PERMANENT',motiv_ban='$motiv',status='BLOCK' where id='$cont'");
- echo succes(ban_permanent);
- mysql_query("Insert into web.dev_ban_log (admin,player,motiv,durata,data) values('" . $_SESSION["user"] . "','$nrs->login','$motiv','PERMANENT','$data')") || exit(mysql_error());
- }
- }
- else {
- echo error(ban_reason);
- }
- }
- }
- function debanare_cont()
- {
- if (isset($_GET["debanare"])) {
- $cont = replace($_GET["debanare"]);
- $query2 = mysql_query("Select * from account.account where id='$cont' and status='BLOCK'");
- $ct = mysql_fetch_object($query2);
- $data = date("H:i:s d-M-y ");
- if (mysql_num_rows($query2) == 0) {
- echo error(acc_noe_nob);
- }
- else {
- mysql_query("Update account.account set motiv_ban='Debanare',status='OK',unban_date='' where id='$cont'");
- echo succes(acc_unban);
- mysql_query("Insert into web.dev_ban_log (admin,player,motiv,durata,data) values('" . $_SESSION["user"] . "','$ct->login','Ban scos','UNBANNED','$data')");
- echo "<meta http-equiv=\"refresh\" content=\"2;url=index.php?page=edit_cont&cont=" . $cont . "\">";
- }
- }
- }
- function plus_monezi()
- {
- if (isset($_POST["adauga"])) {
- if (isset($_GET["cont"])) {
- $cont = replace($_GET["cont"]);
- $cantitate = replace($_POST["cantitate"]);
- $query2 = mysql_query("Select * from account.account where id='$cont'");
- $old = mysql_fetch_object($query2);
- if (mysql_num_rows($query2) == 0) {
- echo error(user_noexist);
- }
- else {
- $ocoins = $old->coins;
- $coins = $cantitate + $ocoins;
- $data = date("H:i:s d-M-y ");
- mysql_query("Update account.account set coins='$coins' where id='$cont'");
- echo succes("" . $cantitate . " " . coins_added . " " . $coins . " MD");
- mysql_query("Insert into web.dev_log_monezi (data,admin,actiune) values ('$data','" . $_SESSION["user"] . "','A adaugat " . $cantitate . " monezi userului " . $old->login . "')") || exit(mysql_error());
- echo "<meta http-equiv=\"refresh\" content=\"1;url=index.php?page=edit_cont&cont=" . $cont . "\">";
- }
- }
- }
- }
- function editare_caracter()
- {
- if (isset($_POST["salveaza"])) {
- $id = replace($_GET["id"]);
- $qw = mysql_query("Select * from player.player where id='$id'");
- if (mysql_num_rows($qw) == 0) {
- echo error(char_noexist);
- }
- else {
- $old = mysql_fetch_object($qw);
- $nume = r_text($_POST["nume"]);
- $level = replace($_POST["level"]);
- $clasa = $_POST["job"];
- $rang = $_POST["rang"];
- $yang = replace($_POST["yang"]);
- $st = replace($_POST["st"]);
- $dx = replace($_POST["dx"]);
- $iq = replace($_POST["iq"]);
- $ht = replace($_POST["ht"]);
- $data = date("h:i:s d/m/Y");
- if (($nume != NULL) && ($level != NULL) && ($yang != NULL) && ($st != NULL) && ($dx != NULL) && ($iq != NULL) && ($ht != NULL)) {
- if (($nume == $old->name) && ($rang == "")) {
- mysql_query("Update player.player set level='$level',job='$clasa',gold='$yang',st='$st',dx='$dx',iq='$iq',ht='$ht' where id='$id'");
- echo succes(char_edited);
- mysql_query("Insert into web.dev_player_edit (data,admin,player,initial,final) values ('$data','" . $_SESSION["user"] . "','" . $old->name . "','Nume : " . $old->name . ", Level: " . $old->level . ", St: " . $old->st . ", Dx: " . $old->st . ", Iq: " . $old->iq . ", Ht: " . $old->ht . "','Nume : $nume, Level: $level,, St: $st, Dx: $st, Iq: $iq, Ht: $ht')");
- }
- else if ($rang != "") {
- $nnm = mysql_query("Select * from player.player where name='$rang$nume'");
- if (mysql_num_rows($nnm) == 0) {
- mysql_query("Update player.player set name='$rang$nume',level='$level',job='$clasa',gold='$yang',st='$st',dx='$dx',iq='$iq',ht='$ht' where id='$id'");
- echo succes(char_edited_n . " $rang$nume");
- mysql_query("Insert into web.dev_player_edit (data,admin,player,initial,final) values ('$data','" . $_SESSION["user"] . "','" . $old->name . "','Nume : " . $old->name . ", Level: " . $old->level . ", St: " . $old->st . ", Dx: " . $old->st . ", Iq: " . $old->iq . ", Ht: " . $old->ht . "','Nume : $rang$nume, Level: $level, St: $st, Dx: $st, Iq: $iq, Ht: $ht')");
- }
- else {
- echo error(name_exist);
- }
- }
- else {
- $nnm = mysql_query("Select * from player.player where name='$rang$nume'");
- if (mysql_num_rows($nnm) == 0) {
- mysql_query("Update player.player set name='$nume',level='$level',job='$clasa',gold='$yang',st='$st',dx='$dx',iq='$iq',ht='$ht' where id='$id'");
- echo succes("Caracterul a fost editat cu succes!Noul nume $rang$nume");
- mysql_query("Insert into web.dev_player_edit (data,admin,player,initial,final) values ('$data','" . $_SESSION["user"] . "','" . $old->name . "','Nume : " . $old->name . ", Level: " . $old->level . ", St: " . $old->st . ", Dx: " . $old->st . ", Iq: " . $old->iq . ", Ht: " . $old->ht . "','Nume : $rang$nume, Level: $level, St: $st, Dx: $st, Iq: $iq, Ht: $ht')");
- }
- else {
- echo error(name_exist);
- }
- }
- }
- else {
- echo error(all_fields);
- }
- }
- }
- }
- function nume_item($vnum)
- {
- $q = mysql_query("Select * from player.item_proto where vnum='$vnum'");
- $m = mysql_fetch_object($q);
- echo "<b>" . $m->locale_name . "</b>";
- }
- function cauta_ip()
- {
- if (isset($_POST["cauta"])) {
- $ip = replace($_POST["ip"]);
- if ($ip != NULL) {
- ($qu = mysql_query("Select * from player.player where ip like '%$ip%'")) || exit(mysql_error());
- if (mysql_num_rows($qu) == 0) {
- echo error(ip_noexist);
- }
- else {
- echo "<table width=\"100%\" border=\"0\" align=\"center\" cellspacing=\"1\" cellpadding=\"1\">";
- echo "<table width=\"100%\" border=\"0\" align=\"center\" cellspacing=\"1\" cellpadding=\"1\"><tr class=\"top\"><td class=\"iR_stats_level\">Ip</td><td class=\"iR_stats_level\">Cont :: Caracter</td><td> </td></tr>";
- while ($ch = mysql_fetch_object($qu)) {
- $account = mysql_fetch_object(mysql_query("Select * from account.account where id='$ch->account_id'"));
- echo "<tr class=\"top\">
- <td class=\"iR_stats_reset\">" . $ch->ip . "</td>
- <td class=\"iR_stats_reset\"><a href=\"index.php?page=edit_cont&cont=" . $ch->account_id . "\"><font color=\"white\">" . $account->login . "</font></a> :: <a href=\"index.php?page=a_caracter&id=" . $ch->id . "\"><font color=\"white\">" . $ch->name . "</font></a></td>
- <td class=\"collect\"><a href=\"index.php?page=ban_ip&ip=" . $ch->ip . "\"><font color=\"white\">Baneaza IP</font></a></td>
- </tr>";
- }
- echo "</table>";
- }
- }
- }
- if (isset($_GET["ip"])) {
- $ip = replace($_GET["ip"]);
- if ($ip != NULL) {
- ($qu = mysql_query("Select * from player.player where ip like '%$ip%'")) || exit(mysql_error());
- if (mysql_num_rows($qu) == 0) {
- echo error(ip_noexist);
- }
- else {
- echo "<table width=\"100%\" border=\"0\" align=\"center\" cellspacing=\"1\" cellpadding=\"1\">";
- echo "<table width=\"100%\" border=\"0\" align=\"center\" cellspacing=\"1\" cellpadding=\"1\"><tr class=\"top\"><td class=\"iR_stats_level\">Ip</td><td class=\"iR_stats_level\">Cont :: Caracter</td><td> </td></tr>";
- while ($ch = mysql_fetch_object($qu)) {
- $account = mysql_fetch_object(mysql_query("Select * from account.account where id='$ch->account_id'"));
- echo "<tr class=\"top\">
- <td class=\"iR_stats_reset\">" . $ch->ip . "</td>
- <td class=\"iR_stats_reset\"><a href=\"index.php?page=edit_cont&cont=" . $ch->account_id . "\"><font color=\"white\">" . $account->login . "</font></a> :: <a href=\"index.php?page=a_caracter&id=" . $ch->id . "\"><font color=\"white\">" . $ch->name . "</font></a></td>
- <td class=\"collect\"><a href=\"index.php?page=ban_ip&ip=" . $ch->ip . "\"><font color=\"white\">Baneaza IP</font></a></td>
- </tr>";
- }
- echo "</table>";
- }
- }
- }
- }
- function ban_ip()
- {
- $ip = replace($_GET["ip"]);
- ($qu = mysql_query("Select * from player.player where ip='$ip'")) || exit(mysql_error());
- if (mysql_num_rows($qu) == 0) {
- echo error(ip_noexist);
- }
- else {
- $ban = "PERMANENT";
- $motiv = "BANIP";
- $data = date("H:i:s d-M-y ");
- while ($inf = mysql_fetch_object($qu)) {
- mysql_query("Update account.account set unban_date='$ban',motiv_ban='$motiv',status='BLOCK' where id='" . $inf->account_id . "'");
- $nnf = mysql_fetch_object(mysql_query("Select * from account.account where id='" . $inf->account_id . "'"));
- mysql_query("Insert into web.dev_ban_log (admin,player,motiv,durata,data) values('" . $_SESSION["user"] . "','$nnf->login','$motiv','$ban','$data')") || exit(mysql_error());
- ++$nr;
- }
- echo succes(acc_ban . " $ip " . acc_ban2);
- mysql_query("Insert into web.web_log_banip (admin,actiune) values ('" . $_SESSION["user"] . "','Conturile cu ip $ip au fost banate cu succes.Perioada ban : PERMANENT')");
- echo "<meta http-equiv=\"refresh\" content=\"2;url=index.php?page=cauta_ip\">";
- }
- }
- function cauta_vnum()
- {
- include ("inc/daten.inc.php");
- if (isset($_POST["cauta"])) {
- $vnum = replace($_POST["vnum"]);
- $window = $_POST["locatie"];
- if ($vnum != NULL) {
- ($sqlCmd = mysql_query("SELECT item.*,player.name,player.account_id,account.login \r\n FROM player.item\r\n INNER JOIN player.player \r\n ON player.id=item.owner_id \r\n INNER JOIN account.account \r\n ON account.id=player.account_id \r\n WHERE item.vnum='" . $vnum . "' \r\n AND window='" . $window . "'")) || exit(mysql_error());
- ($sqlCmd2 = mysql_query("SELECT item.*,account.id AS account_id,account.login\r\n FROM player.item\r\n INNER JOIN account.account \r\n ON account.id=item.owner_id \r\n WHERE item.vnum='" . $vnum . "' \r\n AND window='" . $window . "'")) || exit(mysql_error());
- $iss = mysql_num_rows($sqlCmd);
- echo succes("$iss iteme gasite.")."<table width=\"100%\" border=\"0\" align=\"center\" cellspacing=\"1\" cellpadding=\"1\"><tr><td class=\"iR_stats_level\">Owner</td><td class=\"iR_stats_level\">id</td><td class=\"iR_stats_level\">bonusuri</td></tr>";
- while ($ch = mysql_fetch_object($sqlCmd)) {
- echo "<tr>
- <td class=\"iR_stats_level\">
- <a href=\"index.php?page=edit_cont&cont=" . $ch->account_id . "\">
- <font color=\"white\">" . $ch->login . " :: " . $ch->name . "</font></a></td>
- <td class=\"iR_stats_level\">" . $ch->id . "</td>
- <td class=\"iR_stats_level\">";
- $i = 0;
- while ($i < 7) {
- if ($i == 0) {
- $akBoni = $ch->attrtype0;
- $akWert = $ch->attrvalue0;
- }
- if ($i == 1) {
- $akBoni = $ch->attrtype1;
- $akWert = $ch->attrvalue1;
- }
- if ($i == 2) {
- $akBoni = $ch->attrtype2;
- $akWert = $ch->attrvalue2;
- }
- if ($i == 3) {
- $akBoni = $ch->attrtype3;
- $akWert = $ch->attrvalue3;
- }
- if ($i == 4) {
- $akBoni = $ch->attrtype4;
- $akWert = $ch->attrvalue4;
- }
- if ($i == 5) {
- $akBoni = $ch->attrtype5;
- $akWert = $ch->attrvalue5;
- }
- if ($i == 6) {
- $akBoni = $ch->attrtype6;
- $akWert = $ch->attrvalue6;
- }
- echo "#" . ($i + 1) . " ";
- if (isset($itemBoni[$akBoni])) {
- echo $itemBoni[$akBoni];
- }
- else {
- echo $akBoni;
- }
- echo ": " . $akWert."<br/>";
- ++$i;
- }
- echo "</td></tr>";
- }
- echo "</table>";
- }
- }
- }
- function auto_unban()
- {
- $data = date("d/m/Y");
- $query = mysql_query("Select * from account.account where unban_date <= '$data'");
- while ($cont = mysql_fetch_object($query)) {
- mysql_query("Update account.account set unban_date='',motiv_ban='',status='OK' where id='$cont->id'") || exit(mysql_error());
- }
- }
- function sterge_cont_automat()
- {
- $data = date("d/m/Y");
- $query = mysql_query("Select * from account.account where data_stergere='$data'");
- while ($cont = mysql_fetch_object($query)) {
- mysql_query("Delete from account.account where id='$cont->id'");
- }
- }
- function adauga_admini()
- {
- if (isset($_POST["submit"])) {
- $cont = replace($_POST["cont"]);
- $char = replace($_POST["caracter"]);
- $acces = $_POST["mAuthority"];
- if (($cont != NULL) && ($char != NULL)) {
- mysql_query("Insert into common.gmlist (mAccount,mName,mAuthority) values ('$cont','$char','$acces')");
- echo succes(acc_char . " $char" . is_now . " $acces");
- }
- }
- }
- function check_donate()
- {
- if (isset($_GET["cod"]) && is_numeric($_GET["cod"]) && ($_GET["set_status"] == "Valid")) {
- $cod = replace($_GET["cod"]);
- $admin = $_SESSION["user"];
- include ("configurare.php");
- $query = mysql_query("Select * from web.donate where cod='$cod' and status='In curs de verificare'");
- if (mysql_num_rows($query) == 1) {
- $fetch = mysql_fetch_object($query);
- $query2 = mysql_query("Select * from account.account where login='$fetch->cont'");
- $fetch2 = mysql_fetch_object($query2);
- $rasplata = $fetch->valoarea * $rasplata_euro;
- $paid = $rasplata + $fetch2->coins;
- mysql_query("Update account.account set coins='$paid' where login='" . $fetch->cont . "'");
- mysql_query("Update web.donate set status='Valid',admin='$admin' where cod='$cod'");
- echo succes(donate1 . " $cod" . donate2 . " " . $fetch2->login . " " . donate3 . " " . $rasplata . "" . donate4 . " $paid MD.");
- }
- else {
- error(cod_validated);
- }
- }
- if (isset($_GET["cod"]) && is_numeric($_GET["cod"]) && ($_GET["set_status"] == "Invalid")) {
- $cod = replace($_GET["cod"]);
- $admin = $_SESSION["user"];
- $query = mysql_query("Select * from web.donate where cod='$cod' and status='In curs de verificare'");
- if (mysql_num_rows($query) == 1) {
- mysql_query("Update web.donate set status='Invalid',admin='$admin' where cod='$cod'");
- echo succes(donate1 . " $cod " . donate22);
- }
- else {
- error(cod_validated);
- }
- }
- }
- function retrage_item()
- {
- if (isset($_GET["retrage"])) {
- $ii = replace($_GET["retrage"]);
- $m2pos = mysql_query("Select * from player.item where owner_id='" . $_SESSION["userid"] . "' and window='MALL' order by pos desc limit 0,1");
- $positione = mysql_fetch_object($m2pos);
- $posact = $positione->pos;
- $error = 0;
- $data = date("h:i:s d/M/Y");
- if ($posact < 48) {
- $posact = $posact + 1;
- if ($posact == "0") {
- ++$posact;
- }
- }
- else {
- $error = 1;
- echo error(full_warehouse);
- }
- if ($error != 1) {
- mysql_query("UPDATE player.item SET owner_id='" . $_SESSION["userid"] . "', window='MALL', pos='$posact' WHERE id='" . $ii . "'");
- echo succes(w_ii . "" . $ii . "" . w_ii2 . "");
- mysql_query("Insert into web.dev_log_retrage (data,admin,actiune) values ('$data','" . $_SESSION["user"] . "','Itemul cu id " . $ii . " a fost retras cu succes.')");
- }
- }
- }
- function vote()
- {
- $id = replace($_GET["voteid"]);
- $ip = getenv("REMOTE_ADDR");
- $owneri = mysql_query("Select id,coins from account.account where login='" . $_SESSION["user"] . "'");
- $owner = mysql_fetch_object($owneri);
- $ownerid = $owner->id;
- $coinsa = $owner->coins;
- $time = time();
- $hours = time() + (12 * 60 * 60);
- $sql1 = mysql_query("Select * from web.votes where accountid='$ownerid' and voteid='$id' ");
- $sql11 = mysql_fetch_object($sql1);
- $siteid = $sql11->voteid;
- $data = $sql11->data;
- ($justip = mysql_query("Select ip from web.votes where ip='$ip'")) || exit(mysql_error());
- ($vi = mysql_query("Select * from web.vote where id='$id'")) || exit(mysql_error());
- ($viv = mysql_query("Select valoare from web.vote where id='$id'")) || exit(mysql_error());
- $coin = mysql_fetch_object($viv);
- $value = $coin->valoare;
- $rasplata = $coinsa + $value;
- if (mysql_num_rows($vi) == 0) {
- echo error(v_invalid);
- }
- else if (1 <= mysql_num_rows($sql1)) {
- if ($data <= $time) {
- mysql_query("Delete from web.votes where voteid='$id' and accountid='$ownerid'");
- mysql_query("Insert into web.votes (data,voteid,accountid,ip) values ('$hours','$id','$ownerid','$ip')");
- mysql_query("Update account.account set coins='$rasplata' where id='$ownerid'");
- $oradata = date("H:i:s d/m/Y");
- $ip = getenv("REMOTE_ADDR");
- $link = $vl->link;
- echo succes(v_redirect);
- echo "<meta http-equiv=\"refresh\" content=\"1;url=http://" . $link . "\">";
- }
- else {
- echo error(v_voted);
- }
- }
- else {
- mysql_query("Insert into web.votes (data,voteid,accountid,ip) values ('$hours','$id','$ownerid','$ip')");
- $oradata = date("H:i:s d/m/Y");
- $ip = getenv("REMOTE_ADDR");
- mysql_query("Update account set coins='$rasplata' where id='$ownerid'");
- $vl = mysql_fetch_object($vi);
- $link = $vl->link;
- echo succes(v_redirect);
- echo "<meta http-equiv=\"refresh\" content=\"1;url=http://" . $link . "\">";
- }
- }
- function link_vot()
- {
- if (isset($_POST["adauga"])) {
- $nume = replace($_POST["nume"]);
- $valoare = replace($_POST["valoare"]);
- $link = replace($_POST["link"]);
- if ($link && $valoare && $nume) {
- mysql_query("Insert into web.vote (nume,valoare,link) values ('$nume','$valoare','$link')") || exit(mysql_error());
- echo succes(v_link);
- }
- else {
- echo error(all_fields);
- }
- }
- }
- function a_parola()
- {
- if (isset($_POST["schimba"])) {
- if (isset($_GET["cont"]) && is_numeric($_GET["cont"])) {
- $cont = replace($_GET["cont"]);
- if ($cont != NULL) {
- $check = mysql_query("Select * from account.account where id='$cont'");
- $ft = mysql_fetch_object($check);
- if (mysql_num_rows($check) == 1) {
- $parola = replace($_POST["parola"]);
- if ($parola != NULL) {
- mysql_query("Update account.account set password=password('$parola') where id='$cont'");
- echo succes(new_pw . "$ft->login" . new_pw2 . "$parola.");
- }
- }
- }
- else {
- echo error(pw_err);
- }
- }
- }
- }
- function romana($var)
- {
- $new_var = str_replace("г", "a", $var);
- $new_var = str_replace("г", "a", $new_var);
- $new_var = str_replace("в", "a", $new_var);
- $new_var = str_replace("О", "I", $new_var);
- $new_var = str_replace("о", "i", $new_var);
- $new_var = str_replace("s", "s", $new_var);
- $new_var = str_replace("t", "t", $new_var);
- $new_var = str_replace("A", "A", $new_var);
- $new_var = str_replace("В", "I", $new_var);
- $new_var = str_replace("S", "S", $new_var);
- $new_var = str_replace("T", "T", $new_var);
- $new_var = str_replace("ю", "t", $new_var);
- $new_var = str_replace("є", "s", $new_var);
- $new_var = str_replace("2147483647", "-15", $new_var);
- return $new_var;
- }
- function img_item($item)
- {
- $q = mysql_query("Select img_status FROM web.dev_is_items where vnum='$item'");
- $it = mysql_fetch_object($q);
- $itemalin = mysql_fetch_row(mysql_query("SELECT imagine from web.dev_is_items where vnum='$item'"));
- if ("0" < $it->img_status) {
- echo "<div align='center'><img src='images/item/$itemalin[0].png'></div>";
- }
- else {
- if (strlen($item) == 1) {
- $immagine_item = "images/item/0000" . $item . ".png";
- }
- if (strlen($item) == 2) {
- $immagine_item = "images/item/000" . substr($item, 0, 1) . "0.png";
- }
- if (strlen($item) == 3) {
- $immagine_item = "images/item/00" . substr($item, 0, 2) . "0.png";
- }
- if (strlen($item) == 4) {
- $immagine_item = "images/item/0" . substr($item, 0, 3) . "0.png";
- }
- if (strlen($item) == 5) {
- $immagine_item = "images/item/" . substr($item, 0, 4) . "0.png";
- }
- if (strlen($item) == 6) {
- $immagine_item = "images/item/" . substr($item, 0, 5) . "0.png";
- }
- if (strlen($item) == 0) {
- $immagine_item = "images/item/error.png";
- }
- echo "<div align='center'><img src='$immagine_item' border='0px' alt='' align='center' style='max-height:90px;'></div>";
- }
- }
- function img_item_jd($item)
- {
- $q = mysql_query("Select img_status FROM web.dev_jd_items where vnum='$item'");
- $it = mysql_fetch_object($q);
- $itemalin = mysql_fetch_row(mysql_query("SELECT imagine from web.dev_jd_items where vnum='$item'"));
- if ("0" < $it->img_status) {
- echo "<div align='center'><img src='images/item/$itemalin[0].png'></div>";
- }
- else {
- if (strlen($item) == 1) {
- $immagine_item = "images/item/0000" . $item . ".png";
- }
- if (strlen($item) == 2) {
- $immagine_item = "images/item/000" . substr($item, 0, 1) . "0.png";
- }
- if (strlen($item) == 3) {
- $immagine_item = "images/item/00" . substr($item, 0, 2) . "0.png";
- }
- if (strlen($item) == 4) {
- $immagine_item = "images/item/0" . substr($item, 0, 3) . "0.png";
- }
- if (strlen($item) == 5) {
- $immagine_item = "images/item/" . substr($item, 0, 4) . "0.png";
- }
- if (strlen($item) == 6) {
- $immagine_item = "images/item/" . substr($item, 0, 5) . "0.png";
- }
- if (strlen($item) == 0) {
- $immagine_item = "images/item/error.png";
- }
- echo "<div align='center'><img src='$immagine_item' border='0px' alt='' align='center' style='max-height:90px;'></div>";
- }
- }
- function resetare_parola()
- {
- if (isset($_POST["reseteaza"])) {
- $cont = replace($_GET["cont"]);
- $password = substr(hash("sha512", rand()), 0, 7);
- $check = mysql_query("Select * from account.account where id='$cont'");
- if (mysql_num_rows($check) == 0) {
- echo error(user_noexist);
- }
- else {
- include ("configurare.php");
- $query = mysql_query("Select * from account.account where id='$cont'");
- $conts = mysql_fetch_object($query);
- mysql_query("Update account.account set password=PASSWORD('$password') where id='$cont'");
- echo succes("" . $conts->login . " :: Noua parola $password a fost trimisa la email " . $conts->email . ".");
- $to = $conts->email;
- $subject = "Your new password!";
- $message = "Hi " . $conts->login . "!\r\n\r\n\t\t\tYou have requested to reset your old password.\r\n\r\n\t\t\tYour new password is : " . $password . "\r\n\r\n\t\t\t\r\n\t\t\tWith welcome\r\n\r\n\t\t\t" . $titlu . ".";
- new mail($to, $subject, $message);
- }
- }
- }
- function adauga_news()
- {
- if (isset($_POST["adauga"])) {
- $titlu = replace($_POST["titlu"]);
- $tip = $_POST["tip"];
- $continut = $_POST["elm1"];
- $data = date("h:i:s d/M/Y");
- if ($titlu && $continut) {
- mysql_query("Insert into web.dev_news (data,tip,continut,titlu) values ('$data','$tip','$continut','$titlu')");
- echo succes("Stire adaugata cu succes!");
- }
- else {
- echo error("Spatii libere");
- }
- }
- }
- function adauga_descarcari()
- {
- if (isset($_POST["adauga"])) {
- $nume = replace($_POST["nume"]);
- $tip = $_POST["tip"];
- $link = replace($_POST["link"]);
- $marime = replace($_POST["marime"]);
- $data = date("d/M/Y");
- if ($nume && $link && $marime) {
- mysql_query("Insert into web.dev_descarcari (data,tip,nume,link,marime) values ('$data','$tip','$nume','$link','$marime')") || exit(mysql_error());
- echo succes(d_link);
- }
- else {
- echo error(all_fields);
- }
- }
- }
- function BuyItem()
- {
- include ("daten.inc.php");
- include ("configurare.php");
- if (isset($_SESSION["user"]) && isset($_SESSION["pass"])) {
- if (isset($_GET) && ($_GET["buy"] != NULL)) {
- $getbuy = replace($_GET["buy"]);
- $m2user = mysql_fetch_object(mysql_query("Select * from account.account where login='" . $_SESSION["user"] . "'"));
- $m2engine2 = mysql_query("Select * from web.dev_is_items where id='" . $getbuy . "'");
- $luamid = mysql_query("select * from player.item where id=(SELECT MAX(id) FROM player.item)");
- $idul = mysql_fetch_array($luamid);
- $item_id_final = $idul["id"] + 1;
- if (mysql_num_rows($m2engine2) != NULL) {
- $owner_id = $m2user->id;
- $monezi_actuale = $m2user->coins;
- $jetoane_actuale = $m2user->jcoins;
- $m2engine = mysql_fetch_object($m2engine2);
- $preta = $m2engine->pret;
- $pretf = ($reducere / 100) * $preta;
- $pretrr = $preta - $pretf;
- $pret = round($pretrr);
- $new_coins = $monezi_actuale - $pret;
- $new_jcoins = $jetoane_actuale + $pret;
- ($m2pos = mysql_query("Select * from player.item where owner_id='$owner_id' and window='MALL' order by pos desc limit 0,1")) || exit(mysql_error());
- $positione = mysql_fetch_object($m2pos);
- $posact = $positione->pos;
- $error = 0;
- if ($posact < 48) {
- $posact = $posact + 1;
- if ($posact == "0") {
- ++$posact;
- }
- }
- else {
- $error = 1;
- echo alert(full_warehouse);
- }
- if ($monezi_actuale < $pret) {
- $error = 1;
- echo error(low_coins)."<meta HTTP-EQUIV='REFRESH' content='0; url=index.php'>";
- }
- else if ($error != 1) {
- mysql_query("Update account.account set coins='$new_coins' where id='$owner_id'");
- if ("0" < $jd_module) {
- mysql_query("Update account.account set jcoins='$new_jcoins' where id='$owner_id'");
- }
- $count = $m2engine->count;
- if (empty($count)) {
- $count = 1;
- }
- if ($m2engine->game_nou == "1") {
- $timp = time() + $m2engine->socket0;
- }
- else {
- $timp = $m2engine->socket0;
- }
- mysql_query("INSERT INTO player.item \r\n\t\t\t\t(owner_id,window,pos,count,vnum,attrtype0, attrvalue0, attrtype1, attrvalue1, attrtype2, attrvalue2, attrtype3, attrvalue3, attrtype4, attrvalue4, attrtype5, attrvalue5, attrtype6, attrvalue6, socket0, socket1, socket2)\r\n\t\t\t\tVALUES \r\n\t\t\t\t('" . mysql_real_escape_string($owner_id) . "','MALL','" . $posact . "','" . $count . "','" . $m2engine->vnum . "','" . $m2engine->attrtype0 . "', '" . $m2engine->attrvalue0 . "', '" . $m2engine->attrtype1 . "', '" . $m2engine->attrvalue1 . "', '" . $m2engine->attrtype2 . "', '" . $m2engine->attrvalue2 . "', '" . $m2engine->attrtype3 . "', '" . $m2engine->attrvalue3 . "', '" . $m2engine->attrtype4 . "', '" . $m2engine->attrvalue4 . "', '" . $m2engine->attrtype5 . "', '" . $m2engine->attrvalue5 . "', '" . $m2engine->attrtype6 . "', '" . $m2engine->attrvalue6 . "', '" . $timp . "', '" . $m2engine->socket1 . "', '" . $m2engine->socket2 . "')") || exit(mysql_error());
- $luamid = mysql_query("select * from player.item where id=(SELECT MAX(id) FROM player.item)");
- $idul = mysql_fetch_array($luamid);
- $item_id_final = $idul["id"] + 1;
- $today = date("H:i:s d/m/Y");
- mysql_query("Insert into web.dev_is_logs\r\n\t\t(owner_id,item_id,vnum,pret,timp) values \r\n\t\t('$owner_id','$item_id_final','$m2engine->vnum','$pret','$today')\r\n\t\t") || exit(mysql_error());
- succes("<font color='black'>Item cumparat cu succes . Verificati itemshop pozitia " . $posact . "</font> ");
- echo "<meta http-equiv=\"refresh\" content=\"2;url=index.php?page=itemshop\">";
- }
- }
- }
- }
- else {
- echo restricted;
- }
- }
- function JBuyItem()
- {
- if (isset($_GET) && is_numeric($_GET["buy"])) {
- include ("configurare.php");
- $getbuy = replace($_GET["buy"]);
- $m2user = mysql_fetch_object(mysql_query("Select * from account.account where login='" . $_SESSION["user"] . "'"));
- $m2engine2 = mysql_query("Select * from web.dev_jd_items where id='" . $getbuy . "'");
- $luamid = mysql_query("select * from player.item where id=(SELECT MAX(id) FROM player.item)");
- $idul = mysql_fetch_array($luamid);
- $item_id_final = $idul["id"] + 1;
- if (mysql_num_rows($m2engine2) != NULL) {
- $owner_id = $m2user->id;
- $jmonezi_actuale = $m2user->jcoins;
- $m2engine = mysql_fetch_object($m2engine2);
- $preta = $m2engine->pret;
- $pretf = ($reducere / 100) * $preta;
- $pretrr = $preta - $pretf;
- $pret = round($pretrr);
- $new_jcoins = $jmonezi_actuale - $pret;
- ($m2pos = mysql_query("Select * from player.item where owner_id='$owner_id' and window='MALL' order by pos desc limit 0,1")) || exit(mysql_error());
- $positione = mysql_fetch_object($m2pos);
- $posact = $positione->pos;
- $error = 0;
- if ($posact < 48) {
- $posact = $posact + 1;
- if ($posact == "0") {
- ++$posact;
- }
- }
- else {
- $error = 1;
- echo error(fullwarehouse);
- }
- if ($jmonezi_actuale < $pret) {
- $error = 1;
- echo error(nomd)."<meta HTTP-EQUIV='REFRESH' content='1; url=index.php?page=jshop'>";
- }
- else if ($error != 1) {
- mysql_query("Update account.account set jcoins='$new_jcoins' where id='$owner_id'");
- mysql_query("INSERT INTO player.item \r\n\t\t\t\t(owner_id,window,pos,count,vnum,attrtype0, attrvalue0, attrtype1, attrvalue1, attrtype2, attrvalue2, attrtype3, attrvalue3, attrtype4, attrvalue4, attrtype5, attrvalue5, attrtype6, attrvalue6, socket0, socket1, socket2)\r\n\t\t\t\tVALUES \r\n\t\t\t\t('" . mysql_real_escape_string($owner_id) . "','MALL','" . $posact . "','1','" . $m2engine->vnum . "','" . $m2engine->attrtype0 . "', '" . $m2engine->attrvalue0 . "', '" . $m2engine->attrtype1 . "', '" . $m2engine->attrvalue1 . "', '" . $m2engine->attrtype2 . "', '" . $m2engine->attrvalue2 . "', '" . $m2engine->attrtype3 . "', '" . $m2engine->attrvalue3 . "', '" . $m2engine->attrtype4 . "', '" . $m2engine->attrvalue4 . "', '" . $m2engine->attrtype5 . "', '" . $m2engine->attrvalue5 . "', '" . $m2engine->attrtype6 . "', '" . $m2engine->attrvalue6 . "', '" . $m2engine->socket0 . "', '" . $m2engine->socket1 . "', '" . $m2engine->socket2 . "')");
- $today = date("H:i:s d/m/Y");
- mysql_query("Insert into web.dev_is_logs (owner_id,item_id,vnum,pret,timp) values ('$owner_id','$item_id_final','$m2engine->vnum','$pret','$today')") || exit(mysql_error());
- echo succes(ibuy)."<meta HTTP-EQUIV='REFRESH' content='1; url=index.php?page=jshop'>";
- }
- }
- }
- }
- function update_categorii()
- {
- $getCats = mysql_query("Select * from web.dev_is_cat");
- $cN = 0;
- while ($cName = mysql_fetch_object($getCats)) {
- ++$cN;
- $categorii .= "<td class='is_cat'>\r\n\t<a href='index.php?page=itemshop&cat=" . $cName->id . "'>" . $cName->titlu . "</a>\r\n\t</td>";
- if (($cN % 4) == 0) {
- $categorii .= "</tr><tr>";
- }
- }
- if (file_exists("cache/itemshop/categorii.txt")) {
- unlink("cache/itemshop/categorii.txt");
- $cats = fopen("cache/itemshop/categorii.txt", "w");
- fwrite($cats, $categorii);
- fclose($cats);
- }
- else {
- $cats = fopen("cache/itemshop/categorii.txt", "w");
- fwrite($cats, $categorii);
- fclose($cats);
- }
- }
- function update_meniu()
- {
- $getCats = mysql_query("Select * from web.dev_menu_links WHERE type='utilizator'");
- while ($cName = mysql_fetch_object($getCats)) {
- $categorii .= "<tr><td class='main_menu'>\r\n\t<a href='" . $cName->link . "'>» " . $cName->nume . "</a>\r\n\t</td></tr>";
- }
- if (file_exists("cache/meniuri/meniu.txt")) {
- unlink("cache/meniuri/meniu.txt");
- $cats = fopen("cache/meniuri/meniu.txt", "w");
- fwrite($cats, $categorii);
- fclose($cats);
- }
- else {
- $cats = fopen("cache/meniuri/meniu.txt", "w");
- fwrite($cats, $categorii);
- fclose($cats);
- }
- }
- function update_meniu_normal()
- {
- $getCats = mysql_query("Select * from web.dev_menu_links WHERE type='normal'");
- while ($cName = mysql_fetch_object($getCats)) {
- $categorii .= "<tr><td class='main_menu'>\r\n\t<a href='" . $cName->link . "'> " . $cName->nume . "</a>\r\n\t</td></tr>";
- }
- if (file_exists("cache/meniuri/meniu_normal.txt")) {
- unlink("cache/meniuri/meniu_normal.txt");
- $cats = fopen("cache/meniuri/meniu_normal.txt", "w");
- fwrite($cats, $categorii);
- fclose($cats);
- }
- else {
- $cats = fopen("cache/meniuri/meniu_normal.txt", "w");
- fwrite($cats, $categorii);
- fclose($cats);
- }
- }
- function playerstats()
- {
- $unu = 0;
- $doi = 0;
- $trei = 0;
- $aLL = mysql_query("SELECT * FROM player.player WHERE DATE_SUB(NOW(), INTERVAL 5 MINUTE) < last_play;");
- if ($oN = mysql_fetch_object($aLL)) {
- ($r1 = mysql_query("SELECT * FROM player.player_index where id='" . $oN->account_id . "' and empire='1'")) || exit(mysql_error());
- while ($s1 = mysql_fetch_object($r1)) {
- ++$unu;
- }
- ($r2 = mysql_query("SELECT * FROM player.player_index where id='" . $oN->account_id . "' and empire='2'")) || exit(mysql_error());
- while ($s2 = mysql_fetch_object($r2)) {
- ++$doi;
- }
- ($r3 = mysql_query("SELECT * FROM player.player_index where id='" . $oN->account_id . "' and empire='3'")) || exit(mysql_error());
- ++$trei;
- }
- $total = $unu + $doi + $trei;
- $latime = 220;
- $red = round(($latime / $total) * $unu);
- $yellow = round(($latime / $total) * $doi);
- $blue = round(($latime / $total) * $trei);
- echo "<table width=\"220\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\" height=\"16\" style=\"padding-top:2px; margin-left:0px;\" align=\"center\">
- <tr style=\"-moz-border-radius: 10px; border-radius: 10px;\">";
- if ("0" < $red) {
- echo "
- <td width=\"" . $red . "\" style=\"background-image:url(images/bars/barred.png); width: " . $red . "px;\"></td>";
- }
- if ("0" < $yellow) {
- echo "<td width=\"" . $yellow . "\" style=\"background-image:url(images/bars/baryellow.png); width:" . $yellow . "px;\"> </td>";
- }
- if ("0" < $blue) {
- echo "<td width=\"" . $blue . "\" style=\"background-image:url(images/bars/barblue.png); width:" . $blue . "px;\"> </td>";
- }
- echo "</tr>
- </table>";
- }
- function buy_pachet()
- {
- if (isset($_GET) && is_numeric($_GET["buy_pachet"])) {
- $getbuy = replace($_GET["buy_pachet"]);
- $gUser = mysql_fetch_object(mysql_query("Select * from account.account where login='" . $_SESSION["user"] . "'"));
- $owner_id = $gUser->id;
- $getPachet = mysql_query("Select * from web.dev_pachetele_pachetele where id='$getbuy'");
- $dPachet = mysql_fetch_object($getPachet);
- $getItems = mysql_query("Select * from web.dev_is_items where pachet_id='$getbuy'");
- if (mysql_num_rows($getPachet) == NULL) {
- echo error(p_exist);
- }
- else if (mysql_num_rows($getItems) == NULL) {
- echo error(p_items);
- }
- else {
- $pPret = $dPachet->pret;
- $mMonezi = $gUser->coins;
- $new_coins = $mMonezi - $pPret;
- if ($mMonezi < $pPret) {
- echo error(nomd)."<meta http-equiv=\"refresh\" content=\"2;url=index.php?page=pachete_promotionale\">";
- }
- else {
- ($m2pos = mysql_query("Select * from player.item where owner_id='$owner_id' and window='MALL' order by pos desc limit 0,1")) || exit(mysql_error());
- $positione = mysql_fetch_object($m2pos);
- $posact = $positione->pos;
- $error = 0;
- if ($posact <= 40) {
- $posact = $posact + 1;
- if ($posact == "0") {
- $posact = $posact + 1;
- }
- }
- else {
- $error = 1;
- echo error(fullwarehouse);
- }
- if ($error != 1) {
- while ($m2engine = mysql_fetch_object($getItems)) {
- ++$posact;
- mysql_query("Update account.account set coins='$new_coins' where id='$owner_id'");
- mysql_query("INSERT INTO player.item (owner_id,window,pos,count,vnum,attrtype0, attrvalue0, attrtype1, attrvalue1, attrtype2, attrvalue2, attrtype3, attrvalue3, attrtype4, attrvalue4, attrtype5, attrvalue5, attrtype6, attrvalue6, socket0, socket1, socket2) VALUES ('" . mysql_real_escape_string($owner_id) . "','MALL','" . $posact . "','" . $m2engine->count . "','" . $m2engine->vnum . "','" . $m2engine->attrtype0 . "', '" . $m2engine->attrvalue0 . "', '" . $m2engine->attrtype1 . "', '" . $m2engine->attrvalue1 . "', '" . $m2engine->attrtype2 . "', '" . $m2engine->attrvalue2 . "', '" . $m2engine->attrtype3 . "', '" . $m2engine->attrvalue3 . "', '" . $m2engine->attrtype4 . "', '" . $m2engine->attrvalue4 . "', '" . $m2engine->attrtype5 . "', '" . $m2engine->attrvalue5 . "', '" . $m2engine->attrtype6 . "', '" . $m2engine->attrvalue6 . "', '" . $m2engine->socket0 . "', '" . $m2engine->socket1 . "', '" . $m2engine->socket2 . "')");
- }
- $today = date("H:i:s d/m/Y");
- mysql_query("Insert into web.dev_log_pachete (owner_id,item_id,vnum,pret,timp) values ('$owner_id','$item_id_final','$dPachet->titlu','$pPret','$today')") || exit(mysql_error());
- echo succes(pbuy)."<meta http-equiv=\"refresh\" content=\"1;url=index.php?page=pachete_promotionale\">";
- }
- }
- }
- }
- }
- include ("lang/lang_en.php");
- include ("inc/daten.inc.php");
- include ("inc/mail_class.php");
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement