Exemplo n.º 1
0
 } elseif ($display == 'bossesBC') {
     echo border('syellow', 'start', $rt_wordings[$roster_conf['roster_lang']]['BossProgressBC']);
 } elseif ($display == 'summary') {
     echo border('syellow', 'start', $rt_wordings[$roster_conf['roster_lang']]['Summary']);
 } elseif ($display == 'attendance') {
     echo border('syellow', 'start', $rt_wordings[$roster_conf['roster_lang']]['Attendance']);
 } else {
     if ($raid != '') {
         $query = 'SELECT raidid, instanceid, zone FROM `' . $db_prefix . 'raids` WHERE raidnum = ' . $raid;
         if ($roster_conf['sqldebug']) {
             print "<!-- {$query} -->\n";
         }
         $result = $wowdb->query($query) or die_quietly($wowdb->error(), 'Database Error', basename(__FILE__), __LINE__, $query);
         $row = $wowdb->fetch_array($result);
         // Set title for selected raid
         $title = getZoneIcon($row['zone']);
         if ($row['zone'] != 'RandomRaid') {
             $zoneName = $rt_wordings[$roster_conf['roster_lang']]['Zones'][$row['zone']];
             if (!isset($zoneName) || $zoneName == '') {
                 $zoneName = $rt_wordings[$roster_conf['roster_lang']]['ZonesBC'][$row['zone']];
             }
         } else {
             $zoneName = $rt_wordings[$roster_conf['roster_lang']][$row['zone']];
         }
         $title .= $zoneName . ' <span style="font-size:10px;">(' . date($addon_conf['RaidTracker']['DateView'], strtotime($row['raidid'])) . ' - ' . $row['instanceid'] . ' )</span>';
         echo border('syellow', 'start', $title);
     } else {
         echo border('syellow', 'start', $wordings[$roster_conf['roster_lang']]['RaidTracker']);
     }
 }
 echo '<table cellpadding="0" cellspacing="0" class="membersList"><tr>';
Exemplo n.º 2
0
function getRaidCount()
{
    global $wowdb, $roster_conf, $wordings, $rt_wordings, $db_prefix;
    $totalraids = 0;
    $totalbosskills = 0;
    // Display the Top / left side of the Stylish Border
    echo border('syellow', 'start', $rt_wordings[$roster_conf['roster_lang']]['RaidHistory']);
    // Make a table to hold the content
    echo '<table cellpadding="0" cellspacing="0" class="membersList">';
    // Display the header of the table
    echo '<tr>';
    echo '<th class="membersHeader">' . $rt_wordings[$roster_conf['roster_lang']]['RaidZone'] . '</th>';
    echo '<th class="membersHeader">' . $rt_wordings[$roster_conf['roster_lang']]['RaidCount'] . '</th>';
    echo '<th class="membersHeaderRight">' . $rt_wordings[$roster_conf['roster_lang']]['BossKill'] . '</th>';
    echo '</tr>';
    // Get Raids
    $query = 'SELECT DISTINCT zone FROM `' . $db_prefix . 'raids` WHERE deleted != 1 ORDER BY zone ASC';
    if ($roster_conf['sqldebug']) {
        print "<!-- {$query} -->\n";
    }
    $result = $wowdb->query($query) or die_quietly($wowdb->error(), 'Database Error', basename(__FILE__), __LINE__, $query);
    $rownum = 1;
    while ($row = $wowdb->fetch_array($result)) {
        // Open a new Row
        echo '<tr>';
        // Display zones
        if ($rt_wordings[$roster_conf['roster_lang']]['Zones'][$row['zone']] != '') {
            $zone = $rt_wordings[$roster_conf['roster_lang']]['Zones'][$row['zone']];
        } else {
            $zone = $rt_wordings[$roster_conf['roster_lang']]['ZonesBC'][$row['zone']];
        }
        echo '<td class="membersRow' . $rownum . '">' . getZoneIcon($row['zone']) . ' ' . $zone . '</td>';
        // Display killcount
        $kquery = 'SELECT count(*) FROM `' . $db_prefix . 'raids` WHERE zone = \'' . addslashes($row['zone']) . '\'';
        if ($roster_conf['sqldebug']) {
            print "<!-- {$kquery} -->\n";
        }
        $kresult = $wowdb->query($kquery) or die_quietly($wowdb->error(), 'Database Error', basename(__FILE__), __LINE__, $kquery);
        $krow = $wowdb->fetch_array($kresult);
        echo '<td class="membersRow' . $rownum . '">';
        echo ' ' . $krow[0] . '</td>';
        // Add count to $totalraids
        $totalraids = $totalraids + $krow[0];
        // Display bosskills for that zone
        $totalkills = 0;
        foreach ($rt_wordings[$roster_conf['roster_lang']]['Bosses'][$row['zone']] as $boss => $bossloc) {
            $tkquery = 'SELECT count(boss) FROM `' . $db_prefix . 'raidbosskills` WHERE boss = \'' . addslashes($boss) . '\'';
            if ($roster_conf['sqldebug']) {
                print "<!-- {$tkquery} -->\n";
            }
            $tkresult = $wowdb->query($tkquery) or die_quietly($wowdb->error(), 'Database Error', basename(__FILE__), __LINE__, $tkquery);
            $tkrow = $wowdb->fetch_array($tkresult);
            $totalkills = $totalkills + $tkrow[0];
        }
        echo '<td class="membersRowRight' . $rownum . '">';
        echo $totalkills . '</td>';
        // Add $totalkills to $totalbosskills
        $totalbosskills = $totalbosskills + $totalkills;
        // Close the Row
        echo '</tr>';
        switch ($rownum) {
            case 1:
                $rownum = 2;
                break;
            default:
                $rownum = 1;
        }
    }
    // Add totals at bottom
    echo '<tr><th colspan="3" class="membersHeaderRight">';
    echo $rt_wordings[$roster_conf['roster_lang']]['TotalRaids'] . ': ' . $totalraids . ' | ';
    echo $rt_wordings[$roster_conf['roster_lang']]['TotalKills'] . ': ' . $totalbosskills;
    echo '</th></tr>';
    // Close the table
    echo '</table>';
    // Display the Right side / Bottom of the Stylish Border
    echo border('syellow', 'end');
}
Exemplo n.º 3
0
    $zone_where = ' WHERE deleted != 1 AND zone = \'' . $zone . '\' ';
} else {
    $zone_where = ' WHERE deleted != 1 ';
}
// Get all raids
$query = 'SELECT raidnum, instanceid, raidid, zone, note FROM `' . $db_prefix . 'raids` ' . $zone_where . ' ORDER BY raidid DESC, zone ASC';
if ($roster_conf['sqldebug']) {
    print "<!-- {$query} -->\n";
}
$result = $wowdb->query($query) or die_quietly($wowdb->error(), 'Database Error', basename(__FILE__), __LINE__, $query);
$rownum = 1;
while ($row = $wowdb->fetch_array($result)) {
    // Open a new Row
    echo '<tr>';
    // Display the zone in first column
    echo '<td class="membersRow' . $rownum . '"> ' . getZoneIcon($row['zone']);
    echo '<a href="addon.php?roster_addon_name=RaidTracker&raid=' . $row['raidnum'] . '">';
    if ($row['zone'] != 'RandomRaid') {
        $zoneName = $rt_wordings[$roster_conf['roster_lang']]['Zones'][$row['zone']];
        if (!isset($zoneName) || $zoneName == '') {
            $zoneName = $rt_wordings[$roster_conf['roster_lang']]['ZonesBC'][$row['zone']];
        }
    } else {
        $zoneName = $rt_wordings[$roster_conf['roster_lang']][$row['zone']];
    }
    echo $zoneName . " (" . $row['instanceid'] . ")</td>";
    // Display the date in second column
    echo '<td class="membersRow' . $rownum . '">';
    echo date($addon_conf['RaidTracker']['DateView'], strtotime($row['raidid'])) . '</td>';
    // Get bosskills
    $query = 'SELECT count(*) FROM `' . $db_prefix . 'raidbosskills` WHERE raidnum = ' . $row['raidnum'];