Jump to content

Recommended Posts

I'm working one of the new features for WorldACARS that pulls aircraft data from the database, displays it, gets processed by WorldACARS then displays it to the user.

For some reason the code I wrote doesn't work:

(It pulls data from url, e.g http://localhost/action.php/wacars/maintence?reg=VH-FTW)

		public function maintence()
		{
				$reg = $_GET['reg'];      		   		
				$aicraft = self::getAircraftInfo($reg);
				echo "$aicraft->totaltime";
		}

		public static function getAircraftInfo($reg)
		{
			$reg = DB::escape($reg);

			return DB::get_row('SELECT * FROM '.TABLE_PREFIX.'aircraft 
								WHERE `registration`='.$reg);
		}

Could someone please tell me whats wrong with it?

Thanks,

Mitch

Link to post
Share on other sites
  • Administrators

You should be using $this->get->reg

Also, you don't need static, you can just call it using $this->getAircraftInfo(). Though you should call the API OperationsData::getAircraftInfo()

Link to post
Share on other sites

I am still getting a blank page...

Does the OperationsData::getAircraftInfo($id) $id mean the registration or the actual aircraft id (1,2,3 etc.). WorldACARS sends the data as the registration of the aircraft and not the numeric ID.

Updated Code:

	
	public function maintence()
		{
				$reg = $this->get->reg;      		   		
				$aircraft = $this->getAircraftInfo($reg);
				echo "$aicraft->totaltime";
		}

Link to post
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...