2 include_once("conf.php");
3 include_once("functions.php");
5 function init_pagePerMark($mark, $pattern, $page)
8 if ($mark == $pattern && $page > 0)
9 return ($page-1)*$config['fade_limit'];
13 function render_Page($currentOffset, $totalRecords, $colSpan, $baselink, $add)
16 $link = '<a href="'.$baselink.'&page=%d&mark='.$add.'#'.$add.'">%d </a>';
17 $currentPage = floor($currentOffset/$config['fade_limit']) +
1;
18 generateLPage($totalRecords, $currentPage, $link, $config['fade_limit'], $colSpan);
21 function render_AjaxPage($currentOffset, $totalRecords, $colSpan, $baselink, $add)
24 $link = '<a href="'.$baselink.'&page=%d&mark='.$add.'" onClick="return uploadFromHref(this, \''.$add.'\');">%d </a>';
25 $currentPage = floor($currentOffset/$config['fade_limit']) +
1;
26 generateLPage($totalRecords, $currentPage, $link, $config['fade_limit'], $colSpan);
29 function renderFactionGroupList($parent, $list, $header, $page_seek, $totalRecords, $baseLink, $headMARK)
34 echo '<div class=reportContainer id='.$headMARK.'>';
35 addTab($header.' ('.$totalRecords.')', $headMARK);
36 echo "<table class=report width=500>";
38 echo "<tr class=head><td><a name=\"$headMARK\">$header</a></td></tr>";
40 echo '<td class=teamreputation>';
41 echo '<a href="?faction='.$parent['id'].'">'.$parent['name'].'</a></td>';
46 echo '<td class=reputation><a href="?faction='.$f['id'].'"> '.$f['name'].'</a></td>';
49 render_Page($page_seek, $totalRecords, 1, $baseLink, $headMARK);
50 echo "</tbody></table></div>";
53 //=======================================================================================
54 // Рендер лута по таблицам loot_
55 // creature_loot_template
56 // gameobject_loot_template
58 //=======================================================================================
59 function renderSubList($lootList)
65 foreach ($lootList as $loot)
68 if ($loot['groupid']!=$curloot)
70 echo "<tr><th colspan = 3>Group $loot[groupid]</th></tr>";
71 $curloot = $loot['groupid'];
74 if ($loot['mincountOrRef'] > 0)
76 if ($item = GetItem($loot['item'],"`entry`, `Quality`, `name`, `displayid`"))
78 $colorname = $item['Quality'];
79 echo "<td width=1%>";show_item($item['entry'], $item['displayid'], 'reagent');echo "</td>";
80 echo "<td class=left><a class=$Quality[$colorname] href=\"?item=$item[entry]\">$item[name]</a></td>";
83 echo "<td>-</td><td>Unknown item $loot[item]</td>";
85 else // Используется список вещей (падает только одна вещь из списка)
87 echo "<td align=center>".$loot['maxcount']."x</td>";
88 echo "<td class=forsub>$gtext<table class=sublist><tbody>";
89 renderSubList($loot['item']);
90 echo "</tbody></table></td>";
92 if ($loot['ChanceOrQuestChance'] < 0) echo "<td align=center>Q".(-$loot['ChanceOrQuestChance'])."%</td>";
93 else if ($loot['ChanceOrQuestChance'] > 0) echo "<td align=center>".$loot['ChanceOrQuestChance']."%</td>";
98 function renderLootTableList($lootList, $header, $page_seek, $totalRecords, $baseLink, $headMARK)
103 echo '<div class=reportContainer id='.$headMARK.'>';
104 addTab($header.' ('.$totalRecords.')', $headMARK);
105 echo "<table class=report width=500>";
107 echo "<tr class=head><td colspan=3><a name=\"$headMARK\">$header</a></td></tr>";
108 echo "<tr><th width=1%></th><th>$lang[item_name]</th><th>$lang[drop]%</th></tr>";
109 renderSubList($lootList);
110 render_Page($page_seek, $totalRecords, 3, $baseLink, $headMARK);
111 echo "</tbody></table></div>";
114 //=======================================================================================
115 // Выводим зоны для рыбалки имеющие данный лут
116 //=======================================================================================
117 function renderItemFishingList($lootList, $refLoot, $header, $page_seek, $totalRecords, $baseLink, $headMARK)
119 global $lang,$config;
122 echo '<div class=reportContainer id='.$headMARK.'>';
123 addTab($header.' ('.$totalRecords.')', $headMARK);
124 echo "<table class=report width=500>";
126 echo "<tr><td colSpan=2 class=head><a name=\"$headMARK\">$header</a></td></tr>";
127 echo "<tr><th>Area</th><th>$lang[drop]%</th></tr>";
128 foreach ($lootList as $area_loot)
131 echo '<td class=left>'.getFullAreaName($area_loot['loot_entry']).'</td>';
132 if ($area_loot['ChanceOrQuestChance'] < 0) echo "<td>Q".(-$area_loot['ChanceOrQuestChance'])."%</td>";
133 else echo "<td>".$area_loot['ChanceOrQuestChance']."%</td>";
136 render_Page($page_seek, $totalRecords, 2, $baseLink, $headMARK);
137 echo "</tbody></table></div>";