/
home
/
u775757334
/
domains
/
civicwelllife.com
/
public_html
/
seller
/
function
/
/home/u775757334/domains/civicwelllife.com/public_html/seller/function
mkdir
upload
Name
Size
Mode
Actions
ajax_function.php
13392
0644
edit
dl
rm
custum.css
10832
0644
edit
dl
rm
custum.js
4159
0644
edit
dl
rm
Edit:
/home/u775757334/domains/civicwelllife.com/public_html/seller/function/custum.js
(4159B)
jQuery(document).ready(function ($) { $("#sellerLoginForm").submit(function (e) { e.preventDefault(); let formData = new FormData(this); formData.append("case", "loginSeller"); $("#sellerLoginBtn").text("Please wait...").prop("disabled", true); $.ajax({ url: "function/ajax_function.php", type: "POST", data: formData, contentType: false, processData: false, success: function (res) { let r = typeof res === "string" ? JSON.parse(res) : res; if (r.status == 1) { window.location.href = r.redirect; } else { alert(r.msg); } $("#sellerLoginBtn").text("Login to Seller Panel").prop("disabled", false); }, error: function () { alert("Something went wrong. Please try again."); $("#sellerLoginBtn").text("Login to Seller Panel").prop("disabled", false); } }); }); $("#sellerProductForm").submit(function (e) { e.preventDefault(); let formData = new FormData(this); formData.append("case", "saveSellerProduct"); let btnText = $("input[name='product_id']").val() > 0 ? "Updating..." : "Saving..."; $("#saveProductBtn").text(btnText).prop("disabled", true); $.ajax({ url: "function/ajax_function.php", type: "POST", data: formData, contentType: false, processData: false, success: function (res) { let r = typeof res === "string" ? JSON.parse(res) : res; alert(r.msg); if (r.status == 1) { window.location.href = "product-list.php"; } $("#saveProductBtn").text($("input[name='product_id']").val() > 0 ? "Update Product" : "Save Product").prop("disabled", false); }, error: function () { alert("Something went wrong."); $("#saveProductBtn").text($("input[name='product_id']").val() > 0 ? "Update Product" : "Save Product").prop("disabled", false); } }); }); $(document).on("click", ".deleteBtn", function () { if (!confirm("Delete this record?")) return; let id = $(this).data("id"); let table = $(this).data("table"); let row = $(this).closest("tr"); $.ajax({ url: "function/ajax_function.php", type: "POST", data: { case: "deleteData1", id: id, table: table }, success: function (res) { let r = JSON.parse(res); if (r.status == 1) { alert(r.msg); row.fadeOut(); // remove row } else { alert(r.msg); } } }); }); $("#sellerProfileForm").submit(function (e) { e.preventDefault(); let formData = new FormData(this); formData.append("case", "saveSellerProfile"); $("#saveProfileBtn").text("Updating...").prop("disabled", true); $.ajax({ url: "function/ajax_function.php", type: "POST", data: formData, contentType: false, processData: false, success: function (res) { let r = typeof res === "string" ? JSON.parse(res) : res; alert(r.msg); if (r.status == 1) { window.location.reload(); } $("#saveProfileBtn").text("Update Profile").prop("disabled", false); }, error: function () { alert("Something went wrong."); $("#saveProfileBtn").text("Update Profile").prop("disabled", false); } }); }); });
Save
cmd:
run