php help

Where is the route information stored and how would I recall it?

Routes are in your schedules if thats what you mean?

If you take a look in to the schedule_brief.tpl you can see the code there that calls it.

Routes are in your schedules if thats what you mean?

If you take a look in to the schedule_brief.tpl you can see the code there that calls it.

Yes but i need the total distance of a flight the pilot is flying to be shown on the live flight map (Im making a progress bar and I need the total distance of the flight in order to get the % of the flight completed)

If you get what i mean..

Ah ok great idea, let me have a look, ill get back to you.

OK in that schedule briefing tpl the function in there,

<?php echo "{$schedule->distance}"; ?>

OK in that schedule briefing tpl the function in there,

<?php echo "{$schedule->distance}"; ?>

Still abit confused here, when I put

<?php echo "{$schedule->distance}"; ?>

into the acarsmap.tpl file, nothing shows up, Do I need a function in the acars.php module ?

OK you have to load the schedule number, if your in the acars tpl then you can use the flight, that should work

Or thinking about it if your creating a module use sql to get what you want.

OK you have to load the schedule number, if your in the acars tpl then you can use the flight, that should work

Sorry for my lack of php knowledge but how would I load the schedule number?

Thanks

Ok let me have a play for 5 minutes and ill post the code, Where is it your putting or wanting to show the total distance, is it the acars.tpl

Ok let me have a play for 5 minutes and ill post the code, Where is it your putting or wanting to show the total distance, is it the acars.tpl

Yup in the acars.tpl file.

I do appreciate this

Ok let me have a play for 5 minutes and ill post the code, Where is it your putting or wanting to show the total distance, is it the acars.tpl

Any luck?

Anyone?

Nothing?

sorry forgot all about this, you should be able to use this function

Not tested though. using the existing api this should give you the total miles

<?php echo $route->distance . Config::Get(‘UNITS’);?>

sorry forgot all about this, you should be able to use this function

Not tested though. using the existing api this should give you the total miles

<?php echo $route->distance . Config::Get(‘UNITS’);?>

When I add the code nothing shows up…

Im guessing I need to add something into the ACARSDate.class.php file?

Maybe something like:

public static function getSchedulesByDistance($distance, $type, $onlyenabled=true, $start='', $limit='')
{
	if($type == '')
		$type = '>';

	$params = array('s.distance' => trim($type).' '.$distance);
	if($onlyenabled)
		$params['s.enabled'] = '1';

	return self::findSchedules($params, $limit, $start);
}

But when I add that it gives me an error on the site and kACARS gives me about 10 error messages saying it lost connection to the site.. ..so im not gonna mess around with it myself unless no one is flying

Thanks,

James

…

Bump