diff --git a/assets/js/user-history.js b/assets/js/user-history.js
new file mode 100644
index 0000000..26985f7
--- /dev/null
+++ b/assets/js/user-history.js
@@ -0,0 +1,177 @@
+async function postProductRating(product_id, formData,endpointData,sessionToken) {
+ const endpoint = `https://${endpointData}/api/v1/products/${product_id}/ratings`;
+ // const sessionToken = 'your-session-token-here'; // Replace with your actual session token logic
+
+ try {
+ const response = await fetch(endpoint, {
+ method: 'POST',
+ headers: {
+ 'Authorization': 'Bearer ' + sessionToken,
+ },
+ body: formData
+ });
+
+ if (!response.ok) {
+ throw new Error(`HTTP error! status: ${response.status}`);
+ }
+
+ return await response.json();
+ } catch (error) {
+ console.error('Error:', error);
+ throw error;
+ }
+}
+async function updateOrderRating(product_id,endpointData,sessionToken) {
+ const endpoint = `https://${endpointData}/api/v1/orders/${product_id}`;
+ // const sessionToken = 'your-session-token-here'; // Replace with your actual session token logic
+
+ try {
+ const response = await fetch(endpoint, {
+ method: 'PATCH',
+ headers: {
+ 'Content-Type': 'application/json',
+ 'Authorization': 'Bearer ' + sessionToken,
+ },
+ body: JSON.stringify({
+ "isRate": true
+ })
+ });
+
+ if (!response.ok) {
+ throw new Error(`HTTP error! status: ${response.status}`);
+ }
+
+ return await response.json();
+ } catch (error) {
+ console.error('Error:', error);
+ throw error;
+ }
+}
+async function uploadImageRating(formData,endpointData,sessionToken) {
+ const endpoint = `https://${endpointData}/api/v1/upload_image`;
+ // const sessionToken = 'your-session-token-here'; // Replace with your actual session token logic
+
+ try {
+ const response = await fetch(endpoint, {
+ method: 'POST',
+ headers: {
+ 'Authorization': 'Bearer ' + sessionToken,
+ },
+ body: formData
+ });
+
+ if (!response.ok) {
+ throw new Error(`HTTP error! status: ${response.status}`);
+ }
+
+ return await response.json();
+ } catch (error) {
+ console.error('Error:', error);
+ throw error;
+ }
+}
+async function sendFeedback(variation, rating,
+ comments, images, videos, customer_id,
+ order_id,
+ vendor_id, files, productId,
+ endpoint, sessionToken
+) {
+
+ const formData = new FormData();
+ const currentDate = new Date();
+ const formattedDate = currentDate
+ .toISOString().replace(/[-T:]/g, "")
+ .slice(0, -5);
+
+
+ formData.append('variation', variation);
+ formData.append('rating', rating);
+ formData.append('comments', comments);
+
+ formData.append('customer_id',
+ customer_id);
+ formData.append('order_id', order_id);
+ formData.append('vendor_id', vendor_id);
+ images?.forEach((image, index) => {
+ formData.append(
+ `images`,
+ image);
+ });
+
+ // Append videos to FormData
+ videos?.forEach((video, index) => {
+ formData.append(
+ `videos`,
+ video);
+ });
+
+
+ postProductRating(
+ productId,
+ formData,
+ endpoint, sessionToken
+ )
+ .then(response => {
+ console.log('Success:',
+ response);
+ if (!response) {
+ throw new Error(
+ 'Failed to send text message'
+ );
+ } else {
+
+
+ updateOrderRating(
+ order_id,
+ endpoint,
+ sessionToken
+ )
+ .then(
+ response1 => {
+ console.log(
+ 'Success:',
+ response1
+ );
+ if (
+ !
+ response1
+ ) {
+
+ throw new Error(
+ `
+ update order failed `
+ );
+ } else {
+ sendButton1
+ [
+ order_id
+ ]
+ .textContent =
+ "Submitted";
+ sendButton1
+ [
+ order_id
+ ]
+ .disabled =
+ true
+ }
+ })
+ .catch(error => {
+ console
+ .error(
+ 'Error:',
+ error
+ );
+ });
+
+
+
+
+ }
+ })
+ .catch(error => {
+ console.error('Error:',
+ error);
+ });
+
+}
\ No newline at end of file
diff --git a/product-left-sidebar.php b/product-left-sidebar.php
index ebb40a8..24400ff 100644
--- a/product-left-sidebar.php
+++ b/product-left-sidebar.php
@@ -92,24 +92,34 @@ if (isset($_GET['id'])) {
@@ -1628,7 +1638,7 @@ if (isset($_GET['id'])) {
alt="" /> -->
-
+
@@ -252,13 +271,15 @@ if ($_SESSION["isVendor"] == true) {
-->
-
+
-
alt="vendor image">
+
+ alt="vendor image">
@@ -300,13 +321,14 @@ if ($_SESSION["isVendor"] == true) {
-->
-
+
@@ -314,18 +336,36 @@ if ($_SESSION["isVendor"] == true) {
-
All Refunds
-
-
To Approve
-
-
To Ship
-
-
To Receive
-
-
To Refund
-
-
Complete
-
+
+ All Refunds
+
+
+
+ To Approve
+
+
+
+ To Ship
+
+
+
+ To Receive
+
+
+
+ To Refund
+
+
+
+ Complete
+
+
@@ -335,7 +375,7 @@ if ($_SESSION["isVendor"] == true) {
-
- |
+
+ |
-
-
+
+
No Refund/s Yet.';
- ?>
-
+ ?>
+
@@ -460,23 +513,36 @@ if ($_SESSION["isVendor"] == true) {
$orderExist = true;
$totalAmount += $order['total_amount'];
?>
-
-
- |
- |
- |
- |
- |
- |
-
- |
+
+ |
-
-
+
+
No To Approve Refund/s Yet.';
- ?>
-
+ ?>
+
@@ -499,7 +565,7 @@ if ($_SESSION["isVendor"] == true) {
-
+
@@ -534,23 +600,36 @@ if ($_SESSION["isVendor"] == true) {
$orderExist = true;
$totalAmount += $order['total_amount'];
?>
-
-
- |
- |
- |
- |
- |
- |
-
- |
+
+ |
-
-
+
+
No To Ship Refund/s Yet.';
- ?>
-
+ ?>
+
@@ -573,7 +652,7 @@ if ($_SESSION["isVendor"] == true) {
-
+
@@ -608,26 +687,39 @@ if ($_SESSION["isVendor"] == true) {
$orderExist = true;
$totalAmount += $order['total_amount'];
?>
-
-
- |
- |
- |
- |
- |
- |
-
- |
-
-
+
No To Receive Refund/s Yet.';
- ?>
-
+ ?>
+
@@ -685,26 +777,39 @@ if ($_SESSION["isVendor"] == true) {
$orderExist = true;
$totalAmount += $order['total_amount'];
?>
-
-
- |
- |
- |
- |
- |
- |
-
- |
-
-
+
No To Refund/s Yet.';
- ?>
-
+ ?>
+
@@ -761,28 +866,41 @@ if ($_SESSION["isVendor"] == true) {
$orderExist = true;
$totalAmount += $order['total_amount'];
?>
-
-
- |
- |
- |
- |
- |
- |
-
- |
-
-
-
-
+
+
-
+
-
+
@@ -1042,20 +1160,25 @@ if ($_SESSION["isVendor"] == true) {
@@ -1264,7 +1399,7 @@ if ($_SESSION["isVendor"] == true) {
-
+
@@ -1335,29 +1470,29 @@ if ($_SESSION["isVendor"] == true) {
diff --git a/vendor-dashboard.php b/vendor-dashboard.php
index 87db16c..48de342 100644
--- a/vendor-dashboard.php
+++ b/vendor-dashboard.php
@@ -64,7 +64,7 @@ if ($_SESSION["isCustomer"] == true) {
-
+
diff --git a/vendor-payments.php b/vendor-payments.php
index 78b562e..0bdbf2a 100644
--- a/vendor-payments.php
+++ b/vendor-payments.php
@@ -56,7 +56,7 @@ if ($_SESSION["isCustomer"] == true) {
-
+
@@ -103,6 +103,22 @@ if ($_SESSION["isCustomer"] == true) {
border: 1px solid #ccc;
border-radius: 4px;
}
+
+ .roww {
+ width: 100%;
+ display: flex;
+ /* justify-content: center;
+ align-items: center; */
+ flex-wrap: nowrap !important;
+ flex-direction: row !important;
+ }
+
+ @media(max-width:992px) {
+ .roww {
+ flex-wrap: wrap !important;
+
+ }
+ }
-
+
+
@@ -135,7 +155,7 @@ $vendorPayoutData = json_decode($response, true);
-
+
Vendor Payouts
@@ -157,7 +177,7 @@ $vendorPayoutData = json_decode($response, true);
-
+
@@ -317,18 +345,10 @@ $vendorPayoutData = json_decode($response, true);
-
+
Amount |
@@ -348,35 +368,37 @@ $vendorPayoutData = json_decode($response, true);
$payoutDate = date("F d, Y", strtotime($val['createdAt']));
$payoutId = $val['_id'];
if ((empty($vendorIdCheck) == false) && ($vendorIdCheck == $vendorId) && ($status == "Deposited")) { ?>
-
- |
-
+ |
+
- |
-
- N/A |
-
+
+ N/A |
+
- |
-
- N/A |
-
- |
- |
-
-
- |
-
+ |
+
+ N/A |
+
+ |
+ |
+
+
+ |
+
-
+
@@ -437,7 +459,7 @@ $vendorPayoutData = json_decode($response, true);
-
+
@@ -525,7 +547,7 @@ $vendorPayoutData = json_decode($response, true);
-
+