$req_attack = mysql_fetch_array(mysql_query("SELECT f.name AS f_name, b.name AS b_name, c.name AS c_name, d.name AS d_name, e.name AS e_name FROM attacken a LEFT JOIN attacken b ON(b.id='".$req_atk[0]."') LEFT JOIN attacken c ON(c.id='".$req_atk[1]."') LEFT JOIN attacken d ON(d.id='".$req_atk[2]."') LEFT JOIN attacken e ON(e.id='".$req_atk[3]."') LEFT JOIN attacken f ON(f.id='".$req_atk[4]."') WHERE a.id='".$at_id."'"));
$attacken = mysql_query('SELECT * FROM attacken WHERE Frucht='.$tf.' '.$order.' LIMIT '.($pagenum * 20).', 20 ');
} else {
if ($rassen == 1) {
$attacken = mysql_query("SELECT * FROM attacken WHERE (rassen LIKE '%1,%11,%' OR (rassen LIKE '%1,%' AND rassen NOT LIKE '%11,%')) AND Frucht is NULL AND info not like '%npc attacke%' $order ".' LIMIT '.($pagenum * 20).', 20 ');
} elseif (!empty($search)) {
$attacken = mysql_query("SELECT * FROM attacken WHERE name LIKE '%".$search."%' AND info not like '%npc attacke%' $order ".' LIMIT '.($pagenum * 20).', 20 ');
} elseif (empty($rassen)) {
if ($type == 'op') {
$attacken = mysql_query("SELECT * FROM attacken WHERE (rassen LIKE '%1,%' OR rassen LIKE '%8,%' OR rassen LIKE '%9,%' OR rassen LIKE '%12,%') AND Frucht is NULL AND rassen!='11,' AND info not like '%npc attacke%' $order ".' LIMIT '.($pagenum * 20).', 20 ');
} elseif ($type == 'db') {
$attacken = mysql_query("SELECT * FROM attacken WHERE (rassen LIKE '%2,%' OR rassen LIKE '%3,%' OR rassen LIKE '%4,%' OR rassen LIKE '%5,%' OR rassen LIKE '%6,%' OR rassen LIKE '%7,%' OR rassen LIKE '%10,%') AND Frucht is NULL AND rassen!='11,' AND info not like '%npc attacke%' $order ".' LIMIT '.($pagenum * 20).', 20 ');
} elseif ($type == 'tf') {
if ($fruchttyp == 'paramecia') {
$attacken = mysql_query("SELECT * FROM attacken WHERE (Frucht=3 OR Frucht=4 OR Frucht=9 OR Frucht=11 OR Frucht=12 OR Frucht=38 OR Frucht=14 OR Frucht=17 OR Frucht=26 OR Frucht=2 OR Frucht=19 OR Frucht=20 OR Frucht=21 OR Frucht=22) AND info not like '%npc attacke%' $order ".' LIMIT '.($pagenum * 20).', 20 ');
} elseif ($fruchttyp == 'zoan') {
$attacken = mysql_query("SELECT * FROM attacken WHERE (Frucht=31 OR Frucht=30 OR Frucht=33 OR Frucht=34 OR Frucht=35 OR Frucht=32 OR Frucht=29 OR Frucht=16) AND info not like '%npc attacke%' $order ".' LIMIT '.($pagenum * 20).', 20 ');
} elseif ($fruchttyp == 'logia') {
$attacken = mysql_query("SELECT * FROM attacken WHERE (Frucht=23 OR Frucht=24 OR Frucht=8 OR Frucht=15 OR Frucht=6) AND info not like '%npc attacke%' $order ".' LIMIT '.($pagenum * 20).', 20 ');
} else {
$attacken = mysql_query("SELECT * FROM attacken WHERE Frucht!=0 AND rassen!='11,' AND info not like '%npc attacke%' $order ".' LIMIT '.($pagenum * 20).', 20 ');
}
} else {
$attacken = mysql_query("SELECT * FROM attacken WHERE info NOT LIKE '%npc attacke%' $order ".' LIMIT '.($pagenum * 20).', 20 ');
}
} else {
$attacken = mysql_query("SELECT * FROM attacken WHERE rassen LIKE '%$rassen%' AND Frucht is NULL AND info not like '%npc attacke%' $order ".' LIMIT '.($pagenum * 20).', 20 ');
$total = mysql_num_rows(mysql_query('SELECT id FROM attacken WHERE Frucht='.$tf));
} else {
if ($rassen == 1) {
$total = mysql_num_rows(mysql_query("SELECT * FROM attacken WHERE (rassen LIKE '%1,%11,%' OR (rassen LIKE '%1,%' AND rassen NOT LIKE '%11,%')) AND Frucht is NULL AND info not like '%npc attacke%' "));
} elseif (!empty($search)) {
$total = mysql_num_rows(mysql_query("SELECT * FROM attacken WHERE name LIKE '%".$search."%' AND info not like '%npc attacke%' "));
} elseif (empty($rassen)) {
if ($type == 'op') {
$total = mysql_num_rows(mysql_query("SELECT id FROM attacken WHERE (rassen LIKE '%1,%' OR rassen LIKE '%8,%' OR rassen LIKE '%9,%' OR rassen LIKE '%12,%') AND Frucht is NULL AND rassen!='11,' AND info not like '%npc attacke%' "));
} elseif ($type == 'db') {
$total = mysql_num_rows(mysql_query("SELECT id FROM attacken WHERE (rassen LIKE '%2,%' OR rassen LIKE '%3,%' OR rassen LIKE '%4,%' OR rassen LIKE '%5,%' OR rassen LIKE '%6,%' OR rassen LIKE '%7,%' OR rassen LIKE '%10,%') AND Frucht is NULL AND rassen!='11,' AND info not like '%npc attacke%' "));
} elseif ($type == 'tf') {
if ($fruchttyp == 'paramecia') {
$total = mysql_num_rows(mysql_query("SELECT id FROM attacken WHERE (Frucht=3 OR Frucht=4 OR Frucht=9 OR Frucht=11 OR Frucht=12 OR Frucht=38 OR Frucht=14 OR Frucht=17 OR Frucht=26 OR Frucht=2 OR Frucht=19 OR Frucht=20 OR Frucht=21 OR Frucht=22) AND info not like '%npc attacke%' "));
} elseif ($fruchttyp == 'zoan') {
$total = mysql_num_rows(mysql_query("SELECT id FROM attacken WHERE (Frucht=31 OR Frucht=30 OR Frucht=33 OR Frucht=34 OR Frucht=35 OR Frucht=32 OR Frucht=29 OR Frucht=16) AND info not like '%npc attacke%' "));
} elseif ($fruchttyp == 'logia') {
$total = mysql_num_rows(mysql_query("SELECT id FROM attacken WHERE (Frucht=23 OR Frucht=24 OR Frucht=8 OR Frucht=15 OR Frucht=6) AND info not like '%npc attacke%' "));
} else {
$total = mysql_num_rows(mysql_query("SELECT id FROM attacken WHERE Frucht!=0 AND rassen!='11,' AND info not like '%npc attacke%' "));
}
} else {
$total = mysql_num_rows(mysql_query("SELECT id FROM attacken WHERE info NOT LIKE '%npc attacke%' "));
}
} else {
$total = mysql_num_rows(mysql_query("SELECT id FROM attacken WHERE rassen LIKE '%$rassen%' AND Frucht is NULL AND info not like '%npc attacke%' "));
$tf_query= mysql_query('SELECT * FROM wochen_markt WHERE (id!=25 AND id!=41 AND id!=42) AND (id=4 OR id=11 OR id=9 OR id=14 OR id=20 OR id=3 OR id=12 OR id=38 OR id=17 OR id=26 OR id=2 OR id=19 OR id=21 OR id=22 OR id=409 OR id=410 OR id=411 OR id=412) ORDER BY item ASC');
$tf_query= mysql_query('SELECT * FROM wochen_markt WHERE (id!=25 AND id!=41 AND id!=42) AND (id=29 OR id=31 OR id=34 OR id=35 OR id=30 OR id=33 OR id=16 OR id=32 OR id=401 OR id=403 OR id=405 OR id=407) ORDER BY item ASC');
$tf_query= mysql_query('SELECT * FROM wochen_markt WHERE (id!=25 AND id!=41 AND id!=42) AND (id=8 OR id=23 OR id=24 OR id=6 OR id=15 OR id=413 OR id=414) ORDER BY item ASC');