diff --git a/admin/user-card.php b/admin/user-card.php index 5db84fb..637fe3d 100644 --- a/admin/user-card.php +++ b/admin/user-card.php @@ -101,7 +101,7 @@ $users = getUsers();
diff --git a/admin/vendor-card.php b/admin/vendor-card.php index 12ee445..59bfcde 100644 --- a/admin/vendor-card.php +++ b/admin/vendor-card.php @@ -814,11 +814,32 @@ function validateEmail(vendorId) { // echo "$i"; // } - if ($totalVendors >= $vendorsPerPage) { + /* if ($totalVendors >= $vendorsPerPage) { for ($i = 1; $i <= $totalPages; $i++) { echo "$i"; } - } + } */ + + $start = max(1, $currentpage - 2); + $end = min($totalPages, $start + 4); + + if ($start > 1) { + echo "1"; + if ($start > 2) { + echo " ... "; + } + } + + for ($i = $start; $i <= $end; $i++) { + echo "$i "; + } + + if ($end < $totalPages) { + if ($end < $totalPages - 1) { + echo " ... "; + } + echo "$totalPages"; + } ?>
diff --git a/checkouttest.php b/checkouttest.php index 7e02241..8304e7e 100644 --- a/checkouttest.php +++ b/checkouttest.php @@ -389,7 +389,7 @@ if (isset($customer_data[0]["address"]) && is_array($customer_data[0]["address"]
- +
@@ -419,7 +419,7 @@ if (isset($customer_data[0]["address"]) && is_array($customer_data[0]["address"]
- +
@@ -452,7 +452,7 @@ if (isset($customer_data[0]["address"]) && is_array($customer_data[0]["address"]
- +
- - + ${ + (product["sale_price"] && product["sale_price"] > 0) ? + ` + ` : + (product["regular_price"] && product["regular_price"] != "") ? + ` + ` : + `` + }
diff --git a/user-profile.php b/user-profile.php index d44ef18..8e2c482 100644 --- a/user-profile.php +++ b/user-profile.php @@ -330,7 +330,7 @@ if ($_SESSION["isVendor"] == true) {
- +
@@ -360,7 +360,7 @@ if ($_SESSION["isVendor"] == true) {
- +
@@ -397,7 +397,7 @@ if ($_SESSION["isVendor"] == true) {
- + "> -
+
@@ -227,7 +238,7 @@ if ($_SESSION["isVendor"] == true) { echo ''; echo '' . $product['regular_price'] . ''; echo '' . $product['sale_price'] . ''; - echo ''; + echo ''; } else { echo '' . $product['regular_price'] . ''; } @@ -335,7 +346,7 @@ if ($_SESSION["isVendor"] == true) { if (xhr.status === 200) { // Product removed successfully, you can handle the UI update here if needed console.log('Product removed successfully'); - // location.reload(); // Refresh the page after removing the product + location.reload(); // Refresh the page after removing the product } else { // Handle error response console.error('Error removing product:', xhr.responseText); @@ -368,9 +379,9 @@ if ($_SESSION["isVendor"] == true) { xhr.setRequestHeader('Content-Type', 'application/json'); xhr.onreadystatechange = function() { if (xhr.readyState === XMLHttpRequest.DONE) { - if (xhr.status === 200) { + if (xhr.status === 0) { console.log('Products removed successfully'); - // location.reload(); + location.reload(); } else { console.error('Error removing products:', xhr.responseText); } @@ -777,7 +788,7 @@ if ($_SESSION["isVendor"] == true) { '; + echo ''; } else { echo ''; }