Jump to content

VastatsData.class.php


simpilot

Recommended Posts

Guest CableGuy

Just wanted to let everyone know, IF your va has NO Flight hours logged or no routes or anything and its basically a clean install, You will get mysql_fetch errors, Once you add airports and do a flight and all, They will all be gone and display the data grabbed from the database.

Link to comment
Share on other sites

Guest CableGuy

mmmm, it does not work for me...  :-

i get

<?php StatsData::AircraftUsage(5); ?>

and it does not work...

did i made anything wrong?

Add an aircraft from your admin panel and it shall work

Link to comment
Share on other sites

  • 4 weeks later...

Ok, I know I am getting ready to open myself up to ridicule here, but can some one please tell me how to get this to appear on the website? Or can you point me in the direction of a tutorial or doc that explains how to add this type of stuff to the website?

I added some stuff and it threw some numbers at me on the site when I viewed it but it looked nothing like what was given as an example in the first post for this thread. So far I have uploaded the file and ran the sql and edited a tpl file. I reverted back to the original tpl file when this went wrong for me.

I am REALLY new to this system and still trying to figure it all out. I know once I get it right for the first time, I will never have to ask a stupid question like this ever again. So far I am loving this system to death but am frustrated all at the same time.  ;D

Thanks for any help I can get. I would really appreciate  it.

Ray

Link to comment
Share on other sites

  • Administrators

Hey Ray,

No problem. I just realized I don't have a doc on how to, so watch this space:

http://docs.phpvms.net/development/using_the_api#using_the_api

There's a video tutorial too on using the API (see link on top), watching that will help as well. Gimme about an hour or so, and I'll have the above link filled out though

Link to comment
Share on other sites

It's all good man. No worries. Sh*t happens from time to time.  ;-)

Yeah I couldn't wathc them last night. Got 2 teeth pulled and pain pills kicked in. I am going to go and watch them now. I'll keep looking back from time to time on the docs as well.

Thanks again.

Link to comment
Share on other sites

I for the life of me can not get my head around this module thing. I can get stuff to show up on site, that part I have figured out. If some one would let me nix their stats module that would be great. Then I can figure out how it all works.

If not that's ok too. I will keep trying.

Thanks,  Ray

Link to comment
Share on other sites

Yeah, I was guessing they were. I wasn't sure if we still had to create a module for this to work or what. The whole module thing has me running in circles I'm afraid.

After loads of cussing and face turning red, I am finally getting results to show up on the page. Not pretty, but it's a start  ;)

Link to comment
Share on other sites

I got mine to work without creating a module. All the functions are now in phpVMS that are shown in the pic on the front page.

Mine is basic basic now but works. What I did was  placed the frontpage_main.tpl from core templates into my skin so it would not be written over in updates.

I have added something liek this to make it work.

 <h3>VA Statistics</h3>
    
        <p>Total Pilots: <?php echo StatsData::PilotCount(); ?></p>
        <p>Total Flights: <?php echo StatsData::TotalFlights(); ?></p>
        <p>Total Flights Today: <?php VastatsData::totalflightstoday(); ?></p>
        <p>Total Flight Hours: <?php echo StatsData::TotalHours(); ?></p>
        <p>Total PAX Carried: <?php VastatsData::totalpaxcarried(); ?></p>
        <p>Total Fuel Burned: <?php VastatsData::totalfuelburned(); ?></p>
        <p>Total Miles Flown: <?php VastatsData::totalmilesflown(); ?></p>
        <p>Total Aircraft: <?php VastatsData::totalaircraftinfleet(); ?></p>
        <p>Total Schedules: <?php VastatsData::totalschedules(); ?></p>
        <p>Total News Items: <?php VastatsData::totalnewsitems(); ?></p>

I know all the P's are not necessary. I just hacked it together lastnight in a few minutes. But something like that will get you on your way.

I just looked way to far into it and tried and tried to create a module and never actually had to.  :-[  Try doing something like I did in the frontpage_main.tpl if using crystal or a copied crystal and it should work. And obviously you will need to skin it and recode to suit your needs.

Link to comment
Share on other sites

  • Administrators

Modules have been revamped in the next version, so it will be easier.

But for this, you just can modify the templates to call the functions.

I think the video tutorials might make it clearer. But I will be revising the existing tutorials when the time comes to reflect the updated internals. I'll try to go in-depth for it, to cover alot of stuff.

Link to comment
Share on other sites

Hello Sir and thanks for your reply.

Like you I also have tried making a Module but to no avail,

Will try what you have done.

Thanks again

Adam

No probs Adam. Like I said, that is VERY rough code that was tossed together in a couple minutes.  :-[ Try it and skin it to your liking and I'm sure you will be happy.  ;D

Link to comment
Share on other sites

  • 3 months later...

PLs can someone code me some table for Croatia Cargo Company,  i would really be preciated, cause you guys eat codes for brekfast, i will do that for year hehe...really...

So...i would involve...total pilots, total A/C, total routes, total miles flown, total cargo carried, total fuel burnedtotal hours flown. Thank you very much guys

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