Файл: tankon.mobi/tanks/adminka.php
Строк: 844
<?php
include_once '../sys/inc/start.php';
include_once '../sys/inc/compress.php';
include_once '../sys/inc/sess.php';
include_once '../sys/inc/home.php';
include_once '../sys/inc/settings.php';
include_once '../sys/inc/db_connect.php';
include_once '../sys/inc/ipua.php';
include_once '../sys/inc/fnc.php';
include_once '../sys/inc/user.php';
include_once '../sys/inc/thead.php';
title();aut();
echo '<link rel="stylesheet" href="style.css" type="text/css" />';
include_once 'function.php';
if($tanks_code['status']>1)
{
if(isset($_GET['new_presents'])){
if(isset($_POST['ok']))
{
$name=$_POST['name'];
$cena=$_POST['cena'];
$id_cat=$_POST['id_cat'];
if(isset($_FILES['file']))
{
$type = $_FILES['file']['type'];
if ($type!=='image/jpeg' && $type!=='image/jpg' && $type!=='image/gif' && $type!=='image/png'){$err=1;err_game('Это не картинка');}
}
if (!isset($err))
{
$tmp = $_FILES['file']['tmp_name'];
mysql_query("INSERT INTO `kolhoz_gift` SET `name` = '$name', `cena` = '$cena', `id_cat` = '$id_cat'");
$id=mysql_insert_id();
$tmp = $_FILES['file']['tmp_name'];
move_uploaded_file($tmp, "../images/gifts/".$id.".png");
header("location: /adminka?new_presents");
}
}
echo "<form method="post" enctype='multipart/form-data'>n";
echo'<div class="trnt-block p5" style="margin-bottom:3px">';
echo "<div class='white sh_b bold cntr'>Новый подарок</div><table><div class='white sh_b bold small'>";
echo "<tr><td>Название подарка:</td><td style='width:150px;'><input name="name" type="text" maxlength='32' value='' /></td></tr>";
echo "<tr><td>Цена:</td><td style='width:150px;'><input name="cena" type="text" maxlength='32' value=''></td></tr>";
echo "<tr><td>Категория:</td><td style='width:150px;'>
<select name='id_cat'>";
$cat= mysql_query("SELECT * FROM `kolhoz_gift_cat`");
while($cats = mysql_fetch_array($cat)) {
echo'<option value="'.$cats['id'].'">'.$cats['name'].'</option>';
}
echo"</select>
</td></tr>";
echo "<tr><td>Изображение:</td><td style='width:150px;'><input type='file' name='file' /></td></tr>";
echo'</div></table></div>';echo'</div>
</div>';
echo'</div><div class="bot">
<span class="input-but border"><span>';
echo "<input name='ok' value="Добавить" class='w100' type="submit" /></span></span>
</div></form>";
echo'<a class="simple-but gray" href="/adminka?tour"><span><span>Назад</span></span></a></div>';
include_once 'foots.php';
exit;
}
if ($tanks_code['id']==1){
if(isset($_GET['popol'])){
$popol= mysql_query("SELECT * FROM `unitpay_payments` where `dateComplete`!='0' ORDER BY dateComplete DESC LIMIT 10");
while($popols = mysql_fetch_array($popol)) {
$rr = mysql_fetch_array(mysql_query("SELECT * FROM `user` where `id`='".$popols['account']."'"));
echo'<a href="/profile?id='.$rr['id'].'"><div class="trnt-block white small bold p5" style="margin-bottom:5px">'.$rr['nick'].' - '.$popols['sum'].' рублей ('.$popols['dateComplete'].')</div></a>';
}
echo'<a class="simple-but gray mb10" href="/adminka"><span><span>Назад</span></span></a></div>';
include_once 'foots.php';
exit;
}
if(isset($_GET['redak'])){
$readak= mysql_query("SELECT * FROM `tanks_admin2` ORDER BY id DESC LIMIT 25");
while($readaks = mysql_fetch_array($readak)) {
echo'<div class="trnt-block white small bold p5" style="margin-bottom:5px"><font color="#228B22">'.$readaks['ban'].'</font> изм. <font color="#B22222">'.$readaks['user'].'</font> на <font color="#9370DB">'.$readaks['nick_new'].'</font> и <font color="#9370DB">'.$readaks['mail_new'].'</font></div>';
}
echo'<a class="simple-but gray mb10" href="/adminka"><span><span>Назад</span></span></a></div>';
include_once 'foots.php';
exit;
}
if(isset($_GET['bans'])){
$readak1= mysql_query("SELECT * FROM `tanks_admin` where `act`!='0' ORDER BY id DESC LIMIT 30");
echo'<div class="trnt-block white small bold p5" style="margin-bottom:5px">';
while($readaks1 = mysql_fetch_array($readak1)) {
$nick_mod= mysql_fetch_array(mysql_query("SELECT * FROM `user` where `id`='".$readaks1['ban']."'"));
$nick_use= mysql_fetch_array(mysql_query("SELECT * FROM `user` where `id`='".$readaks1['user']."'"));
echo'<div><a href="/profile?id='.$readaks1['user'].'"><font color="#228B22">'.$nick_mod['nick'].'</font> <font color="#9370DB">'.$readaks1['act'].'</font> <font color="#B22222">'.$nick_use['nick'].'</font>';
if($readaks1['act']!='снял бан'){
echo' - <font color="#009ACD">'.$readaks1['prich'].'</font></a>';
}
echo'</div>';
}
echo'</div>';
echo'<a class="simple-but gray mb10" href="/adminka"><span><span>Назад</span></span></a></div>';
include_once 'foots.php';
exit; }
if(isset($_GET['new_tank'])){
if(isset($_POST['okey'])){
if($_POST['strana']!=5){$prod=$_POST['price'];}else{$prod=$_POST['price']*100;}
if($_POST['strana']!=5){
if($_POST['level']==1){$price_cd=15000;$prod=7500;}
if($_POST['level']==2){$price_cd=100000;$prod=50000;}
if($_POST['level']==3){$price_cd=200000;$prod=100000;}
if($_POST['level']==4){$price_cd=250000;$prod=125000;}
if($_POST['level']==5){$price_cd=500000;$prod=250000;}
if($_POST['level']==6){$price_cd=1000000;$prod=500000;}
if($_POST['level']==7){$price_cd=3000000;$prod=1500000;}
if($_POST['level']==8){$price_cd=5000000;$prod=2500000;}
if($_POST['level']==9){$price_cd=7500000;$prod=3250000;}
if($_POST['level']==10){$price_cd=10000000;$prod=5000000;}
}else {$price_cd=$_POST['price'];}
mysql_query("INSERT INTO `tanks_magazin` (`id`,`screen`,`level`,`name`,`price`,`ataka`,`bron`,`toch`,`proch`,`strana`,`prod_tank`,`type`,`orud`,`opis`) VALUES ('".$_POST['idsd']."','".$_POST['screen']."','".$_POST['level']."','".$_POST['name']."','".$price_cd."','".$_POST['ataka']."','".$_POST['bron']."','".$_POST['toch']."','".$_POST['proch']."','".$_POST['strana']."','".$prod."','".$_POST['type']."','".$_POST['orud']."','".$_POST['opis']."')");
if($_POST['strana']<5){
if($_POST['level']==1){
mysql_query("INSERT INTO `tanks_shop` (`screen`,`name`,`price`,`sell_price`,`ataka`,`bron`,`toch`,`proch`,`uid`,`tank`) VALUES ('gun.jpg','".$_POST['gun']."','20000','8000','10','0','10','10','1','".$_POST['idsd']."')");
mysql_query("INSERT INTO `tanks_shop` (`screen`,`name`,`price`,`sell_price`,`ataka`,`bron`,`toch`,`proch`,`uid`,`tank`) VALUES ('optronics.jpg','".$_POST['svz']."','20000','8000','0','0','0','30','2','".$_POST['idsd']."')");
mysql_query("INSERT INTO `tanks_shop` (`screen`,`name`,`price`,`sell_price`,`ataka`,`bron`,`toch`,`proch`,`uid`,`tank`) VALUES ('fragShield.jpg','".$_POST['bash']."','20000','8000','0','10','10','10','3','".$_POST['idsd']."')");
mysql_query("INSERT INTO `tanks_shop` (`screen`,`name`,`price`,`sell_price`,`ataka`,`bron`,`toch`,`proch`,`uid`,`tank`) VALUES ('frame.jpg','".$_POST['gus']."','20000','8000','10','10','0','10','4','".$_POST['idsd']."')");
}
if($_POST['level']==2){
mysql_query("INSERT INTO `tanks_shop` (`screen`,`name`,`price`,`sell_price`,`ataka`,`bron`,`toch`,`proch`,`uid`,`tank`) VALUES ('gun.jpg','".$_POST['gun']."','25000','12500','20','0','20','20','1','".$_POST['idsd']."')");
mysql_query("INSERT INTO `tanks_shop` (`screen`,`name`,`price`,`sell_price`,`ataka`,`bron`,`toch`,`proch`,`uid`,`tank`) VALUES ('optronics.jpg','".$_POST['svz']."','25000','12500','0','0','0','60','2','".$_POST['idsd']."')");
mysql_query("INSERT INTO `tanks_shop` (`screen`,`name`,`price`,`sell_price`,`ataka`,`bron`,`toch`,`proch`,`uid`,`tank`) VALUES ('fragShield.jpg','".$_POST['bash']."','25000','12500','0','20','20','20','3','".$_POST['idsd']."')");
mysql_query("INSERT INTO `tanks_shop` (`screen`,`name`,`price`,`sell_price`,`ataka`,`bron`,`toch`,`proch`,`uid`,`tank`) VALUES ('frame.jpg','".$_POST['gus']."','25000','12500','20','20','0','20','4','".$_POST['idsd']."')");
}
if($_POST['level']==3){
mysql_query("INSERT INTO `tanks_shop` (`screen`,`name`,`price`,`sell_price`,`ataka`,`bron`,`toch`,`proch`,`uid`,`tank`) VALUES ('gun.jpg','".$_POST['gun']."','50000','25000','30','0','30','30','1','".$_POST['idsd']."')");
mysql_query("INSERT INTO `tanks_shop` (`screen`,`name`,`price`,`sell_price`,`ataka`,`bron`,`toch`,`proch`,`uid`,`tank`) VALUES ('optronics.jpg','".$_POST['svz']."','50000','25000','0','0','0','90','2','".$_POST['idsd']."')");
mysql_query("INSERT INTO `tanks_shop` (`screen`,`name`,`price`,`sell_price`,`ataka`,`bron`,`toch`,`proch`,`uid`,`tank`) VALUES ('fragShield.jpg','".$_POST['bash']."','50000','25000','0','30','30','30','3','".$_POST['idsd']."')");
mysql_query("INSERT INTO `tanks_shop` (`screen`,`name`,`price`,`sell_price`,`ataka`,`bron`,`toch`,`proch`,`uid`,`tank`) VALUES ('frame.jpg','".$_POST['gus']."','50000','25000','30','30','0','30','4','".$_POST['idsd']."')");
}
if($_POST['level']==4){
mysql_query("INSERT INTO `tanks_shop` (`screen`,`name`,`price`,`sell_price`,`ataka`,`bron`,`toch`,`proch`,`uid`,`tank`) VALUES ('gun.jpg','".$_POST['gun']."','75000','40000','40','0','40','40','1','".$_POST['idsd']."')");
mysql_query("INSERT INTO `tanks_shop` (`screen`,`name`,`price`,`sell_price`,`ataka`,`bron`,`toch`,`proch`,`uid`,`tank`) VALUES ('optronics.jpg','".$_POST['svz']."','75000','40000','0','0','0','120','2','".$_POST['idsd']."')");
mysql_query("INSERT INTO `tanks_shop` (`screen`,`name`,`price`,`sell_price`,`ataka`,`bron`,`toch`,`proch`,`uid`,`tank`) VALUES ('fragShield.jpg','".$_POST['bash']."','75000','40000','0','40','40','40','3','".$_POST['idsd']."')");
mysql_query("INSERT INTO `tanks_shop` (`screen`,`name`,`price`,`sell_price`,`ataka`,`bron`,`toch`,`proch`,`uid`,`tank`) VALUES ('frame.jpg','".$_POST['gus']."','75000','40000','40','40','0','40','4','".$_POST['idsd']."')");
}
if($_POST['level']==5){
mysql_query("INSERT INTO `tanks_shop` (`screen`,`name`,`price`,`sell_price`,`ataka`,`bron`,`toch`,`proch`,`uid`,`tank`) VALUES ('gun.jpg','".$_POST['gun']."','100000','50000','50','0','50','50','1','".$_POST['idsd']."')");
mysql_query("INSERT INTO `tanks_shop` (`screen`,`name`,`price`,`sell_price`,`ataka`,`bron`,`toch`,`proch`,`uid`,`tank`) VALUES ('optronics.jpg','".$_POST['svz']."','100000','50000','0','0','0','150','2','".$_POST['idsd']."')");
mysql_query("INSERT INTO `tanks_shop` (`screen`,`name`,`price`,`sell_price`,`ataka`,`bron`,`toch`,`proch`,`uid`,`tank`) VALUES ('fragShield.jpg','".$_POST['bash']."','100000','50000','0','50','50','50','3','".$_POST['idsd']."')");
mysql_query("INSERT INTO `tanks_shop` (`screen`,`name`,`price`,`sell_price`,`ataka`,`bron`,`toch`,`proch`,`uid`,`tank`) VALUES ('frame.jpg','".$_POST['gus']."','100000','50000','50','50','0','50','4','".$_POST['idsd']."')");
}
if($_POST['level']==6){
mysql_query("INSERT INTO `tanks_shop` (`screen`,`name`,`price`,`sell_price`,`ataka`,`bron`,`toch`,`proch`,`uid`,`tank`) VALUES ('gun.jpg','".$_POST['gun']."','200000','100000','60','0','60','60','1','".$_POST['idsd']."')");
mysql_query("INSERT INTO `tanks_shop` (`screen`,`name`,`price`,`sell_price`,`ataka`,`bron`,`toch`,`proch`,`uid`,`tank`) VALUES ('optronics.jpg','".$_POST['svz']."','200000','100000','0','0','0','180','2','".$_POST['idsd']."')");
mysql_query("INSERT INTO `tanks_shop` (`screen`,`name`,`price`,`sell_price`,`ataka`,`bron`,`toch`,`proch`,`uid`,`tank`) VALUES ('fragShield.jpg','".$_POST['bash']."','200000','100000','0','60','60','60','3','".$_POST['idsd']."')");
mysql_query("INSERT INTO `tanks_shop` (`screen`,`name`,`price`,`sell_price`,`ataka`,`bron`,`toch`,`proch`,`uid`,`tank`) VALUES ('frame.jpg','".$_POST['gus']."','200000','100000','60','60','0','60','4','".$_POST['idsd']."')");
}
if($_POST['level']==7){
mysql_query("INSERT INTO `tanks_shop` (`screen`,`name`,`price`,`sell_price`,`ataka`,`bron`,`toch`,`proch`,`uid`,`tank`) VALUES ('gun.jpg','".$_POST['gun']."','250000','125000','70','0','70','70','1','".$_POST['idsd']."')");
mysql_query("INSERT INTO `tanks_shop` (`screen`,`name`,`price`,`sell_price`,`ataka`,`bron`,`toch`,`proch`,`uid`,`tank`) VALUES ('optronics.jpg','".$_POST['svz']."','250000','125000','0','0','0','210','2','".$_POST['idsd']."')");
mysql_query("INSERT INTO `tanks_shop` (`screen`,`name`,`price`,`sell_price`,`ataka`,`bron`,`toch`,`proch`,`uid`,`tank`) VALUES ('fragShield.jpg','".$_POST['bash']."','250000','125000','0','70','70','70','3','".$_POST['idsd']."')");
mysql_query("INSERT INTO `tanks_shop` (`screen`,`name`,`price`,`sell_price`,`ataka`,`bron`,`toch`,`proch`,`uid`,`tank`) VALUES ('frame.jpg','".$_POST['gus']."','250000','125000','70','70','0','70','4','".$_POST['idsd']."')");
}
if($_POST['level']==8){
mysql_query("INSERT INTO `tanks_shop` (`screen`,`name`,`price`,`sell_price`,`ataka`,`bron`,`toch`,`proch`,`uid`,`tank`) VALUES ('gun.jpg','".$_POST['gun']."','500000','250000','80','0','80','80','1','".$_POST['idsd']."')");
mysql_query("INSERT INTO `tanks_shop` (`screen`,`name`,`price`,`sell_price`,`ataka`,`bron`,`toch`,`proch`,`uid`,`tank`) VALUES ('optronics.jpg','".$_POST['svz']."','500000','250000','0','0','0','240','2','".$_POST['idsd']."')");
mysql_query("INSERT INTO `tanks_shop` (`screen`,`name`,`price`,`sell_price`,`ataka`,`bron`,`toch`,`proch`,`uid`,`tank`) VALUES ('fragShield.jpg','".$_POST['bash']."','500000','250000','0','80','80','80','3','".$_POST['idsd']."')");
mysql_query("INSERT INTO `tanks_shop` (`screen`,`name`,`price`,`sell_price`,`ataka`,`bron`,`toch`,`proch`,`uid`,`tank`) VALUES ('frame.jpg','".$_POST['gus']."','500000','250000','80','80','0','80','4','".$_POST['idsd']."')");
}
if($_POST['level']==9){
mysql_query("INSERT INTO `tanks_shop` (`screen`,`name`,`price`,`sell_price`,`ataka`,`bron`,`toch`,`proch`,`uid`,`tank`) VALUES ('gun.jpg','".$_POST['gun']."','1000000','500000','90','0','90','90','1','".$_POST['idsd']."')");
mysql_query("INSERT INTO `tanks_shop` (`screen`,`name`,`price`,`sell_price`,`ataka`,`bron`,`toch`,`proch`,`uid`,`tank`) VALUES ('optronics.jpg','".$_POST['svz']."','1000000','500000','0','0','0','270','2','".$_POST['idsd']."')");
mysql_query("INSERT INTO `tanks_shop` (`screen`,`name`,`price`,`sell_price`,`ataka`,`bron`,`toch`,`proch`,`uid`,`tank`) VALUES ('fragShield.jpg','".$_POST['bash']."','1000000','500000','0','90','90','90','3','".$_POST['idsd']."')");
mysql_query("INSERT INTO `tanks_shop` (`screen`,`name`,`price`,`sell_price`,`ataka`,`bron`,`toch`,`proch`,`uid`,`tank`) VALUES ('frame.jpg','".$_POST['gus']."','1000000','500000','90','90','0','90','4','".$_POST['idsd']."')");
}
if($_POST['level']==10){
mysql_query("INSERT INTO `tanks_shop` (`screen`,`name`,`price`,`sell_price`,`ataka`,`bron`,`toch`,`proch`,`uid`,`tank`) VALUES ('gun.jpg','".$_POST['gun']."','3000000','1500000','100','0','100','100','1','".$_POST['idsd']."')");
mysql_query("INSERT INTO `tanks_shop` (`screen`,`name`,`price`,`sell_price`,`ataka`,`bron`,`toch`,`proch`,`uid`,`tank`) VALUES ('optronics.jpg','".$_POST['svz']."','3000000','1500000','0','0','0','300','2','".$_POST['idsd']."')");
mysql_query("INSERT INTO `tanks_shop` (`screen`,`name`,`price`,`sell_price`,`ataka`,`bron`,`toch`,`proch`,`uid`,`tank`) VALUES ('fragShield.jpg','".$_POST['bash']."','3000000','1500000','0','100','100','100','3','".$_POST['idsd']."')");
mysql_query("INSERT INTO `tanks_shop` (`screen`,`name`,`price`,`sell_price`,`ataka`,`bron`,`toch`,`proch`,`uid`,`tank`) VALUES ('frame.jpg','".$_POST['gus']."','3000000','1500000','100','100','0','100','4','".$_POST['idsd']."')");
}
}
header ("Location: /adminka?new_tank");
}
$idsd=mysql_result(mysql_query("SELECT COUNT(*) FROM `tanks_magazin` "), 0)+55;
echo '<div class="trnt-block" style="margin-bottom:5px;">
<div class="wrap-content">';
echo "<form method='post'>n";
echo "<div class='white sh_b bold cntr'>Новый танк</div><table><div class='white sh_b bold small'>";
echo "<tr><td>Id:</td><td style='width:150px;'><input type='text' name='idsd' value='".$idsd."'></td></tr>";
echo "<tr><td>Картинка:</td><td style='width:150px;'><input type='text' name='screen'></td></tr>";
echo "<tr><td>Название:</td><td style='width:150px;'><input type='text' name='name'></td></tr>";
echo "<tr><td>Цена:</td><td style='width:150px;'><input type='text' name='price'></td></tr>";
echo "<tr><td>Атака:</td><td style='width:150px;'><input type='text' name='ataka'></td></tr>";
echo "<tr><td>Броня:</td><td style='width:150px;'><input type='text' name='bron'></td></tr>";
echo "<tr><td>Точность:</td><td style='width:150px;'><input type='text' name='toch'></td></tr>";
echo "<tr><td>Прочность:</td><td style='width:150px;'><input type='text' name='proch'></td></tr>";
echo "<tr><td>Орудие:</td><td style='width:150px;'><input type='text' name='gun'></td></tr>";
echo "<tr><td>Связь:</td><td style='width:150px;'><input type='text' name='svz'></td></tr>";
echo "<tr><td>Башня:</td><td style='width:150px;'><input type='text' name='bash'></td></tr>";
echo "<tr><td>Гусеницы:</td><td style='width:150px;'><input type='text' name='gus'></td></tr>";
echo "<tr><td>Описание:</td><td style='width:150px;'><input type='text' name='opis'></td></tr>";
echo "<tr><td>Тип:</td><td style='width:150px;'>
<select name='type'>
<option value='Лёгкий танк'>Лёгкий танк</option>
<option value='Средний танк'>Средний танк</option>
<option value='Тяжёлый танк'>Тяжёлый танк</option>
<option value='ПТ-САУ'>ПТ-САУ</option>
</select>
</td></tr>";
echo "<tr><td>Нация:</td><td style='width:150px;'>
<select name='strana'>
<option value='1'>Германия</option>
<option value='2'>СССР</option>
<option value='3'>США</option>
<option value='4'>ФРАНЦИЯ</option>
<option value='5'>Премиум</option>
</select>
</td></tr>";
echo "<tr><td>Прем нация:</td><td style='width:150px;'>
<select name='orud'>
<option value='Германия'>Германия</option>
<option value='СССР'>СССР</option>
<option value='США'>США</option>
<option value='ФРАНЦИЯ'>ФРАНЦиЯ</option>
</select>
</td></tr>";
echo "<tr><td>Танк:</td><td style='width:150px;'>
<select name='level'>
<option value='1'>1 уровня</option>
<option value='2'>2 уровня</option>
<option value='3'>3 уровня</option>
<option value='4'>4 уровня</option>
<option value='5'>5 уровня</option>
<option value='6'>6 уровня</option>
<option value='7'>7 уровня</option>
<option value='8'>8 уровня</option>
<option value='9'>9 уровня</option>
<option value='10'>10 уровня</option>
</select>
</td></tr>";
echo'</div></table></div>';echo'</div>
</div>';
echo'</div><div class="bot">
<span class="input-but border"><span>';
echo "<input name='okey' value="Создать" class='w100' type="submit" /></span></span>
</div></form>";
echo'<a class="simple-but gray" href="/adminka?tour"><span><span>Назад</span></span></a></div>';
include_once 'foots.php';
exit;
}
if(isset($_GET['tour'])){
if(isset($_GET['add'])){
if(isset($_POST['ok'])){
mysql_query("INSERT INTO `tanks_tournament` (`screen`,`name`,`zolota`,`rating`,`nachalo`,`leveln`,`levelc`,`time_k`) VALUES ('".$_POST['screen']."','".$_POST['name']."','".$_POST['zolota']."','".$_POST['rating']."','".$_POST['nachalo']."','".$_POST['leveln']."','".$_POST['vse']."','".$_POST['time_k']."')");
header ("Location: /adminka?tour");
}
echo '<div class="trnt-block" style="margin-bottom:5px;">
<div class="wrap-content">';
echo "<form method='post'>n";
echo "<div class='white sh_b bold cntr'>Турнир</div><table><div class='white sh_b bold small'>";
echo "<tr><td>Картинка:</td><td style='width:150px;'><input type='text' name='screen' '></td></tr>";
echo "<tr><td>Название:</td><td style='width:150px;'><input type='text' name='name' '></td></tr>";
echo "<tr><td>Золота:</td><td style='width:150px;'><input type='text' name='zolota' '></td></tr>";
echo "<tr><td>Рейтинг:</td><td style='width:150px;'><input type='text' name='rating' '></td></tr>";
echo "<tr><td>Начало:</td><td style='width:150px;'><input type='text' name='nachalo' '></td></tr>";
echo "<tr><td>Конец:</td><td style='width:150px;'><input type='text' name='time_k' '></td></tr>";
echo "<tr><td>С:</td><td style='width:150px;'>
<select name='leveln'>
<option value='1'>1 уровня</option>
<option value='2'>2 уровня</option>
<option value='3'>3 уровня</option>
<option value='4'>4 уровня</option>
<option value='5'>5 уровня</option>
<option value='6'>6 уровня</option>
<option value='7'>7 уровня</option>
<option value='8'>8 уровня</option>
</select>
</td></tr>";
echo "<tr><td>По:</td><td style='width:150px;'>
<select name='vse'>
<option value='2'>2 уровень</option>
<option value='3'>3 уровень</option>
<option value='4'>4 уровень</option>
<option value='5'>5 уровень</option>
<option value='6'>6 уровень</option>
<option value='7'>7 уровень</option>
<option value='8'>8 уровень</option>
<option value='9'>9 уровень</option>
<option value='10'>10 уровень</option>
</select>
</td></tr>";
echo'</div></table></div>';echo'</div>
</div>';
echo'</div><div class="bot">
<span class="input-but border"><span>';
echo "<input name='ok' value="Создать" class='w100' type="submit" /></span></span>
</div></form>";
echo'<a class="simple-but gray" href="/adminka?tour"><span><span>Назад</span></span></a></div>';
include_once 'foots.php';
exit;
}
if(isset($_GET['zap'])){
if(isset($_GET['id'])){
mysql_query("UPDATE `tanks_tournament` SET `konec`='1' WHERE `id`='".$_GET['id']."' ");
header ("Location :adminka?tour");
}}
if(isset($_GET['zak'])){
if(isset($_GET['id'])){
mysql_query("UPDATE `tanks_tournament` SET `konec`='2' WHERE `id`='".$_GET['id']."' ");
$tour_winka= mysql_query("SELECT * FROM `tanks_tournament_users` where `tour`='".$_GET['id']."'");
while($tour_winkas = mysql_fetch_array($tour_winka)) {
mysql_query("UPDATE `tanks` SET `tour`='0' WHERE `id`='".$tour_winkas ['user']."'");
mysql_query("UPDATE `tanks_tournament_users` SET `vkl`='1' WHERE `user`='".$tour_winkas ['user']."'");
}
$tour_win= mysql_query("SELECT * FROM `tanks_tournament_users` where `tour`='".$_GET['id']."' ORDER BY win DESC LIMIT 5");
while($tour_wins = mysql_fetch_array($tour_win)) {
$tourka= mysql_fetch_array(mysql_query("SELECT * FROM `tanks_tournament` where `id`='".$tour_wins['tour']."'"));
$mc_tour= mysql_fetch_array(mysql_query("SELECT * FROM `collective_user` WHERE `id_user` = '".$tour_wins['user']."'"));
mysql_query("UPDATE `collective` SET `rating` = `rating`+'".$tourka['rating']."' WHERE `id`='".$mc_tour['id_collective']."'");
mysql_query("UPDATE `collective_user` SET `rating` = `rating`+'".$tourka['rating']."' WHERE `id_user`='".$tour_wins['user']."'");
mysql_query("INSERT INTO `tanks_medal` (`id_user`,`name`,`screen`,`tank`,`zadan`) VALUES ('".$tour_wins['user']."','Счастливчик','lucky.png','".$tour_wins['tanks']."','победу в сражении ".$tourka['name']."')");
mysql_query("UPDATE `tanks` SET `zolota`=`zolota`+'".$tourka['zolota']."',`rating`=`rating`+'".$tourka['rating']."',`tour`='0' WHERE `id`='".$tour_wins['user']."'");
mysql_query("UPDATE `tanks_tournament_users` SET `vkl`='1' WHERE `user`='".$tour_wins['user']."'");
}
header ("Location :adminka?tour");
}}
if(isset($_GET['del'])){
if(isset($_GET['id'])){
mysql_query("DELETE FROM `tanks_tournament` WHERE `id` = '".$_GET['id']."'");
mysql_query("DELETE FROM `tanks_tournament_users` WHERE `tour` = '".$_GET['id']."'");
header ("Location :adminka?tour");
}}
$tour= mysql_query("SELECT * FROM `tanks_tournament` ORDER BY id DESC LIMIT 5");
while($tours = mysql_fetch_array($tour)) {
echo '<div class="trnt-block" style="margin-bottom:5px;padding:5px;">';
$time_tour=time_left($tours['nachalo']-time());
echo'
<div class="wrap1">
<div class="mb5 inbl">
<div class="thumb fl">
<img src="/tanks/images/tour/'.$tours['screen'].'"">
<span class="mask2"> </span>
</div>
<div class="ml58 small white sh_b bold">
<span class="green2">'.$tours['name'].' ';
if($tours['konec']==1){echo'начался</span>';}
elseif($tours['konec']==2){echo'кончился</span>';}
elseif($tours['konec']==0){echo'в '.$tours['nachalo'].'</span>';}
echo'<br>С '.$tours['nachalo'].' по '.$tours['time_k'].'</span>';
echo', уровни с '.$tours['leveln'].' по '.$tours['levelc'].'<br>
Приз: <img src="tanks/images/icons/gold.png"> '.$tours['zolota'].', <img src="tanks/images/icons/exp.png"> '.$tours['rating'].'';
if ($tours['konec']==0){
echo '</div></div></div>
<div class="clrb"></div>
</div>
<div class="bot">
<a class="simple-but border" href="/adminka?tour&zap&id='.$tours['id'].'">
<span>
<span>
Запустить сражение
</span>
</span>
</a>
</div>';}
elseif($tours['konec']==1){echo '</div></div></div>
<div class="clrb"></div>
</div>
<div class="bot">
<a class="simple-but border" href="/adminka?tour&zak&id='.$tours['id'].'">
<span>
<span>
Закончить сражение
</span>
</span>
</a>
</div>';}
elseif($tours['konec']==2){echo '</div></div></div>
<div class="clrb"></div>
</div>
<div class="bot">
<a class="simple-but border" href="/adminka?tour&del&id='.$tours['id'].'">
<span>
<span>
Удалить сражение
</span>
</span>
</a>
</div>';}
echo'
</div></div></div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>';
}
echo'<a class="simple-but gray" href="/adminka?tour&add"><span><span>Создать турнир</span></span></a></div>';
echo'<a class="simple-but gray" href="/adminka"><span><span>Назад</span></span></a></div>';
include_once 'foots.php';
exit;
}
if(isset($_GET['zpr'])){
if(isset($_GET['ok'])){
$q=mysql_querll("SELECT * FROM `tanks` WHERE `status`='1'");
mysql_query("UPDATE `tanks` SET `rubles` = `rubles`+'100' WHERE `status`='1' ");
while($post=mysql_fetch_array($q))
{
mysql_query("INSERT INTO `kolhoz_mail` SET `id_user` = '$post[id]', `id_kont` = '$tanks_code[id]', `msg` = 'Вам выдали зароботную плату в виде [imgs]http://tankon.mobi/images/rubles.png[/imgs] 100 игровых рублей!', `time` = '$time', `type` = 'to'");
}
header ("Location: /adminka");
}
echo'<div class="bot"><table><tbody><tr><td class="w50 pr1">
<a class="simple-but border" href="/adminka?zpr&ok"><span>
<span>Выдать</span></span></a></td>
<td class="w50 pl1"><a class="simple-but border" href="/adminka">
<span><span>Нет, рано</span></span></a></td></tr></tbody></table></div>';
}
if(isset($_GET['vid'])){
if(isset($_GET['ok'])){
$qrt=mysql_querll("SELECT * FROM `tanks`");
mysql_query("UPDATE `tanks` SET `rubles` = `rubles`+'200'");
while($postka=mysql_fetch_array($qrt))
{
mysql_query("INSERT INTO `kolhoz_mail` SET `id_user` = '$postka[id]', `id_kont` = '0', `msg` = 'К 31 октября, в честь Ночи всех святых, TankOn преобразится в лучших традициях Хэллоуина: череп, тыква, привидение … Что это было?! Может, летучая мышь пролетела неслышно в темноте, задев крылом? В честь хэллоуина вам выдано [imgs]http://tankon.mobi/images/rubles.png[/imgs] 200 рублей, также не пропустите акцию x5', `time` = '$time', `type` = 'to'");
}
header ("Location: /adminka");
}
echo'<div class="bot"><table><tbody><tr><td class="w50 pr1">
<a class="simple-but border" href="/adminka?vid&ok"><span>
<span>Выдать</span></span></a></td>
<td class="w50 pl1"><a class="simple-but border" href="/adminka">
<span><span>Нет, рано</span></span></a></td></tr></tbody></table></div>';
}
if(isset($_GET['rekl'])){
$HISHNIK=mysql_result(mysql_query("SELECT COUNT(*) FROM `reklama` WHERE `adress`='HISHNIK'"), 0);
$DS=mysql_result(mysql_query("SELECT COUNT(*) FROM `reklama` WHERE `adress`='DS'"), 0);
$Fakenham=mysql_result(mysql_query("SELECT COUNT(*) FROM `reklama` WHERE `adress`='Fakenham'"), 0);
$obsh=mysql_result(mysql_query("SELECT COUNT(*) FROM `reklama`"), 0);
echo'<div class="trnt-block p5" style="margin-bottom:3px;">';
echo'<table class="white small bold"><tbody>
<tr><td>HISHNIK:</td><td style="width:150px"><font color="red">'.$HISHNIK.'</font></td></tr>
<tr><td>Desmond Stels:</td><td style="width:150px"><font color="red">'.$DS.'</font></td></tr>
<tr><td>Fakenham:</td><td style="width:150px"><font color="red">'.$Fakenham.'</font></td></tr>
<tr><td><br>Все:</td><td style="width:150px"><br><font color="yellow">'.$obsh.'</font></td></tr>
</tbody></table>';
echo'</div>';
echo'<a class="simple-but gray" href="/adminka"><span><span>Назад</span></span></a></div>';
include_once 'foots.php';
exit;
}
if(isset($_GET['statistika'])){
$vseuser=mysql_result(mysql_query("SELECT COUNT(*) FROM `user`"), 0);
$referal=mysql_result(mysql_query("SELECT COUNT(*) FROM `referals`"), 0);
$tanks=mysql_result(mysql_query("SELECT COUNT(*) FROM `tanks_angar`"), 0);
$tanks_mag=mysql_result(mysql_query("SELECT COUNT(*) FROM `tanks_magazin`"), 0);
$referal1=mysql_result(mysql_query("SELECT COUNT(*) FROM `referals` WHERE `ip`='1'"), 0);
$obsh=mysql_result(mysql_query("SELECT COUNT(*) FROM `reklama`"), 0);
echo'<div class="trnt-block p5" style="margin-bottom:3px;">';
echo'<table class="white small bold"><tbody>
<tr><td>Рефералы:</td><td style="width:150px"><font color="yellow">'.$referal.'/'.$referal1.'</font></td></tr>
<tr><td>Игроков:</td><td style="width:150px"><font color="yellow">'.$vseuser.'</font></td></tr>
<tr><td>Танков:</td><td style="width:150px"><font color="yellow">'.$tanks.'</font></td></tr>
<tr><td>Танков в магазине:</td><td style="width:150px"><font color="yellow">'.$tanks_mag.'</font></td></tr>
</tbody></table>';
echo'</div>';
echo'<a class="simple-but gray" href="/adminka"><span><span>Назад</span></span></a></div>';
include_once 'foots.php';
exit;
}
echo '<a href="?popol"><div class="trnt-block p5" style="margin-bottom:5px">Пополнения</div></a>';
echo '<a href="?tour"><div class="trnt-block p5" style="margin-bottom:5px">Сражения</div></a>';
echo '<a href="?new_tank"><div class="trnt-block p5" style="margin-bottom:5px">Добавить танк и модули</div></a>';
echo '<a href="?redak"><div class="trnt-block p5" style="margin-bottom:5px">Редактирование</div></a>';
echo '<a href="?bans"><div class="trnt-block p5" style="margin-bottom:5px">Баны</div></a>';
echo '<a href="?new_presents"><div class="trnt-block p5" style="margin-bottom:5px">Добавить подарок</div></a>';
echo '<a href="?zpr"><div class="trnt-block p5" style="margin-bottom:5px">Выдать ЗП мд</div></a>';
echo '<a href="?vid"><div class="trnt-block p5" style="margin-bottom:5px">Выдать подарки</div></a>';
echo '<a href="?rekl"><div class="trnt-block p5" style="margin-bottom:5px">Реклама</div></a>';
echo '<a href="?statistika"><div class="trnt-block p5" style="margin-bottom:5px">Статистика</div></a>';
}
include_once 'foots.php';}else{header("Location:/");}
?>