Browse Source

changed server things. hope it doesn't blow up.

christian 3 years ago
parent
commit
735a6fbfe1
68 changed files with 171 additions and 537 deletions
  1. 0
    1
      platforms/android/app/src/main/assets/www/Server/BARRO.json
  2. 0
    1
      platforms/android/app/src/main/assets/www/Server/CRISTAL.json
  3. 0
    1
      platforms/android/app/src/main/assets/www/Server/CUERO.json
  4. 0
    1
      platforms/android/app/src/main/assets/www/Server/FIBRAS .json
  5. 0
    1
      platforms/android/app/src/main/assets/www/Server/HIGÜERA.json
  6. 0
    1
      platforms/android/app/src/main/assets/www/Server/INSTRUMENTOS TÍPICOS.json
  7. 0
    1
      platforms/android/app/src/main/assets/www/Server/JUGUETES TRADICIONALES.json
  8. 0
    1
      platforms/android/app/src/main/assets/www/Server/LABORES EN AGUJA.json
  9. 0
    1
      platforms/android/app/src/main/assets/www/Server/MADERA.json
  10. 0
    1
      platforms/android/app/src/main/assets/www/Server/METAL.json
  11. 0
    1
      platforms/android/app/src/main/assets/www/Server/MÁSCARAS.json
  12. 0
    1
      platforms/android/app/src/main/assets/www/Server/TABACOS.json
  13. 0
    1
      platforms/android/app/src/main/assets/www/Server/TEXTILES.json
  14. 0
    76
      platforms/android/app/src/main/assets/www/Server/driveToJson.php
  15. 0
    1
      platforms/android/app/src/main/assets/www/Server/renglones.json
  16. 1
    1
      platforms/android/app/src/main/assets/www/css/index.css
  17. 0
    1
      platforms/android/app/src/main/assets/www/data/BARRO.json
  18. 0
    1
      platforms/android/app/src/main/assets/www/data/CARETAS.json
  19. 0
    1
      platforms/android/app/src/main/assets/www/data/CRISTAL.json
  20. 0
    1
      platforms/android/app/src/main/assets/www/data/CUERO.json
  21. 0
    1
      platforms/android/app/src/main/assets/www/data/FIBRAS.json
  22. 0
    1
      platforms/android/app/src/main/assets/www/data/HIGÜERA.json
  23. 0
    1
      platforms/android/app/src/main/assets/www/data/INSTRUMENTOSTÍPICOS.json
  24. 0
    1
      platforms/android/app/src/main/assets/www/data/JUGUETESTRADICIONALES.json
  25. 0
    1
      platforms/android/app/src/main/assets/www/data/LABORESENAGUJA.json
  26. 0
    1
      platforms/android/app/src/main/assets/www/data/MADERA.json
  27. 0
    1
      platforms/android/app/src/main/assets/www/data/METAL.json
  28. 0
    1
      platforms/android/app/src/main/assets/www/data/TABACOS.json
  29. 0
    1
      platforms/android/app/src/main/assets/www/data/TEXTILES.json
  30. 0
    76
      platforms/android/app/src/main/assets/www/data/driveToJson.php
  31. 0
    1
      platforms/android/app/src/main/assets/www/data/renglones.json
  32. 70
    59
      platforms/android/app/src/main/assets/www/index.html
  33. 8
    1
      platforms/android/app/src/main/assets/www/js/azar.js
  34. 1
    7
      platforms/android/app/src/main/assets/www/js/load.js
  35. 17
    23
      platforms/android/app/src/main/assets/www/js/renglones.js
  36. 0
    1
      www/Server/BARRO.json
  37. 0
    1
      www/Server/CRISTAL.json
  38. 0
    1
      www/Server/CUERO.json
  39. 0
    1
      www/Server/FIBRAS .json
  40. 0
    1
      www/Server/HIGÜERA.json
  41. 0
    1
      www/Server/INSTRUMENTOS TÍPICOS.json
  42. 0
    1
      www/Server/JUGUETES TRADICIONALES.json
  43. 0
    1
      www/Server/LABORES EN AGUJA.json
  44. 0
    1
      www/Server/MADERA.json
  45. 0
    1
      www/Server/METAL.json
  46. 0
    1
      www/Server/MÁSCARAS.json
  47. 0
    1
      www/Server/TABACOS.json
  48. 0
    1
      www/Server/TEXTILES.json
  49. 0
    76
      www/Server/driveToJson.php
  50. 0
    1
      www/Server/renglones.json
  51. 0
    1
      www/data/BARRO.json
  52. 0
    1
      www/data/CARETAS.json
  53. 0
    1
      www/data/CRISTAL.json
  54. 0
    1
      www/data/CUERO.json
  55. 0
    1
      www/data/FIBRAS.json
  56. 0
    1
      www/data/HIGÜERA.json
  57. 0
    1
      www/data/INSTRUMENTOSTÍPICOS.json
  58. 0
    1
      www/data/JUGUETESTRADICIONALES.json
  59. 0
    1
      www/data/LABORESENAGUJA.json
  60. 0
    1
      www/data/MADERA.json
  61. 0
    1
      www/data/METAL.json
  62. 0
    1
      www/data/TABACOS.json
  63. 0
    1
      www/data/TEXTILES.json
  64. 0
    76
      www/data/driveToJson.php
  65. 0
    1
      www/data/renglones.json
  66. 56
    56
      www/index.html
  67. 1
    7
      www/js/load.js
  68. 17
    23
      www/js/renglones.js

+ 0
- 1
platforms/android/app/src/main/assets/www/Server/BARRO.json
File diff suppressed because it is too large
View File


+ 0
- 1
platforms/android/app/src/main/assets/www/Server/CRISTAL.json
File diff suppressed because it is too large
View File


+ 0
- 1
platforms/android/app/src/main/assets/www/Server/CUERO.json
File diff suppressed because it is too large
View File


+ 0
- 1
platforms/android/app/src/main/assets/www/Server/FIBRAS .json
File diff suppressed because it is too large
View File


+ 0
- 1
platforms/android/app/src/main/assets/www/Server/HIGÜERA.json
File diff suppressed because it is too large
View File


+ 0
- 1
platforms/android/app/src/main/assets/www/Server/INSTRUMENTOS TÍPICOS.json
File diff suppressed because it is too large
View File


+ 0
- 1
platforms/android/app/src/main/assets/www/Server/JUGUETES TRADICIONALES.json
File diff suppressed because it is too large
View File


+ 0
- 1
platforms/android/app/src/main/assets/www/Server/LABORES EN AGUJA.json
File diff suppressed because it is too large
View File


+ 0
- 1
platforms/android/app/src/main/assets/www/Server/MADERA.json
File diff suppressed because it is too large
View File


+ 0
- 1
platforms/android/app/src/main/assets/www/Server/METAL.json
File diff suppressed because it is too large
View File


+ 0
- 1
platforms/android/app/src/main/assets/www/Server/MÁSCARAS.json
File diff suppressed because it is too large
View File


+ 0
- 1
platforms/android/app/src/main/assets/www/Server/TABACOS.json View File

@@ -1 +0,0 @@
1
-[{"Nombre":"\u00c1ngel Otero Cotto","Especificaciones":"Cigarros, Mascadura","Tel\u00e9fono 1":"(939) 350-4999","E-mail":"papiroscigars@gmail.com","Municipio":"Cidra PR","id":0},{"Nombre":"\u00c1ngel Otero Vicente","Especificaciones":"Cigarros, Mascadura","Tel\u00e9fono 1":"(787) 595-1431","E-mail":"papiroscigars@gmail.com","Municipio":"Cidra PR","id":1},{"Nombre":"Angelo Vel\u00e1zquez Santiago","Especificaciones":"Cigarros","Tel\u00e9fono 1":"(787) 396-0941","E-mail":"velazquezcigars@hotmail.com","Municipio":"Aguas Buenas PR","id":2},{"Nombre":"Carlos M. Del Valle Mel\u00e9ndez","Especificaciones":"Cigarros","Tel\u00e9fono 1":"(787) 380-9122","E-mail":"cdelvalle1229@yahoo.com","Municipio":"Gu\u00e1nica PR","id":3},{"Nombre":"Jos\u00e9 A. V\u00e9lez Burgos","Especificaciones":"Cigarros, Muebles, Restaurador","Tel\u00e9fono 1":"(787) 648-2858","E-mail":"velez.jose751@gmail.com","Municipio":"Yauco PR","id":4},{"Nombre":"Patricio A. Pe\u00f1a","Especificaciones":"","Tel\u00e9fono 1":"(787) 785-8619","E-mail":"","Municipio":"Bayam\u00f3n PR","id":5}]

+ 0
- 1
platforms/android/app/src/main/assets/www/Server/TEXTILES.json
File diff suppressed because it is too large
View File


+ 0
- 76
platforms/android/app/src/main/assets/www/Server/driveToJson.php View File

@@ -1,76 +0,0 @@
1
-<?php
2
-header('Content-type: application/json');
3
- 
4
-
5
- 
6
-// Function to convert CSV into associative array
7
-function csvToArray($file, $delimiter) { 
8
-  if (($handle = fopen($file, 'r')) !== FALSE) { 
9
-    $i = 0; 
10
-    while (($lineArray = fgetcsv($handle, 4000, $delimiter, '"')) !== FALSE) { 
11
-      for ($j = 0; $j < count($lineArray); $j++) { 
12
-        $arr[$i][$j] = $lineArray[$j]; 
13
-      } 
14
-      $i++; 
15
-    } 
16
-    fclose($handle); 
17
-  } 
18
-  return $arr; 
19
-} 
20
- 
21
-function formatArray ($feed) {
22
-
23
-  $keys = array();
24
-  $newArray = array();
25
-  $data = csvToArray($feed, ',');
26
- 
27
-  $count = count($data) - 1;
28
- 
29
-  $labels = array_shift($data);  
30
- 
31
-  foreach ($labels as $label) {
32
-    $keys[] = $label;
33
-  }
34
- 
35
-  $keys[] = 'id';
36
- 
37
-  for ($i = 0; $i < $count; $i++) {
38
-    $data[$i][] = $i;
39
-  }
40
- 
41
-  for ($j = 0; $j < $count; $j++) {
42
-    $d = array_combine($keys, $data[$j]);
43
-    $newArray[$j] = $d;
44
-  }
45
-
46
-  return $newArray;
47
-
48
-}
49
- 
50
-$feed = 'https://docs.google.com/spreadsheets/d/e/2PACX-1vQUspPunAmkZrtfhMgMvGYGTK_4ONsCnSoe6OcTFc-4ILRHTatdPIwgRx1eRM1qFTkYFMrvcx8OI4cv/pub?output=csv';
51
-
52
-$data = formatArray($feed);
53
-
54
-$info = json_encode($data);
55
-
56
-$infoAsJson = json_decode($info);
57
-
58
-
59
-
60
-$handle = fopen("renglones.json", 'w');
61
-fwrite($handle, $info);
62
-
63
-
64
-
65
-for ($i = 0; $i < count($infoAsJson); $i++) {
66
-  $renglon = formatArray($infoAsJson[$i]->Link);
67
-  $renglonInfo = json_encode($renglon);
68
-  $renglonAsJson = json_decode($renglonInfo);
69
-  
70
-  $my_file = $infoAsJson[$i]->Renglones . ".json";
71
-  $handle = fopen($my_file, 'w') or die ('Cannot open file');
72
-  fwrite($handle, $renglonInfo);
73
-
74
-}
75
-
76
-?>

+ 0
- 1
platforms/android/app/src/main/assets/www/Server/renglones.json
File diff suppressed because it is too large
View File


+ 1
- 1
platforms/android/app/src/main/assets/www/css/index.css View File

@@ -33,7 +33,7 @@ body {
33 33
     padding:0px;
34 34
     /* Padding to avoid the "unsafe" areas behind notches in the screen */
35 35
     padding: env(safe-area-inset-top, 0px) env(safe-area-inset-right, 0px) env(safe-area-inset-bottom, 0px) env(safe-area-inset-right, 0px);
36
-    text-transform:uppercase;
36
+    text-transform:none;
37 37
     width:100%;
38 38
 }
39 39
 

+ 0
- 1
platforms/android/app/src/main/assets/www/data/BARRO.json
File diff suppressed because it is too large
View File


+ 0
- 1
platforms/android/app/src/main/assets/www/data/CARETAS.json
File diff suppressed because it is too large
View File


+ 0
- 1
platforms/android/app/src/main/assets/www/data/CRISTAL.json
File diff suppressed because it is too large
View File


+ 0
- 1
platforms/android/app/src/main/assets/www/data/CUERO.json
File diff suppressed because it is too large
View File


+ 0
- 1
platforms/android/app/src/main/assets/www/data/FIBRAS.json
File diff suppressed because it is too large
View File


+ 0
- 1
platforms/android/app/src/main/assets/www/data/HIGÜERA.json
File diff suppressed because it is too large
View File


+ 0
- 1
platforms/android/app/src/main/assets/www/data/INSTRUMENTOSTÍPICOS.json
File diff suppressed because it is too large
View File


+ 0
- 1
platforms/android/app/src/main/assets/www/data/JUGUETESTRADICIONALES.json
File diff suppressed because it is too large
View File


+ 0
- 1
platforms/android/app/src/main/assets/www/data/LABORESENAGUJA.json
File diff suppressed because it is too large
View File


+ 0
- 1
platforms/android/app/src/main/assets/www/data/MADERA.json
File diff suppressed because it is too large
View File


+ 0
- 1
platforms/android/app/src/main/assets/www/data/METAL.json
File diff suppressed because it is too large
View File


+ 0
- 1
platforms/android/app/src/main/assets/www/data/TABACOS.json View File

@@ -1 +0,0 @@
1
-[{"Nombre":"\u00c1ngel Otero Cotto","Especificaciones":"Cigarros, Mascadura","Tel\u00e9fono 1":"(939) 350-4999","E-mail":"papiroscigars@gmail.com","Municipio":"Cidra PR","id":0},{"Nombre":"\u00c1ngel Otero Vicente","Especificaciones":"Cigarros, Mascadura","Tel\u00e9fono 1":"(787) 595-1431","E-mail":"papiroscigars@gmail.com","Municipio":"Cidra PR","id":1},{"Nombre":"Angelo Vel\u00e1zquez Santiago","Especificaciones":"Cigarros","Tel\u00e9fono 1":"(787) 396-0941","E-mail":"velazquezcigars@hotmail.com","Municipio":"Aguas Buenas PR","id":2},{"Nombre":"Carlos M. Del Valle Mel\u00e9ndez","Especificaciones":"Cigarros","Tel\u00e9fono 1":"(787) 380-9122","E-mail":"cdelvalle1229@yahoo.com","Municipio":"Gu\u00e1nica PR","id":3},{"Nombre":"Jos\u00e9 A. V\u00e9lez Burgos","Especificaciones":"Cigarros, Muebles, Restaurador","Tel\u00e9fono 1":"(787) 648-2858","E-mail":"velez.jose751@gmail.com","Municipio":"Yauco PR","id":4},{"Nombre":"Patricio A. Pe\u00f1a","Especificaciones":"","Tel\u00e9fono 1":"(787) 785-8619","E-mail":"","Municipio":"Bayam\u00f3n PR","id":5}]

+ 0
- 1
platforms/android/app/src/main/assets/www/data/TEXTILES.json
File diff suppressed because it is too large
View File


+ 0
- 76
platforms/android/app/src/main/assets/www/data/driveToJson.php View File

@@ -1,76 +0,0 @@
1
-<?php
2
-header('Content-type: application/json');
3
- 
4
-
5
- 
6
-// Function to convert CSV into associative array
7
-function csvToArray($file, $delimiter) { 
8
-  if (($handle = fopen($file, 'r')) !== FALSE) { 
9
-    $i = 0; 
10
-    while (($lineArray = fgetcsv($handle, 4000, $delimiter, '"')) !== FALSE) { 
11
-      for ($j = 0; $j < count($lineArray); $j++) { 
12
-        $arr[$i][$j] = $lineArray[$j]; 
13
-      } 
14
-      $i++; 
15
-    } 
16
-    fclose($handle); 
17
-  } 
18
-  return $arr; 
19
-} 
20
- 
21
-function formatArray ($feed) {
22
-
23
-  $keys = array();
24
-  $newArray = array();
25
-  $data = csvToArray($feed, ',');
26
- 
27
-  $count = count($data) - 1;
28
- 
29
-  $labels = array_shift($data);  
30
- 
31
-  foreach ($labels as $label) {
32
-    $keys[] = $label;
33
-  }
34
- 
35
-  $keys[] = 'id';
36
- 
37
-  for ($i = 0; $i < $count; $i++) {
38
-    $data[$i][] = $i;
39
-  }
40
- 
41
-  for ($j = 0; $j < $count; $j++) {
42
-    $d = array_combine($keys, $data[$j]);
43
-    $newArray[$j] = $d;
44
-  }
45
-
46
-  return $newArray;
47
-
48
-}
49
- 
50
-$feed = 'https://docs.google.com/spreadsheets/d/e/2PACX-1vQUspPunAmkZrtfhMgMvGYGTK_4ONsCnSoe6OcTFc-4ILRHTatdPIwgRx1eRM1qFTkYFMrvcx8OI4cv/pub?output=csv';
51
-
52
-$data = formatArray($feed);
53
-
54
-$info = json_encode($data);
55
-
56
-$infoAsJson = json_decode($info);
57
-
58
-
59
-
60
-$handle = fopen("renglones.json", 'w');
61
-fwrite($handle, $info);
62
-
63
-
64
-
65
-for ($i = 0; $i < count($infoAsJson); $i++) {
66
-  $renglon = formatArray($infoAsJson[$i]->Link);
67
-  $renglonInfo = json_encode($renglon);
68
-  $renglonAsJson = json_decode($renglonInfo);
69
-  
70
-  $my_file = $infoAsJson[$i]->Renglones . ".json";
71
-  $handle = fopen($my_file, 'w') or die ('Cannot open file');
72
-  fwrite($handle, $renglonInfo);
73
-
74
-}
75
-
76
-?>

+ 0
- 1
platforms/android/app/src/main/assets/www/data/renglones.json
File diff suppressed because it is too large
View File


+ 70
- 59
platforms/android/app/src/main/assets/www/index.html
File diff suppressed because it is too large
View File


+ 8
- 1
platforms/android/app/src/main/assets/www/js/azar.js View File

@@ -1,13 +1,20 @@
1 1
 var request = new XMLHttpRequest()
2 2
 
3 3
                         request.open('GET', 'json/azar.json', true)
4
-
4
+    
5 5
                         request.onload = function() {
6 6
                             // begin accessing JSON data here
7 7
                             var data = JSON.parse(this.response)
8 8
                             
9 9
                             var page = document.getElementById("home");
10
+                            
11
+                                var aleatorio = Math.floor(Math.random()*32);
12
+                                document.getElementById("image").innerHTML = `<img src="img/${aleatorio}.jpg" width="100%" height="300">`;
13
+                                document.getElementById("Content").innerHTML = data[aleatorio].Renglones + "<br>" + data[aleatorio].Artesano + "<br>" + data[aleatorio].Municipio;
14
+                          
10 15
                             page.addEventListener("show", function(event){
16
+                                document.getElementById("image").innerHTML='';
17
+                                document.getElementById("Content").innerHTML='';
11 18
                                 var aleatorio = Math.floor(Math.random()*32);
12 19
                                 //var azar = document.getElementById("azar");
13 20
                                 //var img = ons.createElement(`<img src="img/${aleatorio}.png">`);

+ 1
- 7
platforms/android/app/src/main/assets/www/js/load.js View File

@@ -16,10 +16,7 @@ window.fn.loadLink = function (url) {
16 16
 window.fn.pushPage = function (page, anim) {
17 17
 
18 18
 	//Open and send json file that is equivalent with the especification.
19
-	var request = new XMLHttpRequest();
20
-	request.open("GET", "Server/" + page.title.toUpperCase() + ".json", false);
21
-	request.send(null)
22
-	var artesanos = JSON.parse(request.responseText);
19
+	var artesanos = JSON.parse(window.localStorage.getItem(page.title.toUpperCase()));
23 20
 
24 21
   if (anim) {
25 22
     document.getElementById('myNavigator').pushPage(page.id, { data: { title: page.title, esp: page.esp, json: artesanos } , animation: anim });
@@ -27,6 +24,3 @@ window.fn.pushPage = function (page, anim) {
27 24
     document.getElementById('myNavigator').pushPage(page.id, { data: { title: page.title, esp: page.esp, json: artesanos } });
28 25
   }
29 26
 };
30
-
31
-
32
-

+ 17
- 23
platforms/android/app/src/main/assets/www/js/renglones.js View File

@@ -1,29 +1,23 @@
1
-var request = new XMLHttpRequest()
1
+var info = JSON.parse(window.localStorage.getItem("RENGLONES"));
2 2
 
3
-request.open('GET', 'json/renglones.json', true)
3
+var list = document.getElementById("list");
4
+
5
+  for (var i = 0; i < info.length; i++) {
6
+
7
+          var item = ons.createElement(`<ons-list-item expandable onclick="hideAll()">
8
+                      <div class="center">${info[i].Renglones}</div>
9
+                      <div class="right"><img class="list-item__thumbnail" src="img/${info[i].Renglones}.jpg"></div>
10
+                      <div class="expandable-content">
11
+                      <ons-list>
12
+                      <ons-list-item onclick="fn.pushPage({'id':'artesanos.html','title':'${info[i].Renglones}','esp': '${info[i].Especificaciones}'})">Artesanos</ons-list-item>
13
+                      <ons-list-item onclick="fn.pushPage({'id':'artesanias.html','title':'${info[i].Renglones}','esp': '${info[i].Especificaciones}'})">Productos</ons-list-item>
14
+                      </ons-list></div>
15
+                  </ons-list-item>`);
16
+          list.appendChild(item);
17
+          }
4 18
 
5
-request.onload = function() {
6
-  // begin accessing JSON data here
7
-  var info = JSON.parse(this.response)
8
-        
9
-  var list = document.getElementById("list");
10
-    
11
-    for (var i = 0; i < info.length; i++) {
12 19
 
13
-            var item = ons.createElement(`<ons-list-item expandable>
14
-                        <div class="center">${info[i].Renglones}</div>
15
-                        <div class="right"><img class="list-item__thumbnail" src="img/${info[i].Renglones}.jpg"></div>
16
-                        <div class="expandable-content">
17
-                        <ons-list>
18
-                        <ons-list-item onclick="fn.pushPage({'id':'artesanos.html','title':'${info[i].Renglones}','esp': '${info[i].Especificaciones}'})">Artesanos</ons-list-item>
19
-                        <ons-list-item onclick="fn.pushPage({'id':'artesanias.html','title':'${info[i].Renglones}','esp': '${info[i].Especificaciones}'})">Especificaciones</ons-list-item>
20
-                        </ons-list></div>
21
-                    </ons-list-item>`);
22
-            list.appendChild(item);
23
-            }
24
-        }
25
-    
26 20
 request.send()  /*`<ons-card onclick="fn.pushPage({'id':'artesanias.html','title':'${info[i].Renglones}','esp': '${info[i].Especificaciones}'})">
27 21
                         <div class="title">${info[i].Renglones}</div>
28 22
                         <div class="content"><img class="list-item__thumbnail" src="img/${info[i].Renglones}.png"></div>
29
-                    </ons-card>`*/
23
+                    </ons-card>`*/

+ 0
- 1
www/Server/BARRO.json
File diff suppressed because it is too large
View File


+ 0
- 1
www/Server/CRISTAL.json
File diff suppressed because it is too large
View File


+ 0
- 1
www/Server/CUERO.json
File diff suppressed because it is too large
View File


+ 0
- 1
www/Server/FIBRAS .json
File diff suppressed because it is too large
View File


+ 0
- 1
www/Server/HIGÜERA.json
File diff suppressed because it is too large
View File


+ 0
- 1
www/Server/INSTRUMENTOS TÍPICOS.json
File diff suppressed because it is too large
View File


+ 0
- 1
www/Server/JUGUETES TRADICIONALES.json
File diff suppressed because it is too large
View File


+ 0
- 1
www/Server/LABORES EN AGUJA.json
File diff suppressed because it is too large
View File


+ 0
- 1
www/Server/MADERA.json
File diff suppressed because it is too large
View File


+ 0
- 1
www/Server/METAL.json
File diff suppressed because it is too large
View File


+ 0
- 1
www/Server/MÁSCARAS.json
File diff suppressed because it is too large
View File


+ 0
- 1
www/Server/TABACOS.json View File

@@ -1 +0,0 @@
1
-[{"Nombre":"\u00c1ngel Otero Cotto","Especificaciones":"Cigarros, Mascadura","Tel\u00e9fono 1":"(939) 350-4999","E-mail":"papiroscigars@gmail.com","Municipio":"Cidra PR","id":0},{"Nombre":"\u00c1ngel Otero Vicente","Especificaciones":"Cigarros, Mascadura","Tel\u00e9fono 1":"(787) 595-1431","E-mail":"papiroscigars@gmail.com","Municipio":"Cidra PR","id":1},{"Nombre":"Angelo Vel\u00e1zquez Santiago","Especificaciones":"Cigarros","Tel\u00e9fono 1":"(787) 396-0941","E-mail":"velazquezcigars@hotmail.com","Municipio":"Aguas Buenas PR","id":2},{"Nombre":"Carlos M. Del Valle Mel\u00e9ndez","Especificaciones":"Cigarros","Tel\u00e9fono 1":"(787) 380-9122","E-mail":"cdelvalle1229@yahoo.com","Municipio":"Gu\u00e1nica PR","id":3},{"Nombre":"Jos\u00e9 A. V\u00e9lez Burgos","Especificaciones":"Cigarros, Muebles, Restaurador","Tel\u00e9fono 1":"(787) 648-2858","E-mail":"velez.jose751@gmail.com","Municipio":"Yauco PR","id":4},{"Nombre":"Patricio A. Pe\u00f1a","Especificaciones":"","Tel\u00e9fono 1":"(787) 785-8619","E-mail":"","Municipio":"Bayam\u00f3n PR","id":5}]

+ 0
- 1
www/Server/TEXTILES.json
File diff suppressed because it is too large
View File


+ 0
- 76
www/Server/driveToJson.php View File

@@ -1,76 +0,0 @@
1
-<?php
2
-header('Content-type: application/json');
3
- 
4
-
5
- 
6
-// Function to convert CSV into associative array
7
-function csvToArray($file, $delimiter) { 
8
-  if (($handle = fopen($file, 'r')) !== FALSE) { 
9
-    $i = 0; 
10
-    while (($lineArray = fgetcsv($handle, 4000, $delimiter, '"')) !== FALSE) { 
11
-      for ($j = 0; $j < count($lineArray); $j++) { 
12
-        $arr[$i][$j] = $lineArray[$j]; 
13
-      } 
14
-      $i++; 
15
-    } 
16
-    fclose($handle); 
17
-  } 
18
-  return $arr; 
19
-} 
20
- 
21
-function formatArray ($feed) {
22
-
23
-  $keys = array();
24
-  $newArray = array();
25
-  $data = csvToArray($feed, ',');
26
- 
27
-  $count = count($data) - 1;
28
- 
29
-  $labels = array_shift($data);  
30
- 
31
-  foreach ($labels as $label) {
32
-    $keys[] = $label;
33
-  }
34
- 
35
-  $keys[] = 'id';
36
- 
37
-  for ($i = 0; $i < $count; $i++) {
38
-    $data[$i][] = $i;
39
-  }
40
- 
41
-  for ($j = 0; $j < $count; $j++) {
42
-    $d = array_combine($keys, $data[$j]);
43
-    $newArray[$j] = $d;
44
-  }
45
-
46
-  return $newArray;
47
-
48
-}
49
- 
50
-$feed = 'https://docs.google.com/spreadsheets/d/e/2PACX-1vQUspPunAmkZrtfhMgMvGYGTK_4ONsCnSoe6OcTFc-4ILRHTatdPIwgRx1eRM1qFTkYFMrvcx8OI4cv/pub?output=csv';
51
-
52
-$data = formatArray($feed);
53
-
54
-$info = json_encode($data);
55
-
56
-$infoAsJson = json_decode($info);
57
-
58
-
59
-
60
-$handle = fopen("renglones.json", 'w');
61
-fwrite($handle, $info);
62
-
63
-
64
-
65
-for ($i = 0; $i < count($infoAsJson); $i++) {
66
-  $renglon = formatArray($infoAsJson[$i]->Link);
67
-  $renglonInfo = json_encode($renglon);
68
-  $renglonAsJson = json_decode($renglonInfo);
69
-  
70
-  $my_file = $infoAsJson[$i]->Renglones . ".json";
71
-  $handle = fopen($my_file, 'w') or die ('Cannot open file');
72
-  fwrite($handle, $renglonInfo);
73
-
74
-}
75
-
76
-?>

+ 0
- 1
www/Server/renglones.json
File diff suppressed because it is too large
View File


+ 0
- 1
www/data/BARRO.json
File diff suppressed because it is too large
View File


+ 0
- 1
www/data/CARETAS.json
File diff suppressed because it is too large
View File


+ 0
- 1
www/data/CRISTAL.json
File diff suppressed because it is too large
View File


+ 0
- 1
www/data/CUERO.json
File diff suppressed because it is too large
View File


+ 0
- 1
www/data/FIBRAS.json
File diff suppressed because it is too large
View File


+ 0
- 1
www/data/HIGÜERA.json
File diff suppressed because it is too large
View File


+ 0
- 1
www/data/INSTRUMENTOSTÍPICOS.json
File diff suppressed because it is too large
View File


+ 0
- 1
www/data/JUGUETESTRADICIONALES.json
File diff suppressed because it is too large
View File


+ 0
- 1
www/data/LABORESENAGUJA.json
File diff suppressed because it is too large
View File


+ 0
- 1
www/data/MADERA.json
File diff suppressed because it is too large
View File


+ 0
- 1
www/data/METAL.json
File diff suppressed because it is too large
View File


+ 0
- 1
www/data/TABACOS.json View File

@@ -1 +0,0 @@
1
-[{"Nombre":"\u00c1ngel Otero Cotto","Especificaciones":"Cigarros, Mascadura","Tel\u00e9fono 1":"(939) 350-4999","E-mail":"papiroscigars@gmail.com","Municipio":"Cidra PR","id":0},{"Nombre":"\u00c1ngel Otero Vicente","Especificaciones":"Cigarros, Mascadura","Tel\u00e9fono 1":"(787) 595-1431","E-mail":"papiroscigars@gmail.com","Municipio":"Cidra PR","id":1},{"Nombre":"Angelo Vel\u00e1zquez Santiago","Especificaciones":"Cigarros","Tel\u00e9fono 1":"(787) 396-0941","E-mail":"velazquezcigars@hotmail.com","Municipio":"Aguas Buenas PR","id":2},{"Nombre":"Carlos M. Del Valle Mel\u00e9ndez","Especificaciones":"Cigarros","Tel\u00e9fono 1":"(787) 380-9122","E-mail":"cdelvalle1229@yahoo.com","Municipio":"Gu\u00e1nica PR","id":3},{"Nombre":"Jos\u00e9 A. V\u00e9lez Burgos","Especificaciones":"Cigarros, Muebles, Restaurador","Tel\u00e9fono 1":"(787) 648-2858","E-mail":"velez.jose751@gmail.com","Municipio":"Yauco PR","id":4},{"Nombre":"Patricio A. Pe\u00f1a","Especificaciones":"","Tel\u00e9fono 1":"(787) 785-8619","E-mail":"","Municipio":"Bayam\u00f3n PR","id":5}]

+ 0
- 1
www/data/TEXTILES.json
File diff suppressed because it is too large
View File


+ 0
- 76
www/data/driveToJson.php View File

@@ -1,76 +0,0 @@
1
-<?php
2
-header('Content-type: application/json');
3
- 
4
-
5
- 
6
-// Function to convert CSV into associative array
7
-function csvToArray($file, $delimiter) { 
8
-  if (($handle = fopen($file, 'r')) !== FALSE) { 
9
-    $i = 0; 
10
-    while (($lineArray = fgetcsv($handle, 4000, $delimiter, '"')) !== FALSE) { 
11
-      for ($j = 0; $j < count($lineArray); $j++) { 
12
-        $arr[$i][$j] = $lineArray[$j]; 
13
-      } 
14
-      $i++; 
15
-    } 
16
-    fclose($handle); 
17
-  } 
18
-  return $arr; 
19
-} 
20
- 
21
-function formatArray ($feed) {
22
-
23
-  $keys = array();
24
-  $newArray = array();
25
-  $data = csvToArray($feed, ',');
26
- 
27
-  $count = count($data) - 1;
28
- 
29
-  $labels = array_shift($data);  
30
- 
31
-  foreach ($labels as $label) {
32
-    $keys[] = $label;
33
-  }
34
- 
35
-  $keys[] = 'id';
36
- 
37
-  for ($i = 0; $i < $count; $i++) {
38
-    $data[$i][] = $i;
39
-  }
40
- 
41
-  for ($j = 0; $j < $count; $j++) {
42
-    $d = array_combine($keys, $data[$j]);
43
-    $newArray[$j] = $d;
44
-  }
45
-
46
-  return $newArray;
47
-
48
-}
49
- 
50
-$feed = 'https://docs.google.com/spreadsheets/d/e/2PACX-1vQUspPunAmkZrtfhMgMvGYGTK_4ONsCnSoe6OcTFc-4ILRHTatdPIwgRx1eRM1qFTkYFMrvcx8OI4cv/pub?output=csv';
51
-
52
-$data = formatArray($feed);
53
-
54
-$info = json_encode($data);
55
-
56
-$infoAsJson = json_decode($info);
57
-
58
-
59
-
60
-$handle = fopen("renglones.json", 'w');
61
-fwrite($handle, $info);
62
-
63
-
64
-
65
-for ($i = 0; $i < count($infoAsJson); $i++) {
66
-  $renglon = formatArray($infoAsJson[$i]->Link);
67
-  $renglonInfo = json_encode($renglon);
68
-  $renglonAsJson = json_decode($renglonInfo);
69
-  
70
-  $my_file = $infoAsJson[$i]->Renglones . ".json";
71
-  $handle = fopen($my_file, 'w') or die ('Cannot open file');
72
-  fwrite($handle, $renglonInfo);
73
-
74
-}
75
-
76
-?>

+ 0
- 1
www/data/renglones.json
File diff suppressed because it is too large
View File


+ 56
- 56
www/index.html
File diff suppressed because it is too large
View File


+ 1
- 7
www/js/load.js View File

@@ -16,10 +16,7 @@ window.fn.loadLink = function (url) {
16 16
 window.fn.pushPage = function (page, anim) {
17 17
 
18 18
 	//Open and send json file that is equivalent with the especification.
19
-	var request = new XMLHttpRequest();
20
-	request.open("GET", "Server/" + page.title.toUpperCase() + ".json", false);
21
-	request.send(null)
22
-	var artesanos = JSON.parse(request.responseText);
19
+	var artesanos = JSON.parse(window.localStorage.getItem(page.title.toUpperCase()));
23 20
 
24 21
   if (anim) {
25 22
     document.getElementById('myNavigator').pushPage(page.id, { data: { title: page.title, esp: page.esp, json: artesanos } , animation: anim });
@@ -27,6 +24,3 @@ window.fn.pushPage = function (page, anim) {
27 24
     document.getElementById('myNavigator').pushPage(page.id, { data: { title: page.title, esp: page.esp, json: artesanos } });
28 25
   }
29 26
 };
30
-
31
-
32
-

+ 17
- 23
www/js/renglones.js View File

@@ -1,29 +1,23 @@
1
-var request = new XMLHttpRequest()
1
+var info = JSON.parse(window.localStorage.getItem("RENGLONES"));
2 2
 
3
-request.open('GET', 'json/renglones.json', true)
3
+var list = document.getElementById("list");
4
+
5
+  for (var i = 0; i < info.length; i++) {
6
+
7
+          var item = ons.createElement(`<ons-list-item expandable onclick="hideAll()">
8
+                      <div class="center">${info[i].Renglones}</div>
9
+                      <div class="right"><img class="list-item__thumbnail" src="img/${info[i].Renglones}.jpg"></div>
10
+                      <div class="expandable-content">
11
+                      <ons-list>
12
+                      <ons-list-item onclick="fn.pushPage({'id':'artesanos.html','title':'${info[i].Renglones}','esp': '${info[i].Especificaciones}'})">Artesanos</ons-list-item>
13
+                      <ons-list-item onclick="fn.pushPage({'id':'artesanias.html','title':'${info[i].Renglones}','esp': '${info[i].Especificaciones}'})">Productos</ons-list-item>
14
+                      </ons-list></div>
15
+                  </ons-list-item>`);
16
+          list.appendChild(item);
17
+          }
4 18
 
5
-request.onload = function() {
6
-  // begin accessing JSON data here
7
-  var info = JSON.parse(this.response)
8
-        
9
-  var list = document.getElementById("list");
10
-    
11
-    for (var i = 0; i < info.length; i++) {
12 19
 
13
-            var item = ons.createElement(`<ons-list-item expandable onclick="hideAll()">
14
-                        <div class="center">${info[i].Renglones}</div>
15
-                        <div class="right"><img class="list-item__thumbnail" src="img/${info[i].Renglones}.jpg"></div>
16
-                        <div class="expandable-content">
17
-                        <ons-list>
18
-                        <ons-list-item onclick="fn.pushPage({'id':'artesanos.html','title':'${info[i].Renglones}','esp': '${info[i].Especificaciones}'})">Artesanos</ons-list-item>
19
-                        <ons-list-item onclick="fn.pushPage({'id':'artesanias.html','title':'${info[i].Renglones}','esp': '${info[i].Especificaciones}'})">Productos</ons-list-item>
20
-                        </ons-list></div>
21
-                    </ons-list-item>`);
22
-            list.appendChild(item);
23
-            }
24
-        }
25
-    
26 20
 request.send()  /*`<ons-card onclick="fn.pushPage({'id':'artesanias.html','title':'${info[i].Renglones}','esp': '${info[i].Especificaciones}'})">
27 21
                         <div class="title">${info[i].Renglones}</div>
28 22
                         <div class="content"><img class="list-item__thumbnail" src="img/${info[i].Renglones}.png"></div>
29
-                    </ons-card>`*/
23
+                    </ons-card>`*/