PIREP Status

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?

Thanks lorathon,

I’ll give that a try.

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.

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

Thanks simpilot, I see how they work together for saying at a certain status.

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?

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

Thanks simpilot

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 '

Ok, now I’ll have shame on my self

I better start using the serach feature casue I found one.

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!

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.

1 Like

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.