Переглянути джерело

Add script to export data to CSV

This can be imported by Libra for Android
master
Chris Smith 14 роки тому
джерело
коміт
79f2b94d1e
1 змінених файлів з 17 додано та 0 видалено
  1. 17
    0
      export.php

+ 17
- 0
export.php Переглянути файл

@@ -0,0 +1,17 @@
1
+<?PHP
2
+
3
+ require('user-data.php');
4
+
5
+ /* For format of user-data.php see comment in data.php.
6
+  *
7
+  * In addition, this script requires a START_DATE constant containing
8
+  * the unix timestamp of the first entry in the $data array.
9
+  */
10
+
11
+ foreach ($data as $week => $value) {
12
+  if ($value != -1) {
13
+   echo date('Y-m-d', strtotime('+' . $week . ' weeks', START_DATE)), ';', $value, "\n";
14
+  }
15
+ }
16
+
17
+?>

Завантаження…
Відмінити
Зберегти