"; print ""; print ""; print ""; print ""; print "
The LORD JESUS is my rock,
and my fortress,
and my deliverer;
my God, my strength,
in whom I will trust.
from PSALM 18, 2 (KJV)
Work at Sea
   
Jesus Saves Work at Sea Pacific Mission Aviation Rhein 2012 Die Schweiz
zu Fuss
Kilimanjaro Bicycle Touring Wild Wild West Mediterranean Coast Death Valley Thailand BKK-CNX Bluegrass Express Baja California Switzerland Thailand and Laos Empire Builder Coyote Trail CHE-SWE Sun Seeker Southern Slingshot Heartland Express Dixie Queen Northern Delights Winter Wonderland Backslash Southern Sunrise Pacific Trilogy Corner Connector Pictures Websolutions Postcards and Stamps Contact Me

 

 

 

 

 

 

Ports by Country

This page helps me keep track of the ports visited by ship. Although "visited" sometimes only meant touching the pier or seeing the city from afar.

 
Calls: 2220
Ports: 832
Countries (political), excl. Antarctica: 104
Countries incl. Outlaying Territorries: 156
Average Port Re-Visiting Rate: 2.67x
 

 Call at anchor
 Cruising
 Expedition

  "; print "
\"".$line_rc["country"]."\" ".$line_rc["country"].""; if($number_of_calls_country == 1) { print $number_of_calls_country." call"; } else { print $number_of_calls_country." calls"; } print "
"; //Read Ports for this Country (without state) print ""; $sql_rp = "SELECT DISTINCT port FROM sea_itinerary WHERE country='".$line_rc["country"]."' AND state='' ORDER BY port ASC"; $res_rp = mysqli_query($db, $sql_rp) or die("SQL Error: [read ports]"); while($line_rp = mysqli_fetch_array($res_rp)) { //Read Numbers of Calls for this Port $sql_rpc = "SELECT * FROM sea_itinerary si INNER JOIN sea_contract sc ON si.contract_no=sc.id WHERE si.country='".$line_rc["country"]."' AND si.port='".$line_rp["port"]."' ORDER BY si.arrival"; //print $sql_rpc; $res_rpc = mysqli_query($db, $sql_rpc) or die("SQL Error: [read port calls]"); $number_of_calls = mysqli_num_rows($res_rpc); $details = "
"; $anchor_call = false; $anchor_port = false; //will be set true if at least one call to this port was at anchor $cruising_call = false; $cruising_port = false; //will be set true if at least one call to this port was cruising $expedition_call = false; $expedition_port = false; //will be set true if at least one call to this port was expedition while($line_rpc = mysqli_fetch_array($res_rpc)) { if($line_rpc["type"] == "A") { $anchor_call = true; $anchor_port = true; } if($line_rpc["type"] == "C") { $cruising_call = true; $cruising_port = true; } if($line_rpc["type"] == "E") { $expedition_call = true; $expedition_port = true; } $now = strtotime(date('Y-m-d')); $past = strtotime($line_rpc["arrival"]); $seconds = round($now - $past); $days = round($seconds/60/60/24); $years = floor($days/365); $remaining_days = $days - ($years*365); switch($years) { case "0": $y_text = ""; break; case "1": $y_text = "1 year, "; break; default: $y_text = $years." years, "; } switch($remaining_days) { case "1": $d_text = "1 day "; break; default: $d_text = $remaining_days." days "; } $details .= getDateFromTimeStamp($line_rpc["arrival"])." ".$line_rpc["vessel"]." - ".$y_text.$d_text." ago"; if($anchor_call) { $details .= " "; } if($cruising_call) { $details .= " "; } if($expedition_call) { $details .= " "; } $details .= "
"; $anchor_call = false; //reset for next call $cruising_call = false; //reset for next call $expedition_call = false; //reset for next call } $details .= "
"; print ""; print ""; print ""; print ""; print ""; $anchor_port = false; //reset for next port } print "
 "; print " ".$line_rp["port"]; if($anchor_port) { print " "; } if($cruising_port) { print " "; } if($expedition_port) { print " "; } print ""; if($number_of_calls == 1) { print $number_of_calls." call"; } else { print $number_of_calls." calls"; } print "
\n"; //Read Ports for this Country (with state) $sql_rs = "SELECT DISTINCT state FROM sea_itinerary WHERE country='".$line_rc["country"]."' AND state!='' ORDER BY state ASC"; $res_rs = mysqli_query($db, $sql_rs) or die("SQL Error: [read states]"); while($line_rs = mysqli_fetch_array($res_rs)) { //Make State Header //Lookup State Flag $sql_rf = "SELECT * FROM sea_flag WHERE country='".$line_rs["state"]."'"; $res_rf = mysqli_query($db, $sql_rf) or die("SQL Error: [read flag]"); if($line_rf = mysqli_fetch_array($res_rf)) { //Flag Found $flag_path = "flags/".$line_rf["filename"]; } else { $flag_path = "flags/none.gif"; } //Read Numbers of Calls for this State $sql_rsc = "SELECT * FROM sea_itinerary WHERE state='".$line_rs["state"]."'"; $res_rsc = mysqli_query($db, $sql_rsc) or die("SQL Error: [read state calls]"); $number_of_calls_state = mysqli_num_rows($res_rsc); print " "; print ""; print ""; print ""; print ""; print ""; print ""; print ""; print "
 \"".$line_rs["state"]."\" ".$line_rs["state"].""; if($number_of_calls_state == 1) { print $number_of_calls_state." call"; } else { print $number_of_calls_state." calls"; } print ""; print "
\n"; //List ports in that state print ""; $sql_rps = "SELECT DISTINCT port FROM sea_itinerary WHERE country='".$line_rc["country"]."' AND state='".$line_rs["state"]."' ORDER BY port ASC"; $res_rps = mysqli_query($db, $sql_rps) or die("SQL Error: [read port in state]"); while($line_rps = mysqli_fetch_array($res_rps)) { //Read Numbers of Calls for this Port $sql_rpc = "SELECT * FROM sea_itinerary si INNER JOIN sea_contract sc ON si.contract_no=sc.id WHERE si.country='".$line_rc["country"]."' AND si.port='".$line_rps["port"]."' ORDER BY si.arrival"; $res_rpc = mysqli_query($db, $sql_rpc) or die("SQL Error: [read port calls]"); $number_of_calls = mysqli_num_rows($res_rpc); $details = "
"; $anchor_call = false; $anchor_port = false; //will be set true if at least one call to this port was at anchor $cruising_call = false; $cruising_port = false; //will be set true if at least one call to this port was cruising $expedition_call = false; $expedition_port = false; //will be set true if at least one call to this port was expedition while($line_rpc = mysqli_fetch_array($res_rpc)) { if($line_rpc["type"] == "A") { $anchor_call = true; $anchor_port = true; } if($line_rpc["type"] == "C") { $cruising_call = true; $cruising_port = true; } if($line_rpc["type"] == "E") { $expedition_call = true; $expedition_port = true; } $now = strtotime(date('Y-m-d')); $past = strtotime($line_rpc["arrival"]); $seconds = round($now - $past); $days = round($seconds/60/60/24); $years = floor($days/365); $remaining_days = $days - ($years*365); switch($years) { case "0": $y_text = ""; break; case "1": $y_text = "1 year, "; break; default: $y_text = $years." years, "; } switch($remaining_days) { case "1": $d_text = "1 day "; break; default: $d_text = $remaining_days." days "; } $details .= getDateFromTimeStamp($line_rpc["arrival"])." ".$line_rpc["vessel"]." - ".$y_text.$d_text." ago"; if($anchor_call) { $details .= " "; } if($cruising_call) { $details .= " "; } if($expedition_call) { $details .= " "; } $details .= "
"; $anchor_call = false; //reset for next call $cruising_call = false; //reset for next call $expedition_call = false; //reset for next call } $details .= "
"; print ""; print ""; print ""; print ""; print ""; } print "
 "; print " ".$line_rps["port"]; if($anchor_port) { print " "; } if($cruising_port) { print " "; } if($expedition_port) { print " "; } print ""; if($number_of_calls == 1) { print $number_of_calls." call"; } else { print $number_of_calls." calls"; } print "
\n"; } print " "; } ?>