Mentions légales du service

Skip to content
Snippets Groups Projects
Commit d00a8062 authored by VIEVILLE Thierry's avatar VIEVILLE Thierry
Browse files

from makefile

parent c8eed0ae
No related branches found
No related tags found
No related merge requests found
No preview for this file type
......@@ -2,16 +2,16 @@
{
// Gdrive arrays IDs
$data_sheets_IDS = array(
"Ressources" => "1xlI91FqGZ1XLltIcPe5_3IvASOVbSWKC5sdlGxrfWVk",
"Événements" => "1lFRQpuBVGoLg0Sj90nHjHsxKMFzmHv6oC7X0AT3AmmM",
"Questionnements" => "1IkqZP0WwdttFcMYVEn53DzpnaTESKtZYFqhJ6hA46jw",
"Événements" => "1lFRQpuBVGoLg0Sj90nHjHsxKMFzmHv6oC7X0AT3AmmM",
"Ressources" => "1xlI91FqGZ1XLltIcPe5_3IvASOVbSWKC5sdlGxrfWVk",
"Partenaires" => "1f18x3mIHlNXpFNRlMfJA6YGmPLbil5WxP8L71jlS2Fg",
);
// Gdrive arrays displayed fields
$data_sheets_fields = array(
"Ressources" => array("Titre", "URL", "URL2", "Auteur", "Éditeur", "Langue", "Objectif didactique ou pédagogique"),
"Événements" => array("Titre", "Type", "Cible", "Date", "Lieu", "Contact", "URL"),
"Questionnements" => array("Catégorie", "Domaine", "Question"),
"Événements" => array("Titre", "Type", "Cible", "Date", "Lieu", "Contact", "URL"),
"Ressources" => array("Titre", "URL", "URL2", "Auteur", "Éditeur", "Langue", "Objectif didactique ou pédagogique"),
"Partenaires" => array("Nom", "URL", "Contact"),
);
// Returns the value the record of the given $index for the given $fieldName in the given $sheetName
......@@ -43,21 +43,23 @@
if ($data_csv_contents[$sheetName][0][$index] == $fieldName)
$data_sheets_fields_index[$sheetName][$fieldName] = $index;
}
//-print_r($data_csv_contents);
}
// Now displays all data as HTML file
{
$html = "<html><head><meta charset='UTF-8;'></head><body>\n";
$html = "<html><head><meta charset='UTF-8'/></head><body>\n";
foreach($data_sheets_fields as $sheetName => $fieldNames) {
$html .= "<h2> Table des <a target='_blank' href='https://docs.google.com/spreadsheets/d/".$data_sheets_IDS[$sheetName]."'>". $sheetName."</a></h2><table>\n <tr>";
$html .= "<h2> Table des <a target='_blank' href='https://docs.google.com/spreadsheets/d/".$data_sheets_IDS[$sheetName]."'>". $sheetName."</a></h2><table style='max-width:1000px;border:1px'>\n <tr>";
foreach($fieldNames as $fieldName)
$html .= "<th>".$fieldName."</th>";
$html .= "</tr>\n";
for($index = 0; $index < get_data_count($sheetName); $index++) {
$html .= " <tr>";
foreach($fieldNames as $fieldName)
$html .= "<td>".get_data($sheetName, $fieldName, $index)."</td>";
if (preg_match("/^URL/", $fieldName) && get_data($sheetName, $fieldName, $index) != "")
$html .= "<td><a target='_blank'' href='".get_data($sheetName, $fieldName, $index)."'>url</a></td>";
else
$html .= "<td>".get_data($sheetName, $fieldName, $index)."</td>";
$html .= "</tr>\n";
}
$html .= "</table>";
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment