[insert_php] if(!isset($_GET[‘gid’]) && !isset($_GET[‘rid’]) && (!isLoggedIn() || !isset($_GET[‘eid’]))){ echo ‘‘; } if(isset($_GET[‘gid’])){ $fileName = generateInvoice($_GET[‘gid’],1); $isPaid = groupRegistrationIsPaid($_GET[‘gid’]); }elseif(isset($_GET[‘rid’])){ $fileName = generateInvoice($_GET[‘rid’]); $isPaid = registrationIsPaid($_GET[‘rid’]); }elseif(isLoggedIn() && isset($_GET[‘eid’])){ $person = getPersonByPersonID($_SESSION[‘memberid’]); $registration = getRegistrationByEvent($person->personID, $_GET[‘eid’]); $fileName = generateInvoice($registration->registrationID); $isPaid = registrationIsPaid($registration->registrationID); }else{ echo ‘‘; } $url = “http://www.natmathematics.org/” . $fileName; echo ‘Download ‘ . ($isPaid ? ‘Receipt’ : ‘Invoice’) . ‘‘; echo ‘

‘; echo ‘‘; [/insert_php]