Can I Have A Clean Code Of The Pilot Roster With No Hubs

Just now, AidasP said:

wait…I am using default ‘Crew Center’, well at least the one i made with bootstrap, the thing is, that (yes my version is 5.5.x, of phpvms), that the Module Pilots, is acting like its not even existing there, i can delete everything, i can keep everything, i can edit stuff, it just ignores my changes, i am really annoyed with the hubs, just like sitting here trying to fix it for like 2h30min, so yeah..

oh and yeah i move them to my skin folder, or edit it directly, still no luck

Are you actually using CrewCenter? Have you got any links? Screenshots? Give us something to work with. 

Noo… I dont user the CrewCenter, i told that before, im using my own, which i made with bootstrap, any1 can give me a code with pilots list, without hubs, and with bootstrap would be appreciated a lot!

i mean with bootstrap - bootstrap table

Ok well you need to stop calling it crew center as people will automatically think you are using the crewcenter that many of us use. 

Why are you making these edits (ie file location)?

What phpVMS version are you using?

you can easily grab the default php file you need from a github repo

For phpvms 5.5.x, go into core/modules/Pilots/Pilot.php and find this

 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); $pilot\_list = PilotData::findPilots(array('p.hub'=\>$hub-\>icao)); $this-\>set('allpilots', $pilot\_list); # deprecated $this-\>set('pilot\_list', $pilot\_list); $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); # deprecated $this-\>set('pilot\_list', $nohub); $this-\>render('pilots\_list.tpl'); }

And replace it with this

 public function index() { $allpilots = PilotData::getAllPilots(); $this-\>set('allpilots', $allpilots); # deprecated $this-\>set('pilot\_list', $allpilots); $this-\>render('pilots\_list.tpl'); }

Provided you haven’t heavily modified the pilots_list.tpl/.php file, it should work.

NOTE: This takes into account the nature of the post, to give a pilots list of every pilot in the database and order them by pilot id not by hub.

If you want the default then do what said and go to the github repo and download the default file again.

On 12/19/2017 at 11:27 PM, web541 said:

For phpvms 5.5.x, go into core/modules/Pilots/Pilot.php and find this

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); $pilot_list = PilotData::findPilots(array(‘p.hub’=>$hub->icao)); $this->set(‘allpilots’, $pilot_list); # deprecated $this->set(‘pilot_list’, $pilot_list); $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); # deprecated $this->set(‘pilot_list’, $nohub); $this->render(‘pilots_list.tpl’); }

And replace it with this

public function index() { $allpilots = PilotData::getAllPilots(); $this->set(‘allpilots’, $allpilots); # deprecated $this->set(‘pilot_list’, $allpilots); $this->render(‘pilots_list.tpl’); }

Provided you haven’t heavily modified the pilots_list.tpl/.php file, it should work.

NOTE: This takes into account the nature of the post, to give a pilots list of every pilot in the database and order them by pilot id not by hub.

If you want the default then do what said and go to the github repo and download the default file again.

Okay, thanks! Sorry for late reply. But that really helps.

 

      Aidas

1 Like