diff --git a/SQL_Feladat_AdatB/index.js b/SQL_Feladat_AdatB/index.js index 42ca203..7e9306f 100644 --- a/SQL_Feladat_AdatB/index.js +++ b/SQL_Feladat_AdatB/index.js @@ -1,9 +1,135 @@ +const root = document.getElementById("root"); let tableSelectionDomElement = document.getElementById("tabla"); let selectedTable = "tagok"; tableSelectionDomElement.addEventListener("change", function (){ selectedTable = tableSelectionDomElement.value; - - console.log(selectedTable); + switch (selectedTable) { + case "tagok": + CreateTagokForm(); + break; + case "tagsag": + CreateTagsagForm(); + break; + case "jelenlet": + CreateJelenletForm(); + break; + case "esemenyek": + CreateEsemenyekForm(); + break; + case "visszajelzes": + CreateVisszajelzesForm(); + break; + default: + break; + } }); +function RemoveTable(){ + if (document.getElementById("tabla_Form") != null){ + root.removeChild("tabla_Form"); + console.log("asd"); + } + return; +} + +function CreateTagokForm(){ + RemoveTable(); + //TODO fix names in the form + let form = document.createElement("div"); + form.id = "tabla_Form"; + form.innerHTML = ` +
+ `; + root.appendChild(form); + return; +} + +function CreateTagsagForm() { + RemoveTable(); + //TODO fix names in the form + let form = document.createElement("div"); + form.id = "tabla_Form"; + form.innerHTML = ` + + `; + root.appendChild(form); + return; +} + +function CreateJelenletForm(){ + RemoveTable(); + //TODO fix names in the form + let form = document.createElement("div"); + form.id = "tabla_Form"; + form.innerHTML = ` + + `; + root.appendChild(form); + return; +} + +function CreateEsemenyekForm(){ + RemoveTable(); + //TODO fix names in the form + let form = document.createElement("div"); + form.id = "tabla_Form"; + form.innerHTML = ` + + `; + root.appendChild(form); + return; +} + +function CreateVisszajelzesForm(){ + RemoveTable(); + //TODO fix names in the form + let form = document.createElement("div"); + form.id = "tabla_Form"; + form.innerHTML = ` + + `; + root.appendChild(form); + return; +} diff --git a/SQL_Feladat_AdatB/index.php b/SQL_Feladat_AdatB/index.php index da858fa..4cfa567 100644 --- a/SQL_Feladat_AdatB/index.php +++ b/SQL_Feladat_AdatB/index.php @@ -1,3 +1,6 @@ + @@ -6,9 +9,9 @@