Your page is good. I think it is how you are calling it. Are you still using the address as www.yoursite.com/index.php/pilots ? If so, you are calling the functions within the module which will seperate the pilots into hubs everytime. Best bet is to create a new path to the page. Either using the page function in admin or through a new module. I pasted your code into a blank page without using the pilots module and it works fine… Hope this helps a little.
Your page is good. I think it is how you are calling it. Are you still using the address as www.yoursite.com/index.php/pilots ? If so, you are calling the functions within the module which will seperate the pilots into hubs everytime. Best bet is to create a new path to the page. Either using the page function in admin or through a new module. I pasted your code into a blank page without using the pilots module and it works fine… Hope this helps a little.
could you please help on how to do that or an example of this ?
Thanks in advance
Vangelis Boulasikis
P.S Temporarly i stoped the problem by leaving only 1 hub but like that we can not gice the option to the new pilots to select their hub
Without creating another module or a new page for your site you can open pilots.php in your core/modules/pilots folder and find the index section ->
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');
}
and change it to
public function index()
{
$this->set('allpilots', PilotData::getAllPilots());
$this->render('pilots_list.tpl');
}
Just remember when you update this will be overwritten to the default structure. You would be better served to create a new page and/or module.