This commit is contained in:
Aritra Banik 2024-02-18 16:43:23 +05:30
parent b5b52e8be0
commit cb6806ebc6
4 changed files with 31 additions and 3 deletions

Binary file not shown.

BIN
src/a3

Binary file not shown.

View File

@ -261,6 +261,9 @@ import
phoneError = ""
passwordError = ""
ch = ""
echo "hi"
echo ctx.urlForm
echo "bye"
try:
email = ctx.cookies["email"]
@ -453,10 +456,18 @@ import
password = ""
if email == "":
echo "No cookie found."
ctx.redirect("/login")
else:
products = micsGetProducts(email, password)
echo "Cookie found."
ctx &= initCookie("c_country", "")
ctx &= initCookie("c_fname", "")
ctx &= initCookie("c_lname", "")
ctx &= initCookie("c_address", "")
ctx &= initCookie("c_state_country", "")
ctx &= initCookie("c_postal_zip", "")
ctx &= initCookie("c_email_address", "")
ctx &= initCookie("c_phone", "")
compileTemplateFile(getScriptDir() / "a3a" / "thankyou.nimja")

View File

@ -351,6 +351,23 @@
</div>
<script>
document.getElementById("b3").onclick = function() {
document.cookie = "c_country="+document.getElementById("c_country").value;
document.cookie = "c_fname="+document.getElementById("c_fname").value;
document.cookie = "c_lname="+document.getElementById("c_lname").value;
document.cookie = "c_address="+document.getElementById("c_address").value;
document.cookie = "c_state_country="+document.getElementById("c_state_country").value;
document.cookie = "c_postal_zip="+document.getElementById("c_postal_zip").value;
document.cookie = "c_email_address="+document.getElementById("c_email_address").value;
document.cookie = "c_phone="+document.getElementById("c_phone").value;
if (document.getElementById("c_create_account").checked) {
document.cookie = "c_create_account="+document.getElementById("c_create_account").value;
}
// window.location.href = '/thankyou';
}
function continueShopping() {
window.location.href = '/shop';
}
@ -362,4 +379,4 @@
+ quantity;
} #}
</script>
{% endblock %}
{% endblock %}