T function explained


#1

Good day,
I have the following code, but get the following error:

Parse error: syntax error, unexpected T_VARIABLE in /home/jdsarcco/public_html/uvsaaf/core/modules/Aircraft_Condition/Aircraft_Condition.php on line 35

here is the code:

[code]<?php
/**

class Aircraft_Condition extends CodonModule
// Register our module to listen for events
{
public function __index()
{
CodonEvent::addListener(‘Aircraft_Condition’);
}

// Example:
public function EventListener($eventinfo)
		{
		 if($eventinfo[0] == 'pirep_filed'
  
		//Retrieve the aircraft info based on the aircraft id stored in the pirep row
		
		$aircraft = OperationsData::getAircraftInfo($pirepinfo->aircraftid);
		}

		//Figure out the $cond that needs to be placed into the 
		//if($pirepinfo->landingrate > -200 && $pirepinfo->landingrate <-500)
			//$cond = $aircraft->cond -20;
			  


		//update the 'cond' column using the aircraft id for row identification
		//$update = OperationsData::editAircraft(array('id'=>$pirepinfo->aircraftid, 'cond'=>$cond));
		//}

}[/code]

Can someone point out my mistake, and pehaps explain briefly waht the T - function and T variables mean?

Best regards,

Jakes


#2

Sorry, incorrect code above ( cannot find the edit function in this forum

[php]<?php
/**

class Aircraft_Condition extends CodonModule
// Register our module to listen for events
{
public function __index()
{
CodonEvent::addListener(‘Aircraft_Condition’);
}

// Example:
public function EventListener($eventinfo)
		{
		 if($eventinfo[0] == 'pirep_filed'
  
		//Retrieve the aircraft info based on the aircraft id stored in the pirep row
		
		$aircraft = OperationsData::getAircraftInfo($pirepinfo->aircraftid);
		}

		//Figure out the $cond that needs to be placed into the 
		if($pirepinfo->landingrate > -200 && $pirepinfo->landingrate <-500)
			$cond = $aircraft->cond -20;
			  


		//update the 'cond' column using the aircraft id for row identification
		$update = OperationsData::editAircraft(array('id'=>$pirepinfo->aircraftid, 'cond'=>$cond));
		}

}[/php]


#3
hello Jakes, your doing syntax error. replace your code with below code (modify by me) [php] <?php class Aircraft_Condition extends CodonModule { // Register our module to listen for events public function __index() { CodonEvent::addListener('Aircraft_Condition'); } // Example: public function EventListener($eventinfo) { if($eventinfo[0] == 'pirep_filed') { //Retrieve the aircraft info based on the aircraft id stored in the pirep row $aircraft = OperationsData::getAircraftInfo($pirepinfo->aircraftid); } //Figure out the $cond that needs to be placed into the if($pirepinfo->landingrate > -200 && $pirepinfo->landingrate <-500) $cond = $aircraft->cond -20;
	//update the 'cond' column using the aircraft id for row identification
	$update = OperationsData::editAircraft(array('id'=>$pirepinfo->aircraftid, 'cond'=>$cond));
}

}
?>
[/php]
I hope this will helpful for you…
Reply your feedback
SR


#4

Thank you very much, really appreciate it!


#5
Hello Jakes, I hope your issues finally resolve. Post other issues Enjoy... :) :D ~~SR~~