Roster list

In the index function you showed, you can replace it with this:

public function index()

  {

     

      $this->render(‘pilots_list.tpl’);

  }

Which should do what you want.

I think I’ll revamp this function a bit too, so it can be customized a bit more easily

Aha that fixed it Nabeel thanks

Hi Nedra,

In the post by Danny where he shows that code, I believe it’s in the pilots module, replace it with the code I put in the post above, it’ll only show it once then

Hi Nedra,

In the post by Danny where he shows that code, I believe it’s in the pilots module, replace it with the code I put in the post above, it’ll only show it once then

Is there a way to get the name of the airport hub to not show up when there is no pilots based at that hub? If you look at it here: v you can see it says “There are no pilots based at this airport.” Is there any way to keep the names of the airports with pilots based there and to stop the airports that have no pilots based at them from showing up?

Thanks, james

The only one i can see if in pilots.php

public function index()
{
// Get all of our hubs, and list pilots by hub
$allhubs = OperationsData::GetAllHubs();

if(!$allhubs) $allhubs = array();

foreach($allhubs as $hub)
{
$this->set(‘title’, $hub->name);
$this->set(‘icao’, $hub->icao);

$this->set(‘allpilots’, PilotData::findPilots(array(‘p.hub’=>$hub->icao)));

$this->render(‘pilots_list.tpl’);
}

$nohub = PilotData::findPilots(array(‘p.hub’=>‘’));
if(!$nohub)
{
return;
}

$this->set(‘title’, ‘No Hub’);
$this->set(‘icao’, ‘’);
$this->set(‘allpilots’, $nohub);
$this->render(‘pilots_list.tpl’);
}

what folder is this in?

Thank you

ID Name Rank Flights Hours Vatsim ID IVAO Status

How do i only have one of them? for each hub there is table like that.

Would it be possible so there is only one table with all pilots in just one list?

thanks

Daniel

Is there a way to get the name of the airport hub to not show up when there is no pilots based at that hub? If you look at it here: v you can see it says “There are no pilots based at this airport.” Is there any way to keep the names of the airports with pilots based there and to stop the airports that have no pilots based at them from showing up?

Thanks, james

In that loop where it shows the pilots, you can do something like

if(count($pilots) == 0) { echo 'No pilots based at this airport'; }

ID Name Rank Flights Hours Vatsim ID IVAO Status

How do i only have one of them? for each hub there is table like that.

Would it be possible so there is only one table with all pilots in just one list?

thanks

Daniel

Read this thread from the beginning, it explains how

i don’t understand i just need a clean code please or can you point out please

thanks

Daniel

In that loop where it shows the pilots, you can do something like

if(count($pilots) == 0) { echo ‘No pilots based at this airport’; }

But the airports that have no pilot based at them are still showing up?

does that go in the pilot list.tpl

1 Like

Add this to your local.config.php

/* For PILOT_ORDER_BY use p.[column_name] [ASC/DESC] */
Config::Set('PILOT_ORDER_BY', 'p.ranklevel DESC');
1 Like