Jump to content

Recommended Posts

Posted

Hello

We have an error with the pireps and FSACARS.

When a pilot sent a pirep from FSACARS, he uses the SEND LOG button. After he clicked on this button, he has this message : Log sent !

After that, I receive an e-mail :

A PIREP has been submitted by FSW004

FSW0004: TNCM to SOCA

Aircraft: 3, Flight Time: 2.15

File using: fsacars

All seems to be ok, but I don't have the pirep in phpVMS. No pirep in the database, no pirep in the admin panel, no pirep in all the system !

I just have the e-mail, but I don't have the pirep.

I am currently using the last version of phpVMS : 2.0.796

What can I do to solve this error ?

Thanks

Stéphane

Posted

Still didnt work for me, Database error, this started just after 795 was run, Now ive updated and it still doesnt work plus i am getting more Access Denied errors.

  • Administrators
Posted

Database error means FSACARS is backed up, so there's a PIREP there waiting for export. The permissions, you can fix, just set those to 777

Posted

Ok Nabeel, but its not allowing us to export us to the database,

Pic 1, saying connection ok:

screen1.jpg

Pic 2, saying it failed to connect:

screen2.jpg

Does that make any sense to you because its got me and also the rest of the VA Confused lol :P

In the log.txt:

SELECT a.name AS aircraft, COUNT(p.aircraft) AS count, SUM(p.flighttime) AS hours,
    FROM phpvms_pireps p, phpvms_aircraft a 
    WHERE p.aircraft = a.id AND pilotid=12
    GROUP BY a.name
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'FROM phpvms_pireps p, phpvms_aircraft a 
    WHERE p.aircraft = a.id AND pilotid' at line 2

Posted

Nabeel, We as a VA are filling approx 20 pireps a day and we are all having the same issue, since the last couple of updates. when you exported the file did you export to ours or your own ? Thanks in advance

Simon

  • Administrators
Posted

To my own.

I'm wondering what might have changed. Let me try something. I'll have an update tonight. There are no errors in the logs though? Weird

  • Administrators
Posted

Can you guys try this:

Open /core/modules/acars/fspax.php

After line 171, add:

'landingrate'=>$_POST['TouchDownVertSpeedFt'],

So it's:

'flighttime'=>$flighttime,
					'landingrate'=>$_POST['TouchDownVertSpeedFt'],
					'submitdate'=>'NOW()',

Posted

Ok first of all nabeel, my fspax file looks completely different from that,

Line 170: 'aircraft'=>$aircraft,

Line 171:      'flighttime'=>$flighttime,

Line 172: 'submitdate'=>'NOW()',

Shall i still add that line?

Posted

This is the full config fspax.php...

<?php
/**
* phpVMS - Virtual Airline Administration Software
* Copyright (c) 2008 Nabeel Shahzad
* For more information, visit www.phpvms.net
*	Forums: http://www.phpvms.net/forum
*	Documentation: http://www.phpvms.net/docs
*
* phpVMS is licenced under the following license:
*   Creative Commons Attribution Non-commercial Share Alike (by-nc-sa)
*   View license.txt in the root, or visit http://creativecommons.org/licenses/by-nc-sa/3.0/
*
* @author Nabeel Shahzad
* @copyright Copyright (c) 2008, Nabeel Shahzad
* @link http://www.phpvms.net
* @license http://creativecommons.org/licenses/by-nc-sa/3.0/
*/

/*  FSPassengers, Copyright © Daniel Polli
http://www.fspassengers.com
*/

writedebug("FSPAX DEBUG");
//writedebug($_SERVER['QUERY_STRING']);
writedebug(print_r($_POST, true));


# Check for connection
if($_POST['FsPAskConnexion'] == 'yes')
{
	# Validate pilot:
	$_POST['UserName'] = DB::escape($_POST['UserName']);

	# Entered as ###
	if(is_numeric($_POST['UserName']))
	{
		$pilotid = intval(intval(trim( $_POST['UserName']))) - Config::Get('PILOTID_OFFSET');
	}
	else
	{
		# Check if they entered as XXX###
		if(preg_match('/^([A-Za-z]*)(.*)(d*)/', $_POST['UserName'], $matches)>0)
		{
			$pilotid = intval(intval(trim($matches[2]))) - Config::Get('PILOTID_OFFSET');
		}
		else
		{
			# Invalid Pilot
			echo '#Answer# Error - Invalid pilot ID format;';
			return;
		}
	}

	$pilotdata = PilotData::GetPilotData($pilotid);
	if(!$pilotdata)
	{
		echo '#Answer# Error - Username don't exist or wrong password;';
		return;
	}

	# Give it what it wants
	# Derive the config from the main config settings
	echo "#Answer# Ok - connected;";
	echo 'Weight='.Config::Get('WeightUnit').' Dist='.Config::Get('DistanceUnit').' Speed='.Config::Get('SpeedUnit').' Alt='.Config::Get('AltUnit').' Liqu='.Config::Get('LiquidUnit');
	echo '#welcome#'.Config::Get('WelcomeMessage').'#endwelcome#';
}


if($_POST['FsPAskToRegister'] == 'yes')
{
	$comment = '';

	# Get the pilot id:

	if(is_numeric($_POST['UserName']))
	{
		$pilotid = intval(intval(trim( $_POST['UserName']))) - Config::Get('PILOTID_OFFSET');
	}
	else
	{
		if(preg_match('/^([A-Za-z]*)(d*)/', $_POST['UserName'], $matches) == 0)
		{
			echo "#Answer# Error: Pilot doesn't exist ;";
			return;
		}

		$pilotid = intval(intval(trim($matches[2]))) - Config::Get('PILOTID_OFFSET');
	}

	# Get the flight ID
	$flightinfo = SchedulesData::getProperFlightNum($_POST['FlightId']);
	$code = $flightinfo['code'];
	$flightnum = $flightinfo['flightnum'];
	/*if(preg_match('/^([A-Za-z]*)(d*)/', $_POST['FlightId'], $matches) == 0)
	{
		echo "#Answer# Error - Invalid flight ID;";
		return;
	}*/


	preg_match('/^([A-Za-z]*) - .*/', $_POST['DepartureIcaoName'], $aptinfo);
	$depicao = $aptinfo[1];

	# Make sure it exists
	if(!OperationsData::GetAirportInfo($depicao))
	{
		OperationsData::RetrieveAirportInfo($depicao);
	}

	preg_match('/^([A-Za-z]*) - .*/', $_POST['ArrivalIcaoName'], $aptinfo);
	$arricao = $aptinfo[1];

	# Make sure it exists
	if(!OperationsData::GetAirportInfo($arricao))
	{
		OperationsData::RetrieveAirportInfo($arricao);
	}

	//if($code == '')
	//{
		# Find a flight using just the flight code
		$sched = SchedulesData::FindFlight($matches[2]);

		# Can't do it. They completely screwed this up
		if(!$sched)
		{
			return;
		}

		$code = $sched->code;
		$flightnum = $sched->flightnum;
		$leg = $sched->leg;
		$aircraft = $sched->aircraft;
		/*$depicao = $sched->depicao;
		$arricao = $sched->arricao;*/

		if($depicao != $sched->depicao || $arricao != $sched->arricao)
		{
			$comment = 'phpVMS Message: Arrival or Departure does not match schedule. ';
		}
	//}

	# Get the time, don't care about seconds
	preg_match('/^(d*):(d*):(d*)/', $_POST['TotalBlockTime'], $time);
	$flighttime = $time[1].'.'.$time[2];

	# Get the fuel used
	$fuelused = floatval($_POST['StartFuelQuantity']) - floatval($_POST['EndFuelQuantity']);

	# Form the log:
	$log = '';
	foreach($_POST as $name=>$value)
	{
		if($name == 'FsPAskToRegister' || $name == 'UserName' || $name == 'Password')
		{
			continue;
		}

		$log .= "$name=$value<br />".PHP_EOL;
	}

	$comment .= 'FSPassengers Flight. No aircraft entered';

	$data = array(	'pilotid'=>$pilotid,
					'code'=>$code,
					'flightnum'=>$flightnum,
					'leg'=>$leg,
					'depicao'=>$depicao,
					'arricao'=>$arricao,
					'aircraft'=>$aircraft,
					'flighttime'=>$flighttime,
					'submitdate'=>'NOW()',
					'load'=>$_POST['NbrPassengers'],
					'fuelused'=>$fuelused,
					'source'=>'fspax',
					'comment'=>$comment,
					'log'=> $log);

	writedebug($data);

	$ret = ACARSData::FilePIREP($pilotid, $data);	

	echo "#Answer# Ok - Saved;";
}

  • Administrators
Posted

Yeah, add it after line 171, so then it will look like that 2nd bit I posted.

On all ACARS? What version are you using?

I'm flying on FSFK right now, and it seems to be working (they all use one interface)

Posted

Addded the line, still no luck, still same error however new things in the core/logs/log.txt file:

You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'FROM phpvms_pireps p, phpvms_aircraft a 
			WHERE p.aircraft = a.id AND pilotid' at line 2
SELECT a.name AS aircraft, COUNT(p.aircraft) AS count, SUM(p.flighttime) AS hours,
			FROM phpvms_pireps p, phpvms_aircraft a 
			WHERE p.aircraft = a.id AND pilotid=12
			GROUP BY a.name
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'FROM phpvms_pireps p, phpvms_aircraft a 
			WHERE p.aircraft = a.id AND pilotid' at line 2

  • Administrators
Posted

Nothing in ACARS? I fixed that error. Let me trying doing a commit which fixed that, let's see if it helped.

Which update did it start with? Do you remember? Did you run the update.php, I added a column to the PIREP table, do you have a landingstats column there?

  • Administrators
Posted

Commit is up right now, give it a shot.

Also, there's nothing in the acars.txt? What about in the modules/acars/log.txt (in case it wrote in there, it shouldn't have, but maybe it did?)

  • Moderators
Posted

Yeah, add it after line 171, so then it will look like that 2nd bit I posted.

On all ACARS? What version are you using?

I'm flying on FSFK right now, and it seems to be working (they all use one interface)

i want it gimegimegime ;D ;D ;D ;D

Posted

Yes theres landingrate, could i remove it and see if it works?

Also, our providers doesnt use localhost, would that maybe cause a problem?

We use: 10.21.47.198

Thomas.

  • Administrators
Posted

That's supposed to be there,  I thought that not being there was the source of the problem, but since it's there, that's fine.

Don't use localhost for what?

Empty the modules log.txt as well, and then try filling. This is a weird error.

Does xacars work, ACARS wise and PIREP wise?

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