Jump to content
servetas

Pilot Career Page v1

Recommended Posts

Pilot Career Page v1.1

This module is going to show your pilot ranks and awards on phpVMS. It was developed by php-mods and it is registered under Creative Commons Attribution-Noncommercial-Share Alike 3.0 Unported License.

How to Install?

Copy and upload the files same as the structure as your phpvms files. If you want to link your website's visitors/users to this module, use this:

www.yoursite.com/index.php/career -or- <?php echo url('/career'); ?>

Screenshots

career_page.jpg

Download

The module has been uploaded on github and you can download it here.

Support will be offered by this forum. If you have any questions do not hesitate to contact us.

PS: For those you are using Pilot Awards System (by phpmods), this module needs some customization in order to work in collaboration with your module.

  • Like 1

Share this post


Link to post
Share on other sites

don't know if my following question is possible to be realized!

is it possible to make the listing to show the ICAO or Aircraft Type allowed for specific Rank?

best regards

Thomas

Share this post


Link to post
Share on other sites

UPDATE 1.1 (03/01/2013)

Added the aircraft column on the ranks table (as per Txmmy83 request). The download link can be found on the first post.

  • Like 1

Share this post


Link to post
Share on other sites

Cool module mate, thanks!

im getting an error - Warning: Invalid argument supplied for foreach() in /home/voovirtu/public_html/va/core/templates/career.tpl on line 57

Share this post


Link to post
Share on other sites

Hello,

I got this codes. Help please.

Strict Standards: Non-static method CareerData::getgenaward() should not be called statically, assuming $this from incompatible context in /home/pilotomeraslan/public_html/a/core/modules/Career/Career.php on line 13
Strict Standards: Non-static method CareerData::getranks() should not be called statically, assuming $this from incompatible context in /home/pilotomeraslan/public_html/a/core/modules/Career/Career.php on line 14

Strict Standards: Non-static method CareerData::getaircrafts() should not be called statically, assuming $this from incompatible context in /home/pilotomeraslan/public_html/a/core/templates/career.php on line 31
E190

Share this post


Link to post
Share on other sites

Open core/common/CareerData.class.php

find this

  public function getgenaward() {
    $sql = "SELECT * FROM " . TABLE_PREFIX . "awards";
    return DB::get_results($sql);
  }
   public function getranks() {
 $sql = "SELECT * FROM " . TABLE_PREFIX . "ranks ORDER BY minhours";
 return DB::get_results($sql);
   }
   public function getaircrafts($rankid) {
 $sql= "SELECT distinct icao FROM " . TABLE_PREFIX . "aircraft WHERE minrank=" . $rankid;
 return DB::get_results($sql);
   }

And replace it with this

   public static function getgenaward() {
 $sql = "SELECT * FROM " . TABLE_PREFIX . "awards";
 return DB::get_results($sql);
   }

   public static function getranks() {
 $sql = "SELECT * FROM " . TABLE_PREFIX . "ranks ORDER BY minhours";
 return DB::get_results($sql);
   }

   public static function getaircrafts($rankid) {
 $sql= "SELECT distinct icao FROM " . TABLE_PREFIX . "aircraft WHERE minrank=" . $rankid;
 return DB::get_results($sql);
   }

Share this post


Link to post
Share on other sites

Alternatively, just re-download the module from github. I have made all the required changes.

  • Like 1

Share this post


Link to post
Share on other sites

Alternatively, just re-download the module from github. I have made all the required changes.

I just submitted a pull-request on this one.

Changed

$this->shoe('career');

to

$this->show('career');

In your github files to make sure that the template is correctly rendered.

Share this post


Link to post
Share on other sites

For ranks with multiple aircraft is there a way to add a comma and space between each aircraft.

else {
foreach($rankai as $ran) {echo $ran->icao; }
} ?></td>

Fairly certain I need to modify this area, but I am not sure how to place a ", " between each call of the foreach command.

Share this post


Link to post
Share on other sites

I made a pull request on this module. it is a small fix for the error on the page when no awards have been assigned in the system yet.

Share this post


Link to post
Share on other sites

I made an extra update into the file and merged the pull request. Thank you

Not a problem at all. My only headache was that I can not get the sorry message below the table headers. As of now it is sitting on top of the table headers. if I move the php, I get errors that I can not fix. I'm not the slickest with php but I do get lucky on that rare occasion. I really wish I could fix it the rest of the way. :(

Share this post


Link to post
Share on other sites

That's what I did. I added a table row and column (with an extended colspan) to shown the error inside the table.

  • Like 1

Share this post


Link to post
Share on other sites

Nice! I'll run over to git and view the change. I am curious. I tried like mad man and all I got was errors. I was probably one little simple step away from correct. :)

**EDIT**

Looking at your code change, I was real close in my thinking. Where I was going wrong was not adding the 2nd } in the

<?php } } ?>

Lesson learned. I thank you much!

Edited by TAV1702

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×