Jump to content

PHP any one? help please if possible


Guest chikolol

Recommended Posts

Guest chikolol

okay, sorry too ask for something again lol, well i have been working on my virtual airline for some time now, and i have codeshare branches on my airline, which operate expanded routes through out Europe and Americas, but i have a few thing on my Operations page for the different airline, such as JET2 AND DHL, now i ahve added those airlines and some schedules how would i show the latest flights flown by that airline and a schedule just by that particular airline, to show it on the page, not the whole system schedule but just that particular one, if its possible!, now i now i have posted this before dont get mad at me, please! and i have been through the API, lol am just asking for a little guide not everything but at least a clue on how to start, thats all. not asking for much

Link to comment
Share on other sites

  • Administrators

Not sure if I am understanding exactly what you are trying to do but if you are simply wanting to display the scheduled routes for one of your airlines and you are using a unique flight number code for the schedules for that airline you can sort the data using the "code" line out of the schedules table.

I am guessing how you have it setup and making some assumptions but -

your flight schedules are probably something like

JET101 - KLAX - KBOS etc...

DHL201 - KLAX - KBOS etc...

The "JET" and the "DHL" portion of the flight number is a seperate item in the table named "code". If you set up your own sql request to only use lines that the "code" = "DHL" it should only return the flights for that airline, or you could sort the info after you pull the entire table and only display what you want using a similar command..

The PIREPS also store the same unique code so you could sort and display those in the same way.

If you are tring to display a unique airline logo in the flight info as on the second page of the uk link you posted you could use the same theory using if - else commands based upon the returned "code" data.

basically - if code = DHL -> then display logo image 1 // if code = JET -> then display logo image 2 // else display logo image 3

Let me know if any of this is what you are thinking and I can probably write a quick piece of php to make it work for you.

Link to comment
Share on other sites

Guest chikolol

yes mate, that's exactly what am looking for, and if you can then that would be awesome mate! id the code is simple and you can do that then that would be awesome, thank you mate!

Link to comment
Share on other sites

  • Administrators

chikolol - Looks good on your site  :)

Thomas - Here is a basic piece of code to display the table data as an image according to the airline as on the flyUK site. You will need to modify it to fit your site and insert it in the schedule_results.tpl file or in whatever table you are using.

This example is using the assumption that there is 4 airlines, you can adjust it to how many you have.

 <td>
        
      <?php
        
                if ($route->code=="abc") echo "<img src='http://www.yoursite.com/abc.gif'>";

                elseif ($route->code=="def") echo "<img src='http://www.yoursite.com/def.gif'>";

                elseif ($route->code=="ghi") echo "<img src='http://www.yoursite.com/ghi.gif'>";

                else echo "<img src='http://www.yoursite.com/jkl.gif'>"; 

         ?>

</td>

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