Initial conversion to PHP
Further coversion to PHP, incl. fpdf functions
Working PHP version - need to work on switches