EastCoastHops Posted October 27, 2013 Report Posted October 27, 2013 Hello, Can someone give me the code to pull the pilot roster for individual hubs to use on my hub pages? Thanks! -Brendan Quote
Administrators simpilot Posted October 28, 2013 Administrators Report Posted October 28, 2013 Try; $pilots = PilotData::findPilots(array('p.hub' => 'ICAO')); Change ICAO to the icao code of the hub you are looking for. 1 Quote
EastCoastHops Posted October 28, 2013 Author Report Posted October 28, 2013 Thank you simpilot! Quote
Taran Posted December 7, 2013 Report Posted December 7, 2013 I tried to put this code in a page source but it didn't work. What am i missing? This is how i added it: $pilots = PilotData::findPilots(array('p.hub' => 'CYYZ')); Quote
freshJet Posted December 7, 2013 Report Posted December 7, 2013 Don't know why you want pilots, but try it this way: $params['p.hub'] = 'CYYZ'; $pilots = PilotData::findPilots($params); Quote
Taran Posted December 7, 2013 Report Posted December 7, 2013 I put in just as you said and all it did was show that code. Could it be the issue that i'm using the page editor in the admin center to edit the source code? If so, how do i edit the source code through my file manager? Quote
Taran Posted December 8, 2013 Report Posted December 8, 2013 I've figured out the answer to: "how do i edit the source code through my file manager?" But i still can't get either of those codes to work. any suggestions? Quote
freshJet Posted December 8, 2013 Report Posted December 8, 2013 Did you use add the PHP tags? What are you doing with the code after that? Quote
Taran Posted December 8, 2013 Report Posted December 8, 2013 what are the php tags? can you show me exactly how it's supposed to go in so i can just copy and paste it? I'll put it in a table later Quote
freshJet Posted December 8, 2013 Report Posted December 8, 2013 Firstly, I noticed you've changed the thread title. Rosters are already displayed by default when you go to index.php/pilots. If you want it for just one hub then: <tr> <th>Pilot code</th> <th>First name</th> <th>Last name</th> <th>Country</th> <th>Total Hours</th> <th>Total Flights</th> </tr> <?php $params['p.hub'] = 'CYYZ'; $pilots = PilotData::findPilots($params); foreach($pilots as $pilot){ ?> <tr> <td><?php echo $pilot->code.$pilot->pilotid;?></td> <td><?php echo $pilot->firstname;?></td> <td><?php echo $pilot->lastname;?></td> <td><?php echo $pilot->country;?></td> <td><?php echo $pilot->totalhours;?></td> <td><?php echo $pilot->totalflights;?></td> </tr> <?php } ?> That will display all your pilots based in Toronto and some of their details. Quote
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.