getSpreadsheetEntry('https://spreadsheets.google.com/feeds/spreadsheets/' . $spreadsheet_key); // Get worksheets in this spreadsheet, should be only one $wsFeed = $ssEntry->getWorksheets(); } catch (Exception $e) { die('ERROR: ' . $e->getMessage()); } // Get worksheet data foreach ($wsFeed as $wsEntry): $rows = $wsEntry->getContentsAsRows(); foreach ($rows as $row): foreach($row as $key => $value): // Populate data arrays for manipulation // $all_keys[] = $key; // Don't really need the keys, because the header titles are in the values $all_values[] = str_replace("\n", "
", $value); endforeach; endforeach; endforeach; // Populate data arrays for later manipulation $total_rows = count($all_values) / count($row); for ($y = 0; $y < count($all_values); $y++) { // Populate the header and text arrays if ($y < count($row)) { $all_headers[] = $all_values[$y]; } else { $all_texts[] = str_replace("IMG_DIR", "./section_images", $all_values[$y]); // Replace IMG_DIR with actual directory of images } } // The page layout will use the data in reverse, so reverse the arrays $reverse_all_headers = array_reverse($all_headers); $reverse_all_texts = array_reverse($all_texts); // Print out full case outline if ($show_full) { echo "

Cases: Full Outline

"; echo "‹ Back to Case Booklet


"; echo "
"; for ($z = count($all_headers) - 3; $z > -1; $z--) { // End at the second to last column of the spreadsheet echo "$reverse_all_headers[$z]

\n"; echo "" . strip_tags($reverse_all_texts[$z], '



') . "


\n"; } echo "

"; print_footer(); exit; } ?> ‹ Back to Cases

Cases

--


--

















Case: