get_row($vQuery); # hack for future codes - if the code isn't found in the # DB but is one of our as-yet-unpublished future codes # show the special 'coming soon' page if (!is_object( $vRow)){ if (isRedirectCode($vCode)){ $vLocation = "https://edcoexampapers.ie/edco-exam-mobile-audio-app/"; } else if (isFutureCode( $vCode)){ $vLocation = "coming_soon.php?questioncode=" . $vCode; } else { $vReason = ''; if (isExpiredCode( $vCode)){ $vReason = '&reason=expired'; } else if (isProjectMathsCode( $vCode)){ $vReason = '&reason=projectmaths'; } else if (isWithdrawnCode( $vCode)){ $vReason = '&reason=withdrawn'; } $vLocation = "not_found.php?questioncode=" . $vCode . $vReason; } header("Location: $vLocation\n\n"); } # as of Jan 2021, we have multiple types of codes in the accesscode table # type 1 = tutorial, type 2 = aural, type 3 = teacher PDF downloads # redirect to the appropriate handler page for each type. switch($vRow->codetype_id){ case 2: # aural content $vLocation = "aural.php?questioncode=" . $vCode; header("Location: $vLocation\n\n"); break; case 3: # teacher content - downloadable PDFs $vLocation = "teacher.php?questioncode=" . $vCode; header("Location: $vLocation\n\n"); break; default: break; } # if we can't retrieve the portal ID from the DB, redirect to # the error page #if (!is_object( $vRow)){ #$vLocation = "not_found.php?questioncode=" .$vCode; #header("Location: $vLocation\n\n"); #} $id = $vRow->docfragment_id; } # if we've gotten this far, the code is valid or the ID is defined. # Pull the tutorial info from the DB if (isset($id)){ # retrieve doc via ID $vDocIDs = array(); // stores the IDs of related documents if available $vDocIDs['portal'] = $_GET['port']; $vDocIDs['preparatory'] = $_GET['prep']; $vDocIDs['solution'] = $_GET['soln']; $vDocIDs['tip'] = $_GET['tip']; # create link URLs for use in prep/ans/tip navigation section $vLinks = array(); $vLinks['portal'] = sprintf("?id=%s&port=%s&prep=%s&soln=%s&tip=%s", $vDocIDs['portal'], $vDocIDs['portal'], $vDocIDs['preparatory'], $vDocIDs['solution'], $vDocIDs['tip']); $vLinks['preparatory'] = sprintf("?id=%s&port=%s&prep=%s&soln=%s&tip=%s", $vDocIDs['preparatory'], $vDocIDs['portal'], $vDocIDs['preparatory'], $vDocIDs['solution'], $vDocIDs['tip']); $vLinks['solution'] = sprintf("?id=%s&port=%s&prep=%s&soln=%s&tip=%s", $vDocIDs['solution'], $vDocIDs['portal'], $vDocIDs['preparatory'], $vDocIDs['solution'], $vDocIDs['tip']); $vLinks['tip'] = sprintf("?id=%s&port=%s&prep=%s&soln=%s&tip=%s", $vDocIDs['tip'], $vDocIDs['portal'], $vDocIDs['preparatory'], $vDocIDs['solution'], $vDocIDs['tip']); $vTypes = array( "portal" => "Portal", "preparatory" => "Preparation", "solution" => "Answer", "tip" => "Smart Tips!" ); // retrieve any images associated with this document $vSQL = "SELECT * FROM image_docfragment where docfragment_id='$id'"; $vResults = $db->get_results($vSQL); // for each image associated with this doc, pull it out of the DB and // save it to disk if (is_array($vResults)){ foreach ($vResults as $vRow){ // if the image isn't in the cache we need to extract it from the DB // and put it in the image cache. if (!isImgCached($vRow->image_id)){ $vSQL = "SELECT * FROM image where id='" . $vRow->image_id . "'"; $vRow = $db->get_row($vSQL); if (is_object($vRow)){ saveImage( $vRow->id, $vRow->mimetype, $vRow->data); } } } } $vSQL = "SELECT title, content, type, subquestion, subject_id FROM docfragment where id='$id'"; $vRow = $db->get_row($vSQL); if (is_object($vRow)){ $vTitle = $vRow->title; $subq = $vRow->subquestion; $vData = AddGlossaryInfo( $vRow->content, $vRow->subject_id); $vType = $vRow->type; } else { $vTitle = "could not find tutorial."; $vData = "Could not retrieve data for document ID=$id. Please contact the systems administrator."; } // for all kinds of content except the portal pages, we can // just spit the data straight out. For portals, we have to // generate a table with links to the appropriate prep, solution // and tips pages as well as the correct text description of // each question if ('portal' == $vType){ $prep = array(); $solution = array(); $tip = array(); if (false != getLinkedFiles( $id, $prep, $solution, $tip)){ $vData = portalList2( $id, $vData, $prep, $solution, $tip); $vTypes['portal'] = $vTitle; } else { $vData = "No files linked for ID=$id."; } } } ?> <?= $vTitle; ?>
Enter the code found on your
Edco Exam Papers here:
class="portal" >