game/mailconf.php
2022-12-30 21:03:50 +02:00

43 lines
1.9 KiB
PHP

<?php
use Core\Db;
const GAME = true;
require_once('_incl_data/__config.php');
require_once('_incl_data/class/__db_connect.php');
define('IP', UserIp::get());
if (isset($_GET['mail'])) {
$key = md5('mailconf*15+' . $_GET['mail']);
if ($_GET['key'] != $key) {
echo 'Êëþ÷ íå ñîâïàäàåò, íàïèøèòå Àäìèíèñòðàöèè ïî E-mail: admin@new-combats.com';
} elseif (isset($_GET['cancel'])) {
//Îòêàç îò ðàññûëêè
echo 'Âû îòêàçàëèñü îò ðàññûëêè íà ýë.ïî÷òó: <b>' . $_GET['mail'] . '</b>.';
} else {
//
$mcf = Db::getRow('select * from mini_actions where var = ?', [$_GET['mail']]);
$user = Db::getRow('select * from users where id = ?', [$mcf['uid']]);
//Ïîäïèñàíèå íà ðàññûëêó
if (!isset($user['id'])) {
echo 'Çàðåãèñòðèðóéòåñü ÷òîáû ïðèâÿçàòü ýë.ïî÷òó <b>' . $_GET['mail'] . '</b> ê ïåðñîíàæó.';
} else {
$bank = Db::getRow('select * from bank where uid = (select uid from mini_actions where var = ?) order by id desc limit 1', [$_GET['mail']]);
if ($mcf['ok'] > 0) {
echo 'Âû óæå ïîäòâåðæäàëè ýòîò E-mail ðàíåå! <b>' . date('d.m.Y H:i:s', $mcf['ok']) . '</b>';
} elseif (!isset($bank['id'])) {
echo 'Ñíà÷àëà ñîçäàéòå ñ÷åò â èãðîâîì áàíêå, ÷òîáû ìû ñìîãëè ïåðåâåñòè òóäà 1 åêð.';
} else {
Db::sql('update mini_actions set ok = unix_timestamp() where id = ?', [$mcf['id']]);
Db::sql('update bank set money2 = money2 + 1 where id = ?', [$bank['id']]);
echo 'Âû óñïåøíî ïîäïèñàëèñü íà ðàññûëêó íîâîñòåé äëÿ ýë.ïî÷òû <b>' . $_GET['mail'] . '</b>, íà ñ÷åò ïåðñîíàæà <b>' . $user['login'] . '</b> çà÷èñëåí 1 åêð.';
}
}
}
} else {
echo 'E-mail íå íàéäåí.';
}
echo '<br><br>- - - - - - -<br><br>Ñ óâàæåíèåì,<br>Àäìèíèñòðàöèÿ &copy; <a href="https://new-combats.com/">new-combats.com</a>';