Файл: mod/instalscript/metro/index.php
Строк: 710
<?
#########МОД ПОДЗЕМЕЛЬЕ ДЛЯ ДВИЖКА WAPHERO.RU###
#########Автор:InstalScript[is](Колян Карамышев)#####
#########Понравился мод я здесь bymas.ru/id3741######
#########ПРОДОВАТЬ И СЛИВАТЬ МОД ЗАПРЕЩЕНО###
$_GET[id]=intval($_GET['id']);
$instalscript=htmlspecialchars(trim($_GET['instalscript']));
$header = 'Подземелье';
include_once '../../../core/system.php';
include_once '../../../core/head.php';
switch($instalscript){
default:
echo"<div class='title'>";
echo"<img src='img/logo.jpg'></div><div class='player menuList'><b>";
$metro_1 = mysql_query("SELECT * FROM `metro` WHERE `open`='yes' ");
while($metro = mysql_fetch_array($metro_1)){
$i++;
echo"<li><a href='instalscript-bymas?instalscript=info-metro&id=$metro[id]'>$i.$metro[name_rus] [$metro[lvl]ур.]</a></li>";}
echo"<li><a class='link-1' href='instalscript-bymas?instalscript=list-band'><font color='#A5CF12'>Поиск банд</font></a></li>";
echo"</b></div>";
break;
case'all-list-mob':
$mob = mysql_query("SELECT * FROM `metro_mob` ");
echo"<div class='mini-line'></div>";
echo"<div class='player' style='line-height:140%;'>";
if($mob==0){echo"Монстров нет!";}else{
while($mb = mysql_fetch_array($mob)){
$i++;
$mo1 = mysql_fetch_array(mysql_query("SELECT * FROM `metro` WHERE `id`='".$mb['metro_id']."' "));
echo"$i. $mb[name] ($mb[kol] шт)</br>";
if($mb['tip']=='mob'){$mb['tip']='моб';}
if($mb['tip']=='boss'){$mb['tip']='босс';}
echo"Тип:$mb[tip]<br/>";
echo"<img src='$mb[img]'></br>";
echo"<img src='/images/icon/str.png' alt='str'> Сила: $mb[sila]<br>";
echo"<img src='/images/icon/vit.png' alt='vit'> Здоровье: $mb[max_health]<br>";
echo"<img src='/images/icon/agi.png' alt='agi'> Ловкость: $mb[lovk]<br>";
echo"<img src='/images/icon/def.png' alt='def'> Защита: $mb[zashit]<br>";
echo"<font color='#78CC40'>Подземелье:$mo1[name_rus]</font>";
echo"<div class='line'></div>";
}
}
echo"</div>";
break;
case'all-list-award':
$award = mysql_query("SELECT * FROM `metro_award` ");
if($award==0){echo"Вещей нет!";}else{
while($aw = mysql_fetch_array($award)){
$i++;
$stat = explode(';',$aw['stats']);
echo'<div class="player"><div class="float-left">
<img width="50" height="50" src="'.$aw['url'].'"></div>
<img src="/images/icon/equip.png"> <span class="yellow">'.$i.'. '.$aw['name'].'</span><br>
'.($stat['0']>0?'<span class="dgreen"><img src="/images/icon/str.png" alt="*"/>+'.$stat['0'].'</span>':null).'
'.($stat['1']>0?'<span class="dgreen"><img src="/images/icon/vit.png" alt="*"/>+'.$stat['1'].'</span>':null).'</span>
'.($stat['2']>0?'<span class="dgreen"><img src="/images/icon/agi.png" alt="*"/>+'.$stat['2'].'</span>':null).'</span>
'.($stat['3']>0?'<span class="dgreen"><img src="/images/icon/def.png" alt="*"/>+'.$stat['3'].'</span>':null).'</span>
'.($stat['4']>0?'<span class="dgreen"><img src="/images/icon/mana.png" alt="*"/>+'.$stat['4'].'</span>':null).'</span>
<br>Тип: '.$aw['type'].' <div style="clear:both;"></div></div>';
$mo = mysql_fetch_array(mysql_query("SELECT * FROM `metro` WHERE `id`='".$aw['metro_id']."'"));
echo"<div class='player menuList title'><b><li><a href='instalscript-bymas?instalscript=info-metro&id=$mo[id]'>$mo[name_rus]</a></li></b></div>";
}
}
break;
case'info-metro':
$mo = mysql_fetch_array(mysql_query("SELECT * FROM `metro` WHERE `id`='".$_GET['id']."' AND `open`='yes' "));
$awarss = mysql_fetch_array(mysql_query("SELECT * FROM `metro_award` WHERE `metro_id`='".$_GET['id']."' "));
$awar = mysql_query("SELECT * FROM `metro_award` WHERE `metro_id`='$mo[id]' ");
$boss_1= mysql_fetch_array(mysql_query("SELECT * FROM `metro_mob` WHERE `metro_id`='".$_GET['id']."' AND `tip`='boss' "));
$bos = mysql_query("SELECT * FROM `metro_mob` WHERE `metro_id`='".$_GET['id']."' AND `tip`='boss'");
echo"<div class='title'><b>";
if($mo==0){echo"Ошибка!";}
else{
echo"<div class='player menuList'>";
echo"<div class=title>$mo[name_rus]</div>";
echo"<img src='$mo[img]'>";
echo"$mo[info]";
if($boss_1!=0){echo"</br><font color='#6DA51B'>Боссы</font>";while($boss = mysql_fetch_array($bos)){echo"<a href='instalscript-bymas?instalscript=info-mob&tip=boss&id=$boss[id]'><font color='red'>$boss[name]</font></a> ";}}
if($awarss!=0){echo"Награда";while($awards = mysql_fetch_array($awar)){echo"<a href='instalscript-bymas?instalscript=info-shmot&id=$awards[id]'><font color='#D56513'>$awards[name]</font></a> ";}}
if($user['level']>=$mo['lvl']){echo"<div class='player menuList title'><b>
<li><a href='instalscript-bymas?instalscript=create-band&id=$mo[id]'><font color='#A5CF12'>Создать банду</font></a></li>
<li><a href='instalscript-bymas?instalscript=list-band&id=$mo[id]'><font color='#A5CF12'>Поиск банд</font></a></li></b></div>";}else{echo"</div></br>Требуется $mo[lvl]ур.";}
}
echo"</b></div></div>";
break;
case'create-band':
$cb = mysql_fetch_array(mysql_query("SELECT * FROM `metro` WHERE `id`='".$_GET['id']."' AND `open`='yes' "));
if($cb==0){echo"Ошибка не выбрано подземелье!</br>";}
if($user['level']<$cb['lvl']){echo"Ваш уровень не для этого подземелье!</br>";}
else{
if($_GET['create']=='yes'){
$ub = mysql_fetch_array(mysql_query("SELECT * FROM `metro_bands` WHERE `user`='".$user['nick']."' "));
if($ub!=0){header('Location: instalscript-bymas?instalscript=banda');exit;
}
else{
$time_user=time();
mysql_query("INSERT INTO `metro_bands` SET `metro_id` = '".$cb['id']."',`general_id` = '".$user['id']."',`user` = '$user[nick]',`tip` = 'lider',`proideno` = 'no',`nagrada_rozdana` = 'no',`time` = '".time()."',`vbande` = 'yes',`vboi` = 'no',`zhiv`='yes',`max_man` = '1' ");
$mobs=mysql_fetch_array(mysql_query("SELECT * FROM `metro_mob` WHERE `metro_id`='".$cb['id']."' ORDER BY `poryadok` DESC"));
mysql_query("INSERT INTO `metro_battle` SET `metro_id` = '".$mobs['id']."',`general_id` = '".$user['id']."',`tip` = '".$mobs['tip']."',`poryadok` = '".$mobs['poryadok']."',`lovk` = '".$mobs['lovk']."',`zashit` = '".$mobs['zashit']."',`health` = '".$mobs['health']."',`max_health` = '".$mobs['max_health']."',`sila` = '".$mobs['sila']."',`kol` = '".$mobs['kol']."',`img` = '".$mobs['img']."',`name` = '".$mobs['name']."',`time`='".time()."' ") or die (mysql_error());
mysql_query("INSERT INTO `metro_log` SET `text` = 'Бой начался',`kto_udaril`='start',`general_id`='".$user['id']."' ") or die (mysql_error());
mysql_query("INSERT INTO `metro_chat` SET `msg`='Игрок $user[nick] создал банду на подземелье $cb[name_rus]!',`time`='".time()."',`general_id`='".$user['id']."' ") or die (mysql_error());
header('Location: instalscript-bymas?instalscript=banda');exit;
}
}else{
echo"<div class='player menuList'>";
echo"Вы действительно хотите создать банду на подземелье $cb[name_rus]";
echo"</div>";
echo"<div class='player menuList title'><b>
<li><a href='instalscript-bymas?instalscript=create-band&create=yes&id=$cb[id]'><font color='#20770B'>Да</font></a></li>
<li><a href='instalscript-bymas?instalscript=info-metro&id=$cb[id]'><font color='#7E0303'>Нет</font></a></li></b></div>";
}
}
break;
case'dead':
switch($_GET['act']){
default:
$moya_banda = mysql_fetch_array(mysql_query("SELECT * FROM `metro_bands` WHERE `user`='".$user['nick']."' "));
if($moya_banda==0){echo"Вы не состоите в банде!";}else{
echo"<div class='title'>";
echo"<img src='img/logo-dead.jpg'></br>Вы умерли";
echo"<div class='player menuList'>
<li><a href='instalscript-bymas-battle'><font color='#17650C'>В банду</font></a></li>
<li><a href='instalscript-bymas?instalscript=dead&act=life'><font color='#0BD7B3'>Восстоновить жизни за 10 золотых</font></a></li>
</div>";
echo"</div>";
}
break;
case'life':
if($user['gold']>=10){mysql_query("UPDATE `user` SET `health`= '".$user['max_health']."',`gold`='".($user['gold']-10)."' WHERE `nick`='".$user['nick']."' ");
mysql_query("UPDATE `metro_bands` SET `zhiv`='yes' WHERE `user`='".$user['nick']."' ");
header('Location: instalscript-bymas?instalscript=banda&life=yes');exit;
}
if($user['gold']<10){
header('Location: instalscript-bymas?instalscript=banda&life=no');exit;
}
break;
}
break;
case'banda':
$moya_banda = mysql_fetch_array(mysql_query("SELECT * FROM `metro_bands` WHERE `user`='".$user['nick']."' ")); //моя банда
$moe_podzemelie = mysql_fetch_array(mysql_query("SELECT * FROM `metro` WHERE `id`='".$moya_banda['metro_id']."' ")); //подземелье
$lider_bands = mysql_fetch_array(mysql_query("SELECT * FROM `metro_bands` WHERE `tip`='lider' AND `general_id`='".$moya_banda['general_id']."' ")); //лидер банды
$lider_band = mysql_fetch_array(mysql_query("SELECT * FROM `user` WHERE `nick`='".$lider_bands['user']."' ")); //лидер банды ищем в таблице user
$users_v_bande = mysql_fetch_array(mysql_query("SELECT * FROM `metro_bands` WHERE `general_id`='".$moya_banda['general_id']."' ")); //массив списка людей в банде
$tsu = mysql_fetch_array(mysql_query("SELECT * FROM `metro_user_time` WHERE `user` = '".$user['nick']."' AND `metro_id`='".$moya_banda['metro_id']."' AND `time`>'".time()."' "));
if($moya_banda){
$users_vbande = mysql_result(mysql_query("SELECT COUNT(*) FROM `metro_bands` WHERE `general_id`='".$moya_banda['general_id']."' AND `vbande`='yes' "),0);
$users_kollichestvo = mysql_result(mysql_query("SELECT COUNT(*) FROM `metro_bands` WHERE `general_id`='".$moya_banda['general_id']."' "),0);
}
mysql_query("UPDATE `metro_battle` SET `time`='".(time())."' WHERE `general_id`='".$moya_banda['general_id']."' ");
echo"<div class='title'>";
if($moya_banda==0){echo"Вы не состоите в банде!";}else{
if($_GET['defeat']=='yes'){echo"<font color='#F00000'>Поражение! Подземелье не пройдено!</font></br>";}
if($_GET['life']=='yes'){echo"<font color='#0BD7B3'>Жизни восстановлены</font></br>";}
if($_GET['life']=='no'){echo"Недостаточно золота</br>";}
if($_GET['exit']=='going'){
if($_GET['e']=='yes'){
if($user['nick']==$lider_bands['user'] && $users_kollichestvo>1){echo"$users_kollichestvo Передайте сначала кому-либо лидерство!";}
elseif($users_kollichestvo==1){
mysql_query("DELETE FROM `metro_log` WHERE `general_id`='".$moya_banda['general_id']."' ");
mysql_query("DELETE FROM `metro_chat` WHERE `general_id`='".$moya_banda['general_id']."' ");
mysql_query("DELETE FROM `metro_battle` WHERE `general_id`='".$moya_banda['general_id']."' ");
mysql_query("DELETE FROM `metro_bands` WHERE `general_id`='".$moya_banda['general_id']."' ");
echo"Вы покинули банду</br>";}
else{mysql_query("DELETE FROM `metro_bands` WHERE `user`='".$user['nick']."' ");echo"Вы покинули банду</br>";}
}
else{
echo"Вы действительно хотите покинуть банду?</br><a href='instalscript-bymas?instalscript=banda&exit=going&e=yes'><font color='#920303'>Да</font></a>
</br><a href='instalscript-bymas?instalscript=banda'><font color='#1F8510'>Нет</font></a>";}
}
else{
if($_GET['defeat']=='yes'){
$mobs=mysql_fetch_array(mysql_query("SELECT * FROM `metro_mob` WHERE `metro_id`='".$moya_banda['metro_id']."' ORDER BY `poryadok` DESC"))or die (mysql_error());
mysql_query("UPDATE `metro_battle` SET
`metro_id` = '".$mobs['id']."',
`general_id` = '".$user['id']."',
`tip` = '".$mobs['tip']."',
`poryadok` = '".$mobs['poryadok']."',
`lovk` = '".$mobs['lovk']."',
`zashit` = '".$mobs['zashit']."',
`health` = '".$mobs['health']."',
`max_health` = '".$mobs['max_health']."',
`sila` = '".$mobs['sila']."',
`kol` = '".$mobs['kol']."',
`img` = '".$mobs['img']."',
`name` = '".$mobs['name']."',
`time`='".time()."' ") or die (mysql_error());
mysql_query("UPDATE `metro_bands` SET `nagrada`='',`nagrada_rozdana`='no',`uron`='0',`proideno`='no' WHERE `general_id`='".$moya_banda['general_id']."' ") or die (mysql_error());
echo"<div class='player menuList'><li><a href='instalscript-bymas?instalscript=dead&act=life'><font color='#0BD7B3'>Восстоновить жизни за 10 золотых</font></a></li></div>";
}
if($tsu==0 && $moya_banda['tip']=='lider'){
$mobs=mysql_fetch_array(mysql_query("SELECT * FROM `metro_mob` WHERE `metro_id`='".$moya_banda['metro_id']."' ORDER BY `poryadok` DESC"))or die (mysql_error());
mysql_query("UPDATE `metro_battle` SET
`metro_id` = '".$mobs['id']."',
`general_id` = '".$user['id']."',
`tip` = '".$mobs['tip']."',
`poryadok` = '".$mobs['poryadok']."',
`lovk` = '".$mobs['lovk']."',
`zashit` = '".$mobs['zashit']."',
`health` = '".$mobs['health']."',
`max_health` = '".$mobs['max_health']."',
`sila` = '".$mobs['sila']."',
`kol` = '".$mobs['kol']."',
`img` = '".$mobs['img']."',
`name` = '".$mobs['name']."',
`time`='".time()."' ") or die (mysql_error());
mysql_query("UPDATE `metro_bands` SET `nagrada`='',`nagrada_rozdana`='no',`uron`='0',`proideno`='no' WHERE `general_id`='".$moya_banda['general_id']."' ") or die (mysql_error());
}
if(time()>$tsu['time']){mysql_query("DELETE FROM `metro_user_time` WHERE `user`='".$user['nick']."' AND `metro_id`='".$moya_banda['metro_id']."' ") or die (mysql_error());}
if($_GET['ub']=='yes'){if($moya_banda['tip']=='lider'){$pl = mysql_fetch_array(mysql_query("SELECT * FROM `metro_bands` WHERE `general_id`='".$moya_banda['general_id']."' AND `user`='".$_GET['pl']."' "))or die(mysql_error());if($_GET['pl']!=''){if($pl==0){echo"Не выбран боец!</br>";}else{$upl = mysql_fetch_array(mysql_query("SELECT * FROM `user` WHERE `nick`='".$pl['user']."' "));if($pl['user']==$user['nick']){echo"Вы не можете передать лидерство самому себе</br>";}else{mysql_query("UPDATE `metro_bands` SET `tip`='lider' WHERE `user`='".$upl['nick']."' ")or die(mysql_error());mysql_query("UPDATE `metro_log` SET `general_id`='".$upl['id']."' WHERE `general_id`='".$moya_banda['general_id']."' ")or die(mysql_error());mysql_query("UPDATE `metro_chat` SET `general_id`='".$upl['id']."' WHERE `general_id`='".$moya_banda['general_id']."' ")or die(mysql_error());mysql_query("UPDATE `metro_battle` SET `general_id`='".$upl['id']."' WHERE `general_id`='".$moya_banda['general_id']."' ")or die(mysql_error());mysql_query("UPDATE `metro_bands` SET `general_id`='".$upl['id']."' WHERE `general_id`='".$moya_banda['general_id']."' ")or die(mysql_error());mysql_query("UPDATE `metro_bands` SET `tip`='user' WHERE `user`='".$moya_banda['user']."' ")or die(mysql_error());echo"Вы передали лидерство бойцу $_GET[pl] </br>";}}}}else{echo"Вы не лидер банды</br>";}}
if($_GET['kyy']=='yes'){if($_GET['ky']=='yes'){$kk = mysql_fetch_array(mysql_query("SELECT * FROM `metro_bands` WHERE `general_id`='".$moya_banda['general_id']."' AND `user`='".$_GET['kk']."' "));if($_GET['kk']!=''){echo"";}if($kk==0){echo"Не выбран боец!</br>";}else{if($kk['user']==$user['nick']){echo"Этого делать нельзя</br>";}else{mysql_query("DELETE FROM `metro_bands` WHERE `user`='".$kk['user']."' ")or die(mysql_error());echo"Вы кикнули бойца</br>";}}}else{echo"Вы не лидер банды</br>";}}
if($moya_banda['proideno']=='yes'){echo"<font color='#6CF985'>Подземелье пройдено награда раздана</font></br>";
/*ВЫДАЕМ НАГРАДУ*/
if($moya_banda['nagrada']=='' && $moya_banda['nagrada_rozdana']=='no' && $moya_banda['uron']>0){
$shmot = mysql_fetch_array(mysql_query("SELECT * FROM `metro_award` WHERE `metro_id` = '".$moya_banda['metro_id']."' ORDER BY RAND() LIMIT 1")) or die (mysql_error());
mysql_query("INSERT INTO `metro_kompl_us` SET `id_shmotki` = '".$shmot['id']."',`id_user` = '".$user['id']."'") or die (mysql_error());
mysql_query("UPDATE `metro_bands` SET `nagrada`='".$shmot['name']."',`nagrada_rozdana` = 'yes' WHERE `user`='".$user['nick']."' ")or die(mysql_error());
}
}
if($user['health']>0){mysql_query("UPDATE `metro_bands` SET `zhiv`='yes' WHERE `user`='".$user['nick']."' ")or die(mysql_error());}
if($lider_bands['zhiv']=='yes' && $lider_bands['vboi']=='yes' && $lider_bands['vbande']=='yes' && $tsu==0 ){header('Location: instalscript-bymas-battle?go=go');}
if($tsu!=0){echo"<font color='#FB4040'>Вы сохранены в данном подземелье до [".vremja($tsu['time'])."]</br>Текущее время</br> [".vremja(time())."]</font></br>";}
echo"Банда на подземелье $moe_podzemelie[name_rus]";
echo"<img src='img/logo-banda.jpg'></br>";
echo"Лидер банды </br><a href='/user/?id=$lider_band[id]'>$lider_band[nick]</a></br>";
if($moya_banda['tip']!='lider'){echo"Бой может начать только лидер</br>";}else{echo"Перед началом боя оповестите всех кто в банде<div class='player menuList'><li><a href='instalscript-bymas-battle'><font color='#17650C'>Начать бой</font></a></li></div></br>";}
echo"Список бойцов</br>";
$moya_band = mysql_query("SELECT * FROM `metro_bands` WHERE `general_id`='".$moya_banda['general_id']."' "); //моя банда
while($uuuu = mysql_fetch_array($moya_band))
{
$userss_v_bande = mysql_fetch_array(mysql_query("SELECT * FROM `user` WHERE `nick`='".$uuuu['user']."' "));
echo"<a href='/user/?id=$userss_v_bande[id]'>$userss_v_bande[nick]</a></br>";
if($uuuu['nagrada']!=''){echo"<font color='#70C611'>Выдана вещь $uuuu[nagrada]</br></font>";}
if($moya_banda['tip']=='lider'){
echo"<a href='instalscript-bymas?instalscript=banda&kyy=yes&ky=yes&kk=$userss_v_bande[nick]'><font color=#C40000>Кикнуть</font></a>
</br><a href='instalscript-bymas?instalscript=banda&ub=yes&pl=$userss_v_bande[nick]'><font color=#2B7D0B>Передать лидерство</font></a></br>";}
}
################ЧАТ БАНДЫ#################
switch($act)
{
case 'post':
if(isset($_POST['msg'])){
$msg = check($_POST['msg']);
if(strlen($msg) < 3 or strlen($msg) > 400) $err = 'Длина сообщения должна быть в пределах 3 - 400 символов';
if($user[level] < 1) $err = 'В чате можно писать только с 1 уровня!';
if(!isset($err)) {mysql_query("INSERT INTO `metro_chat` SET `id_user` = '$user[id]', `msg` = '$msg', `time` = '".time()."',`general_id`='".$moya_banda['general_id']."' ") or die(mysql_error());
header('Location: instalscript-bymas?instalscript=banda');$_SESSION['message'] = 'Сообщение добавлено!';exit();}
else{header('Location: instalscript-bymas?instalscript=banda');$_SESSION['err'] = $err;exit();}}
else{header('Location: instalscript-bymas?instalscript=banda');$_SESSION['err'] = 'Введите текст';exit();}
break;
default:
$k_post = mysql_result(mysql_query("SELECT COUNT(*) FROM `metro_chat` WHERE `general_id`='".$moya_banda['general_id']."' "),0);
$k_page = k_page($k_post,$set['p_str']);
$page = page($k_page);
$start = $set['p_str']*$page-$set['p_str'];
echo "<div class='player menuList'>";
echo "<li><a href='/smiles.php'><img src='/images/icon/arrow.png'>Cписок смайлов</a></li>";
echo "<li><a href='instalscript-bymas?instalscript=banda'><img src='/images/icon/arrow.png'>Обновить</a></li>";
echo "</div>";
echo "<div class='mini-line'></div>";
if(isset($_GET['otvet'])) {$ank = mysql_fetch_assoc(mysql_query("SELECT * FROM `user` WHERE `id` = '".$_GET['otvet']."' LIMIT 1"));echo '<form class="player" method="post" action="instalscript-bymas?instalscript=banda&act=post"><input class="text large" value="'.$ank[nick].', " type="text" name="msg" /><br /><span class="btn"><span class="end"><input class="label" type="submit" value="Отправить">Отправить</span></span></form>';}
else{echo '<form class="player" method="post" action="instalscript-bymas?instalscript=banda&act=post"><input class="text large" type="text" name="msg" /><br /><span class="btn"><span class="end"><input class="label" type="submit" value="Отправить">Отправить</span></span></form>';}
$q = mysql_query("SELECT * FROM `metro_chat` ORDER BY `id` DESC LIMIT $start, $set[p_str]");
echo "<div class='dot-line'></div>";
echo "<div class='player' style = 'color: #7D26CD;'>";
while($post = mysql_fetch_assoc($q)) {
$ank = mysql_fetch_assoc(mysql_query("SELECT * FROM `user` WHERE `id` = $post[id_user] LIMIT 1"));
if($ank[prava] == 5 ){$color = 'Admin';}
if($ank[prava] == 4 ){$color = 'Moder';}
if($ank[prava] == 0 ){$color = '';}
echo online($ank[id]);
echo " <a href='/user/?id=$ank[id]'><b><span style = 'color: #FF6347;'>$ank[nick]</span></b></a> <span class='dgreen'>[".vremja($post[time])."]</span> <a href='instalscript-bymas?instalscript=banda&otvet=$ank[id]'>(»)</a>";
if ($user['prava'] >= 4){echo " / /";echo "<a href='?del=msg&id_msg=".$post['id']."'> Удалить</a>";}
if(htmlspecialchars($_GET['del']) == 'msg') {$id_chmsg = intval($_GET['id_msg']);$del_metro_chat_msg = mysql_query("DELETE FROM `metro_chat` WHERE `id` = '".$id_chmsg."' ");header("Location: instalscript-bymas?instalscript=banda");}echo ': <span class="'.$color.'">'.smiles($post['msg']).'</span><br>';}
echo "</div>";
if ($k_page>1){echo "<div class='dot-line'></div>";str('?instalscript=banda&',$k_page,$page); }
echo "<div class='mini-line'></div>";}
echo"</br><a href='instalscript-bymas?instalscript=banda&exit=going'><b><font color='#9A0303'>Покинуть банду</font></b></a>";
echo"</br>Бойцов в банде $users_vbande/$users_kollichestvo";
}
}
echo"</div>";
break;
case'list-band':
echo"<div class='title player menuList'>";
$met=mysql_fetch_array(mysql_query("SELECT * FROM `metro` WHERE `id`='".$_POST['metro_id']."' "));
$kolivb = mysql_result(mysql_query("SELECT COUNT(*) FROM `metro_bands` WHERE `id`='".$met['metro_id']."' AND `vboi`='no' "),0);
$ki=$met['max_man']<$kolivb;
$banda=mysql_fetch_array(mysql_query("SELECT * FROM `metro_bands` WHERE `id`='".$_POST['metro_id']."' AND `max_man`='$ki' AND `vboi`='no' "));
echo"Поиск банды<br/><form action='instalscript-bymas?instalscript=list-band' method='post'><select name="metro_id">";
$aaa=mysql_query("SELECT * FROM `metro` ");
while($aaa1=mysql_fetch_array($aaa)){echo"<option value='$aaa1[id]'>$aaa1[name_rus] $aaa1[lvl]ур.</option>";}
echo"</select><br/><input class='text large' type='submit' value='Поиск'/></form>";
if($_POST['metro_id']==""){echo"";}
else{
$num = 10;
$page = $_GET['page'];
$result = mysql_query("SELECT COUNT(*) FROM `metro_bands` WHERE `metro_id`='".$_POST['metro_id']."' AND `vboi`='no' ");
$posts = mysql_result($result, 0);$total = intval(($posts - 1) / $num) + 1;$page = intval($page);
if(empty($page) or $page < 0) $page = 1;if($page > $total) $page = $total;$start = $page * $num - $num;
$qi = mysql_query("SELECT * FROM `metro_bands` WHERE `metro_id`='".$_POST['metro_id']."' AND `tip`='lider' AND `vboi`='no' LIMIT $start, $num ");
$query = mysql_query("SELECT * FROM `metro_bands` WHERE `metro_id`='".$_POST['metro_id']."' AND `tip`='lider' AND `vboi`='no' ORDER BY `max_man` DESC");
if (mysql_affected_rows()==0){echo "На данный момент банд нету";echo"<li><a class='link-1' href='instalscript-bymas?'>Подземелья</a></li>";}
else{while($sc=mysql_fetch_array($qi) ){
$vbsl = mysql_result(mysql_query("SELECT COUNT(*) FROM `metro_bands` WHERE `general_id`='".$sc['general_id']."' "),0);
$metro_1=mysql_fetch_array(mysql_query("SELECT * FROM `metro` WHERE `id`='".$_POST['metro_id']."' "));
echo"<li><a class='link-2' href='instalscript-bymas?instalscript=list-bandv&id=$sc[id]'> $metro_1[name_rus],Лидер:$sc[user] $vbsl[max_man]/$met[max_man]</a></li>";}
if ($page != 1) $pervpage = '<a class="link-is" href="instalscript-bymas?instalscript=list-band&page=1" title="Go to page «"><span><span>«</span></span></a> ';
if ($page != $total) $nextpage = ' <a class="link-is" href="instalscript-bymas?instalscript=list-band&page='.$total.'">'. » .'</a>';
if($page - 2 > 0) $page2left = '<a class="link-is" href="instalscript-bymas?instalscript=list-band&page='. ($page - 2) .'">'. ($page - 2) .'</a>';
if($page - 1 > 0) $page1left = '<a class="link-is" href="instalscript-bymas?instalscript=list-band&page='. ($page -1) .'">'. ($page - 1) .'</a> ';
if($page + 2 <= $total) $page2right = ' <a class="link-is" href="instalscript-bymas?instalscript=list-band&page='. ($page + 2) .'">'. ($page + 2) .'</a>';
if($page + 1 <= $total) $page1right = ' <a class="link-is" href="instalscript-bymas?instalscript=list-band&page='. ($page + 1) .'">'. ($page + 1) .'</a>';
$aa= "<span title='Go to page $page'>$page</span> ";
echo $pervpage.$page2left.$page1left.'<b>' .$aa. '</b>'.$page1right.$page2right.$nextpage;
echo"</div>";}
}
echo"</div></div>";
break;
case'list-bandv':
echo"<div class='title player menuList'>";
$list_band = mysql_fetch_array(mysql_query("SELECT * FROM `metro_bands` WHERE `id`='".$_GET['id']."' "));
if($list_band==0){echo"Не выбранна банда";}
else{
$metro = mysql_fetch_array(mysql_query("SELECT * FROM `metro` WHERE `id`='".$list_band['metro_id']."' "));
$lider = mysql_fetch_array(mysql_query("SELECT * FROM `metro_bands` WHERE `tip`='lider' AND `general_id`='".$list_band['general_id']."' "));
$lider_user = mysql_fetch_array(mysql_query("SELECT * FROM `user` WHERE `nick`='".$lider['user']."' ")); //список людей в таблице user из данной банды
$users = mysql_fetch_array(mysql_query("SELECT * FROM `metro_bands` WHERE `general_id`='".$list_band['general_id']."' "));
$userr = mysql_query("SELECT * FROM `metro_bands` WHERE `general_id`='".$list_band['general_id']."' ");
$koql = mysql_result(mysql_query("SELECT COUNT(*) FROM `metro_bands` WHERE `general_id`='".$list_band['general_id']."' "),0);
if($metro['max_man']==$kol_ll_v_b){echo"Банда полная";}else{
echo"Банда на подземелье $metro[name_rus]</br>";
echo"<img src='img/logo-banda.jpg'></br>";
echo"Лидер банды <a href='/user/?id=$lider_user[id]'>$lider_user[nick]</a>";
echo"Список людей</br>";
while($usesr = mysql_fetch_array($userr)){
$useri = mysql_fetch_array(mysql_query("SELECT * FROM `user` WHERE `nick` = '".$usesr['user']."' "));
echo"<li><a href='/user/?id=$useri[id]'>$useri[nick]</a></li>";}
echo"Людей в банде $koql/$metro[max_man]";
echo"<li><a href='instalscript-bymas?instalscript=vv&id=$lider[id]'>Вступить в банду</a></li>";
}
}
echo"</div>";
break;
case'vv':
echo"<div class='title player menuList'>";
$my_bandaa = mysql_fetch_array(mysql_query("SELECT * FROM `metro_bands` WHERE `user`='".$user['nick']."' "));
$list_band = mysql_fetch_array(mysql_query("SELECT * FROM `metro_bands` WHERE `id`='".$_GET['id']."' "));
if($my_bandaa){header('Location: instalscript-bymas?instalscript=banda');exit;}
if($list_band==0){echo"Не выбранна банда";}
else{
echo"Вы действительно хотите вступить в банду";
echo"<li><a href='instalscript-bymas?instalscript=vv&id=$list_band[id]&vvb=yes'>Да</a></li>";
echo"<li><a href='instalscript-bymas?'>Нет</a></li>";
if($_GET['vvb']=='yes'){
$max_man=$list_band['max_man']+1;
$time_user=time();
mysql_query("INSERT INTO `metro_bands` SET `metro_id` = '".$list_band['metro_id']."',`general_id` = '".$list_band['general_id']."',`user` = '".$user['nick']."',`tip` = 'user',`proideno` = 'no',`nagrada_rozdana` = 'no',`time` = '".time()."',`vbande` = 'yes',`vboi` = 'no', `zhiv`='yes',`max_man` = '".$max_man."' ") or die (mysql_error());
header('Location: instalscript-bymas?instalscript=banda');exit;
}
}
echo"</div>";
break;
case'save-list':
$time_save = mysql_fetch_array(mysql_query("SELECT * FROM `metro_user_time` WHERE `user`='".$user['nick']."' "));
$time_s = mysql_query("SELECT * FROM `metro_user_time` WHERE `user`='".$user['nick']."' ");
echo"<div class='title player menuList'>";
if($time_save!=0){echo"<font color='#F2BF26'>Список сохраненных подземелей на сегодня</font></br>";echo"<font color='#D01E04'>Текущие время [".vremja(time())."]</font></br>";while($TS = mysql_fetch_array($time_s)){$mr = mysql_fetch_array(mysql_query("SELECT * FROM `metro` WHERE `id`='".$TS['metro_id']."' "));echo"<font color='#48F7A8'>$mr[name_rus]</font> до <font color='#DC290A'>[".vremja($TS['time'])."]</font></br>";}}
else{echo"<font color='#4EE038'>На сегодня вы не сохраненны не в одном подземелье!</font>";}
echo"</div>";
break;
case'info-shmot':
$komp = mysql_fetch_array(mysql_query("SELECT * FROM `metro_award` WHERE `id`='".$_GET['id']."' "));
if($komp==0){echo"Вещи не существует";}else{
$stat = explode(';',$komp['stats']);
echo'<div class="player"><div class="float-left">
<img width="50" height="50" src="'.$komp['url'].'"></div>
<img src="/images/icon/equip.png"> <span class="yellow">'.$komp['name'].'</span><br>
'.($stat['0']>0?'<span class="dgreen"><img src="/images/icon/str.png" alt="*"/>+'.$stat['0'].'</span>':null).'
'.($stat['1']>0?'<span class="dgreen"><img src="/images/icon/vit.png" alt="*"/>+'.$stat['1'].'</span>':null).'</span>
'.($stat['2']>0?'<span class="dgreen"><img src="/images/icon/agi.png" alt="*"/>+'.$stat['2'].'</span>':null).'</span>
'.($stat['3']>0?'<span class="dgreen"><img src="/images/icon/def.png" alt="*"/>+'.$stat['3'].'</span>':null).'</span>
'.($stat['4']>0?'<span class="dgreen"><img src="/images/icon/mana.png" alt="*"/>+'.$stat['4'].'</span>':null).'</span>
<br>Тип: '.$komp['type'].' <div style="clear:both;"></div></div>';
$mo = mysql_fetch_array(mysql_query("SELECT * FROM `metro` WHERE `id`='".$komp['metro_id']."'"));
echo"<div class='player menuList title'><b><li><a href='instalscript-bymas?instalscript=info-metro&id=$mo[id]'>$mo[name_rus]</a></li></b></div>";
}
break;
case'info-mob':
$mob = mysql_fetch_array(mysql_query("SELECT * FROM `metro_mob` WHERE `id`='".$_GET['id']."' "));
echo"<div class='mini-line'></div>";
echo"<div class='player' style='line-height:140%;'>";
if($mob==0){echo"Монстра не существует";}else{
echo"$mob[name]</br>";
if($mob['tip']=='mob'){$mob['tip']='моб';}
if($mob['tip']=='boss'){$mob['tip']='босс';}
echo"Тип:$mob[tip]<br/>";
echo"<img src='$mob[img]'></br>";
echo"<img src='/images/icon/str.png' alt='str'> Сила: $mob[sila]<br>";
echo"<img src='/images/icon/vit.png' alt='vit'> Здоровье: $mob[max_health]<br>";
echo"<img src='/images/icon/agi.png' alt='agi'> Ловкость: $mob[lovk]<br>";
echo"<img src='/images/icon/def.png' alt='def'> Защита: $mob[zashit]<br>";
}
echo"</div>";
break;
}
include'../../../core/foot.php';
?>