Jump to content

Separate Airline Statistics


Jeff

Recommended Posts

By looking at Jeff's "Phoenix" and Simpilot's "WestJet" systems, I'm wondering how to separate the statistics for separate hubs and Airlines. My site is more in the way of Jeff's Phoenix (having multiple airlines with their own realistic flight routes). Is there a simple solution to do that, or is it some kind of trade secret that they would rather not discuss for copying reasons? As I have said many times before, I know very little about coding, but am learning pretty fast by reading these forums. I'd appreciate any help on this, as I know more may be interested as well. -Thanx-

Link to comment
Share on other sites

Yeah, I have added associated airlines to my CP Air VA site, and would like to have them under one roof per se, but would like the stats to be separate. Trying to review how best to go about this. Otherwise, I will have to do separate sites for them. Any guidance would be welcome, as always. :)

Link to comment
Share on other sites

  • Administrators

I think it's done mostly by doing manual queries on the database. You can use a tool like TOAD for MySQL to generate the queries and stuff (it's takes some getting used to for using). If you take a look at the core/common/statsdata.class.php you can see how the statistics are currently formed, and do something like that and create your own queries

Link to comment
Share on other sites

Guest lorathon

Jeff,

I wrote my own queries and modules to do just what you are asking about. A lot of it had to do with how I inputed my schedules and aircraft so it will not work for anyone else. It was all thought out prior to adding. The best advice I can give you is to look at how the standard queries are working and just modify them a bit to get what you want.

The most import thing to remember is that if you use the 'code' field in the schedules and pireps you can get most of what you are looking for. The 'code' is the airline code so it is your best friend.

Regards,

The Other Jeff :D

Link to comment
Share on other sites

Jeff,

I wrote my own queries and modules to do just what you are asking about. A lot of it had to do with how I inputed my schedules and aircraft so it will not work for anyone else. It was all thought out prior to adding. The best advice I can give you is to look at how the standard queries are working and just modify them a bit to get what you want.

The most import thing to remember is that if you use the 'code' field in the schedules and pireps you can get most of what you are looking for. The 'code' is the airline code so it is your best friend.

Regards,

The Other Jeff :D

Thanks other Jeff! ;) I gues I got it!

Link to comment
Share on other sites

Jeff,

I wrote my own queries and modules to do just what you are asking about. A lot of it had to do with how I inputed my schedules and aircraft so it will not work for anyone else. It was all thought out prior to adding. The best advice I can give you is to look at how the standard queries are working and just modify them a bit to get what you want.

The most import thing to remember is that if you use the 'code' field in the schedules and pireps you can get most of what you are looking for. The 'code' is the airline code so it is your best friend.

Regards,

The Other Jeff :D

Well, I thought it was going to be something that would take a few hours to a couple days, but as far along into my site (it is basically finished) it wouldn't be worth it to touch anything. Thanks Jeff for your response back on this, I appreciate it.

Link to comment
Share on other sites

Guest lorathon

I am not saying that. Sorry maybe my first post was misleading.

You should be able to get a lot of the stats just using the airline code.

Example -

public function airportInfo($icao="")
{	
	// get all departing schedules for departing chosen Airport
	$params['s.depicao'] = $icao;		
	$params['s.enabled'] = 1;
	$depflights = SchedulesData::findSchedules($params);
               return $depflights;
       }

The above is just a few lines from a module I wrote. If you call airportInfo using KLAX you would get all schedules that depart from KLAX. You can then minipulate this data as such in whatever you called it from.

<?php
echo 'Total Departing Flights :'.count($depflights);
?>

Using the above would show the total number of departing flights for KLAX. The same can be used for the PIREPS.

Link to comment
Share on other sites

I am not saying that. Sorry maybe my first post was misleading.

You should be able to get a lot of the stats just using the airline code.

Example -

public function airportInfo($icao="")
{	
	// get all departing schedules for departing chosen Airport
	$params['s.depicao'] = $icao;		
	$params['s.enabled'] = 1;
	$depflights = SchedulesData::findSchedules($params);
               return $depflights;
       }

The above is just a few lines from a module I wrote. If you call airportInfo using KLAX you would get all schedules that depart from KLAX. You can then minipulate this data as such in whatever you called it from.

<?php
echo 'Total Departing Flights :'.count($depflights);
?>

Using the above would show the total number of departing flights for KLAX. The same can be used for the PIREPS.

so if I wanted to call up LAX then in this...

public function airportInfo($icao="")
{	
	// get all departing schedules for departing chosen Airport
	$params['s.depicao'] = $icao;		
	$params['s.enabled'] = 1;
	$depflights = SchedulesData::findSchedules($params);
               return $depflights;
       }

I would just add KLAX like this?

public function airportInfo($icao="KLAX")
{	
	// get all departing schedules for departing chosen Airport
	$params['s.depicao'] = $icao;		
	$params['s.enabled'] = 1;
	$depflights = SchedulesData::findSchedules($params);
               return $depflights;
       }

...or is that right?

I'm sorry, but I was kinda rushed into PHP when I was so used to using HTML, and am somewhat really confused about all of the new coding, and calling of certain types of scripts. :(

Link to comment
Share on other sites

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