Jump to content

JustinFHI

Members
  • Posts

    12
  • Joined

  • Last visited

Posts posted by JustinFHI

  1. Hi,

    you can fix it like this:

    //Script order
    <?php MainController::Run('PIREPS', 'RecentFrontPage'); ?>
    
    
    //Content of frontpage_recent.tpl
    <?php
    $pir_sel = "SELECT * FROM pireps WHERE pilotid = 'Auth::$userinfo->pilotid' ORDER BY id DESC LIMIT 5";
    $pir_go = mysql_query($pir_sql);
    while($report = mysql_fetch_object) {
     <li><a href="<?php echo url('/pireps/viewreport/'.$report->pirepid);?>">#<?php echo $report->pirepid
     . ' - ' . $report->code.$report->flightnum?> <span class="icon-align-left"></span><strong> Flying from <?php echo $report->depICAO . ' to ' . $report->arrICAO?></strong></a></li>
    }
    ?>
    

    I know that doesn't work with modules, but I think it's the easyst method.

  2. Hey Guys,

    I am currently program at a Trackingsystem, but I have a problem. We use in our airline kACARS only. For the Tracker, I have to change the "kACARS_Free.php" Module that, when kACARS send the liveupdate, these data also insert into a second table called "tracker_daten".

    Here the Code from liveupdate only. Rest of the code is default:

    <?php
    case 'liveupdate':
     $pilotid = PilotData::parsePilotID($xml->verify->pilotID);
     $lat = str_replace(",", ".", $xml->liveupdate->latitude);
     $lon = str_replace(",", ".", $xml->liveupdate->longitude);
     # Get the distance remaining
     $depapt = OperationsData::GetAirportInfo($xml->liveupdate->depICAO);
     $arrapt = OperationsData::GetAirportInfo($xml->liveupdate->arrICAO);
     $dist_remain = round(SchedulesData::distanceBetweenPoints(
     $lat, $lon, $arrapt->lat, $arrapt->lng));
     # Estimate the time remaining
     if($xml->liveupdate->groundSpeed > 0)
     {
     $Minutes = round($dist_remain / $xml->liveupdate->groundSpeed * 60);
     $time_remain = self::ConvertMinutes2Hours($Minutes);
     }
     else
     {
     $time_remain = '00:00';
     }
    
     // Start Trackingrecord
     $pid = $pilotid;
     $flug = $xml->liveupdate->slightNumber;
     $acrf = $xml->liveupdate->registration;
     //	 $lat
     //	 $lon
     $alt = $xml->liveupdate->altitude;
     $gs = $xml->liveupdate->groundSpeed;
     $dep = $xml->liveupdate->depICAO;
     $arr = $xml->liveupdate->arrICAO;
     $rte = $xml->liveupdate->route;
     $deptime = $xml->liveupdate->depTime;
     $eindeutige_flugnummer = $pid.$flug.$dep.$arr.$deptime;
     $md5id = md5($eindeutige_flugnummer);
    
     $sql = "INSERT INTO tracker_daten ('pilot', 'flug', 'acrf', 'lat', 'lon', 'alt', 'gs', 'dep', 'arr', 'rte', 'deptime', 'md5id') VALUES ('$pid', '$flug', '$acrf', '$lat', '$lon', '$alt', '$gs', '$dep', '$arr', $rte', '$deptime', '$md5id')";
     $go = mysql_query($sql);
    
     // End Trackingrecord
    
     $fields = array(
     'pilotid'	 =>$pilotid,
     'flightnum'	 =>$xml->liveupdate->flightNumber,
     'pilotname'	 =>'',
     'aircraft'	 =>$xml->liveupdate->registration,
     'lat'		 =>$lat,
     'lng'		 =>$lon,
     'heading'	 =>$xml->liveupdate->heading,
     'alt'		 =>$xml->liveupdate->altitude,
     'gs'			 =>$xml->liveupdate->groundSpeed,
     'depicao'	 =>$xml->liveupdate->depICAO,
     'arricao'	 =>$xml->liveupdate->arrICAO,
     'deptime'	 =>$xml->liveupdate->depTime,
     'arrtime'	 =>'',
     'route'		 =>$xml->liveupdate->route,
     'distremain'	 =>$dist_remain,
     'timeremaining' =>$time_remain,
     'phasedetail' =>$xml->liveupdate->status,
     'online'		 =>'',
     'client'		 =>'FlyHigh.acars',
     );
     #$this->log("UpdateFlightData: \n".print_r($fields, true), 'kacars');
     ACARSData::UpdateFlightData($pilotid, $fields);
    
    
     break;
    
    

    The problem now is: MySQL-Table "tracker_daten" is stil empty, but "acarsdata"-table become new data.

    Can you help me?

×
×
  • Create New...