From 6e301d88fc58c457e9fb3faa16128bbd222e9b84 Mon Sep 17 00:00:00 2001 From: ed Date: Mon, 13 Jun 2022 08:28:46 +0200 Subject: [PATCH] php --- proj/map/asset/css/edit.css | 78 ++++++++++++++ proj/map/asset/js/edit.js | 101 ++++++++++++++++++ proj/map/asset/js/ingredients.js | 2 +- proj/map/asset/js/main.js | 16 +-- proj/map/asset/json/db.json | 81 -------------- proj/map/asset/json/endpoint/index.php | 91 ---------------- proj/map/asset/json/ing.json | 137 ++++++++++++++++++++++++ proj/map/asset/php/edit.php | 109 +++++++++++++++++++ proj/map/asset/php/handler.php | 11 ++ proj/map/asset/php/home.php | 65 +++++++++++ proj/map/asset/php/ing.php | 14 +++ proj/map/asset/php/test.json | 142 +++++++++++++++++++++++++ proj/map/asset/php/test1.json | 1 + proj/map/index.php | 29 +++++ proj/map/{index.html => oldindex.html} | 0 15 files changed, 690 insertions(+), 187 deletions(-) create mode 100644 proj/map/asset/css/edit.css create mode 100644 proj/map/asset/js/edit.js delete mode 100644 proj/map/asset/json/db.json delete mode 100644 proj/map/asset/json/endpoint/index.php create mode 100644 proj/map/asset/json/ing.json create mode 100644 proj/map/asset/php/edit.php create mode 100644 proj/map/asset/php/handler.php create mode 100644 proj/map/asset/php/home.php create mode 100644 proj/map/asset/php/ing.php create mode 100644 proj/map/asset/php/test.json create mode 100644 proj/map/asset/php/test1.json create mode 100644 proj/map/index.php rename proj/map/{index.html => oldindex.html} (100%) diff --git a/proj/map/asset/css/edit.css b/proj/map/asset/css/edit.css new file mode 100644 index 0000000..fc22e60 --- /dev/null +++ b/proj/map/asset/css/edit.css @@ -0,0 +1,78 @@ +body { + overflow-y: scroll; +} + +#edit-tab-nav { + position: relative; + display: flex; + flex-direction: row; + justify-content: space-around; + margin-bottom: 20px; +} + +#edit-tab-nav-marker { + position: absolute; + height: 5px; + left: 0px; + width: 0px; + background-color: var(--b9h-color-accent); + bottom: -20px; + transition: 0.5s; + +} + +#edit-tab-roll { + width: 200vw; + display: flex; + flex-direction: row; + transform: translateX(-0vw); + transition: transform 0.5s; +} + +.edit-single-tab { + width: 100vw; + padding: 10px; +} + +.edit-single-tab li { + margin-left: 30px; + list-style: none; +} + +.edit-single-tab h4 { + margin-bottom: 10px; +} + +.edit-tab-nav-link { + font-weight: 600; + font-size: 1.2rem; +} + +header { + height: auto; + margin-bottom: 20px; +} + +input[type=text]{ + display: block; + font-size: 1em; + font-family: Inter; + font-weight: 400; + margin-top: 5px; + margin-bottom: 10px; + padding-left: 5px; + border: 0px solid #ccc; + background-color: #e6e6e6; + border-radius: 0px; +} + +.ing-input-lang { + margin-left: 20px; +} + +.ing-form-save { + display: block; + margin-top: 30px; + font-size: 1.5rem; + cursor: pointer; +} \ No newline at end of file diff --git a/proj/map/asset/js/edit.js b/proj/map/asset/js/edit.js new file mode 100644 index 0000000..fa187d6 --- /dev/null +++ b/proj/map/asset/js/edit.js @@ -0,0 +1,101 @@ +Vue.component('NewIng',{ + template : ` +
+ + +
+ `, + props : { + obj : Object + }, + data () { + return { + name : "name", + fr : "fr", + en : "en", + it : "it", + } + }, + methods : { + hello(){ + return "hello" + }, + } +}) + +let vm = new Vue({ + el: '#root', + data : { + message: "Hello Vue", + editTabMarkerL: "0px", + editTabMarkerW: "0px", + editTabRollXOff: 0, + newIng: { + name: "", + fr: "", + en: "", + it: "", + } + }, + methods: { + obj2php: function(obj) { + data = JSON.stringify(obj) + r = new XMLHttpRequest + r.open("POST", "asset/php/handler.php", true) + r.setRequestHeader( + "Content-type", + "application/json") + r.send(data) + }, + saveIng: function() { + if (this.newIng.name !== "") { + ingredients[this.newIng.name] = { + fr: this.newIng.fr, + en: this.newIng.en, + it: this.newIng.it, + } + } + this.obj2php(ingredients) + }, + setEditTab: function(ind) { + let xoff = 0 + switch(ind){ + case 'ind': + xoff = 0; + break; + case 'dish': + xoff = 1; + break; + case 'resto': + xoff = 0; + break; + } + this.editTabRollXOff = xoff + m = document.getElementById("edit-tab-nav-" + ind) + this.editTabMarkerL = m.offsetLeft + "px" + this.editTabMarkerW = m.offsetWidth + "px" + } + }, + computed: { + editTabRollTransX: function () { + return "translateX(-" + this.editTabRollXOff + "00vw)"; + }, + }, + created: function(){ + console.log("created start") + console.log("created end") + }, + mounted: function() { + console.log("mounted start") + this.setEditTab('ing') + console.log("mounted end") + }, + updated: function() { + console.log("updated start") + console.log("updated end") + } + +}) + + + diff --git a/proj/map/asset/js/ingredients.js b/proj/map/asset/js/ingredients.js index 1b4e915..1da2ccd 100644 --- a/proj/map/asset/js/ingredients.js +++ b/proj/map/asset/js/ingredients.js @@ -1,4 +1,4 @@ -let ingredients = { +let ingredientsold = { tomate : { fr: "tomate", en: "tomato", diff --git a/proj/map/asset/js/main.js b/proj/map/asset/js/main.js index bc34c92..b961600 100644 --- a/proj/map/asset/js/main.js +++ b/proj/map/asset/js/main.js @@ -2,6 +2,7 @@ Vue.component('Prototab',{ template : `
+
`, props : { @@ -598,11 +599,9 @@ Vue.component('Accordeon', { switch(obj.tabtype) { case "menu": return "byl-icon-restaurant" - // code block break; case "time": return "byl-icon-clock" - // code block break; case "info": return "byl-icon-info" @@ -611,7 +610,7 @@ Vue.component('Accordeon', { return "byl-icon-euro_symbol" break; default: - // code block + return "" } }, showCard() { @@ -640,17 +639,6 @@ Vue.component('Accordeon', { }, }) - -const jsonurl = "https://ed.brz9.dev/proj/map/asset/json/db.json" - -/* -let jdnb - -fetch(jsonurl) - .then(res => res.json()) - .then(data => jdnb = data) -*/ - let vm = new Vue({ el: '#root', data : jdb.data, diff --git a/proj/map/asset/json/db.json b/proj/map/asset/json/db.json deleted file mode 100644 index d4b71dc..0000000 --- a/proj/map/asset/json/db.json +++ /dev/null @@ -1,81 +0,0 @@ -{ -"db" : { - "restaurants" : { - "id" : "resto", - "type" : "list", - "nameFR" : "Restaurant", - "nameEN" : "Restaurant", - "nameIT" : "Ristoranti", - "sub" : { - "italiens" : { - "id": "restoital", - "type" : "list", - "nameFR" : "Italien", - "nameEN" : "Italian", - "nameIT" : "Italiano", - "sub" : { - "SanTelmo" : { - "id": "santelmo", - "type" : "item", - "name": "Sant Elmo", - "img": "https://ed.brz9.dev/proj/map/asset/img/santelmo.jpg", - "txtFR": "Français Adipisicing live-edge fam velit. Messenger bag poke laboris aesthetic viral do semiotics authentic est selfies.", - "txtEN": "English Adipisicing live-edge fam velit. Messenger bag poke laboris aesthetic viral do semiotics authentic est selfies.", - "txtIT": "Italiano Adipisicing live-edge fam velit. Messenger bag poke laboris aesthetic viral do semiotics authentic est selfies.", - "card" : { - "tabs" : { - "menu" : { - "priceRange" : "18-32€", - "dishes" : { - "divola" : { - "name" : "Pizza Divola" - }, - "regina" : { - "name" : "Pizza Regina" - } - } - }, - "time" : { - "monAM" : "11h30-14h00", - "monPM" : "18h30-22h00" - - } - } - } - }, - "Salsamenteria" : { - "id" : "salsamenteria", - "type" : "item", - "name" : "Salsamenteria di Parma", - "img" : "https://ed.brz9.dev/proj/map/asset/img/salsamentiera.jpg", - "txtFR" : "Français Adipisicing live-edge fam velit. Messenger bag poke laboris aesthetic viral do semiotics authentic est selfies.", - "txtEN" : "English Adipisicing live-edge fam velit. Messenger bag poke laboris aesthetic viral do semiotics authentic est selfies.", - "txtIT" : "Italiano Adipisicing live-edge fam velit. Messenger bag poke laboris aesthetic viral do semiotics authentic est selfies." - } - } - }, - "vege" : { - "id" : "restovege", - "type" : "list", - "nameFR" : "Végétarien", - "nameEN" : "Vegan", - "nameIT" : "Vegetariano", - "sub" : { - "SanTelmo" : { - "id": "santelmo", - "type" : "item", - "name": "San Telmo" - }, - "Salsamenteria" : { - "id": "salsamenteria", - "type" : "item", - "name" : "Salsamenteria di Parma" - } - } - } - } - } - } -} - - diff --git a/proj/map/asset/json/endpoint/index.php b/proj/map/asset/json/endpoint/index.php deleted file mode 100644 index b3246a4..0000000 --- a/proj/map/asset/json/endpoint/index.php +++ /dev/null @@ -1,91 +0,0 @@ - diff --git a/proj/map/asset/json/ing.json b/proj/map/asset/json/ing.json new file mode 100644 index 0000000..ddbc4c6 --- /dev/null +++ b/proj/map/asset/json/ing.json @@ -0,0 +1,137 @@ +{ + "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": "" + } +} diff --git a/proj/map/asset/php/edit.php b/proj/map/asset/php/edit.php new file mode 100644 index 0000000..8c530ee --- /dev/null +++ b/proj/map/asset/php/edit.php @@ -0,0 +1,109 @@ + + + +<?php echo "Maphp";?> + + + + + + + + + +
+
+ + + +
+ + +
+ + + Ings + Dish + +
+
+ +
+ +

Ingredients

+ + + + + + + + + + + + +

{{ i[0] }}

+
  • fr: {{ i[1]['fr'] }}
  • +
  • en: {{ i[1]['en'] }}
  • +
  • it: {{ i[1]['it'] }}
  • +
    + +
    + + +
    + +

    Dishes

    + +
    + +
    + + + +
    + + + + + + + + + + diff --git a/proj/map/asset/php/handler.php b/proj/map/asset/php/handler.php new file mode 100644 index 0000000..9c0a6d5 --- /dev/null +++ b/proj/map/asset/php/handler.php @@ -0,0 +1,11 @@ + diff --git a/proj/map/asset/php/home.php b/proj/map/asset/php/home.php new file mode 100644 index 0000000..3f5ec81 --- /dev/null +++ b/proj/map/asset/php/home.php @@ -0,0 +1,65 @@ + + + +<?php echo "Maphp";?> + + + + + + + + +
    +
    + + +
    + + FR + EN + IT +
    + +
    +
    +
    +
    +
    +
    + + +
    + +
    + + +
    + + +
    + +
    + + + + + + + + + + + + + + + + + + + diff --git a/proj/map/asset/php/ing.php b/proj/map/asset/php/ing.php new file mode 100644 index 0000000..71c6f38 --- /dev/null +++ b/proj/map/asset/php/ing.php @@ -0,0 +1,14 @@ + + +let jing = `'. $data_ing .'`; +let ingredients = JSON.parse(jing) + + +'; + +?> diff --git a/proj/map/asset/php/test.json b/proj/map/asset/php/test.json new file mode 100644 index 0000000..49f586d --- /dev/null +++ b/proj/map/asset/php/test.json @@ -0,0 +1,142 @@ +{ + "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" + } +} diff --git a/proj/map/asset/php/test1.json b/proj/map/asset/php/test1.json new file mode 100644 index 0000000..b6fc4c6 --- /dev/null +++ b/proj/map/asset/php/test1.json @@ -0,0 +1 @@ +hello \ No newline at end of file diff --git a/proj/map/index.php b/proj/map/index.php new file mode 100644 index 0000000..ac9bb16 --- /dev/null +++ b/proj/map/index.php @@ -0,0 +1,29 @@ + + diff --git a/proj/map/index.html b/proj/map/oldindex.html similarity index 100% rename from proj/map/index.html rename to proj/map/oldindex.html