Working Boat List Query

Bill Kneller generating this page – requires database connection and secure login

Provides a list of all J/109s similar to the class page but includes email address, and if registered on the forum, a link to their forum profile.  We can also show the previous owners if known (do we want that?)

Owner List – J/109 Class Association


/> Add Previous Owners (PO) for display in list as sorted



\n”;
echo “

\n”;

while ($myrow = mysql_fetch_array($result)) {
if ($myrow[“contact_type_of”]==”OW” || $myrow[“contact_type_of”]==”CO” || $myrow[“contact_type_of”]==”PO”) {
// print one row of the owner’s list
echo “

” ;
if (!$myrow[contact_email] | $myrow[contact_email]==”None” | !$authorized) {
echo “

“;
}
echo “

“;
// This gets PO boat name from contact list, else use the hull list name
if ($myrow[‘contact_boatname’]) {
echo “

“;
} else {
echo “

“; }
echo “

“;
echo “

“;
$ContactCountry=$myrow[“contact_country”];
if ($ContactCountry==”” || $ContactCountry==”00″ || $ContactCountry==”UNITED STATES” || $ContactCountry==” ” || $ContactCountry==”USA”) { $ContactCountry=”USA”;
}
if ($ContactCountry==”ITL” || $ContactCountry==”ITALY”) { $ContactCountry=”ITL”;
}
if ($ContactCountry==”IRL” || $ContactCountry==”IRELAND”) { $ContactCountry=”IRL”;
}
if ($ContactCountry==”NOR” || $ContactCountry==”NORWAY”) { $ContactCountry=”NOR”;
}
if ($ContactCountry==”GBR” || $ContactCountry==”UNITED KINGDOM”) { $ContactCountry=”GBR”;
}
if ($ContactCountry==”FRA” || $ContactCountry==”FRANCE”) { $ContactCountry=”FRA”;
}
if ($ContactCountry==”NLD” || $ContactCountry==”NETHERLANDS”) { $ContactCountry=”NLD”;
}
if ($ContactCountry==”SUI” || $ContactCountry==”SWITZERLAND”) { $ContactCountry=”SUI”;
}
if ($ContactCountry==”CAN” || $ContactCountry==”CANADA”) { $ContactCountry=”CAN”;
}
if ($ContactCountry==”ESP” || $ContactCountry==”SPAIN”) { $ContactCountry=”ESP”;
}
if ($ContactCountry==”PHL” || $ContactCountry==”PHILIPPINES”) { $ContactCountry=”PHL”;
}
if ($ContactCountry==”HKG” || $ContactCountry==”HONG KONG”) { $ContactCountry=”HKG”;
}
if ($ContactCountry==”AUS” || $ContactCountry==”AUSTRALIA”) { $ContactCountry=”AUS”;
}
if ($ContactCountry==”SWE” || $ContactCountry==”SWEDEN”) { $ContactCountry=”SWE”;
}
if ($ContactCountry==”FIN” || $ContactCountry==”FINLAND”) { $ContactCountry=”FIN”;
}
if ($ContactCountry==”DEU” || $ContactCountry==”GERMANY”) { $ContactCountry=”DEU”;
}
if ($ContactCountry==”MLT” || $ContactCountry==”MALTA”) { $ContactCountry=”MLT”;
}
if ($ContactCountry==”BLG” || $ContactCountry==”BELGIUM”) { $ContactCountry=”BLG”;
}
if ($ContactCountry==”BER” || $ContactCountry==”BERMUDA”) { $ContactCountry=”BER”;
}
if ($ContactCountry==”PRI” || $ContactCountry==”PUERTO RICO”) { $ContactCountry=”PRI”;
}
if ($ContactCountry==”CHL” || $ContactCountry==”CHILE”) { $ContactCountry=”CHL”;
}
if ($ContactCountry==”MEX” || $ContactCountry==”MEXICO”) { $ContactCountry=”MEX”;
}
if ($ContactCountry==”JPN” || $ContactCountry==”JAPAN”) { $ContactCountry=”JPN”;
}
echo “

“;
echo “

“;
echo “

“;

//get dues info
$memberstatus = ” “;
$id = $myrow[“contact_id”];
$result1 = mysql_query(“SELECT *, dues_year FROM dues, contact WHERE dues_id=$id ORDER BY dues_year DESC LIMIT 1”,$db) or die (“Query failed, error message = ” . mysql_error ());
if ($myrow1 = mysql_fetch_array($result1)) {
if ($myrow1[“dues_amount”] > 0) {
if ($myrow[“contact_type_of”] == “OW” || $myrow[“contact_type_of”] == “CO”) $memberstatus = “Member ” . $myrow1[“dues_year”];
if ($myrow[“contact_type_of”] == “AM”) $memberstatus = “Associate ” . $myrow1[“dues_year”];
}
}
// echo “

\n” ;
}
}
echo “

By default, the list is ordered by hull number. To order in some other way, just click the column header at the top of each column. The Owner/Co-Owner name is formatted as an email link that you may click on to email that individual. If you would like to update your contact information, you may do so on the Update My Info page or by contacting admin@j109.org.


Click on column headings to reorder the list.
Status key: OW = Owner; CO = Co-owner; PO = Previous Owner
Hull Owner/Co-Owner Type Boat Name Owner City

State

Country Home Port  Fleet 
” . ($myrow[“contact_hullno”]==’999′?” “:$myrow[“contact_hullno”]) . “  ” . $myrow[“contact_first”] . ” ” . $myrow[“contact_last”];
} else {
echo “

 “.$myrow[“contact_first”].” “.$myrow[“contact_last”].” “.$myrow[“contact_type_of”].”   “.$myrow[“contact_boatname”].”   “.$myrow[“hull_boatname”].”  “;
echo $myrow[“contact_city”];
echo ” 
“;
echo $myrow[“contact_state”];
echo ” 
$ContactCountry  “.$myrow[“hull_homeport”].”  “.$myrow[“hull_fleet”].” – “.$myrow[“fleet_descr”].” “.$memberstatus.”

\n” ;
// Graceful exit below for someone who is not logged in
else:
echo ““;
echo “This page contains information restricted from general public access per section 2.3 of the J/109 Class Constitution. Only J/109 Class authorized users who are logged in may view this information

“;

echo “If you see this message and are a J/109 Class authorized user, you are not logged in.“;
echo “
“;
endif;

?>

Permanent link to this article: https://j109.org/working-boat-list-query/