コード例 #1
0
require_once dirname(__FILE__) . "/language/" . CONF_LANG_ENCODING_TYPE . "/lang-" . $currentlang . ".php";
require_once dirname(__FILE__) . "/language/" . CONF_LANG_ENCODING_TYPE . "/countries-" . $currentlang . ".php";
require_once dirname(__FILE__) . "/CL_NACclub.php";
$clubID = $_GET['clubID'] + 0;
$NAC_ID = $_GET['NAC_ID'] + 0;
// $charset=$langEncodings[$currentlang];
# $_GET['option'] is to control scenario dependent options
$option = empty($_GET['option']) ? 1 : $_GET['option'];
# url parameters in case of option 2
$params = empty($_GET['params']) ? '' : urldecode($_GET['params']);
if ($option == 2) {
    $withFlightsOnly = 1;
} else {
    $withFlightsOnly = 0;
}
$clubList = NACclub::getClubs($NAC_ID, $withFlightsOnly);
// print_r($clubList);
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"  >
<html>
<head>
  <title><?php 
echo _Select_Club;
?>
</title>
  <meta http-equiv="content-type" content="text/html; charset=<?php 
echo $CONF_ENCODING;
?>
">

<style type="text/css">
コード例 #2
0
ファイル: GUI_comp.php プロジェクト: Peter2121/leonardoxc
function listClubs($legend, $header, $category, $key, $formatFunction = "")
{
    global $clubs, $NACid;
    global $Theme, $countries;
    global $moduleRelPath;
    global $CONF_compItemsPerPage;
    global $page_num, $pagesNum, $startNum, $itemsNum;
    global $op, $cat;
    global $countHowManyFlights, $pilotsMax, $pilotsMin;
    global $tabID;
    global $sort_funcs_pilots;
    require_once dirname(__FILE__) . "/CL_NACclub.php";
    $clubNamesList = NACclub::getClubs($NACid);
    $legendRight = "";
    // show all pilots up to  $CONF_compItemsPerPage
    // $legend.=" (".$countHowMany." "._N_BEST_FLIGHTS.")";
    echo "<table class='listTable listTableTabber listTable2' cellpadding='2' cellspacing='0'>\n   \t\t\t<tr><td class='tableTitleExtra' colspan='" . ($pilotsMax + 3) . "'>{$legend}</td></tr>";
    ?>
   <tr>
   <td class="SortHeader" width="30"><?php 
    echo _NUM;
    ?>
</td>
   <td class="SortHeader"><div align=left><?php 
    echo _Club;
    ?>
</div></td>
   <?php 
    for ($ii = 1; $ii <= $pilotsMax; $ii++) {
        ?>
   <td class="SortHeader" width="55"><div align=left><?php 
        echo _PILOT . " #{$ii}";
        ?>
</div></td>
   <?php 
    }
    ?>
   <td class="SortHeader" width="70"><?php 
    echo $header;
    ?>
</td>
   </tr>
   <?php 
    $i = 1;
    foreach ($clubs as $clubID => $club) {
        // if ($i>$CONF_compItemsPerPage) break;
        if (!$club['sum']) {
            continue;
        }
        $sortRowClass = $i % 2 ? "l_row1" : "l_row2";
        if ($i == 1) {
            $bg = " class='compFirstPlace'";
        } else {
            if ($i == 2) {
                $bg = " class='compSecondPlace'";
            } else {
                if ($i == 3) {
                    $bg = " class='compThirdPlace'";
                } else {
                    $bg = " class='{$sortRowClass}'";
                }
            }
        }
        $i++;
        echo "<TR {$bg}>";
        echo "<TD>" . ($i - 1 + $startNum) . "</TD>";
        echo "<TD width='25%'><div align=left >" . $clubNamesList[$clubID] . "</div></TD>";
        unset($pilotBrands);
        $pilotBrands = array();
        $j = 0;
        foreach ($club as $pilotID => $pilot) {
            $k = 0;
            $pilotIDparts = split('_', $pilotID, 2);
            if (!is_numeric($pilotIDparts[1])) {
                continue;
            }
            // echo "#".$pilotID."#";
            $pilotName = getPilotRealName($pilotIDparts[1], $pilotIDparts[0], 1);
            $pilotName = prepare_for_js($pilotName);
            $pilotIDinfo = str_replace("_", "u", $pilotID);
            echo "<TD width='20%'>";
            echo "<table width='100%' cellpadding='0' cellspacing='0' class='listTable3'><TR><TD colspan=3 id='{$arrayName}" . "_{$pilotID}' class='pilotLink'>" . "<a class='clubPilot betterTip' id='tpa0_{$pilotIDinfo}' href=\"javascript:pilotTip.newTip('inline', 0, 13, '{$arrayName}" . "_{$pilotID}', 200, '" . $pilotID . "','" . addslashes($pilotName) . "' )\"  onmouseout=\"pilotTip.hide()\">" . $pilotName . "</a>" . "</td></tr><tr>";
            foreach ($pilot['flights_sel'] as $flightID) {
                $val = $pilot['flights'][$flightID]['score'];
                $glider = $pilot['flights'][$flightID]['glider'];
                $country = $countries[$pilot['flights'][$flightID]['country']];
                $thisFlightBrandID = $pilot['flights'][$flightID]['brandID'];
                if ($thisFlightBrandID) {
                    $pilotBrands[$thisFlightBrandID]++;
                }
                if (!$val) {
                    $outVal = "&nbsp;";
                } else {
                    if ($formatFunction) {
                        $outVal = $formatFunction($val);
                    } else {
                        $outVal = $val;
                    }
                }
                // $descr=_PILOT.": $pilotName, "._GLIDER.": $glider, "._COUNTRY.": $country";
                $descr = _GLIDER . ": {$glider}, " . _COUNTRY . ": {$country}";
                $descr = '';
                if ($val) {
                    echo "<TD width='33%'><a class='betterTip' id='tpa2_{$flightID}' href='" . getLeonardoLink(array('op' => 'show_flight', 'flightID' => $flightID)) . "' alt='{$descr}'  title='{$descr}'>" . $outVal . "</a></TD>";
                } else {
                    echo "<TD width='33%'>" . $outVal . "</TD>";
                }
                $k++;
                if ($k >= $countHowManyFlights) {
                    break;
                }
            }
            if ($k != $countHowManyFlights) {
                for ($kk = $k; $kk < $countHowManyFlights; $kk++) {
                    echo "<TD >&nbsp;</TD>";
                }
            }
            echo "</tr></table></td>";
            $j++;
            if ($j >= $pilotsMax) {
                break;
            }
        }
        if ($j != $pilotsMax) {
            for ($jj = $j; $jj < $pilotsMax; $jj++) {
                echo "<TD width='20%'>-</TD>";
                //				for($jjj=0;$jjj<$countHowManyFlights;$jjj++) {
                //					echo "<TD>-</TD>";
                //				}
            }
        }
        if ($formatFunction) {
            $outVal = $formatFunction($club["sum"]);
        } else {
            $outVal = $club["sum"];
        }
        echo "<TD>" . $outVal . "</TD>";
        echo "</tr>";
    }
    // next club
    echo "</table>";
    //	echo '</div>';
}