VastatsData.class.php

How to I run the .sql file? Also, when I do so, can I just copy theses lines into my code to get the stats?

<?php echo StatsData::PilotCount(); ?>

<?php echo StatsData::TotalFlights(); ?>

<?php echo StatsData::TotalHours(); ?>

These three stats were built by Nabeel and are already in the app, you would not have to run the sql file to use those. If you want to use the other commands you would have to use the sql file and update your db using phpmyadmin. The vastats options will be included in future release I believe.

I put down the wrong stats. Could you give me step by step instructions on how to run the sql file and put those extra stats you came up with on my frontpage. I’m not very good with php, so thanks for all of your help!

Get into the phpmyadmin for your db and select the database that your trying to modify. Select the sql tab and paste the sql query into the window. Hit go. You should then get a message that the query executed sucsessfully. Done.

The commands that are at the beginning of this thread can just be pasted into your site where you want them to appear and then echo the data to get the number.

hey thank’s man… saved me a whole lot of ordeal of doing it myself.

good luck with your va

I’m sorry but how exactly can I access phpmyadmin? I found a website called www.phpmyadmin.net, but even if that’s where to go, I don’t know what to do from there.

My VA’s website is http://www.swava.net.

I’m sorry but how exactly can I access phpmyadmin? I found a website called www.phpmyadmin.net, but even if that’s where to go, I don’t know what to do from there.

My VA’s website is http://www.swava.net.

Do you have access to the cpanel(or something similar) for your site? You should have phpmyadmin as an option from there in the database section. If you do not have access to the backend of the site you will have to write a quick script to insert it through a php file or the like. How did you originally set up your database, you, or someone had to have access to some sort of a database manager.

I’m sorry but how exactly can I access phpmyadmin? I found a website called www.phpmyadmin.net, but even if that’s where to go, I don’t know what to do from there.

My VA’s website is http://www.swava.net.

You should ask your webhost.. im sure they ill guide on how to access phpmyadmin

I believe I do have access to the server. I’m using godaddy.com to host my site.

That is returning an array of data which you then need to convert and display however you would like on your site. I use a module where for the case ‘stats’ I declare,

case ‘stats’:

Template::Set(‘toproutes’, StatsData::TopRoutes(1));
Template::Set(‘topaircraft’, StatsData::AircraftUsage(5));
Template::Show(‘stats_operations.tpl’);

Then in my stats_operations.tpl to display the data I want to see for top aircraft ->

<?php if(!$topaircraft) { echo 'No Top Aircraft'; return; } foreach($topaircraft as $topa) { ?> <?php echo $topa->aircraft; ?> <?php echo $topa->registration; ?> <?php } ?>

and for top routes ->

<?php if(!$toproutes) { echo 'No Top Routes Exist'; return; } foreach($toproutes as $report) { ?> <?php echo $report->code; ?><?php echo $report->flightnum; ?> <?php echo $report->depicao; ?> <?php echo $report->arricao; ?> <?php echo $report->distance; ?> <?php } ?>

These pieces you need to build into your app and display in your template the way you would like to see it. 

hello again,

could you pls explain how to create this module… I think first i have to create a module and put somehow:

case 'stats':
            
  Template::Set('toproutes', StatsData::TopRoutes(1));
  Template::Set('topaircraft', StatsData::AircraftUsage(5));
  Template::Show('stats_operations.tpl');

and then add to stats_operations.tpl

<?php
if(!$toproutes)
{
  echo 'No Top Routes Exist';
  return;
}
foreach($toproutes as $report)
{
?>
<tr>
  <td align="center"><?php echo $report->code; ?><?php echo $report->flightnum; ?></td>
  <td align="center"><?php echo $report->depicao; ?></td>
  <td align="center"><?php echo $report->arricao; ?></td>
  <td align="center"><?php echo $report->distance; ?></td>
</tr>
<?php 
}
?>

for top routes for example.

I think i have all mess up !

sorry  :-[

Rolled a preliminary copy into today’s beta commit.

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

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

Thanks Nabeel I really appreciate it a bunch.

Sorry I did not get to this tonight, few bugs came up. I will have it up for ya tomorrow, but hopefully you checked out the video tutorials

It’s all good man. No worries. Sh*t happens from time to time.  :wink:

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.

Ouch man, good luck with that

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

Ray, most, if not all, of these functions are in the latest beta

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 

Hi guys,

Do I need to create a module or something for this to work ?

Sorry, I’m still learning, I have watched the tutorial video’s but I am still confused as to what to do exactly.

If anyone could shed some light I would be most appreciated.

Thanking you in advance

Adam