Пример #1
0
<?php

/** --- B A S E F U N C T I O N S ---
    This file sets up project-wide things like authentication -
    DO NOT REMOVE
**/
include 'core/protostrap.php';
/** Define VALUES  valid for this file **/
$activeNavigation = "one";
$firmen = get_spreadsheetData("https://docs.google.com/spreadsheets/d/1pYV5OwCy4YW-a0e1bOS9cU4sZpjcGHzSu_F08xgFHzg/edit?usp=sharing", "firmen");
?>
<!DOCTYPE html>
<html >
    <head>
        <title><?php 
echo $application . " - " . $brand;
?>
</title>
        <?php 
// this includes all the markup that loads css files and similar stuff,
// if you have to add more css, that's the place to do it.
// DO NOT REMOVE
include snippet("meta_headTag");
?>

    </head>
<?php 
// uncomment the following function to force user to be logged in
// forceLogin();
?>
Пример #2
0
function updateYAMLfromSpreadsheets($linkedData)
{
    if (empty($_GET['updateYAML'])) {
        return;
    }
    if (!is_array($linkedData) or count($linkedData) < 1) {
        //echo "no Links available";
        return;
    }
    file_put_contents("../assets/data/dataFromSpreadsheets.yml", "");
    $flashMsg['type'] = "success";
    $flashMsg['text'] = "<b>Import successful</b><br>The following variables have been imported: <br>";
    foreach ($linkedData as $key => $url) {
        $flashMsg['text'] .= "<b>" . $key . "</b>, ";
        $val[$key] = get_spreadsheetData($url, $key);
        $yaml = Spyc::YAMLDump($val);
        unset($val);
        $GLOBALS['flashMsg'] = $flashMsg;
        file_put_contents("../assets/data/dataFromSpreadsheets.yml", $yaml, FILE_APPEND);
    }
}