MikeTGV Posted February 7, 2015 Report Posted February 7, 2015 How can I show the status of the Pilot in the Pilot Center even when the Pilot's status is - "On Leave". What factors determine if a pilot is on leave or not ? and how does a pilot become active again after being on leave ? I did found this code in the forum but it was for the default phpvms, therefore im starting this topic. Quote
Angello Posted February 7, 2015 Report Posted February 7, 2015 if($pilot->retired == '1') {echo '<img src="'.SITE_URL.'/lib/skins/ocean_blue/images/no.png" alt="warning" /> - Retired';} else {echo '<img src="'.SITE_URL.'/lib/skins/ocean_blue/images/yes.png" alt="warning" /> - Active';} ?></td> Quote
Angello Posted February 7, 2015 Report Posted February 7, 2015 pilot list.tpl <br /><br /> <h3><?php echo $title?></h3> <?php if(!$allpilots) { echo 'There are no pilots!'; return; } ?> <table width="100%" class="ocean_table" id="tabledlist"> <thead> <tr> <th>Pilot ID</th> <th width="24%">Name</th> <th width="16%">Rank</th> <th width="17%">Flights</th> <th width="18%">Hours</th> <th width="19%">Status</th> </tr> </thead> <tbody> <?php foreach($allpilots as $pilot) { /* To include a custom field, use the following example: <td> <?php echo PilotData::GetFieldValue($pilot->pilotid, 'VATSIM ID'); ?> </td> For instance, if you added a field called "IVAO Callsign": echo PilotData::GetFieldValue($pilot->pilotid, 'IVAO Callsign'); */ // To skip a retired pilot, uncomment the next line: //if($pilot->retired == 1) { continue; } ?> <tr> <td width="6%" nowrap><a href="<?php echo url('/profile/view/'.$pilot->pilotid);?>"> <?php echo PilotData::GetPilotCode($pilot->code, $pilot->pilotid)?></a> </td> <td> <img src="<?php echo Countries::getCountryImage($pilot->location);?>" alt="<?php echo Countries::getCountryName($pilot->location);?>" /> <?php echo $pilot->firstname.' '.$pilot->lastname?> </td> <td><img src="<?php echo $pilot->rankimage?>" alt="<?php echo $pilot->rank;?>" /></td> <td><?php echo $pilot->totalflights?></td> <td><?php echo Util::AddTime($pilot->totalhours, $pilot->transferhours); ?></td> <td><?php if($pilot->retired == '1') {echo '<img src="'.SITE_URL.'/lib/skins/ocean_blue/images/no.png" alt="warning" /> - Retired';} else {echo '<img src="'.SITE_URL.'/lib/skins/ocean_blue/images/yes.png" alt="warning" /> - Active';} ?></td> <?php } ?> </tbody> </table> Quote
MikeTGV Posted February 7, 2015 Author Report Posted February 7, 2015 But there are 3 statuses right ? Active, Inactive and On Leave and they perform differently. The code that you gave me only shows two of them not three. i want is to show when the pilot is on leave as well. 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.