return 'SELECT '.$colums.' FROM `attacken` WHERE ('.implode(' OR ', $ids).') AND Frucht is NULL AND info not like \'%npc attacke%\'';
} elseif ($type == -1) { // tfs
$condition = getFruchtCondition($fruchttyp);
return 'SELECT '.$colums.' FROM `attacken` inner join wochen_markt on attacken.frucht = wochen_markt.id WHERE '.$condition.' attacken.info not like \'%npc attacke%\'';
} else {
return 'SELECT '.$colums.' FROM `attacken` WHERE info NOT LIKE \'%npc attacke%\'';
}
} else {
return 'SELECT '.$colums.' FROM `attacken` WHERE find_in_set(\''.$rassen.'\', rassen) != 0 AND Frucht is NULL AND info not like \'%npc attacke%\'';
}
}
function showAtks($linkz,$tf='',$rassen='',$order='',$type='',$pagenum='',$fruchttyp='',$search='') {
$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') {
$condition = getFruchtCondition($fruchttyp);
// select attacken.*, wochen_markt.kategorie from attacken inner join wochen_markt on attacken.frucht = wochen_markt.id
$sql = 'SELECT attacken.* FROM attacken inner join wochen_markt on attacken.frucht = wochen_markt.id WHERE ' .$condition.' attacken.info not like \'%npc attacke%\' '.$order.' LIMIT '.($pagenum * 20).', 20 ';
$attacken = mysql_query($sql);
} 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 ');
}
}
while ($row = mysql_fetch_array($attacken)) {
?>
<tr>
@ -225,29 +233,8 @@ function showAtks($linkz,$tf='',$rassen='',$order='',$type='',$pagenum='',$fruch
}
if (!empty($tf) AND is_numeric($tf)) {
$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') {
$condition = getFruchtCondition($fruchttyp);
$total = mysql_num_rows(mysql_query('SELECT attacken.* FROM attacken inner join wochen_markt on attacken.frucht = wochen_markt.id WHERE ' .$condition.' attacken.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%' "));