Jump to content

PIREPS errors


stephanepa38

Recommended Posts

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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

But how couldnt this work, it was downloaded AFTER the latest update beta?

Link:

http://pulseair.co.uk/PLS_config.cfg

Contains:

menu_name=Pulse Air :: Welcome To Our Website!;
base_url=http://members.pulseair.co.uk; 
path_stats=index.php/acars;  		
path_export=action.php/acars/fspax;	
username=PLS0001;		
password=none; 

Thomas.

Link to comment
Share on other sites

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;";
}

Link to comment
Share on other sites

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

Link to comment
Share on other sites

  • Administrators

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?

Link to comment
Share on other sites

  • Moderators

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

Link to comment
Share on other sites

  • Administrators

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?

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