Jump to content

Malchor

Members
  • Posts

    17
  • Joined

  • Last visited

Posts posted by Malchor

  1. Hello Guys,

    I am a realy Noob on PHP. I have a two Questions.

    1. Can some one help me to prepare the Schedules Flight Page that only the Flights from your last arrival Airport and the Flights by the right days will displayed? A Flight only on Tuesday shall only shwon on Tuesday.

    2. In this reason I want to display also the available Aircrafts on Dep Airport and if there are no Aircrafts you must order an aircraft from a other airport at a small charge.

    Is this possible together?

    And can some one help me pls.

    Thanks in advance.

    Malchor

  2. Hello guys,

    I have a question. I have copy an edit the code a little bit. Now I have the problem, that all flight statuts will show next to each user.

    What I Mean you can see here

    test_pic.JPG

    How I can change this? The code is following

    <?php 
           date_default_timezone_set('USA/Atlanta');
           $query = "SELECT * FROM phpvms_schedules ORDER BY deptime + 0 ASC";
           $list = DB::get_results($query);
           echo '<h3>Expected Departures - Current Time is '.date('D M j H:i:s T Y').'</h3>';
    echo '<table width="90%" border="1">'; 
    echo '<tr><td><b>Flight Number</b></td><td><b>Departure</b></td><td><b>Arrival</b></td><td><b>Departure Time</b></td><td><b>Aircraft</b></td><td><b>Status</b></td></tr>'; 
    $count = 0; 
    foreach($list as $flight) 
    { 
           if(date('G:i') >= '23') 
           {$time = '0';} 
           else 
           {$time = date('G:i');} 
                   if(($flight->deptime + 0) > $time) 
                   { 
           if($count < 10) 
           { 
                   $aircraft = OperationsData::getAircraftInfo($flight->aircraft); 
                   echo '<tr><td>'.$flight->code.$flight->flightnum.'</td><td>'.$flight->depicao.'</td><td>'.$flight->arricao.'</td><td>'.$flight->deptime.'</td><td>'.$aircraft->fullname.'</td>'; 
                   echo '<td>'; 
                   if(($flight->deptime - date('G:i')) <= 2 / 120 * 1) 
                   { 
                   echo 'Departed'; 
                   } 				
    
                   if(($flight->deptime - date('G:i')) <= 2 / 120 * 5) 
                   { 
                   echo 'Gate closed'; 
                   } 				
    
                   if(($flight->deptime - date('G:i')) <= 2 / 120 * 15) 
                   { 
                   echo 'Final Call'; 
                   } 
    
                   if(($flight->deptime - date('G:i')) <= 2 / 120 * 30) 
                   { 
                   echo 'Boarding'; 
                   } 
    
                   if(($flight->deptime - date('G:i')) <= 2) 
                   { 
                   echo 'Check-In open'; 
                   } 
    
      else
                   { 
                   echo ''; 
                   } 
                   echo '</td></tr>'; 
                   $count++; 
           } 
           } 
    } 
    echo '</table>';
    
    echo '<h3>Expected Arrivals - Current Time is '.date('G:i').'</h3>'; 
    echo '<table width="90%" border="1">'; 
    echo '<tr><td><b>Flight Number</b></td><td><b>Departure</b></td><td><b>Arrival</b></td><td><b>Arrival Time</b></td><td><b>Aircraft</b></td><td><b>Status</b></td></tr>'; 
    $count = 0; 
    foreach($list as $flight) 
    { 
           if(date('G:i') >= '23') 
           {$time = '0';} 
           else 
           {$time = date('G:i');} 
                   if(($flight->arrtime + 0) > $time) 
                   { 
           if($count < 10) 
           { 
                   $aircraft = OperationsData::getAircraftInfo($flight->aircraft); 
                   echo '<tr><td>'.$flight->code.$flight->flightnum.'</td><td>'.$flight->depicao.'</td><td>'.$flight->arricao.'</td><td>'.$flight->arrtime.'</td><td>'.$aircraft->fullname.'</td>'; 
                   echo '<td>';
                    if(($flight->arrtime - date('G:i')) <= 1 / 60 * 1) 
                   { 
                   echo 'Landed'; 
                   }
    
                   if(($flight->arrtime - date('G:i')) <= 1 / 60 * 15) 
                   { 
                   echo 'On Approach'; 
                   } 
                   else 
                   { 
                   echo 'On Time'; 
                   } 
                   echo '</td></tr>'; 
                   $count++; 
           } 
           } 
    } 
    echo '</table>';  
    ?>

    Who can help me please?

    Regards

    Olaf

×
×
  • Create New...