Jump to content

Recommended Posts

  • Moderators
Posted

Hey guys, I'm trying to firgutre out what the code is of the status of the PIREP.

here's my code

$pirep->status";

Is it wrong or what?

I want to display the stats of the PIREP, like rejected or approved. How can I do that?

  • Moderators
Posted

ok, so. It seems to work, but Still not sure what to do like disply the status like for ex)

If it's still pending, I want to say Pending

If it's apprvoed, I want to say Approved

How are they worked in a way to know the number to say the status of the PIREP?

P.S. sorry for being little annoying. I'm starting to trasit into php after times of skinning.

  • Moderators
Posted

Umm, seems it does not work as it is supoosed to be. Ok I'll explain what I am doing

I'm creating a Recent PIREPS and I'm trying to get the status in order to what it says, here's it is the code how it is right now......

echo "<td align=center> $pirep->status == 0){echo 'Pending';} elseif($pirep->status == 1){echo 'Approved';} else {echo 'Rejected';} </td>";

So if the PIREP is still pending, I want it to say Pending, ETC.....

But It's still showing the

if($pirep->status == 0){echo 'Pending';}
elseif($pirep->status == 1){echo 'Approved';}
else {echo 'Rejected';}

on the recent PIREP status, is there something I'm missing to display the correct thing?

  • Administrators
Posted
echo '<td align=center>';
if($pirep->status == 0){echo 'Pending';}
elseif($pirep->status == 1){echo 'Approved';}
else {echo 'Rejected';}
echo '</td>';

  • Like 1
  • 4 weeks later...
  • Moderators
Posted

Ok, I'm bring this topic back up, it never worked.

So, here's my code......

foreach ($pireps as $pirep)
 {
   $pilotinfo = PilotData::getPilotData($pirep->pilotid);
   $pilotid = PilotData::getPilotCode($pilotinfo->code, $pilotinfo->pilotid); 

   echo "<tr>";
   echo "<td align=center> $pirep->code $pirep->flightnum </td>";
   echo "<td align=center> $pilotid $pilotinfo->firstname $pilotinfo->lastname </td>";
   echo "<td align=center> $pirep->depicao </td>";
   echo "<td align=center> $pirep->arricao </td>";
   echo "<td align=center> $pirep->aircraft </td>";
   echo "<td align=center> if($pirep->status == 0){echo 'Pending';}
   							elseif($pirep->status == 1){echo 'Approved';}
								else {echo 'Rejected';}
echo '</td>";

 }
}

Now I'm not sure, why it's showing like that in the status colum.

if( == 0){echo 'Pending';} elseif( == 1){echo 'Approved';} else {echo 'Rejected';} echo '

  • Moderators
Posted

Opening it up again,

I got one problem.........

I want to add the DIV style tag to the code I pasted below, it'll keep giving me parse error.......

if($pirep->accepted == 0) { $status = "<div class="Pending CSS">Pending</div>"; }
   else if($pirep->accepted == 1) { $status = "Accepted"; }
   else { $status = "Denied"; }




Any help please thanks!

  • Moderators
Posted

Someting like this?

<td align="center">
     <?php

     if($report->accepted == PIREP_ACCEPTED)
        echo '<div id="success">Accepted</div>';
     elseif($report->accepted == PIREP_REJECTED)
        echo '<div id="error">Rejected</div>';
     elseif($report->accepted == PIREP_PENDING)
        echo '<div id="pending">Pending</div>';
     elseif($report->accepted == PIREP_INPROGRESS)
        echo '<div id="error">Flight in Progress</div>';

     ?>
  </td>

This is what i use.

  • Like 1
  • Moderators
Posted

Yeah I tried that too. I'll repost my code here again so you can see what the heck it's like.

Here's a piece of it.......

<?php

if(count($pireps) > 0)
{
 foreach ($pireps as $pirep)
 {
   $pilotinfo = PilotData::getPilotData($pirep->pilotid);
   $pilotid = PilotData::getPilotCode($pilotinfo->code, $pilotinfo->pilotid); 
   if($pirep->accepted == 0) { $status = "PENDING"; }
   else if($pirep->accepted == 1) { $status = "APPROVED"; }
   else { $status = "REJECTED"; }

   echo "<tr>";
   echo "<td>'.$pirep->code.$pirep->flighnum.'</td>";
   echo "<td>'.$pirep->depicao.'</td>";
   echo "<td>'.$pirep->arricao.'</td>";
   echo "<td>'.$pirep->aircraft.'</td>";
   echo "<td>'.$pirep->flighttime.'</td>";
   echo "<td>'.$pilotid.' '.$pilotinfo->firstname.' '.$pilotinfo->lastname.'</td>";
   echo "<td>'.$pirep->flighttype.'</th>";
   echo "<td>'.$status.'</td>";
   echo "</tr>";
 }
}
else
{

Thanks for your help again. :D

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.

×
×
  • Create New...