JustinFHI Posted July 26, 2014 Report Share Posted July 26, 2014 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? Quote Link to comment Share on other sites More sharing options...
JustinFHI Posted July 29, 2014 Author Report Share Posted July 29, 2014 Doesn't anybody know an answer? Quote Link to comment Share on other sites More sharing options...
CedGauche Posted July 29, 2014 Report Share Posted July 29, 2014 Can you post a screenshot of the structure of the table "Tracker Daten"? 1 Quote Link to comment Share on other sites More sharing options...
JustinFHI Posted July 30, 2014 Author Report Share Posted July 30, 2014 Hi, here is the structure Quote Link to comment Share on other sites More sharing options...
CedGauche Posted July 30, 2014 Report Share Posted July 30, 2014 Looking good, I guess there is an error in the script. Do you have direct acces to the webserver, so you could make a test query and check if you can write into the database/table? Quote Link to comment Share on other sites More sharing options...
JustinFHI Posted July 30, 2014 Author Report Share Posted July 30, 2014 Yes it is my own root-server. I can write to the table but only via SQL-Query and via an extra script. Via kACARS it doesn't work... Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.