Jump to content

Recommended Posts

  • Moderators
Posted

I have just been looking at how the pirep log is displayed,

     <?php
     # Simple, each line of the log ends with *
     # Just explode and loop.
     $log = explode('*', $pirep->log);
     foreach($log as $line)
     {
        echo $line .'<br />';
     }
     ?>

If it possible to style based on an event, for example

If the log contains Stall format that text in Red Bold for example, or if it contains a landing rate < -500 that is also formatted, im just trying to get some ideas on how to format the output based on different events and even if it is possible.

Thanks.

  • Administrators
Posted

You could do some conditional statements, it would probably get a little lengthy in order to cover everything and every type of ACARS system but maybe something like this for the TOD event;

[22:54] - TOD reached

<?php      
# Simple, each line of the log ends with *      
# Just explode and loop.
     $log = explode('*', $pirep->log);
     foreach($log as $line)      
     {         
       $line_items = explode('-', $line);
       {
          if($line_items['1'] == 'TOD reached')
          {echo '<font color="#00FF00">'.$line.'</font><br />';}
          else
          { echo $line .'<br />';}
       }
     } 
?>

  • Moderators
Posted

Dave i have tried many permutations but no still not making any difference, just to check i changed the else to another colour just to make sure it would and that's fine.

Just seems to be the conditions its not picking up.

  • Moderators
Posted

I dont mean to harp on about this but has anyone else tried, I cant get the if statement to change the display colour, just wondered if any one else has managed to get it to work?

Cheers.

  • 1 month later...
  • 1 year later...
Posted

In kaCARS free dont work because in the kacars free log not have the - in the log

[14:45] TOD Reached

what is the code for the log kacars free? I tried this but does not work

<?php	
# Simple, each line of the log ends with *	   
# Just explode and loop.
	  $log = explode('*', $pirep->log);
	  foreach($log as $line)		 
	  {			 
		    $line_items = explode(' ', $line);
		    {
			   if($line_items['1'] == 'TOD reached')
			   {echo '<font color="#00FF00">'.$line.'</font><br />';}
			   else
			   { echo $line .'<br />';}
		    }
	  }
?>

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