Jump to content

LOA


Jacob Armstrong

Recommended Posts

I have this code in pilot_list.tpl:

<?php

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

I have a pilot's account set to LOA, but it still shows green Active. Do you know why? Here is my pilot roster; www.virtualamerican.org/index.php/pilots. Thanks.

Link to comment
Share on other sites

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>';
}
?>

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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
Link to comment
Share on other sites

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