Jump to content

Recommended Posts

Posted

Is this looking at if a pilot is Active/Inactive?

Sorta. I don't want to use the Active/Inactive that is already in the system because I want a LOA option as well. I've set it up to do it this way with an extra field. So, do you know if it's my coding. I'm new to PHP and don't know if I messed up something. LOL

Posted

So you added LOA to the Active/Inactive select in the admin panel?

Have you set it up to be recording another value? For active: retired=0, inactive: retired=1 - so you'll need to modify the form to add retired=2 or something.

Alternatively, you can just call Inactive "LOA" on you pilots list, in which case (assuming the way you're retrieving pilot data is correct because I don't remember it off the top of my head):

<?php

if (PilotData::GetFieldValue($pilot->retired) == 1){
echo '<td style="color: orange;">LOA</td>';
}else {
echo '<td style="color: green;">Active</td>';
}
?>

Posted

So you added LOA to the Active/Inactive select in the admin panel?

Have you set it up to be recording another value? For active: retired=0, inactive: retired=1 - so you'll need to modify the form to add retired=2 or something.

Alternatively, you can just call Inactive "LOA" on you pilots list, in which case (assuming the way you're retrieving pilot data is correct because I don't remember it off the top of my head):

<?php

if (PilotData::GetFieldValue($pilot->retired) == 1){
echo '<td style="color: orange;">LOA</td>';
}else {
echo '<td style="color: green;">Active</td>';
}
?>

No. I didn't add it to the Active/Inactive part already made in the system, I made a custom field called LOA. I would put LOA or Active in it.

Posted

Right OK. That code was wrong any way - it's early :P

<?php

if (PilotData::GetFieldValue($pilot->pilotid, 'LOA') == "LOA"){
echo '<td style="color: orange;">LOA</td>';
}else {
echo '<td style="color: green;">Active</td>';
}
?>

Hopefully should work. Just a ")" in the wrong place.

  • Like 1
Posted

Right OK. That code was wrong any way - it's early :P

<?php

if (PilotData::GetFieldValue($pilot->pilotid, 'LOA') == "LOA"){
echo '<td style="color: orange;">LOA</td>';
}else {
echo '<td style="color: green;">Active</td>';
}
?>

Hopefully should work. Just a ")" in the wrong place.

Thanks you very much, sir!

+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...