# Pilot Career Page v1

**URL:** <https://forum.phpvms.net/t/pilot-career-page-v1/7465>\
**Category:** PHP-Mods Addons\
**Created:** [November 27, 2012, 8:35am UTC](https://forum.phpvms.net/t/pilot-career-page-v1/7465 "2012-11-27T08:35:06Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![servetas](https://forum.phpvms.net/user_avatar/forum.phpvms.net/servetas/32/75_2.png) [@servetas](https://forum.phpvms.net/u/servetas)\
**Post date:** [November 27, 2012, 8:35am UTC](https://forum.phpvms.net/t/pilot-career-page-v1/7465/1 "2012-11-27T08:35:06Z")

</div>

**Pilot Career Page v1.1**

This module is going to show your pilot ranks and awards on phpVMS. It was developed by [php-mods](http://php-mods.eu/) 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**

**Download**

The module has been uploaded on github and you can download it [here](http://php-mods.eu/site/index.php/pilot-career-page-module).

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

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

---

<div class="post-metadata">

**Author:** ![Txmmy83](https://forum.phpvms.net/letter_avatar_proxy/v4/letter/t/f14d63/32.png) [@Txmmy83](https://forum.phpvms.net/u/Txmmy83)\
**Post date:** [December 29, 2012, 2:07pm UTC](https://forum.phpvms.net/t/pilot-career-page-v1/7465/2 "2012-12-29T14:07:44Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![servetas](https://forum.phpvms.net/user_avatar/forum.phpvms.net/servetas/32/75_2.png) [@servetas](https://forum.phpvms.net/u/servetas)\
**Post date:** [January 4, 2013, 2:59pm UTC](https://forum.phpvms.net/t/pilot-career-page-v1/7465/3 "2013-01-04T14:59:34Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Txmmy83](https://forum.phpvms.net/letter_avatar_proxy/v4/letter/t/f14d63/32.png) [@Txmmy83](https://forum.phpvms.net/u/Txmmy83)\
**Post date:** [January 13, 2013, 8:06pm UTC](https://forum.phpvms.net/t/pilot-career-page-v1/7465/4 "2013-01-13T20:06:38Z")

</div>

thank you very much

---

<div class="post-metadata">

**Author:** ![Junior](https://forum.phpvms.net/letter_avatar_proxy/v4/letter/j/7ea924/32.png) [@Junior](https://forum.phpvms.net/u/Junior)\
**Post date:** [June 3, 2014, 4:20am UTC](https://forum.phpvms.net/t/pilot-career-page-v1/7465/5 "2014-06-03T04:20:29Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![servetas](https://forum.phpvms.net/user_avatar/forum.phpvms.net/servetas/32/75_2.png) [@servetas](https://forum.phpvms.net/u/servetas)\
**Post date:** [June 3, 2014, 9:04am UTC](https://forum.phpvms.net/t/pilot-career-page-v1/7465/6 "2014-06-03T09:04:08Z")

</div>

Have you added any award on your phpvms system?

---

<div class="post-metadata">

**Author:** ![OmerAslan](https://forum.phpvms.net/user_avatar/forum.phpvms.net/omeraslan/32/869_2.png) [@OmerAslan](https://forum.phpvms.net/u/OmerAslan)\
**Post date:** [May 24, 2016, 3:57pm UTC](https://forum.phpvms.net/t/pilot-career-page-v1/7465/7 "2016-05-24T15:57:01Z")

</div>

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

```

---

<div class="post-metadata">

**Author:** ![web541](https://forum.phpvms.net/letter_avatar_proxy/v4/letter/w/59ef9b/32.png) [@web541](https://forum.phpvms.net/u/web541)\
**Post date:** [May 24, 2016, 8:50pm UTC](https://forum.phpvms.net/t/pilot-career-page-v1/7465/8 "2016-05-24T20:50:42Z")

</div>

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);
   }

```

---

<div class="post-metadata">

**Author:** ![servetas](https://forum.phpvms.net/user_avatar/forum.phpvms.net/servetas/32/75_2.png) [@servetas](https://forum.phpvms.net/u/servetas)\
**Post date:** [May 24, 2016, 9:01pm UTC](https://forum.phpvms.net/t/pilot-career-page-v1/7465/9 "2016-05-24T21:01:17Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![OmerAslan](https://forum.phpvms.net/user_avatar/forum.phpvms.net/omeraslan/32/869_2.png) [@OmerAslan](https://forum.phpvms.net/u/OmerAslan)\
**Post date:** [May 24, 2016, 9:03pm UTC](https://forum.phpvms.net/t/pilot-career-page-v1/7465/10 "2016-05-24T21:03:40Z")

</div>

It’s working thank you my friend…

---

<div class="post-metadata">

**Author:** ![web541](https://forum.phpvms.net/letter_avatar_proxy/v4/letter/w/59ef9b/32.png) [@web541](https://forum.phpvms.net/u/web541)\
**Post date:** [May 24, 2016, 9:14pm UTC](https://forum.phpvms.net/t/pilot-career-page-v1/7465/11 "2016-05-24T21:14:27Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![servetas](https://forum.phpvms.net/user_avatar/forum.phpvms.net/servetas/32/75_2.png) [@servetas](https://forum.phpvms.net/u/servetas)\
**Post date:** [May 25, 2016, 9:03am UTC](https://forum.phpvms.net/t/pilot-career-page-v1/7465/12 "2016-05-25T09:03:06Z")

</div>

Just a mistyping. Merged your pull request.

---

<div class="post-metadata">

**Author:** ![KenG](https://forum.phpvms.net/user_avatar/forum.phpvms.net/keng/32/787_2.png) [@KenG](https://forum.phpvms.net/u/KenG)\
**Post date:** [September 3, 2016, 3:13pm UTC](https://forum.phpvms.net/t/pilot-career-page-v1/7465/13 "2016-09-03T15:13:11Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![web541](https://forum.phpvms.net/letter_avatar_proxy/v4/letter/w/59ef9b/32.png) [@web541](https://forum.phpvms.net/u/web541)\
**Post date:** [September 3, 2016, 9:15pm UTC](https://forum.phpvms.net/t/pilot-career-page-v1/7465/14 "2016-09-03T21:15:15Z")

</div>

Try this

```
foreach($rankai as $ran) { echo $ran->icao.','; }

```

---

<div class="post-metadata">

**Author:** ![KenG](https://forum.phpvms.net/user_avatar/forum.phpvms.net/keng/32/787_2.png) [@KenG](https://forum.phpvms.net/u/KenG)\
**Post date:** [September 4, 2016, 1:07pm UTC](https://forum.phpvms.net/t/pilot-career-page-v1/7465/15 "2016-09-04T13:07:54Z")

</div>

Thank you,

That did it.

---

<div class="post-metadata">

**Author:** ![TAV1702](https://forum.phpvms.net/user_avatar/forum.phpvms.net/tav1702/32/41_2.png) [@TAV1702](https://forum.phpvms.net/u/TAV1702)\
**Post date:** [November 28, 2016, 1:52am UTC](https://forum.phpvms.net/t/pilot-career-page-v1/7465/16 "2016-11-28T01:52:14Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![servetas](https://forum.phpvms.net/user_avatar/forum.phpvms.net/servetas/32/75_2.png) [@servetas](https://forum.phpvms.net/u/servetas)\
**Post date:** [November 28, 2016, 10:35am UTC](https://forum.phpvms.net/t/pilot-career-page-v1/7465/17 "2016-11-28T10:35:27Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![TAV1702](https://forum.phpvms.net/user_avatar/forum.phpvms.net/tav1702/32/41_2.png) [@TAV1702](https://forum.phpvms.net/u/TAV1702)\
**Post date:** [November 29, 2016, 3:09am UTC](https://forum.phpvms.net/t/pilot-career-page-v1/7465/18 "2016-11-29T03:09:37Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![servetas](https://forum.phpvms.net/user_avatar/forum.phpvms.net/servetas/32/75_2.png) [@servetas](https://forum.phpvms.net/u/servetas)\
**Post date:** [November 29, 2016, 9:32am UTC](https://forum.phpvms.net/t/pilot-career-page-v1/7465/19 "2016-11-29T09:32:03Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![TAV1702](https://forum.phpvms.net/user_avatar/forum.phpvms.net/tav1702/32/41_2.png) [@TAV1702](https://forum.phpvms.net/u/TAV1702)\
**Post date:** [November 29, 2016, 7:27pm UTC](https://forum.phpvms.net/t/pilot-career-page-v1/7465/20 "2016-11-29T19:27:05Z")

</div>

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!
