Jump to content

Recommended Posts

Guest lorathon
Posted
$res = @unserialize($pirep->rawdata);

if (is_array($pirep->rawdata['points']))
{	
    foreach($pirep->rawdata['points'] as $point)
    {
		$altitude = $point['alt'];
		$groudspeed = $point['gs'];
	}
}

 

Hope this helps.

  • 3 weeks later...
Posted

Hello 

works but instead of appearing the altitude appears  the numbers  of points

'0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '3', '9', '11', '9', '5', '141', '241', '244', '244', '246', '246', '246', '246', '244', '246', '246', '244', '241', '237', '229', '103', '93', '73', '25', '5', '9', '0', '0', '0', '0', '0',

 

 
Guest lorathon
Posted

The code I wrote does not echo anything.  So you will need to place your code here so that I can see it and determine what the issue is.

Posted

<script type="text/javascript">

Highcharts.chart('container', {
    chart: {
        type: 'line'
    },
    title: {
        text: 'Altitude'
    },
  
    xAxis: {
        categories: [<?php $res = @unserialize($pirep->rawdata);
               if (is_array($pirep->rawdata["points"])){    
               foreach
               ($pirep->rawdata['points'] as $point)
               {
               ?>
               '<?php echo $altitude = $point['alt'] ?>',
<?php        
}
}?>]
    },
    yAxis: {
        title: {
            text: 'Altitude'
        }
    },
    plotOptions: {
        line: {
            dataLabels: {
                enabled: true
            },
            enableMouseTracking: false
        }
    },
    series: [{
        name: 'Altitude',
        data: [<?php $res = @unserialize($pirep->rawdata);
               if (is_array($pirep->rawdata["points"])){    
               foreach
               ($pirep->rawdata['points'] as $point)
               {
               ?>
               '<?php echo $altitude = $point['alt'] ?>',
<?php        
}
}?>]
    }]
});
        </script>

Guest lorathon
Posted

You have

<?php echo $altitude = $point['alt'] ?>

 

Try

<?php echo floatval($point['alt']) ?>

 

  • 3 months later...
Guest lorathon
Posted

This only works for a custom kACARS.  If you do not have this then there will not be anything in the rawdata field.

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