session_start(); function er($e) { global $c; die('
Произошла ошибка: (c) '.$c[1].''.$e.'
if(isset($_POST['new_bot_id'])) {
mysql_query('INSERT INTO `dungeon_bots` (`id_bot`,`bot_group`,`for_dn`,`colvo`,`x`,`y`,`atack`,`go_bot`) VALUES ("'.mysql_real_escape_string($_POST['new_bot_id']).'","'.mysql_real_escape_string($_POST['new_bot_group']).'","'.mysql_real_escape_string($_POST['id_dn']).'","'.mysql_real_escape_string($_POST['new_bot_colvo']).'", "'.mysql_real_escape_string($_POST['xx']).'","'.mysql_real_escape_string($_POST['yy']).'","1","'.mysql_real_escape_string($_POST['new_bot_go']).'")');
}elseif(isset($_GET['delete'])) {
mysql_query('DELETE FROM `dungeon_bots` WHERE `id2` = "'.mysql_real_escape_string($_GET['delete']).'" LIMIT 1');
}
$sp = mysql_query('SELECT * FROM `dungeon_bots` WHERE `dn` = "0" AND `for_dn` = "'.mysql_real_escape_string($_POST['id_dn']).'" AND `x` = "'.mysql_real_escape_string($_POST['xx']).'" AND `y` = "'.mysql_real_escape_string($_POST['yy']).'" ORDER BY `id2`');
$i = 1;
while($pl = mysql_fetch_array($sp)) {
if( $pl['id_bot'] > 0 ){
$bot = mysql_fetch_array(mysql_query('SELECT * FROM `test_bot` WHERE `id` = "'.$pl['id_bot'].'" LIMIT 1'));
echo $i.'.['.$pl['id2'].'] '.$bot['login'].' [id '.$bot['id'].'] , [x'.$pl['colvo'].'] удалить
';
} elseif( $pl['bot_group'] != '' ){
$bots = explode( ',', $pl['bot_group'] );
$jjj=0;
echo $i.' .['.$pl['id2'].']';
while( $jjj < count($bots) ){
$bot = mysql_fetch_array(mysql_query('SELECT * FROM `test_bot` WHERE `id` = "'.$bots[$jjj].'" LIMIT 1'));
if( isset($bot['login']) ) echo ' '.$bot['login'].' [id '.$bot['id'].'], ';
$jjj++;
}
echo ' [x'.$pl['colvo'].'] удалить
';
}
$i++;
}
echo '
';
?>