Display Minimum Rank & Operated By

G’day Guys,

I would like to display the minimum rank required to fly an aircraft in my fleet table, this will save me creating a rank table.

i have attempted to do so with the following code i heaped together, but i can’t seem to get it to work, some help getting me on the right track would be great

<td><?php
               if($pilot->minrank == 1)
                       { echo "<img style='padding-left:3px;' src='http://qantasvirtual.com/lib/images/ranks/juniorFO.png'>"; }
               elseif($pilot->minrank == 2)
                       { echo "<img style='padding-left:3px;' src='http://qantasvirtual.com/lib/images/ranks/SeniorFO.png'>"; }
               elseif($pilot->minrank == 3)
                       { echo "<img style='padding-left:3px;' src='http://qantasvirtual.com/lib/images/ranks/Junior Captain.png'>"; }
               elseif($pilot->minrank == 4)
                       { echo "<img style='padding-left:3px;' src='http://qantasvirtual.com/lib/images/ranks/SeniorCaptain.png'>"; }
               else($pilot->minrank == 5)
                       { echo "<img style='padding-left:3px;' src='http://qantasvirtual.com/lib/images/ranks/ChiefPilot.png'>"; }
               ?>
</td>

Also i am having trouble trying to display 'operated by, which is one of the fields in my table, i created a tpl file called operatedby, and added the following code, repeating for my whole fleet.

if ($aircraft->registration == 'VH-EBG')
           #A332 (8 a/c)
           {
           $acname = '';
           $paaequipment1 = 'RNP10 GPSRNAV';
           $paaequipment2 = 'D';
           $paawake = 'H';
           $paatype = 'A332';
           $paapob = '228';
           $paaspeed = 'M083';       
           $paaother = ''; 
           $inforuhf = '';
           $inforvhf = '';
           $inforelba = '';
           $infos = '';
           $infosp = '';
           $infosd = '';
           $infosm = '';
           $infosj = '';
           $infoj = '';
           $infojl = '';
           $infojf = '';
           $infou = '';
           $infov = '';
           $infodnumber = '';
           $infodcapa = '';
           $operatedby = 'Qantas';            
           $zfw = '';
           $costindex = '113';

and in the file i want the ‘operated by’ info to display, i put

<?php include('operatedby.tpl') ?>

up the top.

and

<?php echo $operatedby; ?>

where i wanted to call it in my table.

Am i doing the right process for what i want to create ?

any help would be great, learning this will slowly add to my knowledge of coding

My Current layout can be seen here : http://qantasvirtual.com/index.php/fleet

anyone able to point out where i have went wrong ?

anyone able to point out where i have went wrong ?

anyone ?

Ok, thanks to Stuart in another post, i have got the minimum rank working, now how should i go about displaying the airline and aircraft flies for?, i intend on displaying a small image of the airline’s logo within my fleet table, to get a bitter picture of what i mean, my fleet table can be found here: http://qantasvirtual.com/index.php/fleet

How i attempted to unsuccessfully do this can be seen in the first post

help with this would be great, as it’s got me stumped

tylor i hope you will be happy by sharing this code with us please share full code.

Awaiting you

Ahmad

1 Like