Jacob Armstrong Posted July 18, 2010 Report Posted July 18, 2010 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. Quote
Tom Posted July 18, 2010 Report Posted July 18, 2010 Is this looking at if a pilot is Active/Inactive? Quote
Jacob Armstrong Posted July 18, 2010 Author Report Posted July 18, 2010 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 Quote
Tom Posted July 18, 2010 Report Posted July 18, 2010 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>'; } ?> Quote
Jacob Armstrong Posted July 18, 2010 Author Report Posted July 18, 2010 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. Quote
Tom Posted July 18, 2010 Report Posted July 18, 2010 Right OK. That code was wrong any way - it's early <?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. 1 Quote
Jacob Armstrong Posted July 18, 2010 Author Report Posted July 18, 2010 Right OK. That code was wrong any way - it's early <?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 Quote
CPC900 Posted July 18, 2010 Report Posted July 18, 2010 Where/what would I edit to add that into the admin menu?! Quote
Jacob Armstrong Posted July 19, 2010 Author Report Posted July 19, 2010 Where/what would I edit to add that into the admin menu?! I don't know about the admin panel. It's very touchy. I tried editing it and messed it up. 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.