img added
This commit is contained in:
parent
01b63f07d9
commit
fa40433c55
Binary file not shown.
After Width: | Height: | Size: 88 KiB |
Binary file not shown.
After Width: | Height: | Size: 217 KiB |
|
@ -30,6 +30,7 @@ let vm = new Vue({
|
|||
editTabMarkerL: "0px",
|
||||
editTabMarkerW: "0px",
|
||||
editTabRollXOff: 0,
|
||||
tabrollw: "300vw",
|
||||
newIng: {
|
||||
name: "",
|
||||
fr: "",
|
||||
|
@ -38,15 +39,28 @@ let vm = new Vue({
|
|||
}
|
||||
},
|
||||
methods: {
|
||||
obj2php: function(obj) {
|
||||
obj2php: function(obj, dest) {
|
||||
data = JSON.stringify(obj)
|
||||
r = new XMLHttpRequest
|
||||
r.open("POST", "asset/php/handler.php", true)
|
||||
//r.open("POST", "asset/php/handler.php", true)
|
||||
r.open("POST", "handler/" + dest, true)
|
||||
r.setRequestHeader(
|
||||
"Content-type",
|
||||
"application/json")
|
||||
r.send(data)
|
||||
},
|
||||
uploadIMG: function(){
|
||||
let handler = "asset/php/uploader.php"
|
||||
fetch(handler, {
|
||||
method: "POST",
|
||||
body: new FormData(document.getElementById("edit-upload-form"))
|
||||
})
|
||||
// .then((response) => response.json())
|
||||
.then((responseData) => {
|
||||
console.log(responseData)
|
||||
console.log(responseData.message)
|
||||
})
|
||||
},
|
||||
saveIng: function() {
|
||||
if (this.newIng.name !== "") {
|
||||
ingredients[this.newIng.name] = {
|
||||
|
@ -55,7 +69,7 @@ let vm = new Vue({
|
|||
it: this.newIng.it,
|
||||
}
|
||||
}
|
||||
this.obj2php(ingredients)
|
||||
this.obj2php(ingredients, "ing")
|
||||
},
|
||||
setEditTab: function(ind) {
|
||||
let xoff = 0
|
||||
|
@ -63,10 +77,13 @@ let vm = new Vue({
|
|||
case 'ind':
|
||||
xoff = 0;
|
||||
break;
|
||||
case 'dish':
|
||||
case 'resto':
|
||||
xoff = 1;
|
||||
break;
|
||||
case 'resto':
|
||||
case 'upload':
|
||||
xoff = 2;
|
||||
break;
|
||||
default:
|
||||
xoff = 0;
|
||||
break;
|
||||
}
|
||||
|
|
|
@ -1,137 +1 @@
|
|||
{
|
||||
"tomate": {
|
||||
"fr": "tomate",
|
||||
"en": "tomato",
|
||||
"it": "pomodoro"
|
||||
},
|
||||
"mozzarella": {
|
||||
"fr": "mozzarella",
|
||||
"en": "mozzarella",
|
||||
"it": "mozzarella"
|
||||
},
|
||||
"mozzarellaBufala": {
|
||||
"fr": "mozzarella de bufflonne",
|
||||
"en": "buffalo's mozzarella",
|
||||
"it": "mozzarella di bufala"
|
||||
},
|
||||
"saucissecalabraisepiquante": {
|
||||
"fr": "saucisse calabraise piquante",
|
||||
"en": "spicy sausage",
|
||||
"it": "sopressata calabrese piccante"
|
||||
},
|
||||
"jambonblanc": {
|
||||
"fr": "jambon blanc",
|
||||
"en": "white ham",
|
||||
"it": "prosciutto cotto"
|
||||
},
|
||||
"champignons": {
|
||||
"fr": "champignons",
|
||||
"en": "mushrooms",
|
||||
"it": "funghi"
|
||||
},
|
||||
"provoletta": {
|
||||
"fr": "provoletta",
|
||||
"en": "provoletta",
|
||||
"it": "provoletta"
|
||||
},
|
||||
"salsiccia": {
|
||||
"fr": "chaire à saucisse",
|
||||
"en": "sausage",
|
||||
"it": "salsiccia"
|
||||
},
|
||||
"chimichurri": {
|
||||
"fr": "chimichurri",
|
||||
"en": "chimichurri",
|
||||
"it": "chimichurri"
|
||||
},
|
||||
"gorgonzola": {
|
||||
"fr": "gorgonzola",
|
||||
"en": "gorgonzola",
|
||||
"it": "gorgonzola"
|
||||
},
|
||||
"parma": {
|
||||
"fr": "parma",
|
||||
"en": "jambon de Parme",
|
||||
"it": "Parma ham"
|
||||
},
|
||||
"noix": {
|
||||
"fr": "noix",
|
||||
"en": "nuts",
|
||||
"it": "noci"
|
||||
},
|
||||
"caprino": {
|
||||
"fr": "fromage de chèvre",
|
||||
"en": "goat cheese",
|
||||
"it": "caprino"
|
||||
},
|
||||
"honey": {
|
||||
"fr": "miel",
|
||||
"en": "honey",
|
||||
"it": "miele"
|
||||
},
|
||||
"bresaola": {
|
||||
"fr": "bresaola",
|
||||
"en": "bresaola",
|
||||
"it": "bresaola"
|
||||
},
|
||||
"roquette": {
|
||||
"fr": "roquette",
|
||||
"en": "aragula salad",
|
||||
"it": "rucola"
|
||||
},
|
||||
"crudaioladipomodoro": {
|
||||
"fr": "tomates fraîches concassées",
|
||||
"en": "fresh tomatoes",
|
||||
"it": "crudaiola di pomodoro"
|
||||
},
|
||||
"burrata": {
|
||||
"fr": "burrata",
|
||||
"en": "burrata",
|
||||
"it": "burrata"
|
||||
},
|
||||
"basilic": {
|
||||
"fr": "basilic",
|
||||
"en": "basil",
|
||||
"it": "basilico"
|
||||
},
|
||||
"thon": {
|
||||
"fr": "thon",
|
||||
"en": "tuna",
|
||||
"it": "tono"
|
||||
},
|
||||
"cipollaTropea": {
|
||||
"fr": "oignons rouges de Tropea",
|
||||
"en": "red onions from Tropea",
|
||||
"it": "cipolla rossa di Tropea"
|
||||
},
|
||||
"aubergines": {
|
||||
"fr": "aubergines",
|
||||
"en": "eggplants",
|
||||
"it": "melanzane"
|
||||
},
|
||||
"anchois": {
|
||||
"fr": "anchois",
|
||||
"en": "anchovies",
|
||||
"it": "acciughe"
|
||||
},
|
||||
"capres": {
|
||||
"fr": "câpres",
|
||||
"en": "capers",
|
||||
"it": "capperi"
|
||||
},
|
||||
"huileextravierge": {
|
||||
"fr": "huile extra vierge",
|
||||
"en": "extra olive oil",
|
||||
"it": "olio extra vergine"
|
||||
},
|
||||
"gnochgor": {
|
||||
"fr": "Gnochi au Gorgonzolla",
|
||||
"en": "gdlkfgdfg",
|
||||
"it": "ksflskdfjl"
|
||||
},
|
||||
"name": {
|
||||
"fr": "",
|
||||
"en": "",
|
||||
"it": ""
|
||||
}
|
||||
}
|
||||
{"tomate":{"fr":"tomate","en":"tomato","it":"pomodoro"},"mozzarella":{"fr":"mozzarella","en":"mozzarella","it":"mozzarella"},"mozzarellaBufala":{"fr":"mozzarella de bufflonne","en":"buffalo's mozzarella","it":"mozzarella di bufala"},"saucissecalabraisepiquante":{"fr":"saucisse calabraise piquante","en":"spicy sausage","it":"sopressata calabrese piccante"},"jambonblanc":{"fr":"jambon blanc","en":"white ham","it":"prosciutto cotto"},"champignons":{"fr":"champignons","en":"mushrooms","it":"funghi"},"provoletta":{"fr":"provoletta","en":"provoletta","it":"provoletta"},"salsiccia":{"fr":"chaire à saucisse","en":"sausage","it":"salsiccia"},"chimichurri":{"fr":"chimichurri","en":"chimichurri","it":"chimichurri"},"gorgonzola":{"fr":"gorgonzola","en":"gorgonzola","it":"gorgonzola"},"parma":{"fr":"parma","en":"jambon de Parme","it":"Parma ham"},"noix":{"fr":"noix","en":"nuts","it":"noci"},"caprino":{"fr":"fromage de chèvre","en":"goat cheese","it":"caprino"},"honey":{"fr":"miel","en":"honey","it":"miele"},"bresaola":{"fr":"bresaola","en":"bresaola","it":"bresaola"},"roquette":{"fr":"roquette","en":"aragula salad","it":"rucola"},"crudaioladipomodoro":{"fr":"tomates fraîches concassées","en":"fresh tomatoes","it":"crudaiola di pomodoro"},"burrata":{"fr":"burrata","en":"burrata","it":"burrata"},"basilic":{"fr":"basilic","en":"basil","it":"basilico"},"thon":{"fr":"thon","en":"tuna","it":"tono"},"cipollaTropea":{"fr":"oignons rouges de Tropea","en":"red onions from Tropea","it":"cipolla rossa di Tropea"},"aubergines":{"fr":"aubergines","en":"eggplants","it":"melanzane"},"anchois":{"fr":"anchois","en":"anchovies","it":"acciughe"},"capres":{"fr":"câpres","en":"capers","it":"capperi"},"huileextravierge":{"fr":"huile extra vierge","en":"extra olive oil","it":"olio extra vergine"},"gnochgor":{"fr":"Gnochi au Gorgonzolla","en":"gdlkfgdfg","it":"ksflskdfjl"},"name":{"fr":"","en":"","it":""},"Chocolat":{"fr":"chocolat","en":"chocolate","it":"cioccolato"},"chocolat":{"fr":"chocolat","en":"chocolate","it":"cioccolato"},"asperges":{"fr":"asperges","en":"asparagus","it":"asparagi"}}
|
|
@ -32,9 +32,13 @@
|
|||
class="edit-tab-nav-link"
|
||||
v-on:click="setEditTab('ing')">Ings</span>
|
||||
<span
|
||||
id="edit-tab-nav-dish"
|
||||
id="edit-tab-nav-resto"
|
||||
class="edit-tab-nav-link"
|
||||
v-on:click="setEditTab('dish')">Dish</span>
|
||||
v-on:click="setEditTab('resto')">Resto</span>
|
||||
<span
|
||||
id="edit-tab-nav-upload"
|
||||
class="edit-tab-nav-link"
|
||||
v-on:click="setEditTab('upload')">upload</span>
|
||||
|
||||
</section>
|
||||
<section
|
||||
|
@ -88,7 +92,24 @@
|
|||
|
||||
<section class="edit-single-tab">
|
||||
|
||||
<h3>Dishes</h3>
|
||||
<h3>Resto</h3>
|
||||
<input type="number" value="0" step=".01">
|
||||
|
||||
</section>
|
||||
|
||||
<section class="edit-single-tab">
|
||||
|
||||
<h3>Uploads</h3>
|
||||
|
||||
<form id="edit-upload-form" onsubmit="return false" >
|
||||
|
||||
<label class="edit-upload-file-label" for="edit-upload-file-input">Select IMG</label>
|
||||
<input id="edit-upload-file-input" type="file" name="uploadimg">
|
||||
<input type="text" name="uploadfn">
|
||||
|
||||
<button v-on:click="uploadIMG()">Upload IMG</button>
|
||||
|
||||
</form>
|
||||
|
||||
</section>
|
||||
|
||||
|
|
|
@ -1,11 +1,20 @@
|
|||
<?php
|
||||
|
||||
$data = file_get_contents('php://input');
|
||||
echo $data;
|
||||
//echo $data;
|
||||
|
||||
$fn = "asset/output/ing.test";
|
||||
//$fn = "ing.test";
|
||||
$fp = "asset/json/";
|
||||
$bufp = "asset/json/bu/";
|
||||
$buts = date("-Y-m-d_H:i:s");
|
||||
|
||||
$fn = $fp . $uri[2] . ".json";
|
||||
$bufn = $bufp . $uri[2] . $buts . ".json";
|
||||
|
||||
file_put_contents($fn, $data);
|
||||
copy($fn, $bufn);
|
||||
|
||||
//file_put_contents($fn, $data);
|
||||
file_put_contents("test.json", $data);
|
||||
//file_put_contents("rtest.json", $data);
|
||||
|
||||
?>
|
||||
|
|
|
@ -52,7 +52,6 @@
|
|||
|
||||
<script src="asset/js/vue.min.js"></script>
|
||||
<script src="asset/leaflet/leaflet.js"></script>
|
||||
<script src="asset/js/ingredients.js "></script>
|
||||
<script src="asset/js/dishes.js "></script>
|
||||
<script src="asset/js/resto.js"></script>
|
||||
<script src="asset/js/parking.js"></script>
|
||||
|
|
|
@ -1,142 +0,0 @@
|
|||
{
|
||||
"tomate": {
|
||||
"fr": "tomate",
|
||||
"en": "tomato",
|
||||
"it": "pomodoro"
|
||||
},
|
||||
"mozzarella": {
|
||||
"fr": "mozzarella",
|
||||
"en": "mozzarella",
|
||||
"it": "mozzarella"
|
||||
},
|
||||
"mozzarellaBufala": {
|
||||
"fr": "mozzarella de bufflonne",
|
||||
"en": "buffalo's mozzarella",
|
||||
"it": "mozzarella di bufala"
|
||||
},
|
||||
"saucissecalabraisepiquante": {
|
||||
"fr": "saucisse calabraise piquante",
|
||||
"en": "spicy sausage",
|
||||
"it": "sopressata calabrese piccante"
|
||||
},
|
||||
"jambonblanc": {
|
||||
"fr": "jambon blanc",
|
||||
"en": "white ham",
|
||||
"it": "prosciutto cotto"
|
||||
},
|
||||
"champignons": {
|
||||
"fr": "champignons",
|
||||
"en": "mushrooms",
|
||||
"it": "funghi"
|
||||
},
|
||||
"provoletta": {
|
||||
"fr": "provoletta",
|
||||
"en": "provoletta",
|
||||
"it": "provoletta"
|
||||
},
|
||||
"salsiccia": {
|
||||
"fr": "chaire à saucisse",
|
||||
"en": "sausage",
|
||||
"it": "salsiccia"
|
||||
},
|
||||
"chimichurri": {
|
||||
"fr": "chimichurri",
|
||||
"en": "chimichurri",
|
||||
"it": "chimichurri"
|
||||
},
|
||||
"gorgonzola": {
|
||||
"fr": "gorgonzola",
|
||||
"en": "gorgonzola",
|
||||
"it": "gorgonzola"
|
||||
},
|
||||
"parma": {
|
||||
"fr": "parma",
|
||||
"en": "jambon de Parme",
|
||||
"it": "Parma ham"
|
||||
},
|
||||
"noix": {
|
||||
"fr": "noix",
|
||||
"en": "nuts",
|
||||
"it": "noci"
|
||||
},
|
||||
"caprino": {
|
||||
"fr": "fromage de chèvre",
|
||||
"en": "goat cheese",
|
||||
"it": "caprino"
|
||||
},
|
||||
"honey": {
|
||||
"fr": "miel",
|
||||
"en": "honey",
|
||||
"it": "miele"
|
||||
},
|
||||
"bresaola": {
|
||||
"fr": "bresaola",
|
||||
"en": "bresaola",
|
||||
"it": "bresaola"
|
||||
},
|
||||
"roquette": {
|
||||
"fr": "roquette",
|
||||
"en": "aragula salad",
|
||||
"it": "rucola"
|
||||
},
|
||||
"crudaioladipomodoro": {
|
||||
"fr": "tomates fraîches concassées",
|
||||
"en": "fresh tomatoes",
|
||||
"it": "crudaiola di pomodoro"
|
||||
},
|
||||
"burrata": {
|
||||
"fr": "burrata",
|
||||
"en": "burrata",
|
||||
"it": "burrata"
|
||||
},
|
||||
"basilic": {
|
||||
"fr": "basilic",
|
||||
"en": "basil",
|
||||
"it": "basilico"
|
||||
},
|
||||
"thon": {
|
||||
"fr": "thon",
|
||||
"en": "tuna",
|
||||
"it": "tono"
|
||||
},
|
||||
"cipollaTropea": {
|
||||
"fr": "oignons rouges de Tropea",
|
||||
"en": "red onions from Tropea",
|
||||
"it": "cipolla rossa di Tropea"
|
||||
},
|
||||
"aubergines": {
|
||||
"fr": "aubergines",
|
||||
"en": "eggplants",
|
||||
"it": "melanzane"
|
||||
},
|
||||
"anchois": {
|
||||
"fr": "anchois",
|
||||
"en": "anchovies",
|
||||
"it": "acciughe"
|
||||
},
|
||||
"capres": {
|
||||
"fr": "câpres",
|
||||
"en": "capers",
|
||||
"it": "capperi"
|
||||
},
|
||||
"huileextravierge": {
|
||||
"fr": "huile extra vierge",
|
||||
"en": "extra olive oil",
|
||||
"it": "olio extra vergine"
|
||||
},
|
||||
"gnochgor": {
|
||||
"fr": "Gnochi au Gorgonzolla",
|
||||
"en": "gdlkfgdfg",
|
||||
"it": "ksflskdfjl"
|
||||
},
|
||||
"name": {
|
||||
"fr": "",
|
||||
"en": "",
|
||||
"it": ""
|
||||
},
|
||||
"chocolat": {
|
||||
"fr": "chocolat",
|
||||
"en": "chocolate",
|
||||
"it": "chocolate"
|
||||
}
|
||||
}
|
|
@ -1 +0,0 @@
|
|||
hello
|
|
@ -11,6 +11,8 @@ if ($uri[1] == '' ||
|
|||
include ("asset/php/home.php");
|
||||
} elseif ($uri[1] == 'edit' || $uri[3] == 'edit') {
|
||||
include("asset/php/edit.php");
|
||||
} elseif ($uri[1] == 'handler') {
|
||||
include("asset/php/handler.php");
|
||||
} else {
|
||||
echo "404";
|
||||
echo $_SERVER['REQUEST_URI'];
|
||||
|
|
Loading…
Reference in New Issue