function display_page_content() { $item_id = requestIdParam(); $query = "SELECT thumbnail FROM items \n\t WHERE id = {$item_id}"; $result = mysql_Query($query, MyActiveRecord::Connection()); $data = @mysql_fetch_array($result); if (!empty($data["thumbnail"])) { // Output the MIME header header("Content-Type: image/jpeg"); // Output the image echo $data["thumbnail"]; } }
function display_page_content() { $imageId = requestIdParam(); $query = "SELECT * FROM images WHERE id = {$imageId}"; $result = mysql_Query($query, MyActiveRecord::Connection()); $data = @mysql_fetch_array($result); if (!empty($data["thumbnail"])) { // Output the MIME header header("Content-Type: {$data['mime_type']}"); set_image_cache_headers("imgthumb_" . $imageId); // Output the image echo $data["thumbnail"]; } }
function display_page_content() { $connection = MyActiveRecord::Connection(); $imageId = mysql_real_escape_string(requestIdParam()); // TODO: use a parameterized query instead of an escaped string $query = "SELECT * FROM images WHERE id = {$imageId}"; $result = mysql_Query($query, $connection); $data = @mysql_fetch_array($result); if (!empty($data["original"])) { // Output the MIME header header("Content-Type: {$data['mime_type']}"); set_image_cache_headers("img_" . $imageId); // Output the image echo $data["original"]; } }
$wearable = 0; } if ($db['bs'] == 0 && $dat["bs"] == 1) { $wearable = 0; } if ($db['bs'] == 1 && $dat["bs"] == 0) { $wearable = 0; } if ($dat["object_type"] == 'kostyl') { $wearable = 1; } if ($dat["need_orden"] != 0 && $db["orden"] != $dat["need_orden"]) { $wearable = 0; } if ($dat["term"] != "") { mysql_Query("DELETE FROM inv WHERE id=" . $dat["id"] . " and term<" . time()); if (mysql_affected_rows() > 0) { $_SESSION["message"] = "Закончился срок аренды <b>" . $dat["name"] . "</b>"; history($login, "Закончился срок аренды", $dat["name"], $db["remote_ip"], "Инвентарь"); Header("Location: inv.php?otdel=obj&tmp=" . md5(time())); } } $desc = ""; if ($dat["art"] == 1) { $desc .= "<img src='http://www.meydan.az/img/artefakt.gif' border='0' /> "; } if ($dat["art"] == 2) { $desc .= "<img src='http://www.meydan.az/img/icon/artefakt.gif' border='0' /> "; } if ($dat["podzemka"]) { $desc .= "<img src='http://www.meydan.az/img/icon/podzemka.gif' border='0' /> ";
function Upload_and_Save_Image($image, $table_name, $file_field_name, $row_id, $thiswidth = null, $thisheight = null) { $mimeType = $image["type"]; switch ($mimeType) { case "image/gif": $mimeName = "GIF Image"; break; case "image/jpeg": $mimeName = "JPEG Image"; break; case "image/png": $mimeName = "PNG Image"; break; case "image/x-MS-bmp": $mimeName = "Windows Bitmap"; break; default: $mimeName = "Unknown image type"; } $filetype = getFileExtension($image["name"]); list($width) = getimagesize($image["tmp_name"]); $max_width = defined($thiswidth) ? $thiswidth : 0; $max_height = defined($thisheight) ? $thisheight : 0; resizeImageToMax($image["tmp_name"], $max_width, $max_height, $filetype); // Open the uploaded file $file = fopen($image["tmp_name"], "r"); // Read in the uploaded file $fileContents = fread($file, filesize($image["tmp_name"])); // Escape special characters in the file $fileContents = AddSlashes($fileContents); $updateQuery = 'UPDATE ' . $table_name . ' SET ' . $file_field_name . ' = "' . $fileContents . '", mime_type = "' . $mimeType . '" WHERE id = ' . $row_id . ';'; $result = mysql_Query($updateQuery, MyActiveRecord::Connection()); if (!$result) { echo 'Invalid query: ' . mysql_error(); } }
} if ($total < $start + $ttt) { $end = $total; } else { $end = $start + $ttt; } for ($i = 0; $i < $total; $i++) { $classdate = "date"; #$time =date("d.m.y H:i",$chat_array[$i][1]); $time = date("H:i", $chat_array[$i][1]); $name = $chat_array[$i][2]; $color = $chat_array[$i][3]; $body = $chat_array[$i][4]; $msg_room = $chat_array[$i][5]; $msg_city = $chat_array[$i][6]; $have_ignor = mysql_fetch_Array(mysql_Query("SELECT count(*) FROM ignor WHERE login='******' and ignored='" . $name . "'")); if (eregi("to \\[{$login}\\]", $body, $regs)) { $classdate = "date2"; $forom = 1; } if (eregi("private \\[{$login}\\]", $body, $regs)) { $classdate = "date2"; } if (eregi("clan \\[{$my_clan}\\]", $body, $regs)) { $classdate = "date2"; } if (substr($body, 0, 7) == "private") { if (eregi("private \\[{$login}\\]", $body, $regs)) { if (!$have_ignor[0]) { $massages .= "<font class='{$classdate}'>{$time}</font> [<a href='?who={$name}'>{$name}</a>] <font color='{$color}'>{$body}</font> <br/>"; }
} else { if ($my_money < $price_gos) { $mess = "У вас нет такой суммы!"; } else { switch ($present_who) { case 1: $present_who = $login; break; case 2: $present_who = "Клан " . $db["clan"]; break; } mysql_query("LOCK TABLES inv WRITE"); mysql_query("INSERT INTO inv(owner,object_id,object_type,object_razdel,term,msg,gift,gift_author,wear) VALUES ('" . $pr_user["login"] . "','" . $item . "','flower','other','" . $term . "','" . $present_text . "','1','" . $present_who . "','0')"); mysql_query("UNLOCK TABLES"); mysql_Query("UPDATE flower SET mountown=mountown-1 WHERE id=" . $item); if ($is_art) { mysql_query("UPDATE users SET platina=platina-{$price} WHERE login='******'"); $db["platina"] = $db["platina"] - $price; } else { mysql_query("UPDATE users SET money=money-{$price} WHERE login='******'"); $db["money"] = $db["money"] - $price; } if ($pr_user["id"] != $db["id"]) { mysql_query("UPDATE daily_kwest SET taked=taked+1 WHERE user_id='" . $db['id'] . "' and kwest_id=5"); //daily kwest } $name = $DATA["name"]; $mess = "Вы удачно купили «{$name}» за {$price} {$money_type}."; $name2 = "{$name} ({$price} {$money_type}), От имени: <b>{$present_who}</b>, С пожеланием: <b>{$present_text}</b>"; $name3 = "{$name} ({$price} {$money_type}), От имени: <b>{$login}</b>, С пожеланием: <b>{$present_text}</b>";
function lose($team, $battle, $phrase) { $date = date("H:i"); $sql_bat = mysql_query("SELECT zayavka.type,battles.creator_id FROM `battles` LEFT JOIN zayavka on zayavka.creator=battles.creator_id WHERE battles.id={$battle}"); $B_DAT = mysql_fetch_array($sql_bat); mysql_free_result($sql_bat); $cr = $B_DAT["creator_id"]; $zay_type = $B_DAT["type"]; $boylar = array(3, 4, 101, 5, 6, 102, 11); $T = mysql_query("SELECT player,hitted FROM teams WHERE battle_id='" . $cr . "' AND over=0 and team='" . $team . "'"); while ($DATA = mysql_fetch_array($T)) { $player = $DATA["player"]; $hitted_win = $DATA["hitted"]; if ($zay_type == 15) { mysql_query('UPDATE labirint SET location="29x15", vector="180" WHERE user_id="' . $player . '"'); } if ($zay_type == 88) { mysql_query('UPDATE labirint SET location="29x2", vector="180", lose=lose+1 WHERE user_id="' . $player . '"'); } if ($zay_type == 89) { mysql_query('UPDATE labirint SET lose=lose+1 WHERE user_id="' . $player . '"'); } //------------------------------------------------------------------------------------- $LOSER_QUERY_D = mysql_query("SELECT users.*,zver.energy FROM users LEFT join zver on zver.owner=users.id and zver.sleep=0 WHERE login='******'"); $LOSER_DATA = mysql_fetch_array($LOSER_QUERY_D); mysql_free_result($LOSER_QUERY_D); $objects = array(); $objects[0] = $LOSER_DATA["amulet"]; $objects[1] = $LOSER_DATA["hand_r"]; $objects[2] = $LOSER_DATA["armour"]; $objects[3] = $LOSER_DATA["poyas"]; $objects[4] = $LOSER_DATA["ring1"]; $objects[5] = $LOSER_DATA["ring2"]; $objects[6] = $LOSER_DATA["ring3"]; $objects[7] = $LOSER_DATA["helmet"]; $objects[8] = $LOSER_DATA["perchi"]; $objects[9] = $LOSER_DATA["hand_l"]; $objects[10] = $LOSER_DATA["boots"]; $objects[11] = $LOSER_DATA["naruchi"]; $objects[12] = $LOSER_DATA["rubaxa"]; $objects[13] = $LOSER_DATA["plash"]; $objects[14] = $LOSER_DATA["mask"]; $objects[15] = $LOSER_DATA["pants"]; $objects[16] = $LOSER_DATA["masdrikon"]; $objects[17] = $LOSER_DATA["rukavic"]; $damage = 0; shuffle($objects); foreach ($objects as $key => $value) { if ($value == 0) { unset($objects[$key]); } } $new_array = array_values($objects); $damage = $new_array[0]; if ($damage != 0) { $GET_F_INV = mysql_query("SELECT paltar.name,inv.iznos_max,inv.iznos FROM inv LEFT JOIN paltar on paltar.id=inv.object_id WHERE inv.id=" . $damage); $GET_D = mysql_fetch_array($GET_F_INV); mysql_free_result($GET_F_INV); $iznos_all = $GET_D["iznos_max"]; $iznos = $GET_D["iznos"] + 1; $obj_name = $GET_D["name"]; $krit_iznos = $iznos_all - 2; if ($iznos >= $krit_iznos && $iznos < $iznos_all) { talk($player, "Предмет <b>" . $obj_name . "</b> в критическом состоянии!<BR><small>(на правах рекламы) <b>Ремонтная мастерская</b>. Мы даем вторую жизнь старым вещам!</small>", $LOSER_DATA); } if ($iznos <= $iznos_all) { mysql_query("UPDATE inv SET iznos =iznos+1 WHERE id = '" . $damage . "'"); } if ($iznos_all == 1) { unWear($player, $damage); mysql_query("DELETE FROM inv WHERE id='" . $damage . "'"); history($player, 'Пришел в негодность', $obj_name, $LOSER_DATA["remote_ip"], "Бой " . $battle); talk($player, "Предмет <b>" . $obj_name . "</b> сломался", $LOSER_DATA); } else { if ($iznos == $iznos_all) { unWear($player, $damage); talk($player, "Предмет <b>" . $obj_name . "</b> нуждается в ремонте!<BR><small>(на правах рекламы) <b>Ремонтная мастерская</b>. Мы даем вторую жизнь старым вещам!</small>", $LOSER_DATA); } } } if ($zay_type == 29) { #Пещера Воинов mysql_query("UPDATE users SET zayava=0 WHERE login='******'"); mysql_query("UPDATE war_team SET lose=1 WHERE player='" . $player . "'"); say("toroom", "<b>{$player}</b> трагически погиб и покидает турнир.", $player); } if ($zay_type == 99 || $zay_type == 66) { mysql_query("UPDATE users SET bs=0,location='', vector='' WHERE login='******'"); $str = "<span class=date>" . date("d.m.y H:i") . "</span> <script>drwfl('" . $LOSER_DATA['login'] . "','" . $LOSER_DATA['id'] . "','" . $LOSER_DATA['level'] . "','" . $LOSER_DATA['dealer'] . "','" . $LOSER_DATA['orden'] . "','" . $LOSER_DATA['admin_level'] . "','" . $LOSER_DATA['clan_short'] . "','" . $LOSER_DATA['clan'] . "');</script> повержен и выбывает из турнира<BR>"; mysql_query('UPDATE `deztow_turnir` SET `log` = CONCAT(`log`,"' . $str . '") WHERE `active` = TRUE'); mysql_Query("DELETE FROM labirint WHERE user_id='" . $player . "'"); mysql_Query("UPDATE bs_objects SET bs=0,owner='',coord='" . $LOSER_DATA["location"] . "' WHERE owner='" . $player . "'"); mysql_query("DELETE FROM inv WHERE owner='" . $player . "' and object_razdel='thing' and object_id=24 LIMIT 1"); say("toroom", "<b>{$player}</b> трагически погиб и покидает турнир.", $player); } if ($zay_type == 19) { //Таинственный Маяк $have_hell = mysql_fetch_Array(mysql_Query("SELECT * FROM hellround_pohod WHERE `end` = 0 and `owner`=" . $LOSER_DATA["id"] . ";")); $count_wood = $have_hell["volna"]; for ($i = 0; $i < $count_wood; $i++) { mysql_query("INSERT INTO `inv` (`owner`, `object_id`, `object_type`, `object_razdel` ,`iznos`, `iznos_max`) VALUES ('" . $LOSER_DATA['login'] . "', '139','wood','thing','0','1');"); } $count_redkiy = $have_hell["unikal_count"] - 1; if ($count_redkiy > 0) { for ($i = 0; $i < $count_redkiy; $i++) { mysql_query("INSERT INTO `inv` (`owner`, `object_id`, `object_type`, `object_razdel` ,`iznos`, `iznos_max`) VALUES ('" . $LOSER_DATA['login'] . "', '140','wood','thing','0','1');"); } $str_redkiy = "<b>Редкий Образец</b> x{$count_redkiy}."; } say("toroom", "<b>" . $LOSER_DATA['login'] . "</b> создал предмет <b>Образец</b> x{$count_wood}. {$str_redkiy}", $LOSER_DATA['login']); mysql_Query("UPDATE hellround_pohod SET `end` = 1, `date_out` = " . time() . " WHERE `end` = 0 and `owner`=" . $LOSER_DATA["id"] . ";"); } /*if(in_array($zay_type,$boylar)) { //new year //mysql_Query("INSERT INTO inv (owner, object_id, object_type, object_razdel, gift, gift_author, iznos, iznos_max, term) VALUES('".$LOSER_DATA['login']."', '60', 'scroll', 'magic', '1', 'WWW.MEYDAN.AZ', '0', '1', '".(time()+30*24*3600)."');"); //talk($LOSER_DATA["login"],"Вы нашли <b>Снежок</b>",$LOSER_DATA); //novruz mysql_Query("INSERT INTO inv (owner, object_id, object_type, object_razdel, gift, gift_author, iznos, iznos_max, term) VALUES('".$LOSER_DATA['login']."', '262', 'scroll', 'magic', '1', 'WWW.MEYDAN.AZ', '0', '1', '".(time()+30*24*3600)."');"); talk($LOSER_DATA["login"],"Вы нашли <b>Праздничные яйца</b>",$LOSER_DATA); }*/ if ($LOSER_DATA["zver_on"]) { $exp_minus = rand(1, 4); if ($LOSER_DATA["energy"] < $exp_minus) { $exp_minus = rand(1, $LOSER_DATA["energy"]); } mysql_query("UPDATE zver SET energy=energy-{$exp_minus} WHERE owner=" . $LOSER_DATA["id"] . " and sleep=0 "); } $krov = array("100", "101", "102", "11"); if (in_array($zay_type, $krov)) { $travm = rand(1, 3); getTravm($player, $travm); include "travm_dis.php"; $travm_dis = array(); $travm_dis[1] = $ushib_d_h[rand(0, count($ushib_d_h) - 1)]; $travm_dis[2] = $ushib_d_c[rand(0, count($ushib_d_c) - 1)]; $travm_dis[3] = $ushib_d_l[rand(0, count($ushib_d_l) - 1)]; $phrase = "<span class=date>{$date}</span> <B>" . $player . "</B> получил повреждение: <font color=red>" . $travm_dis[$travm] . "</font>.<BR>"; battle_log($battle, $phrase); } if ($zay_type == 20) { getTravm($player, 4); $phrase = "<span class=date>{$date}</span> <B>" . $player . "</B> получил повреждение: <font color=red>Неличимая травма</font>.<BR>"; battle_log($battle, $phrase); } if ($phrase == 0) { talk($player, "Бой окончен! Вы проиграли бой. Всего вами нанесено: <b>" . $hitted_win . " HP</b>. Получено опыта: <b>0</b>.", $LOSER_DATA); } else { if ($phrase == 1) { talk($player, "Бой окончен! Ничья! Всего вами нанесено: <b>" . $hitted_win . " HP</b>. Получено опыта: <b>0</b>.", $LOSER_DATA); } else { if ($phrase == 2) { $travm = rand(1, 3); getTravm($player, $travm); include "travm_dis.php"; $travm_dis = array(); $travm_dis[1] = $ushib_d_h[rand(0, count($ushib_d_h) - 1)]; $travm_dis[2] = $ushib_d_c[rand(0, count($ushib_d_c) - 1)]; $travm_dis[3] = $ushib_d_l[rand(0, count($ushib_d_l) - 1)]; $phrase = "<span class=date>{$date}</span> <B>" . $player . "</B> получил повреждение: <font color=red>" . $travm_dis[$travm] . "</font>.<BR>"; battle_log($battle, $phrase); talk($player, "Бой окончен! Вы проиграли бой. Всего вами нанесено: <b>{$hitted_win} HP</b>. Получено опыта: <b>0</b>.", $LOSER_DATA); } else { if ($phrase == 11) { talk($player, "Бой окончен по таймауту! Ничья! Всего вами нанесено: <b>{$hitted_win} HP</b>. Получено опыта: <b>0</b>.", $LOSER_DATA); } } } } $all_hp = $LOSER_DATA["hp_all"]; if ($LOSER_DATA["level"] < 4) { setHP($player, $all_hp, $all_hp); } else { setHP($player, '0', $all_hp); } $cur_m = $LOSER_DATA["mana"]; $all_m = $LOSER_DATA["mana_all"]; setMN($player, $cur_m, $all_m); } mysql_query("UPDATE users,(SELECT player FROM teams WHERE battle_id='" . $cr . "' AND team='" . $team . "') as upd SET battle='0', " . ($phrase == 1 || $phrase == 11 ? "nich=nich+1" : "lose=lose+1") . ", zayavka=0, battle_opponent='', battle_pos='', battle_team='',fwd='',zver_on=0,oslab=" . (time() + 5 * 60) . " WHERE login=upd.player"); mysql_query("UPDATE teams SET over = 1 WHERE battle_id='" . $cr . "' and team={$team}"); }
echo "OK"; } else { echo "NO USERS"; } } } if ($_POST["heal"]) { $query = mysql_fetch_Array(mysql_query("SELECT * FROM zayavka WHERE type=23")); if ($query) { $res = mysql_fetch_array(mysql_Query("SELECT * FROM battles WHERE creator_id=" . $query["creator"])); $have_bot = mysql_fetch_array(mysql_Query("SELECT * FROM bot_temp WHERE battle_id=" . $res["id"] . " and team=2")); $hp_add = 50000; $new_hp = $have_bot["hp"] + $hp_add; if ($new_hp > $have_bot["hp_all"]) { $new_hp = $have_bot["hp_all"]; $hp_add = $have_bot["hp_all"] - $have_bot["hp"]; } mysql_Query("UPDATE bot_temp SET hp=hp+{$hp_add} WHERE id=" . $have_bot["id"]); $phrase_priem = "<span class=date>" . date("H:i") . "</span> <b>Исчадие Хаоса</b> понял что его спасение это прием <b>Воля к победе. <font color=green>+{$hp_add}</font></b> [" . $new_hp . "/" . $have_bot['hp_all'] . "]<br>"; battle_log($res["id"], $phrase_priem); } else { echo "You Should Start Battle"; } } ?> <form method="POST" action="?spell=chaos_battle"> Битва с Исчадием Хаоса <input type="submit" name="startBattle" value="Start Battle"><BR> Heal HP <input type="submit" name="heal" value="OK"><BR> </form> <?php }
$svet_Array = array(1, 4, 3); $tma_Array = array(2, 3); $join_team = (int) $_GET["team"]; $have_i = mysql_fetch_Array(mysql_Query("SELECT * FROM war_team WHERE player='" . $login . "'")); if (!$have_i) { $count_Teams = mysql_fetch_Array(mysql_query("SELECT count(*) FROM war_team WHERE team={$join_team}")); if ($count_Teams[0] < 20) { if ($join_team == 1 && in_Array($db["orden"], $svet_Array) || $join_team == 2 && in_Array($db["orden"], $tma_Array)) { mysql_query("INSERT INTO war_team VALUES('" . $login . "','" . $have_Zayavka['id'] . "','" . $join_team . "','0')"); mysql_query("UPDATE users SET zayava=1 WHERE login='******'"); if ($join_team == 1) { $loc = "32x5"; } else { $loc = "2x24"; } mysql_Query("DELETE FROM labirint WHERE user_id='" . $login . "'"); mysql_query("INSERT INTO labirint(user_id, location, vector, visit_time) VALUES('" . $login . "', '" . $loc . "', '0', '" . time() . "')"); $msg = "Заявка на бой подана"; } else { $msg = "Вы не можете идти на поединок против своих..."; } } else { $msg = "Максимальное колличество бойцов в группе - 20 чел."; } } else { $msg = "Вы уже и так в группе"; } } ####################################################### echo "\n\t\t\t\t\t<font color='#ff0000'>{$msg}</font><br>\n\t\t\t\t\t<table cellspacing=1 cellpadding=3 align=center width=600>\n\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t<td colspan=2 align=center><b>До войны еще: " . convert_time($have_Zayavka['start_time']) . "</td>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t<tr class='newbut' align=center>\n\t\t\t\t\t\t\t<td width=50%><b>Свет</td><td><b>Тьма</td>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t<td valign=top>"; $sql_team1 = mysql_query("SELECT users.login, users.level, users.id, users.orden, users.admin_level, users.clan, users.clan_short, users.dealer FROM war_team LEFT JOIN users ON users.login=war_team.player WHERE group_id=" . $have_Zayavka['id'] . " and war_team.team=1");
function updateOrderInSection($section, $order = 1) { if ($section != null) { $updateQuery = "UPDATE items_sections SET display_order = " . $order . " WHERE items_id = " . $this->id . " AND sections_id = " . $section->id; $result = mysql_Query($updateQuery, MyActiveRecord::Connection()) or die("Error updating item order in section: " . $updateQuery); } }
if ($_GET['action'] == 'rotateright') { $my_vector += 90; if ($my_vector > 270) { $my_vector = 0; } } else { if ($_GET['action'] == 'forward') { $step1 = next_step($my_cord, $my_vector); if ($step1['fwd'] && !in_array($step1["fwd"], $sunduk_Array) && !count($Bot_Array[$step1['fwd']])) { if ($step1['fwd'] == "4x3" && $my_vector == 180) { $have_opened = mysql_fetch_array(mysql_query("SELECT * FROM led_setting WHERE group_id='" . $group_id . "' and type='key' and etaj={$etaj}")); if (!$have_opened) { $have_key = mysql_fetch_array(mysql_query("SELECT id FROM inv WHERE object_type='wood' and inv.owner='" . $login . "' and object_id=25")); if ($have_key) { mysql_query("INSERT INTO led_setting VALUES (0,'" . $step1['fwd'] . "','" . $login . "','" . $group_id . "','{$etaj}','key','')"); mysql_Query("DELETE FROM inv WHERE id=" . $have_key["id"]); say("toroom", "<b>" . $logins . "</b> открыл <b>«Решётку»</b>", $login); $my_cord = $step1['fwd']; $Time = $ctime; } else { $msg = "Не хватает: Ключ от Лабиринта"; } } else { $my_cord = $step1['fwd']; $Time = $ctime; } } else { $my_cord = $step1['fwd']; $Time = $ctime; } }
function initialize_page() { $image_id = requestIdParam(); $image = Images::FindById($image_id); $post_action = isset($_POST['submit']) ? $_POST['submit'] : ""; if ($post_action == "Save Image" || $post_action == "Save and Return to List") { $success = ''; if (isset($_POST['delete'])) { $image->delete(true); setFlash("<h3>Image deleted</h3>"); redirect("/admin/list_images"); } else { $old_name = $image->name; $image->title = cleanupSpecialChars($_POST['title']); $image->description = cleanupSpecialChars($_POST['description']); if (ALLOW_SHORT_PAGE_NAMES) { $image->name = $_POST['name'] == "" ? slug($_POST['title']) : slug($_POST['name']); } else { $image->name = slug($_POST['title']); } //$image->save(); $updateQuery = "UPDATE images SET title='{$image->title}', name='{$image->name}', description='{$image->description}' WHERE id='{$image->id}';"; if (mysql_Query($updateQuery, MyActiveRecord::Connection())) { if ($old_name != $image->name) { Pages::UpdateImageReferences($old_name, $image->name); } $success .= "Image changes saved / "; } else { die($updateQuery); setFlash("<h3>FAILURE – Please notify HCd of this error: " . mysql_error() . "</h3>"); } // Replace an existing image with a new one if (is_uploaded_file($_FILES["new_image"]["tmp_name"])) { $mimeType = $_FILES["new_image"]["type"]; $filetype = getFileExtension($_FILES["new_image"]["name"]); //list($width) = getimagesize($_FILES["new_image"]["tmp_name"]); $max_width = 0; $max_height = 0; if (defined("MAX_IMAGE_WIDTH")) { $max_width = MAX_IMAGE_WIDTH; } if (defined("MAX_IMAGE_HEIGHT")) { $max_height = MAX_IMAGE_HEIGHT; } resizeToMultipleMaxDimensions($_FILES["new_image"]["tmp_name"], $max_width, $max_height, $filetype); // Open the uploaded file $file = fopen($_FILES["new_image"]["tmp_name"], "r"); // Read in the uploaded file $fileContents = fread($file, filesize($_FILES["new_image"]["tmp_name"])); // Escape special characters in the file $fileContents = AddSlashes($fileContents); $updateQuery2 = "UPDATE images SET original='{$fileContents}', mime_type='{$mimeType}' WHERE id='{$image->id}';"; if (mysql_Query($updateQuery2, MyActiveRecord::Connection())) { $success .= "Image replaced / "; } else { setFlash("FAILURE – Please notify HCd of this error: " . mysql_error() . "</h3>"); //die( $updateQuery2 ); } } } if ($post_action == "Save and Return to List") { redirect("/admin/list_images"); } setFlash("<h3>" . substr($success, 0, -3) . "</h3>"); } }
// tb_access ��Ҩ��繵��ҧẺ�ͺ��� $query3 = "SELECT * FROM tb_assess WHERE row_id = '$sRowid' and year = '$nPrefix' "; $result3 = mysql_query($query3) or die( mysql_error($Conn) ); $nrow3 = mysql_num_rows($result3); print "<font face='THSarabunPSK'><a href='menulst.php' ><B>������<BR>���������ѡ�������� 3</B></a></font>"; print "<BR>*********"; print "</body>"; if( $sIdname == $sPword ){ echo "<script>alert('����! ���ʼ�ҹ�ͧ��ҹ�ѧ���������¹�ŧ ��س�����¹���ʼ�ҹ�����������¹�������ͤ�����ʹ��¢ͧ��ҹ') </script>"; } /*echo "<script>alert('�ٹ�����������зӡ�û�Ѻ��ا�ҹ�����Ť��������� �դ������繻Դ����ԡ������ 00.30 - 02.00 �ջѭ�ҡ����ҹ�Դ������� 6206') </script>"; */ // include("connect.inc"); $sql = "Select left(prefix,2) From runno where title = 'HN' "; list($title_hn) = Mysql_fetch_row(Mysql_Query($sql)); $year_now = substr(date("Y")+543,2); if($title_hn != $year_now){ $sql1= "Update runno set prefix = '56-', runno = 0 where title = 'HN' limit 1;"; $result1 = mysql_Query($sql1); $sql2 = "Update runno set prefix = '56/', runno = 0 where title = 'AN' limit 1;"; $result2 = mysql_Query($sql2); $sql3 = "Update runno set prefix = '56/', runno = 0 where title = 'nid_c' limit 1;"; $result3 = mysql_Query($sql3); } include("unconnect.inc"); ?>
//get paytax/fee $gettax = mysql_Query("select * from tempassess a where a.owner_id='{$owner_id}' and a.business_id='{$business_id}'"); $dfv = 0; while ($gett = mysql_fetch_assoc($gettax)) { //while ($dfv < $v) { $dfv++; //display $f++; $disp = mysql_Query("select sum(amount) from ebpls_payment_details a, rpt_temp_abs b where a.owner_id='{$owner_id}' and a.business_id='{$business_id}' and a.tfoid='{$tfoid[$f]}' and a.tfoid = b.tfoid and or_no = '{$gp['payment_code']}' order by or_no asc"); //echo "select * from ebpls_payment_details a where a.owner_id='$owner_id' and a.business_id='$business_id' and a.tfoid='$tfoid[$f]' <br>"; //$disp = mysql_Query("select * from tempassess a where a.owner_id='$owner_id' and a.business_id='$business_id' and a.natureid='$gp[bus_code]' and a.tfoid='$tfoid[$f]'"); $cntm = mysql_num_rows($disp); if ($tfoid[$f] != '') { if ($cntm == 0 and $sassess == 1) { //reg fee $disp = mysql_Query("select sum(amount) from ebpls_payment_details a, rpt_temp_abs b where a.owner_id='{$owner_id}' and a.business_id='{$business_id}' and a.tfoid='{$tfoid[$f]}' and a.tfoid = b.tfoid and or_no = '{$gp['payment_code']}' order by or_no asc"); //$disp = mysql_Query("select * from tempassessz a where a.owner_id='$owner_id' and a.business_id='$business_id' and a.tfoid='$tfoid[$f]'"); } $dis = mysql_fetch_row($disp); $pdf->Cell(30, 5, number_format($dis[0], 2), 1, 0, 'R'); //tax/fee name $newv[$f] = $newv[$f] + $dis[0]; } } $pdf->SetX($RX); $pdf->Cell(40, 5, $gp[payment_code], 0, 0, 'C'); $pdf->Cell(10, 5, '', 0, 1, 'C'); } } $pdf->SetX(5); $pdf->Cell(50, 5, '', 1, 0, 'C');
$obj3 = mysql_fetch_array(mysql_query("SELECT count(*) FROM inv WHERE owner='" . $login . "' AND object_id=" . $have_qwest["item3"] . " and object_type='wood'")); if ($obj3[0] < $have_qwest["col3"]) { $msg .= "Не хватает: " . $item3["name"] . " - " . (int) ($have_qwest["col3"] - $obj3[0]) . " штук...<br>"; } else { $all_have[] = $have_qwest["item3"]; } } if ($all_count == count($all_have)) { mysql_query("UPDATE users SET naqrada=naqrada+" . $have_qwest["add_naqrada"] . " WHERE login='******'"); mysql_query("UPDATE qwest SET status=1 WHERE id=" . $have_qwest["id"]); mysql_Query("DELETE FROM inv WHERE owner='" . $login . "' AND object_id=" . $have_qwest["item1"] . " and object_type='wood'"); if ($have_qwest["item2"]) { mysql_Query("DELETE FROM inv WHERE owner='" . $login . "' AND object_id=" . $have_qwest["item2"] . " and object_type='wood'"); } if ($have_qwest["item3"]) { mysql_Query("DELETE FROM inv WHERE owner='" . $login . "' AND object_id=" . $have_qwest["item3"] . " and object_type='wood'"); } $msg = "Поздравляю вы выполнили <b>Квест</b>, в честь этого вы получили бонус <b>" . $have_qwest["add_naqrada"] . " Ед. награды</b>."; } } } ##============================================================================== ?> <h3>Задания[Этаж 2]</h3> <table width="100%" cellspacing="0" cellpadding="0" border="0"> <tr> <td width="100%"><font color="#ff0000"><?php echo $msg; ?> </font></td> <td nowrap>
function MySQL_tools_execute($Query) { mysql_Query($Query) or die(mysql_error()); }
<?php $id = $_GET['id'] + 0; mysql_connect("localhost", "mediator_rscheat", "adpass123") or die('The SQL server is down.'); mysql_select_db("mediator_sleepwalker"); // mysql_select_db("AR"); $result = mysql_query("SELECT * FROM sleep WHERE sleepuser_id='{$id}'"); while ($row = mysql_fetch_array($result, MYSQL_ASSOC)) { mysql_Query("UPDATE user SET FO=FO-1, realFO=realFO-1 WHERE user_id='" . $row['typeuser_id'] . "'"); mysql_Query("DELETE FROM sleep WHERE sleep_id='" . $row['sleep_id'] . "'"); // echo "a"; } echo "Finished!";
// µÃǨÊͺáÅÐà»ÅÕè¹ HN AN µÍ¹¢Öé¹»ÕãËÁè $sql = "Select left(prefix,2) From runno where title = 'HN' "; list($title_hn) = Mysql_fetch_row(Mysql_Query($sql)); $year_now = substr(date("Y")+543,2); if($title_hn != $year_now){ $sql = "Update runno set prefix = '".$year_now."-', runno = 0 where title = 'HN' limit 1;"; $result = mysql_Query($sql); } $sql = "Select left(prefix,2) From runno where title = 'AN' "; list($title_an) = Mysql_fetch_row(Mysql_Query($sql)); $year_now = substr(date("Y")+543,2); if($title_an != $year_now){ $sql = "Update runno set prefix = '".$year_now."/', runno = 0 where title = 'AN' limit 1;"; $result = mysql_Query($sql); } // END ?> </table> <FONT SIZE="2" COLOR="#990000">***¤Ó͸ԺÒÂ***</FONT> <BR> <FONT SIZE="" COLOR="66CDAA">ÊÕà¢ÕÂÇ ¤×Í ÂѧäÁèä´é·Ó¡ÒõÃǨÊÔ·¸Ô¡ÒÃÃÑ¡ÉÒ</FONT><BR> <FONT SIZE="" COLOR="#CCFF00">ÊÕà¢ÕÂÇÍè͹ ¤×Í µÃǨÊͺáÅéÇ ÁÕÊÔ·¸Ô»ÃСѹÊѧ¤Á</FONT><BR> <FONT SIZE="" COLOR="#99CC00">ÊÕà¢ÕÂÇÍè͹ ¤×Í µÃǨÊͺáÅéÇ ÁÕÊÔ·¸Ô¨èÒµç</FONT><BR> <FONT SIZE="" COLOR="#FF0033">ÊÕá´§ ¤×Í äÁèÁÕÊÔ·¸Ô</FONT><BR> <hr /> <?php $alert_msg = null;
$if_bot = mysql_fetch_Array(mysql_query("SELECT * FROM `bot_temp` WHERE battle_id='" . $db["battle"] . "' AND bot_name='" . $target . "'")); if ($if_bot) { if ($if_bot["prototype"] == "ƒив") { $lose_hp = 3000; } else { $lose_hp = rand(1, 15); } $new_hp = $if_bot["hp"] - $lose_hp; if ($new_hp <= 0) { $new_hp = 0; $death = "<span class=date>{$date}</span> <b>" . $target . " мертв</b><br>"; } $phrase = "<span class=date>{$date}</span> <span class={$span}>{$login}</span> кинул ¤йцом в <span class={$span2}>" . $target . "</span>, попав в {$mest_txt} <span class=krit>-{$lose_hp}</span>. [" . $new_hp . "/" . $if_bot["hp_all"] . "]<br>{$death}"; mysql_Query("UPDATE `bot_temp` SET hp={$new_hp} WHERE id='" . $if_bot["id"] . "'"); } else { $res = mysql_fetch_array(mysql_Query("SELECT * FROM users WHERE login='******'")); $lose_hp = rand(1, 30); $new_hp = $res["hp"] - $lose_hp; if ($new_hp <= 0) { $new_hp = 0; $death = "<span class=date>{$date}</span> <b>" . $target . " мертв</b><br>"; } $phrase = "<span class=date>{$date}</span> <span class={$span}>{$login}</span> кинул ¤йцом в <span class={$span2}>" . $target . "</span>, попав в {$mest_txt} <span class=krit>-{$lose_hp}</span>. [" . $new_hp . "/" . $res["hp_all"] . "]<br>{$death}"; setHP($res["login"], $new_hp, $res["hp_all"]); } mysql_query("UPDATE teams SET hitted=hitted+{$lose_hp} WHERE player='" . $login . "'"); mysql_query("UPDATE users SET battle_opponent='' WHERE login='******'"); battle_log($battle_id, $phrase); mysql_query("UPDATE inv SET iznos = iznos+1 WHERE id='" . $id . "'"); $DAT = mysql_fetch_array(mysql_query("SELECT iznos,iznos_max FROM inv WHERE id = '" . $id . "'")); if ($DAT["iznos"] == $DAT["iznos_max"]) {
} } if ($db["clan_take"] == 1 || $db["glava"] == 1) { if ($_POST['unwar']) { if ($db['money'] >= 1000) { $_POST["clan_names"] = htmlspecialchars(addslashes($_POST["clan_names"])); if ($clan_s == $_POST["clan_names"]) { $msg = "Ќападение на самого себ¤ - это уже мазохизм..."; } else { $hava_clan = mysql_fetch_Array(mysql_query("SELECT * FROM clan WHERE name_short='" . $_POST["clan_names"] . "'")); $res = mysql_fetch_Array(mysql_query("SELECT * FROM clan_battle WHERE defender='" . $clan_s . "' and attacker='" . $_POST["clan_names"] . "'")); if ($res) { if ($res["type"] == 1) { $battle_id = $res["id"]; mysql_query("UPDATE clan_battle SET type=2 WHERE defender='" . $clan_s . "' and attacker='" . $_POST["clan_names"] . "'"); mysql_Query("UPDATE users SET money=money-1000 WHERE login='******'"); say("toall_news", "<font color=#990000>’анства <b>" . $clan_t . "</b> прин¤л вызов ѕротив ’анства <b>" . $hava_clan["name"] . "</b></font>", $login); $msg = "Ѕитва объ¤влена"; $log = '<span class=date>' . date("d.m.y H:i") . '</span> ’анства ' . $clan_t . ' прин¤л вызов ѕротив ’анства ' . $hava_clan["name"] . '<BR>'; mysql_query('UPDATE `clan_history` SET `log` = CONCAT(`log`,\'' . $log . '\') WHERE clan_id="' . $battle_id . '"'); } else { $msg = "Ѕитва уже объ¤влен"; } } else { $msg = "¬ы должны ќбъ¤вит войну ’анству " . $hava_clan["name"]; } } } else { $msg = "” ¬ас нет такой суммы - 1000.00 «л."; } }
} else { if ($have_hell["volna"] >= 25) { $have_unikal = rand(4, 5); } else { if ($have_hell["volna"] >= 20) { $have_unikal = rand(3, 5); } else { if ($have_hell["volna"] >= 10) { $have_unikal = rand(2, 5); } else { $have_unikal = rand(1, 7); } } } } mysql_Query("UPDATE hellround_pohod SET volna=volna+1, unikal='" . $have_unikal . "' " . ($have_unikal == 5 ? ",unikal_count=unikal_count+1" : "") . " WHERE id='" . $have_hell["id"] . "'"); $have_hell["volna"] = $have_hell["volna"] + 1; $have_hell["unikal"] == $have_unikal; $b = 1; } $hell_str = "<table width=100%><tr align=center><td><b style='color:#ff0000'>Волна №" . $have_hell["volna"] . ($have_hell["unikal"] == 5 ? "<br>Приближается нечто..." : "") . "</b></td></tr></table>"; } ##########################ЗАПРОС НА ИСПОЛЬЗОВАНИЕ ПРИЕМОВ########################## if ($_GET['special'] && $b == 1) { include "inc/battle/usepriems.php"; } #################################################################################### if ($opponent == "" && $b == 1) { $opponent = getNextEnemy($login, $enemy_team, $creator, $bid); } #######################Hit Personaj###################################################
if ($brgy_name == "") { $brgy_name = "{$brgy_name}%"; } else { $brgy_name = "{$brgy_name}"; } $result = mysql_query("select distinct (c.business_permit_code) as pid, \n\ta.business_name,\n concat(a.business_lot_no, ' ', a.business_street, ' ', f.barangay_desc, ' ',\n g.city_municipality_desc, ' ', h.province_desc, ' ', a.business_zip_code) as bus_add,\n concat(b.owner_first_name, ' ', b.owner_middle_name, ' ', b.owner_last_name) as fulln,\n\tb.owner_id, a.business_id, \tconcat(b. owner_street, ' ', f.barangay_desc, ' ',\n g.city_municipality_desc, ' ', h.province_desc, ' ', a.business_zip_code) as own_add, \n a.business_payment_mode \n from ebpls_business_enterprise a, ebpls_owner b, ebpls_business_enterprise_permit c,\n\t ebpls_barangay f , ebpls_city_municipality g , ebpls_province h \n\twhere\n a.business_barangay_code = f.barangay_code \n and g.city_municipality_code = a.business_city_code \n and h.province_code = a.business_province_code\n and \n b.owner_barangay_code = f.barangay_code \n and g.city_municipality_code = b.owner_city_code \n and h.province_code = b.owner_province_code \n and b.owner_id = a.owner_id and a.business_id = c.business_id and\n c.active=1 \n\tand c.application_date between '{$date_from} 00:00:00' and '{$date_to} 23:59:59'\n order by a.business_name ASC"); //get penalty dates $getpen = mysql_Query("select * from ebpls_buss_penalty1"); $pensked = mysql_fetch_assoc($getpen); $qtr1 = $pensked[qtrdue1]; $qtr2 = $pensked[qtrdue2]; $qtr3 = $pensked[qtrdue3]; $qtr4 = $pensked[qtrdue4]; $sem1 = $pensked[semdue1]; $sem2 = $pensked[semdue2]; $getpen = mysql_Query("select * from ebpls_buss_penalty"); $pensked = mysql_fetch_assoc($getpen); $ann = $pensked[renewaldate]; $i = 1; $pdf->SetY($Y_Table_Position); while ($re = mysql_fetch_assoc($result)) { if (strtolower($re[business_payment_mode]) == 'quarterly') { $watqtr = date('m', strtotime($date_to)) / 4; if ($watqtr < 1) { $qtrnow = 1; $qtrc = $qtr1; } elseif ($watqtr >= 1 and $watqtr < 1.75) { $qtrnow = 2; $qtrc = $qtr2; } elseif ($watqtr >= 1.75 and $watqtr < 2.5) { $qtrnow = 3;
?> </font> <h4>Статистика</h4> • Побед в Башне Смерти: <B><?php echo $res[0]; ?> </B><BR> • Рейтинг в Башне Смерти: <B><?php echo $reputation; ?> </B><BR> • Репутация в Башне Смерти: <B><?php echo $db["reputation"]; ?> </B><BR> <h4>Задания в Башне</h4> 1. <a href="?zad=1">Выиграть поединок в Башне Смерти</a> <i>(5 репутации, 50.00 Зл.)</i><BR> 2. <a href="?zad=2">Выиграть Башню Смерти</a> <i>(100 репутации, 1000.00 Ед.)</i><BR> <BR><BR> <h4>Последний 10 Рыцарей Башни Смерти</h4> <?php $sql = mysql_Query("SELECT users.login,users.level,users.id,users.orden,users.admin_level,users.clan,users.clan_short,users.dealer FROM `inv` LEFT JOIN users on users.login=inv.owner WHERE `object_id`=31 and `object_type`='medal' ORDER BY inv.date ASC"); while ($dat = mysql_fetch_Array($sql)) { echo "<script>drwfl('" . $dat['login'] . "','" . $dat['id'] . "','" . $dat['level'] . "','" . $dat['dealer'] . "','" . $dat['orden'] . "','" . $dat['admin_level'] . "','" . $dat['clan_short'] . "','" . $dat['clan'] . "');</script><br>"; } ?> </BODY> </HTML>
include "align.php"; header("Content-type: text/html; charset=windows-1251"); header("Cache-Control: no-cache, must-revalidate"); // говорим браузеру что-бы он не кешировал эту страницу header("Pragma: no-cache"); $data = mysql_connect($base_name, $base_user, $base_pass) or die('Не получается подключиться. Проверьте имя сервера, имя пользователя и пароль!'); mysql_select_db($db_name) or die('Ошибка входа в базу данных'); $login = $_SESSION["login"]; echo '<?xml version="1.0" encoding="windows-1251"?> <!DOCTYPE html PUBLIC "-//WAPFORUM//DTD XHTML Mobile 1.2//EN" "http://www.openmobilealliance.org/tech/DTD/xhtml-mobile12.dtd" > <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">'; if ($break == 1) { Header("Location: index.php"); die; } $have_ses = mysql_fetch_Array(mysql_Query("SELECT count(*) FROM online WHERE uniqPCID='" . session_id() . "' and login='******'")); if (!$have_ses[0]) { Header("Location: index.php?logout=" . md5(time())); die; } $db = mysql_fetch_array(mysql_query("SELECT users.*,zver.id as zver_count,zver.obraz as zver_obraz,zver.level as zver_level,zver.name as zver_name,zver.type as zver_type FROM `users` LEFT join zver on zver.owner=users.id and zver.sleep=0 WHERE login='******'")); effects($db["id"], $effect); ###################################################### TestBattle($db); testPrision($db); testCureTravm($login); if ($db["exp"] >= $db["next_up"]) { testUps($db); } if ($db["zver_count"]) { $zver_db = mysql_fetch_assoc(mysql_query("SELECT * FROM zver WHERE id=" . $db["zver_count"]));
} ###################################################################################### if ($_GET["action"] == "change") { $change_count = 100; echo "<br><br>"; if ($_GET["buy"] == "unikal") { $have_obrazec = mysql_fetch_array(mysql_query("SELECT count(*) FROM inv WHERE owner='{$login}' and object_id=139 and object_type='wood'")); if ($have_obrazec[0] >= $change_count) { mysql_query("INSERT INTO `inv` (`owner`, `object_id`, `object_type`, `object_razdel` ,`iznos`, `iznos_max`) VALUES ('{$login}', '141','wood','thing','0','1');"); mysql_query("DELETE FROM inv WHERE inv.object_type='wood' and inv.owner='" . $login . "' and inv.object_id=139 LIMIT {$change_count}"); $msg = "Вы удачно обменяли <b style='color:red'>[Образец]x{$change_count}</b> на <b>Идеальные Образцы</b>"; } else { $msg = "Не хватает: <b style='color:red'>Образец x" . ($change_count - $have_obrazec[0]) . "</b>"; } } $obrazec = mysql_fetch_Array(mysql_Query("SELECT * FROM wood WHERE id=141")); echo "\n\t<center>{$msg}</center>\n\t<TABLE WIDTH=500 CELLSPACING=1 CELLPADDING=2 BGCOLOR=#A5A5A5>\n\t<tr bgcolor='#D5D5D5'>\n\t\t<td valign=center align=center width=100>\n\t\t\t<img src='img/" . $obrazec["img"] . "'><br>\n\t\t\t<A HREF=\"?action=change&buy=unikal\">купить</A>\n\t\t</td>\n\t\t<td valign='top'>\n\t\t\t<b>" . $obrazec["name"] . "</b> (Масса: " . $obrazec["mass"] . ")<BR>\n\t\t\t<b>Цена: " . sprintf("%01.2f", $obrazec["price"]) . " Зл.</b><BR>\n\t\t\tТребуется предмет: <b style='color:red'>[Образец]x{$change_count}</b><br>\n\t\t\tДолговечность: 0/1<BR><BR>\n\t\t\t<small><font color=brown>Предмет не подлежит ремонту</font></small><BR>\n\t\t</td>\n\t</TR>\n\t</table>"; } ?> </td> <td valign=top width=600 nowrap> <?php $_GET["top"] = "mayak1"; switch ($_GET["top"]) { case "mayak1": $top_level = 8; $desc = "Проход для любителей"; break; case "mayak2": $top_level = 9;
$sql = mysql_query("SELECT * FROM predmet LEFT JOIN wood on wood.id=predmet.object_id WHERE predmet.creator='" . $group_id . "' and predmet.cord='" . $my_cord . "' and predmet.id={$get}"); if (!mysql_num_rows($sql)) { $msg = "Кто-то быстрее..."; } else { $ww = mysql_fetch_assoc($sql); mysql_query("INSERT INTO `inv` (`owner`, `object_id`, `object_type`, `object_razdel` ,`iznos`, `iznos_max`) VALUES \t('" . $login . "', '" . $ww['object_id'] . "','wood','thing','0','1');"); mysql_query("DELETE FROM predmet WHERE id='{$get}'"); $msg = "Вы подняли '" . $ww["name"] . "'"; } mysql_free_result($sql); } //------------Восстановление жизни----------------------- if ($_GET['action'] == 'heal' && $step1['fwd'] == "2x15") { $heal = mysql_fetch_array(mysql_query("SELECT * FROM predmet WHERE creator='" . $group_id . "' and type='fontan'")); if ($heal["time_s"] < time()) { mysql_Query("DELETE FROM predmet WHERE creator='" . $group_id . "' and type='fontan'"); $time_s = time() + 10 * 60; mysql_query("INSERT INTO predmet VALUES (null,'" . $group_id . "','','','fontan'," . $time_s . ")"); setHP($login, $db['hp_all'], $db['hp_all']); $msg = "Оххх... Как хорошо..."; } else { $msg = "Кто-то быстрее..."; } } //--------------------------------------------------- if ($_GET['action'] == 'cerep' && ($step1['fwd'] == "4x27" || $step1['fwd'] == "4x3")) { $heal = mysql_fetch_array(mysql_query("SELECT * FROM predmet WHERE creator='" . $group_id . "' and type='cerep' and cord='" . $step1['fwd'] . "'")); if (!$heal) { mysql_query("INSERT INTO predmet VALUES (null,'" . $group_id . "','" . $step1['fwd'] . "','','cerep',0)"); mysql_query("INSERT INTO predmet (creator,cord,object_id,type) VALUES ('" . $group_id . "','" . $my_cord . "','90','wood')"); } else {
} } else { if (in_array($room, array("crypt")) && $level == "crypt_floor2") { $my_pos = mysql_fetch_array(mysql_Query("SELECT * FROM labirint WHERE user_id='" . $login . "' and etaj=1")); if ($my_pos["location"] == "1x28" && $my_pos["vector"] == 0) { if ($db["kwest"] >= 60) { mysql_query("UPDATE labirint SET location='28x15', vector='180',etaj=2 WHERE user_id='" . $login . "'"); $db["room"] = "crypt_floor2"; $changeroom = true; } else { $mess = "На данный момент вами не было заверщенно прохождение всех Квестов в <b>\"Проклятый Клад (Этаж 1)\"</b>."; } } } else { if (in_array($room, array("crypt_floor2")) && $level == "crypt") { $my_pos = mysql_fetch_array(mysql_Query("SELECT * FROM labirint WHERE user_id='" . $login . "' and etaj=2")); if ($my_pos["location"] == "28x15" && $my_pos["vector"] == 0) { mysql_query("UPDATE labirint SET location='1x28', vector='0',etaj=1 WHERE user_id='" . $login . "'"); $db["room"] = "crypt"; $changeroom = true; } } else { if ($room == "dungeon" && $level == "merlin") { $changeroom = true; } else { if ($room == "merlin" && $level == "dungeon") { $changeroom = true; } else { if ($room == "merlin" && $level == "lavka") { $changeroom = true; } else {
function initialize_page() { $post_action = isset($_POST['submit']) ? $_POST['submit'] : ""; if ($post_action == "Add Image" || $post_action == "Add and Return to List") { $title = cleanupSpecialChars($_POST['title']); $description = cleanupSpecialChars($_POST['description']); if (ALLOW_SHORT_PAGE_NAMES) { $name = $_POST['name'] == "" ? slug($_POST['title']) : slug($_POST['name']); } else { $name = slug($_POST['title']); } // Was a file uploaded? if (is_uploaded_file($_FILES["image"]["tmp_name"])) { $mimeType = $_FILES["image"]["type"]; $filetype = getFileExtension($_FILES["image"]["name"]); list($width) = getimagesize($_FILES["image"]["tmp_name"]); $max_width = 0; $max_height = 0; if (defined("MAX_IMAGE_HEIGHT")) { $max_height = MAX_IMAGE_HEIGHT; } if (defined("MAX_IMAGE_WIDTH")) { $max_width = MAX_IMAGE_WIDTH; } resizeToMultipleMaxDimensions($_FILES["image"]["tmp_name"], $max_width, $max_height, $filetype); // Open the uploaded file $file = fopen($_FILES["image"]["tmp_name"], "r"); // Read in the uploaded file $fileContents = fread($file, filesize($_FILES["image"]["tmp_name"])); // Escape special characters in the file $fileContents = AddSlashes($fileContents); /*if( copy($_FILES["image"]["tmp_name"], $_FILES["image"]["tmp_name"] . "_thumb") ) { resizeToMultipleMaxDimensions($_FILES["image"]["tmp_name"] . "_thumb", 200, 0); $image = open_image($_FILES["image"]["tmp_name"] . "_thumb"); if ( $image === false ) { die ('Unable to open image for resizing'); } $width = imagesx($image); // Open the thumbnail file $thumb_file = fopen($_FILES["image"]["tmp_name"] . "_thumb", "r"); // Read in the thumbnail file $thumb_fileContents = fread($thumb_file, filesize($_FILES["image"]["tmp_name"] . "_thumb")); // Escape special characters in the file $thumb_fileContents = AddSlashes($thumb_fileContents); }*/ $thumb_fileContents = NULL; } else { $fileContents = $thumb_fileContents = NULL; } $insertQuery = "INSERT INTO images VALUES (NULL, \"{$title}\", \"{$description}\", \"{$fileContents}\", \"{$thumb_fileContents}\", \"{$mimeType}\", \"{$name}\")"; $result = mysql_Query($insertQuery, MyActiveRecord::Connection()); if (empty($result)) { //die( $updateQuery ); setFlash("<h3>FAILURE – Please notify HCd of this error: " . mysql_error() . "</h3>"); } setFlash("<h3>Image uploaded</h3>"); if ($post_action == "Add and Return to List") { redirect("/admin/list_images"); } } }
$max_win = 5000; $object_id = 428; $kupon_type = 0; $str_his = "100AZN"; break; case 1: $max_win = 1000; $object_id = 427; $kupon_type = 1; $str_his = "10AZN"; break; } $str = "Выигрышный Купон: Вы являетесь Участником Новогоднего Джекпота. Максимальный Выигрыш " . $max_win . " Пл. У Вас " . $kupon_count . " купона..."; for ($i = 1; $i <= $kupon_count; $i++) { mysql_query("INSERT INTO inv (owner, object_id, object_type, object_razdel, msg, gift, gift_author, term) VALUES ('" . $res['login'] . "', '" . $object_id . "', 'flower', 'other', 'Вы являетесь Участником Джекпота', 1, 'WWW.Oldmeydan.Pe.Hu', '" . (time() + 3600 * 24 * 30) . "')"); mysql_Query("INSERT INTO bank_member (user_id, type) VALUES ('" . $res["id"] . "', '" . $kupon_type . "');"); } history($res["login"], 'Купон -$str_his', $str, $res["remote_ip"], 'Купон-$str_his'); mysql_query("INSERT INTO pochta(user, whom, text, subject) VALUES ('Путешественник','" . $res["login"] . "','" . $str . "','Выигрышный Купон')"); say($res["login"], $str, $res["login"]); say("toall_news", "Воин <b>" . $res["login"] . "</b> получил {$kupon_count} выигрышных купонов!", $res["login"]); echo "ok"; } else { echo "User Not Found"; } } else { ?> <br> <br> <form name='action' action='main.php?act=inkviz&spell=kupon' method='post'> <table border=0 width=500>