Файл: data/pet.dat.php
Строк: 178
<?
print '<div class="spiski"><div class="zagolovok">Пэты</div><div class="line"></div><ul>';
if((isset($_GET['inf']))&&(is_numeric($_GET['inf']))){
$pe1 = mysql_query("select* from pet_pers where id='".$_GET['inf']."'");
if (mysql_num_rows($pe1) == 0) {
print "<div class="style_mess_no">Такого Пэта Нет!</div>"; exitt($row,$opredelenie);
} else {
$ret = mysql_fetch_array($pe1);
$fa=round(($ret['sila']+$ret['lovkost'])/10);
print "<div class="chat_conteiner"><li>Инфо пета:</li><br>
Имя:<strong>".$ret['name']."</strong><br>
Класс:<strong>".$ret['klass']."</strong><br>
HP:<strong>".$ret['hp']." / ".$ret['hpall']." (".$ret['hpplus'].")</strong><br>
Сила:<strong>".$ret['sila']." (".$ret['silaplus'].")</strong><br>
Ловкость:<strong>".$ret['lovkost']." (".$ret['livkplus'].")</strong><br>
Выносливость:<strong>".$ret['vinoslivost']." (".$ret['vinplus'].")</strong><br>
Уровень:".$fa."</div>";
exitt($row,$opredelenie);
;}
;}
$pe = mysql_query("select* from pet_pers where id_pers='$opredelenie'");
if (mysql_num_rows($pe) == 0) {
print "<div class="style_mess_no">У вас нет еще петов!</div>";
} else {
if ((isset($_GET['info'])) && (is_numeric($_GET['info']))) {
$pe1 = mysql_query("select* from pet_pers where id_pers='$opredelenie' and id='".$_GET['info']."'");
if (mysql_num_rows($pe) == 0) {
print "<div class="style_mess_no">Это не ваш пэт!</div>";
} else {
$ret = mysql_fetch_array($pe1);
$fa=round(($ret['sila']+$ret['lovkost'])/10);
print "<div class="chat_conteiner"><strong><li>Инфо пета:</li></strong>
Имя:<strong>".$ret['name']."</strong><br>
Класс:<strong>".$ret['klass']."</strong><br>
HP:<strong>".$ret['hp']." / ".$ret['hpall']." (".$ret['hpplus'].")</strong><br>
Сила:<strong>".$ret['sila']." (".$ret['silaplus'].")</strong><br>
Ловкость:<strong>".$ret['lovkost']." (".$ret['livkplus'].")</strong><br>
Выносливость:<strong>".$ret['vinoslivost']." (".$ret['vinplus'].")</strong><br>
Уровень:$fa";
if ($ret['status'] == 0) {
$stat = '<font color=red>off</font>';
}
if ($ret['status'] == 1) {
$stat = '<font color=green>on</font>';
}
if ($ret['status'] == 2) {
$stat = '<font color=red>Ded</font>';
}
print"Статус:<strong>$stat</strong>" ;
}
if ($ret['status'] == 1) {
$stat = '<font color=green>on</font>';
print $delat = '<br>[-<a href=88.php?go=pet&off=' . $ret["id"] . '>OFF</a>-]';
}
print"</div><li><a href=88.php?go=pet>Пэты</a></li>"
;
exitt($row,$opredelenie) ; }
/////////////////////////////
if ((isset($_GET['activ'])) && (is_numeric($_GET['activ']))) {
$pe1 = mysql_query("select* from pet_pers where id_pers='$opredelenie' and id='".$_GET['activ']."' and status='0'");
if (mysql_num_rows($pe1) == 0) {
print "<div class="style_mess_no">Нельзя призвать этого пета!</div>";
} else {
if(($row['hppriz']>0)&&($row['time_priz']>0)&&($row['podklass']!=10) ){
print"<div class="style_mess_no">Вы не можете призвать пэта пока действует призванный</div>";exitt($row,$opredelenie);}
$ret = mysql_fetch_array($pe1);
if($row['pet_activ']>0){
mysql_query("update pet_pers set status='0' where id='".$row['pet_activ']."' ");
;}
mysql_query("update table1 set pet_activ='".$ret['id']."' where name='$opredelenie' ");
mysql_query("update pet_pers set status='1' where id='".$ret['id']."' ");
print"<div class="style_mess_yes">Вы призвали ".$ret['name']."</div>";
;}
exitt($row,$opredelenie);
;}
if ((isset($_GET['off'])) && (is_numeric($_GET['off']))) {
$pe1 = mysql_query("select* from pet_pers where id_pers='$opredelenie' and id='".$_GET['off']."' and status='1'");
if (mysql_num_rows($pe1) == 0) {
print "<div class="style_mess_no">Нельзя отозвать этого пета!</div>";
} else {
$ret = mysql_fetch_array($pe1);
mysql_query("update table1 set pet_activ='0' where name='$opredelenie' ");
mysql_query("update pet_pers set status='0' where id='".$ret['id']."' ");
print"<div class="style_mess_no">Вы отозвали ".$ret['name']."</div>";
;}
exitt($row,$opredelenie);
;}
if ((isset($_GET['del'])) && (is_numeric($_GET['del']))) {
$pe1 = mysql_query("select* from pet_pers where id_pers='$opredelenie' and id='".$_GET['del']."' and status!='1'");
if (mysql_num_rows($pe1) == 0) {
print "<div class="style_mess_no">Нельзя удалить этого пета!</div>";
} else {
$ret = mysql_fetch_array($pe1);
if(!isset($_GET['yes'])) {
print"<div class="style_mess_no">Вы действительно хотите прогнать ".$ret['name']." ?</div>
<li> <a href=88.php?go=pet&del=".$ret['id']."&yes>ДА!</a></li><li> <a href=88.php?go=pet>НЕТ!</a></li>" ;
; }
if(isset($_GET['yes'])) {
mysql_query("update table1 set pet_activ='0' where name='$opredelenie ");
mysql_query("delete from pet_pers where id='".$ret['id']."' and id_pers='$opredelenie' ");
print"<div class="style_mess_no">Вы прогнали ".$ret['name']."</div>";}
;}
exitt($row,$opredelenie);
;}
if ((isset($_GET['life'])) && (is_numeric($_GET['life']))) {
$pe1 = mysql_query("select* from pet_pers where id_pers='$opredelenie' and id='".$_GET['life']."' and status='2'");
if (mysql_num_rows($pe1) == 0) {
print "<div class="style_mess_no">Нельзя воскресить этого пета!</div>";
} else {
$ret = mysql_fetch_array($pe1);
$per_in=mysql_query("select *from pers_info where name='$opredelenie'") ;
$pers_info=mysql_fetch_array($per_in);
if($pers_info['svitok']>0){
mysql_query("update pet_pers set status='0', hp='".$ret['hpall']."' where id='".$ret['id']."' and id_pers='$opredelenie' ");
$pers_info['svitok']--;
mysql_query("update pers_info set svitok='".$pers_info['svitok']."'where name='$opredelenie' ");
} else{print"<div class="style_mess_no">У вас нет свитков воскрешения</div>";
exitt($row,$opredelenie);
;}
print"<div class="style_mess_yes">Вы воскресили ".$ret['name']."</div>";
;}
exitt($row,$opredelenie);
;}
$per_in=mysql_query("select *from pers_info where name='$opredelenie'") ;
$pers_info=mysql_fetch_array($per_in);
////////////////////////////////////////////
print "<div class="chat_conteiner">Ваши пэты<br>
Свитки воскрешения (".$pers_info['svitok'].")</div> ";
while ($pet = mysql_fetch_array($pe)) {
if ($pet['status'] == 0) {
$stat = '<font color=red>off</font>';
$delat = '[-<a href=88.php?go=pet&activ=' . $pet["id"] . '>ON</a>-]';
}
if ($pet['status'] == 1) {
$stat = '<font color=green>on</font>';
$delat = '[-<a href=88.php?go=pet&off=' . $pet["id"] . '>OFF</a>-]';
}
if ($pet['status'] == 2) {
$stat = '<font color=red>Ded</font>';
$delat = '[-<a href=88.php?go=pet&life=' . $pet["id"] . '>Воскресить</a>-]';
}
print "<li><a href=88.php?go=pet&info=" . $pet['id'] . ">" . $pet['name'] . "</a> [-$stat-] $delat [-<a href=88.php?go=pet&del=" . $pet['id'] . ">DEL</a>-]</li>";
;
}
;
}
exitt($row,$opredelenie);
?>