FsPassengers Forums
ASP import for VA - Printable Version

+- FsPassengers Forums (http://www.fspassengers.com/forum)
+-- Forum: FsPassengers (http://www.fspassengers.com/forum/forumdisplay.php?fid=3)
+--- Forum: FsPassengers General (http://www.fspassengers.com/forum/forumdisplay.php?fid=4)
+--- Thread: ASP import for VA (/showthread.php?tid=977)

Pages: 1 2


ASP import for VA - lchristianes - 07-09-2005

Hi everyone!
Since I don't understand (or even like) PHP too much, I was thinking about developing an ASP interface for VA import, so there would be
much more possibilities for people to develop virtual airline sites, and import their flights into it without many problems.
Is there anything that would make things impossible, I mean, any incompatibility?
I'm also an experienced programmer, and I have a good level of ASP knowledge. Of course, I would donate the interface program to
FsP... Gift




Re: ASP import for VA - DanSteph - 08-09-2005

Hello,

there is NO problem at all doing so, if you need some help on the exact data that are exported let me know.

Here's is a short explaination:

FsP export the data in a POST form exactly as a form would do so you only need a page
that catch those post data.

It work roughly like that:

FsP first call the page "import page" with the following POST data:

FsPAskConnexion=Yes
UserName=a username registered in the database
Password=the password of the username


The import page must reply writting a page with text as follow:

#Answer# Ok - connected;Weight=Kg Dist=Nm Speed=Knots Alt=Feet Liqu=Kg #welcome#Welcome to my Va#endwelcome#

As you see it answer "Answer Ok" if the user exist in the database and the page send also the wanted unit that this VA want, at the end it
send also the welcome message that should be displayed in the dialog box of FsPassengers.

If the user doesn't exist or there is another problem the page must answer with such message for example
"#Answer# Error - Username don't exist or wrong password;"

Now FsP will call the page again with a lot of post data (I can give you the exact list below is only a short excerpt)
the page just need to check username, password, check again that the user exist that this flight wasn't recorded already
and record those data in the database.

FsPAskToRegister=Yes
UserName=a username registered in the database
Password=the password of the username
id=
datestamp=
CompanyName=
PilotName=
FlightId=
OnlineNetworkNbr=
FlightDate=
AircraftName=
AircraftType=
....etc etc


I can help you giving all the exact information you need, even if you don't like PHP the import script is pretty straight
with only a few line.

Hope this help a bit ?

Dan




Re: ASP import for VA - Captain Binkles - 08-09-2005

Dan is it possible to import the finance - ie how much the flight made? Or not?




Re: ASP import for VA - DanSteph - 08-09-2005

financial are not exported because each user can fly with different setting: income multiplier etc etc
this render the financial part inconsistent beetween users...

Anyway each VA can do is own financial part , formulae are simple, distance*pax number etc etc...
of course you would not have complex stuff as tickets price taken in account but at least the data
would be consistent.

Dan




Re: ASP import for VA - vollmey - 08-09-2005

Dan,

Is FSP exporting the financials?? Is there a way to do that??

This is just for my little airline. It would be neat in my Stats to show money made, or insurance costs over the last month, landing fee's
etc... But it seems to me that FSP is not exporting them, at least the slots are not in the database.



Post Edited ( 09-08-05 04:50 )


Re: ASP import for VA - DanSteph - 08-09-2005

Sorry Dave,

As I said FsP don't export the financial stuff because of the inconsistency.

Hal Smile




Re: ASP import for VA - lchristianes - 08-09-2005

Thanks a lot, Dan! Your information was quite helpful.
I will start working on it right away, and I will let you know if I have any problems.
Just to start, I will prepare a page to see if I imported all variables correctly, so that I can jump to the database thing.
Can we use the MS Access databases? It's quite common on Windows servers, and the DB drivers are already installed by default...




Re: ASP import for VA - DanSteph - 08-09-2005

You can use watewher you like FSP send POST data just like a FORM up to you to answer
in the right manner to FsP and to do whatewer you want with the data you got.

BTW I forgot: when you get the data and all is ok you must write a page in reply with a text: "#Answer# Ok - Saved;"

The file that get all the data is so simple that you can read it like a book Wink
perhaps you migh consider having a looh at the "FsPgetflight.php"
anyway let me know if any problems.

I'll post right after how the database look it's mysql but Msacces should be almost the same...

Dan




Re: ASP import for VA - DanSteph - 08-09-2005

First the User database, here you get your VA member:

Code:
id int(16) unsigned NOT NULL auto_increment,
          UserName varchar(22) NOT NULL default '',
          Password varchar(22) NOT NULL default '',
          Email varchar(40) NOT NULL default '',


Second the Flight database

Code:
id int(16) unsigned NOT NULL auto_increment,
              datestamp datetime NOT NULL default '0000-00-00 00:00:00',
              UserName varchar(22) NOT NULL default '',
              CompanyName varchar(35) NOT NULL default '',
              PilotName varchar(35) NOT NULL default '',
              FlightId varchar(10) NOT NULL default '',
              OnlineNetworkNbr tinyint(4) NOT NULL default '0',
              FlightDate date NOT NULL default '0000-00-00',
              AircraftName varchar(50) NOT NULL default '',
              AircraftType varchar(5) NOT NULL default '',
              NbrPassengers smallint(2) NOT NULL default '0',
              CargoWeight varchar(15) NOT NULL default '',
              Mtow varchar(15) NOT NULL default '',
              StartAircraftWeight varchar(15) NOT NULL default '',
              EndAircraftWeight varchar(15) NOT NULL default '',
              StartFuelQuantity varchar(15) NOT NULL default '',
              EndFuelQuantity varchar(15) NOT NULL default '',
              DepartureIcaoName varchar(50) NOT NULL default '',
              ArrivalIcaoName varchar(50) NOT NULL default '',
              DepartureLocalHour time NOT NULL default '00:00:00',
              ArrivalLocalHour time NOT NULL default '00:00:00',
              DepartureGmtHour time NOT NULL default '00:00:00',
              ArrivalGmtHour time NOT NULL default '00:00:00',
              TotalBlockTime time NOT NULL default '00:00:00',
              TotalBlockTimeNight time NOT NULL default '00:00:00',
              TotalAirbornTime time NOT NULL default '00:00:00',
              TotalTimeOnGround time NOT NULL default '00:00:00',
              TotalDistance varchar(18) NOT NULL default '',
              MaxAltitude varchar(15) NOT NULL default '',
              CruiseSpeed varchar(15) NOT NULL default '',
              CruiseMachSpeed varchar(15) NOT NULL default '',
              CruiseTimeStartSec time NOT NULL default '00:00:00',
              CruiseTimeStopSec time NOT NULL default '00:00:00',
              CruiseFuelStart varchar(15) NOT NULL default '',
              CruiseFuelStop varchar(15) NOT NULL default '',
              LandingSpeed varchar(15) NOT NULL default '',
              LandingPitch varchar(15) NOT NULL default '',
              TouchDownVertSpeedFt float NOT NULL default '0',
              CaptainSentMayday tinyint(3) NOT NULL default '0',
              CrashFlag tinyint(3) NOT NULL default '0',
              FlightResult varchar(15) NOT NULL default '',
              PassengersOpinion tinyint(4) NOT NULL default '0',
              PassengersOpinionText text NOT NULL,
              FailureText text NOT NULL,
              CasualtiesText text NOT NULL,
              PilotBonusText text NOT NULL,
              BonusPoints int(10) NOT NULL default '0',
              PilotPenalityText text NOT NULL,
              PenalityPoints int(10) NOT NULL default '0',

Dan




Re: ASP import for VA - DanSteph - 08-09-2005

Notice that by any chance the POST value are named exactly the same than the field in the database

So you will get POST with this name for example:

UserName
CompanyName
PilotName
FlightId
OnlineNetworkNbr
FlightDate
AircraftName


Dan




Re: ASP import for VA - lchristianes - 11-09-2005

Hi Dan!

I am already working on the translation from PHP to ASP, and I feel like home working on a language I am familiar to... Smile
The connection between FsP and the ASP page is already ok, and I could get a positive response from the software when I tried to export
some flights. Thanks for the flag change button! lol
I will create the database using MS Access, and test it using Windows IIS 5.1.
This week I'm gonna have lots of work in my real job, so I might walk a little slow, but I am enjoying doing this!
If I have any other doubts, I'll let you know.

Cheers




Re: ASP import for VA - lchristianes - 11-09-2005

Dan,

I'm having hard problems with date fields, I guess mainly because of date formats.
I already tried to change it in the Control Panel under Regional Settings, but it didn't work...
Is it a big problem to work these fields as simple text fields with lenght = 10?




Re: ASP import for VA - lchristianes - 16-09-2005

Any hints here? I did it and it worked fine on import.
Maybe during generating a report, the program could maninpulate data in order to present it correctly...




Re: ASP import for VA - DanSteph - 16-09-2005

Ah sorry didn't saw your first post...

I don't know ASP at all but don't you have any sort of dedicated datefield ?
Imho ASP should include such things ...

Let me know

Dan




Re: ASP import for VA - lchristianes - 17-09-2005

Don't worry... You're pretty busy with all other requests. I'm surprised about how you're able to handle all that...
There is a data field, but depending on the language installed on the server, some database fields must have a different input mask, and
that's the problem.
Since you shall distribute this software to many different regions, it should be focused on compatibility, don't you think?