diff --git a/.bzrignore b/.bzrignore
new file mode 100644
index 0000000..cd1d28e
--- /dev/null
+++ b/.bzrignore
@@ -0,0 +1,2 @@
+load.php
+import
diff --git a/api.php b/api.php
new file mode 100755
index 0000000..0cf4b83
--- /dev/null
+++ b/api.php
@@ -0,0 +1,30 @@
+.
+ */
+
+require 'load.php';
+
+// DB#getResults() ti dà un array di oggetti
+$price = $db->getResults(
+ "SELECT * " .
+ "FROM price " .
+ "LIMIT 5"
+);
+
+http_json_header();
+
+echo json_encode($price, JSON_PRETTY_PRINT);
diff --git a/import.php b/import.php
new file mode 100755
index 0000000..a64c566
--- /dev/null
+++ b/import.php
@@ -0,0 +1,81 @@
+CIAO");
+// Ogni volta che lancio svuota il DB e lo riempe di merda
+
+$db->query("TRUNCATE station");
+$db->query("TRUNCATE price");
+
+echo("
STAR Tabella price
");
+try
+ {
+ $fileName = 'import/prezzo_alle_8.csv';
+ if ( !file_exists($fileName) ) {
+ throw new Exception('File not found.');
+ }
+ $handle = fopen($fileName, "r");
+ if ( !$handle ) {
+ throw new Exception('File open failed.');
+ }
+ fgetcsv($handle); // get line 0 and move pointer to line 1
+ fgetcsv($handle); // get line 1 and move pointer to line 2
+ while(($data = fgetcsv($handle, 255, ";")) !== FALSE) {
+ $db->insertRow(
+ 'price',
+ [
+ new DBCol('idImpianto', intval($data[0]), 'd'),
+ new DBCol('descCarburante', $data[1], 's'),
+ new DBCol('prezzo', floatval($data[2]), 'f'),
+ new DBCol('isSelf', intval($data[3]), 'd'),
+ new DBCol('dtComu', $data[4], 's')
+ ]
+ );
+ }
+ fclose($handle);
+ // send success JSON
+
+ } catch ( Exception $e ) {
+ // send error message if you can
+ echo($e->getMessage());
+ }
+echo("END Tabella price
");
+echo("STAR Tabella station
");
+try
+ {
+ $fileName = 'import/prezzo_alle_8.csv';
+ if ( !file_exists($fileName) ) {
+ throw new Exception('File not found.');
+ }
+ $handle = fopen($fileName, "r");
+ if ( !$handle ) {
+ throw new Exception('File open failed.');
+ }
+ fgetcsv($handle); // get line 0 and move pointer to line 1
+ fgetcsv($handle); // get line 1 and move pointer to line 2
+ while(($data = fgetcsv($handle, 255, ";")) !== FALSE) {
+ $db->insertRow(
+ 'station',
+ [
+ new DBCol('idImpianto', intval($data[0]), 'd'),
+ new DBCol('gestore', $data[1], 's'),
+ new DBCol('bandiera', $data[2], 's'),
+ new DBCol('tipoImpianto', $data[3], 's'),
+ new DBCol('nomeImpianto', $data[4], 's'),
+ new DBCol('indirizzo', $data[5], 's'),
+ new DBCol('comune', $data[6], 's'),
+ new DBCol('provincia', $data[7], 's'),
+ new DBCol('latitudine', floatval($data[8]), 'f'),
+ new DBCol('longitudine', intval($data[9]), 'f')
+ ]
+ );
+ }
+ fclose($handle);
+ // send success JSON
+
+ } catch ( Exception $e ) {
+ // send error message if you can
+ echo($e->getMessage());
+ }
+echo("END Tabella station
");
+echo("FINE
");
diff --git a/includes/footer.php b/includes/footer.php
new file mode 100755
index 0000000..35513db
--- /dev/null
+++ b/includes/footer.php
@@ -0,0 +1,25 @@
+.
+ */
+
+function get_footer($page = null, $args = null) {
+?>
+
+
+