| Code: |
$sql = $db->sql_query("SELECT * FROM " . $prefix . "_tc_ladderteams tclt
JOIN " . $prefix . "_tc_teams tct ON (tclt.team_id = tct.team_id)
LEFT JOIN " . $prefix . "_eto_territories et ON (tct.tid = et.tid)
LEFT JOIN " . $prefix . "_eto_divisions ed ON (tct.div_id = ed.div_id)
JOIN " . $prefix . "_tc_ladders tcl ON (tclt.ladder_id = tcl.sid)
WHERE enabled = 1 AND (ed.div_commander = '$nukeusername' || ed.div_xo ='$nukeusername')
ORDER BY 'name'");
|
| Code: |
while ( $row = $db->sql_fetchrow($sql) ) {
$team_id = $row['team_id'];
$team_name= $row['name'];
$t_name= $row['t_name'];
$result4 = $db->sql_query ("SELECT SUM(lkup.r_points) as resourcepoints
FROM ".$prefix."_eto_rpoints_lkup lkup
JOIN ".$prefix."_tc_teams tct
WHERE lkup.team_id = tct.team_id
AND (lkup.rp_id = '4' OR lkup.rp_id = '5')");
$info4 = $db->sql_fetchrow($result4);
$totalpoints += $info4['resourcepoints'];
echo"<tr>"
. "<td align=\"center\" bgcolor=\"#666666\"><font color=\"#000000\">$team_name</font></td>"
. "<td align=\"center\" bgcolor=\"#666666\"><font color=\"#000000\">$totalpoints</font></td>"
. "<td align=\"center\" bgcolor=\"#666666\"><font color=\"#000000\">$t_name</font></td>"
. "<td align=\"center\" bgcolor=\"#666666\"><font color=\"#000000\">[ <a href=\"modules.php?name=Campaign&file=Reenforce&team_id=$team_id\">" . _CLICK . "</a>]</td>"
. "</tr>";
}
echo "</table>" |