Файл: public_html/cron_71b682d7a8bf77511d5d66bf3a23275d/endAllianceChestEvent.php
Строк: 48
<?php
$connect = array('localhost', 'cd90484_lasthero', '112233', 'cd90484_lasthero');
$base = $db = new mysqli($connect['0'], $connect['1'], $connect['2'], $connect['3']);
$base -> query("SET NAMES 'UTF8'");
if($base -> connect_errno) die('ERROR -> '.$base -> connect_error);
$db->query("UPDATE `events_config` SET `status` = '0' WHERE `event_name` = 'alliance_chest'");
$alliances = $db->query("SELECT * FROM `alliances`");
$event = $db->query("SELECT * FROM `events_config` WHERE `event_name` = 'alliance_chest'")->fetch_object();
while($als = $alliances->fetch_object())
{
$db->query("INSERT INTO `alliance_chest_log` (alliance, level, exp, endtime) VALUES ('".$als->id."', '".$als->chest_level."', '".$als->chest_crowns."', '".$event->endtime."')");
}
$newsName = "Конец события "Сундук альяса"";
$newsDesc = "Событие "Сундук альянса" завершено!";
$db->query("INSERT INTO `forum_themes` (section_id, name, text, author, time, opened) VALUES ('1','".$newsName."','".$newsDesc."', '1', '".time()."', '0')");
$newsId = $db->insert_id;
$db->query("UPDATE `users` SET `read_news` = '".$newsId."'");
//запуск раз в неделю в 12:00 каждый четверг