{"id":29,"date":"2025-07-11T15:40:09","date_gmt":"2025-07-11T15:40:09","guid":{"rendered":"https:\/\/sriviratramatanursery.sabpro.in\/?page_id=29"},"modified":"2025-07-13T09:21:37","modified_gmt":"2025-07-13T09:21:37","slug":"%e0%a4%b5%e0%a4%bf%e0%a4%b0%e0%a4%be%e0%a4%a4%e0%a5%8d%e0%a4%b0%e0%a4%be-%e0%a4%ae%e0%a4%be%e0%a4%a4%e0%a4%be","status":"publish","type":"page","link":"https:\/\/sriviratramatanursery.sabpro.in\/?page_id=29","title":{"rendered":"\u0935\u093f\u0930\u093e\u0924\u094d\u0930\u093e \u092e\u093e\u0924\u093e"},"content":{"rendered":"\n<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n  <meta charset=\"UTF-8\">\n  <title>Login\/Register &#8211; LocalStorage<\/title>\n  <style>\n    body {\n      font-family: Arial, sans-serif;\n      background: #f9f9f9;\n      display: flex;\n      justify-content: center;\n    }\n    .container {\n      background: white;\n      max-width: 400px;\n      margin-top: 50px;\n      padding: 30px;\n      border-radius: 10px;\n      box-shadow: 0 0 10px #ccc;\n    }\n    h2 {\n      text-align: center;\n    }\n    input {\n      width: 100%;\n      padding: 10px;\n      margin: 8px 0;\n      border-radius: 5px;\n      border: 1px solid #ccc;\n    }\n    button {\n      width: 100%;\n      padding: 12px;\n      margin-top: 10px;\n      background: #5b2c00;\n      color: white;\n      border: none;\n      border-radius: 5px;\n      font-size: 16px;\n    }\n    .switch-btn {\n      text-align: center;\n      margin-top: 10px;\n      color: #5b2c00;\n      cursor: pointer;\n    }\n    .logout {\n      text-align: center;\n      margin-top: 20px;\n    }\n    #userWelcome {\n      font-size: 18px;\n      font-weight: bold;\n    }\n  <\/style>\n<\/head>\n<body>\n  <div class=\"container\" id=\"authBox\">\n    <h2 id=\"formTitle\">Login<\/h2>\n    \n    <form id=\"loginForm\">\n      <input type=\"email\" id=\"loginEmail\" placeholder=\"Email\" required>\n      <input type=\"password\" id=\"loginPassword\" placeholder=\"Password\" required>\n      <button type=\"button\" onclick=\"login()\">Login<\/button>\n      <div class=\"switch-btn\" onclick=\"showRegister()\">Don&#8217;t have account? Register<\/div>\n      <div class=\"switch-btn\" onclick=\"showForgot()\">Forgot Password?<\/div>\n    <\/form>\n\n    <form id=\"registerForm\" style=\"display:none;\">\n      <input type=\"text\" id=\"regName\" placeholder=\"Your Name\" required>\n      <input type=\"email\" id=\"regEmail\" placeholder=\"Your Email\" required>\n      <input type=\"password\" id=\"regPassword\" placeholder=\"Password\" required>\n      <input type=\"text\" id=\"regPhone\" placeholder=\"Your Phone\" required>\n      <button type=\"button\" onclick=\"register()\">Register<\/button>\n      <div class=\"switch-btn\" onclick=\"showLogin()\">Already have account? Login<\/div>\n    <\/form>\n\n    <form id=\"forgotForm\" style=\"display:none;\">\n      <input type=\"email\" id=\"forgotEmail\" placeholder=\"Enter your email\">\n      <button type=\"button\" onclick=\"forgotPassword()\">Get Password<\/button>\n      <div class=\"switch-btn\" onclick=\"showLogin()\">Back to Login<\/div>\n    <\/form>\n  <\/div>\n\n  <div class=\"container\" id=\"welcomeBox\" style=\"display:none;\">\n    <h2>Welcome<\/h2>\n    <div id=\"userWelcome\"><\/div>\n    <div class=\"logout\">\n      <button onclick=\"logout()\">Logout<\/button>\n    <\/div>\n  <\/div>\n\n  <script>\n    \/\/ Show\/Hide forms\n    function showRegister() {\n      document.getElementById(\"loginForm\").style.display = \"none\";\n      document.getElementById(\"registerForm\").style.display = \"block\";\n      document.getElementById(\"forgotForm\").style.display = \"none\";\n      document.getElementById(\"formTitle\").innerText = \"Register\";\n    }\n\n    function showLogin() {\n      document.getElementById(\"loginForm\").style.display = \"block\";\n      document.getElementById(\"registerForm\").style.display = \"none\";\n      document.getElementById(\"forgotForm\").style.display = \"none\";\n      document.getElementById(\"formTitle\").innerText = \"Login\";\n    }\n\n    function showForgot() {\n      document.getElementById(\"loginForm\").style.display = \"none\";\n      document.getElementById(\"registerForm\").style.display = \"none\";\n      document.getElementById(\"forgotForm\").style.display = \"block\";\n      document.getElementById(\"formTitle\").innerText = \"Forgot Password\";\n    }\n\n    \/\/ Register\n    function register() {\n      const name = document.getElementById(\"regName\").value;\n      const email = document.getElementById(\"regEmail\").value;\n      const password = document.getElementById(\"regPassword\").value;\n      const phone = document.getElementById(\"regPhone\").value;\n\n      if (!name || !email || !password || !phone) {\n        alert(\"Please fill all fields.\");\n        return;\n      }\n\n      localStorage.setItem(\"user\", JSON.stringify({ name, email, password, phone }));\n      alert(\"Registered successfully!\");\n      showLogin();\n    }\n\n    \/\/ Login\n    function login() {\n      const email = document.getElementById(\"loginEmail\").value;\n      const password = document.getElementById(\"loginPassword\").value;\n      const user = JSON.parse(localStorage.getItem(\"user\"));\n\n      if (!user || user.email !== email || user.password !== password) {\n        alert(\"Invalid email or password.\");\n        return;\n      }\n\n      localStorage.setItem(\"loggedIn\", \"true\");\n      document.getElementById(\"authBox\").style.display = \"none\";\n      document.getElementById(\"welcomeBox\").style.display = \"block\";\n      document.getElementById(\"userWelcome\").innerText = `Hello, ${user.name}`;\n    }\n\n    \/\/ Logout\n    function logout() {\n      localStorage.removeItem(\"loggedIn\");\n      document.getElementById(\"authBox\").style.display = \"block\";\n      document.getElementById(\"welcomeBox\").style.display = \"none\";\n      showLogin();\n    }\n\n    \/\/ Forgot Password\n    function forgotPassword() {\n      const email = document.getElementById(\"forgotEmail\").value;\n      const user = JSON.parse(localStorage.getItem(\"user\"));\n\n      if (!user || user.email !== email) {\n        alert(\"Email not found.\");\n      } else {\n        alert(\"Your password is: \" + user.password);\n      }\n    }\n\n    \/\/ Auto login\n    window.onload = () => {\n      if (localStorage.getItem(\"loggedIn\") === \"true\") {\n        const user = JSON.parse(localStorage.getItem(\"user\"));\n        document.getElementById(\"authBox\").style.display = \"none\";\n        document.getElementById(\"welcomeBox\").style.display = \"block\";\n        document.getElementById(\"userWelcome\").innerText = `Hello, ${user.name}`;\n      }\n    };\n  <\/script>\n<\/body>\n<\/html>\n\n\n\n<!DOCTYPE html>\n<html lang=\"hi\">\n<head>\n  <meta charset=\"UTF-8\">\n  <title>QR \u0915\u094b\u0921 \u091c\u0928\u0930\u0947\u091f\u0930<\/title>\n  <script src=\"https:\/\/cdn.jsdelivr.net\/npm\/qrcode\/build\/qrcode.min.js\"><\/script>\n  <style>\n    body {\n      font-family: Arial, sans-serif;\n      background: #eef2f3;\n      text-align: center;\n      padding: 30px;\n    }\n    select, input[type=\"text\"], textarea, button {\n      width: 80%;\n      padding: 12px;\n      font-size: 16px;\n      margin: 10px 0;\n    }\n    textarea {\n      height: 80px;\n    }\n    button {\n      background-color: #28a745;\n      color: white;\n      border: none;\n      border-radius: 8px;\n      cursor: pointer;\n    }\n    #result {\n      margin-top: 30px;\n    }\n    .info {\n      font-size: 18px;\n      margin-bottom: 15px;\n      color: #333;\n    }\n  <\/style>\n<\/head>\n<body>\n\n  <h2>\ud83d\udccc QR \u0915\u094b\u0921 \u091c\u0928\u0930\u0947\u091f \u0915\u0930\u0947\u0902<\/h2>\n\n  <!-- QR \u092a\u094d\u0930\u0915\u093e\u0930 \u091a\u092f\u0928 -->\n  <select id=\"qrType\">\n    <option value=\"\" disabled selected>QR \u0915\u094b\u0921 \u0915\u093f\u0938 \u091a\u0940\u091c \u0915\u093e \u0939\u0948?<\/option>\n    <option value=\"Facebook\">Facebook<\/option>\n    <option value=\"WhatsApp\">WhatsApp<\/option>\n    <option value=\"YouTube\">YouTube<\/option>\n    <option value=\"\u0935\u0947\u092c\u0938\u093e\u0907\u091f\">\u0935\u0947\u092c\u0938\u093e\u0907\u091f<\/option>\n    <option value=\"\u0905\u0928\u094d\u092f\">\u0905\u0928\u094d\u092f<\/option>\n  <\/select><br>\n\n  <!-- \u0932\u093f\u0902\u0915 \u0907\u0928\u092a\u0941\u091f -->\n  <input type=\"text\" id=\"linkInput\" placeholder=\"\ud83d\udd17 \u0932\u093f\u0902\u0915 \u092a\u0947\u0938\u094d\u091f \u0915\u0930\u0947\u0902\"><br>\n\n  <!-- \u092e\u094b\u092c\u093e\u0907\u0932 \u0928\u0902\u092c\u0930 \u0907\u0928\u092a\u0941\u091f -->\n  <input type=\"text\" id=\"mobileInput\" placeholder=\"\ud83d\udcf1 \u092e\u094b\u092c\u093e\u0907\u0932 \u0928\u0902\u092c\u0930 \u0921\u093e\u0932\u0947\u0902\"><br>\n\n  <!-- \u0935\u093f\u0936\u0947\u0937 \u0935\u093f\u0935\u0930\u0923 -->\n  <textarea id=\"descriptionInput\" placeholder=\"\ud83d\udcdd \u0935\u093f\u0936\u0947\u0937 \u0935\u093f\u0935\u0930\u0923 (QR \u0915\u094b\u0921 \u0915\u093f\u0938 \u092c\u093e\u0930\u0947 \u092e\u0947\u0902 \u0939\u0948)\"><\/textarea><br>\n\n  <!-- \u0938\u092c\u092e\u093f\u091f \u092c\u091f\u0928 -->\n  <button onclick=\"generateQRCode()\">\u2705 \u0938\u092c\u092e\u093f\u091f \u0915\u0930\u0947\u0902<\/button>\n\n  <!-- \u092a\u0930\u093f\u0923\u093e\u092e -->\n  <div id=\"result\"><\/div>\n\n  <script>\n    function generateQRCode() {\n      const type = document.getElementById(\"qrType\").value;\n      const link = document.getElementById(\"linkInput\").value.trim();\n      const mobile = document.getElementById(\"mobileInput\").value.trim();\n      const description = document.getElementById(\"descriptionInput\").value.trim();\n      const resultDiv = document.getElementById(\"result\");\n\n      resultDiv.innerHTML = \"\";\n\n      if (!type || !link || !mobile || !description) {\n        alert(\"\u0915\u0943\u092a\u092f\u093e \u0938\u092d\u0940 \u092b\u093c\u0940\u0932\u094d\u0921 \u092d\u0930\u0947\u0902!\");\n        return;\n      }\n\n      \/\/ \u0935\u093f\u0935\u0930\u0923 \u0926\u093f\u0916\u093e\u090f\u0902\n      const info = document.createElement(\"div\");\n      info.className = \"info\";\n      info.innerHTML = `\n        \ud83e\uddfe \u092f\u0939 <b>${type}<\/b> \u0915\u093e QR \u0915\u094b\u0921 \u0939\u0948<br>\n        \ud83d\udcf1 \u092e\u094b\u092c\u093e\u0907\u0932: ${mobile}<br>\n        \ud83d\udcdd \u0935\u093f\u0935\u0930\u0923: ${description}\n      `;\n      resultDiv.appendChild(info);\n\n      \/\/ QR \u0915\u094b\u0921 \u092c\u0928\u093e\u090f\u0902\n      QRCode.toCanvas(link, { width: 220 }, function (err, canvas) {\n        if (err) {\n          console.error(err);\n          alert(\"QR \u0915\u094b\u0921 \u091c\u0928\u0930\u0947\u091f \u0928\u0939\u0940\u0902 \u0939\u094b \u0938\u0915\u093e!\");\n        } else {\n          resultDiv.appendChild(canvas);\n        }\n      });\n    }\n  <\/script>\n\n<\/body>\n<\/html>\n","protected":false},"excerpt":{"rendered":"<p>Login\/Register &#8211; LocalStorage Login Login Don&#8217;t have account? Register Forgot Password? Register Already have account? Login Get Password Back to Login Welcome Logout QR \u0915\u094b\u0921 \u091c\u0928\u0930\u0947\u091f\u0930 \ud83d\udccc QR \u0915\u094b\u0921 \u091c\u0928\u0930\u0947\u091f \u0915\u0930\u0947\u0902 QR \u0915\u094b\u0921 \u0915\u093f\u0938 \u091a\u0940\u091c \u0915\u093e \u0939\u0948?FacebookWhatsAppYouTube\u0935\u0947\u092c\u0938\u093e\u0907\u091f\u0905\u0928\u094d\u092f \u2705 \u0938\u092c\u092e\u093f\u091f \u0915\u0930\u0947\u0902<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-29","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/sriviratramatanursery.sabpro.in\/index.php?rest_route=\/wp\/v2\/pages\/29","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/sriviratramatanursery.sabpro.in\/index.php?rest_route=\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/sriviratramatanursery.sabpro.in\/index.php?rest_route=\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/sriviratramatanursery.sabpro.in\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/sriviratramatanursery.sabpro.in\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=29"}],"version-history":[{"count":5,"href":"https:\/\/sriviratramatanursery.sabpro.in\/index.php?rest_route=\/wp\/v2\/pages\/29\/revisions"}],"predecessor-version":[{"id":89,"href":"https:\/\/sriviratramatanursery.sabpro.in\/index.php?rest_route=\/wp\/v2\/pages\/29\/revisions\/89"}],"wp:attachment":[{"href":"https:\/\/sriviratramatanursery.sabpro.in\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=29"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}