Jeff Posted June 6, 2010 Report Share Posted June 6, 2010 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- Quote Link to comment Share on other sites More sharing options...
CPC900 Posted June 6, 2010 Report Share Posted June 6, 2010 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. Quote Link to comment Share on other sites More sharing options...
Administrators Nabeel Posted June 6, 2010 Administrators Report Share Posted June 6, 2010 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 Quote Link to comment Share on other sites More sharing options...
CPC900 Posted June 6, 2010 Report Share Posted June 6, 2010 Ok, will try to take a peek later tonight. Thanks. Quote Link to comment Share on other sites More sharing options...
Guest lorathon Posted June 6, 2010 Report Share Posted June 6, 2010 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 Quote Link to comment Share on other sites More sharing options...
skymx Posted June 6, 2010 Report Share Posted June 6, 2010 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 Thanks other Jeff! I gues I got it! Quote Link to comment Share on other sites More sharing options...
Jeff Posted June 6, 2010 Author Report Share Posted June 6, 2010 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 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. Quote Link to comment Share on other sites More sharing options...
Guest lorathon Posted June 7, 2010 Report Share Posted June 7, 2010 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. Quote Link to comment Share on other sites More sharing options...
Jeff Posted June 7, 2010 Author Report Share Posted June 7, 2010 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. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.