Jump to content

Custom pirep display


Vangelis

Recommended Posts

  • Members

Hello boys and girls

I have a question regarding our new virtual airline

we where using fsairliners and we decided to swith to phpvms

and for that reason i am migrating the look of fsairliners to phpvms at some point everything is ok

Pireps are showin in a nice table the pirep details are linkable but i have a small problem with the log i managed to explode the log file by modifing the fspax module with a custon char but in the log at the end by the comments of fspax an n i shown in front of the text

example

Flight Critique -Are angry because they didn't reach their destination (flight too short).

n<----

You made a very smooth landing. (+50)

n<---You landed at the scheduled airport. (+30)

n<---

Your arrived too early at your destination airport.(13h56:24 difference) (-100)

n<---

Here are the links to the tables so you can have a visual idea of what i am talking about

Main Table

http://www.gsairways...atestpireps.php

Pirep Detail

http://www.gsairways...etail.php?ID=19

and this is the code of my query

<?php
require 'dbcon.php';	
$result1 = mysql_query("SELECT
`phpvms_pireps`.`pirepid`
 , `phpvms_pilots`.`lastname`
, `phpvms_pilots`.`firstname`
, `phpvms_pireps`.`fuelused`
, `phpvms_aircraft`.`name`
 , `phpvms_aircraft`.`registration`
, `phpvms_pireps`.`fuelprice`
, `phpvms_pireps`.`revenue`
, `phpvms_pireps`.`log`
FROM
`gsairway_vms`.`phpvms_pireps`
 INNER JOIN `gsairway_vms`.`phpvms_pilots`
 ON (`phpvms_pireps`.`pilotid` = `phpvms_pilots`.`pilotid`)
INNER JOIN `gsairway_vms`.`phpvms_aircraft`
 ON (`phpvms_aircraft`.`id` = `phpvms_pireps`.`aircraft`)WHERE phpvms_pireps.pirepid='$_GET[iD]';");
if (!$result1) {
echo 'Could not run query: ' . mysql_error();
exit;
}
$row1 = mysql_fetch_object($result1);


$splitlog = explode("$$", $row1->log);
for($i = 0; $i < count($splitlog); $i++)


		 $result = mysql_query("SELECT * FROM phpvms_pireps WHERE pirepid = '$_GET[iD]'");
if (!$result) {
echo 'Could not run query: ' . mysql_error();
exit;
}
$row = mysql_fetch_object($result);
mysql_close($link);
?>

so my question is how do i get rid of the n ?

Thank you in advance

Link to comment
Share on other sites

  • Moderators

Here is the fspax config file. Sorry, I'm unable to give you the DB PIREPS table with the modification since my older website is long gone and I could give you this file from the last back up of my older website but I think you can figure it our, no big deal. Also, I can tag along and help you set it up. ;)

fspax.zip

Link to comment
Share on other sites

  • Members

Thank you for the file i will figure out the db fields from the script

I will give it a go 2night and will post the results also 1 idea came up to explode the array field by using the n as identifier i will try that asswel and report back .

Thank again for your help

Link to comment
Share on other sites

  • Members

So i made the changes and i altered the db table but it seems that all the data goes into the log cell

Here is a screen shot of the db table phpvms_pilots

http://www.baggelis.com/printscreen.bmp

and a raw data of the log cell

CompanyName=Greek Scouts Airways<br />nPilotName=Vangelis Boulasikis<br />nFlightId=GSA185<br />nOnlineNetworkNbr=0<br />nFlightDate=2012-12-09<br />nAircraftName=iFly 737-800 (Wide screen)<br />nAircraftType=MEJ<br />nNbrPassengers=118<br />nCargoWeight=0 kg<br />nMtow=78244 kg<br />nStartAircraftWeight=60681 kg<br />nEndAircraftWeight=53280 kg<br />nStartFuelQuantity=10446 kg<br />nEndFuelQuantity=2970 kg<br />nDepartureIcaoName=LGKV - Megas Alexandros Intl - Greece<br />nArrivalIcaoName=LGTS - Makedonia - Greece<br />nDepartureLocalHour=20:36<br />nArrivalLocalHour=21:30<br />nDepartureGmtHour=19:36:00<br />nArrivalGmtHour=20:31:00<br />nTotalBlockTime=00:55:05<br />nTotalBlockTimeNight=00:55:05<br />nTotalAirbornTime=00:48:26<br />nTotalTimeOnGround=00:11:51<br />nTotalDistance=78 Nm<br />nMaxAltitude=12260ft<br />nCruiseSpeed=307 kt<br />nCruiseMachSpeed=0.48<br />nCruiseTimeStartSec=330<br />nCruiseTimeStopSec=968<br />nCruiseFuelStart=5277 kg<br />nCruiseFuelStop=4851 kg<br />nLandingSpeed=122 kt<br />nLandingPitch=5.66<br />nTouchDownVertSpeedFt=-526.92<br />nCaptainSentMayday=0<br />nCrashFlag=0<br />nFlightResult=Perfect<br />nPassengersOpinion=100<br />nPassengersOpinionText=-Are relieved to have landed safely after the extreme weather they experienced during landing.<br>n-Wonder if they landed or if they crashed (hard landing).<br>n<br />nFailureText=<br />nCasualtiesText=<br />nPilotBonusText=Perfect Flight, no problems and very satisfied passengers. (+150)<br>nYou landed at the scheduled airport. (+30)<br>nExtreme weather conditions during approach, but a safe landing and satisfied passengers. (+100)<br>n<br />nBonusPoints=280<br />nPilotPenalityText=Flight regulations require that you have sufficient fuel reserves upon landing (45 mn); you only had reserves for 00h19 of flight. (-300)<br>n<br />nPenalityPoints=300<br />nBitsPenalityDisabled=0<br />n

Link to comment
Share on other sites

So i made the changes and i altered the db table but it seems that all the data goes into the log cell

Here is a screen shot of the db table phpvms_pilots

http://www.baggelis....printscreen.bmp

and a raw data of the log cell

CompanyName=Greek Scouts Airways<br />nPilotName=Vangelis Boulasikis<br />nFlightId=GSA185<br />nOnlineNetworkNbr=0<br />nFlightDate=2012-12-09<br />nAircraftName=iFly 737-800 (Wide screen)<br />nAircraftType=MEJ<br />nNbrPassengers=118<br />nCargoWeight=0 kg<br />nMtow=78244 kg<br />nStartAircraftWeight=60681 kg<br />nEndAircraftWeight=53280 kg<br />nStartFuelQuantity=10446 kg<br />nEndFuelQuantity=2970 kg<br />nDepartureIcaoName=LGKV - Megas Alexandros Intl - Greece<br />nArrivalIcaoName=LGTS - Makedonia - Greece<br />nDepartureLocalHour=20:36<br />nArrivalLocalHour=21:30<br />nDepartureGmtHour=19:36:00<br />nArrivalGmtHour=20:31:00<br />nTotalBlockTime=00:55:05<br />nTotalBlockTimeNight=00:55:05<br />nTotalAirbornTime=00:48:26<br />nTotalTimeOnGround=00:11:51<br />nTotalDistance=78 Nm<br />nMaxAltitude=12260ft<br />nCruiseSpeed=307 kt<br />nCruiseMachSpeed=0.48<br />nCruiseTimeStartSec=330<br />nCruiseTimeStopSec=968<br />nCruiseFuelStart=5277 kg<br />nCruiseFuelStop=4851 kg<br />nLandingSpeed=122 kt<br />nLandingPitch=5.66<br />nTouchDownVertSpeedFt=-526.92<br />nCaptainSentMayday=0<br />nCrashFlag=0<br />nFlightResult=Perfect<br />nPassengersOpinion=100<br />nPassengersOpinionText=-Are relieved to have landed safely after the extreme weather they experienced during landing.<br>n-Wonder if they landed or if they crashed (hard landing).<br>n<br />nFailureText=<br />nCasualtiesText=<br />nPilotBonusText=Perfect Flight, no problems and very satisfied passengers. (+150)<br>nYou landed at the scheduled airport. (+30)<br>nExtreme weather conditions during approach, but a safe landing and satisfied passengers. (+100)<br>n<br />nBonusPoints=280<br />nPilotPenalityText=Flight regulations require that you have sufficient fuel reserves upon landing (45 mn); you only had reserves for 00h19 of flight. (-300)<br>n<br />nPenalityPoints=300<br />nBitsPenalityDisabled=0<br />n

So now you need to get each value one by one and show it in a table. :)

Link to comment
Share on other sites

  • 3 years later...

Ok guys i need your help once again

In fspax.php file should i change this

'pilotpenaltytext'=>$_POST['PilotPenalityText'],);

to this

'pilotpenaltytext'=>$npilotpenaltytext['PilotPenalityText'],);

or this

'pilotpenaltytext'=>$npilotpenaltytext,);

or leave it as is and just create the db entries ?

($npilotpenaltytext is the created db entry )

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