From 38c5d9893b315a669a218b12e4dcee9a43ff6f21 Mon Sep 17 00:00:00 2001 From: radiskull Date: Wed, 23 Nov 2011 20:36:35 +0000 Subject: [PATCH] =?UTF-8?q?Anzeige=20aller=20NPC,=20Aufteilung=20in=20Seit?= =?UTF-8?q?en=20hinzugef=C3=BCgt!?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ag/gm/include/npc.inc.php | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/ag/gm/include/npc.inc.php b/ag/gm/include/npc.inc.php index e4acbd5..219fb4a 100644 --- a/ag/gm/include/npc.inc.php +++ b/ag/gm/include/npc.inc.php @@ -11,6 +11,7 @@ NPC Übersicht'."\n"; } -function displayNPCOverview() { +function displayNPCOverview($page) { $d_array = array('id', 'name', 'level'); $desc_array = array('id', 'Name', 'Level'); - $sql = 'SELECT '.join($d_array,',').' from chars where rasse = \'NPC\' ORDER BY level'; - //$qry = mysql_query($sql.' LIMIT '.($page*20).', 20'); + $sql = 'SELECT '.join($d_array,',').' from chars where rasse = \'NPC\' ORDER BY level, Name LIMIT '.($page*20).', 20'; $qry = mysql_query($sql); //$anzahlSeiten = ceil(mysql_num_rows(mysql_query($sql))/20); $colspan = count($d_array); @@ -312,7 +312,10 @@ function displayNPCOverview() { echo "\t".''."\n"; } - + $total = mysql_num_rows(mysql_query('SELECT '.join($d_array,',').' from chars where rasse = \'NPC\'')); + $url = '###LABEL###'; + echo "\t".''.displayPagelinksNew(20, $total, $page, $url).''."\n"; + echo "\t".'Create a new NPC'."\n"; echo "\t".'
'."\n"; } @@ -345,7 +348,7 @@ function displayNPC($action, $task, $charid, $table, $page, $data, $att_ids){ displayDeleteNPC($charid); } } else{ - displayNPCOverview(); + displayNPCOverview($page); } echo "\t".'Zum Hauptmenu'."\n"; echo "\t".''."\n";