diff --git a/2darray.html b/2darray.html new file mode 100644 index 0000000..399ea59 --- /dev/null +++ b/2darray.html @@ -0,0 +1,17 @@ + + + + + + Document + + + +
+ + +
+ + + + \ No newline at end of file diff --git a/arrayFunction.html b/arrayFunction.html new file mode 100644 index 0000000..e6cfa86 --- /dev/null +++ b/arrayFunction.html @@ -0,0 +1,12 @@ + + + + + + Document + + + + + + \ No newline at end of file diff --git a/css/hotelbill.css b/css/hotelbill.css new file mode 100644 index 0000000..48b04e2 --- /dev/null +++ b/css/hotelbill.css @@ -0,0 +1,81 @@ +* { + margin: 0; + padding: 0; + box-sizing: border-box; +} + +body { + background-image: url(/image/restaurant-interior.jpg); + background-size: cover; +} + +.box { + margin: auto; + margin-top: 2%; + padding: 2%; + background-image: url(/image/Screenshot\ 2023-10-08\ 124757.png); + background-size: cover; + background-position: center center; + width: 30%; + /* background-color: rgb(0, 202, 114); */ + border-radius: 20px; +} + +h1 { + font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif; + font-style: italic; + font-size: larger; + color: rgb(28, 163, 48); + padding: 9px; +} + +p { + color: red; + font-size: small; + font-family: serif; + padding: 4px; +} + +input { + padding: 7px; + border-radius: 10px; + border-style: none; + background-color: rgb(246, 255, 0); + color: rgb(0, 142, 26); +} + +select { + background-color: rgb(246, 255, 0); + color: rgb(0, 142, 26); + padding: 7px; + border-radius: 10px; + border-style: none; +} + +#submit { + color: rgb(0, 103, 43); + background-color: rgb(0, 255, 68); +} + +table { + background-color: rgb(248, 149, 0); + border-radius: 10px; + border-style: none; +} + +th { + color: rgb(31, 116, 87); + background-color: rgb(109, 210, 0); + border-radius: 10px; + padding: 5px; + border-style: none; + +} + +td { + color: rgb(31, 116, 87); + background-color: rgb(109, 210, 0); + border-radius: 10px; + padding: 5px; + border-style: none; +} \ No newline at end of file diff --git a/dom.html b/dom.html new file mode 100644 index 0000000..26377aa --- /dev/null +++ b/dom.html @@ -0,0 +1,22 @@ + + + + + + Document + + + + +
+ + + +
+
+ +
+ + + + \ No newline at end of file diff --git a/h2.html b/h2.html new file mode 100644 index 0000000..4501872 --- /dev/null +++ b/h2.html @@ -0,0 +1,66 @@ + + + + + + + Hotel billing + + + + +
+ + +

+ + + +

+ + + +

+ + no.of.Person + +

+ + +
+ + + + + + + + + + +
Sr.noDateTableFoodNo.Of PersonTotalBill
+ + + + + + + + + \ No newline at end of file diff --git a/hotelbill.html b/hotelbill.html new file mode 100644 index 0000000..0fca552 --- /dev/null +++ b/hotelbill.html @@ -0,0 +1,73 @@ + + + + + + + Hotel Bill + + + + +
+
+

Hotel Bill Collection System

+ +
+ + +

+ +

Select Table

+ + +

+ +

Select Food

+ + +

+ +

Select No Of Person

+ + +

+ + +
+ +

+ + + + + + + + + +
Sr.noDateTableFoodNo.Of PersonTotalBill
+ +
+ +
+ + + \ No newline at end of file diff --git a/image/2307-w064-n002-541B-p1-541.jpg b/image/2307-w064-n002-541B-p1-541.jpg new file mode 100644 index 0000000..f565c85 Binary files /dev/null and b/image/2307-w064-n002-541B-p1-541.jpg differ diff --git a/image/427230-PDYP34-121.jpg b/image/427230-PDYP34-121.jpg new file mode 100644 index 0000000..d781993 Binary files /dev/null and b/image/427230-PDYP34-121.jpg differ diff --git a/image/Screenshot 2023-10-08 124757.png b/image/Screenshot 2023-10-08 124757.png new file mode 100644 index 0000000..a3039ed Binary files /dev/null and b/image/Screenshot 2023-10-08 124757.png differ diff --git a/image/restaurant-interior.jpg b/image/restaurant-interior.jpg new file mode 100644 index 0000000..47b4f25 Binary files /dev/null and b/image/restaurant-interior.jpg differ diff --git a/js/2darray.js b/js/2darray.js new file mode 100644 index 0000000..43314f2 --- /dev/null +++ b/js/2darray.js @@ -0,0 +1,21 @@ +let arr = [ + [1,'meet',21] + [2,'dixit',20] + [3,'dhruvil',22] +] + +const display = (arr) => { + + let print = '' + + + for (let i=0; i { // console.log(index + '--' + value); // }); -//3. +// 3. // data.map((value,index) => { // console.log(index + '--' + value); // }) -//4. +// 4. // data.map((v,i) => console.log(i + '--' + v)) @@ -145,7 +145,7 @@ // --Update-- -//1. +// 1. // data[3] = 50 // console.log(data); @@ -157,19 +157,19 @@ // --Add-- -//1. +// 1. // data.push(100); // console.log(data); -//2. +// 2. // data.unshift(100); // console.log(data); -//3. +// 3. // data.splice(5,0,87) // console.log(data); @@ -179,65 +179,65 @@ // --Remove-- -//1. +// 1. // data.pop() // console.log(data); -//2. +// 2. // data.shift() // console.log(data); -//3. +// 3. // data.splice(2,3) // console.log(data); -//------------- +// ------------- // let data = [ 30, 5, 'MISTRY', 80, 60, 'Surti', 50 ]; // let data1 = [88,188]; -//------------- +// ------------- // --Array's Function's-- -//1. +// 1. // let ans = Array.isArray(data); // console.log(ans); -//2. +// 2. // let ans = data.concat(data1) // console.log(ans); -//3. +// 3. // let ans = data.some((v) => v > 50); // console.log(ans); -//4. +// 4. // let ans = data.find((v) => v > 20); // console.log(ans); -//5. +// 5. // let fullname = "MEET NILESHBHAI MISTRY"; // let ans = fullname.split(" "); // console.log(ans); -//6. +// 6. // let ans = data.slice(2,4 ); // console.log(ans); @@ -247,7 +247,7 @@ // -------TASK------- // ------------------ -//1. filter() +// 1. filter() // const Age = [25, 64, 16, 15, 34]; @@ -261,7 +261,7 @@ -//2. reduse() +// 2. reduse() // let arr = [200, 50, 25]; @@ -276,7 +276,7 @@ // callTask() //Ans: 125 - //or +// or @@ -298,7 +298,7 @@ -//3. indexOf() +// 3. indexOf() // function task() { @@ -318,7 +318,7 @@ -//4. lastindexOf +// 4. lastindexOf // function task() { // let lindexOf = 'mistrymeetteem'; @@ -353,17 +353,17 @@ // console.log(ans); -//2.filter +// 2.filter // let ans = data.filter((v,i) => v > 15 && v < 90) // console.log(ans); -//3. reduse +// 3. reduse // let ans = data1.reduce((acc,v,i) => acc + v,0) // console.log(ans); -//4. reverse +// 4. reverse // let ans = data.reverse() // console.log(ans); @@ -371,58 +371,131 @@ -//5. sort +// 5. sort -//1 +// 1 // let ans = data2.sort() // console.log(ans); //asc -//2 +// 2 // let ans = data1.sort((a,b) => a - b) // console.log(ans); -//3 +// 3 // let ans = data1.sort((a,b) => b - a) // console.log(ans); -//6.fill +// 6.fill // let ans = data.fill(10000,2,5) // console.log(ans); -//7.findIndex +// 7.findIndex // let ans = data1.findIndex((v) => v === 56) // console.log(ans); -let data = [ 10, 8, 50, 'meet', 40, 80, 90, 'meet' ]; +// let data = [ 10, 8, 50, 'meet', 40, 80, 90, 'meet' ]; -let data1 = [55, 8, 9, 877, 56, 99, 140]; +// let data1 = [55, 8, 9, 877, 56, 99, 140]; + +// let data2 = ['Mistry','Meet','Surati','Gujarati']; + + +// //8.includes + +// // let ans = data1.includes(55) +// // console.log(ans); + +// //9.every + +// // let ans = data1.every((v) => v > 0) +// // console.log(ans); + + +// //10. indexOf + +// // let ans = data.indexOf("meet") +// // console.log(ans); + + +// let ans = data.lastIndexOfayyays("meet") +// console.log(ans); + + + + + +// -----arrays task--------- +// ------------------------- + + + +// let data = [20, 49, 10, 'meet', 58, 79]; + +// let data1 = [39, 58, 88, 19, 95, 68] + +// let data2 = ['surat','mumbai','panjab','tamilnadu'] -let data2 = ['Mistry','Meet','Surati','Gujarati']; +// // 1. Finding the maximum element in an array. +// let ans = data.filter((v, i) => v > 40) +// console.log(ans); + +// or + +// let ans1 = data.filter((v, i) => { +// if (v > 15) { +// console.log(v); +// } +// }) + + + + +// 2. Finding the minimum element in an array. + + +// let ans = data.filter((v, i) => v < 50) +// console.log(ans); -//8.includes -// let ans = data1.includes(55) +// or + + +// let ans1 = data.filter((v, i) => { +// if (v < 15) { +// console.log(v); +// } +// }) + + + +// 3. Sorting an array in ascending order + +// let ans = data2.sort() // console.log(ans); -//9.every +// or -// let ans = data1.every((v) => v > 0) +// let ans = data2.sort((v,i) => v - i ) // console.log(ans); -//10. indexOf -// let ans = data.indexOf("meet") + + +// 4. Sorting an array in descending order. + +// let ans = data1.sort((v,i) => i - v) // console.log(ans); +// or -let ans = data.lastIndexOfayyays("meet") -console.log(ans); +// let ans = data.sort() +// console.log(ans); \ No newline at end of file diff --git a/js/arrayFunction.js b/js/arrayFunction.js new file mode 100644 index 0000000..1f09a70 --- /dev/null +++ b/js/arrayFunction.js @@ -0,0 +1,181 @@ +// let array1 = [15, 84, 65, 22, 45, 170, 54] + +//1. + +// const maxArr = (array1) => { +// let max = array1[0] + +// for (let i=1; i max) { +// max = array1[i] +// } +// } +// console.log(max); +// } +// maxArr(array1) + + + +//2. + +// const maxArr = (array1) => { +// let max = array1[0] + +// for (let i=1; i { +// let = newArr =[] +// for (let i=array1.length-1; i>=0; i--) { +// newArr.push(array1[i]); +// } +// console.log(newArr); +// } + +// ReversArr(array1) + +//6. Finding the sum of all elements in an array. + +// const SumArr = () => { +// sum = 0 +// for (let i=0; i { +// sum = 0 +// for (let i=0; i { +// let temp; +// for (let i=0; i { +// let uniqeArr = [] + +// arr.map((v) => { +// if (!uniqeArr === v) { +// newArr.push(v) +// } +// }) +// console.log(uniqeArr); +// } + +// dupliArr(arr2) + + + + + + +//10. Merging two arrays into a new array. + +// const mergeArr = (arr1,arr2) => { +// let newArr = [] + +// for (let i=0; i { + + +// } +// splitArr(arr1, aar2) + +//13. Rotating an array by a given number of positions. + +// const rotatingArr = (arr,n) => { +// for (let i=0; i { + +// let ans = arr.sort((a,b) => b-a) +// console.log(ans[1]); +// } + +// seclargArr(arr1) + +// 15. Finding the k-th smallest element in an array. + +// const ksmallArr = (arr, elem) => { +// let ans = arr.sort((a, b) =>a - b) +// console.log(ans[elem - 1]); +// } +// ksmallArr(arr1, 2) + diff --git a/js/dom.js b/js/dom.js new file mode 100644 index 0000000..8c7e86d --- /dev/null +++ b/js/dom.js @@ -0,0 +1,54 @@ +// const handlClick = () => { +// console.log("Click!!"); +// } +// let divElem = document.getElementById("disp"); +// let h1Elem = document.createElement("h1"); +// let h1Text = document.createTextNode("Hello"); + +// h1Elem.appendChild(h1Text); + +// divElem.appendChild(h1Elem); + +// let aElem = document.createElement("a"); +// aElem.setAttribute("href","#"); +// aElem.setAttribute("onclick","handlClick()") +// let aText = document.createTextNode("home"); + +// aElem.appendChild(aText); +// divElem.appendChild(aElem); + + +const handlRemove = (id) => { + let div = document.getElementById("div-", + id) + console.log("remove"); + div.remove() + +} +const handlSubmit = () => { + event.preventDefault() + + let name = document.getElementById("name").value; + console.log("ok"); + + let id = Math.floor(Math.random() * 1000); + console.log(id); + + + let parentDiv = document.getElementById("disp"); + let divElem = document.createElement("div"); + divElem.setAttribute("id","div-" + id); + let divText = document.createTextNode(name); + + let btnElem = document.createElement("button"); + btnElem.setAttribute("onclick","handlRemove("+ id +")"); + + let btnText = document.createTextNode("X"); + + divElem.appendChild(divText); + parentDiv.appendChild(divElem); + + btnElem.appendChild(btnText); + parentDiv.appendChild(btnElem); + + +} \ No newline at end of file diff --git a/js/h2.js b/js/h2.js new file mode 100644 index 0000000..79f017d --- /dev/null +++ b/js/h2.js @@ -0,0 +1,129 @@ +const handleSubmit = () => { + // console.log("okkk"); + let date = document.getElementById("date").value; + let table = document.getElementById("table").value; + let food = document.getElementById("food").value; + let Person = document.getElementById("person").value; + + let foodName; + let rate; + + if (date === " " || table === "0" || Person === "") { + document.getElementById("d-error").innerHTML = "" + } else { + if (food === "250") { + foodName = 'Punjabi'; + rate = 250; + } else if (food === "150") { + foodName = 'chinees'; + rate = 150; + } else if (food === "200") { + foodName = 'south - india'; + rate = 200; + } + + let total = rate * Person + let obj = { + "Date": date, + "Table": table, + "Food": foodName, + "Parson": Person, + "TotalBill": total, + } + + + let localHotel = JSON.parse(localStorage.getItem("hoteldata")); + + if (localHotel == null) { + localStorage.setItem("hoteldata", JSON.stringify([obj])); + } else { + localHotel.push(obj); + localStorage.setItem("hoteldata", JSON.stringify(localHotel)); + } + display() + } + +} + + +const display = () => { + let localHotel = JSON.parse(localStorage.getItem("hoteldata")); + + let dispElem = document.getElementById("disp"); + + let finalBill = localHotel.reduce((acc, v) => acc + v.TotalBill, 0); + console.log(finalBill); + + localHotel.map((v, i) => { + // console.log(v); + let id = Math.floor(Math.random() * 1000); + + let trElem = document.createElement("tr"); + trElem.setAttribute("id", id) + + let tdElem = document.createElement("td"); + let tdTxt = document.createTextNode(i + 1) + tdElem.appendChild(tdTxt); + trElem.appendChild(tdElem); + + + let tdElem1 = document.createElement("td"); + let tdTxt1 = document.createTextNode(v.Date) + tdElem1.appendChild(tdTxt1); + trElem.appendChild(tdElem1); + + let tdElem2 = document.createElement("td"); + let tdTxt2 = document.createTextNode(v.Table) + tdElem2.appendChild(tdTxt2); + trElem.appendChild(tdElem2); + + let tdElem3 = document.createElement("td"); + let tdTxt3 = document.createTextNode(v.Food) + tdElem3.appendChild(tdTxt3); + trElem.appendChild(tdElem3); + + let tdElem4 = document.createElement("td"); + let tdTxt4 = document.createTextNode(v.Parson); + tdElem4.appendChild(tdTxt4); + trElem.appendChild(tdElem4); + + let tdElem5 = document.createElement("td"); + let tdTxt5 = document.createTextNode(v.TotalBill); + tdElem5.appendChild(tdTxt5); + trElem.appendChild(tdElem5); + + let tdElemX = document.createElement("td"); + let tdTxtX = document.createTextNode("X"); + tdElemX.setAttribute("onclick", "handleremove(" + id + ")"); + tdElemX.appendChild(tdTxtX); + trElem.appendChild(tdElemX); + + dispElem.appendChild(trElem); + // dispElem.appendChild(divElem); + + }) + + + let trFelem = document.createElement("tr"); + + let thFelem = document.createElement("th"); + thFelem.setAttribute("colspan", "5"); + let thFTxt = document.createTextNode("Final counter"); + + let tdFelem = document.createElement("td"); + let tdFTxt = document.createTextNode(finalBill); + + thFelem.appendChild(thFTxt); + trFelem.appendChild(thFelem); + + tdFelem.appendChild(tdFTxt); + trFelem.appendChild(tdFelem); + + dispElem.appendChild(trFelem); +} + +display(); + +const handleremove = (id) => { + +} \ No newline at end of file diff --git a/js/hotelbill.js b/js/hotelbill.js new file mode 100644 index 0000000..79f017d --- /dev/null +++ b/js/hotelbill.js @@ -0,0 +1,129 @@ +const handleSubmit = () => { + // console.log("okkk"); + let date = document.getElementById("date").value; + let table = document.getElementById("table").value; + let food = document.getElementById("food").value; + let Person = document.getElementById("person").value; + + let foodName; + let rate; + + if (date === " " || table === "0" || Person === "") { + document.getElementById("d-error").innerHTML = "" + } else { + if (food === "250") { + foodName = 'Punjabi'; + rate = 250; + } else if (food === "150") { + foodName = 'chinees'; + rate = 150; + } else if (food === "200") { + foodName = 'south - india'; + rate = 200; + } + + let total = rate * Person + let obj = { + "Date": date, + "Table": table, + "Food": foodName, + "Parson": Person, + "TotalBill": total, + } + + + let localHotel = JSON.parse(localStorage.getItem("hoteldata")); + + if (localHotel == null) { + localStorage.setItem("hoteldata", JSON.stringify([obj])); + } else { + localHotel.push(obj); + localStorage.setItem("hoteldata", JSON.stringify(localHotel)); + } + display() + } + +} + + +const display = () => { + let localHotel = JSON.parse(localStorage.getItem("hoteldata")); + + let dispElem = document.getElementById("disp"); + + let finalBill = localHotel.reduce((acc, v) => acc + v.TotalBill, 0); + console.log(finalBill); + + localHotel.map((v, i) => { + // console.log(v); + let id = Math.floor(Math.random() * 1000); + + let trElem = document.createElement("tr"); + trElem.setAttribute("id", id) + + let tdElem = document.createElement("td"); + let tdTxt = document.createTextNode(i + 1) + tdElem.appendChild(tdTxt); + trElem.appendChild(tdElem); + + + let tdElem1 = document.createElement("td"); + let tdTxt1 = document.createTextNode(v.Date) + tdElem1.appendChild(tdTxt1); + trElem.appendChild(tdElem1); + + let tdElem2 = document.createElement("td"); + let tdTxt2 = document.createTextNode(v.Table) + tdElem2.appendChild(tdTxt2); + trElem.appendChild(tdElem2); + + let tdElem3 = document.createElement("td"); + let tdTxt3 = document.createTextNode(v.Food) + tdElem3.appendChild(tdTxt3); + trElem.appendChild(tdElem3); + + let tdElem4 = document.createElement("td"); + let tdTxt4 = document.createTextNode(v.Parson); + tdElem4.appendChild(tdTxt4); + trElem.appendChild(tdElem4); + + let tdElem5 = document.createElement("td"); + let tdTxt5 = document.createTextNode(v.TotalBill); + tdElem5.appendChild(tdTxt5); + trElem.appendChild(tdElem5); + + let tdElemX = document.createElement("td"); + let tdTxtX = document.createTextNode("X"); + tdElemX.setAttribute("onclick", "handleremove(" + id + ")"); + tdElemX.appendChild(tdTxtX); + trElem.appendChild(tdElemX); + + dispElem.appendChild(trElem); + // dispElem.appendChild(divElem); + + }) + + + let trFelem = document.createElement("tr"); + + let thFelem = document.createElement("th"); + thFelem.setAttribute("colspan", "5"); + let thFTxt = document.createTextNode("Final counter"); + + let tdFelem = document.createElement("td"); + let tdFTxt = document.createTextNode(finalBill); + + thFelem.appendChild(thFTxt); + trFelem.appendChild(thFelem); + + tdFelem.appendChild(tdFTxt); + trFelem.appendChild(tdFelem); + + dispElem.appendChild(trFelem); +} + +display(); + +const handleremove = (id) => { + +} \ No newline at end of file diff --git a/js/object.js b/js/object.js new file mode 100644 index 0000000..e69de29 diff --git a/js/storage.js b/js/storage.js new file mode 100644 index 0000000..a1d7ff9 --- /dev/null +++ b/js/storage.js @@ -0,0 +1,53 @@ +// localStorage.setItem('firstname','meet') +// localStorage.setItem('lastname','mistry') +// // console.log(localStorage.getItem('firstname')); +// localStorage.removeItem('lastname') + + + +// // sessionStorage.setItem('location','surat') +// // sessionStorage.removeItem('location') + +// // console.log(sessionStorage.getItem('location')); + + + +const handlSubmit = () => { + + + let localdata = JSON.parse(localStorage.getItem("name")); + + let name = document.getElementById("name").value; + + console.log(name); + + if (localdata) { + localdata.push(name); + + localStorage.setItem("name", JSON.stringify(localdata)); + } else { + + localStorage.setItem("name", JSON.stringify([name])); + } + + + // arr.push(name); + +} + +const Display = () => { + let data = JSON.parse(localStorage.getItem("name")); + let disElem = document.getElementById("disp") + disElem.innerHTML = "" + + + data.map((l) => { + let liElem = document.createElement("li"); + let liText = document.createTextNode(l) + + liElem.appendChild(liText); + disElem.appendChild(liElem); + }); +} + +Display() \ No newline at end of file diff --git a/js/todo.js b/js/todo.js new file mode 100644 index 0000000..ebe1c4f --- /dev/null +++ b/js/todo.js @@ -0,0 +1,42 @@ +let array = []; +let update = null; + +const handleremove = (i) => { + + array.splice(i , 1); + + display(); +} +const handleEdit = (i) => { + update = i; + document.getElementById("name").value = array[i]; + +} + +const display = () => { + let ulElem = document.getElementById("disp"); + + let liElem = document.createElement("li"); + let liText = document.createTextNode("100"); + + liElem.appendChild(liText); + ulElem.appendChild(liElem); + + + +} + +const handledetail = () => { + event.preventDefault(); + let name = document.getElementById("name").value; + + if (update !== null || update == 0) { + array[update] = name; + } else { + array.push(name); + } + update = null; + document.getElementById("name").value = ""; + + display(); +} \ No newline at end of file diff --git a/objects.html b/objects.html new file mode 100644 index 0000000..712e43a --- /dev/null +++ b/objects.html @@ -0,0 +1,12 @@ + + + + + + Document + + + + + + \ No newline at end of file diff --git a/storage.html b/storage.html new file mode 100644 index 0000000..9c38e22 --- /dev/null +++ b/storage.html @@ -0,0 +1,20 @@ + + + + + + Document + + +
+ + + + +
    + +
+ + + + \ No newline at end of file diff --git a/todo.html b/todo.html new file mode 100644 index 0000000..19d8f0f --- /dev/null +++ b/todo.html @@ -0,0 +1,21 @@ + + + + + + Document + + + +
+ + + + + +
    + +
+ + + \ No newline at end of file
sr nonameage