flyalaska Posted January 1, 2012 Report Share Posted January 1, 2012 Does anyone have a pilot roster that shows all their pilots without breaking them up by hub and is willing to share? Quote Link to comment Share on other sites More sharing options...
mseiwald Posted January 1, 2012 Report Share Posted January 1, 2012 What about sorting them by Airline instead by Hub? I have sorted the Roster by airline on my Site! Found the Code somewhere here in the forum Quote Link to comment Share on other sites More sharing options...
flyalaska Posted January 1, 2012 Author Report Share Posted January 1, 2012 Never thought of that. I will look around. Thank you!! Quote Link to comment Share on other sites More sharing options...
Tylor Eddy Posted January 1, 2012 Report Share Posted January 1, 2012 If you like the structure of mine, ill be happy to post the code here, i got it from somewhere on these massive forums anyways PS. just looking at your pilot roster, those rank images look unreal, great job Tylor Quote Link to comment Share on other sites More sharing options...
flyalaska Posted January 1, 2012 Author Report Share Posted January 1, 2012 If you like the structure of mine, ill be happy to post the code here, i got it from somewhere on these massive forums anyways PS. just looking at your pilot roster, those rank images look unreal, great job Tylor If you want the image set, I can give them to you. About the roster code, that is exactly what I am looking for.Please share!! Quote Link to comment Share on other sites More sharing options...
Tylor Eddy Posted January 2, 2012 Report Share Posted January 2, 2012 If you want the image set, I can give them to you. About the roster code, that is exactly what I am looking for.Please share!! Thats ok, i was merly commenting on how they look as for my roster, you can find the basics below, i have take out all my styling so you can add your touch <div id="content"> <?php $roster = PilotData::getAllPilots(); ?> <?php if(!$roster) { echo 'There are no pilots!'; return; } ?> <table> <table id="tabledlist" class="other"> <thead> <tr> <th width="160px">Pilot ID</th> <th width="220px">Name</th> <th width="120px">Rank</th> <th width="50px">Flights</th> <th width="100px">Hours</th> <th width="100px">HUB</th> <th width="128px">Vatsim ID</th> <th width="50px">Status</th> </tr> </thead> <tbody> <?php foreach($roster as $pilot) { if($pilot->retired == 1) { continue; } ?> <tr> <TD ALIGN="center"> <img src="<?php echo Countries::getCountryImage($pilot->location);?>" alt="<?php echo Countries::getCountryName($pilot->location);?>" align="absmiddle" /> <a href="<?php echo SITE_URL?>/index.php/profile/view/<?php echo $pilot->pilotid?>"> <?php echo PilotData::GetPilotCode($pilot->code, $pilot->pilotid)?></a> </td> <TD ALIGN="left"> <?php echo $pilot->firstname.' '.$pilot->lastname?> </td> <TD ALIGN="center"><img src="<?php echo $pilot->rankimage?>" alt="<?php echo $pilot->rank;?>" /></td> <TD ALIGN="center"><?php echo $pilot->totalflights?></td> <TD ALIGN="center"><?php echo Util::AddTime($pilot->totalhours, $pilot->transferhours); ?></td> <TD ALIGN="center"><?php echo $pilot->hub?></td> <td><div align="center"> <?php $fieldvalue = PilotData :: GetFieldValue ( $pilot -> pilotid , 'Vatsim ID' ); if( $fieldvalue != '' ) { echo '<a href="http://stats.vatsim.net/search_id.php?id=' . $fieldvalue . '" target="_blank">' . $fieldvalue . '</a></a>' ; } else { echo '<img src="http://yourwebsite.com/images/inactiveicon.png" width="20" height="18" border="0" alt="" /></a>' ; } ?> </div></td> <TD ALIGN="center"><?php if($pilot->retired == 0) { ?> <img src="http://yourwebsite.com/images/activeicon.png" alt="Active" /> <?php } else { ?> <img src="http://yourwebsite.com/images/inactiveicon.png" alt="Inactive" /> <?php } ?></td> </td> </tr> <?php } ?> </tbody> </table> </div> Above is everything you'll need, i'll let you make all the changes you feel necessary Regards Tylor Quote Link to comment Share on other sites More sharing options...
cgentil Posted July 16, 2012 Report Share Posted July 16, 2012 Thats ok, i was merly commenting on how they look as for my roster, you can find the basics below, i have take out all my styling so you can add your touch <div id="content"> <?php $roster = PilotData::getAllPilots(); ?> <?php if(!$roster) { echo 'There are no pilots!'; return; } ?> <table> <table id="tabledlist" class="other"> <thead> <tr> <th width="160px">Pilot ID</th> <th width="220px">Name</th> <th width="120px">Rank</th> <th width="50px">Flights</th> <th width="100px">Hours</th> <th width="100px">HUB</th> <th width="128px">Vatsim ID</th> <th width="50px">Status</th> </tr> </thead> <tbody> <?php foreach($roster as $pilot) { if($pilot->retired == 1) { continue; } ?> <tr> <TD ALIGN="center"> <img src="<?php echo Countries::getCountryImage($pilot->location);?>" alt="<?php echo Countries::getCountryName($pilot->location);?>" align="absmiddle" /> <a href="<?php echo SITE_URL?>/index.php/profile/view/<?php echo $pilot->pilotid?>"> <?php echo PilotData::GetPilotCode($pilot->code, $pilot->pilotid)?></a> </td> <TD ALIGN="left"> <?php echo $pilot->firstname.' '.$pilot->lastname?> </td> <TD ALIGN="center"><img src="<?php echo $pilot->rankimage?>" alt="<?php echo $pilot->rank;?>" /></td> <TD ALIGN="center"><?php echo $pilot->totalflights?></td> <TD ALIGN="center"><?php echo Util::AddTime($pilot->totalhours, $pilot->transferhours); ?></td> <TD ALIGN="center"><?php echo $pilot->hub?></td> <td><div align="center"> <?php $fieldvalue = PilotData :: GetFieldValue ( $pilot -> pilotid , 'Vatsim ID' ); if( $fieldvalue != '' ) { echo '<a href="http://stats.vatsim.net/search_id.php?id=' . $fieldvalue . '" target="_blank">' . $fieldvalue . '</a></a>' ; } else { echo '<img src="http://yourwebsite.com/images/inactiveicon.png" width="20" height="18" border="0" alt="" /></a>' ; } ?> </div></td> <TD ALIGN="center"><?php if($pilot->retired == 0) { ?> <img src="http://yourwebsite.com/images/activeicon.png" alt="Active" /> <?php } else { ?> <img src="http://yourwebsite.com/images/inactiveicon.png" alt="Inactive" /> <?php } ?></td> </td> </tr> <?php } ?> </tbody> </table> </div> Above is everything you'll need, i'll let you make all the changes you feel necessary Regards Tylor I have tried bue I had this error: All same pilot... Quote Link to comment Share on other sites More sharing options...
cgentil Posted July 17, 2012 Report Share Posted July 17, 2012 Anyone help me? Please... Quote Link to comment Share on other sites More sharing options...
James142 Posted July 17, 2012 Report Share Posted July 17, 2012 I have tried bue I had this error: All same pilot... Are you asking why the images are not showing? If so, have you changed the image links to your own website URL? You need to change: <img src="http://yourwebsite.com/images/activeicon.png" alt="Active" /> And <img src="http://yourwebsite.com/images/inactiveicon.png" alt="Inactive" /> to your images. Kindest Regards, James Quote Link to comment Share on other sites More sharing options...
cgentil Posted July 17, 2012 Report Share Posted July 17, 2012 Are you asking why the images are not showing? If so, have you changed the image links to your own website URL? You need to change: <img src="http://yourwebsite.com/images/activeicon.png" alt="Active" /> And <img src="http://yourwebsite.com/images/inactiveicon.png" alt="Inactive" /> to your images. Kindest Regards, James No I'am asking why I have only 1 pilot in company and in roster I have lot of pilots (but is only 1 pilot)... Quote Link to comment Share on other sites More sharing options...
cgentil Posted July 18, 2012 Report Share Posted July 18, 2012 Bump Quote Link to comment Share on other sites More sharing options...
cgentil Posted July 19, 2012 Report Share Posted July 19, 2012 Anyone? Please Quote Link to comment Share on other sites More sharing options...
Moderators Kyle Posted July 19, 2012 Moderators Report Share Posted July 19, 2012 What do you mean only 1 pilot in company? If you have a link, please post in here so we can get an idea on what your issue is really. Cheers! Quote Link to comment Share on other sites More sharing options...
cgentil Posted July 19, 2012 Report Share Posted July 19, 2012 There is: http://teste90.netne.net/index.php/pilots Regards. Quote Link to comment Share on other sites More sharing options...
cgentil Posted July 19, 2012 Report Share Posted July 19, 2012 One more question how I hide "view details" if pilots not logged in? In schedules http://teste90.netne.../schedules/view EDIT: details or an error with message "you aren't logged in" Quote Link to comment Share on other sites More sharing options...
Moderators Kyle Posted July 19, 2012 Moderators Report Share Posted July 19, 2012 There is: http://teste90.netne...ndex.php/pilots Regards. Somehow, you must have two foreach in the code. Remove one of them and it should only show one. One more question how I hide "view details" if pilots not logged in? In schedules http://teste90.netne.../schedules/view EDIT: details or an error with message "you aren't logged in" You can do this... <?php if(!Auth::LoggedIn()) { ?> <strong>Log in first before booking!</strong> <?php } else { ?> <a href="<?php echo url('/schedules/details/'.$route->id);?>">View Details</a><br /> <?php } ?> Cheers! Quote Link to comment Share on other sites More sharing options...
cgentil Posted July 19, 2012 Report Share Posted July 19, 2012 Thats ok, i was merly commenting on how they look as for my roster, you can find the basics below, i have take out all my styling so you can add your touch <div id="content"> <?php $roster = PilotData::getAllPilots(); ?> <?php if(!$roster) { echo 'There are no pilots!'; return; } ?> <table> <table id="tabledlist" class="other"> <thead> <tr> <th width="160px">Pilot ID</th> <th width="220px">Name</th> <th width="120px">Rank</th> <th width="50px">Flights</th> <th width="100px">Hours</th> <th width="100px">HUB</th> <th width="128px">Vatsim ID</th> <th width="50px">Status</th> </tr> </thead> <tbody> <?php foreach($roster as $pilot) { if($pilot->retired == 1) { continue; } ?> <tr> <TD ALIGN="center"> <img src="<?php echo Countries::getCountryImage($pilot->location);?>" alt="<?php echo Countries::getCountryName($pilot->location);?>" align="absmiddle" /> <a href="<?php echo SITE_URL?>/index.php/profile/view/<?php echo $pilot->pilotid?>"> <?php echo PilotData::GetPilotCode($pilot->code, $pilot->pilotid)?></a> </td> <TD ALIGN="left"> <?php echo $pilot->firstname.' '.$pilot->lastname?> </td> <TD ALIGN="center"><img src="<?php echo $pilot->rankimage?>" alt="<?php echo $pilot->rank;?>" /></td> <TD ALIGN="center"><?php echo $pilot->totalflights?></td> <TD ALIGN="center"><?php echo Util::AddTime($pilot->totalhours, $pilot->transferhours); ?></td> <TD ALIGN="center"><?php echo $pilot->hub?></td> <td><div align="center"> <?php $fieldvalue = PilotData :: GetFieldValue ( $pilot -> pilotid , 'Vatsim ID' ); if( $fieldvalue != '' ) { echo '<a href="http://stats.vatsim.net/search_id.php?id=' . $fieldvalue . '" target="_blank">' . $fieldvalue . '</a></a>' ; } else { echo '<img src="http://yourwebsite.com/images/inactiveicon.png" width="20" height="18" border="0" alt="" /></a>' ; } ?> </div></td> <TD ALIGN="center"><?php if($pilot->retired == 0) { ?> <img src="http://yourwebsite.com/images/activeicon.png" alt="Active" /> <?php } else { ?> <img src="http://yourwebsite.com/images/inactiveicon.png" alt="Inactive" /> <?php } ?></td> </td> </tr> <?php } ?> </tbody> </table> </div> Above is everything you'll need, i'll let you make all the changes you feel necessary Regards Tylor This is the code, what I have to edit? Thanks. Quote Link to comment Share on other sites More sharing options...
cgentil Posted July 19, 2012 Report Share Posted July 19, 2012 Somehow, you must have two foreach in the code. Remove one of them and it should only show one. You can do this... <?php if(!Auth::LoggedIn()) { ?> <strong>Log in first before booking!</strong> <?php } else { ?> <a href="<?php echo url('/schedules/details/'.$route->id);?>">View Details</a><br /> <?php } ?> Cheers! But is possible do anything like this: http://teste90.netne.net/index.php/profile ? An error when anybody open page without log in? Regards! Quote Link to comment Share on other sites More sharing options...
Moderators Kyle Posted July 20, 2012 Moderators Report Share Posted July 20, 2012 Clear out the pilot_list.tpl file, and put this code in the pilot_list.tpl <div id="content"> <?php $roster = PilotData::getAllPilots(); ?> <?php if(!$roster) { echo 'There are no pilots!'; return; } ?> <table> <table id="tabledlist" class="other"> <thead> <tr> <th width="160px">Pilot ID</th> <th width="220px">Name</th> <th width="120px">Rank</th> <th width="50px">Flights</th> <th width="100px">Hours</th> <th width="100px">HUB</th> <th width="128px">Vatsim ID</th> <th width="50px">Status</th> </tr> </thead> <tbody> <?php foreach($roster as $pilot) { if($pilot->retired == 1) { continue; } ?> <tr> <TD ALIGN="center"> <img src="<?php echo Countries::getCountryImage($pilot->location);?>" alt="<?php echo Countries::getCountryName($pilot->location);?>" align="absmiddle" /> <a href="<?php echo SITE_URL?>/index.php/profile/view/<?php echo $pilot->pilotid?>"> <?php echo PilotData::GetPilotCode($pilot->code, $pilot->pilotid)?></a> </td> <TD ALIGN="left"> <?php echo $pilot->firstname.' '.$pilot->lastname?> </td> <TD ALIGN="center"><img src="<?php echo $pilot->rankimage?>" alt="<?php echo $pilot->rank;?>" /></td> <TD ALIGN="center"><?php echo $pilot->totalflights?></td> <TD ALIGN="center"><?php echo Util::AddTime($pilot->totalhours, $pilot->transferhours); ?></td> <TD ALIGN="center"><?php echo $pilot->hub?></td> <td><div align="center"> <?php $fieldvalue = PilotData :: GetFieldValue ( $pilot -> pilotid , 'Vatsim ID' ); if( $fieldvalue != '' ) { echo '<a href="http://stats.vatsim.net/search_id.php?id=' . $fieldvalue . '" target="_blank">' . $fieldvalue . '</a></a>' ; } else { echo '<img src="http://yourwebsite.com/images/inactiveicon.png" width="20" height="18" border="0" alt="" /></a>' ; } ?> </div></td> <TD ALIGN="center"><?php if($pilot->retired == 0) { ?> <img src="http://yourwebsite.com/images/activeicon.png" alt="Active" /> <?php } else { ?> <img src="http://yourwebsite.com/images/inactiveicon.png" alt="Inactive" /> <?php } ?></td> </td> </tr> <?php } ?> </tbody> </table> </div> Then with the schedule part... <?php if(!Auth::LoggedIn()) { ?> <div id="error">Log in first before booking!</div> <?php } else { ?> <a href="<?php echo url('/schedules/details/'.$route->id);?>">View Details</a><br /> <?php } ?> Cheers! Quote Link to comment Share on other sites More sharing options...
cgentil Posted July 20, 2012 Report Share Posted July 20, 2012 Don't work. Check: http://teste90.netne...ndex.php/pilots And for schedules page I want, a error in page (all page if pilot if not logged in), I think a code for Schedules.php... Like this: I think code like this in Schedules.php class Profile extends CodonModule { public function index() { if(!Auth::LoggedIn()) { $this->set('message', 'You must be logged in to access this feature!'); $this->render('core_error.tpl'); return; } I've tried, but i've got a error: Parse error: syntax error, unexpected T_PUBLIC in /home/public_html/core/modules/Schedules/Schedules.php on line 31 Quote Link to comment Share on other sites More sharing options...
cgentil Posted July 20, 2012 Report Share Posted July 20, 2012 Kyle, any ideas? Please! Quote Link to comment Share on other sites More sharing options...
Moderators Kyle Posted July 20, 2012 Moderators Report Share Posted July 20, 2012 cgentil, Can you paste from the start of Schedules.php up to line 100? You may be missing a { or } to close out the function or something. Cheers Quote Link to comment Share on other sites More sharing options...
cgentil Posted July 20, 2012 Report Share Posted July 20, 2012 I will post here, my server now is down... One question show rank image in signature, is possible isn't it if yes, how?? Quote Link to comment Share on other sites More sharing options...
Moderators Kyle Posted July 20, 2012 Moderators Report Share Posted July 20, 2012 The rank image in signature, I think that part of the the phpVMS Beta. I wouldn't bother using Beta right now since it's not stable yet for VA operations yet. Quote Link to comment Share on other sites More sharing options...
cgentil Posted July 20, 2012 Report Share Posted July 20, 2012 Ok, thanks. I make download of version 2.1.934. This version is ok, right? Thanks! Quote Link to comment Share on other sites More sharing options...
Moderators Kyle Posted July 20, 2012 Moderators Report Share Posted July 20, 2012 Yep, that's the stable version. Quote Link to comment Share on other sites More sharing options...
cgentil Posted July 20, 2012 Report Share Posted July 20, 2012 Ok. Tomorrow will post what you say me. Thanks for all help Quote Link to comment Share on other sites More sharing options...
cgentil Posted July 20, 2012 Report Share Posted July 20, 2012 There is: <?php /** * phpVMS - Virtual Airline Administration Software * Copyright (c) 2008 Nabeel Shahzad * For more information, visit www.phpvms.net * Forums: http://www.phpvms.net/forum * Documentation: http://www.phpvms.net/docs * * phpVMS is licenced under the following license: * Creative Commons Attribution Non-commercial Share Alike (by-nc-sa) * View license.txt in the root, or visit http://creativecommons.org/licenses/by-nc-sa/3.0/ * * @author Nabeel Shahzad * @copyright Copyright (c) 2008, Nabeel Shahzad * @link http://www.phpvms.net * @license http://creativecommons.org/licenses/by-nc-sa/3.0/ */ class Schedules extends CodonModule { public function index() { $this->view(); } public function view() { if(isset($this->post->action) && $this->post->action == 'findflight') { $this->FindFlight(); return; } $this->showSchedules(); } public function detail($routeid='') { $this->details($routeid); } public function details($routeid = '') { //$routeid = $this->get->id; if(!is_numeric($routeid)) { preg_match('/^([A-Za-z]{3})(\d*)/', $routeid, $matches); $code = $matches[1]; $flightnum = $matches[2]; $params = array('s.code'=>$code, 's.flightnum'=>$flightnum); } else { $params = array('s.id' => $routeid); } $schedule = SchedulesData::getScheduleDetailed($routeid); $this->set('schedule', $schedule); $this->render('schedule_details.tpl'); $this->render('route_map.tpl'); } public function brief($routeid = '') { if($routeid == '') { $this->set('message', 'You must be logged in to access this feature!'); $this->render('core_error.tpl'); return; } $schedule = SchedulesData::getScheduleDetailed($routeid); $this->set('schedule', $schedule); $this->render('schedule_briefing.tpl'); } public function boardingpass($routeid) { if($routeid == '') { $this->set('message', 'You must be logged in to access this feature!'); $this->render('core_error.tpl'); return; } $schedule = SchedulesData::getScheduleDetailed($routeid); $this->set('schedule', $schedule); $this->render('schedule_boarding_pass.tpl'); } public function bids() { if(!Auth::LoggedIn()) return; $this->set('bids', SchedulesData::GetBids(Auth::$userinfo->pilotid)); $this->render('schedule_bids.tpl'); } public function addbid() { if(!Auth::LoggedIn()) return; $routeid = $this->get->id; if($routeid == '') { echo 'No route passed'; return; } // See if this is a valid route $route = SchedulesData::findSchedules(array('s.id' => $routeid)); if(!is_array($route) && !isset($route[0])) { echo 'Invalid Route'; return; } CodonEvent::Dispatch('bid_preadd', 'Schedules', $routeid); /* Block any other bids if they've already made a bid */ if(Config::Get('DISABLE_BIDS_ON_BID') == true) { $bids = SchedulesData::getBids(Auth::$userinfo->pilotid); # They've got somethin goin on if(count($bids) > 0) { echo 'You have already a flight assigned'; return; } } $ret = SchedulesData::AddBid(Auth::$userinfo->pilotid, $routeid); CodonEvent::Dispatch('bid_added', 'Schedules', $routeid); if($ret == true) { echo 'Flight assigned'; } else { echo 'Flight already assigned'; } } public function removebid() { if(!Auth::LoggedIn()) return; SchedulesData::RemoveBid($this->post->id); } public function showSchedules() { $depapts = OperationsData::GetAllAirports(); $equip = OperationsData::GetAllAircraftSearchList(true); $this->set('depairports', $depapts); $this->set('equipment', $equip); $this->render('schedule_searchform.tpl'); # Show the routes. Remote this to not show them. $this->set('allroutes', SchedulesData::GetSchedules()); $this->render('schedule_list.tpl'); } public function findFlight() { if($this->post->depicao != '') { $params = array('s.depicao' => $this->post->depicao); } if($this->post->arricao != '') { $params = array('s.arricao' => $this->post->arricao); } if($this->post->equipment != '') { $params = array('a.name' => $this->post->equipment); } if($this->post->distance != '') { if($this->post->type == 'greater') $value = '> '; else $value = '< '; $value .= $this->post->distance; $params = array('s.distance' => $value); } $params['s.enabled'] = 1; $this->set('allroutes', SchedulesData::findSchedules($params)); $this->render('schedule_results.tpl'); } public function statsdaysdata($routeid) { $routeinfo = SchedulesData::findSchedules(array('s.id'=>$routeid)); $routeinfo = $routeinfo[0]; // Last 30 days stats $data = PIREPData::getIntervalDataByDays( array( 'p.code' => $routeinfo->code, 'p.flightnum' => $routeinfo->flightnum, ), 30); $this->create_line_graph('Schedule Flown Counts', $data); } protected function create_line_graph($title, $data) { if(!$data) { $data = array(); } $titles = array(); $bar_titles = array(); foreach($data as $val) { $titles[] = $val->ym; $values[] = floatval($val->total); } OFCharts::add_data_set($titles, $values); echo OFCharts::create_line_graph($title); } } Quote Link to comment Share on other sites More sharing options...
cgentil Posted July 21, 2012 Report Share Posted July 21, 2012 Any idea Kyle? Quote Link to comment Share on other sites More sharing options...
RogerB Posted July 21, 2012 Report Share Posted July 21, 2012 Yeah it's been in Beta for 10 years......LMAO 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.