Post by Dutch Owen on Jun 30, 2010 17:34:07 GMT -5
I can't modify FSCaptain to transmit different column names because that would break all the other places where it's being used to transmit pireps via the standard FSP interface.
The best solution is to modify the PHP code that's processing the pireps; Remember that the PHP code is not a part of FSCaptain and you can modify it yourself pretty easily.
At some point in your code there's an INSERT statement. Here's the one from the standard FSP distributed code:
In your code, I think that the column names you are inserting are your names. All you need to do to fix this is to insert some statements before the $query= statement to move the contents of the FSCaptain fields to your fields. That will accomplish your translation. If you want, email me the php code that does the insert and I'll put the statements in there for you.
Hope this helps,
Dutch
The best solution is to modify the PHP code that's processing the pireps; Remember that the PHP code is not a part of FSCaptain and you can modify it yourself pretty easily.
At some point in your code there's an INSERT statement. Here's the one from the standard FSP distributed code:
// ALL IS OK REGISTER THE FLIGHT
$query = "INSERT INTO flights(id,datestamp,UserName,CompanyName,PilotName,FlightId,OnlineNetworkNbr,FlightDate,AircraftName,AircraftType,NbrPassengers,CargoWeight,Mtow,StartAircraftWeight,EndAircraftWeight,StartFuelQuantity,EndFuelQuantity,DepartureIcaoName,ArrivalIcaoName,DepartureLocalHour,ArrivalLocalHour,DepartureGmtHour,ArrivalGmtHour,TotalBlockTime,TotalBlockTimeNight,TotalAirbornTime,TotalTimeOnGround,TotalDistance,MaxAltitude,CruiseSpeed,CruiseMachSpeed,CruiseTimeStartSec,CruiseTimeStopSec,CruiseFuelStart,CruiseFuelStop,LandingSpeed,LandingPitch,TouchDownVertSpeedFt,CaptainSentMayday,CrashFlag,FlightResult,PassengersOpinion,PassengersOpinionText,FailureText,CasualtiesText,PilotBonusText,BonusPoints,PilotPenalityText,PenalityPoints) VALUES('',now(),'$_POST[UserName]','$_POST[CompanyName]','$_POST[PilotName]','$_POST[FlightId]','$_POST[OnlineNetworkNbr]','$_POST[FlightDate]','$_POST[AircraftName]','$_POST[AircraftType]','$_POST[NbrPassengers]','$_POST[CargoWeight]','$_POST[Mtow]','$_POST[StartAircraftWeight]','$_POST[EndAircraftWeight]','$_POST[StartFuelQuantity]','$_POST[EndFuelQuantity]','$_POST[DepartureIcaoName]','$_POST[ArrivalIcaoName]','$_POST[DepartureLocalHour]','$_POST[ArrivalLocalHour]','$_POST[DepartureGmtHour]','$_POST[ArrivalGmtHour]','$_POST[TotalBlockTime]','$_POST[TotalBlockTimeNight]','$_POST[TotalAirbornTime]','$_POST[TotalTimeOnGround]','$_POST[TotalDistance]','$_POST[MaxAltitude]','$_POST[CruiseSpeed]','$_POST[CruiseMachSpeed]','$_POST[CruiseTimeStartSec]','$_POST[CruiseTimeStopSec]','$_POST[CruiseFuelStart]','$_POST[CruiseFuelStop]','$_POST[LandingSpeed]','$_POST[LandingPitch]','$_POST[TouchDownVertSpeedFt]','$_POST[CaptainSentMayday]','$_POST[CrashFlag]','$_POST[FlightResult]','$_POST[PassengersOpinion]','$_POST[PassengersOpinionText]','$_POST[FailureText]','$_POST[CasualtiesText]','$_POST[PilotBonusText]','$_POST[BonusPoints]','$_POST[PilotPenalityText]','$_POST[PenalityPoints]')";
In your code, I think that the column names you are inserting are your names. All you need to do to fix this is to insert some statements before the $query= statement to move the contents of the FSCaptain fields to your fields. That will accomplish your translation. If you want, email me the php code that does the insert and I'll put the statements in there for you.
Hope this helps,
Dutch