Custom field data

Hi Nabeel,

I have created a custom field when registering “vatsimid” i want to pull all that field values in to a plain text web page, i thought the values would have been in the pilots table but the’re not, i have had a poke about but any assistance would be appreciated.

This is what i want,

<?php echo PilotData::GetFieldValue($pilot->pilotid, ‘VATSIM ID’); ?>

Just a plain text file with all the CID’s

Something like:

$allpilots = PilotData::getAllPilots(); # I believe that's the right function
foreach($allpilots as $pilot) 
{
echo PilotData::GetFieldValue($pilot->pilotid, 'VATSIM ID');
}

I get the following error,

Fatal error: Class ‘PilotData’ not found in /srv/www/easyjetva.com/public_html/core/vr.php on line 2

what im afer is that fied data in a plain text file for vroute to automatically parse my roster with vatsim id’s and send invitations to join the group.

Did you include the codon.config.php file?

OK so the plot thickens, thats got rid of the error but nothing is displayed for some reason.

Sounds like there’s an error somewhere then, try adding, below the include:

error_reporting(E_ALL);
ini_set('display_errors', 'on');

Tried that im getting no output what so ever, Damn..

OK so i had to put the actual file location not the url which is now working but im getting the complete data in one line, is there a way i can put in a line break?

No worries i figured it out, Thanks Nabeel for your help.

Hi Mark,

Did you get the code for auto-vroute invites working?

If yes can I have it please

Regards

Jon

Hi Jon,

Yes is did, you will need to speak with Michal Rok before hand and he will set you up on his side that will look at that file and parse it.

In another VA i am involved with they use an api in to vroute that will provide a route based on the variables passed dep and arr, but i just have not had the time to look in to that yet

Hi Mark,

Ok Thanks For That,

Kind Regards

Jon Derrick

Sorry Jon was going to post the file but got distracted in something else

Here you go, just change the field value for your custom created field and it will pull what ever you like, as you can see this is outside of phpvms and site in the root folder.

Just make sure you define your actual path of the file in the include and yes it does need the //

<?php
//error_reporting(E_ALL);
//ini_set('display_errors', 'on');
include 'YOURSITES_ROOT_PATH/public_html//core/codon.config.php';
$allpilots = PilotData::getAllPilots();
foreach($allpilots as $pilot)
{
       echo PilotData::GetFieldValue($pilot->pilotid, 'VATSIM ID');
echo '<br />';
}
?>