Jump to content

Fspax scoring


tnick74

Recommended Posts

Hello,

i try to work out a scoring system using fspax pireps and this is what i have done so far:

1. created 2 fields in the db table "_pireps", named "bonus" and "penalty"

2. added the following code to the /acars/fspax.php:

$data = array( 'pilotid'=>$pilotid,

'code'=>$code,

'flightnum'=>$flightnum,

'leg'=>$leg,

'depicao'=>$depicao,

'arricao'=>$arricao,

'aircraft'=>$aircraft,

'route' => '',

'flighttime'=>$flighttime,

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

'submitdate'=>'NOW()',

'load'=>$_POST['NbrPassengers'],

'fuelused'=>$fuelused,

'bonus'=>$_POST['BonusPoints'],

'penalty'=>$_POST['PenaltyPoints'],

'score'=>$score,

'source'=>'fspax',

'comment'=>$comment,

'log'=> $log);

So, i suppose in every fspax pirep, the bonus and penalty values should be added. But no...when exporting a pirep, these values are not inserted in the pirep db.

Any help please?

Link to comment
Share on other sites

Guest lorathon

Try adding the following after the FilePIREP portion

$last = PIREPData::getLastReports($pilotid, 1);  // this will get the last pirep (meaning the one just filed above)

$fields = array(
	     'bonus'		=> $_POST['BonusPoints'],
	     'penalty'		=> $_POST['PenaltyPoints']		    
	);

PIREPData::updatePIREPfields($last->pirepid, $fields);

Link to comment
Share on other sites

Guest lorathon

Right after the following

$ret = ACARSData::FilePIREP($pilotid, $data);
if(!$ret)
{
	echo "#Answer# Error - ".PIREPData::$lasterror;
	exit;
}

and before

echo "#Answer# Ok - Saved;";

It is at the bottom of the file.

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