Jump to content

GCMap - Great Circle Mapper


Guest lorathon

Recommended Posts

  • 1 month later...
Guest lorathon

Check the flights. One of the airports may not be in the DB of the GCMap. You may have to wait until a few more pireps are filed for it to clear the recent flights.

Link to comment
Share on other sites

  • 1 month later...

Hey I got this errer above the photo,

Warning: Invalid argument supplied for foreach() in /home/spiritvi/public_html/lib/skins/brilliancev1/frontpage_main.tpl on line 6

Heres the Code:

<?php
	$flights = PIREPData::getRecentReportsByCount(10);																	  
	$string = "";
	foreach($flights as $flight)
	{		
			$string = $string.$flight->depicao.'+-+'.$flight->arricao.',+';
	}																		
?>

<img src="[url="http://www.gcmap.com/map?P=<?php"]http://www.gcmap.com/map?P=<?php[/url] echo $string ?>&MS=bm&MR=240&MX=590x360&PM=pemr:diamond7:red%2b%22%25I%22:red&PC=%230000ff" />
<?php
$count = 15;
$pireps = PIREPData::getRecentReportsByCount($count);
?>

<table width="94%" border="0" bordercolor="#FFFFFF">
  <thead>
 <tr align="center" valign="middle" bgcolor="#7D95AF">
   <th>Flight #</th>
   <th>Departure</th>
   <th>Arrival</th>
   <th>Duration</th>
   <th>Pilot</th>
   <th>Landing Rate</th>
   <th>Aircraft</th>
 </tr>
</thead>
<tbody>

<?php

if(count($pireps) > 0)
{
 foreach ($pireps as $pirep)
 {
$pilotinfo = PilotData::getPilotData($pirep->pilotid);
$pilotid = PilotData::getPilotCode($pilotinfo->code, $pilotinfo->pilotid);  

echo "<tr>";
echo "<td align=center> $pirep->code $pirep->flightnum </td>";
echo "<td align=center> $pirep->depicao </td>";
echo "<td align=center> $pirep->arricao </td>";
echo "<td align=center> $pirep->flighttime </td>";
echo "<td align=center> $pilotid $pilotinfo->firstname $pilotinfo->lastname </td>";
echo "<td align=center> $pirep->landingrate </td>";
echo "<td align=center> $pirep->aircraft </td>";
echo "</tr>";
 }
}
else
{
echo "<tr><td>There are no recent flights!</td></tr>";
}
?>
</tr></table>
</div>

Link to comment
Share on other sites

  • 10 months later...

<?php
$count = 5;
$pireps = PIREPData::getRecentReportsByCount($count);
?>
 <table width="427" border="0" cellspacing="2" cellpadding="2">
   <tdead>
  <tr class="recent">
    <td width="68"><strong>Flight No</strong></td>
    <td width="70"><strong>Departure</strong></td>
    <td width="84"><strong>Arrival</strong></td>
    <td width="74"><strong>Duration</strong></td>
    <td width="38"><strong>Pilot</strong></td>
    <td width="55"><strong>Status</strong></td>
    </tr>
  </tdead>
   <tbody>

  <?php
if(count($pireps) > 0)
{
 foreach ($pireps as $pirep)
 {
 {
    $pilotinfo = PilotData::getPilotData($pirep->pilotid);
    $pilotid = PilotData::getPilotCode($pilotinfo->code, $pilotinfo->pilotid);
}
?>
  <tr>
    <td><a href="<?php echo url('/pireps/viewreport/'.$pirep->pirepid);?>">
		  <?php echo $pirep->code.$pirep->flightnum; ?></a>
    </td>
    <td><?php echo $pirep->depicao; ?></td>
    <td><?php echo $pirep->arricao; ?></td>
    <td><?php echo $pirep->flighttime; ?></td>
    <td><?php echo $pirep->pilotid; ?></td>
    <td><?php

		    if($pirep->accepted == PIREP_ACCEPTED)
				    echo '<span style="color:#347C17"><strong>Accepted</strong></span>';
		    elseif($pirep->accepted == PIREP_REJECTED)
				    echo '<span style="color:#FF0000"><strong>Rejected</strong></span>';
		    elseif($pirep->accepted == PIREP_PENDING)
				    echo '<span style="color:#E56717"><strong>Approval Pending</strong></span>';
		    elseif($pirep->accepted == PIREP_INPROGRESS)
				    echo '<span style="color:#whatever">Flight in Progress</span>';
				    ?>
    </td>
  </tr>
  <?php
}}
else
{
    echo '<tr><td>There are no recent flights!</td></tr>';
}
?>
 </tbody>
 </table>

Im useing this coded but I cant seem to get a map to link to it and the map show the routes what am I doing wrong thanks.

Link to comment
Share on other sites

  • 1 month later...

Hey I got this errer above the photo,

Warning: Invalid argument supplied for foreach() in /home/spiritvi/public_html/lib/skins/brilliancev1/frontpage_main.tpl on line 6

Heres the Code:

<?php

$flights = PIREPData::getRecentReportsByCount(10);

$string = "";

foreach($flights as $flight)

{

$string = $string.$flight->depicao.'+-+'.$flight->arricao.',+';

}

?>

<img src="http://www.gcmap.com/map?P=<?php echo $string ?>&MS=bm&MR=240&MX=590x360&PM=pemr:diamond7:red%2b%22%25I%22:red&PC=%230000ff" />

<?php

$count = 15;

$pireps = PIREPData::getRecentReportsByCount($count);

?>

<table width="94%" border="0" bordercolor="#FFFFFF">

<thead>

<tr align="center" valign="middle" bgcolor="#7D95AF">

<th>Flight #</th>

<th>Departure</th>

<th>Arrival</th>

<th>Duration</th>

<th>Pilot</th>

<th>Landing Rate</th>

<th>Aircraft</th>

</tr>

</thead>

<tbody>

<?php

if(count($pireps) > 0)

{

foreach ($pireps as $pirep)

{

$pilotinfo = PilotData::getPilotData($pirep->pilotid);

$pilotid = PilotData::getPilotCode($pilotinfo->code, $pilotinfo->pilotid);

echo "<tr>";

echo "<td align=center> $pirep->code $pirep->flightnum </td>";

echo "<td align=center> $pirep->depicao </td>";

echo "<td align=center> $pirep->arricao </td>";

echo "<td align=center> $pirep->flighttime </td>";

echo "<td align=center> $pilotid $pilotinfo->firstname $pilotinfo->lastname </td>";

echo "<td align=center> $pirep->landingrate </td>";

echo "<td align=center> $pirep->aircraft </td>";

echo "</tr>";

}

}

else

{

echo "<tr><td>There are no recent flights!</td></tr>";

}

?>

</tr></table>

</div>

I got the Same Error any know how to fix? or is this because there were no flights made?

Link to comment
Share on other sites

  • 3 months later...

I understand how this code "builds" the website address by adding the Departure and Arrival airports into the website link....but GCMaps also allows you to build the same link using the Latitude and Longitude coordinates to build the address. I would like to add code so that it looks up the Departure and Arrival Airports in my own MySQL database and retrieve the Lat/Long coordinates to be inputted into the web address. This would eliminate errors for the smaller airports that may not be into the GCMaps database. The downside is that it will not list the airport name code on the map.

The web address format for San Fransisco to Los Angles Airports with the code as currently written would be:http://www.gcmap.com/mapui?P=LAX-SFO (http://www.gcmap.com/mapui?P=LAX-SFO)

But using the Lat/Long coordinates, it can also be written as:http://www.gcmap.com/mapui?P=37.618972+N+122.374889+W-33.942495+N+118.408067+W (http://www.gcmap.com... N 118.408067 W)

I am just not sure of the easiest way to query the "phpvms_airports" database for the Lat/Long and write the new code into the current code.

<?php

$flights = PIREPData::getRecentReportsByCount(10);

$string = "";

foreach($flights as $flight)

{

$string = $string.$flight->depicao.'+-+'.$flight->arricao.',+';

}

?>

<img src="http://www.gcmap.com/map?P=<?php echo $string ?>&MS=bm&MR=240&MX=590x360&PM=pemr:diamond7:red%2b%22%25I%22:red&PC=%230000ff" />

<?php

$count = 15;

$pireps = PIREPData::getRecentReportsByCount($count);

?>

Link to comment
Share on other sites

  • 3 weeks later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...