update parser function  outputSHIPS.php

convert mysqli functions to object oriented style and reformat
update parser function outputTRAINS.php

convert mysqli functions to object oriented style and reformat.
Also improve error message in outputSHIPS.php