Jump to content

Recommended Posts

Posted

Hello,

I have a custom pilot list with a column for status, however I want that column to display active or inactive instead of 1 and 2

<style type="text/css">
<!--
.style2 {color: #CCCCCC}
-->
</style>
<h3><?php echo $title?></h3>
<?php
if(!$allpilots)
{
 echo 'There are no pilots!';
 return;
}
?>
<table width="945" border="0" class="tablesorter" id="tabledlist">
<thead>
<tr>
<th bgcolor="#63003A"><span class="style2">Pilot ID</span></th>
<th width="25%" bgcolor="#63003A"><span class="style2">Name</span></th>
<th width="19%" bgcolor="#63003A"><span class="style2">Rank</span></th>
<th width="22%" bgcolor="#63003A"><span class="style2">Flights</span></th>
<th width="17%" bgcolor="#63003A"><span class="style2">Hours</span></th>
<th width="17%" bgcolor="#63003A"><span class="style2">Status</span></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="7%" nowrap><div align="center"><a href="<?php echo url('/profile/view/'.$pilot->pilotid);?>">
  <?php echo PilotData::GetPilotCode($pilot->code, $pilot->pilotid)?></a></div></td>
<td>
 <div align="center"><img src="<?php echo Countries::getCountryImage($pilot->location);?>"
  alt="<?php echo Countries::getCountryName($pilot->location);?>" />

<?php echo $pilot->firstname.' '.$pilot->lastname?>
  </div></td>
<td><div align="center"><?php echo $pilot->rank;?></div></td>
<td><div align="center"><?php echo $pilot->totalflights?></div></td>
<td><div align="center"><?php echo Util::AddTime($pilot->totalhours, $pilot->transferhours); ?></div></td>
<td><?php echo $pilot->retired?></td>
<?php
}
?>
</tbody>
</table>

Thanks

Guest lorathon
Posted

Change this

<td><?php echo $pilot->retired?></td>

to this

<td><?php if($pilot->retired==0) echo 'ACTIVE'; else echo 'INACTIVE';?></td>

  • 3 months later...
Posted (edited)

Change this

<td><?php echo $pilot->retired?></td>

to this

<td><?php if($pilot->retired==0) echo 'ACTIVE'; else echo 'INACTIVE';?></td>

Thanks, I just got this code, i want to use a image instead of the 1 or 2 or the active/inactive, can you give me a code please?

_______________________________________________________________________________________|

Nevermind :P i just used this

<?php if($pilot->retired==0) echo '<img src="http://qantasvirtual.com/lib/skins/brilliancev1/images/activeman.png"/>'; else echo '<img src="http://qantasvirtual.com/lib/skins/brilliancev1/images/leaveman.png"/>';?>

I know a little on this :P

Edited by SBM0001
  • Like 1

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...