Jump to content

Delayed on Time fights done


Ademar Andrade

Recommended Posts

Hi all,

I'm trying to determinate witch flights have been done on time.

The logic is: if the flight time is bigger than the estimated, the result is Delayed, else On time.

So i simple code:

  <?php
			  if ($pirep->flighttime > $schedules->flighttime)
			  {
			  echo "Delayed";
			  }
			  else
			  {
			  echo "On time";
			  }
  ?>

On results, all flights are "Delayed", and it's not truth.

Help guys, what is wrong with my code?

Thanks for attention!

Link to comment
Share on other sites

  • 2 weeks later...

that can be a reason! and I would try to echo

$schedules->flighttime for testing!

since I have the strong feeling that it returns nothing (when it have no return) the PIREP flightime is always greater and jumps directly into the echo "Delayed"

Kyle,

like you said the logical part is correct TESTED! with values

I will try to find out what is wrong tonight

Link to comment
Share on other sites

that can be a reason! and I would try to echo

$schedules->flighttime for testing!

since I have the strong feeling that it returns nothing (when it have no return) the PIREP flightime is always greater and jumps directly into the echo "Delayed"

The code looks fine, but do you have the flight time set in your schedules?

Thank you guys...

Now is working...

Have a nice day!

Link to comment
Share on other sites

On my Site i have both times converted to minutes and then the checks.... I extended the range a bit.... if flighttime more than scheduledtime + 15 then it's delayed

If flighttime less than scheduledtime - 15 it's early and else it's on time.

That works. I can't give the code for it right now as i'm not on my PC but it should be easy to do for you.

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