2018-01-28 16:40:49 +00:00
|
|
|
|
<?php
|
|
|
|
|
session_start();
|
|
|
|
|
if ($_SESSION['uid'] == null) header("Location: index.php");
|
|
|
|
|
include "config.php";
|
|
|
|
|
$user = mysql_fetch_array(mysql_query("SELECT * FROM `users` WHERE `id` = '{$_SESSION['uid']}' LIMIT 1;"));
|
|
|
|
|
include "functions.php";
|
|
|
|
|
|
|
|
|
|
if ($user['room'] != 44) { header("Location: main.php"); die(); }
|
|
|
|
|
if ($user['battle'] != 0) { header('location: fbattle.php'); die(); }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
?>
|
|
|
|
|
<HTML><HEAD>
|
|
|
|
|
<link rel=stylesheet type="text/css" href="css/main.css">
|
|
|
|
|
<meta content="text/html; charset=utf-8" http-equiv=Content-type>
|
|
|
|
|
<META Http-Equiv=Cache-Control Content=no-cache>
|
|
|
|
|
<meta http-equiv=PRAGMA content=NO-CACHE>
|
|
|
|
|
<META Http-Equiv=Expires Content=0>
|
|
|
|
|
</HEAD>
|
|
|
|
|
<body leftmargin=5 topmargin=5 marginwidth=5 marginheight=5 bgcolor=#e0e0e0>
|
|
|
|
|
<TABLE border=0 width=100% cellspacing="0" cellpadding="0">
|
|
|
|
|
<FORM action="city.php" method=GET>
|
|
|
|
|
<tr><td><h3>Новый Год - 2011!</td><td align=right>
|
|
|
|
|
<INPUT TYPE="submit" value="Вернуться" name="cp"></td></tr>
|
|
|
|
|
</FORM>
|
|
|
|
|
</table>
|
|
|
|
|
<?php
|
|
|
|
|
$do_ng=365-date("z");
|
|
|
|
|
?>
|
|
|
|
|
<table>
|
|
|
|
|
<tr><td>
|
|
|
|
|
Совсем недавно мы праздновали начало 2016 года, а всего через <?= $do_ng?> дней наступит 2017 год.<br />
|
|
|
|
|
Как бы это ни было печально, в этом есть и свои радости: новые надежды, планы и... подарки, конечно же!<br />
|
|
|
|
|
С сегодняшнего дня и до окончания новогодних праздников ищите под елкой свой подарок!
|
|
|
|
|
</td></tr><tr><td>
|
|
|
|
|
<h4>Подарки от Деда Мороза!</h4>
|
|
|
|
|
<?
|
|
|
|
|
if ($user['podarokAD']==0 && $_POST['get_present']!=1)
|
|
|
|
|
{
|
|
|
|
|
echo('Вот Ваш сегодняшний подарок:<br />
|
|
|
|
|
<FORM method="POST" name="pres_go" action="new_year.php">
|
|
|
|
|
<input name="get_present" type="hidden" value="1">
|
|
|
|
|
<img border=0 src="i/sh/podarokNY.gif"><br />
|
|
|
|
|
<input name="sb" type="submit" VALUE="Получить">
|
|
|
|
|
</FORM>');
|
|
|
|
|
}
|
|
|
|
|
elseif($user['podarokAD']==0 && $_POST['get_present']==1)
|
|
|
|
|
{
|
|
|
|
|
mysql_query("UPDATE `users` SET `podarokAD`='1' WHERE `id`='{$user['id']}';");
|
|
|
|
|
$user = mysql_fetch_array(mysql_query("SELECT * FROM `users` WHERE `id` = '{$_SESSION['uid']}' LIMIT 1;"));
|
|
|
|
|
|
|
|
|
|
$pres_chance=rand(0,100);
|
|
|
|
|
if($pres_chance<50)
|
|
|
|
|
{
|
|
|
|
|
$p_cr=rand(15,30);
|
|
|
|
|
$p_flag="0";
|
|
|
|
|
}
|
|
|
|
|
elseif($pres_chance>=50 && $pres_chance<75)
|
|
|
|
|
{
|
|
|
|
|
$present=
|
|
|
|
|
array("284", "285", "286", "287", "272", "290");
|
|
|
|
|
$p_flag="1";
|
|
|
|
|
}
|
|
|
|
|
elseif($pres_chance>=75 && $pres_chance<95)
|
|
|
|
|
{
|
|
|
|
|
$present=
|
|
|
|
|
array("171", "779", "780");
|
|
|
|
|
$p_flag="1";
|
|
|
|
|
}
|
|
|
|
|
elseif($pres_chance>=95)
|
|
|
|
|
{
|
|
|
|
|
$present=
|
|
|
|
|
array("283");
|
|
|
|
|
$p_flag="1";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if($p_flag==1)
|
|
|
|
|
{
|
|
|
|
|
//Святой Рандом
|
|
|
|
|
$priz_id=rand(0,count($present)-1);
|
|
|
|
|
$pr_get=$present[$priz_id];
|
|
|
|
|
|
|
|
|
|
//выборка из магазина
|
|
|
|
|
$dress = mysql_fetch_array(mysql_query("SELECT * FROM `shop` WHERE `id` = '{$pr_get}' LIMIT 1;"));
|
|
|
|
|
//отдаем подарок
|
|
|
|
|
mysql_query("INSERT INTO `inventory`
|
|
|
|
|
(`prototype`,`owner`,`name`,`type`,`massa`,`cost`,`img`,`maxdur`,`isrep`,
|
|
|
|
|
`gsila`,`glovk`,`ginta`,`gintel`,`ghp`,`gnoj`,`gtopor`,`gdubina`,`gmech`,`gfire`,`gwater`,`gair`,`gearth`,`glight`,`ggray`,`gdark`,`needident`,`nsila`,`nlovk`,`ninta`,`nintel`,`nmudra`,`nvinos`,`nnoj`,`ntopor`,`ndubina`,`nmech`,`nfire`,`nwater`,`nair`,`nearth`,`nlight`,`ngray`,`ndark`,
|
|
|
|
|
`mfkrit`,`mfakrit`,`mfuvorot`,`mfauvorot`,`bron1`,`bron2`,`bron3`,`bron4`,`maxu`,`minu`,`magic`,`nlevel`,`nalign`,`dategoden`,`goden`,`otdel`,`gmp`,`gmeshok`,`encicl`,`artefact`,`present`
|
|
|
|
|
)
|
|
|
|
|
VALUES
|
|
|
|
|
('{$dress['id']}','{$user['id']}','{$dress['name']}','{$dress['type']}',{$dress['massa']},{$dress['cost']},'{$dress['img']}',{$dress['maxdur']},{$dress['isrep']},'{$dress['gsila']}','{$dress['glovk']}','{$dress['ginta']}','{$dress['gintel']}','{$dress['ghp']}','{$dress['gnoj']}','{$dress['gtopor']}','{$dress['gdubina']}','{$dress['gmech']}','{$dress['gfire']}','{$dress['gwater']}','{$dress['gair']}','{$dress['gearth']}','{$dress['glight']}','{$dress['ggray']}','{$dress['gdark']}','{$dress['needident']}','{$dress['nsila']}','{$dress['nlovk']}','{$dress['ninta']}','{$dress['nintel']}','{$dress['nmudra']}','{$dress['nvinos']}','{$dress['nnoj']}','{$dress['ntopor']}','{$dress['ndubina']}','{$dress['nmech']}','{$dress['nfire']}','{$dress['nwater']}','{$dress['nair']}','{$dress['nearth']}','{$dress['nlight']}','{$dress['ngray']}','{$dress['ndark']}',
|
|
|
|
|
'{$dress['mfkrit']}','{$dress['mfakrit']}','{$dress['mfuvorot']}','{$dress['mfauvorot']}','{$dress['bron1']}','{$dress['bron3']}','{$dress['bron2']}','{$dress['bron4']}','{$dress['maxu']}','{$dress['minu']}','{$dress['magic']}','{$dress['nlevel']}','{$dress['nalign']}','".(($dress['goden'])?($dress['goden']*24*60*60+time()):"")."','{$dress['goden']}','{$dress['razdel']}','{$dress['gmp']}','{$dress['gmeshok']}','{$dress['encicl']}','{$dress['artefact']}','Мэр Города'
|
|
|
|
|
) ;");
|
|
|
|
|
mysql_query("INSERT INTO `delo` (`id` , `author` ,`pers`, `text`, `type`, `date`) VALUES ('','0','{$user['id']}','\"".$user['login']."\" получил от Деда Мороза: \"".$dress['name']."\" ".$dresscount."id:(".$dressid.") [0/".$dress['maxdur']."]',1,'".time()."');");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
echo('<img src="i/sh/podarokNY.gif" /><br />Вы получили подарок: <b>'.$dress['name'].'</b>!');
|
2018-03-04 00:09:58 +00:00
|
|
|
|
addchp ('Вы получили подарок: '.$dress['name'],'{[]}'.nick::id($user['id'])->short().'{[]}');
|
2018-01-28 16:40:49 +00:00
|
|
|
|
//$_POST['get_present']=0;
|
|
|
|
|
//mysql_query("UPDATE `users` SET `podarokAD`='1' WHERE `id`='{$user['id']}';");
|
|
|
|
|
//header("Location: ".$_SERVER['PHP_SELF']);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
echo('<img src="i/sh/podarokNY.gif" /><br />Вы получили <b>'.$p_cr.'</b> кр!');
|
2018-03-04 00:09:58 +00:00
|
|
|
|
addchp ('Вы получили подарок: '.$p_cr.' кр. ','{[]}'.nick::id($user['id'])->short().'{[]}');
|
2018-01-28 16:40:49 +00:00
|
|
|
|
mysql_query("UPDATE users set money=money+{$p_cr} where id='{$user['id']}';");
|
|
|
|
|
mysql_query("INSERT INTO `delo` (`id` , `author` ,`pers`, `text`, `type`, `date`)
|
|
|
|
|
VALUES ('','0','{$user['id']}','\"".$user['login']."\" получил от Деда Мороза ".$p_cr." кр. ',1,'".time()."');");
|
|
|
|
|
//$_POST['get_present']=0;
|
|
|
|
|
//mysql_query("UPDATE `users` SET `podarokAD`='1' WHERE `id`='{$user['id']}';");
|
|
|
|
|
//header("Location: ".$_SERVER['PHP_SELF']);
|
|
|
|
|
}
|
|
|
|
|
//mysql_query("UPDATE `users` SET `podarokAD`='0' WHERE `id`='{$user['id']}';");
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
echo('<img src="i/sh/podarokNY_chb.gif" /><br /><b>Сегодня Вы уже получили подарок. Приходите завтра!</b>');
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
?>
|
|
|
|
|
</td><td> </td>
|
|
|
|
|
<td>
|
|
|
|
|
|
|
|
|
|
</td>
|
|
|
|
|
</tr>
|
|
|
|
|
</table>
|
|
|
|
|
|
|
|
|
|
<BR>
|
|
|
|
|
|
|
|
|
|
</BODY>
|
|
|
|
|
</HTML>
|