Esempio n. 1
0
function listTakeoffs($res, $legend, $query_str = "", $sortOrder = "CountryCode")
{
    global $db, $Theme;
    global $takeoffRadious;
    global $userID;
    global $moduleRelPath;
    global $PREFS;
    global $page_num, $pagesNum, $startNum, $itemsNum;
    global $currentlang, $nativeLanguage, $opMode;
    global $countries;
    $legendRight = "";
    $headerSelectedBgColor = "#F2BC66";
    open_inner_table("<table class=main_text width=100%><tr><td>{$legend}</td><td width=300 align=right bgcolor=#eeeeee>{$legendRight}</td></tr></table>", 750);
    ?>
  <td width="25" bgcolor="<?php 
    echo $Theme->color1;
    ?>
"><div align=left><?php 
    echo _NUM;
    ?>
</div></td>
 <?php 
    printHeaderTakeoffs(120, $headerSelectedBgColor, $Theme->color0, $sortOrder, "CountryCode", _COUNTRY, $query_str);
    printHeaderTakeoffs(0, $headerSelectedBgColor, $Theme->color2, $sortOrder, "clubName", _CLUB_NAME, $query_str);
    printHeaderTakeoffs(120, $headerSelectedBgColor, $Theme->color3, $sortOrder, "FlightsNum", _NUMBER_OF_FLIGHTS, $query_str);
    printHeaderTakeoffs(100, $headerSelectedBgColor, $Theme->color4, $sortOrder, "max_distance", _SITE_RECORD_OPEN_DISTANCE, $query_str);
    ?>
</tr>
<?php 
    $currCountry = "";
    $i = 1;
    while ($row = $db->sql_fetchrow($res)) {
        $takeoffName = $row["name"];
        //	 $sortRowBgColor=($i%2)?"#CCCACA":"#E7E9ED";
        $sortRowBgColor = "#E7E9ED";
        $bgcolor = "";
        if ($countries[$row["countryCode"]] != $currCountry || $sortOrder != 'CountryCode') {
            $currCountry = $countries[$row["countryCode"]];
            $country_str = "<div align=left>" . "<a href='" . CONF_MODULE_ARG . "&op=list_clubs&country=" . $row["countryCode"] . "'>" . $currCountry . "</a>" . "</div>";
            if ($sortOrder == 'CountryCode') {
                $bgcolor = "bgcolor=#DDDDDD";
            } else {
                $bgcolor = $i % 2 ? "bgcolor=#DDDDDD" : "";
            }
        } else {
            $country_str = "";
        }
        $i++;
        echo "<TR {$bgcolor} align=right>";
        echo "<TD {$first_col_back_color} ><div align=left>" . ($i - 1 + $startNum) . "</div></TD>      ";
        echo "<TD valign=top>{$country_str}</TD>";
        echo "<TD " . ($sortOrder == "takeoffID" ? "bgcolor=" . $sortRowBgColor : "") . ">" . "<div align=left>" . "<a href='" . CONF_MODULE_ARG . "&op=show_club&clubIDview=" . $row["ID"] . "'><img src='" . $moduleRelPath . "/img/icon_magnify_small.gif' border=0></a>" . "&nbsp;" . "<a href='" . CONF_MODULE_ARG . "&op=list_flights&clubID=" . $row["ID"] . "'>" . $takeoffName . "</a>" . "</div></TD>";
        echo "<TD " . ($sortOrder == "LINEAR_DISTANCE" ? "bgcolor=" . $sortRowBgColor : "") . "><div align=right>" . $row["FlightsNum"] . " (<a href='" . CONF_MODULE_ARG . "&op=list_flights&clubID=" . $row["ID"] . "'>" . _SHOW_FLIGHTS . "</a>)</div></TD>\t";
        echo "<TD " . ($sortOrder == "LINEAR_DISTANCE" ? "bgcolor=" . $sortRowBgColor : "") . "><div align=right>" . formatDistanceOpen($row["max_distance"]) . "</div></TD>\t";
        close_tr();
    }
    close_inner_table();
    $db->sql_freeresult($res);
}
Esempio n. 2
0
      <td>&nbsp;</td>
    </tr>
    <tr> 
      <td colspan="2"><div align="center"> 
          <input type="submit" name="SubmitButton" id="SubmitButton" value="<?php 
echo _ADD_TAKEOFF_TO_AREA;
?>
">
		  <input type="hidden" name="addTakeoffForm" value="1" />
          &nbsp; 

      </div></td>
    </tr>
  </table>
  <p>&nbsp;</p>
  
</form>
<table>
<?php 
list($takeoffs, $takeoffsID) = area::getTakeoffs($areaID);
$i = 0;
foreach ($takeoffs as $name) {
    $takeoffID = $takeoffsID[$i];
    echo "<tr><td>{$name}</td><td><a href='GUI_area_remove_takeoff?areaId={$areaID}&takeoffID={$takeoffID}'>remove Takeoff from area</a></td></tr><br>";
    $i++;
}
?>
  </table>
<?php 
close_inner_table();
Esempio n. 3
0
function listFlights($res, $legend, $query_str = "", $sortOrder = "DATE")
{
    global $Theme;
    global $module_name;
    global $takeoffRadious;
    global $userID;
    global $moduleRelPath;
    global $admin_users;
    global $PREFS;
    global $page_num, $pagesNum, $startNum, $itemsNum;
    global $currentlang, $nativeLanguage, $opMode;
    $legendRight = "";
    if ($pagesNum > 1) {
        if ($page_num > 1) {
            $legendRight .= "<a href='?name={$module_name}&op=list_flights&sortOrder={$sortOrder}{$query_str}&page_num=" . ($page_num - 1) . "'><<</a>&nbsp;";
        } else {
            $legendRight .= "<<&nbsp;";
        }
        for ($k = 1; $k <= $pagesNum; $k++) {
            if ($k != $page_num) {
                $legendRight .= "<a href='?name={$module_name}&op=list_flights&sortOrder={$sortOrder}{$query_str}&page_num={$k}'>{$k}</a>&nbsp;";
            } else {
                $legendRight .= "{$k}&nbsp;";
            }
        }
        if ($page_num < $pagesNum) {
            $legendRight .= "<a href='?name={$module_name}&op=list_flights&sortOrder={$sortOrder}{$query_str}&page_num=" . ($page_num + 1) . "'>>></a>&nbsp;";
        } else {
            $legendRight .= ">>&nbsp;";
        }
    }
    $endNum = $startNum + $PREFS->itemsPerPage;
    if ($endNum > $itemsNum) {
        $endNum = $itemsNum;
    }
    $legendRight .= " [ " . ($startNum + 1) . "-" . $endNum . " " . _From . " " . $itemsNum . " ]";
    if ($itemsNum == 0) {
        $legendRight = "[ 0 ]";
    }
    $headerSelectedBgColor = "#F2BC66";
    open_inner_table("<table class=main_text width=100%><tr><td>{$legend}</td><td valign=top width=400 align=right bgcolor=#eeeeee>{$legendRight}</td></tr></table>", 750, -1);
    ?>
  <td width="25" bgcolor="<?php 
    echo $Theme->color1;
    ?>
"><div align=left><?php 
    echo _NUM;
    ?>
</div></td>
 <?php 
    printHeader(80, $headerSelectedBgColor, $Theme->color0, $sortOrder, "DATE", _DATE_SORT, $query_str);
    printHeader(160, $headerSelectedBgColor, $Theme->color0, $sortOrder, "pilotName", _PILOT, $query_str);
    printHeader(0, $headerSelectedBgColor, $Theme->color1, $sortOrder, "takeoffID", _TAKEOFF, $query_str);
    printHeader(40, $headerSelectedBgColor, $Theme->color2, $sortOrder, "DURATION", _DURATION_HOURS_MIN, $query_str);
    printHeader(65, $headerSelectedBgColor, $Theme->color3, $sortOrder, "LINEAR_DISTANCE", _LINEAR_DISTANCE, $query_str);
    printHeader(65, $headerSelectedBgColor, $Theme->color3, $sortOrder, "FLIGHT_KM", _OLC_KM, $query_str);
    printHeader(40, $headerSelectedBgColor, $Theme->color3, $sortOrder, "FLIGHT_POINTS", _OLC_SCORE, $query_str);
    ?>
  <td width="18" bgcolor="<?php 
    echo $Theme->color4;
    ?>
">&nbsp;</td>
  <td width="72" bgcolor="<?php 
    echo $Theme->color4;
    ?>
"><div align=left><?php 
    echo _SHOW;
    ?>
</div></td></tr>
<?php 
    $i = 1;
    while ($row = mysql_fetch_assoc($res)) {
        $is_private = $row["private"];
        $name = getPilotRealName($row["userID"], $row["serverID"]);
        $takeoffName = getWaypointName($row["takeoffID"]);
        $takeoffVinicity = $row["takeoffVinicity"];
        $takeoffNameFrm = formatLocation($takeoffName, $takeoffVinicity, $takeoffRadious);
        $sortRowBgColor = $i % 2 ? "#CCCACA" : "#E7E9ED";
        $i++;
        open_tr();
        $days_from_submission = floor((mktime() - datetime2UnixTimestamp($row["dateAdded"])) / 86400);
        // 60*60*24 sec per day
        if ($is_private) {
            $first_col_back_color = " bgcolor=#33dd33 ";
        } else {
            $first_col_back_color = "";
        }
        echo "<TD {$first_col_back_color} ><div align=left>" . ($i - 1 + $startNum) . "</div></TD>      \n\t   <TD " . ($sortOrder == "DATE" ? "bgcolor=" . $sortRowBgColor : "") . ">\n\t\t\t<div align=right>";
        if ($days_from_submission <= 3) {
            echo "<img src='" . $moduleRelPath . "/img/icon_new.png' >";
        }
        echo formatDate($row["DATE"]) . "</div></TD>" . "<TD width=300 colspan=2 valign=top " . ($sortOrder == "pilotName" || $sortOrder == "takeoffID" ? "bgcolor=" . $sortRowBgColor : "") . ">" . "<div align=left>" . "<a href='?name={$module_name}&op=pilot_profile&pilotIDview=" . $row["userID"] . "'><img src='" . $moduleRelPath . "/img/icon_magnify_small.gif' border=0></a>" . "<a href='?name={$module_name}&op=pilot_profile_stats&pilotIDview=" . $row["userID"] . "'><img src='" . $moduleRelPath . "/img/icon_stats.gif' border=0></a>&nbsp;" . "<a href='?name={$module_name}&op=list_flights&pilotID=" . $row["userID"] . "'>{$name}</a>" . "</div><div align=right>" . "<a href='?name={$module_name}&op=list_flights&takeoffID=" . $row["takeoffID"] . "'>{$takeoffNameFrm}</a>&nbsp;" . "<a href='?name={$module_name}&op=show_waypoint&waypointIDview=" . $row["takeoffID"] . "'><img src='" . $moduleRelPath . "/img/icon_magnify_small.gif' border=0></a>" . "<a href='" . $moduleRelPath . "/download.php?type=kml_wpt&wptID=" . $row["takeoffID"] . "'><img src='" . $moduleRelPath . "/img/gearth_icon.png' border=0></a>" . "</div></TD>" . "<TD " . ($sortOrder == "DURATION" ? "bgcolor=" . $sortRowBgColor : "") . "><div align=right>" . sec2Time($row['DURATION'], 1) . "</div></TD>\n\t   <TD " . ($sortOrder == "LINEAR_DISTANCE" ? "bgcolor=" . $sortRowBgColor : "") . "><div align=right>" . formatDistanceOpen($row["LINEAR_DISTANCE"]) . "</div></TD>\t\n\t   <TD " . ($sortOrder == "FLIGHT_KM" ? "bgcolor=" . $sortRowBgColor : "") . "><div align=right>" . formatDistanceOpen($row["FLIGHT_KM"]) . "</div></TD>\t\n\t   <TD " . ($sortOrder == "FLIGHT_POINTS" ? "bgcolor=" . $sortRowBgColor : "") . "><div align=right>" . formatOLCScore($row["FLIGHT_POINTS"]) . "</div></TD>" . "<td><img src='" . $moduleRelPath . "/img/icon_cat_" . $row["cat"] . ".png' border=0></td>" . "<TD align=left><a href='?name={$module_name}&op=show_flight&flightID=" . $row["ID"] . "'><img src='" . $moduleRelPath . "/img/icon_magnify_small.gif' border=0></a>";
        echo "<a href='" . $moduleRelPath . "/download.php?type=kml_trk&flightID=" . $row["ID"] . "'><img src='" . $moduleRelPath . "/img/gearth_icon.png' border=0></a>";
        if ($row["photo1Filename"]) {
            echo "<img src='" . $moduleRelPath . "/img/photo_icon.jpg' width=16 height=16>";
        } else {
            echo "<img src='" . $moduleRelPath . "/img/photo_icon_blank.gif' width=16 height=16>";
        }
        if ($row["userID"] == $userID || in_array($userID, $admin_users)) {
            // admin IDS in $admin_users
            echo "<a href='?name={$module_name}&op=delete_flight&flightID=" . $row["ID"] . "'><img src='" . $moduleRelPath . "/img/x_icon.gif' width=16 height=16 border=0 align=bottom></a>";
            echo "<a href='?name={$module_name}&op=edit_flight&flightID=" . $row["ID"] . "'><img src='" . $moduleRelPath . "/img/change_icon.png' width=16 height=16 border=0 align=bottom></a>";
        }
        echo "</TD>";
        close_tr();
    }
    close_inner_table();
    mysql_freeResult($res);
}