Jump to content

REALScheduleLite beta 1.0 [DEPRECATED]


Recommended Posts

Thank you for the reply, Dave :)

Have you assigned the pilots to a hub? - I built in a qualifier in the index template to put the pilot at their hub if they have never filed a PIREP.

Yes, the pilots are assigned to the hub EDDK, also in the pilots table of the SQL database. And the qualifier is correct in my realschedulelite_index.tpl. But it doesn't work :( I tried the following in the realschedulelite_airport_details.tpl:

           //If pilot is logged in check their location
           //If the pilot is at this airport allow them to bid on flights
           if(Auth::LoggedIn() == true)
           {
               $location = PIREPData::getLastReports(Auth::$userinfo->pilotid, 1, '');
               $location = RealScheduleLiteData::get_pilot_location(Auth::$userinfo->pilotid);
	if(!$location == $name->hub)
	{
	    echo '<td><a id="'.$flight->id.'" class="addbid"
			href="'.actionurl('/schedules/addbid').'">Add to Bid</a></td>';
	}
               else if($location->arricao == $name->icao)
               {
                   echo '<td><a id="'.$flight->id.'" class="addbid"
			href="'.actionurl('/schedules/addbid').'">Add to Bid</a></td>';
               }
               else
               {
                   echo '<td>You are not at this airport</td>';
               }
           }

That way it works fine for new and also existed pilots :D At least for the moment, I'll continue testing...

Link to comment
Share on other sites

But...once you fly your first route it will show up correctly.

Yes, that's correct. But the first flight can't book on my website via the hub EDDK. And that was the problem. If anyone of the new pilots take any random existing flight number it works. But I would that they start the first flight in EDDK or another chosen hub after registration and that them shown flights from the selected hub airport by REALScheduleLite.

Link to comment
Share on other sites

  • Administrators

What version are you guys running? Maybe something has changed in the latest that is cracking this script, it has worked up till now. It is designed to fall back and place the pilot at their hub if they have never filed a PIREP.

Link to comment
Share on other sites

Dave, I'm running the latest update Version 2.1.943. Even when I first installed R.S.L. it appeared that way. Members will or have joined previously, and it always shows "You are here", but when they click on the Hub, they get "you are not at this airport". I haven't changed anything in the code what-so-ever. Do you think it should be uninstalled and re-installed again?

Link to comment
Share on other sites

I'm using the VMS 2.1.934 and the RSL beta 1.0. Because I've got this problem, I reinstalled both twice again, phpVMS and RSL, also the SQL tables. But the result with a fresh install was the same: "You are here" and "You are at XXXX" vs. "You are not at this airport". But with my posted code above it works fine for me.

Link to comment
Share on other sites

  • Administrators

hello simpilot

with a quick question would show only the airports that have an aircraft if it has not stopped it shows nothing on the list would be nicer

At this point it would take a pretty big hack into the index template for the module. That function is buried well within the table, something to think about when/if there is another version written.

Link to comment
Share on other sites

hello simpilot

with a quick question would show only the airports that have an aircraft if it has not stopped it shows nothing on the list would be nicer

Yeah that's what I recommended some time ago too. But as Simpilot has stated, it would be quite the task to do. How about pagination (drop box) to choose page 1, 2, 3 etc. I am not sure how hard that would be. My list is way long and I have not even got half of my airports in yet. ;) If I can hack an easy script up I will but my scripting is sloppy and slow. It would take me a while to figure it out.

Link to comment
Share on other sites

  • Administrators

Hi

In get next flight only shown first flight and in get_airport show only first flight for each registration , I want show all flight for registration like get_aircraft page (Flight Routing) .

If I al following you, the airport page would only show the next flight for the aircraft, that would be like in the real world, and when you click on the aircraft registration number it should bring up a page with all the routes the ac is assigned to and also mark its current location. I think that is how I coded it.

Link to comment
Share on other sites

Hi Dave,

Each aircraft in your inventory can only be assigned to one looped route.

Is there a way to possibly remove this limitation?

The scenario as follows. I have a very small charter based company, flying 22 routes with 4 aircraft. The are all short hops doing adventure safari type flights. At the moment we have 2 C172's and 2 C208's Everything is flown using these 4 aircraft. some of my routes are duplicated using different departure times (Duplicated as in same destination).

I have removed all the Limit 1 part of the sql statements to see if that works, but I still cannot get it right.

Is this at all possible?

Link to comment
Share on other sites

  • Administrators

Not as it stands now. I can find a workaround for the next version when/if I write it. The module is looking for the location of the aircraft and then finding the next route for it from there, so if you have more than one route from the airfield it will show them all when you got to find the next flight for the aircraft. Probably have to use anbother db table to track each plane and work with departure times or something... Have to think about that one.

Link to comment
Share on other sites

  • 1 month later...

Yes, that's correct. But the first flight can't book on my website via the hub EDDK. And that was the problem. If anyone of the new pilots take any random existing flight number it works. But I would that they start the first flight in EDDK or another chosen hub after registration and that them shown flights from the selected hub airport by REALScheduleLite.

I have the same problem. When one pilot dont have any flight, he cant become an flight in the shedule. It shows: You are not at this airport

And the new code i have add. But it comes again. please help me.

Link to comment
Share on other sites

  • 4 weeks later...
  • 2 weeks later...
  • Administrators

Good eve Simpilot,

short question, are you sure that a loop EDDH - EDDN - LEPA - EDDN - EDDH works without any problems? Thanks for a short reply!

Returning to EDDN before the final leg that returns to EDDH will hang the aircraft up on that leg the way the script is written now. It looks for the last flight of the aircraft and places it at the destination so if there are two flights from EDDN it will not know which one to display.

Link to comment
Share on other sites

Hey simpilot. The addon is working great for me. I have a question.

Basically it has to do with restricting flights as per ranking. Some of my fleet is only flyable at a certain rank.

Say I am at JFK, and there are two flights departing. One of them is a 747 to Amsterdam, the other an A320 to Chicago. With my rank I am officially only allowed to fly with A320s.

But the module shows "Add to bid". Would it be possible for the system to not only look at your current location but also your ranks and at what rank certain aircrafts are allowed to be flown?

So basically it would only show the link "Add to bid" if you ARE at that airport and if your rank allows you to fly the aircraft in question.

I tried the following without success:

<style>
table.green, table.green td {
	border: 1px solid #008020;
               background-color: #D8FFCC;
     }
</style> 
<?php
//simpilotgroup addon module for phpVMS virtual airline system
//
//simpilotgroup addon modules are licenced under the following license:
//Creative Commons Attribution Non-commercial Share Alike (by-nc-sa)
//To view full license text visit http://creativecommons.org/licenses/by-nc-sa/3.0/
//
//@author David Clark (simpilot)
//@copyright Copyright (c) 2009-2010, David Clark
//@license http://creativecommons.org/licenses/by-nc-sa/3.0/

echo '<br /><h3>Available Flights At '.$name->name.'</h3>';
?>
<br />
<table width="100%" border="1px" class="green" cellspacing="0px">
   <tr>
       <th colspan="2">Airport Information</th>
   </tr>
   <tr>
       <td>ICAO:</td>
       <td><?php echo $name->icao; ?></td>
   </tr>
   <tr>
       <td>Country:</td>
       <td><?php echo $name->country; ?></td>
   </tr>
   <tr>
       <td>Latitude:</td>
       <td><?php echo $name->lat; ?></td>
   </tr>
   <tr>
       <td>Longitude:</td>
       <td><?php echo $name->lng; ?></td>
   </tr>
   <tr>
       <td>Flight Aware Charts Link: (USA Airfields Only)</td>
       <td><a href="http://flightaware.com/resources/airport/<?php echo $name->icao; ?>/procedures" target="_blank"><u><?php echo $name->icao; ?></u></a></td>
   </tr>
</table>
<hr />
<?php
echo '<table width="100%" border="1px" class="green" cellspacing="0px">';
echo '<tr>';
echo '<th>Flight</th>';
echo '<th>Aircraft</th>';
echo '<th>Registration</th>';
echo '<th>Next Destination</th>';
echo '<th width="10%">Distance</th>';
echo '<th>Departure Time</th>';
if(Auth::LoggedIn() == true)
{
   echo '<th>Add Bid</th>';
}
echo '</tr>';
if(!$aircrafts)
{
   echo '<tr><td colspan="6">The Airline Has No Aircraft</td></tr>';
}
else
{
   foreach ($aircrafts as $aircraft)
   {
       $location = RealScheduleLiteData::get_aircraft_location($aircraft->id);
       if(!$location)
       {
           $location = RealScheduleLiteData::get_aircraft_start($aircraft->id);
           $airfield = $location->depicao;
       }
       else
       {
           $airfield = $location->arricao;
       }
       if ($airfield == $name->icao)
       {
           $flight = RealScheduleLiteData::get_next_flight($aircraft->id, $airfield);
           $airfield = OperationsData::getAirportInfo($flight->arricao);
           echo '<tr>';
           echo '<td>'.$flight->code.''.$flight->flightnum.'</td>';
           echo '<td>'.$aircraft->fullname.'</td>';
           echo '<td><a href="'.SITE_URL.'/index.php/RealScheduleLite/get_aircraft?id='.$aircraft->id.'" >'.$aircraft->registration.'</a></td>';
           echo '<td>'.$airfield->icao.' - '.$airfield->name.' - '.$airfield->country.'</td>';
           echo '<td>'.round($flight->distance).' nm</td>';
           echo '<td>'.$flight->deptime.'</td>';


    if($route->aircraftlevel < Auth::$userinfo->ranklevel)
		{
			//If pilot is logged in check their location
			//If the pilot is at this airport allow them to bid on flights
			if(Auth::LoggedIn() == true)
			{
			    $location = RealScheduleLiteData::get_pilot_location(Auth::$userinfo->pilotid);
			    if($location->arricao == $name->icao)
			    {
				echo '<td><a id="'.$flight->id.'" class="addbid"
					    href="'.actionurl('/schedules/addbid').'">Add to Bid</a></td>';
			    }
			    else
			    {
				echo '<td>You are not at this airport</td>';
			    }
			}
		}
		else
		{
			echo '<td>Rank Requirement not Met</td>';
	         }
    }

           echo '</tr>';
   }
}
echo '</table>';
echo '<form><input class="mail" type="button" value="Go Back To Listing" onClick="history.go(-1);return true;"> </form>';
?>

If I replace the if($route->aircraftlevel < Auth::$userinfo->ranklevel) with if($route->aircraftlevel > Auth::$userinfo->ranklevel) then everywhere it writes "Rank Requirement not Met" instead of "Add to Bid".

At the moment my whole fleet can be flown at any rank except for the aircraft with registration ZE-B01. My rank is lower than the minimum for the aircraft. After it works I will make all the aircraft at their respective minimum ranks

Regards,

Nout

Link to comment
Share on other sites

  • 2 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...