Pārlūkot izejas kodu

Add script to export data to CSV

This can be imported by Libra for Android
master
Chris Smith 14 gadus atpakaļ
vecāks
revīzija
79f2b94d1e
1 mainītis faili ar 17 papildinājumiem un 0 dzēšanām
  1. 17
    0
      export.php

+ 17
- 0
export.php Parādīt failu

@@ -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
+?>

Notiek ielāde…
Atcelt
Saglabāt