Jump to content

Andy

Members
  • Posts

    30
  • Joined

  • Last visited

Posts posted by Andy

  1. I am not sure what you are using for variables, but if you are basing it off of what I posted a while back you could do ->

    $depname = OperationsData::RetrieveAirportInfo($flight->depicao);
    $arrname = OperationsData::RetrieveAirportInfo($flight->arricao);

    right before your table row within your foreach loop, then change your table cells to ->

    <td>'.$depname->name.'</td><td>'.$arrname->name.'</td>

    And it will display the name of the airport instead of the icao code.

    Thx Simpilot for code, i pasted in the template and the dep and arr. rows are empty. Maybe i´ve done a mistake.

    Here is the full code with the changes.

    $query = "SELECT * FROM phpvms_schedules ORDER BY deptime + 0 ASC";

    $list = DB::get_results($query);

    echo '<h3>Departures : '.date('d M Y H:i:s T ').' </h3>';

    echo '<table width="100%" border="0" bordercolor="#ffffff" bgcolor="#393938"><colgroup>

    <col width="40">

    <col width="85">

    <col width="120">

    <col width="120">

    <col width="100">

    <col width="100">

    <col width="130">

    </colgroup>';

    echo '<tr><td><font color="#fafaf6"><b>Code</b></font></td><td><font color="#fafaf6"><b>Flight Number</b></font></td>

    <td><font color="#fafaf6"><b>Departure</b></font></td>

    <td><font color="#fafaf6"><b>Arrival</b></font></td><td><font color="#fafaf6"><b>Departure Time</b></font></td>

    <td><font color="#fafaf6"><b>Aircraft</b></font></td><td><font color="#fafaf6"><b>Status</b></font></td></tr>';

    $count = 0;

    $depname = OperationsData::RetrieveAirportInfo($flight->depicao);

    $arrname = OperationsData::RetrieveAirportInfo($flight->arricao);

    foreach($list as $flight) {

    if(date('G:i') >= '23') {

    $time = '0';

    }

    else {

    $time = date('G:i');

    }

    if(($flight->deptime + 0) >= $time) {

    if($count < 8) {

    $aircraft = OperationsData::getAircraftInfo($flight->aircraft);

    echo '<tr><td><font color="#ffff00">'.$flight->code.'</font></td>

    <td><font color="#ffff00">'.$flight->flightnum.'</font></td><td><font color="#ffff00">'.$depname->name.'</font></td>

    <td><font color="#ffff00">'.$arrname->name.'</font></td><td><font color="#ffff00">'.$flight->deptime.'</font></td>

    <td><font color="#ffff00">'.$aircraft->name.'</font></td>';

    echo '<td><font color="#ffff00">';

    $minutes = explode(':', $flight->deptime);

    if($minutes['0'] <= date('G')) {

    if(($minutes['1'] - date('i')) <= 0) {

    echo 'Departed';

    }

    elseif(($minutes['1'] - date('i')) <= 5 && ($minutes['1'] - date('i')) >= 5) {

    echo 'Final Call';

    }

    elseif(($minutes['1'] - date('i')) >= 6 && ($minutes['1'] - date('i')) <= 20) {

    echo 'Boarding';

    }

    else {

    echo 'Scheduled Departure';

    }

    }

    else {

    echo 'Scheduled Departure';

    }

    echo '</td></tr>';

    $count++;

    }

    }

    }

    echo '</table>';

    :unsure:

    Andreas

  2. I'm sure it is possible, but I don't have anywhere near enough PHP knowledge to figure out how. I experimented today to see if I could figure it out, but no success. I'm sure someone who actually knows what they are doing, will provide an answer, soon.

    Hi Robin, thx for your reply! It´s no problem, i´ll wait for the right code. ;)

    Andreas

  3. Hi@all!

    I like the Flight board, looks nice. I tried to change the icao names to full names (depicao to depname).

    But after this the board didn´t show something in this row. It´s possible to change to airport fullnames? And what should i change.

    thx for help.

    Andreas

  4. Thx for your attention. I got information from my provider, that the sql server travel to another hardware. that cause short connection cuts to the database.

    phpvms run´s now fine again. But i can´t look up EDDF! Other airports work. mmhhh. strange.

    regards

    Andreas Romahn

  5. Hello together! My phpVMS crashed from 1 Minute to the next. I tried to look up a Airport (EDDF) at the admin panel. At first phpvms told "Airport not found, try4 Letter ICAO" at the second try comes this- the whole site is gone

    "Fatal error: Uncaught <blockquote><font face=arial size=2 color=000099><b>Last Error --</b> [<font color=000000><b>Lost connection to MySQL server at 'reading initial communication packet', system error: 111 (2013)</b></font>]<br />[<font color=000000><b></b></font>]</font><p> </blockquote><hr noshade color=dddddd size=1> thrown in /hp/br/aa/wt/www/home/core/classes/ezdb/ezdb_mysql.class.php on line 99"

    Look up other Airports work fine, no problems. MySQL Server and db is online.

    What should i do?

    Regards

    Andreas Romahn

    Ps. sorry for my bad english but its long time ago that i wrote english.

×
×
  • Create New...