setSpreadsheetKey("0AuPh9cI948YxdGFTcG0tNEZQdExtQkVxUlZyQW5tbkE"); $query->setWorksheetId("od6"); } catch (Exception $e) { die('ERROR: ' . $e->getMessage()); } // Get a list of the 2nd, 3rd, and 4th row (glossary_media, glossary_name, glossary_definition) and put into an array $query->setReturnEmpty(true); $query->setMinCol(2); $query->setMaxCol(4); $query->setMinRow(2); $cellFeed = $service->getCellFeed($query); // Populate the data_arrays $array_counter = 1; foreach ($cellFeed as $cellEntry) { if ($array_counter == 1) { $glossary_medias[] = str_replace(" ", "", $cellEntry->getCell()->getText()); } elseif ($array_counter == 2) { $glossary_names[] = $cellEntry->getCell()->getText(); } elseif ($array_counter == 3) { $glossary_definitions[] = str_replace("\n", "
", $cellEntry->getCell()->getText()); } // Reset array counter when all of row data is entered $array_counter < 3 ? $array_counter++ : $array_counter = 1; } // Show specific glossary_name when link is clicked /* if ($heme_glossary_name) { if (array_search($heme_glossary_name, $glossary_names)) { echo "

Transfusion Medicine Glossary



\n"; echo "$heme_glossary_name : " . $glossary_definitions[array_search($heme_glossary_name, $glossary_names)] . "

\n"; echo "<< Back to Transfusion Medicine Glossary

\n"; print_footer(); exit; } else { echo "Glossary term not found."; } } */ // Show list of terms for comparison and put them in a table if ($checkedname) { echo "

Comparing Selected Glossary Terms


\n"; echo "<< Back to Transfusion Medicine Glossary

\n"; echo "\n"; // Get all images for ($i = 0; $i < count($checkedname); $i++) { $media_string = ''; if ($glossary_medias[array_search($checkedname[$i], $glossary_names)]) { // Check to see if any media links are associated with glossary name unset($media_list); $media_list = explode(",", $glossary_medias[array_search($checkedname[$i], $glossary_names)]); for ($z = 0; $z < count($media_list); $z++) { $media_string .= "
Figure " . ($z+1) . "


\n"; } $media_string = "

" . $media_string . "
\n"; } echo "\n"; } echo "
$checkedname[$i]

" . $media_string . "
" . $glossary_definitions[array_search($checkedname[$i], $glossary_names)] . "
\n"; print_footer(); exit; } ?>

Transfusion Medicine Glossary



Go To: A | B | C | D | E | F | G | H | I | J | K | L | M | N | O | P | Q | R | S | T | U | V | W | X | Y | Z


\n"; $ALPHABET_COUNTER++; } // Alternating background row color $color == '#ffffff' ? $color = '#eeeeee' : $color = '#ffffff'; // Parse the definition for all glossary terms and set hyperlinks $str_link = ""; // Reset the definition string for ($y = 0; $y < count($glossary_names); $y++) { // Loop through all glossary names if ($str_link == "") $str_link = $glossary_definitions[$x]; // Set initial definition string as original if (stripos($glossary_definitions[$x], $glossary_names[$y])) { // The name is found within the definition text, so continue //Check the case of the name in the original definition text against the array of terms that should always be alphabetized if (in_array($glossary_names[$y], $CAPITAL_TERMS)) { $fixed_glossary_name = str_replace("'", "'", $glossary_names[$y]); } else { $fixed_glossary_name = strtolower(str_replace("'", "'", $glossary_names[$y])); } // Don't need to highlight its own glossary_definition ???FIX??? //if (!stristr($glossary_definitions[$x], $glossary_names[$x])) { // Build a string -- a definition may have multiple terms within it $str_link = str_replace_word($glossary_names[$y], "$fixed_glossary_name\n", $str_link); //} } } // Extract media (possibly multiple) for glossary name, if any $media_string = ''; if ($glossary_medias[$x]) { // Check to see if any media links are associated with glossary name unset($media_list); $media_list = explode(",", $glossary_medias[$x]); for ($z = 0; $z < count($media_list); $z++) { $media_string .= "  
Figure " . ($z+1) . "

\n"; } $media_string = "

" . $media_string . "

\n"; } echo "\n"; } ?>
Back to top ^

" . $ARRAY_ALPHABET[$ALPHABET_COUNTER] . "


" . $glossary_names[$x] . " " . $str_link . $media_string . "