This repository has been archived by the owner on Apr 5, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathprogress.php
53 lines (44 loc) · 1.51 KB
/
progress.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
<?php
if (!defined('IN_PHPBB'))
{
exit;
}
$query = "SELECT * FROM ". $TableNames['progress'] ." WHERE active = '1' ORDER BY raidid DESC";
$result = $db->sql_query($query);
$i = 1;
while($raid = $db->sql_fetchrow($result)) {
$prozent = round($raid['bosseskilled'] / $raid['totalbosses'] * 100);
$prozenthc = round($raid['hcbosseskilled'] / $raid['totalhcbosses'] * 100);
$template->assign_block_vars('raidprogress', array(
'NORMALNUMBER' => 'n'.$i,
'HEROICNUMBER' => 'h'.$i,
'RAIDID' => $raid['raidid'],
'RAIDNAME' => $raid['raidname'],
'BOSSESKILLED' => $raid['bosseskilled'],
'HCBOSSESKILLED' => $raid['hcbosseskilled'],
'TOTALBOSSES' => $raid['totalbosses'],
'TOTALHCBOSSES' => $raid['totalhcbosses'],
'PROZENT' => $prozent,
'PROZENTHC' => $prozenthc,
));
$i++;
$query = "SELECT * FROM ". $TableNames['progressbosses'] ." WHERE raidid = '". $raid['raidid'] ."' ORDER BY killdate, id, bossid, raidid, name";
$result2 = $db->sql_query($query);
while($boss = $db->sql_fetchrow($result)) {
if($boss['heroic'] == 0) {
$template->assign_block_vars('raidprogress.normalbosskills', array(
'BOSSNAME' => $boss['name'],
'KILLDATE' => date('d.m.Y', $boss['killdate']),
));
}
else if ($boss['heroic'] == 1) {
$template->assign_block_vars('raidprogress.heroicbosskills', array(
'BOSSNAME' => $boss['name'],
'KILLDATE' => date('d.m.Y', $boss['killdate']),
));
}
}
$db->sql_freeresult($result2);
}
$db->sql_freeresult($result);
$template->assign_var('S_RAIDPROGRESS',true);