2 include_once("include/functions.php");
4 $page = intval(@$_REQUEST['page']);
6 // Создаём SQL запрос исходя из заданых пользователем параметров
8 // Создаём ссылку на страницу, игнорируем дефолтные значения
9 $FindRefrence = "?set";
12 if ($name = mysql_real_escape_string(@$_REQUEST['name']))
14 $filter.= " AND `name` like '%$name%'";
15 $FindRefrence.="&name=$name";
20 // Убираем ненужный AND в начале строки
21 $filter = substr($filter, 5);
24 $sort = @$_REQUEST['sort'];
25 $sort_str = " order by `name`";
26 if ($sort == "name") $sort_str = " order by `name`";
27 else if($sort == "id") $sort_str = " order by `id`";
28 else $sort_str = " order by `name`";
32 $rows = $wDB->selectPage($number, "SELECT * FROM `wowd_itemset` WHERE
34 $sort_str LIMIT ?d, ?d", getPageOffset($page), $config['fade_limit']);
36 if (!$rows ||
$number == 0)
38 echo $lang['not_found'];
42 echo "<table class=report width=500>\n";
44 echo "<tr><td colspan=4 class=head>$lang[item_set]</td></tr>\n";
46 // Делаем ссылку для сортировки
47 $SortRefrence = $FindRefrence;
48 if ($page>1) $SortRefrence.="&page=$page";
51 echo "<th><a href=\"$SortRefrence\">$lang[set_name]</a></th>";
52 echo "<th width=260px>Items</th>";
55 foreach ($rows as $set)
60 $item = getItem($set['item_1']);
63 $items = $dDB->select("SELECT `entry`, `AllowableClass`, `displayid` FROM `item_template` WHERE `itemset` = ?d", $set['id']);
68 echo "<td>$set[name]</td>";
73 if ($itemid = $set['item_'.$i])
74 show_item($itemid, 0, 'set');
78 foreach($items as $item)
79 show_item($item['entry'], $item['displayid'], 'set');
82 $classreq = getAllowableClass($item['AllowableClass']);
85 if (!$classreq) $classreq = "";
87 echo "<td align=center>".$classreq."</td>";
90 $pageRefrence = $FindRefrence;
91 if ($sort) $pageRefrence.="&sort=$sort";
92 generatePage($number, $page, "<a href=\"$pageRefrence&page=%d\">%d </a>", 4);
93 echo "</tbody></table>";