Jump to content

[solved] A code for the number of pilots currently flying?


James142

Recommended Posts

You can assign the count to a variable like

$pilotsflying = count(ACARSData::GetACARSData());

then use an if command to check to see if the count is greater than 0

if($pilotsflying > 0)
  {
     Do Stuff
  }

I'm not so great with php coding, but where do i put the

if($pilotsflying > 0)
  {
     Do Stuff
  }

? I have tried putting the code all over the place but it doesnt work? one way i did it was this way:

<marquee align="left" direction="left" onmouseover="this.stop();" onmouseout="this.start();" behavior="scroll" width="600"></i>There are <?php echo count(ACARSData::GetACARSData());?> if($pilotsflying > 0)
  {
	<i>currently no</i>   }
xacars flights - </i><b>click here to view </b></marquee></

which is wrong as it does not come out There are if($pilotsflying > 0)

{

<i>currently no</i> }

xacars flights - </i><b>click here to view. sorry if this seems like a stupid question:S,

James

Link to comment
Share on other sites

  • Administrators

try something like this


<?php
   $pilotsflying = count(ACARSData::GetACARSData()); 
       echo '<marquee align="left" direction="left" onmouseover="this.stop();" onmouseout="this.start();" behavior="scroll" width="600">';
       if($pilotsflying > 0)
           { echo 'There are '.$pilotsflying.' xacars flights - click <a href="'.SITE_URL.'/index.php/acars">here</a> to view'; }
           else
           { echo 'Welcome to our site'; }
       echo '</marquee>';
?>

Link to comment
Share on other sites

try something like this


<?php
   $pilotsflying = count(ACARSData::GetACARSData()); 
       echo '<marquee align="left" direction="left" onmouseover="this.stop();" onmouseout="this.start();" behavior="scroll" width="600">';
       if($pilotsflying > 0)
           { echo 'There are '.$pilotsflying.' xacars flights - click <a href="'.SITE_URL.'/index.php/acars">here</a> to view'; }
           else
           { echo 'Welcome to our site'; }
       echo '</marquee>';
?>

That is brilliant, thank you so much!!

James

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