` LASSE / DL1LLL: DP0GVN/p PALAOA
this way to Lasses Antarctic Photos
QRZ Call Sign Lookup
Who's Online
5 visitors online now
0 guests, 5 bots, 0 members
Flag Counter
free counters
since 10.10.2012

DP0GVN/p PALAOA

This is the Logbook from DP0GVN/P as Lasse (DL1LLL) worked from PALAOA Observatory

“);
print(“

“);
print(“

Datum

“);
print(“

MyCall

“);
print(“

Call

“);
print(“

Band

“);
print(“

Mode

“);
print(“

Report ausgehend

“);
print(“

Report eingehend

“);
print(“

Land

“);
print(“

“);

$counter = 0; ## Zählt die Einträge im LogFile

while(!feof($logfile)){
$data = explode(“\t”,fgets($logfile));
if($counter >= $startEntry && $counter < $next){ #t$mycall\t$call\t$band\t$mode\t$rst_sent\t$rst_rcvd\t$country $date = trim($data[0]); $mycall = trim($data[1]); $call = trim($data[2]); $band = trim($data[3]); $mode = trim($data[4]); $rst_sent = trim($data[5]); $rst_rcvd = trim($data[6]); $country = trim($data[7]); $countryImg = getCountry($country).".png"; print(" “);
print(“

$date

“);
print(“

$mycall

“);
print(“

$call

“);
print(“

$band

“);
print(“

$mode

“);
print(“

$rst_sent

“);
print(“

$rst_rcvd

“);
print(“

 $country

“);
print(“

“);
}
$counter++;
}

print(“

“);
## hier wird festgelegt, wie man weiter durch die Liste scrollt
## zurueck geht nur, wenn $prev !=0;
if($prev>=0){
print(“

<< zurueck

“);
}else{
print(“

<< zurueck

“);
}

print(“

 

“);

if($next<=$counter){ print(" vor >>

“);
}else{
print(“

vor >>

“);
}

print(“

“);
print(“

“);

fclose($logfile);
}

function checkTime($source,$target){

## überprüft ob das log.txt file neuern datums ist als das db-File
## ja = return 1;
## nein = return 0;
$changeSource = filectime($source);
$changeTarget = filectime($target);

if($changeTarget > $changeSource){
## dann target neuer und alles ok
return 1;
}else{
return 0;
}
}

function convertLog($source,$target){

print(“Konvertiere LOG File
“);

$file = file_get_contents($source);
$contents = substr($file, strpos($file, ‘‘) + strlen(‘‘));
$records = preg_split(‘//’, $contents);
$data = array();

## hier schon das filehandle für den output öffnen
$output = fopen(“$target”,”w+”);

## hier file scannen und infos in array schreiben
foreach ($records as $record) {
preg_match_all(‘/<(.*?):([0-9]*)>([^<]*)/', $record, $data[]); } $numRecords = sizeof($data); for($i=0;$i<$numRecords-1;$i++){ ## schöner wäre assoziatives array, aber so geht es erstmal auch: $date = "-"; $mycall = "-"; $call = "-"; $band = "-"; $mode = "-"; $rst_sent = "-"; $rst_rcvd = "-"; $country = "-"; $numFields = sizeof($data[$i][0]); for($j=0;$j<$numFields;$j++){ $fieldValue = trim($data[$i][3][$j]); $fieldName = trim($data[$i][1][$j]); $fieldLength = trim($data[$i][2][$j]); switch($fieldName){ case "qso_date": $date = $fieldValue; break; case "station_callsign": $mycall = $fieldValue; break; case "call": $call = $fieldValue; break; case "band": $band = $fieldValue; break; case "mode": $mode = $fieldValue; break; case "rst_sent": $rst_sent = $fieldValue; break; case "rst_rcvd": $rst_rcvd = $fieldValue; break; case "country": $country = $fieldValue; break; case "lat": $lat = $fieldValue; break; case "lon": $lon = $fieldValue; break; default: break; } } $year = substr($date,0,4); $month = substr($date,4,2); $day = substr($date,6,2); ## LAT und LON Formatieren ## TYP: S011 31.250 ## Erster Buchstabe + oder -> dann split mit leerzeichen

## LAT
$signLat = substr($lat,0,1);
$lat = substr($lat,1);
$latitude = explode(” “,$lat);
if($signLat == “N”){
$lat = $latitude[0]+($latitude[1]/60);
}else{
$lat = -($latitude[0]+($latitude[1]/60));
}

## LON
$signLon = substr($lon,0,1);
$lon = substr($lon,1);
$longitude = explode(” “,$lon);
if($signLon == “E”){
$lon = $longitude[0]+($longitude[1]/60);
}else{
$lon = -($longitude[0]+($longitude[1]/60));
}

## nun sind alle Infos für eine Zeile gesammelt und sie wird auf das Filehandle geschrieben
fwrite($output,”$year/$month/$day\t$mycall\t$call\t$band\t$mode\t$rst_sent\t$rst_rcvd\t$country\t$lat\t$lon\n”);

}

fclose($output);

}

?>

Leave a Reply

Protected by WP Anti Spam