Compare commits

...

102 Commits
mark_3 ... main

Author SHA1 Message Date
MarkHipe c1c7611bb3 Merge pull request 'louie_branch' (#92) from louie_branch into main
Reviewed-on: #92
2024-06-05 15:53:37 +08:00
jouls bdc6f313e6 Merge branch 'main' of https://code.obanana.io/Obanana.Corporation/obanana_b2b_test into louie_branch 2024-06-05 15:44:12 +08:00
jouls c0f77b9415 added required fields for vendor first name 2024-06-05 15:43:47 +08:00
MarkHipe 58281130a5 Merge pull request 'new changes' (#91) from mark_4 into main
Reviewed-on: #91
2024-06-05 15:41:22 +08:00
mark H 86bd2d6f47 new changes 2024-06-05 15:40:23 +08:00
jouls cfe9c96697 Merge branch 'main' of https://code.obanana.io/Obanana.Corporation/obanana_b2b_test into louie_branch 2024-06-03 10:59:53 +08:00
jouls c382fa82bf added total payouts per vendor card in admin side 2024-05-31 18:39:17 +08:00
MarkHipe b5fd8dae3c Merge pull request 'search prod fix error' (#90) from mark_4 into main
Reviewed-on: #90
2024-05-30 13:38:33 +08:00
mark H bcfae881a6 search prod fix error 2024-05-30 13:37:52 +08:00
MarkHipe f24b1e303d Merge pull request 'minor fixes in label in user-profile/vendor-settings and minor ui changes in header.php' (#89) from gelo_branch into main
Reviewed-on: #89
2024-05-30 10:34:17 +08:00
gelonspr cb52a82b40 minor fixes in label in user-profile/vendor-settings and minor ui changes in header.php 2024-05-30 10:33:40 +08:00
MarkHipe 35928618e9 Merge pull request 'mark_4' (#88) from mark_4 into main
Reviewed-on: #88
2024-05-30 10:30:28 +08:00
mark H 306edd1db5 Merge branch 'main' of https://code.obanana.io/Obanana.Corporation/obanana_b2b_test into mark_4 2024-05-30 10:29:44 +08:00
mark H 3e8caa1e28 obanana rating 2024-05-30 10:03:49 +08:00
MarkHipe ba91559ff3 Merge pull request 'louie_branch' (#87) from louie_branch into main
Reviewed-on: #87
2024-05-30 10:03:35 +08:00
jouls 4a8603ee48 fixed address section of vendor-settings and user-profile 2024-05-28 18:23:48 +08:00
jouls 58ac2155cb Added required prop on product name, slug, width, height, length, and weight. 2024-05-28 15:53:17 +08:00
jouls 25e991dc37 renamed displayed property on vendor profile under admin page 2024-05-28 14:34:12 +08:00
jouls b2deee4405 added logical handling for seller since with empty date_registered fields 2024-05-23 10:49:46 +08:00
jouls fbb4cd8082 removed duplicated contact us number and email 2024-05-23 10:49:26 +08:00
jouls f616306a45 added pagination admin vendor payments and payouts table 2024-05-22 18:46:36 +08:00
jouls 4620fde33d fixed vendor name and customer name on index 2024-05-22 15:46:35 +08:00
jouls cffda7e9e5 edited vendor payouts breadcrumbs 2024-05-22 15:46:15 +08:00
MarkHipe 69a94fdfb0 Merge pull request 'mark_4' (#86) from mark_4 into main
Reviewed-on: #86
2024-05-21 09:56:39 +08:00
mark H ac3209663e Merge branch 'main' of https://code.obanana.io/Obanana.Corporation/obanana_b2b_test into mark_4 2024-05-21 09:43:55 +08:00
mark H 4b996b873c obanana chat 2024-05-21 09:18:10 +08:00
MarkHipe 82815035da Merge pull request 'added address label on vendor and buyer profile settings, initialized map on admin, fixed missing header on vendor-payments' (#85) from gelo_branch into main
Reviewed-on: #85
2024-05-21 09:17:37 +08:00
gelonspr bc7c212b91 added address label on vendor and buyer profile settings, initialized map on admin, fixed missing header on vendor-payments 2024-05-21 09:15:21 +08:00
MarkHipe 0f48dfc231 Merge pull request 'louie_branch' (#84) from louie_branch into main
Reviewed-on: #84
2024-05-21 09:12:13 +08:00
jouls af34ad5738 improved styling of badge for order status on vendor dashboard 2024-05-15 18:16:59 +08:00
jouls 53698a00b0 changed button size on admin order-history to medium 2024-05-15 18:14:52 +08:00
jouls 813f7eb8b9 added javascript for line chart of monthly users 2024-05-15 18:14:32 +08:00
jouls a5b1d41094 added badge and improved styling on order status, fixed profile size on new customers and new vendors 2024-05-15 18:14:16 +08:00
jouls e1d31a0a47 imporvements on stylings and renaming of line chart for monthly users 2024-05-15 18:13:34 +08:00
jouls 092afe0fa1 fixed bug on edit and delete bank function 2024-05-15 18:10:19 +08:00
jouls 68959b61ce added array_reverse on payout data table to show latest payouts first on the table 2024-05-15 18:09:39 +08:00
jouls 40549f484e added required field for tracking number and courier name in to ship status on orders edit 2024-05-15 18:08:53 +08:00
jouls 3b6e0b843d fixed display of vendor or customer name on index 2024-05-15 18:08:02 +08:00
jouls 67ef426e36 removed to upper on first name and last name 2024-05-15 18:07:04 +08:00
MarkHipe 0b12c0bae7 Merge pull request 'mark_4' (#83) from mark_4 into main
Reviewed-on: #83
2024-05-08 18:07:24 +08:00
mark H 2c47485103 Merge branch 'main' of https://code.obanana.io/Obanana.Corporation/obanana_b2b_test into mark_4 2024-05-08 18:05:13 +08:00
mark H 94012e7ccb update exempt To checkout status 2024-05-08 18:04:59 +08:00
MarkHipe 3a513218c5 Merge pull request 'gelo_branch' (#82) from gelo_branch into main
Reviewed-on: #82
2024-05-08 18:03:59 +08:00
gelonspr f2adac3fbc minor changes 2024-05-08 18:02:41 +08:00
gelonspr d0f51e2a03 minor changes in user-profile.php 2024-05-08 18:01:19 +08:00
gelonspr 6efdc5f4dd added message if wishlist is empty 2024-05-08 18:00:36 +08:00
gelonspr 9e5694145a Remove checkout option on Account icon and removed category button in login.php 2024-05-08 18:00:10 +08:00
gelonspr 2ef5f188d7 Add function to checkbox by clicking the category text on sidebar under shop-list-left-sidebar.php and Adjust Naming on shop-list-left-sidebar.php 2024-05-08 17:57:53 +08:00
MarkHipe bf27328ec3 Merge pull request 'louie_branch' (#81) from louie_branch into main
Reviewed-on: #81
2024-05-08 17:54:16 +08:00
jouls 4fe563d212 added dynamic information of vendor in admin vendor profile 2024-05-08 17:49:41 +08:00
jouls ac7fcc6942 added required prop on certain input fields 2024-05-08 17:49:16 +08:00
jouls b254e6241d added reload on delete selected products 2024-05-08 15:39:59 +08:00
jouls eed7c3d7b1 added edit and delete functionality on vendors bank information 2024-05-08 14:20:48 +08:00
jouls d0e49d0ea4 added strtoupper to control possible errors on payment status 2024-05-08 14:20:14 +08:00
MarkHipe fd8016afd0 Merge pull request 'mark_4' (#80) from mark_4 into main
Reviewed-on: #80
2024-05-03 18:46:44 +08:00
mark H 7c5c0cab4f Merge branch 'main' of https://code.obanana.io/Obanana.Corporation/obanana_b2b_test into mark_4 2024-05-03 18:24:24 +08:00
mark H 6160b494c9 new update 2024-05-03 18:21:20 +08:00
MarkHipe 478b74c465 Merge pull request 'stacy_branch' (#79) from stacy_branch into main
Reviewed-on: #79
2024-05-03 18:15:57 +08:00
Stacy 62c2d9ae1b pagination & search filter 2024-05-03 18:13:39 +08:00
Stacy 7d44fae6bd cart & wishlist countdown in mobile view 2024-05-03 18:12:24 +08:00
Stacy 02b2f799db removed products for Sale/Inquiry in Vendor's Page 2024-05-03 18:09:25 +08:00
Stacy 1d6b14208d Vendor: Remove Buttons - Wishlist and Cart 2024-05-03 18:07:31 +08:00
Stacy 8439191bbc selection button for address 2024-05-03 18:05:45 +08:00
MarkHipe 3d686c607f Merge pull request 'fixed dynamic data for admin sales report chart' (#78) from gelo_branch into main
Reviewed-on: #78
2024-05-03 17:05:16 +08:00
gelonspr 22a3a404aa fixed dynamic data for admin sales report chart 2024-05-03 17:00:39 +08:00
MarkHipe eec3c04121 Merge pull request 'louie_branch' (#77) from louie_branch into main
Reviewed-on: #77
2024-05-03 16:58:01 +08:00
jouls 0728acbcc6 Merge branch 'main' of https://code.obanana.io/Obanana.Corporation/obanana_b2b_test into louie_branch 2024-05-03 16:55:32 +08:00
MarkHipe d4f61153d2 Merge pull request 'minor bugs' (#76) from raymart_branch into main
Reviewed-on: #76
2024-05-03 16:34:13 +08:00
raymart 7679dad1e6 minor bugs 2024-05-03 16:31:55 +08:00
jouls 4200c4e155 minor fixes on stylings inside modal box 2024-05-02 17:22:39 +08:00
jouls 2da9f77349 Improved data table and layout of vendouy payouts page 2024-05-02 15:59:16 +08:00
MarkHipe 4d7a47b158 Merge pull request 'mark_4' (#75) from mark_4 into main
Reviewed-on: #75
2024-04-30 14:49:08 +08:00
mark H 613325f68d new update 2024-04-30 14:46:53 +08:00
mark H 0c368796a7 Merge branch 'main' of https://code.obanana.io/Obanana.Corporation/obanana_b2b_test into mark_4 2024-04-30 14:42:33 +08:00
mark H a9853d178c - new update 2024-04-30 14:25:28 +08:00
MarkHipe a7a4b1482d Merge pull request 'stacy_branch' (#74) from stacy_branch into main
Reviewed-on: #74
2024-04-30 14:17:02 +08:00
Stacy c361a31143 Merge branch 'main' of https://code.obanana.io/Obanana.Corporation/obanana_b2b_test into stacy_branch 2024-04-30 14:12:32 +08:00
MarkHipe 2cb98f24d6 Merge pull request 'fixed admin dashboard download csv and initialized dynamic dataset for sales report' (#73) from gelo_branch into main
Reviewed-on: #73
2024-04-30 14:10:49 +08:00
gelonspr f278bb854d fixed admin dashboard download csv and initialized dynamic dataset for sales report 2024-04-30 14:09:53 +08:00
MarkHipe c154d801d2 Merge pull request 'louie_branch' (#72) from louie_branch into main
Reviewed-on: #72
2024-04-30 14:07:17 +08:00
jouls 32fd214c51 Merge branch 'main' of https://code.obanana.io/Obanana.Corporation/obanana_b2b_test into louie_branch 2024-04-30 14:03:55 +08:00
Stacy 3fdab75955 applied price matrix on hover addtocart buttons 2024-04-30 13:47:33 +08:00
Stacy 3e3ebfe66c created back button 2024-04-30 13:46:28 +08:00
Stacy 3f334715f3 updated quantity UI 2024-04-30 13:45:35 +08:00
Stacy 7d847cd447 removed some reload and modified console 2024-04-30 13:44:23 +08:00
jouls b4b69ba223 added dynamic bank information on upcoming payouts based on the default bank payout set by the user 2024-04-30 09:26:24 +08:00
MarkHipe b92be0667d Merge pull request 'minor bugs, add +63 in contact at modal, pagination in admin' (#71) from raymart_branch into main
Reviewed-on: #71
2024-04-30 09:12:20 +08:00
raymart e6ea65914e minor bugs, add +63 in contact at modal, pagination in admin 2024-04-30 09:11:18 +08:00
jouls ca799e9c23 added bank name in upcoming payouts in payouts tab 2024-04-30 09:04:40 +08:00
MarkHipe 465679ae48 Merge pull request 'Updates on checkout, product page, user history, vendor settings, vendor profile' (#70) from jun-branch into main
Reviewed-on: #70
2024-04-30 08:28:00 +08:00
Jun Barroga e1771dccdc Updates on checkout, product page, user history, vendor settings, vendor profile 2024-04-30 08:22:40 +08:00
jouls 2ad0c9e955 changed logic of summation of daily revenue 2024-04-26 17:36:12 +08:00
jouls e8b5b6b50c added return status column on recent orders table 2024-04-26 17:35:53 +08:00
jouls 0dd203aba2 added error handling for routes on vendor pages 2024-04-26 15:47:05 +08:00
jouls 88ae2713bb improvements on new vendors table 2024-04-26 14:26:32 +08:00
jouls e30cbcebd7 improvements on admin dashboard and order history 2024-04-26 13:01:28 +08:00
jouls 0dfa648b19 Added total users and new vendors table, improvements on recent orders table 2024-04-25 18:21:15 +08:00
jouls 8858763cd6 Added New Customers Table 2024-04-25 17:18:36 +08:00
jouls 793afa339f Added Daily Signup Counter 2024-04-25 15:35:16 +08:00
jouls 35a6c3b693 added functions for getAllCustomers and getAllVendors 2024-04-25 15:34:57 +08:00
jouls 46995fef7b removed forgot pass in register user 2024-04-25 15:16:37 +08:00
MarkHipe 69afa41d33 Merge pull request 'fix error' (#69) from mark_3 into main
Reviewed-on: #69
2024-04-24 09:50:50 +08:00
65 changed files with 12980 additions and 11572 deletions

View File

@ -18,7 +18,10 @@
<meta name="msapplication-TileImage" content="assets/images/favicon/favicon.png" />
<!-- css Icon Font -->
<link rel="stylesheet" href="assets/css/vendor/ecicons.min.css" />
<link rel="stylesheet" href="assets/css/vendor/ecicons.min.css" />
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.2/css/all.min.css"
integrity="sha512-SnH5WK+bZxgPHs44uWIX+LLJAJ9/2PkPKZ5QiAj6Ta86w+fsb2TkcmfRyVX3pBnMFcV7oQPJkl9QevSCWr3W6A=="
crossorigin="anonymous" referrerpolicy="no-referrer" />
<!-- css All Plugins Files -->
<link rel="stylesheet" href="assets/css/plugins/animate.css" />
@ -458,129 +461,7 @@
</div>
<!-- Cart Floating Button end -->
<!-- Whatsapp -->
<div class="ec-style ec-right-bottom">
<!-- Start Floating Panel Container -->
<div class="ec-panel">
<!-- Panel Header -->
<div class="ec-header">
<strong>Need Help?</strong>
<p>Chat with us on WhatsApp</p>
</div>
<!-- Panel Content -->
<div class="ec-body">
<ul>
<!-- Start Single Contact List -->
<li>
<a class="ec-list" data-number="918866774266"
data-message="Please help me! I have got wrong product - ORDER ID is : #654321485">
<div class="d-flex bd-highlight">
<!-- Profile Picture -->
<div class="ec-img-cont">
<img loading="lazy" src="assets/images/whatsapp/profile_01.jpg" class="ec-user-img"
alt="Profile image">
<span class="ec-status-icon"></span>
</div>
<!-- Display Name & Last Seen -->
<div class="ec-user-info">
<span>Sahar Darya</span>
<p>Sahar left 7 mins ago</p>
</div>
<!-- Chat iCon -->
<div class="ec-chat-icon">
<i class="fa fa-whatsapp"></i>
</div>
</div>
</a>
</li>
<!--/ End Single Contact List -->
<!-- Start Single Contact List -->
<li>
<a class="ec-list" data-number="918866774266"
data-message="Please help me! I have got wrong product - ORDER ID is : #654321485">
<div class="d-flex bd-highlight">
<!-- Profile Picture -->
<div class="ec-img-cont">
<img loading="lazy" src="assets/images/whatsapp/profile_02.jpg" class="ec-user-img"
alt="Profile image">
<span class="ec-status-icon ec-online"></span>
</div>
<!-- Display Name & Last Seen -->
<div class="ec-user-info">
<span>Yolduz Rafi</span>
<p>Yolduz is online</p>
</div>
<!-- Chat iCon -->
<div class="ec-chat-icon">
<i class="fa fa-whatsapp"></i>
</div>
</div>
</a>
</li>
<!--/ End Single Contact List -->
<!-- Start Single Contact List -->
<li>
<a class="ec-list" data-number="918866774266"
data-message="Please help me! I have got wrong product - ORDER ID is : #654321485">
<div class="d-flex bd-highlight">
<!-- Profile Picture -->
<div class="ec-img-cont">
<img loading="lazy" src="assets/images/whatsapp/profile_03.jpg" class="ec-user-img"
alt="Profile image">
<span class="ec-status-icon ec-offline"></span>
</div>
<!-- Display Name & Last Seen -->
<div class="ec-user-info">
<span>Nargis Hawa</span>
<p>Nargis left 30 mins ago</p>
</div>
<!-- Chat iCon -->
<div class="ec-chat-icon">
<i class="fa fa-whatsapp"></i>
</div>
</div>
</a>
</li>
<!--/ End Single Contact List -->
<!-- Start Single Contact List -->
<li>
<a class="ec-list" data-number="918866774266"
data-message="Please help me! I have got wrong product - ORDER ID is : #654321485">
<div class="d-flex bd-highlight">
<!-- Profile Picture -->
<div class="ec-img-cont">
<img loading="lazy" src="assets/images/whatsapp/profile_04.jpg" class="ec-user-img"
alt="Profile image">
<span class="ec-status-icon ec-offline"></span>
</div>
<!-- Display Name & Last Seen -->
<div class="ec-user-info">
<span>Khadija Mehr</span>
<p>Khadija left 50 mins ago</p>
</div>
<!-- Chat iCon -->
<div class="ec-chat-icon">
<i class="fa fa-whatsapp"></i>
</div>
</div>
</a>
</li>
<!--/ End Single Contact List -->
</ul>
</div>
</div>
<!--/ End Floating Panel Container -->
<!-- Start Right Floating Button-->
<div class="ec-right-bottom">
<div class="ec-box">
<div class="ec-button rotateBackward">
<img loading="lazy" class="whatsapp" src="assets/images/common/whatsapp.png" alt="whatsapp icon" />
</div>
</div>
</div>
<!--/ End Right Floating Button-->
</div>
<!-- Whatsapp end -->
<!-- Feature tools -->
<div class="ec-tools-sidebar-overlay"></div>

View File

@ -7,12 +7,17 @@ $(document).ready(function() {
fetchData()
.then(function (response) {
responseData = response.data;
console.log(responseData);
const completedOrdersCount = countCompletedOrders(responseData);
const toPayOrdersCount = countToPayOrders(responseData);
const toShipOrdersCount = countToShipOrders(responseData);
const returnedOrdersCount = countReturnedpOrders(responseData);
const returnedOrdersCount = countReturnedOrders(responseData);
const { cod_monthly_totals, obpay_monthly_totals, months } = countMonthlySales(responseData);
const { cod_daily_totals, obpay_daily_totals } = countDailySales(responseData);
const { cod_yearly_totals, obpay_yearly_totals, years } = countYearlySales(responseData);
initializeChart(completedOrdersCount, toPayOrdersCount, toShipOrdersCount, returnedOrdersCount);
initializeSalesChart(cod_daily_totals, obpay_daily_totals, cod_monthly_totals,
obpay_monthly_totals, months, cod_yearly_totals, obpay_yearly_totals, years
);
})
.catch(function (error) {
console.error('Error fetching data:', error);
@ -24,50 +29,266 @@ $(document).ready(function() {
}
function countCompletedOrders(data) {
let completedOrdersCount = 0;
data.forEach(function(order) {
function getCurrentMonthData(data) {
const now = new Date();
const currentMonth = now.getMonth();
const currentYear = now.getFullYear();
return data.filter(order => {
const orderDate = new Date(order.order_date);
return orderDate.getMonth() === currentMonth && orderDate.getFullYear() === currentYear;
});
}
function countCompletedOrders(data) {
const filteredData = getCurrentMonthData(data);
let completedOrdersCount = 0;
filteredData.forEach(function(order) {
if (order.status === 'COMPLETED') {
completedOrdersCount++;
completedOrdersCount++;
}
});
console.log(completedOrdersCount)
return completedOrdersCount;
});
console.log(completedOrdersCount);
return completedOrdersCount;
}
function countYearlySales(data) {
const now = new Date();
const years = [];
const cod_yearly_totals = Array(5).fill(0);
const obpay_yearly_totals = Array(5).fill(0);
// Initialize years array with the current year and the previous four years
for (let i = 4; i >= 0; i--) {
const year = new Date(now.getFullYear() - i, 0, 1); // January 1st of each year
years.push(year);
}
data.forEach(order => {
const orderDate = new Date(order.order_date);
orderDate.setHours(0, 0, 0, 0);
function countToPayOrders(data) {
let toPayOrdersCount = 0;
data.forEach(function(order) {
// Check if payment status exists and is not null
if (order.payment && order.payment.status) {
const payment_status = order.payment.status.toLowerCase();
years.forEach((year, index) => {
if (orderDate.getFullYear() === year.getFullYear()) {
if (payment_status === "paid") {
const total_amount = parseInt(order.total_amount);
if (order.payment_method === "Cash On Delivery") {
cod_yearly_totals[4 - index] += total_amount; // Adjust index since we are going from current to past
} else if (order.payment_method === "Obananapay") {
obpay_yearly_totals[4 - index] += total_amount;
}
}
}
});
}
});
cod_yearly_totals.reverse();
obpay_yearly_totals.reverse();
return {
cod_yearly_totals,
obpay_yearly_totals,
years: years.map(year => year.getFullYear().toString()) // Return year labels for use in charts or displays
};
}
function countMonthlySales(data) {
const now = new Date();
const months = [];
const cod_monthly_totals = Array(12).fill(0);
const obpay_monthly_totals = Array(12).fill(0);
for (let i = 11; i >= 0; i--) {
const month = new Date(now.getFullYear(), now.getMonth() - i, 1);
months.push(month);
}
data.forEach(order => {
if (order.payment && order.payment.status){
const orderDate = new Date(order.order_date);
orderDate.setHours(0, 0, 0, 0);
const payment_status = order.payment.status.toLowerCase();
months.forEach((month, index) => {
if (orderDate.getFullYear() === month.getFullYear() && orderDate.getMonth() === month.getMonth()) {
if (payment_status === "paid") {
const total_amount = parseInt(order.total_amount);
if (order.payment_method === "Cash On Delivery") {
cod_monthly_totals[11 - index] += total_amount;
} else if (order.payment_method === "Obananapay") {
obpay_monthly_totals[11 - index] += total_amount;
}
}
}
});
}
});
console.log(cod_monthly_totals)
cod_monthly_totals.reverse();
obpay_monthly_totals.reverse();
return {
cod_monthly_totals,
obpay_monthly_totals,
months: months.map(month => `${month.toLocaleString('default', { month: 'short' })} ${month.getFullYear()}`) // Return month labels for use in charts or displays
};
}
function countDailySales(data) {
const today = new Date();
today.setHours(0, 0, 0, 0);
const sevenDaysAgo = new Date();
sevenDaysAgo.setDate(today.getDate() - 6);
sevenDaysAgo.setHours(0, 0, 0, 0);
const sixDaysAgo = new Date();
sixDaysAgo.setDate(today.getDate() - 5);
sixDaysAgo.setHours(0, 0, 0, 0);
const fiveDaysAgo = new Date();
fiveDaysAgo.setDate(today.getDate() - 4);
fiveDaysAgo.setHours(0, 0, 0, 0);
const fourDaysAgo = new Date();
fourDaysAgo.setDate(today.getDate() - 3);
fourDaysAgo.setHours(0, 0, 0, 0);
const threeDaysAgo = new Date();
threeDaysAgo.setDate(today.getDate() - 2);
threeDaysAgo.setHours(0, 0, 0, 0);
const twoDaysAgo = new Date();
twoDaysAgo.setDate(today.getDate() - 1);
twoDaysAgo.setHours(0, 0, 0, 0);
//variables for total daily sales on COD
let cod_total_7 = 0;
let cod_total_6 = 0;
let cod_total_5 = 0;
let cod_total_4 = 0;
let cod_total_3 = 0;
let cod_total_2 = 0;
let cod_total_1 = 0;
//variables for total daily sales on ObananaPay
let obpay_total_7 = 0;
let obpay_total_6 = 0;
let obpay_total_5 = 0;
let obpay_total_4 = 0;
let obpay_total_3 = 0;
let obpay_total_2 = 0;
let obpay_total_1 = 0;
data.forEach(order => {
const orderDate = new Date(order.order_date);
orderDate.setHours(0, 0, 0, 0);
const payment_status = order.payment.status;
if (orderDate.getTime() === sevenDaysAgo.getTime() ) {
if(payment_status.toLowerCase() === "paid" && order.payment_method === "Cash On Delivery" ){
cod_total_7 += parseInt(order.total_amount);
console.log(order)
// console.log("compare:" + sevenDaysAgo)
}else if (payment_status.toLowerCase() === "paid" && order.payment_method === "Obananapay") {
obpay_total_7 += parseInt(order.total_amount);
}
}else if (orderDate.getTime() === sixDaysAgo.getTime() ) {
if(payment_status.toLowerCase() === "paid" && order.payment_method === "Cash On Delivery" ){
cod_total_6 += parseInt(order.total_amount);
console.log(order)
// console.log("compare:" + sevenDaysAgo)
}else if (payment_status.toLowerCase() === "paid" && order.payment_method === "Obananapay") {
obpay_total_6 += parseInt(order.total_amount);
}
}else if (orderDate.getTime() === fiveDaysAgo.getTime() ) {
if(payment_status.toLowerCase() === "paid" && order.payment_method === "Cash On Delivery" ){
cod_total_5 += parseInt(order.total_amount);
console.log(order)
// console.log("compare:" + sevenDaysAgo)
}else if (payment_status.toLowerCase() === "paid" && order.payment_method === "Obananapay") {
obpay_total_5 += parseInt(order.total_amount);
}
}else if (orderDate.getTime() === fourDaysAgo.getTime() ) {
if(payment_status.toLowerCase() === "paid" && order.payment_method === "Cash on Delivery" ){
cod_total_4 += parseInt(order.total_amount);
console.log(order)
// console.log("compare:" + sevenDaysAgo)
}else if (payment_status.toLowerCase() === "paid" && order.payment_method === "Obananapay") {
obpay_total_4 += parseInt(order.total_amount);
}
}else if (orderDate.getTime() === threeDaysAgo.getTime() ) {
if(payment_status.toLowerCase() === "paid" && order.payment_method === "Cash On Delivery" ){
cod_total_3 += parseInt(order.total_amount);
console.log(order)
// console.log("compare:" + sevenDaysAgo)
}else if (payment_status.toLowerCase() === "paid" && order.payment_method === "Obananapay") {
obpay_total_3 += parseInt(order.total_amount);
}
}else if (orderDate.getTime() === twoDaysAgo.getTime() ) {
if(payment_status.toLowerCase() === "paid" && order.payment_method === "Cash On Delivery" ){
cod_total_2 += parseInt(order.total_amount);
console.log(order)
// console.log("compare:" + sevenDaysAgo)
}else if (payment_status.toLowerCase() === "paid" && order.payment_method === "Obananapay") {
obpay_total_2 += parseInt(order.total_amount);
}
}else if (orderDate.getTime() === today.getTime() ) {
if(payment_status.toLowerCase() === "paid" && order.payment_method === "Cash On Delivery" ){
cod_total_1 += parseInt(order.total_amount);
console.log(order)
// console.log("compare:" + sevenDaysAgo)
}else if (payment_status.toLowerCase() === "paid" && order.payment_method === "Obananapay") {
obpay_total_1 += parseInt(order.total_amount);
}
}
});
const cod_daily_totals = [cod_total_7, cod_total_6, cod_total_5, cod_total_4, cod_total_3, cod_total_2, cod_total_1,];
const obpay_daily_totals = [obpay_total_7, obpay_total_6, obpay_total_5, obpay_total_4, obpay_total_3, obpay_total_2, obpay_total_1,];
// console.log(total_7);
return { cod_daily_totals, obpay_daily_totals };
}
function countToPayOrders(data) {
const filteredData = getCurrentMonthData(data);
let toPayOrdersCount = 0;
filteredData.forEach(function(order) {
if (order.status === 'TO PAY') {
toPayOrdersCount++;
toPayOrdersCount++;
}
});
console.log(toPayOrdersCount)
return toPayOrdersCount;
}
function countToShipOrders(data) {
let toShipOrdersCount = 0;
data.forEach(function(order) {
});
console.log(toPayOrdersCount);
return toPayOrdersCount;
}
function countToShipOrders(data) {
const filteredData = getCurrentMonthData(data);
let toShipOrdersCount = 0;
filteredData.forEach(function(order) {
if (order.status === 'TO SHIP') {
toShipOrdersCount++;
toShipOrdersCount++;
}
});
console.log(toShipOrdersCount)
return toShipOrdersCount;
}
function countReturnedpOrders(data) {
let returnedOrdersCount = 0;
data.forEach(function(order) {
});
console.log(toShipOrdersCount);
return toShipOrdersCount;
}
function countReturnedOrders(data) {
const filteredData = getCurrentMonthData(data);
let returnedOrdersCount = 0;
filteredData.forEach(function(order) {
if (order.status === 'RETURNED') {
returnedOrdersCount++;
returnedOrdersCount++;
}
});
console.log(returnedOrdersCount)
return returnedOrdersCount;
}
});
console.log(returnedOrdersCount);
return returnedOrdersCount;
}
function initializeChart(completedOrdersCount , toPayOrdersCount, toShipOrdersCount, returnedOrdersCount) {
var doughnut = document.getElementById("doughnut-chart");
@ -112,49 +333,449 @@ $(document).ready(function() {
}
}
});
} else {
}
}
function initializeSalesChart(cod_daily_totals, obpay_daily_totals, cod_monthly_totals, obpay_monthly_totals, months, cod_yearly_totals, obpay_yearly_totals, years) {
var acquisition = document.getElementById("salesChart");
if (acquisition !== null) {
function updateDailyLabels() {
var labelsDaily = [];
for (let i = 6; i >= 0; i--) {
var date = new Date();
date.setDate(date.getDate() - i);
labelsDaily.push(formatDate(date));
}
return labelsDaily;
}
function formatDate(date) {
const options = { day: 'numeric', month: 'short' }; // E.g., 26 Apr
return date.toLocaleDateString('en-US', options);
}
// Updating labelsDaily dynamically
var labelsDaily = updateDailyLabels();
var labelsMonthly = months;
var labelsYearly = years;
var acqData = [
{ //daily data
first: cod_daily_totals, //COD
second: obpay_daily_totals, //ObPay
third: [44, 167, 102, 123, 183, 88, 134] //Paymongo
},
{ //monthly data
first: cod_monthly_totals, //COD
second: obpay_monthly_totals, //ObPay
third: [55, 44, 144, 75, 155, 166, 70] //Paymongo
},
{ //yearly data
first: cod_yearly_totals, //COD
second: obpay_yearly_totals, //ObPay
third: [156, 23, 165, 88, 112 ] //Paymongo
}
];
var configAcq = {
// The type of chart we want to create
type: "line",
// The data for our dataset
data: {
// labels: [
// "4 Jan",
// "5 Jan",
// "6 Jan",
// "7 Jan",
// "8 Jan",
// "9 Jan",
// "10 Jan"
// ],
datasets: [
{
label: "Cash on Delivery",
backgroundColor: "rgba(52, 116, 212, .2)",
borderColor: "rgba(52, 116, 212, .7)",
data: acqData[0].first,
lineTension: 0.3,
pointBackgroundColor: "rgba(52, 116, 212,0)",
pointHoverBackgroundColor: "rgba(52, 116, 212,1)",
pointHoverRadius: 3,
pointHitRadius: 30,
pointBorderWidth: 2,
pointStyle: "rectRounded"
},
{
label: "ObananaPay",
backgroundColor: "rgba(255, 192, 203, .3)",
borderColor: "rgba(255, 192, 203, .7)",
data: acqData[0].second,
lineTension: 0.3,
pointBackgroundColor: "rgba(255, 192, 203, 0)",
pointHoverBackgroundColor: "rgba(255, 192, 203, 1)",
pointHoverRadius: 3,
pointHitRadius: 30,
pointBorderWidth: 2,
pointStyle: "rectRounded"
},
{
label: "Paymongo",
backgroundColor: "rgb(178, 251, 212, .3)",
borderColor: "rgba(178, 251, 212, .7)",
data: acqData[0].third,
lineTension: 0.3,
pointBackgroundColor: "rgba(178, 251, 212, 0)",
pointHoverBackgroundColor: "rgba(178, 251, 212, 1)",
pointHoverRadius: 3,
pointHitRadius: 30,
pointBorderWidth: 2,
pointStyle: "rectRounded"
}
]
},
// Configuration options go here
options: {
responsive: true,
maintainAspectRatio: false,
legend: {
display: false
},
scales: {
xAxes: [
{
gridLines: {
display: false
}
}
],
yAxes: [
{
gridLines: {
display: true,
color: "#eee",
zeroLineColor: "#eee"
},
ticks: {
beginAtZero: true,
stepSize: 20000,
max: 200000
}
}
]
},
tooltips: {
mode: "index",
titleFontColor: "#888",
bodyFontColor: "#555",
titleFontSize: 12,
bodyFontSize: 15,
backgroundColor: "rgba(256,256,256,0.95)",
displayColors: true,
xPadding: 20,
yPadding: 10,
borderColor: "rgba(220, 220, 220, 0.9)",
borderWidth: 2,
caretSize: 10,
caretPadding: 15
}
}
};
var ctx = document.getElementById("salesChart").getContext("2d");
var lineAcq = new Chart(ctx, configAcq);
document.getElementById("acqLegend").innerHTML = lineAcq.generateLegend();
var items = document.querySelectorAll(
"#user-acquisition .nav-tabs .nav-item"
);
items.forEach(function (item, index) {
item.addEventListener("click", function() {
// Determine which tab was clicked
var selectedTab = this.textContent.trim();
// Choose data and labels based on the selected tab
switch (selectedTab) {
case "Daily":
configAcq.data.labels = labelsDaily;
configAcq.data.datasets[0].data = acqData[0].first;
configAcq.data.datasets[1].data = acqData[0].second;
configAcq.data.datasets[2].data = acqData[0].third;
break;
case "Monthly":
configAcq.data.labels = labelsMonthly;
configAcq.data.datasets[0].data = acqData[1].first;
configAcq.data.datasets[1].data = acqData[1].second;
configAcq.data.datasets[2].data = acqData[1].third;
break;
case "Yearly":
configAcq.data.labels = labelsYearly;
configAcq.data.datasets[0].data = acqData[2].first;
configAcq.data.datasets[1].data = acqData[2].second;
configAcq.data.datasets[2].data = acqData[2].third;
break;
}
lineAcq.update();
});
});
items[0].click();
}
}
function convertToCSV(data) {
const columnTitles = ['ORDER ID', 'STATUS', 'BUYER NAME', 'TOTAL AMOUNT', 'ORDER DATE',
'ORDER TIME', 'PRODUCT NAME','PRICE', 'QUANTITY',
'VENDOR ID', 'VENDOR NAME',];
const header = columnTitles.join(',') + '\n';
const body = data.map(order => {
const orderDate = new Date(order.order_date).toLocaleDateString('en-US');
const orderTime = new Date(order.order_date).toLocaleTimeString('en-US');
const productName = order.items.length > 0 ? `"${order.items[0].product.name}"` : '';
return [
order._id,
order.status,
order.customer[0]?.name,
order.total_amount,
orderDate,
orderTime,
productName,
order.items[0]?.price,
order.items[0]?.quantity,
order.items[0]?.vendor_id,
order.items[0]?.vendor_name
].join(',');
}).join('\n');
return header + body;
}
function downloadCSV(filename) {
const csv = convertToCSV(responseData);
const blob = new Blob([csv], { type: 'text/csv' });
const url = window.URL.createObjectURL(blob);
const a = document.createElement('a');
a.href = url;
a.download = filename;
document.body.appendChild(a);
a.click();
document.body.removeChild(a);
window.URL.revokeObjectURL(url);
}
const now = new Date();
const currentMonth = now.getMonth(); // Months are 0-indexed (0 for January, 11 for December)
const currentYear = now.getFullYear();
const filteredData = data.filter(order => {
const orderDate = new Date(order.order_date);
return orderDate.getMonth() === currentMonth && orderDate.getFullYear() === currentYear;
});
const columnTitles = [
'ORDER ID', 'STATUS', 'BUYER NAME', 'TOTAL AMOUNT', 'METHOD', 'ORDER DATE',
'ORDER TIME', 'PRODUCT NAME', 'PRICE', 'QUANTITY', 'VENDOR ID', 'VENDOR NAME'
];
const header = columnTitles.join(',') + '\n';
const body = filteredData.map(order => {
const orderDate = new Date(order.order_date).toLocaleDateString('en-US');
const orderTime = new Date(order.order_date).toLocaleTimeString('en-US');
const productName = order.items.length > 0 ? `"${order.items[0].product.name}"` : '';
return [
order._id,
order.status,
order.customer[0]?.name,
order.total_amount,
order.payment_method,
orderDate,
orderTime,
productName,
order.items[0]?.price,
order.items[0]?.quantity,
order.items[0]?.vendor_id,
order.items[0]?.vendor_name
].join(',');
}).join('\n');
return header + body;
}
function downloadCSV() {
const now = new Date();
const months = ["January", "February", "March", "April", "May", "June",
"July", "August", "September", "October", "November", "December"];
const currentMonthName = months[now.getMonth()];
const filename = `${currentMonthName}_orders_overview.csv`;
const csv = convertToCSV(responseData); // Ensure responseData is up to date
const blob = new Blob([csv], { type: 'text/csv' });
const url = window.URL.createObjectURL(blob);
const a = document.createElement('a');
a.href = url;
a.download = filename;
document.body.appendChild(a);
a.click();
document.body.removeChild(a);
window.URL.revokeObjectURL(url);
}
$('#download-btn').on('click', function(event) {
event.preventDefault();
downloadCSV('orders_data.csv');
});
let customer_data;
let vendor_data;
function getDataAndInitializeChart () {
userData()
.then(function (users){
vendorData()
.then(function (venues){
customer_data = users.data;
vendor_data = venues.data;
const {customer_monthly_total, months} = countCustomerReg(customer_data)
const { vendor_monthly_total} = countVendorReg(vendor_data);
initializeActivityChart(customer_monthly_total, vendor_monthly_total, months);
})
})
}
getDataAndInitializeChart();
function userData(){
return axios.get('https://api.obanana.shop/api/v1/customers');
}
function vendorData(){
return axios.get('https://api.obanana.shop/api/v1/vendors');
}
function countCustomerReg(customers) {
const currentDate = new Date();
const monthLabels = [];
const customer_monthly_total = Array(12).fill(0);
for (let i = 11; i >= 0; i--) {
const month = new Date(currentDate.getFullYear(), currentDate.getMonth() - i, 1);
monthLabels.push(month);
}
console.log(monthLabels);
customers.forEach(customer => {
const regDate = new Date(customer.createdAt);
regDate.setHours(0, 0, 0, 0);
monthLabels.forEach((month, index) => {
let total_count = 0;
if (regDate.getFullYear() === month.getFullYear() && regDate.getMonth() === month.getMonth()) {
total_count ++;
customer_monthly_total[11 - index] += total_count;
}
});
});
console.log(customer_monthly_total)
customer_monthly_total.reverse();
return {
customer_monthly_total,
months: monthLabels.map(month => `${month.toLocaleString('default', { month: 'short' })} ${month.getFullYear()}`) // Return month labels for use in charts or displays
};
}
function countVendorReg(vendors) {
const currentDate = new Date();
const monthLabels = [];
const vendor_monthly_total = Array(12).fill(0);
for (let i = 11; i >= 0; i--) {
const month = new Date(currentDate.getFullYear(), currentDate.getMonth() - i, 1);
monthLabels.push(month);
}
console.log(monthLabels);
vendors.forEach(vendor => {
const regDate = new Date(vendor.createdAt);
regDate.setHours(0, 0, 0, 0);
monthLabels.forEach((month, index) => {
let total_count = 0;
if (regDate.getFullYear() === month.getFullYear() && regDate.getMonth() === month.getMonth()) {
total_count ++;
vendor_monthly_total[11 - index] += total_count;
}
});
});
console.log(vendor_monthly_total)
vendor_monthly_total.reverse();
return {
vendor_monthly_total,
};
}
function initializeActivityChart (customer_monthly_total, vendor_monthly_total, months){
var activity = document.getElementById("registry");
if (activity !== null) {
var activityData = [
{
first: customer_monthly_total,
second: vendor_monthly_total
}
];
var config = {
// The type of chart we want to create
type: "line",
// The data for our dataset
data: {
labels: months,
datasets: [
{
label: "Customer",
backgroundColor: "rgba(255, 165, 0, .3)",
borderColor: "rgba(255, 165, 0, .7)",
data: activityData[0].first,
lineTension: 0.3,
pointBackgroundColor: "rgba(255, 165, 0, 0)",
pointHoverBackgroundColor: "rgba(255, 165, 0, 1)",
pointHoverRadius: 3,
pointHitRadius: 30,
pointBorderWidth: 2,
pointStyle: "rectRounded"
},
{
label: "Vendors",
backgroundColor: "rgba(135, 206, 235, .3)",
borderColor: "rgba(135, 206, 235, .7)",
data: activityData[0].second,
lineTension: 0.3,
pointBackgroundColor: "rgba(135, 206, 235, 0)",
pointHoverBackgroundColor: "rgba(135, 206, 235, 1)",
pointHoverRadius: 3,
pointHitRadius: 30,
pointBorderWidth: 2,
pointStyle: "rectRounded"
}
]
},
// Configuration options go here
options: {
responsive: true,
maintainAspectRatio: false,
legend: {
display: false
},
scales: {
xAxes: [
{
gridLines: {
display: false
}
}
],
yAxes: [
{
gridLines: {
display: true,
color: "#eee",
zeroLineColor: "#eee"
},
ticks: {
beginAtZero: true,
stepSize: 10,
max: 30
}
}
]
},
tooltips: {
mode: "index",
titleFontColor: "#888",
bodyFontColor: "#555",
titleFontSize: 12,
bodyFontSize: 15,
backgroundColor: "rgba(256,256,256,0.95)",
displayColors: true,
xPadding: 20,
yPadding: 10,
borderColor: "rgba(220, 220, 220, 0.9)",
borderWidth: 2,
caretSize: 10,
caretPadding: 15
}
}
};
var ctx = document.getElementById("registry").getContext("2d");
var actLine = new Chart(ctx, config);
document.getElementById("actLegend").innerHTML = actLine.generateLegend();
}
}
});

14
admin/assets/js/map.js Normal file
View File

@ -0,0 +1,14 @@
var southWest = L.latLng(4.64, 116.95),
northEast = L.latLng(20.53, 127.25),
bounds = L.latLngBounds(southWest, northEast);
// Initialize the map and set the bounds
var map = L.map('map', {
maxBounds: bounds,
maxBoundsViscosity: 1.0 // Keeps the user within the bounds
}).setView([13.41, 122.56], 6); // Centered on the Philippines with a zoom level of 6
// Add a tile layer
L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', {
attribution: '&copy; <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors'
}).addTo(map);

View File

@ -1,6 +1,6 @@
<?php
$_SESSION["is_test"]=true;
$_SESSION["test_email_rcpt"]="junjihadbarroga@gmail.com";
$_SESSION["test_email_rcpt"]="kramblooda@gmail.com";
$_SESSION["sales_email"]="sales@obanana.com";
$_SESSION["data_endpoint"]="api.obanana.shop";
$_SESSION["transfer_fee"]=0.02;

View File

@ -14,8 +14,15 @@ if($_SESSION["user_type"]!="admin"){
header("location: login.php?alert=Only admins allowed here!");
}
$all_orders = getAllOrder();
date_default_timezone_set('Asia/Manila');
$currentDate = date('m-d-Y');
$all_orders = getAllOrder();
$all_customers = getAllCustomers();
$all_vendors = getAllVendors();
$allSignups = array_merge($all_customers, $all_vendors);
?>
@ -42,6 +49,14 @@ date_default_timezone_set('Asia/Manila');
<link href="assets/plugins/daterangepicker/daterangepicker.css" rel="stylesheet">
<link href="assets/plugins/simplebar/simplebar.css" rel="stylesheet" />
<!-- LEAFLET JS -->
<link rel="stylesheet" href="https://unpkg.com/leaflet@1.9.4/dist/leaflet.css"
integrity="sha256-p4NxAoJBhIIN+hmNHrzRCf9tD/miZyoHS5obTRR9BMY="
crossorigin=""/>
<script src="https://unpkg.com/leaflet@1.9.4/dist/leaflet.js"
integrity="sha256-20nQCchB9co0qIjJZRGuk2/Z9VM+kNiyxNV1lvTlZBo="
crossorigin=""></script>
<!-- Ekka CSS -->
<link id="ekka-css" href="assets/css/ekka.css" rel="stylesheet" />
@ -101,13 +116,14 @@ date_default_timezone_set('Asia/Manila');
<ul class="dropdown-menu dropdown-menu-right ec-dropdown-menu">
<!-- User image -->
<li class="dropdown-header">
<img loading="lazy" src="assets/img/user/user.png" class="img-circle" alt="User Image" />
<div class="d-inline-block">
John Deo <small class="pt-1"><?php echo $_SESSION['email']?></small>
<div class="d-flex align-items-center">
<img loading="lazy" src="assets/img/user/user.png" class="img-circle" alt="User Image" />
<small class="pt-1"><?php echo $_SESSION['email']?></small>
</div>
</li>
<li>
<a href="user-profile.html">
<!-- Commented out for future use or functionality -->
<!-- <li>
<a href="#">
<i class="mdi mdi-account"></i> My Profile
</a>
</li>
@ -118,7 +134,7 @@ date_default_timezone_set('Asia/Manila');
</li>
<li>
<a href="#"> <i class="mdi mdi-diamond-stone"></i> Projects </a>
</li>
</li> -->
<li class="right-sidebar-in">
<a href="javascript:0"> <i class="mdi mdi-settings-outline"></i> Setting </a>
</li>
@ -127,7 +143,8 @@ date_default_timezone_set('Asia/Manila');
</li>
</ul>
</li>
<li class="dropdown notifications-menu custom-dropdown">
<!-- Commented out for future usage or functionality -->
<!-- <li class="dropdown notifications-menu custom-dropdown">
<button class="dropdown-toggle notify-toggler custom-dropdown-toggler">
<i class="mdi mdi-bell-outline"></i>
</button>
@ -690,7 +707,7 @@ date_default_timezone_set('Asia/Manila');
<a class="text-center" href="#"> View All </a>
</li>
</ul>
</li>
</li> -->
<li class="right-sidebar-in right-sidebar-2-menu">
<i class="mdi mdi-settings-outline mdi-spin"></i>
</li>
@ -707,8 +724,19 @@ date_default_timezone_set('Asia/Manila');
<div class="col-xl-3 col-sm-6 p-b-15 lbl-card">
<div class="card card-mini dash-card card-1">
<div class="card-body">
<h2 class="mb-1">1,503</h2>
<p>Daily Signups</p>
<?php
$signupCount = 0;
foreach ($allSignups as $signup) {
$signupDate = date('m-d-Y', strtotime($signup['createdAt']));
if ($signupDate === $currentDate) {
$signupCount++;
}
}
?>
<h2 class="mb-1"><?php echo $signupCount; ?></h2>
<!-- <h2 class="mb-1">1,503</h2> -->
<p>Today's Signups</p>
<span class="mdi mdi-account-arrow-left"></span>
</div>
</div>
@ -716,9 +744,17 @@ date_default_timezone_set('Asia/Manila');
<div class="col-xl-3 col-sm-6 p-b-15 lbl-card">
<div class="card card-mini dash-card card-2">
<div class="card-body">
<h2 class="mb-1">79,503</h2>
<p>Daily Visitors</p>
<span class="mdi mdi-account-clock"></span>
<?php
$userCount = 0;
foreach ($allSignups as $signup) {
$userCount++;
}
?>
<h2 class="mb-1"><?php echo $userCount; ?></h2>
<!-- <h2 class="mb-1">79,503</h2> -->
<p>Total Users</p>
<span class="mdi mdi-account-multiple"></span>
</div>
</div>
</div>
@ -726,18 +762,19 @@ date_default_timezone_set('Asia/Manila');
<div class="card card-mini dash-card card-3">
<div class="card-body">
<?php
$currentDate = date('m-d-Y'); // Get current date
// Get current date
$orderCount = 0; // Initialize order count
$dailyRevenue = 0;
foreach ($all_orders as $x => $val) {
foreach (array_reverse($all_orders) as $x => $val) {
$paymentStatus = strtolower($val['payment']['status']);
$returnStatus = strtolower($val['return_order']['status']);
$orderStatus = strtolower($val['status']);
$formattedOrderDate = date('m-d-Y', strtotime($val['order_date']));
if ($formattedOrderDate == $currentDate) {
$orderCount++;
if($paymentStatus == "paid"){
$dailyRevenue += $val['total_amount'];
if($paymentStatus == "paid" && (!$returnStatus || $orderStatus != "returned" )){
$dailyRevenue += $val['total_amount'];
} // Increment order count for each order on the current date
}
}
@ -745,7 +782,7 @@ date_default_timezone_set('Asia/Manila');
$finalDailyRevenue = number_format($dailyRevenue, 2, '.', ',');
?>
<h2 class="mb-1"><?php echo $orderCount; ?></h2>
<p>Today's Order</p>
<p>Today's Orders</p>
<span class="mdi mdi-package-variant"></span>
</div>
</div>
@ -766,7 +803,6 @@ date_default_timezone_set('Asia/Manila');
<!-- Sales Graph -->
<div id="user-acquisition" class="card card-default">
<div class="card-header">
<h2>Sales Report</h2>
</div>
<div class="card-body">
@ -774,7 +810,7 @@ date_default_timezone_set('Asia/Manila');
role="tablist">
<li class="nav-item">
<a class="nav-link active" data-bs-toggle="tab" href="#todays" role="tab"
aria-selected="true">Today's</a>
aria-selected="true">Daily</a>
</li>
<li class="nav-item">
<a class="nav-link" data-bs-toggle="tab" href="#monthly" role="tab"
@ -788,7 +824,7 @@ date_default_timezone_set('Asia/Manila');
<div class="tab-content pt-4" id="salesReport">
<div class="tab-pane fade show active" id="source-medium" role="tabpanel">
<div class="mb-6" style="max-height:247px">
<canvas id="acquisition" class="chartjs2"></canvas>
<canvas id="salesChart" class="chartjs2" style="width: 100%; height: 400px;"></canvas>
<div id="acqLegend" class="customLegend mb-2"></div>
</div>
</div>
@ -799,7 +835,7 @@ date_default_timezone_set('Asia/Manila');
<div class="col-xl-4 col-md-12 p-b-15">
<!-- Doughnut Chart -->
<div class="card card-default">
<div class="card card-default" style="height: 100%">
<div class="card-header justify-content-center">
<h2>Orders Overview</h2>
</div>
@ -807,7 +843,7 @@ date_default_timezone_set('Asia/Manila');
<canvas id="doughnut-chart"></canvas>
</div>
<a href="#" id="download-btn" class="pb-5 d-block text-center text-muted"><i
class="mdi mdi-download mr-2"></i> Download overall report</a>
class="mdi mdi-download mr-2"></i> Download Current Month's Overall Report</a>
<div class="card-footer d-flex flex-wrap bg-white p-0">
<div class="col-6">
<div class="p-20">
@ -815,7 +851,7 @@ date_default_timezone_set('Asia/Manila');
<li class="mb-2"><i class="mdi mdi-checkbox-blank-circle-outline mr-2"
style="color: #4c84ff"></i>Order Completed</li>
<li class="mb-2"><i class="mdi mdi-checkbox-blank-circle-outline mr-2"
style="color: #80e1c1 "></i>Order To Pay</li>
style="color: #80e1c1"></i>Order To Pay</li>
<li><i class="mdi mdi-checkbox-blank-circle-outline mr-2"
style="color: #ff7b7b "></i>Order Returned</li>
</ul>
@ -835,32 +871,35 @@ date_default_timezone_set('Asia/Manila');
</div>
<div class="row">
<div class="col-xl-8 col-md-12 p-b-15">
<div class="col-xl-12 col-md-12 p-b-15">
<!-- User activity statistics -->
<div class="card card-default" id="user-activity">
<div class="no-gutters">
<div>
<div class="card-header justify-content-between">
<h2>User Activity</h2>
<div class="date-range-report ">
<h2>Monthly Users Registry</h2>
<!-- <div class="date-range-report ">
<span></span>
</div>
</div> -->
</div>
<div class="card-body">
<div class="tab-content" id="userActivityContent">
<div class="tab-pane fade show active" id="user" role="tabpanel">
<canvas id="activity" class="chartjs"></canvas>
<canvas id="registry" class="chartjs"></canvas>
</div>
<div>
<div id="actLegend" class="customLegend mb-2"></div>
</div>
</div>
</div>
<div class="card-footer d-flex flex-wrap bg-white border-top">
<!-- <div class="card-footer d-flex flex-wrap bg-white border-top">
<a href="#" class="text-uppercase py-3">In-Detail Overview</a>
</div>
</div> -->
</div>
</div>
</div>
</div>
<div class="col-xl-4 col-md-12 p-b-15">
<!-- <div class="col-xl-4 col-md-12 p-b-15">
<div class="card card-default">
<div class="card-header flex-column align-items-start">
<h2>Current Users</h2>
@ -872,21 +911,21 @@ date_default_timezone_set('Asia/Manila');
<a href="#" class="text-uppercase py-3">In-Detail Overview</a>
</div>
</div>
</div>
</div> -->
</div>
<div class="row">
<div class="col-xl-8 col-12 p-b-15">
<div class="col-xl-12 col-md-12 p-b-15">
<!-- World Chart -->
<div class="card card-default" id="analytics-country">
<div class="card-header justify-content-between">
<h2>Purchased by Country</h2>
<h2>Purchased by City</h2>
<div class="date-range-report ">
<span></span>
</div>
</div>
<div class="card-body vector-map-world-2">
<div id="regions_purchase" style="height: 100%; width: 100%;"></div>
<div id="map" style="height: 100%; width: 100%;"></div>
</div>
<div class="border-top mt-3">
<div class="row no-gutters">
@ -907,8 +946,8 @@ date_default_timezone_set('Asia/Manila');
</div>
</div>
</div>
<div class="col-xl-4 col-12 p-b-15">
<!-- Top Sell Table -->
<!-- Top Sell Table -->
<!-- <div class="col-xl-4 col-12 p-b-15">
<div class="card card-default Sold-card-table">
<div class="card-header justify-content-between">
<h2>Sold by Items</h2>
@ -1008,7 +1047,7 @@ date_default_timezone_set('Asia/Manila');
<a href="#" class="text-uppercase py-3">View Report</a>
</div>
</div>
</div>
</div> -->
</div>
<div class="row">
@ -1017,65 +1056,103 @@ date_default_timezone_set('Asia/Manila');
<div class="card card-table-border-none card-default recent-orders" id="recent-orders">
<div class="card-header justify-content-between">
<h2>Recent Orders</h2>
<!-- <div class="date-range-report">
<span></span>
</div> -->
</div>
<div class="card-body pt-0 pb-5">
<table class="table card-table table-responsive table-responsive-large"
style="width:100%">
<thead>
<tr>
<th>Order ID</th>
<th>Payment Method</th>
<th>Customer Name</th>
<th class="d-none d-lg-table-cell">Vendor Name</th>
<th class="d-none d-lg-table-cell">Total Amount</th>
<th class="d-none d-lg-table-cell">Order Date</th>
<th>Status</th>
<th></th>
<th>Return Status</th>
</tr>
</thead>
<tbody>
<?php
$iterationCount = 0;
$ordersDisplayed = false;
foreach (array_reverse($all_orders) as $x => $val) {
$paymentStatus = strtolower($val['payment']['status']);
$formattedOrderDate = date('m-d-Y', strtotime($val['order_date']));
$orderId = $val['_id'];
$paymentMethod = $val['payment_method'];
$customerName = $val['customer'][0]['name'];
$vendorName = $val['items'][0]['vendor_name'];
$totalAmount = $val['total_amount'];
$orderStatus = strtoupper($val['status']);
$returnStatus = strtoupper($val['return_order']['status']);
$statusClass = '';
if ($orderStatus === 'UNPAID' || $orderStatus === 'RETURNED') {
$statusClass = '#cb3747';
} elseif ($orderStatus === 'TO PAY') {
$statusClass = '#50d7ab';
} elseif ($orderStatus === 'TO SHIP') {
$statusClass = '#9586cd';
}
elseif ($orderStatus === 'TO RECEIVE') {
$statusClass = '#ffc319';
} elseif ($orderStatus === 'COMPLETED') {
$statusClass = '#88aaf3';
$style = '';
$textColor = '';
$backgroundColor = '';
switch ($orderStatus) {
case 'TO SHIP':
$backgroundColor = '#8061ef';
$textColor = 'white';
break;
case 'TO PAY':
$backgroundColor = '#1E6E58';
$textColor = 'white';
break;
case 'TO RECEIVE':
$backgroundColor = '#FFD700';
$textColor = 'black';
break;
case 'COMPLETED':
$backgroundColor = '#4c84ff';
$textColor = 'white';
break;
case 'RETURNED':
$backgroundColor = '#ff7b7b';
$textColor = 'white';
break;
default:
$backgroundColor = '#464646';
$textColor = 'white';
}
$style = "display: flex; height: 15px; font-weight: bold;
width: 90px; font-size: 10px !important; padding: 10px;
justify-content: center; align-items: center;
background-color: $backgroundColor; border-radius: 30px; color: $textColor;";
if ($formattedOrderDate == $currentDate) {
$ordersDisplayed = true;
$displayDate = date('m-d-Y, g:i A', strtotime($val['order_date']));
?>
<tr>
<td><?php echo $orderId ?></td>
<td><?php echo $paymentMethod ?></td>
<td><?php echo $customerName ?></td>
<td><?php echo $vendorName ?></td>
<td><?php echo $totalAmount ?></td>
<td> <?php echo number_format($totalAmount, 2, '.', ',') ?></td>
<td><?php echo $displayDate ?></td>
<td><span style="color: <?php echo $statusClass; ?>"><?php echo $orderStatus ?></span></td>
<td><span style="<?php echo $style; ?>"><?php echo $orderStatus ?></span></td>
<td><?php echo $returnStatus?: "NONE" ?></td>
</tr>
<?php
$iterationCount++;
if ($iterationCount >= 8) {
break;
}
$iterationCount++;
if ($iterationCount >= 8) {
break;
}
}
}
if (!$ordersDisplayed) {
?>
<tr>
<td class="align-self-center">No Recent Orders Yet.</td>
</tr>
<?php
}
?>
</tbody>
@ -1086,12 +1163,16 @@ date_default_timezone_set('Asia/Manila');
</div>
<div class="row">
<div class="col-xl-5">
<div class="col-xl-6">
<!-- New Customers -->
<div class="card ec-cust-card card-table-border-none card-default">
<div class="card-header justify-content-between ">
<?php
$weekAgoDate = date('m-d-Y', strtotime('-7 days'));
?>
<h2>New Customers</h2>
<div>
<div> From <?php echo $weekAgoDate; ?> to <?php echo $currentDate; ?></div>
<!-- <div>
<button class="text-black-50 mr-2 font-size-20">
<i class="mdi mdi-cached"></i>
</button>
@ -1106,220 +1187,141 @@ date_default_timezone_set('Asia/Manila');
<li class="dropdown-item"><a href="#">Something else here</a></li>
</ul>
</div>
</div>
</div> -->
</div>
<div class="card-body pt-0 pb-15px">
<table class="table ">
<tbody>
<?php
$iterationCount = 0;
$customersDisplayed = false;
foreach (array_reverse($all_customers) as $x => $val) {
$formattedSignupDate = date('m-d-Y', strtotime($val['createdAt']));
$imageUrl = $val['customer_image'];
$fullName = $val['first_name'] . ' ' . $val['last_name'];
$email = $val['user_email'];
if ($formattedSignupDate >= $weekAgoDate && $formattedSignupDate <= $currentDate) {
$customersDisplayed = true;
?>
<tr>
<td>
<div class="media">
<div class="media-image mr-3 rounded-circle">
<a href="profile.html"><img loading="lazy"
class="profile-img rounded-circle w-45"
src="assets/img/user/u1.jpg"
alt="customer image"></a>
<img loading="lazy"
class="profile-img rounded-circle"
style="width: 50px; height: 50px; border-style: solid; border-color: #FFAA00;"
src="<?php echo $imageUrl !== null ? $imageUrl : 'assets/img/user/u1.jpg'; ?>"
alt="customer image">
</div>
<div class="media-body align-self-center">
<a href="profile.html">
<h6 class="mt-0 text-dark font-weight-medium">Selena
Wagner</h6>
</a>
<small>@selena.oi</small>
<h6 class="mt-0 text-dark font-weight-medium"><?php echo $fullName; ?></h6>
<small><?php echo $email; ?></small>
</div>
</div>
</td>
<td>2 Orders</td>
<td class="text-dark d-none d-md-block">$150</td>
</tr>
<tr>
<td>
<div class="media">
<div class="media-image mr-3 rounded-circle">
<a href="profile.html"><img loading="lazy"
class="profile-img rounded-circle w-45"
src="assets/img/user/u2.jpg"
alt="customer image"></a>
</div>
<div class="media-body align-self-center">
<a href="profile.html">
<h6 class="mt-0 text-dark font-weight-medium">Walter
Reuter</h6>
</a>
<small>@walter.me</small>
</div>
</div>
</td>
<td>5 Orders</td>
<td class="text-dark d-none d-md-block">$200</td>
</tr>
<tr>
<td>
<div class="media">
<div class="media-image mr-3 rounded-circle">
<a href="profile.html"><img loading="lazy"
class="profile-img rounded-circle w-45"
src="assets/img/user/u3.jpg"
alt="customer image"></a>
</div>
<div class="media-body align-self-center">
<a href="profile.html">
<h6 class="mt-0 text-dark font-weight-medium">Larissa
Gebhardt</h6>
</a>
<small>@larissa.gb</small>
</div>
</div>
</td>
<td>1 Order</td>
<td class="text-dark d-none d-md-block">$50</td>
</tr>
<tr>
<td>
<div class="media">
<div class="media-image mr-3 rounded-circle">
<a href="profile.html"><img loading="lazy"
class="profile-img rounded-circle w-45"
src="assets/img/user/u4.jpg"
alt="customer image"></a>
</div>
<div class="media-body align-self-center">
<a href="profile.html">
<h6 class="mt-0 text-dark font-weight-medium">Albrecht
Straub</h6>
</a>
<small>@albrech.as</small>
</div>
</div>
</td>
<td>2 Orders</td>
<td class="text-dark d-none d-md-block">$100</td>
</tr>
<tr>
<td>
<div class="media">
<div class="media-image mr-3 rounded-circle">
<a href="profile.html"><img loading="lazy"
class="profile-img rounded-circle w-45"
src="assets/img/user/u5.jpg"
alt="customer image"></a>
</div>
<div class="media-body align-self-center">
<a href="profile.html">
<h6 class="mt-0 text-dark font-weight-medium">Leopold
Ebert</h6>
</a>
<small>@leopold.et</small>
</div>
</div>
</td>
<td>1 Order</td>
<td class="text-dark d-none d-md-block">$60</td>
</tr>
<tr>
<td>
<div class="media">
<div class="media-image mr-3 rounded-circle">
<a href="profile.html"><img loading="lazy"
class="profile-img rounded-circle w-45"
src="assets/img/user/u3.jpg"
alt="customer image"></a>
</div>
<div class="media-body align-self-center">
<a href="profile.html">
<h6 class="mt-0 text-dark font-weight-medium">Larissa
Gebhardt</h6>
</a>
<small>@larissa.gb</small>
</div>
</div>
</td>
<td>1 Order</td>
<td class="text-dark d-none d-md-block">$50</td>
<td><?php echo $formattedSignupDate?></td>
</tr>
<?php
$iterationCount++;
if ($iterationCount >= 8) {
break;
}
}
}
if (!$customersDisplayed) {
?>
<tr>
<td class="align-self-center">No new customers in the past week</td>
</tr>
<?php
}
?>
</tbody>
</table>
</div>
</div>
</div>
<div class="col-xl-7">
<!-- Top Products -->
<div class="card card-default ec-card-top-prod">
<div class="card-header justify-content-between">
<h2>Top Products</h2>
<div>
<button class="text-black-50 mr-2 font-size-20"><i
class="mdi mdi-cached"></i></button>
<div class="col-xl-6">
<!-- New Customers -->
<div class="card ec-cust-card card-table-border-none card-default">
<div class="card-header justify-content-between ">
<?php
$weekAgoDate = date('m-d-Y', strtotime('-7 days'));
?>
<h2>New Vendors</h2>
<div> From <?php echo $weekAgoDate; ?> to <?php echo $currentDate; ?></div>
<!-- <div>
<button class="text-black-50 mr-2 font-size-20">
<i class="mdi mdi-cached"></i>
</button>
<div class="dropdown show d-inline-block widget-dropdown">
<a class="dropdown-toggle icon-burger-mini" href="#" role="button"
id="dropdown-product" data-bs-toggle="dropdown" aria-haspopup="true"
id="dropdown-customar" data-bs-toggle="dropdown" aria-haspopup="true"
aria-expanded="false" data-display="static">
</a>
<ul class="dropdown-menu dropdown-menu-right">
<li class="dropdown-item"><a href="#">Update Data</a></li>
<li class="dropdown-item"><a href="#">Detailed Log</a></li>
<li class="dropdown-item"><a href="#">Statistics</a></li>
<li class="dropdown-item"><a href="#">Clear Data</a></li>
<li class="dropdown-item"><a href="#">Action</a></li>
<li class="dropdown-item"><a href="#">Another action</a></li>
<li class="dropdown-item"><a href="#">Something else here</a></li>
</ul>
</div>
</div>
</div> -->
</div>
<div class="card-body mt-10px mb-10px py-0">
<div class="row media d-flex pt-15px pb-15px">
<div
class="col-lg-3 col-md-3 col-2 media-image align-self-center rounded">
<a href="#"><img loading="lazy" src="assets/img/products/p1.jpg" alt="customer image"></a>
</div>
<div class="col-lg-9 col-md-9 col-10 media-body align-self-center ec-pos">
<a href="#">
<h6 class="mb-10px text-dark font-weight-medium">Baby cotton shoes</h6>
</a>
<p class="float-md-right sale"><span class="mr-2">58</span>Sales</p>
<p class="d-none d-md-block">Statement belting with double-turnlock hardware
adds “swagger” to a simple.</p>
<p class="mb-0 ec-price">
<span class="text-dark">$520</span>
<del>$580</del>
</p>
</div>
</div>
<div class="row media d-flex pt-15px pb-15px">
<div
class="col-lg-3 col-md-3 col-2 media-image align-self-center rounded">
<a href="#"><img loading="lazy" src="assets/img/products/p2.jpg" alt="customer image"></a>
</div>
<div class="col-lg-9 col-md-9 col-10 media-body align-self-center ec-pos">
<a href="#">
<h6 class="mb-10px text-dark font-weight-medium">Hoodies for men</h6>
</a>
<p class="float-md-right sale"><span class="mr-2">20</span>Sales</p>
<p class="d-none d-md-block">Statement belting with double-turnlock hardware
adds “swagger” to a simple.</p>
<p class="mb-0 ec-price">
<span class="text-dark">$250</span>
<del>$300</del>
</p>
</div>
</div>
<div class="row media d-flex pt-15px pb-15px">
<div
class="col-lg-3 col-md-3 col-2 media-image align-self-center rounded">
<a href="#"><img loading="lazy" src="assets/img/products/p3.jpg" alt="customer image"></a>
</div>
<div class="col-lg-9 col-md-9 col-10 media-body align-self-center ec-pos">
<a href="#">
<h6 class="mb-10px text-dark font-weight-medium">Long slive t-shirt</h6>
</a>
<p class="float-md-right sale"><span class="mr-2">10</span>Sales</p>
<p class="d-none d-md-block">Statement belting with double-turnlock hardware
adds “swagger” to a simple.</p>
<p class="mb-0 ec-price">
<span class="text-dark">$480</span>
<del>$654</del>
</p>
</div>
</div>
<div class="card-body pt-0 pb-15px">
<table class="table ">
<tbody>
<?php
$iterationCount = 0;
$vendorsDisplayed = false;
foreach (array_reverse($all_vendors) as $x => $val) {
$formattedSignupDate = date('m-d-Y', strtotime($val['createdAt']));
$imageUrl = $val['vendor_image'];
$shopName = $val['user_login'];
$fullName = $val['first_name'] . ' ' . $val['last_name'];
$email = $val['user_email'];
if ($formattedSignupDate >= $weekAgoDate && $formattedSignupDate <= $currentDate) {
$vendorsDisplayed = true;
?>
<tr>
<td>
<div class="media">
<div class="media-image mr-3 rounded-circle">
<img loading="lazy"
class="profile-img rounded-circle"
style="width: 50px; height: 50px; border-style: solid; border-color: #FFAA00;"
src="<?php echo $imageUrl !== null ? $imageUrl : 'assets/img/user/u1.jpg'; ?>"
alt="customer image">
</div>
<div class="media-body align-self-center">
<h6 class="mt-0 text-dark font-weight-medium"><?php echo $shopName; ?></h6>
<small><?php echo $fullName; ?> || </small>
<small><?php echo $email; ?></small>
</div>
</div>
</td>
<td><?php echo $formattedSignupDate?></td>
</tr>
<?php
$iterationCount++;
if ($iterationCount >= 8) {
break;
}
}
}
if (!$vendorsDisplayed) {
?>
<tr>
<td class="align-self-center">No new vendors in the past week</td>
</tr>
<?php
}
?>
</tbody>
</table>
</div>
</div>
</div>
@ -1333,7 +1335,7 @@ date_default_timezone_set('Asia/Manila');
<p>
Copyright &copy; <span id="ec-year"></span><a class="text-primary"
href="https://themeforest.net/user/ashishmaraviya" target="_blank"> Ekka Admin Dashboard</a>. All Rights Reserved.
</p>
</p>
</div>
</footer>
@ -1353,6 +1355,7 @@ date_default_timezone_set('Asia/Manila');
<!-- gelo added dynamic charts -->
<script src="assets/js/dashboard-chart.js"></script>
<script src="assets/js/map.js"></script>
<!-- Google map chart -->
<script src="assets/plugins/charts/google-map-loader.js"></script>
<script src="assets/plugins/charts/google-map.js"></script>

View File

@ -1,10 +1,6 @@
<style>
.sidenav-item.active {
background-color: #f0f0f0; /* Change background color */
}
.sidenav-item.active .nav-text {
color: #333; /* Change text color */
.nav-link:hover{
border-left: 5px solid #87CEFA;
}
</style>
@ -21,18 +17,17 @@
<!-- begin sidebar scrollbar -->
<div class="ec-navigation" data-simplebar>
<!-- sidebar menu -->
<ul class="nav sidebar-inner" id="sidebar-menu">
<ul class="nav sidebar-inner">
<!-- Dashboard -->
<li class="active">
<li class="nav-link">
<a class="sidenav-item-link" href="index.php">
<i class="mdi mdi-view-dashboard-outline"></i>
<span class="nav-text">Dashboard</span>
</a>
<hr>
</li>
<!-- Vendors -->
<li>
<li class="nav-link">
<a class="sidenav-item-link" href="vendor-card.php">
<i class="mdi mdi-account-group-outline"></i>
<span class="nav-text">Vendors</span>
@ -60,7 +55,7 @@
</li>
<!-- Users -->
<li >
<li class="nav-link">
<a class="sidenav-item-link" href="user-card.php">
<i class="mdi mdi-account-group"></i>
<span class="nav-text">Users</span>
@ -143,7 +138,7 @@
</li> -->
<!-- Orders -->
<li >
<li class="nav-link">
<a class="sidenav-item-link" href="order-history.php">
<i class="mdi mdi-cart"></i>
<span class="nav-text">Orders</span>
@ -257,4 +252,6 @@
</ul>
</div>
</div>
</div>
</div>

View File

@ -14,7 +14,7 @@ if ($_SESSION["user_type"] != "admin") {
header("location: login.php?alert=Only admins allowed here!");
}
$orders = getAllOrder();
$allorders = json_encode($orders, true);
// $allorders = json_encode($orders, true);
?>
<!DOCTYPE html>
@ -24,9 +24,9 @@ $allorders = json_encode($orders, true);
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="description" content="Ekka - Admin Dashboard HTML Template.">
<meta name="description" content="oBanana B2B - Admin Dashboard">
<title>Ekka - Admin Dashboard HTML Template.</title>
<title>oBanana B2B - Admin Dashboard</title>
<!-- GOOGLE FONTS -->
<link rel="preconnect" href="https://fonts.googleapis.com">
@ -82,7 +82,8 @@ $allorders = json_encode($orders, true);
<table id="responsive-data-table" class="table" style="width:100%">
<thead>
<tr>
<th>Date</th>
<th>Updated Date</th>
<th>Order Date</th>
<th>Customer</th>
<th>Vendor</th>
<th>Product</th>
@ -102,6 +103,7 @@ $allorders = json_encode($orders, true);
?>
<tr>
<td><?php echo date('Y-m-d', strtotime($order['updatedAt'])) ?></td>
<td><?php echo date('Y-m-d', strtotime($order['order_date'])) ?></td>
<td><?php echo $order['customer'][0]['name'] ?></td>
<td><?php echo $order['items'][0]['vendor_name'] ?></td>
<td><?php echo $order['items'][0]['product']['name'] ?></td>
@ -113,7 +115,7 @@ $allorders = json_encode($orders, true);
<td><?php echo $order['return_order']['status'] ?></td>
<!-- <td><span class="mb-2 mr-2 badge badge-secondary">Cancel</span></td> -->
<td>
<a class="btn btn-lg btn-primary" data-bs-toggle="modal" data-bs-target="#modal-order-<?php echo $order['_id']; ?>">Details</a>
<a class="btn btn-md btn-primary" data-bs-toggle="modal" data-bs-target="#modal-order-<?php echo $order['_id']; ?>">Details</a>
</td>
</tr>
<div class="modal fade" id="modal-order-<?php echo $order['_id']; ?>" tabindex="-1" role="dialog" aria-hidden="true">

View File

@ -101,7 +101,7 @@ $users = getUsers();
<div class="row">
<?php
$totalUsers = count($users);
$usersPerPage = 20;
$usersPerPage = 15;
$totalPages = ceil($totalUsers / $usersPerPage);
$currentPage = isset($_GET['page']) ? $_GET['page'] : 1;
$start = ($currentPage - 1) * $usersPerPage;
@ -266,8 +266,31 @@ $users = getUsers();
<!-- Pagination Links -->
<div class="pagination">
<?php
for ($page = 1; $page <= $totalPages; $page++) {
/* for ($page = 1; $page <= $totalPages; $page++) {
echo '<a href="?page=' . $page . '">' . $page . '</a>';
} */
$maxPages = 5; // Maximum number of pages to display
$ellipsis = true; // Whether to show ellipsis if there are more pages
$startPage = max(1, $currentPage - floor($maxPages / 2));
$endPage = min($totalPages, $startPage + $maxPages - 1);
if ($ellipsis && $startPage > 1) {
echo '<a href="?page=1">1</a>';
if ($startPage > 2) {
echo '<span>...</span>';
}
}
for ($page = $startPage; $page <= $endPage; $page++) {
echo '<a href="?page=' . $page . '">' . $page . '</a>';
}
if ($ellipsis && $endPage < $totalPages) {
if ($endPage < $totalPages - 1) {
echo '<span>...</span>';
}
echo '<a href="?page=' . $totalPages . '">' . $totalPages . '</a>';
}
?>
</div>

View File

@ -17,6 +17,11 @@ if ($_SESSION["user_type"] != "admin") {
$products = productList();
$vendorSearchResult = $_SESSION["vendorSearchResult"];
$payoutResponse = getAllPayout($_SESSION["token"]);
$payoutData = json_decode($payoutResponse, true);
?>
<!DOCTYPE html>
<html lang="en" dir="ltr">
@ -103,16 +108,16 @@ $vendorSearchResult = $_SESSION["vendorSearchResult"];
</button>
</div>
</div>
<div class="card card-default p-4 ec-card-space">
<div class="col-lg-6 col-md-12">
<form style="display:flex; margin-bottom:50px;" method="POST" action="vendor-card-action.php">
<input type="text" name="search" class="form-control" id="searchProduct" placeholder="search with vendor name..">
<button class="submit" type="submit" id="search-btn" class="btn btn-flat">
<i class="mdi mdi-magnify" style="font-size:20px; color:gray; margin-left:-40px;"></i>
</button>
</form>
</div>
<div class="col-lg-6 col-md-12">
<form style="display:flex; margin-bottom:50px;" method="POST" action="vendor-card-action.php">
<input type="text" name="search" class="form-control" id="searchProduct" placeholder="search with vendor name..">
<button class="submit" type="submit" id="search-btn" class="btn btn-flat">
<i class="mdi mdi-magnify" style="font-size:20px; color:gray; margin-left:-40px;"></i>
</button>
</form>
</div>
<div class="ec-vendor-card mt-m-24px row">
<?php
@ -126,16 +131,16 @@ $vendorSearchResult = $_SESSION["vendorSearchResult"];
$end = $start + $vendorsPerPage - 1;
$vendorsCopy = $vendors;
if (!empty($_GET['search']) ) {
$filteredProducts=[];
if (!empty($_GET['search'])) {
$filteredProducts = [];
foreach ($vendorsCopy as $result) {
$vendorName = strtolower($result['user_login']);
$vendorName = strtolower($result['user_login']);
if (
strpos($vendorName,strtolower($_GET['search']))!==false
strpos($vendorName, strtolower($_GET['search'])) !== false
) {
$filteredProducts[] = $result;
} else{
} else {
}
}
@ -149,6 +154,19 @@ $vendorSearchResult = $_SESSION["vendorSearchResult"];
// $vendors = vendorList();
for ($x = $start; $x <= $end && $x < $totalVendors; $x++) {
$vendor = $vendors[$x];
$vendorId = $vendor['_id'];
$totalPayoutAmount = 0; // Initialize the total net amount for the current vendor
// Loop through the payout data and sum up the net amounts
foreach ($payoutData as $payout) {
if ($payout['vendor_details'][0]['vendor_id'] == $vendorId) {
$totalPayoutAmount += $payout['net_amount'];
}
}
$totalPayoutAmount = number_format($totalPayoutAmount, 2, '.', ',');
?>
<div class="col-lg-6 col-xl-4 col-xxl-3">
<div class="card card-default mt-24px">
@ -177,7 +195,7 @@ $vendorSearchResult = $_SESSION["vendorSearchResult"];
<i class="mdi mdi-cellphone-basic mr-1"></i>
<span style="font-size:13px;">
<?php
echo isset($vendor['phone']) && !empty($vendor['phone']) ? $vendor['phone']: 'No Number yet';
echo isset($vendor['phone']) && !empty($vendor['phone']) ? $vendor['phone'] : 'No Number yet';
?>
</span>
</li>
@ -192,7 +210,7 @@ $vendorSearchResult = $_SESSION["vendorSearchResult"];
</ul>
</a>
<div class="row justify-content-center ec-vendor-detail">
<div class="col-4">
<div class="col-3">
<h6 class="text-uppercase">Items</h6>
<?php
$vendorId = $vendor['_id'];
@ -202,13 +220,13 @@ $vendorSearchResult = $_SESSION["vendorSearchResult"];
?>
<h5><?php echo count($product); ?></h5>
</div>
<div class="col-4">
<div class="col-3">
<h6 class="text-uppercase">Sell</h6>
<h5>1908</h5>
</div>
<div class="col-4">
<div class="col-6">
<h6 class="text-uppercase">Payout</h6>
<h5>$2691</h5>
<h5 style="font-size: 15px;"> <?php echo $totalPayoutAmount; ?></h5>
</div>
</div>
</div>
@ -231,11 +249,12 @@ $vendorSearchResult = $_SESSION["vendorSearchResult"];
<!-- 02-28-2024 Stacy modified this block of code -->
<div class="modal-body pt-0">
<div style="text-align: center; display: column; justify-content: center; align-items: center;" class="col-md-6">
<!-- <input type="file" id="fileInput<?php #echo $vendor['_id']; ?>" accept=".png, .jpg, .jpeg" /> -->
<!-- <input type="file" id="fileInput<?php #echo $vendor['_id'];
?>" accept=".png, .jpg, .jpeg" /> -->
<div class="thumb-edit" style="padding-left:120px; margin-bottom:-40px;">
<input style="display:none;" type='file' id="fileInput<?php echo $vendor['_id']; ?>" class="ec-image-upload" accept=".png, .jpg, .jpeg" onchange="previewImage('<?php echo $vendor['_id']; ?>')"/>
<input style="display:none;" type='file' id="fileInput<?php echo $vendor['_id']; ?>" class="ec-image-upload" accept=".png, .jpg, .jpeg" onchange="previewImage('<?php echo $vendor['_id']; ?>')" />
<label><i class="fa-solid fa-file-import" style="cursor:pointer;" onclick="document.getElementById('fileInput<?php echo $vendor['_id']; ?>').click()"></i></label>
</div>
<div class="vendor-image" style="padding-top:20px; ">
<?php
@ -248,30 +267,29 @@ $vendorSearchResult = $_SESSION["vendorSearchResult"];
</div>
<script>
function updateButtonText(input){
function updateButtonText(input) {
var label = document.getElementById('fileInputLabel');
if (input.files.length > 0) {
label.innerHTML = '<i class="fa-solid fa-file-arrow-up"></i> ' + input.files[0].name;
}else{
} else {
label.innerHTML = '<i class="fa-solid fa-file-arrow-up"></i> Upload file';
}
}
// 03-14-2024 Jun Jihad modified this block of code to show preview of the image to be uploaded
function previewImage(vendorId) {
var fileInput = document.getElementById('fileInput' + vendorId);
var file = fileInput.files[0];
console.log('clicked hereee');
const reader = new FileReader();
var fileInput = document.getElementById('fileInput' + vendorId);
var file = fileInput.files[0];
console.log('clicked hereee');
const reader = new FileReader();
reader.onload = function (e) {
const dataUri = e.target.result;
document.getElementById('imgPrev' + vendorId).src = dataUri; // Fixed concatenation here
};
reader.onload = function(e) {
const dataUri = e.target.result;
document.getElementById('imgPrev' + vendorId).src = dataUri; // Fixed concatenation here
};
reader.readAsDataURL(file);
}
reader.readAsDataURL(file);
}
// 03-14-2024 Jun Jihad modified this block of code to show preview of the image to be uploaded
</script>
</div>
<form>
@ -378,296 +396,293 @@ $vendorSearchResult = $_SESSION["vendorSearchResult"];
</div>
</div>
<script>
function deleteVendor(vendorId){
function deleteVendor(vendorId) {
let text = "Please confirm delete action!\nClick OK or Cancel button.";
if (confirm(text) == true) {
window.open("vendor-delete-action.php?id=" + vendorId, "_self");
}
}
function uploadFile(vendorId) {
const originalEmail = document.getElementById('email-' + vendorId).defaultValue;
const updatedEmail = document.getElementById('email-' + vendorId).value;
const isEmailModified = originalEmail !== updatedEmail;
const originalEmail = document.getElementById('email-' + vendorId).defaultValue;
const updatedEmail = document.getElementById('email-' + vendorId).value;
const isEmailModified = originalEmail !== updatedEmail;
if (isEmailModified) {
validateEmail(vendorId).then(isEmailAvailable => {
if (!isEmailAvailable) {
$('#email-error-message-' + vendorId).text('Email is already in use').show();
} else {
$('#email-error-message-' + vendorId).text('').hide();
if (isEmailModified) {
validateEmail(vendorId).then(isEmailAvailable => {
if (!isEmailAvailable) {
$('#email-error-message-' + vendorId).text('Email is already in use').show();
} else {
$('#email-error-message-' + vendorId).text('').hide();
var fileInput = document.getElementById('fileInput' + vendorId);
var file = fileInput.files[0];
const updatedUser = document.getElementById('user_login-' + vendorId).value;
const firstName = document.getElementById('firstName-' + vendorId).value;
const lastName = document.getElementById('lastName-' + vendorId).value;
const phone = document.getElementById('phone-' + vendorId).value;
const description = document.getElementById('description-' + vendorId).value;
const status = document.getElementById('status-' + vendorId).value;
const updatedAddress1 = document.getElementById('address_1-' + vendorId).value;
const updatedAddress2 = document.getElementById('address_2-' + vendorId).value;
const barangay = document.getElementById('barangay-' + vendorId).value;
const city = document.getElementById('city-' + vendorId).value;
const province = document.getElementById('province-' + vendorId).value;
const country = document.getElementById('country-' + vendorId).value;
var formData = new FormData();
formData.append('image_id', vendorId);
formData.append('category', 'vendor');
formData.append('image', file); // Include the file data in the form data
if(file){
fetch('https://<?php echo $_SESSION["data_endpoint"]; ?>/api/v1/upload_image', {
method: 'POST',
body: formData
})
.then(response => {
if (response.ok) {
return response.json();
} else {
console.error('File upload failed');
throw new Error('File upload failed');
}
})
.then(result => {
const filename = result.filename;
const payload = {
vendor_image: `https://<?php echo $_SESSION["data_endpoint"]; ?>/images/storage/vendor_uploads/${filename}`,
user_login: updatedUser,
first_name: firstName,
last_name: lastName,
user_email: updatedEmail,
phone: phone,
vendor_description: description,
status: status,
address: [{
address_1: updatedAddress1,
address_2: updatedAddress2,
barangay: barangay,
city: city,
province: province,
country: country,
}]
};
return fetch('https://<?php echo $_SESSION["data_endpoint"]; ?>/api/v1/vendors/' + vendorId, {
method: 'PATCH',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify(payload)
});
})
.then(secondResponse => {
if (secondResponse.ok) {
console.log('Second request successful');
location.reload();
} else {
console.error('Second request failed');
}
})
.catch(error => {
console.error('Error during fetch:', error);
});
}else{
const payload = {
vendor_image: `https://<?php echo $_SESSION["data_endpoint"]; ?>/images/storage/vendor_uploads/${filename}`,
user_login: updatedUser,
first_name: firstName,
last_name: lastName,
user_email: updatedEmail,
phone: phone,
vendor_description: description,
status: status,
address: [{
address_1: updatedAddress1,
address_2: updatedAddress2,
barangay: barangay,
city: city,
province: province,
country: country,
}]
};
fetch('https://<?php echo $_SESSION["data_endpoint"]; ?>/api/v1/vendors/' + vendorId, {
method: 'PATCH',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify(payload)
})
.then(response => {
if (response.ok) {
location.reload();
return response.json();
} else {
console.error('vendor Update failed');
throw new Error('vendor Update failed');
}
})
;
}
}
});
}else {
$('#email-error-message-' + vendorId).text('').hide();
const updatedUser = document.getElementById('user_login-' + vendorId).value;
const firstName = document.getElementById('firstName-' + vendorId).value;
const lastName = document.getElementById('lastName-' + vendorId).value;
const updatedEmail = document.getElementById('email-' + vendorId).value;
const phone = document.getElementById('phone-' + vendorId).value;
const description = document.getElementById('description-' + vendorId).value;
const status = document.getElementById('status-' + vendorId).value;
const updatedAddress1 = document.getElementById('address_1-' + vendorId).value;
const updatedAddress2 = document.getElementById('address_2-' + vendorId).value;
const barangay = document.getElementById('barangay-' + vendorId).value;
const city = document.getElementById('city-' + vendorId).value;
const province = document.getElementById('province-' + vendorId).value;
const country = document.getElementById('country-' + vendorId).value;
var fileInput = document.getElementById('fileInput' + vendorId);
var file = fileInput.files[0];
var formData = new FormData();
formData.append('image_id', vendorId);
formData.append('category', 'vendor');
formData.append('image', file);
if (file){
fetch('https://<?php echo $_SESSION["data_endpoint"]; ?>/api/v1/upload_image', {
method: 'POST',
body: formData
})
.then(response => {
if (response.ok) {
return response.json();
} else {
console.error('File upload failed');
throw new Error('File upload failed');
}
})
.then(result => {
const filename = result.filename;
const payload = {
vendor_image: `https://<?php echo $_SESSION["data_endpoint"]; ?>/images/storage/vendor_uploads/${filename}`,
user_login: updatedUser,
first_name: firstName,
last_name: lastName,
user_email: updatedEmail,
phone: phone,
vendor_description: description,
status: status,
address: [{
address_1: updatedAddress1,
address_2: updatedAddress2,
barangay: barangay,
city: city,
province: province,
country: country,
}]
};
// Make API request using the extracted filename
return fetch('https://<?php echo $_SESSION["data_endpoint"]; ?>/api/v1/vendors/' + vendorId, {
method: 'PATCH',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify(payload)
});
})
.then(secondResponse => {
if (secondResponse.ok) {
console.log('Second request successful');
location.reload();
} else {
console.error('Second request failed');
}
})
.catch(error => {
console.error('Error during fetch:', error);
});
}else{
const payload = {
user_login: updatedUser,
first_name: firstName,
last_name: lastName,
user_email: updatedEmail,
phone: phone,
vendor_description: description,
status: status,
address: [{
address_1: updatedAddress1,
address_2: updatedAddress2,
barangay: barangay,
city: city,
province: province,
country: country,
}]
};
fetch('https://<?php echo $_SESSION["data_endpoint"]; ?>/api/v1/vendors/' + vendorId, {
method: 'PATCH',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify(payload)
})
.then(response => {
if (response.ok) {
location.reload();
return response.json();
} else {
console.error('vendor Update failed');
throw new Error('vendor Update failed');
}
})
;
}
}
}
function validateEmail(vendorId) {
var emailInput = document.getElementById('email-' + vendorId);
var email = emailInput.value;
if (email.trim() !== '') {
return fetch('https://<?php echo $_SESSION["data_endpoint"]; ?>/api/v1/vendors/search?q=' + email)
.then(response => {
if (response.ok) {
return response.json();
} else {
throw new Error('Failed to check email availability');
}
})
.then(data => {
const isEmailAvailable = parseInt(data.results.length) === 0;
$('#email-error-message-' + vendorId).text(isEmailAvailable ? '' : 'Email is already in use').show();
return isEmailAvailable;
})
.catch(error => {
console.error('Error during email validation:', error);
return false;
});
} else {
$('#email-error-message-' + vendorId).text('').hide();
return Promise.resolve(true);
}
}
var fileInput = document.getElementById('fileInput' + vendorId);
var file = fileInput.files[0];
const updatedUser = document.getElementById('user_login-' + vendorId).value;
const firstName = document.getElementById('firstName-' + vendorId).value;
const lastName = document.getElementById('lastName-' + vendorId).value;
const phone = document.getElementById('phone-' + vendorId).value;
const description = document.getElementById('description-' + vendorId).value;
const status = document.getElementById('status-' + vendorId).value;
const updatedAddress1 = document.getElementById('address_1-' + vendorId).value;
const updatedAddress2 = document.getElementById('address_2-' + vendorId).value;
const barangay = document.getElementById('barangay-' + vendorId).value;
const city = document.getElementById('city-' + vendorId).value;
const province = document.getElementById('province-' + vendorId).value;
const country = document.getElementById('country-' + vendorId).value;
var formData = new FormData();
formData.append('image_id', vendorId);
formData.append('category', 'vendor');
formData.append('image', file); // Include the file data in the form data
if (file) {
fetch('https://<?php echo $_SESSION["data_endpoint"]; ?>/api/v1/upload_image', {
method: 'POST',
body: formData
})
.then(response => {
if (response.ok) {
return response.json();
} else {
console.error('File upload failed');
throw new Error('File upload failed');
}
})
.then(result => {
const filename = result.filename;
const payload = {
vendor_image: `https://<?php echo $_SESSION["data_endpoint"]; ?>/images/storage/vendor_uploads/${filename}`,
user_login: updatedUser,
first_name: firstName,
last_name: lastName,
user_email: updatedEmail,
phone: phone,
vendor_description: description,
status: status,
address: [{
address_1: updatedAddress1,
address_2: updatedAddress2,
barangay: barangay,
city: city,
province: province,
country: country,
}]
};
return fetch('https://<?php echo $_SESSION["data_endpoint"]; ?>/api/v1/vendors/' + vendorId, {
method: 'PATCH',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify(payload)
});
})
.then(secondResponse => {
if (secondResponse.ok) {
console.log('Second request successful');
location.reload();
} else {
console.error('Second request failed');
}
})
.catch(error => {
console.error('Error during fetch:', error);
});
} else {
const payload = {
vendor_image: `https://<?php echo $_SESSION["data_endpoint"]; ?>/images/storage/vendor_uploads/${filename}`,
user_login: updatedUser,
first_name: firstName,
last_name: lastName,
user_email: updatedEmail,
phone: phone,
vendor_description: description,
status: status,
address: [{
address_1: updatedAddress1,
address_2: updatedAddress2,
barangay: barangay,
city: city,
province: province,
country: country,
}]
};
fetch('https://<?php echo $_SESSION["data_endpoint"]; ?>/api/v1/vendors/' + vendorId, {
method: 'PATCH',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify(payload)
})
.then(response => {
if (response.ok) {
location.reload();
return response.json();
} else {
console.error('vendor Update failed');
throw new Error('vendor Update failed');
}
});
}
}
});
} else {
$('#email-error-message-' + vendorId).text('').hide();
const updatedUser = document.getElementById('user_login-' + vendorId).value;
const firstName = document.getElementById('firstName-' + vendorId).value;
const lastName = document.getElementById('lastName-' + vendorId).value;
const updatedEmail = document.getElementById('email-' + vendorId).value;
const phone = document.getElementById('phone-' + vendorId).value;
const description = document.getElementById('description-' + vendorId).value;
const status = document.getElementById('status-' + vendorId).value;
const updatedAddress1 = document.getElementById('address_1-' + vendorId).value;
const updatedAddress2 = document.getElementById('address_2-' + vendorId).value;
const barangay = document.getElementById('barangay-' + vendorId).value;
const city = document.getElementById('city-' + vendorId).value;
const province = document.getElementById('province-' + vendorId).value;
const country = document.getElementById('country-' + vendorId).value;
var fileInput = document.getElementById('fileInput' + vendorId);
var file = fileInput.files[0];
var formData = new FormData();
formData.append('image_id', vendorId);
formData.append('category', 'vendor');
formData.append('image', file);
if (file) {
fetch('https://<?php echo $_SESSION["data_endpoint"]; ?>/api/v1/upload_image', {
method: 'POST',
body: formData
})
.then(response => {
if (response.ok) {
return response.json();
} else {
console.error('File upload failed');
throw new Error('File upload failed');
}
})
.then(result => {
const filename = result.filename;
const payload = {
vendor_image: `https://<?php echo $_SESSION["data_endpoint"]; ?>/images/storage/vendor_uploads/${filename}`,
user_login: updatedUser,
first_name: firstName,
last_name: lastName,
user_email: updatedEmail,
phone: phone,
vendor_description: description,
status: status,
address: [{
address_1: updatedAddress1,
address_2: updatedAddress2,
barangay: barangay,
city: city,
province: province,
country: country,
}]
};
// Make API request using the extracted filename
return fetch('https://<?php echo $_SESSION["data_endpoint"]; ?>/api/v1/vendors/' + vendorId, {
method: 'PATCH',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify(payload)
});
})
.then(secondResponse => {
if (secondResponse.ok) {
console.log('Second request successful');
location.reload();
} else {
console.error('Second request failed');
}
})
.catch(error => {
console.error('Error during fetch:', error);
});
} else {
const payload = {
user_login: updatedUser,
first_name: firstName,
last_name: lastName,
user_email: updatedEmail,
phone: phone,
vendor_description: description,
status: status,
address: [{
address_1: updatedAddress1,
address_2: updatedAddress2,
barangay: barangay,
city: city,
province: province,
country: country,
}]
};
fetch('https://<?php echo $_SESSION["data_endpoint"]; ?>/api/v1/vendors/' + vendorId, {
method: 'PATCH',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify(payload)
})
.then(response => {
if (response.ok) {
location.reload();
return response.json();
} else {
console.error('vendor Update failed');
throw new Error('vendor Update failed');
}
});
}
}
}
function validateEmail(vendorId) {
var emailInput = document.getElementById('email-' + vendorId);
var email = emailInput.value;
if (email.trim() !== '') {
return fetch('https://<?php echo $_SESSION["data_endpoint"]; ?>/api/v1/vendors/search?q=' + email)
.then(response => {
if (response.ok) {
return response.json();
} else {
throw new Error('Failed to check email availability');
}
})
.then(data => {
const isEmailAvailable = parseInt(data.results.length) === 0;
$('#email-error-message-' + vendorId).text(isEmailAvailable ? '' : 'Email is already in use').show();
return isEmailAvailable;
})
.catch(error => {
console.error('Error during email validation:', error);
return false;
});
} else {
$('#email-error-message-' + vendorId).text('').hide();
return Promise.resolve(true);
}
}
</script>
<!-- <script>
@ -814,13 +829,34 @@ function validateEmail(vendorId) {
// echo "<a href='?page=$i' class='" . ($currentpage == $i ? 'active' : '') . "'>$i</a>";
// }
if ($totalVendors >= $vendorsPerPage) {
/* if ($totalVendors >= $vendorsPerPage) {
for ($i = 1; $i <= $totalPages; $i++) {
echo "<a href='?page=$i' class='" . ($currentpage == $i ? 'active' : '') . "'>$i</a>";
}
} */
$start = max(1, $currentpage - 2);
$end = min($totalPages, $start + 4);
if ($start > 1) {
echo "<a href='?page=1'>1</a>";
if ($start > 2) {
echo "<span>&nbsp;...&nbsp;</span>";
}
}
for ($i = $start; $i <= $end; $i++) {
echo "<a href='?page=$i' class='" . ($currentpage == $i ? 'active' : '') . "'>$i</a>&nbsp;";
}
if ($end < $totalPages) {
if ($end < $totalPages - 1) {
echo "<span>&nbsp;...&nbsp;</span>";
}
echo "<a href='?page=$totalPages'>$totalPages</a>";
}
?>
</div>
<!-- Ec Pagination End -->
@ -837,35 +873,35 @@ function validateEmail(vendorId) {
<form action="add_vendor_action.php" method="post">
<div class="ec-vendor-block-img space-bottom-30">
<!-- <div class="ec-vendor-block-bg cover-upload">
<div class="thumb-upload">
<div class="thumb-edit">
<input type='file' id="thumbUpload01" class="ec-image-upload"
accept=".png, .jpg, .jpeg" />
<label><i class="fi-rr-edit"></i></label>
</div>
<div class="thumb-preview ec-preview">
<div class="image-thumb-preview">
<img loading="lazy" class="image-thumb-preview ec-image-preview v-img"
src="assets/images/banner/7.jpg" alt="edit" />
</div>
</div>
</div>
</div> -->
<!-- <div class="ec-vendor-block-detail">
<div class="thumb-upload">
<div class="thumb-edit">
<input type='file' id="thumbUpload02" class="ec-image-upload"
accept=".png, .jpg, .jpeg" />
<label><i class="fi-rr-edit"></i></label>
</div>
<div class="thumb-preview ec-preview">
<div class="image-thumb-preview">
<img loading="lazy" class="image-thumb-preview ec-image-preview v-img"
src="assets/images/vendor/5.jpg" alt="edit" />
</div>
</div>
</div>
</div> -->
<div class="thumb-upload">
<div class="thumb-edit">
<input type='file' id="thumbUpload01" class="ec-image-upload"
accept=".png, .jpg, .jpeg" />
<label><i class="fi-rr-edit"></i></label>
</div>
<div class="thumb-preview ec-preview">
<div class="image-thumb-preview">
<img loading="lazy" class="image-thumb-preview ec-image-preview v-img"
src="assets/images/banner/7.jpg" alt="edit" />
</div>
</div>
</div>
</div> -->
<!-- <div class="ec-vendor-block-detail">
<div class="thumb-upload">
<div class="thumb-edit">
<input type='file' id="thumbUpload02" class="ec-image-upload"
accept=".png, .jpg, .jpeg" />
<label><i class="fi-rr-edit"></i></label>
</div>
<div class="thumb-preview ec-preview">
<div class="image-thumb-preview">
<img loading="lazy" class="image-thumb-preview ec-image-preview v-img"
src="assets/images/vendor/5.jpg" alt="edit" />
</div>
</div>
</div>
</div> -->
<div class="ec-vendor-upload-detail">
<form class="row g-3">
<div class="col-md-12 space-t-15">

View File

@ -93,7 +93,7 @@ $vendorSearchResult = $_SESSION["vendorSearchResult"];
<!-- Sidebar toggle button -->
<button id="sidebar-toggler" class="sidebar-toggle"></button>
<!-- search form -->
<!-- 03-07-2024 Stacy & Raymart modified this block of code -->
<div class="search-form d-lg-inline-block">
<form action="vendor-product-search-action.php">
@ -648,22 +648,22 @@ $vendorSearchResult = $_SESSION["vendorSearchResult"];
</header>
<!-- 3-19-24 raymart added vendor search -->
<?php if (!empty($vendorSearchResult['results'])) : ?>
<div class="shop-pro-content" style="margin-bottom:40px; margin-right: 2%; margin-left: 2%;">
<div class="ec-product-inner">
<h5 class="ec-pro-title" style="margin-top: 25px; margin-left: 5%; font-size: 25px;">Vendor Search Results</h5>
<div class="row mt-4">
<?php
$count = 0;
foreach ($vendorSearchResult['results'] as $vendor) {
if ($count < 2) {
?>
<div class="col-md-12">
<div class="card" style="margin:5px">
<div class="card-body">
<div class="vendor-info" style="display: flex; align-items: center;">
<div class="ec-catalog-vendor" style="display: inline-block;">
<!-- 3-19-24 raymart added vendor search -->
<?php if (!empty($vendorSearchResult['results'])) : ?>
<div class="shop-pro-content" style="margin-bottom:40px; margin-right: 2%; margin-left: 2%;">
<div class="ec-product-inner">
<h5 class="ec-pro-title" style="margin-top: 25px; margin-left: 5%; font-size: 25px;">Vendor Search Results</h5>
<div class="row mt-4">
<?php
$count = 0;
foreach ($vendorSearchResult['results'] as $vendor) {
if ($count < 2) {
?>
<div class="col-md-12">
<div class="card" style="margin:5px">
<div class="card-body">
<div class="vendor-info" style="display: flex; align-items: center;">
<div class="ec-catalog-vendor" style="display: inline-block;">
<a href="vendor-profile.php?id=<?php echo $vendor["_id"] ?>">
<?php if (isset($vendor['vendor_image'])) : ?>
<img loading="lazy" src="<?php echo $vendor['vendor_image']; ?>" alt="<?php echo $vendor['user_login']; ?>" class="vendor-image" style="max-width: 100px; max-height: 100px;">
@ -671,117 +671,124 @@ $vendorSearchResult = $_SESSION["vendorSearchResult"];
<img loading="lazy" src="https://api.obanana.com/images/storage/web_images/1708588564876-viber_image_2024-02-22_15-54-42-498.png" class="vendor-image-placeholder" style="max-width: 100px; max-height: 100px;">
<?php endif; ?>
</a>
</div>
<div class="vendor-details" style="display:inline-block;">
<h6 class="ec-pro-title" style="padding:0 30px;font-family: Poppins, sans-serif; text-decoration: none; color: #777;white-space: nowrap;text-overflow: ellipsis;display: block;font-size: 16px;font-weight: 400;">
<a href="vendor-profile.php?id=<?php echo $vendor["_id"] ?>">
<?php echo $vendor['user_login']; ?>
</a>
</h6>
</div>
<div class="card text-center" style="margin-left: auto; margin-right: 5px;">
<div class="card-body">
<h6>Seller Products</h6>
<?php
$products = productList();
$vendorId = $vendor['_id'];
$product = array_filter($products, function ($var) use ($vendorId) {
return ($var['vendor_api_id'] == $vendorId);
});
?>
<p><?php echo count($product); ?></p>
</div>
<div class="vendor-details" style="display:inline-block;">
<h6 class="ec-pro-title" style="padding:0 30px;font-family: Poppins, sans-serif; text-decoration: none; color: #777;white-space: nowrap;text-overflow: ellipsis;display: block;font-size: 16px;font-weight: 400;">
<a href="vendor-profile.php?id=<?php echo $vendor["_id"] ?>">
<?php echo $vendor['user_login']; ?>
</a>
</h6>
</div>
<div class="card text-center" style="margin-left: auto; margin-right: 5px;">
<div class="card-body">
<h6>Seller Products</h6>
</div>
<div class="card text-center" style="margin-left: 5px; margin-right: 5px;">
<div class="card-body">
<h6>Seller since</h6>
<p>
<?php
$products = productList();
$vendorId = $vendor['_id'];
$product = array_filter($products, function ($var) use ($vendorId) {
return ($var['vendor_api_id'] == $vendorId);
});
if (!empty($vendor['date_registered'])) {
echo $vendor['date_registered'];
} else {
echo "Not yet registered";
}
?>
<p><?php echo count($product); ?></p>
</div>
</div>
<div class="card text-center" style="margin-left: 5px; margin-right: 5px;">
<div class="card-body">
<h6>Seller since</h6>
<p><?php echo $vendor['date_registered']; ?></p>
</div>
</p>
</div>
</div>
</div>
</div>
</div>
<?php
}
$count++;
}
?>
</div>
</div>
</div>
<?php endif; ?>
<!-- vendor search end -->
<!-- 3-19-24 raymart added Shop content Start -->
<div class="shop-pro-content" style="margin-right: 2%; margin-left: 2%;">
<div class="shop-pro-inner list-view">
<div class="row">
<?php
// $productSearchResult = [];
// foreach ($productSearchResult['results'] as $product => $productListVendor) {
// echo "$product .":" . $productListVendor";
// $vendorOfProduct = getVendorbyId($product['vendor_api_id']);
$products = productListVendor($vendorId);
$totalProducts = count($products);
for ($i = 0; $i <= $totalProducts - 1; $i++) {
$product = $products[$i];
?>
<div class="col-lg-3 col-md-4 col-sm-6">
<div class="card-wrapper">
<div class="card-container">
<div class="card-top">
<div class="image-container" style="height: 300px;"> <!-- Adjust the height as needed -->
<?php
if (isset($product['images'])) {
$image_urls = explode(',', $product['images']);
if (!empty($image_urls)) {
$first_image_url = trim($image_urls[0]);
?>
<img loading="lazy" class="img-fluid" src="<?php echo $first_image_url; ?>" alt="edit" style="object-fit: cover; width: 100%; height: 100%;"/>
<?php
}
} else {
?>
<img loading="lazy" class="img-fluid rounded-circle" src="https://api.obanana.com/images/storage/web_images/1710214273217-no_image.png" alt="edit" />
<?php
}
?>
</div>
</div>
<div class="card-bottom">
<h3><?php echo $product['product_name']; ?></h3>
<p><?php echo $product['regular_price']; ?></p>
</div>
<div class="card-action">
<div class="card-edit" onclick="editProduct('<?php echo $product['_id'] ?>');"><i class="mdi mdi-circle-edit-outline"></i></div>
<div class="card-preview"><i class="mdi mdi-eye-outline"></i></div>
<div class="card-remove" onclick="deleteProd('<?php echo $product['_id'] ?>');"><i class="mdi mdi mdi-delete-outline"></i></div>
</div>
</div>
</div>
</div>
<?php
<?php
}
?>
</div>
$count++;
}
?>
</div>
</div>
</div>
<!--Shop content End -->
<!-- 3-19-24 raymart added function for delete & edit -->
<script>
<?php endif; ?>
<!-- vendor search end -->
var sessionToken = '<?php echo isset($_SESSION["token"]) ? $_SESSION["token"] : ""; ?>';
var email = '<?php echo isset($_SESSION["email"]) ? $_SESSION["email"] : ""; ?>';
var password = '<?php echo isset($_SESSION["password"]) ? $_SESSION["password"] : ""; ?>';
<!-- 3-19-24 raymart added Shop content Start -->
<div class="shop-pro-content" style="margin-right: 2%; margin-left: 2%;">
<div class="shop-pro-inner list-view">
<div class="row">
<?php
// $productSearchResult = [];
// foreach ($productSearchResult['results'] as $product => $productListVendor) {
// echo "$product .":" . $productListVendor";
// $vendorOfProduct = getVendorbyId($product['vendor_api_id']);
function editProduct(productId) {
$products = productListVendor($vendorId);
$totalProducts = count($products);
for ($i = 0; $i <= $totalProducts - 1; $i++) {
$product = $products[$i];
?>
<div class="col-lg-3 col-md-4 col-sm-6">
<div class="card-wrapper">
<div class="card-container">
<div class="card-top">
<div class="image-container" style="height: 300px;"> <!-- Adjust the height as needed -->
<?php
if (isset($product['images'])) {
$image_urls = explode(',', $product['images']);
if (!empty($image_urls)) {
$first_image_url = trim($image_urls[0]);
?>
<img loading="lazy" class="img-fluid" src="<?php echo $first_image_url; ?>" alt="edit" style="object-fit: cover; width: 100%; height: 100%;" />
<?php
}
} else {
?>
<img loading="lazy" class="img-fluid rounded-circle" src="https://api.obanana.com/images/storage/web_images/1710214273217-no_image.png" alt="edit" />
<?php
}
?>
</div>
</div>
<div class="card-bottom">
<h3><?php echo $product['product_name']; ?></h3>
<p><?php echo $product['regular_price']; ?></p>
</div>
<div class="card-action">
<div class="card-edit" onclick="editProduct('<?php echo $product['_id'] ?>');"><i class="mdi mdi-circle-edit-outline"></i></div>
<div class="card-preview"><i class="mdi mdi-eye-outline"></i></div>
<div class="card-remove" onclick="deleteProd('<?php echo $product['_id'] ?>');"><i class="mdi mdi mdi-delete-outline"></i></div>
</div>
</div>
</div>
</div>
<?php
}
?>
</div>
</div>
</div>
</div>
<!--Shop content End -->
<!-- 3-19-24 raymart added function for delete & edit -->
<script>
var sessionToken = '<?php echo isset($_SESSION["token"]) ? $_SESSION["token"] : ""; ?>';
var email = '<?php echo isset($_SESSION["email"]) ? $_SESSION["email"] : ""; ?>';
var password = '<?php echo isset($_SESSION["password"]) ? $_SESSION["password"] : ""; ?>';
function editProduct(productId) {
console.log("Session Token:", sessionToken);
login(email, password, function() {
// Removed the call to updateSessionToken
@ -818,36 +825,35 @@ $vendorSearchResult = $_SESSION["vendorSearchResult"];
.then(data => {
// Update the session token on the server side
fetch("update-token-session.php", {
method: "POST",
headers: {
"Content-Type": "application/json"
},
body: JSON.stringify({
token: data.token
method: "POST",
headers: {
"Content-Type": "application/json"
},
body: JSON.stringify({
token: data.token
})
})
})
.then(response => response.json())
.then(result => {
if (result.status === 'success') {
// Update the session token in the client-side variable
sessionToken = data.token;
console.log("New Token:", sessionToken);
callback();
} else {
throw new Error("Unable to update session token");
}
});
.then(response => response.json())
.then(result => {
if (result.status === 'success') {
// Update the session token in the client-side variable
sessionToken = data.token;
console.log("New Token:", sessionToken);
callback();
} else {
throw new Error("Unable to update session token");
}
});
})
.catch(error => {
console.error("Error:", error.message);
});
}
}
</script>
<!-- 3-19-24 raymart added function for delete & edit -->
</script>
<!-- 3-19-24 raymart added function for delete & edit -->
<!-- Common Javascript -->
<!-- Common Javascript -->
<script src="assets/plugins/jquery/jquery-3.5.1.min.js"></script>
<script src="assets/js/bootstrap.bundle.min.js"></script>
<script src="assets/plugins/simplebar/simplebar.min.js"></script>
@ -860,6 +866,6 @@ $vendorSearchResult = $_SESSION["vendorSearchResult"];
<!-- Ekka Custom -->
<script src="assets/js/ekka.js"></script>
</body>
</body>
</html>

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

177
assets/js/user-history.js Normal file
View File

@ -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);
});
}

221
cart.php
View File

@ -32,7 +32,10 @@ if ($_SESSION["userId"] <> "") {
<meta name="msapplication-TileImage" content="assets/images/favicon/favicon.png" />
<!-- css Icon Font -->
<link rel="stylesheet" href="assets/css/vendor/ecicons.min.css" />
<link rel="stylesheet" href="assets/css/vendor/ecicons.min.css" />
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.2/css/all.min.css"
integrity="sha512-SnH5WK+bZxgPHs44uWIX+LLJAJ9/2PkPKZ5QiAj6Ta86w+fsb2TkcmfRyVX3pBnMFcV7oQPJkl9QevSCWr3W6A=="
crossorigin="anonymous" referrerpolicy="no-referrer" />
<!-- css All Plugins Files -->
<link rel="stylesheet" href="assets/css/plugins/animate.css" />
@ -191,11 +194,26 @@ if ($_SESSION["userId"] <> "") {
<div class="ec-cart-content">
<div class="ec-cart-inner">
<div class="row">
<style>
.rowcart{
display:flex;
justify-content:center;
align-self: center;
flex-direction:row;
}
.rowcartCheckbox{
height:15px;
width:15px;
margin-right:5px;
}
</style>
<form action="#">
<div class="table-content cart-table-content">
<table>
<thead>
<tr>
<th></th>
<th>Product</th>
<th>Price</th>
<th style="text-align: center;">Quantity</th>
@ -229,19 +247,39 @@ if ($_SESSION["userId"] <> "") {
?>
<tr id="cart_order_<?php echo $order['_id'] ?>">
<td data-label="Product" class="ec-cart-pro-name"><a href="product-left-sidebar.php?id=<?php echo $order['items'][0]['product']['product_id']; ?>"><img loading="lazy" class="ec-cart-pro-img mr-4" src="<?php echo $order['items'][0]['product']['product_image']; ?>" alt="" /><?php echo $order['items'][0]['product']['name']; ?></a></td>
<td>
<input type="checkbox" class="rowcartCheckbox" name="cart-item1[]" value="<?php echo $order['_id']?>"/>
</td>
<td data-label="Product" class="ec-cart-pro-name"><a href="product-left-sidebar.php?id=<?php echo $order['items'][0]['product']['product_id']; ?>">
<img loading="lazy" class="ec-cart-pro-img mr-4" src="<?php echo $order['items'][0]['product']['product_image']; ?>" alt="" />
<?php echo $order['items'][0]['product']['name']; ?></a>
</td>
<td data-label="Price" class="ec-cart-pro-price"><span class="amount"><?php echo $order['items'][0]['price']; ?></span></td>
<td data-label="Quantity" class="ec-cart-pro-qty" style="text-align: center;">
<div class="cart-qty-plus-minus2" style="width:100px; margin:auto;">
<div class="qty-btn" onclick="qtyDecrementCart('<?php echo $order['_id']; ?>' , '<?php echo $order['items'][0]['_id']; ?>',false, '<?php echo $order['items'][0]['product']['product_id']; ?>')">-</div>
<input id="cart_qty-input-<?php echo $order['items'][0]['_id']; ?>" class="qty-input" type="number" name="ec_qtybtn" value="<?php echo $order['items'][0]['quantity']; ?>" oninput="handleQtyInputCart(this, '<?php echo $order['_id']; ?>', '<?php echo $order['items'][0]['_id']; ?>','<?php echo $order['items'][0]['product']['product_id']; ?>')" />
<div class="qty-btn" onclick="qtyIncrementCart('<?php echo $order['_id']; ?>' , '<?php echo $order['items'][0]['_id']; ?>',false, '<?php echo $order['items'][0]['product']['product_id']; ?>')">+</div>
<!-- CART UI -->
<div class="cart-qty-plus-minus2 d-flex justify-content-center mt-1">
<div class="qty-btn" style="color:#ffaa00; font-size:35px; margin-right:5px; cursor: pointer;" onclick="qtyDecrementCart('<?php echo $order['_id']; ?>' ,
'<?php echo $order['items'][0]['_id']; ?>',false, '<?php echo $order['items'][0]['product']['product_id']; ?>')"
onmouseover="this.style.color='#a15d00'" onmouseout="this.style.color='#ffaa00'">-
</div>
<input style="width:100px; height:40px mt-3" id="cart_qty-input-<?php echo $order['items'][0]['_id']; ?>" class="qty-input" type="number" name="ec_qtybtn"
value="<?php echo $order['items'][0]['quantity']; ?>" oninput="handleQtyInputCart(this, '<?php echo $order['_id']; ?>',
'<?php echo $order['items'][0]['_id']; ?>','<?php echo $order['items'][0]['product']['product_id']; ?>')" />
<div class="qty-btn" style="color:#ffaa00; font-size:30px; margin-left:5px; cursor: pointer;" onclick="qtyIncrementCart('<?php echo $order['_id']; ?>' ,
'<?php echo $order['items'][0]['_id']; ?>',false, '<?php echo $order['items'][0]['product']['product_id']; ?>')"
onmouseover="this.style.color='#a15d00'" onmouseout="this.style.color='#ffaa00'">+</div>
</div>
<span id="cart_qty_<?php echo $order['_id'] ?>"></span>
</td>
<td data-label="Total" class="cart_subtotal-<?php echo $order['_id']; ?>" style="font-weight:bold"> <?php echo $order['total_amount'] ?></td>
<td data-label="Remove" class="ec-cart-pro-remove">
<a onclick="deleteOrderCart('<?php echo $order['_id']; ?>')"><i class="ecicon eci-trash-o"></i></a>
<!-- <a onclick="deleteOrderCart('<?php # echo $order['_id']; ?>')"><i class="ecicon eci-trash-o"></i></a> -->
<a href="#" class="removeCart" onclick="deleteOrderCart('<?php echo $order['_id']; ?>')">
<i class="ecicon eci-trash" style="color:#7e7e7e;" onmouseover="this.style.color='#aaaaaa'"
onmouseout="this.style.color='#7e7e7e'">
</i>
</a>
</td>
</tr>
<?php
@ -254,6 +292,34 @@ if ($_SESSION["userId"] <> "") {
?>
<script>
// let myLatestOrders = [];
var checkboxes = document.querySelectorAll('input[name="cart-item1[]"]');
checkboxes.forEach(function(checkbox) {
checkbox.addEventListener('change', function() {
getCheckedCheckboxes();
getLatestOrdersCart();
// update_Total()
});
});
function getCheckedCheckboxes() {
var checkboxes = document.querySelectorAll('input[name="cart-item1[]"]');
var checkedValues = [];
var uncheckedValues = [];
checkboxes.forEach(function(checkbox) {
if (checkbox.checked) {
checkedValues.push(checkbox.value.toLowerCase().trim());
} else {
uncheckedValues.push(checkbox.value.toLowerCase().trim());
}
});
if (checkedValues.length === 0) {
return uncheckedValues;
} else {
console.log(checkedValues);
return checkedValues;
}
}
function handleQtyInputCart(input, orderId, itemId, prodId) {
var newQuantity = parseInt(input.value);
@ -548,7 +614,18 @@ if ($_SESSION["userId"] <> "") {
if (orderData && orderData !== "") {
console.log(orderData)
const filteredOrders = orderData.filter(order => order.status.toUpperCase() === 'CART');
const totalAmountSum = filteredOrders.reduce((sum, order) => {
var checkedCategories = getCheckedCheckboxes();
let orderInitial= null;
if (filteredOrders && filteredOrders !== "") {
// Calculate the new total amount based on the updated quantities
if(checkedCategories?.length>0){
orderInitial = filteredOrders?.filter(order => checkedCategories?.includes(order._id));
}else{
orderInitial = filteredOrders
}
}
const totalAmountSum = orderInitial.reduce((sum, order) => {
const totalAmount = parseFloat(order.total_amount);
return sum + totalAmount;
}, 0);
@ -586,6 +663,16 @@ if ($_SESSION["userId"] <> "") {
})
.catch(error => console.error('Error:', error));
}
function handleCheckoutButton(event) {
event.preventDefault();
var checkedCategories = getCheckedCheckboxes();
const selectedIdString = checkedCategories.join('-');
login(email, password, function(token) {
window.location.href = `checkouttest.php?selected=${selectedIdString}`;
});
}
</script>
<!-- <tr>
<td data-label="Product" class="ec-cart-pro-name"><a
@ -654,7 +741,7 @@ if ($_SESSION["userId"] <> "") {
<div class="col-lg-12">
<div class="ec-cart-update-bottom">
<a href="index.php">Continue Shopping</a>
<a style="text-decoration:none; color:white" href="checkout.php" class="btn btn-primary">Check Out</a>
<a style="text-decoration:none; color:white"onclick="handleCheckoutButton(event)" class="btn btn-primary">Check Out</a>
</div>
</div>
</div>
@ -1205,121 +1292,7 @@ if ($_SESSION["userId"] <> "") {
</div>
<!-- Cart Floating Button end -->
<!-- Whatsapp -->
<div class="ec-style ec-right-bottom">
<!-- Start Floating Panel Container -->
<div class="ec-panel">
<!-- Panel Header -->
<div class="ec-header">
<strong>Need Help?</strong>
<p>Chat with us on WhatsApp</p>
</div>
<!-- Panel Content -->
<div class="ec-body">
<ul>
<!-- Start Single Contact List -->
<li>
<a class="ec-list" data-number="918866774266" data-message="Please help me! I have got wrong product - ORDER ID is : #654321485">
<div class="d-flex bd-highlight">
<!-- Profile Picture -->
<div class="ec-img-cont">
<img loading="lazy" src="assets/images/whatsapp/profile_01.jpg" class="ec-user-img" alt="Profile image">
<span class="ec-status-icon"></span>
</div>
<!-- Display Name & Last Seen -->
<div class="ec-user-info">
<span>Sahar Darya</span>
<p>Sahar left 7 mins ago</p>
</div>
<!-- Chat iCon -->
<div class="ec-chat-icon">
<i class="fa fa-whatsapp"></i>
</div>
</div>
</a>
</li>
<!--/ End Single Contact List -->
<!-- Start Single Contact List -->
<li>
<a class="ec-list" data-number="918866774266" data-message="Please help me! I have got wrong product - ORDER ID is : #654321485">
<div class="d-flex bd-highlight">
<!-- Profile Picture -->
<div class="ec-img-cont">
<img loading="lazy" src="assets/images/whatsapp/profile_02.jpg" class="ec-user-img" alt="Profile image">
<span class="ec-status-icon ec-online"></span>
</div>
<!-- Display Name & Last Seen -->
<div class="ec-user-info">
<span>Yolduz Rafi</span>
<p>Yolduz is online</p>
</div>
<!-- Chat iCon -->
<div class="ec-chat-icon">
<i class="fa fa-whatsapp"></i>
</div>
</div>
</a>
</li>
<!--/ End Single Contact List -->
<!-- Start Single Contact List -->
<li>
<a class="ec-list" data-number="918866774266" data-message="Please help me! I have got wrong product - ORDER ID is : #654321485">
<div class="d-flex bd-highlight">
<!-- Profile Picture -->
<div class="ec-img-cont">
<img loading="lazy" src="assets/images/whatsapp/profile_03.jpg" class="ec-user-img" alt="Profile image">
<span class="ec-status-icon ec-offline"></span>
</div>
<!-- Display Name & Last Seen -->
<div class="ec-user-info">
<span>Nargis Hawa</span>
<p>Nargis left 30 mins ago</p>
</div>
<!-- Chat iCon -->
<div class="ec-chat-icon">
<i class="fa fa-whatsapp"></i>
</div>
</div>
</a>
</li>
<!--/ End Single Contact List -->
<!-- Start Single Contact List -->
<li>
<a class="ec-list" data-number="918866774266" data-message="Please help me! I have got wrong product - ORDER ID is : #654321485">
<div class="d-flex bd-highlight">
<!-- Profile Picture -->
<div class="ec-img-cont">
<img loading="lazy" src="assets/images/whatsapp/profile_04.jpg" class="ec-user-img" alt="Profile image">
<span class="ec-status-icon ec-offline"></span>
</div>
<!-- Display Name & Last Seen -->
<div class="ec-user-info">
<span>Khadija Mehr</span>
<p>Khadija left 50 mins ago</p>
</div>
<!-- Chat iCon -->
<div class="ec-chat-icon">
<i class="fa fa-whatsapp"></i>
</div>
</div>
</a>
</li>
<!--/ End Single Contact List -->
</ul>
</div>
</div>
<!--/ End Floating Panel Container -->
<!-- Start Right Floating Button-->
<div class="ec-right-bottom">
<div class="ec-box">
<div class="ec-button rotateBackward">
<img loading="lazy" class="whatsapp" src="assets/images/common/whatsapp.png" alt="whatsapp icon" />
</div>
</div>
</div>
<!--/ End Right Floating Button-->
</div>
<!-- Whatsapp end -->
<!-- Feature tools -->
<div class="ec-tools-sidebar-overlay"></div>

129
cart1.php
View File

@ -18,7 +18,10 @@
<meta name="msapplication-TileImage" content="assets/images/favicon/favicon.png" />
<!-- css Icon Font -->
<link rel="stylesheet" href="assets/css/vendor/ecicons.min.css" />
<link rel="stylesheet" href="assets/css/vendor/ecicons.min.css" />
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.2/css/all.min.css"
integrity="sha512-SnH5WK+bZxgPHs44uWIX+LLJAJ9/2PkPKZ5QiAj6Ta86w+fsb2TkcmfRyVX3pBnMFcV7oQPJkl9QevSCWr3W6A=="
crossorigin="anonymous" referrerpolicy="no-referrer" />
<!-- css All Plugins Files -->
<link rel="stylesheet" href="assets/css/plugins/animate.css" />
@ -1630,129 +1633,7 @@
</div>
<!-- Cart Floating Button end -->
<!-- Whatsapp -->
<div class="ec-style ec-right-bottom">
<!-- Start Floating Panel Container -->
<div class="ec-panel">
<!-- Panel Header -->
<div class="ec-header">
<strong>Need Help?</strong>
<p>Chat with us on WhatsApp</p>
</div>
<!-- Panel Content -->
<div class="ec-body">
<ul>
<!-- Start Single Contact List -->
<li>
<a class="ec-list" data-number="918866774266"
data-message="Please help me! I have got wrong product - ORDER ID is : #654321485">
<div class="d-flex bd-highlight">
<!-- Profile Picture -->
<div class="ec-img-cont">
<img loading="lazy" src="assets/images/whatsapp/profile_01.jpg" class="ec-user-img"
alt="Profile image">
<span class="ec-status-icon"></span>
</div>
<!-- Display Name & Last Seen -->
<div class="ec-user-info">
<span>Sahar Darya</span>
<p>Sahar left 7 mins ago</p>
</div>
<!-- Chat iCon -->
<div class="ec-chat-icon">
<i class="fa fa-whatsapp"></i>
</div>
</div>
</a>
</li>
<!--/ End Single Contact List -->
<!-- Start Single Contact List -->
<li>
<a class="ec-list" data-number="918866774266"
data-message="Please help me! I have got wrong product - ORDER ID is : #654321485">
<div class="d-flex bd-highlight">
<!-- Profile Picture -->
<div class="ec-img-cont">
<img loading="lazy" src="assets/images/whatsapp/profile_02.jpg" class="ec-user-img"
alt="Profile image">
<span class="ec-status-icon ec-online"></span>
</div>
<!-- Display Name & Last Seen -->
<div class="ec-user-info">
<span>Yolduz Rafi</span>
<p>Yolduz is online</p>
</div>
<!-- Chat iCon -->
<div class="ec-chat-icon">
<i class="fa fa-whatsapp"></i>
</div>
</div>
</a>
</li>
<!--/ End Single Contact List -->
<!-- Start Single Contact List -->
<li>
<a class="ec-list" data-number="918866774266"
data-message="Please help me! I have got wrong product - ORDER ID is : #654321485">
<div class="d-flex bd-highlight">
<!-- Profile Picture -->
<div class="ec-img-cont">
<img loading="lazy" src="assets/images/whatsapp/profile_03.jpg" class="ec-user-img"
alt="Profile image">
<span class="ec-status-icon ec-offline"></span>
</div>
<!-- Display Name & Last Seen -->
<div class="ec-user-info">
<span>Nargis Hawa</span>
<p>Nargis left 30 mins ago</p>
</div>
<!-- Chat iCon -->
<div class="ec-chat-icon">
<i class="fa fa-whatsapp"></i>
</div>
</div>
</a>
</li>
<!--/ End Single Contact List -->
<!-- Start Single Contact List -->
<li>
<a class="ec-list" data-number="918866774266"
data-message="Please help me! I have got wrong product - ORDER ID is : #654321485">
<div class="d-flex bd-highlight">
<!-- Profile Picture -->
<div class="ec-img-cont">
<img loading="lazy" src="assets/images/whatsapp/profile_04.jpg" class="ec-user-img"
alt="Profile image">
<span class="ec-status-icon ec-offline"></span>
</div>
<!-- Display Name & Last Seen -->
<div class="ec-user-info">
<span>Khadija Mehr</span>
<p>Khadija left 50 mins ago</p>
</div>
<!-- Chat iCon -->
<div class="ec-chat-icon">
<i class="fa fa-whatsapp"></i>
</div>
</div>
</a>
</li>
<!--/ End Single Contact List -->
</ul>
</div>
</div>
<!--/ End Floating Panel Container -->
<!-- Start Right Floating Button-->
<div class="ec-right-bottom">
<div class="ec-box">
<div class="ec-button rotateBackward">
<img loading="lazy" class="whatsapp" src="assets/images/common/whatsapp.png" alt="whatsapp icon" />
</div>
</div>
</div>
<!--/ End Right Floating Button-->
</div>
<!-- Whatsapp end -->
<!-- Feature tools -->
<div class="ec-tools-sidebar-overlay"></div>

View File

@ -115,7 +115,10 @@ if (!empty($_GET['minPrice']) || !empty($_GET['maxPrice']) || !empty($_GET['cate
<meta name="msapplication-TileImage" content="assets/images/favicon/favicon.png" />
<!-- css Icon Font -->
<link rel="stylesheet" href="assets/css/vendor/ecicons.min.css" />
<link rel="stylesheet" href="assets/css/vendor/ecicons.min.css" />
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.2/css/all.min.css"
integrity="sha512-SnH5WK+bZxgPHs44uWIX+LLJAJ9/2PkPKZ5QiAj6Ta86w+fsb2TkcmfRyVX3pBnMFcV7oQPJkl9QevSCWr3W6A=="
crossorigin="anonymous" referrerpolicy="no-referrer" />
<!-- css All Plugins Files -->
<link rel="stylesheet" href="assets/css/plugins/animate.css" />
@ -133,21 +136,37 @@ if (!empty($_GET['minPrice']) || !empty($_GET['maxPrice']) || !empty($_GET['cate
<!-- Background css -->
<link rel="stylesheet" id="bg-switcher-css" href="assets/css/backgrounds/bg-4.css">
<script>
function updateCartItemCount() {
$.get("cartitems.php?id=<?php echo $_SESSION['customerId']; ?>", function(data, status) {
if (data != "") {
console.log("Data: " + data + "\nStatus: " + status);
document.getElementById("cartItemCount").innerHTML = data;
}
});
}
function updateWishItemCount() {
$.get("wishlistitems.php?id=<?php echo $_SESSION['customerId']; ?>", function(data) {
if (data != "") {
document.getElementById("wishItemCount").innerHTML = data;
}
});
}
function updateCartItemCount() {
var xhr = new XMLHttpRequest();
xhr.open("GET", "cartitems.php?id=<?php echo $_SESSION['customerId']; ?>", true);
xhr.onreadystatechange = function () {
if (xhr.readyState == 4 && xhr.status == 200) {
var data = xhr.responseText;
if (data !== "") {
console.log("Data: " + data);
document.getElementById("cartItemCount").innerHTML = data;
document.getElementById("cartNewItemCount").innerHTML = data;
}
}
};
xhr.send();
}
function updateWishItemCount() {
var xhr = new XMLHttpRequest();
xhr.open("GET", "wishlistitems.php?id=<?php echo $_SESSION['customerId']; ?>", true);
xhr.onreadystatechange = function () {
if (xhr.readyState == 4 && xhr.status == 200) {
var data = xhr.responseText;
if (data !== "") {
document.getElementById("wishItemCount").innerHTML = data;
document.getElementById("wishNewItemCount").innerHTML = data;
}
}
};
xhr.send();
}
</script>
<!-- raymart added css feb 14 2024 -->
<style>
@ -302,7 +321,7 @@ if (!empty($_GET['minPrice']) || !empty($_GET['maxPrice']) || !empty($_GET['cate
<div class="ec-page-description ec-page-description-info"style="background: orange;">
<div class="ec-page-block" style="background: #393e46;">
<div class="ec-catalog-vendor">
<a href="vendor-profile.html">
<?php
if (isset($vendor["vendor_image"])) {
?><img loading="lazy" src="<?php echo $vendor["vendor_image"] ?>" alt="vendor img"><?php
@ -310,14 +329,14 @@ if (!empty($_GET['minPrice']) || !empty($_GET['maxPrice']) || !empty($_GET['cate
?><img loading="lazy" src="https://api.obanana.com/images/storage/web_images/1710214273217-no_image.png" alt="vendor img"><?php
}
?>
</a>
</div>
<div class="ec-catalog-vendor-info row" style="justify-content: center;">
<div class="col-lg-3 col-md-6 ec-catalog-name pad-15">
<a href="vendor-profile.html">
<h6 class="name"><?php echo $vendor["user_login"] ?></h6>
</a>
<p>( Retail Business )</p>
</div>
<!-- raymart remove level feb 22 2024 -->
@ -326,18 +345,23 @@ if (!empty($_GET['minPrice']) || !empty($_GET['maxPrice']) || !empty($_GET['cate
<p>Level : 9 out of 10</p>
</div> -->
<div class="col-lg-3 col-md-6 ec-catalog-pro-count pad-15">
<a href="vendor-profile.html">
<h6>Seller Products</h6>
<?php
?>
</a>
<p><?php echo count($products) ?> Products</p>
</div>
<div class="col-lg-3 col-md-6 ec-catalog-since pad-15">
<a href="vendor-profile.html">
<h6>Seller since</h6>
<p><?php echo $vendor["date_registered"] ?></p>
</a>
<p>
<?php
if (!empty($vendor['date_registered'])){
echo date('F j, Y', strtotime($vendor['date_registered']));
} else {
echo "Not Yet Registered";
}
?>
</p>
</div>
</div>
</div>
@ -391,134 +415,8 @@ if (!empty($_GET['minPrice']) || !empty($_GET['maxPrice']) || !empty($_GET['cate
<!-- Shop content Start -->
<div class="shop-pro-content">
<div class="shop-pro-inner">
<div class="row" id="product-container">
<?php
//var_dump($products);
foreach ($filteredProducts as $product){
// $vendorOfProduct = getVendorbyId($product['vendor_api_id']);
?>
<div class="col-lg-4 col-md-6 col-sm-6 col-xs-6 mb-6 pro-gl-content">
<div class="ec-product-inner">
<div class="ec-pro-image-outer" style="max-width: 290px; height: 350px;">
<div class="ec-pro-image">
<!-- raymart added for link for product feb 22 2024 -->
<a class="image" href="product-left-sidebar.php?id=<?php echo $product["_id"] ?>"<?php echo $product["product_image"] ?>>
<!-- raymart replace new function for images of the product march 8 2024 -->
<?php
if (isset($product['images'])) {
$image_urls = explode(',', $product['images']);
if (!empty($image_urls)) {
$first_image_url = trim($image_urls[0]);
?>
<img loading="lazy" class="main-image" src="<?php echo $first_image_url; ?>" alt="edit" style="border: 1px solid #eeeeee; height: 330px; object-fit: cover;"/>
<?php
}
} else {
?>
<img loading="lazy" class="main-image" src="https://api.obanana.com/images/storage/web_images/1710214273217-no_image.png" alt="edit" />
<?php
}
?>
</a>
<!-- raymart edit action feb 14 2024 -->
<div class="ec-pro-actions" style="bottom: -36px;">
<!-- raymart replace updated prize for the product march 8 2024 -->
<?php if (isset($product["sale_price"]) && $product["sale_price"] > 0) : ?>
<button title="Add To Cart" onclick="popupAddToCart(`<?php echo htmlspecialchars(json_encode($product), ENT_QUOTES, 'UTF-8'); ?>`,`<?php echo htmlspecialchars($vendorOfProduct, ENT_QUOTES, 'UTF-8'); ?>`, `<?php echo isset($_SESSION['token']) ? $_SESSION['token'] : ''; ?>` , `<?php echo isset($_SESSION['email']) ? $_SESSION['email'] : ''; ?>` , `<?php echo isset($_SESSION['password']) ? $_SESSION['password'] : ''; ?>` , `<?php echo htmlspecialchars(json_encode($customer_data), ENT_QUOTES, 'UTF-8'); ?>`);" class="add-to-cart"><i class="fi-rr-shopping-basket"></i> Add To Cart</button>
<a class="ec-btn-group wishlist" title="Wishlist" onclick="popupWishlist('<?php echo htmlspecialchars(json_encode($product), ENT_QUOTES, 'UTF-8'); ?>', '<?php echo htmlspecialchars(json_encode($customer_data), ENT_QUOTES, 'UTF-8'); ?>');"><i class="fi-rr-heart"></i></a>
<?php elseif (isset($product["regular_price"]) && $product["regular_price"] != "") : ?>
<button title="Add To Cart" onclick="popupAddToCart(`<?php echo htmlspecialchars(json_encode($product), ENT_QUOTES, 'UTF-8'); ?>`,`<?php echo htmlspecialchars($vendorOfProduct, ENT_QUOTES, 'UTF-8'); ?>`, `<?php echo isset($_SESSION['token']) ? $_SESSION['token'] : ''; ?>` , `<?php echo isset($_SESSION['email']) ? $_SESSION['email'] : ''; ?>` , `<?php echo isset($_SESSION['password']) ? $_SESSION['password'] : ''; ?>` , `<?php echo htmlspecialchars(json_encode($customer_data), ENT_QUOTES, 'UTF-8'); ?>`);" class="add-to-cart"><i class="fi-rr-shopping-basket"></i> Add To Cart</button>
<a class="ec-btn-group wishlist" title="Wishlist" onclick="popupWishlist('<?php echo htmlspecialchars(json_encode($product), ENT_QUOTES, 'UTF-8'); ?>', '<?php echo htmlspecialchars(json_encode($customer_data), ENT_QUOTES, 'UTF-8'); ?>');"><i class="fi-rr-heart"></i></a>
<?php else : ($product["regular_price"] == "" || $product["regular_price"] == null) ?>
<a class="ec-btn-group wishlist" title="Wishlist" onclick="popupWishlist('<?php echo htmlspecialchars(json_encode($product), ENT_QUOTES, 'UTF-8'); ?>', '<?php echo htmlspecialchars(json_encode($customer_data), ENT_QUOTES, 'UTF-8'); ?>');"><i class="fi-rr-heart"></i></a>
<?php endif; ?>
</div>
<!-- <span class="percentage">20%</span>
<a href="#" class="quickview" data-link-action="quickview" title="Quick view" data-bs-toggle="modal" data-bs-target="#ec_quickview_modal"><i class="fi-rr-eye"></i></a>
<div class="ec-pro-actions">
<a href="compare.html" class="ec-btn-group compare" title="Compare"><i class="fi fi-rr-arrows-repeat"></i></a>
<button title="Add To Cart" class="add-to-cart"><i class="fi-rr-shopping-basket"></i> Add To Cart</button>
<a class="ec-btn-group wishlist" title="Wishlist"><i class="fi-rr-heart"></i></a>
</div> -->
</div>
</div>
<div class="ec-pro-content">
<h5 class="ec-pro-title"><a href="product-left-sidebar.php?id=<?php echo $product["_id"] ?>" style="width: 90%; text-wrap: wrap;"><?php echo $product["product_name"] ?></a></h5>
<!-- raymart remove ratings feb 22 2024 -->
<!-- <div class="ec-pro-rating">
<i class="ecicon eci-star fill"></i>
<i class="ecicon eci-star fill"></i>
<i class="ecicon eci-star fill"></i>
<i class="ecicon eci-star fill"></i>
<i class="ecicon eci-star"></i>
</div> -->
<!-- <div class="ec-pro-list-desc">Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum is simply dutmmy text ever since the 1500s, when an unknown printer took a galley.</div> -->
<span class="ec-price">
<!-- raymart added $ to pesos function feb 22 2024 -->
<?php if (isset($product["sale_price"]) && $product["sale_price"] > 0) : ?>
<span class="old-price">&#8369;<?php echo number_format($product["regular_price"], 2, ".", ",") ?></span>
<span class="new-price">&#8369;<?php echo number_format($product["sale_price"], 2, ".", ",") ?></span>
<?php elseif (isset($product["regular_price"]) && $product["regular_price"] != "") : ?>
<span class="new-price">&#8369;<?php echo number_format($product["regular_price"], 2, ".", ",") ?></span>
<?php elseif ($product["regular_price"] == "" || $product["regular_price"] == null) : ?>
<span class="inquire-text">Inquire</span>
<?php else : ?>
<span class="inquire-text">Inquire</span>
<?php endif; ?>
<!-- <?php if (isset($product["sale_price"]) && $product["sale_price"] > 0) : ?>
<span class="old-price">&#8369;<?php echo number_format($product["regular_price"], 2, ".", ",") ?></span>
<span class="new-price">&#8369;<?php echo number_format($product["sale_price"], 2, ".", ",") ?></span>
<?php elseif (isset($product["regular_price"]) && $product["regular_price"] != "") : ?>
<span class="new-price">&#8369;<?php echo number_format($product["regular_price"], 2, ".", ",") ?></span>
<?php elseif ($product["regular_price"] == "" || $product["regular_price"] == null) : ?>
<span class="inquire-text">Inquire</span>
<?php else : ?>
<span class="inquire-text">Inquire</span>
<?php endif; ?> -->
</span>
<div class="ec-pro-option">
<!-- raymart remove color and size function feb 22 2024 -->
<!-- <div class="ec-pro-color">
<span class="ec-pro-opt-label">Color</span>
<ul class="ec-opt-swatch ec-change-img">
<?php
if (isset($product["product_image"]) && $product["product_image"] <> "") {
?>
<li class="active"><a href="#" class="ec-opt-clr-img" data-src="<?php echo $product["product_image"] ?>" data-src-hover="<?php echo $product["product_image"] ?>" data-tooltip="Gray"><span style="background-color:#e8c2ff;"></span></a></li>
<li><a href="#" class="ec-opt-clr-img" data-src="<?php echo $product["product_image"] ?>" data-src-hover="<?php echo $product["product_image"] ?>" data-tooltip="Orange"><span style="background-color:#9cfdd5;"></span></a></li>
<?php
} else {
?>
<li class="active"><a href="#" class="ec-opt-clr-img" data-src="assets/images/product-image/6_1.jpg" data-src-hover="assets/images/product-image/6_1.jpg" data-tooltip="Gray"><span style="background-color:#e8c2ff;"></span></a></li>
<li><a href="#" class="ec-opt-clr-img" data-src="assets/images/product-image/6_2.jpg" data-src-hover="assets/images/product-image/6_2.jpg" data-tooltip="Orange"><span style="background-color:#9cfdd5;"></span></a></li>
<?php
}
?>
</ul>
</div> -->
<!-- <div class="ec-pro-size">
<span class="ec-pro-opt-label">Size</span>
<ul class="ec-opt-size">
<li class="active"><a href="#" class="ec-opt-sz" data-old="$25.00" data-new="$20.00" data-tooltip="Small">S</a></li>
<li><a href="#" class="ec-opt-sz" data-old="$27.00" data-new="$22.00" data-tooltip="Medium">M</a></li>
<li><a href="#" class="ec-opt-sz" data-old="$30.00" data-new="$25.00" data-tooltip="Large">X</a></li>
<li><a href="#" class="ec-opt-sz" data-old="$35.00" data-new="$30.00" data-tooltip="Extra Large">XL</a></li>
</ul>
</div> -->
</div>
</div>
</div>
</div>
<?php
}
?>
<div class="row" id="product-container3">
</div>
</div>
@ -542,8 +440,10 @@ if (!empty($_GET['minPrice']) || !empty($_GET['maxPrice']) || !empty($_GET['cate
// JavaScript
document.addEventListener("DOMContentLoaded", function() {
loadProducts();
console.log('<?php echo $json ?>')
function loadProducts(page,isFilter) {
let xhrVendors1 = new XMLHttpRequest();
// Define the endpoint URL for fetching vendors
@ -559,67 +459,71 @@ xhrVendors1.onreadystatechange = function() {
var checkedCategories = getCheckedCheckboxes();
var prices = getMinMaxPrices();
function filterFunction(checkedCategories, minPrice, maxPrice,products) {
var filteredProducts = [];
// Filter by category
if (checkedCategories.length > 0) {
let filteredProduct= products?.filter((product) => {
let categoryF = product?.product_category?.toLowerCase();
// console.log('Category (lowercase):', categoryF);
let result =checkedCategories.includes(categoryF)
// console.log('Checked Categories:', result);
return result; // Return a boolean value indicating whether the category is included
});
filteredProducts=filteredProduct
console.log(filteredProducts);
function filterFunction(checkedCategories, minPrice, maxPrice,products) {
var filteredProducts = [];
// Filter by category
if (checkedCategories.length > 0) {
let filteredProduct= products?.filter((product) => {
let categoryF = product?.product_category?.toLowerCase();
// console.log('Category (lowercase):', categoryF);
let result =checkedCategories.includes(categoryF)
// console.log('Checked Categories:', result);
return result; // Return a boolean value indicating whether the category is included
});
filteredProducts=filteredProduct
console.log(filteredProducts);
} else {
// If no categories are selected, keep all products
filteredProducts = products;
}
} else {
// If no categories are selected, keep all products
filteredProducts = products;
}
// If minPrice or maxPrice is not provided, set them to default values
minPriceFinal = minPrice !== '' ? parseInt(minPrice) : 0;
maxPriceFinal = maxPrice !== '' ? parseInt(maxPrice) : Number.MAX_VALUE;
console.log(checkedCategories, minPrice,products)
// If minPrice or maxPrice is not provided, set them to default values
minPriceFinal = minPrice !== '' ? parseInt(minPrice) : 0;
maxPriceFinal = maxPrice !== '' ? parseInt(maxPrice) : Number.MAX_VALUE;
console.log(checkedCategories, minPrice,products)
// Filter by price range
// Filter by price range
if( minPrice !== ''||maxPrice !== ''){
// Filter by price range
// Filter by price range
if( minPrice !== ''||maxPrice !== ''){
filteredProducts = filteredProducts.filter(function(product) {
// Check if product has a sale price
var salePrice = parseInt(product.sale_price);
var regularPrice = parseInt(product.regular_price);
filteredProducts = filteredProducts.filter(function(product) {
// Check if product has a sale price
var salePrice = parseInt(product.sale_price);
var regularPrice = parseInt(product.regular_price);
// Check if salePrice and regularPrice are valid numbers
// if (isNaN(salePrice) || isNaN(regularPrice)) {
// // One of the prices is not a valid number, use 0 instead
// salePrice = salePrice || 0;
// regularPrice = regularPrice || 0;
// }
var priceToCheck = salePrice > 0 ? salePrice : regularPrice;
// console.log(priceToCheck);
return priceToCheck >= minPriceFinal && priceToCheck <= maxPriceFinal;
});
}
console.log({results:filteredProducts});
// Check if salePrice and regularPrice are valid numbers
// if (isNaN(salePrice) || isNaN(regularPrice)) {
// // One of the prices is not a valid number, use 0 instead
// salePrice = salePrice || 0;
// regularPrice = regularPrice || 0;
// }
var priceToCheck = salePrice > 0 ? salePrice : regularPrice;
// console.log(priceToCheck);
return priceToCheck >= minPriceFinal && priceToCheck <= maxPriceFinal;
});
}
console.log({results:filteredProducts});
// Final filtered products
// console.log({results:filteredProducts});
let final = filteredProducts ??[]
return final;
}
let productContainer = document.getElementById("product-container");
// Final filtered products
// console.log({results:filteredProducts});
let final = filteredProducts ??[]
return final;
}
let productContainer = document.getElementById("product-container3");
productContainer.innerHTML = "";
let productsFinal = JSON.parse(xhrVendors1.responseText);
console.log(productsFinal);
// console.log(productsFinal);
productsFinal= filterFunction(checkedCategories, prices.minPrice, prices.maxPrice,productsFinal);
productsFinal?.forEach(function(prod) {
let product = prod;
let vendorOfProduct = prod.vendor_api_id;
let vendorOfProduct = '<?php echo $json ?>';
// let card = document.createElement("div");
let token ="<?php echo $_SESSION['token'] ?>";
let email ="<?php echo $_SESSION['email'] ?>";
@ -632,17 +536,19 @@ let productContainer = document.getElementById("product-container");
let imageUrls = product.images.split(',');
let firstImageUrl = imageUrls[0].trim();
let img = document.createElement("img");
img.setAttribute("style", "width: 290px; height: 200px; object-fit: cover;");
img.setAttribute("style", "border: 1px solid #eeeeee; height: 330px; object-fit: cover;");
img.setAttribute("class", "main-image");
img.setAttribute("src", firstImageUrl);
img.setAttribute("alt", "Product");
img.setAttribute("loading", "lazy");
img.className = "main-image";
imageContainer.appendChild(img);
} else {
let img = document.createElement("img");
img.className = "main-image";
img.setAttribute("style", "width: 290px; height: 200px; object-fit: cover;");
img.setAttribute("style", "border: 1px solid #eeeeee; height: 330px; object-fit: cover;");
img.setAttribute("loading", "lazy");
img.setAttribute("class", "main-image");
img.setAttribute("src", "https://api.obanana.com/images/storage/web_images/1709002636671-viber_image_2024-02-22_15-54-42-498.png");
img.setAttribute("alt", "Product");
@ -654,14 +560,21 @@ let productContainer = document.getElementById("product-container");
card.classList.add("col-lg-4", "col-md-6", "col-sm-6", "col-xs-6", "mb-6", "pro-gl-content", "width-100");
card.innerHTML = `
<div class="ec-product-inner">
<div class="ec-pro-image-outer" style="width: 290px; height: 200px;">
<div class="ec-pro-image-outer" style="max-width: 290px; height: 350px;">
<div class="ec-pro-image">
<a href="product-left-sidebar.php?id=${product._id}">
${imageContainer.innerHTML} <!-- Include the dynamically loaded image here -->
</a>
<div class="ec-pro-actions" style="bottom: -36px;">
<button title="Add To Cart" onclick="popupAddToCart('${encodeURIComponent(JSON.stringify(product))}','${encodeURIComponent(JSON.stringify(vendorOfProduct))}', '${token}', '${email}', '${password}', '${encodeURIComponent(JSON.stringify(customer_data))}');" class="add-to-cart"><i class="fi-rr-shopping-basket"></i> Add To Cart</button>
<a class="ec-btn-group wishlist" title="Wishlist" onclick="popupWishlist('${encodeURIComponent(JSON.stringify(product))}', '${encodeURIComponent(JSON.stringify(customer_data))}');"><i class="fi-rr-heart"></i></a>
${
(product["sale_price"] && product["sale_price"] > 0) ?
`<button title="Add To Cart" onclick="popupAddToCart('${encodeURIComponent(JSON.stringify(product))}','${encodeURIComponent(JSON.stringify(vendorOfProduct))}', '${token}', '${email}', '${password}', '${encodeURIComponent(JSON.stringify(customer_data))}');" class="add-to-cart"><i class="fi-rr-shopping-basket"></i> Add To Cart</button>
<a class="ec-btn-group wishlist" title="Wishlist" onclick="popupWishlist('${encodeURIComponent(JSON.stringify(product))}', '${encodeURIComponent(JSON.stringify(customer_data))}');"><i class="fi-rr-heart"></i></a>` :
(product["regular_price"] && product["regular_price"] != "") ?
`<button title="Add To Cart" onclick="popupAddToCart('${encodeURIComponent(JSON.stringify(product))}','${encodeURIComponent(JSON.stringify(vendorOfProduct))}', '${token}', '${email}', '${password}', '${encodeURIComponent(JSON.stringify(customer_data))}');" class="add-to-cart"><i class="fi-rr-shopping-basket"></i> Add To Cart</button>
<a class="ec-btn-group wishlist" title="Wishlist" onclick="popupWishlist('${encodeURIComponent(JSON.stringify(product))}', '${encodeURIComponent(JSON.stringify(customer_data))}');"><i class="fi-rr-heart"></i></a>` :
`<a class="ec-btn-group wishlist" title="Wishlist" onclick="popupWishlist('${encodeURIComponent(JSON.stringify(product))}', '${encodeURIComponent(JSON.stringify(customer_data))}');"><i class="fi-rr-heart"></i></a>`
}
</div>
</div>
</div>
@ -1270,7 +1183,7 @@ maxPriceInput.addEventListener('input', function() {
<!-- Modal end -->
<!-- Footer navigation panel for responsive display -->
<div class="ec-nav-toolbar">
<!-- <div class="ec-nav-toolbar">
<div class="container">
<div class="ec-nav-panel">
<div class="ec-nav-panel-icons">
@ -1291,7 +1204,7 @@ maxPriceInput.addEventListener('input', function() {
</div>
</div>
</div>
</div> -->
<!-- Footer navigation panel for responsive display end -->
<!-- Recent Purchase Popup -->
@ -1316,121 +1229,7 @@ maxPriceInput.addEventListener('input', function() {
</div>
<!-- Cart Floating Button end -->
<!-- Whatsapp -->
<div class="ec-style ec-right-bottom">
<!-- Start Floating Panel Container -->
<div class="ec-panel">
<!-- Panel Header -->
<div class="ec-header">
<strong>Need Help?</strong>
<p>Chat with us on WhatsApp</p>
</div>
<!-- Panel Content -->
<div class="ec-body">
<ul>
<!-- Start Single Contact List -->
<li>
<a class="ec-list" data-number="918866774266" data-message="Please help me! I have got wrong product - ORDER ID is : #654321485">
<div class="d-flex bd-highlight">
<!-- Profile Picture -->
<div class="ec-img-cont">
<img loading="lazy" src="assets/images/whatsapp/profile_01.jpg" class="ec-user-img" alt="Profile image">
<span class="ec-status-icon"></span>
</div>
<!-- Display Name & Last Seen -->
<div class="ec-user-info">
<span>Sahar Darya</span>
<p>Sahar left 7 mins ago</p>
</div>
<!-- Chat iCon -->
<div class="ec-chat-icon">
<i class="fa fa-whatsapp"></i>
</div>
</div>
</a>
</li>
<!--/ End Single Contact List -->
<!-- Start Single Contact List -->
<li>
<a class="ec-list" data-number="918866774266" data-message="Please help me! I have got wrong product - ORDER ID is : #654321485">
<div class="d-flex bd-highlight">
<!-- Profile Picture -->
<div class="ec-img-cont">
<img loading="lazy" src="assets/images/whatsapp/profile_02.jpg" class="ec-user-img" alt="Profile image">
<span class="ec-status-icon ec-online"></span>
</div>
<!-- Display Name & Last Seen -->
<div class="ec-user-info">
<span>Yolduz Rafi</span>
<p>Yolduz is online</p>
</div>
<!-- Chat iCon -->
<div class="ec-chat-icon">
<i class="fa fa-whatsapp"></i>
</div>
</div>
</a>
</li>
<!--/ End Single Contact List -->
<!-- Start Single Contact List -->
<li>
<a class="ec-list" data-number="918866774266" data-message="Please help me! I have got wrong product - ORDER ID is : #654321485">
<div class="d-flex bd-highlight">
<!-- Profile Picture -->
<div class="ec-img-cont">
<img loading="lazy" src="assets/images/whatsapp/profile_03.jpg" class="ec-user-img" alt="Profile image">
<span class="ec-status-icon ec-offline"></span>
</div>
<!-- Display Name & Last Seen -->
<div class="ec-user-info">
<span>Nargis Hawa</span>
<p>Nargis left 30 mins ago</p>
</div>
<!-- Chat iCon -->
<div class="ec-chat-icon">
<i class="fa fa-whatsapp"></i>
</div>
</div>
</a>
</li>
<!--/ End Single Contact List -->
<!-- Start Single Contact List -->
<li>
<a class="ec-list" data-number="918866774266" data-message="Please help me! I have got wrong product - ORDER ID is : #654321485">
<div class="d-flex bd-highlight">
<!-- Profile Picture -->
<div class="ec-img-cont">
<img loading="lazy" src="assets/images/whatsapp/profile_04.jpg" class="ec-user-img" alt="Profile image">
<span class="ec-status-icon ec-offline"></span>
</div>
<!-- Display Name & Last Seen -->
<div class="ec-user-info">
<span>Khadija Mehr</span>
<p>Khadija left 50 mins ago</p>
</div>
<!-- Chat iCon -->
<div class="ec-chat-icon">
<i class="fa fa-whatsapp"></i>
</div>
</div>
</a>
</li>
<!--/ End Single Contact List -->
</ul>
</div>
</div>
<!--/ End Floating Panel Container -->
<!-- Start Right Floating Button-->
<div class="ec-right-bottom">
<div class="ec-box">
<div class="ec-button rotateBackward">
<img loading="lazy" class="whatsapp" src="assets/images/common/whatsapp.png" alt="whatsapp icon" />
</div>
</div>
</div>
<!--/ End Right Floating Button-->
</div>
<!-- Whatsapp end -->
<!-- Feature tools -->
<div class="ec-tools-sidebar-overlay"></div>

View File

@ -18,7 +18,10 @@
<meta name="msapplication-TileImage" content="assets/images/favicon/favicon.png" />
<!-- css Icon Font -->
<link rel="stylesheet" href="assets/css/vendor/ecicons.min.css" />
<link rel="stylesheet" href="assets/css/vendor/ecicons.min.css" />
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.2/css/all.min.css"
integrity="sha512-SnH5WK+bZxgPHs44uWIX+LLJAJ9/2PkPKZ5QiAj6Ta86w+fsb2TkcmfRyVX3pBnMFcV7oQPJkl9QevSCWr3W6A=="
crossorigin="anonymous" referrerpolicy="no-referrer" />
<!-- css All Plugins Files -->
<link rel="stylesheet" href="assets/css/plugins/animate.css" />

View File

@ -68,7 +68,10 @@ if (isset($customer_data[0]["address"]) && is_array($customer_data[0]["address"]
<meta name="msapplication-TileImage" content="assets/images/favicon/favicon.png" />
<!-- css Icon Font -->
<link rel="stylesheet" href="assets/css/vendor/ecicons.min.css" />
<link rel="stylesheet" href="assets/css/vendor/ecicons.min.css" />
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.2/css/all.min.css"
integrity="sha512-SnH5WK+bZxgPHs44uWIX+LLJAJ9/2PkPKZ5QiAj6Ta86w+fsb2TkcmfRyVX3pBnMFcV7oQPJkl9QevSCWr3W6A=="
crossorigin="anonymous" referrerpolicy="no-referrer" />
<!-- css All Plugins Files -->
<link rel="stylesheet" href="assets/css/plugins/animate.css" />
@ -1450,121 +1453,7 @@ if (isset($customer_data[0]["address"]) && is_array($customer_data[0]["address"]
</div>
<!-- Cart Floating Button end -->
<!-- Whatsapp -->
<div class="ec-style ec-right-bottom">
<!-- Start Floating Panel Container -->
<div class="ec-panel">
<!-- Panel Header -->
<div class="ec-header">
<strong>Need Help?</strong>
<p>Chat with us on WhatsApp</p>
</div>
<!-- Panel Content -->
<div class="ec-body">
<ul>
<!-- Start Single Contact List -->
<li>
<a class="ec-list" data-number="918866774266" data-message="Please help me! I have got wrong product - ORDER ID is : #654321485">
<div class="d-flex bd-highlight">
<!-- Profile Picture -->
<div class="ec-img-cont">
<img loading="lazy" src="assets/images/whatsapp/profile_01.jpg" class="ec-user-img" alt="Profile image">
<span class="ec-status-icon"></span>
</div>
<!-- Display Name & Last Seen -->
<div class="ec-user-info">
<span>Sahar Darya</span>
<p>Sahar left 7 mins ago</p>
</div>
<!-- Chat iCon -->
<div class="ec-chat-icon">
<i class="fa fa-whatsapp"></i>
</div>
</div>
</a>
</li>
<!--/ End Single Contact List -->
<!-- Start Single Contact List -->
<li>
<a class="ec-list" data-number="918866774266" data-message="Please help me! I have got wrong product - ORDER ID is : #654321485">
<div class="d-flex bd-highlight">
<!-- Profile Picture -->
<div class="ec-img-cont">
<img loading="lazy" src="assets/images/whatsapp/profile_02.jpg" class="ec-user-img" alt="Profile image">
<span class="ec-status-icon ec-online"></span>
</div>
<!-- Display Name & Last Seen -->
<div class="ec-user-info">
<span>Yolduz Rafi</span>
<p>Yolduz is online</p>
</div>
<!-- Chat iCon -->
<div class="ec-chat-icon">
<i class="fa fa-whatsapp"></i>
</div>
</div>
</a>
</li>
<!--/ End Single Contact List -->
<!-- Start Single Contact List -->
<li>
<a class="ec-list" data-number="918866774266" data-message="Please help me! I have got wrong product - ORDER ID is : #654321485">
<div class="d-flex bd-highlight">
<!-- Profile Picture -->
<div class="ec-img-cont">
<img loading="lazy" src="assets/images/whatsapp/profile_03.jpg" class="ec-user-img" alt="Profile image">
<span class="ec-status-icon ec-offline"></span>
</div>
<!-- Display Name & Last Seen -->
<div class="ec-user-info">
<span>Nargis Hawa</span>
<p>Nargis left 30 mins ago</p>
</div>
<!-- Chat iCon -->
<div class="ec-chat-icon">
<i class="fa fa-whatsapp"></i>
</div>
</div>
</a>
</li>
<!--/ End Single Contact List -->
<!-- Start Single Contact List -->
<li>
<a class="ec-list" data-number="918866774266" data-message="Please help me! I have got wrong product - ORDER ID is : #654321485">
<div class="d-flex bd-highlight">
<!-- Profile Picture -->
<div class="ec-img-cont">
<img loading="lazy" src="assets/images/whatsapp/profile_04.jpg" class="ec-user-img" alt="Profile image">
<span class="ec-status-icon ec-offline"></span>
</div>
<!-- Display Name & Last Seen -->
<div class="ec-user-info">
<span>Khadija Mehr</span>
<p>Khadija left 50 mins ago</p>
</div>
<!-- Chat iCon -->
<div class="ec-chat-icon">
<i class="fa fa-whatsapp"></i>
</div>
</div>
</a>
</li>
<!--/ End Single Contact List -->
</ul>
</div>
</div>
<!--/ End Floating Panel Container -->
<!-- Start Right Floating Button-->
<div class="ec-right-bottom">
<div class="ec-box">
<div class="ec-button rotateBackward">
<img loading="lazy" class="whatsapp" src="assets/images/common/whatsapp.png" alt="whatsapp icon" />
</div>
</div>
</div>
<!--/ End Right Floating Button-->
</div>
<!-- Whatsapp end -->
<!-- Feature tools -->
<div class="ec-tools-sidebar-overlay"></div>

View File

@ -17,7 +17,21 @@ if ($_SESSION["userId"] <> "") {
$order_ids = [];
if ($cartItems) {
$cartencode = json_encode($cartItems);
if(!empty($_GET['selected'])){
$selectedIds = explode('-', $_GET['selected']);
// Filter $cartItems array based on selected ids
$filteredCartItems = array_filter($cartItems, function($item) use ($selectedIds) {
return in_array($item['_id'], $selectedIds);
});
$cartItems = $filteredCartItems;
$cartencode = json_encode($filteredCartItems);
}else{
// $cartItems = $filteredCartItems;
$cartencode = json_encode($cartItems);
}
foreach ($cartItems as $item) {
array_push($order_ids, $item['_id']);
}
@ -68,7 +82,10 @@ if (isset($customer_data[0]["address"]) && is_array($customer_data[0]["address"]
<meta name="msapplication-TileImage" content="assets/images/favicon/favicon.png" />
<!-- css Icon Font -->
<link rel="stylesheet" href="assets/css/vendor/ecicons.min.css" />
<link rel="stylesheet" href="assets/css/vendor/ecicons.min.css" />
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.2/css/all.min.css"
integrity="sha512-SnH5WK+bZxgPHs44uWIX+LLJAJ9/2PkPKZ5QiAj6Ta86w+fsb2TkcmfRyVX3pBnMFcV7oQPJkl9QevSCWr3W6A=="
crossorigin="anonymous" referrerpolicy="no-referrer" />
<!-- css All Plugins Files -->
<link rel="stylesheet" href="assets/css/plugins/animate.css" />
@ -226,13 +243,9 @@ if (isset($customer_data[0]["address"]) && is_array($customer_data[0]["address"]
<div class="sName">
<h5>Name:
<span id="selectedFName"><?php echo strtoupper($customer['address'][0]['first_name']); ?></span>
<span id="selectedLName"><?php echo strtoupper($customer['address'][0]['last_name']); ?></span>
</h5>
<!-- <h5>Name:
<span id="selectedFName"><?php echo $customer['address'][0]['first_name']; ?></span>
<span id="selectedLName"> <?php echo $customer['address'][0]['last_name']; ?></span>
</h5> -->
<span id="selectedLName"><?php echo $customer['address'][0]['last_name']; ?></span>
</h5>
</div>
<div class="sContact">
<h5>Contact #:
@ -389,7 +402,7 @@ if (isset($customer_data[0]["address"]) && is_array($customer_data[0]["address"]
</div>
<div class="form-group">
<label for="addressContact" class="text-dark font-weight-medium pt-3 mb-2">Contact Number</label>
<input type="number" class="form-control" id="addressContact">
<input type="text" class="form-control" id="addressContact" value="+63 " oninput="preventErasePrefix(this)">
</div>
<div class="form-group">
<label for="addressBuilding" class="text-dark font-weight-medium pt-3 mb-2"> Building,Number </label>
@ -419,7 +432,7 @@ if (isset($customer_data[0]["address"]) && is_array($customer_data[0]["address"]
</div>
<div class="form-group">
<label for="addressCountry" class="text-dark font-weight-medium pt-3 mb-2">Country</label>
<input type="text" class="form-control" id="addressCountry">
<input type="text" class="form-control" id="addressCountry" value="Philippines">
</div>
<button type="button" class="btn btn-primary" id="submitBtn">Submit</button>
</form>
@ -452,7 +465,7 @@ if (isset($customer_data[0]["address"]) && is_array($customer_data[0]["address"]
<div class="form-group">
<label for="addressContact" class="text-dark font-weight-medium pt-3 mb-2">Contact Number</label>
<input type="text" class="form-control" id="addressContact2" value="<?php echo $address['phone']; ?>">
<input type="text" class="form-control" id="addressContact2" value="<?php echo $address['phone']; ?>" oninput="preventEraseThePrefix(this)">
<!-- <label for="addressContact" class="text-dark font-weight-medium pt-3 mb-2">Contact Number</label>
@ -512,6 +525,39 @@ if (isset($customer_data[0]["address"]) && is_array($customer_data[0]["address"]
</div>
</div>
<script>
function preventErasePrefix(input) { /* secondmodal */
var numericValue = input.value.replace(/\D/g, '');
if (numericValue.startsWith('63')) {
input.value = "+63 " + numericValue.substring(2);
} else {
input.value = "+63 " + numericValue;
}
if (input.value.length > 14) {
input.value = input.value.slice(0, 14);
}
}
function preventEraseThePrefix(input) { /* thirdmodal */
var numericValue = input.value.replace(/\D/g, '');
if (numericValue.startsWith('63')) {
input.value = "+63 " + numericValue.substring(2);
} else {
input.value = "+63 " + numericValue;
}
if (input.value.length > 14) {
input.value = input.value.slice(0, 14);
}
}
</script>
<script>
// raymart/sir mark added function to show the addresses of the customer in the third modal march 04 2024
$('#thirdModal').on('shown.bs.modal', function (event) {
@ -1455,6 +1501,21 @@ if (isset($customer_data[0]["address"]) && is_array($customer_data[0]["address"]
const randomIndex = Math.floor(Math.random() * refchar.length);
uniqueRef += refchar.charAt(randomIndex);
}
let paymentDeetsId = 'obn_cod_id_';
for (let i = 0; i < 16; i++) {
const randomIndex = Math.floor(Math.random() * refchar.length);
paymentDeetsId += refchar.charAt(randomIndex);
}
let paymentUniqueId = '';
for (let i = 0; i < 24; i++) {
const randomIndex = Math.floor(Math.random() * refchar.length);
paymentUniqueId += refchar.charAt(randomIndex);
}
let dataPaymentUniqueId = '';
for (let i = 0; i < 24; i++) {
const randomIndex = Math.floor(Math.random() * refchar.length);
dataPaymentUniqueId += refchar.charAt(randomIndex);
}
const selectedFName = document.getElementById('selectedFName').innerText;
const selectedLName = document.getElementById('selectedLName').innerText;
@ -1521,6 +1582,54 @@ if (isset($customer_data[0]["address"]) && is_array($customer_data[0]["address"]
payment: {
status: "UNPAID",
reference_number: uniqueRef,
details: [
{
id: paymentDeetsId,
attributes:{
data:{
attributes:{
amount: parseFloat(orderId.total_amount) * 100 ,
description: orderId.items[0].product.name + " (" + orderId.items[0].quantity + ")" ,
status: "unpaid",
fee:shippingFees * 100,
tax_amount:"null",
taxes:[],
reference_number: uniqueRef,
payments:[
{
attributes:{
billing:{
phone: billingNumber
},
source: {
type: "Cash On Delivery"
},
amount:parseFloat(orderId.total_amount) * 100,
currency: "PHP",
description: orderId.items[0].product.name + " (" + orderId.items[0].quantity + ")" ,
fee:shippingFees,
net_amount: parseFloat(orderId.total_amount) * 100,
statement_descriptor: "Obanana E-commerce Checkout",
status: "unpaid",
tax_amount:0,
refunds: [],
},
_id: paymentUniqueId,
createdAt: iso8601String,
updatedAt: iso8601String
}
],
currency:"PHP",
},
_id:dataPaymentUniqueId,
createdAt: iso8601String,
updatedAt: iso8601String
},
created_at: iso8601String,
updated_at: iso8601String
}
}
]
},
total_amount: parseFloat(orderId.total_amount) + shippingFees,
status: "TO PAY",
@ -1998,121 +2107,7 @@ if (isset($customer_data[0]["address"]) && is_array($customer_data[0]["address"]
</div>
<!-- Cart Floating Button end -->
<!-- Whatsapp -->
<div class="ec-style ec-right-bottom">
<!-- Start Floating Panel Container -->
<div class="ec-panel">
<!-- Panel Header -->
<div class="ec-header">
<strong>Need Help?</strong>
<p>Chat with us on WhatsApp</p>
</div>
<!-- Panel Content -->
<div class="ec-body">
<ul>
<!-- Start Single Contact List -->
<li>
<a class="ec-list" data-number="918866774266" data-message="Please help me! I have got wrong product - ORDER ID is : #654321485">
<div class="d-flex bd-highlight">
<!-- Profile Picture -->
<div class="ec-img-cont">
<img loading="lazy" src="assets/images/whatsapp/profile_01.jpg" class="ec-user-img" alt="Profile image">
<span class="ec-status-icon"></span>
</div>
<!-- Display Name & Last Seen -->
<div class="ec-user-info">
<span>Sahar Darya</span>
<p>Sahar left 7 mins ago</p>
</div>
<!-- Chat iCon -->
<div class="ec-chat-icon">
<i class="fa fa-whatsapp"></i>
</div>
</div>
</a>
</li>
<!--/ End Single Contact List -->
<!-- Start Single Contact List -->
<li>
<a class="ec-list" data-number="918866774266" data-message="Please help me! I have got wrong product - ORDER ID is : #654321485">
<div class="d-flex bd-highlight">
<!-- Profile Picture -->
<div class="ec-img-cont">
<img loading="lazy" src="assets/images/whatsapp/profile_02.jpg" class="ec-user-img" alt="Profile image">
<span class="ec-status-icon ec-online"></span>
</div>
<!-- Display Name & Last Seen -->
<div class="ec-user-info">
<span>Yolduz Rafi</span>
<p>Yolduz is online</p>
</div>
<!-- Chat iCon -->
<div class="ec-chat-icon">
<i class="fa fa-whatsapp"></i>
</div>
</div>
</a>
</li>
<!--/ End Single Contact List -->
<!-- Start Single Contact List -->
<li>
<a class="ec-list" data-number="918866774266" data-message="Please help me! I have got wrong product - ORDER ID is : #654321485">
<div class="d-flex bd-highlight">
<!-- Profile Picture -->
<div class="ec-img-cont">
<img loading="lazy" src="assets/images/whatsapp/profile_03.jpg" class="ec-user-img" alt="Profile image">
<span class="ec-status-icon ec-offline"></span>
</div>
<!-- Display Name & Last Seen -->
<div class="ec-user-info">
<span>Nargis Hawa</span>
<p>Nargis left 30 mins ago</p>
</div>
<!-- Chat iCon -->
<div class="ec-chat-icon">
<i class="fa fa-whatsapp"></i>
</div>
</div>
</a>
</li>
<!--/ End Single Contact List -->
<!-- Start Single Contact List -->
<li>
<a class="ec-list" data-number="918866774266" data-message="Please help me! I have got wrong product - ORDER ID is : #654321485">
<div class="d-flex bd-highlight">
<!-- Profile Picture -->
<div class="ec-img-cont">
<img loading="lazy" src="assets/images/whatsapp/profile_04.jpg" class="ec-user-img" alt="Profile image">
<span class="ec-status-icon ec-offline"></span>
</div>
<!-- Display Name & Last Seen -->
<div class="ec-user-info">
<span>Khadija Mehr</span>
<p>Khadija left 50 mins ago</p>
</div>
<!-- Chat iCon -->
<div class="ec-chat-icon">
<i class="fa fa-whatsapp"></i>
</div>
</div>
</a>
</li>
<!--/ End Single Contact List -->
</ul>
</div>
</div>
<!--/ End Floating Panel Container -->
<!-- Start Right Floating Button-->
<div class="ec-right-bottom">
<div class="ec-box">
<div class="ec-button rotateBackward">
<img loading="lazy" class="whatsapp" src="assets/images/common/whatsapp.png" alt="whatsapp icon" />
</div>
</div>
</div>
<!--/ End Right Floating Button-->
</div>
<!-- Whatsapp end -->
<!-- Feature tools -->
<div class="ec-tools-sidebar-overlay"></div>

View File

@ -1,5 +1,8 @@
<!-- 02-14-2024 Stacy created this file and added contact-us-action.php -->
<?php session_start()?>
<?php
include "functions.php";
session_start()
?>
<!DOCTYPE html>
<html lang="en">
@ -21,7 +24,10 @@
<meta name="msapplication-TileImage" content="assets/images/favicon/favicon.png" />
<!-- css Icon Font -->
<link rel="stylesheet" href="assets/css/vendor/ecicons.min.css" />
<link rel="stylesheet" href="assets/css/vendor/ecicons.min.css" />
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.2/css/all.min.css"
integrity="sha512-SnH5WK+bZxgPHs44uWIX+LLJAJ9/2PkPKZ5QiAj6Ta86w+fsb2TkcmfRyVX3pBnMFcV7oQPJkl9QevSCWr3W6A=="
crossorigin="anonymous" referrerpolicy="no-referrer" />
<!-- css All Plugins Files -->
<link rel="stylesheet" href="assets/css/plugins/animate.css" />
@ -312,129 +318,7 @@
</div>
<!-- Cart Floating Button end -->
<!-- Whatsapp -->
<div class="ec-style ec-right-bottom">
<!-- Start Floating Panel Container -->
<div class="ec-panel">
<!-- Panel Header -->
<div class="ec-header">
<strong>Need Help?</strong>
<p>Chat with us on WhatsApp</p>
</div>
<!-- Panel Content -->
<div class="ec-body">
<ul>
<!-- Start Single Contact List -->
<li>
<a class="ec-list" data-number="918866774266"
data-message="Please help me! I have got wrong product - ORDER ID is : #654321485">
<div class="d-flex bd-highlight">
<!-- Profile Picture -->
<div class="ec-img-cont">
<img loading="lazy" src="assets/images/whatsapp/profile_01.jpg" class="ec-user-img"
alt="Profile image">
<span class="ec-status-icon"></span>
</div>
<!-- Display Name & Last Seen -->
<div class="ec-user-info">
<span>Sahar Darya</span>
<p>Sahar left 7 mins ago</p>
</div>
<!-- Chat iCon -->
<div class="ec-chat-icon">
<i class="fa fa-whatsapp"></i>
</div>
</div>
</a>
</li>
<!--/ End Single Contact List -->
<!-- Start Single Contact List -->
<li>
<a class="ec-list" data-number="918866774266"
data-message="Please help me! I have got wrong product - ORDER ID is : #654321485">
<div class="d-flex bd-highlight">
<!-- Profile Picture -->
<div class="ec-img-cont">
<img loading="lazy" src="assets/images/whatsapp/profile_02.jpg" class="ec-user-img"
alt="Profile image">
<span class="ec-status-icon ec-online"></span>
</div>
<!-- Display Name & Last Seen -->
<div class="ec-user-info">
<span>Yolduz Rafi</span>
<p>Yolduz is online</p>
</div>
<!-- Chat iCon -->
<div class="ec-chat-icon">
<i class="fa fa-whatsapp"></i>
</div>
</div>
</a>
</li>
<!--/ End Single Contact List -->
<!-- Start Single Contact List -->
<li>
<a class="ec-list" data-number="918866774266"
data-message="Please help me! I have got wrong product - ORDER ID is : #654321485">
<div class="d-flex bd-highlight">
<!-- Profile Picture -->
<div class="ec-img-cont">
<img loading="lazy" src="assets/images/whatsapp/profile_03.jpg" class="ec-user-img"
alt="Profile image">
<span class="ec-status-icon ec-offline"></span>
</div>
<!-- Display Name & Last Seen -->
<div class="ec-user-info">
<span>Nargis Hawa</span>
<p>Nargis left 30 mins ago</p>
</div>
<!-- Chat iCon -->
<div class="ec-chat-icon">
<i class="fa fa-whatsapp"></i>
</div>
</div>
</a>
</li>
<!--/ End Single Contact List -->
<!-- Start Single Contact List -->
<li>
<a class="ec-list" data-number="918866774266"
data-message="Please help me! I have got wrong product - ORDER ID is : #654321485">
<div class="d-flex bd-highlight">
<!-- Profile Picture -->
<div class="ec-img-cont">
<img loading="lazy" src="assets/images/whatsapp/profile_04.jpg" class="ec-user-img"
alt="Profile image">
<span class="ec-status-icon ec-offline"></span>
</div>
<!-- Display Name & Last Seen -->
<div class="ec-user-info">
<span>Khadija Mehr</span>
<p>Khadija left 50 mins ago</p>
</div>
<!-- Chat iCon -->
<div class="ec-chat-icon">
<i class="fa fa-whatsapp"></i>
</div>
</div>
</a>
</li>
<!--/ End Single Contact List -->
</ul>
</div>
</div>
<!--/ End Floating Panel Container -->
<!-- Start Right Floating Button-->
<div class="ec-right-bottom">
<div class="ec-box">
<div class="ec-button rotateBackward">
<img loading="lazy" class="whatsapp" src="assets/images/common/whatsapp.png" alt="whatsapp icon" />
</div>
</div>
</div>
<!--/ End Right Floating Button-->
</div>
<!-- Whatsapp end -->
<!-- Feature tools -->
<div class="ec-tools-sidebar-overlay"></div>

129
faq.php
View File

@ -18,7 +18,10 @@
<meta name="msapplication-TileImage" content="assets/images/favicon/favicon.png" />
<!-- css Icon Font -->
<link rel="stylesheet" href="assets/css/vendor/ecicons.min.css" />
<link rel="stylesheet" href="assets/css/vendor/ecicons.min.css" />
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.2/css/all.min.css"
integrity="sha512-SnH5WK+bZxgPHs44uWIX+LLJAJ9/2PkPKZ5QiAj6Ta86w+fsb2TkcmfRyVX3pBnMFcV7oQPJkl9QevSCWr3W6A=="
crossorigin="anonymous" referrerpolicy="no-referrer" />
<!-- css All Plugins Files -->
<link rel="stylesheet" href="assets/css/plugins/animate.css" />
@ -471,129 +474,7 @@
</div>
<!-- Cart Floating Button end -->
<!-- Whatsapp -->
<div class="ec-style ec-right-bottom">
<!-- Start Floating Panel Container -->
<div class="ec-panel">
<!-- Panel Header -->
<div class="ec-header">
<strong>Need Help?</strong>
<p>Chat with us on WhatsApp</p>
</div>
<!-- Panel Content -->
<div class="ec-body">
<ul>
<!-- Start Single Contact List -->
<li>
<a class="ec-list" data-number="918866774266"
data-message="Please help me! I have got wrong product - ORDER ID is : #654321485">
<div class="d-flex bd-highlight">
<!-- Profile Picture -->
<div class="ec-img-cont">
<img loading="lazy" src="assets/images/whatsapp/profile_01.jpg" class="ec-user-img"
alt="Profile image">
<span class="ec-status-icon"></span>
</div>
<!-- Display Name & Last Seen -->
<div class="ec-user-info">
<span>Sahar Darya</span>
<p>Sahar left 7 mins ago</p>
</div>
<!-- Chat iCon -->
<div class="ec-chat-icon">
<i class="fa fa-whatsapp"></i>
</div>
</div>
</a>
</li>
<!--/ End Single Contact List -->
<!-- Start Single Contact List -->
<li>
<a class="ec-list" data-number="918866774266"
data-message="Please help me! I have got wrong product - ORDER ID is : #654321485">
<div class="d-flex bd-highlight">
<!-- Profile Picture -->
<div class="ec-img-cont">
<img loading="lazy" src="assets/images/whatsapp/profile_02.jpg" class="ec-user-img"
alt="Profile image">
<span class="ec-status-icon ec-online"></span>
</div>
<!-- Display Name & Last Seen -->
<div class="ec-user-info">
<span>Yolduz Rafi</span>
<p>Yolduz is online</p>
</div>
<!-- Chat iCon -->
<div class="ec-chat-icon">
<i class="fa fa-whatsapp"></i>
</div>
</div>
</a>
</li>
<!--/ End Single Contact List -->
<!-- Start Single Contact List -->
<li>
<a class="ec-list" data-number="918866774266"
data-message="Please help me! I have got wrong product - ORDER ID is : #654321485">
<div class="d-flex bd-highlight">
<!-- Profile Picture -->
<div class="ec-img-cont">
<img loading="lazy" src="assets/images/whatsapp/profile_03.jpg" class="ec-user-img"
alt="Profile image">
<span class="ec-status-icon ec-offline"></span>
</div>
<!-- Display Name & Last Seen -->
<div class="ec-user-info">
<span>Nargis Hawa</span>
<p>Nargis left 30 mins ago</p>
</div>
<!-- Chat iCon -->
<div class="ec-chat-icon">
<i class="fa fa-whatsapp"></i>
</div>
</div>
</a>
</li>
<!--/ End Single Contact List -->
<!-- Start Single Contact List -->
<li>
<a class="ec-list" data-number="918866774266"
data-message="Please help me! I have got wrong product - ORDER ID is : #654321485">
<div class="d-flex bd-highlight">
<!-- Profile Picture -->
<div class="ec-img-cont">
<img loading="lazy" src="assets/images/whatsapp/profile_04.jpg" class="ec-user-img"
alt="Profile image">
<span class="ec-status-icon ec-offline"></span>
</div>
<!-- Display Name & Last Seen -->
<div class="ec-user-info">
<span>Khadija Mehr</span>
<p>Khadija left 50 mins ago</p>
</div>
<!-- Chat iCon -->
<div class="ec-chat-icon">
<i class="fa fa-whatsapp"></i>
</div>
</div>
</a>
</li>
<!--/ End Single Contact List -->
</ul>
</div>
</div>
<!--/ End Floating Panel Container -->
<!-- Start Right Floating Button-->
<div class="ec-right-bottom">
<div class="ec-box">
<div class="ec-button rotateBackward">
<img loading="lazy" class="whatsapp" src="assets/images/common/whatsapp.png" alt="whatsapp icon" />
</div>
</div>
</div>
<!--/ End Right Floating Button-->
</div>
<!-- Whatsapp end -->
<!-- Feature tools -->
<div class="ec-tools-sidebar-overlay"></div>

View File

@ -1,3 +1,7 @@
<style>
</style>
<!-- Footer Start -->
<footer class="ec-footer section-space-mt">
<div class="footer-container">
@ -16,13 +20,18 @@
<div class="row">
<div class="col-sm-12 col-lg-3 ec-footer-contact">
<div class="ec-footer-widget">
<div class="ec-footer-logo"><a href="index.php"><img loading="lazy" src="assets/images/logo/logo.png" alt=""><img loading="lazy" class="dark-footer-logo" src="assets/images/logo/dark-logo.png" alt="Site Logo" style="display: none;" /></a></div>
<div class="ec-footer-logo"><a href="index.php"><img loading="lazy"
src="assets/images/logo/logo.png" alt=""><img loading="lazy"
class="dark-footer-logo" src="assets/images/logo/logo.png" alt="Site Logo"
style="display: none;" /></a></div>
<h4 class="ec-footer-heading">Contact us</h4>
<div class="ec-footer-links">
<ul class="align-items-center">
<li class="ec-footer-link">16F PMI Tower,Makati, Makati, Philippines</li>
<li class="ec-footer-link"><span>Call Us:</span><a href="Mobile:+63 917 722 6002">+63 (2) 8807-6379</a></li>
<li class="ec-footer-link"><span>Email:</span><a href="mailto:sales@obanana.com">sales@obanana.com</a></li>
<li class="ec-footer-link"><span>Call Us:</span><a
href="Mobile:+63 (2) 8807-6379">+63 (2) 8807-6379</a></li>
<li class="ec-footer-link"><span>Email:</span><a
href="mailto:sales@obanana.com">sales@obanana.com</a></li>
</ul>
</div>
</div>
@ -36,9 +45,9 @@
<li class="ec-footer-link"><a href="faq.php">FAQ</a></li>
<!-- <li class="ec-footer-link"><a href="track-order.html">Delivery Information</a></li> -->
<!-- <li class="ec-footer-link"><a href="contact-us.html">Contact us</a></li> -->
<!-- 02-16-2024 Stacy changed contact us link-->
<li class="ec-footer-link"><a href="contact-us.php">Contact us</a></li>
<!-- 02-16-2024 Stacy changed contact us link-->
<!-- 02-16-2024 Stacy changed contact us link-->
<li class="ec-footer-link"><a href="contact-us.php">Contact us</a></li>
<!-- 02-16-2024 Stacy changed contact us link-->
</ul>
</div>
</div>
@ -55,35 +64,37 @@
if ($_SESSION["isVendor"]) {
?>
<li class="ec-footer-link"><a href="vendor-settings.php">My Account</a></li>
<?php
<?php
} else {
?>
<li class="ec-footer-link"><a href="user-profile.php">My Account</a></li>
<?php
<?php
}
?>
<?php
<?php
}
?>
<!-- <li class="ec-footer-link"><a href="track-order.html">Order History</a></li> -->
<?php
<!-- <li class="ec-footer-link"><a href="track-order.html">Order History</a></li> -->
<?php
if ($_SESSION["isLoggedIn"]) {
?><?php
if ($_SESSION["isVendor"]) {
?>
<li class="ec-footer-link"><a href="vendor-dashboard.php">Order History</a></li>
<?php
<?php
} else {
?>
<li class="ec-footer-link"><a href="user-profile.php">Order History</a></li>
<?php
<?php
}
?>
<?php
<?php
}
?>
<li class="ec-footer-link"><a href="wishlist.php">Wish List</a></li>
<li class="ec-footer-link"><a href="vendor-registration-steps.php">Vendor Registration</a></li>
<li class="ec-footer-link"><a href="wishlist.php">Wish List</a></li>
<li class="ec-footer-link"><a href="vendor-registration-steps.php">Vendor
Registration</a></li>
</ul>
</div>
</div>
@ -117,8 +128,11 @@
<div class="ec-subscribe-form">
<form id="ec-newsletter-form" name="ec-newsletter-form" method="post" action="#">
<div id="ec_news_signup" class="ec-form">
<input class="ec-email" type="email" required="" placeholder="Enter your email here..." name="ec-email" value="" />
<button id="ec-news-btn" class="button btn-primary" type="submit" name="subscribe" value=""><i class="ecicon eci-paper-plane-o" aria-hidden="true"></i></button>
<input class="ec-email" type="email" required=""
placeholder="Enter your email here..." name="ec-email" value="" />
<button id="ec-news-btn" class="button btn-primary" type="submit"
name="subscribe" value=""><i class="ecicon eci-paper-plane-o"
aria-hidden="true"></i></button>
</div>
</form>
</div>
@ -136,10 +150,18 @@
<div class="footer-bottom-social">
<span class="social-text text-upper">Follow us on:</span>
<ul class="mb-0">
<li class="list-inline-item"><a class="hdr-facebook" href="#"><i class="ecicon eci-facebook"></i></a></li>
<li class="list-inline-item"><a class="hdr-twitter" href="#"><i class="ecicon eci-twitter"></i></a></li>
<li class="list-inline-item"><a class="hdr-instagram" href="#"><i class="ecicon eci-instagram"></i></a></li>
<li class="list-inline-item"><a class="hdr-linkedin" href="#"><i class="ecicon eci-linkedin"></i></a></li>
<li class="list-inline-item"><a class="hdr-facebook"
href="https://www.facebook.com/ObananaPH/"><i
class="ecicon eci-facebook"></i></a></li>
<li class="list-inline-item"><a class="hdr-twitter"
href="https://twitter.com/obananac?lang=en"><i
class="ecicon eci-twitter"></i></a></li>
<li class="list-inline-item"><a class="hdr-instagram"
href="https://www.instagram.com/obananaph/"><i
class="ecicon eci-instagram"></i></a></li>
<li class="list-inline-item"><a class="hdr-linkedin"
href="https://ph.linkedin.com/company/obananaph"><i
class="ecicon eci-linkedin"></i></a></li>
</ul>
</div>
</div>
@ -147,7 +169,8 @@
<!-- Footer Copyright Start -->
<div class="col text-center footer-copy">
<div class="footer-bottom-copy ">
<div class="ec-copy">Copyright © 2023 <a class="site-name text-upper" href="#">Obanana<span>.</span></a>. All Rights Reserved</div>
<div class="ec-copy">Copyright © 2023 <a class="site-name text-upper"
href="#">Obanana<span>.</span></a>. All Rights Reserved</div>
</div>
</div>
<!-- Footer Copyright End -->
@ -165,5 +188,30 @@
</div>
</div>
</div>
<!-- Footer navigation panel for responsive display -->
<div class="ec-nav-toolbar">
<div class="container">
<div class="ec-nav-panel">
<!-- <div class="ec-nav-panel-icons">
<a href="#ec-mobile-menu" class="navbar-toggler-btn ec-header-btn ec-side-toggle"><i class="fi-rr-menu-burger"></i></a>
</div> -->
<div class="ec-nav-panel-icons">
<a href="cart.php" class="ec-header-btn ec-header-wishlist">
<div class="header-icon"><i class="fi-rr-shopping-bag"></i></div>
</a>
</div>
<div class="ec-nav-panel-icons">
<a href="index.php" class="ec-header-btn"><i class="fi-rr-home"></i></a>
</div>
<div class="ec-nav-panel-icons">
<a href="wishlist.php" class="ec-header-btn"><i class="fi-rr-heart"></i></a>
</div>
<div class="ec-nav-panel-icons">
<a href="#" class="ec-header-btn"><i class="fi-rr-user"></i></a>
</div>
</div>
</div>
</div>
<!-- Footer navigation panel for responsive display -->
</footer>
<!-- Footer Area End -->

View File

@ -20,7 +20,10 @@
<meta name="msapplication-TileImage" content="assets/images/favicon/favicon.png" />
<!-- css Icon Font -->
<link rel="stylesheet" href="assets/css/vendor/ecicons.min.css" />
<link rel="stylesheet" href="assets/css/vendor/ecicons.min.css" />
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.2/css/all.min.css"
integrity="sha512-SnH5WK+bZxgPHs44uWIX+LLJAJ9/2PkPKZ5QiAj6Ta86w+fsb2TkcmfRyVX3pBnMFcV7oQPJkl9QevSCWr3W6A=="
crossorigin="anonymous" referrerpolicy="no-referrer" />
<!-- css All Plugins Files -->
<link rel="stylesheet" href="assets/css/plugins/animate.css" />
@ -328,121 +331,7 @@ var pass2I = document.getElementById(`passInput2`);
</div>
<!-- Cart Floating Button end -->
<!-- Whatsapp -->
<div class="ec-style ec-right-bottom">
<!-- Start Floating Panel Container -->
<div class="ec-panel">
<!-- Panel Header -->
<div class="ec-header">
<strong>Need Help?</strong>
<p>Chat with us on WhatsApp</p>
</div>
<!-- Panel Content -->
<div class="ec-body">
<ul>
<!-- Start Single Contact List -->
<li>
<a class="ec-list" data-number="918866774266" data-message="Please help me! I have got wrong product - ORDER ID is : #654321485">
<div class="d-flex bd-highlight">
<!-- Profile Picture -->
<div class="ec-img-cont">
<img loading="lazy" src="assets/images/whatsapp/profile_01.jpg" class="ec-user-img" alt="Profile image">
<span class="ec-status-icon"></span>
</div>
<!-- Display Name & Last Seen -->
<div class="ec-user-info">
<span>Sahar Darya</span>
<p>Sahar left 7 mins ago</p>
</div>
<!-- Chat iCon -->
<div class="ec-chat-icon">
<i class="fa fa-whatsapp"></i>
</div>
</div>
</a>
</li>
<!--/ End Single Contact List -->
<!-- Start Single Contact List -->
<li>
<a class="ec-list" data-number="918866774266" data-message="Please help me! I have got wrong product - ORDER ID is : #654321485">
<div class="d-flex bd-highlight">
<!-- Profile Picture -->
<div class="ec-img-cont">
<img loading="lazy" src="assets/images/whatsapp/profile_02.jpg" class="ec-user-img" alt="Profile image">
<span class="ec-status-icon ec-online"></span>
</div>
<!-- Display Name & Last Seen -->
<div class="ec-user-info">
<span>Yolduz Rafi</span>
<p>Yolduz is online</p>
</div>
<!-- Chat iCon -->
<div class="ec-chat-icon">
<i class="fa fa-whatsapp"></i>
</div>
</div>
</a>
</li>
<!--/ End Single Contact List -->
<!-- Start Single Contact List -->
<li>
<a class="ec-list" data-number="918866774266" data-message="Please help me! I have got wrong product - ORDER ID is : #654321485">
<div class="d-flex bd-highlight">
<!-- Profile Picture -->
<div class="ec-img-cont">
<img loading="lazy" src="assets/images/whatsapp/profile_03.jpg" class="ec-user-img" alt="Profile image">
<span class="ec-status-icon ec-offline"></span>
</div>
<!-- Display Name & Last Seen -->
<div class="ec-user-info">
<span>Nargis Hawa</span>
<p>Nargis left 30 mins ago</p>
</div>
<!-- Chat iCon -->
<div class="ec-chat-icon">
<i class="fa fa-whatsapp"></i>
</div>
</div>
</a>
</li>
<!--/ End Single Contact List -->
<!-- Start Single Contact List -->
<li>
<a class="ec-list" data-number="918866774266" data-message="Please help me! I have got wrong product - ORDER ID is : #654321485">
<div class="d-flex bd-highlight">
<!-- Profile Picture -->
<div class="ec-img-cont">
<img loading="lazy" src="assets/images/whatsapp/profile_04.jpg" class="ec-user-img" alt="Profile image">
<span class="ec-status-icon ec-offline"></span>
</div>
<!-- Display Name & Last Seen -->
<div class="ec-user-info">
<span>Khadija Mehr</span>
<p>Khadija left 50 mins ago</p>
</div>
<!-- Chat iCon -->
<div class="ec-chat-icon">
<i class="fa fa-whatsapp"></i>
</div>
</div>
</a>
</li>
<!--/ End Single Contact List -->
</ul>
</div>
</div>
<!--/ End Floating Panel Container -->
<!-- Start Right Floating Button-->
<div class="ec-right-bottom">
<div class="ec-box">
<div class="ec-button rotateBackward">
<img loading="lazy" class="whatsapp" src="assets/images/common/whatsapp.png" alt="whatsapp icon" />
</div>
</div>
</div>
<!--/ End Right Floating Button-->
</div>
<!-- Whatsapp end -->
<!-- Feature tools -->
<div class="ec-tools-sidebar-overlay"></div>

View File

@ -18,7 +18,10 @@
<meta name="msapplication-TileImage" content="assets/images/favicon/favicon.png" />
<!-- css Icon Font -->
<link rel="stylesheet" href="assets/css/vendor/ecicons.min.css" />
<link rel="stylesheet" href="assets/css/vendor/ecicons.min.css" />
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.2/css/all.min.css"
integrity="sha512-SnH5WK+bZxgPHs44uWIX+LLJAJ9/2PkPKZ5QiAj6Ta86w+fsb2TkcmfRyVX3pBnMFcV7oQPJkl9QevSCWr3W6A=="
crossorigin="anonymous" referrerpolicy="no-referrer" />
<!-- css All Plugins Files -->
<link rel="stylesheet" href="assets/css/plugins/animate.css" />
@ -162,121 +165,7 @@
</div>
<!-- Cart Floating Button end -->
<!-- Whatsapp -->
<div class="ec-style ec-right-bottom">
<!-- Start Floating Panel Container -->
<div class="ec-panel">
<!-- Panel Header -->
<div class="ec-header">
<strong>Need Help?</strong>
<p>Chat with us on WhatsApp</p>
</div>
<!-- Panel Content -->
<div class="ec-body">
<ul>
<!-- Start Single Contact List -->
<li>
<a class="ec-list" data-number="918866774266" data-message="Please help me! I have got wrong product - ORDER ID is : #654321485">
<div class="d-flex bd-highlight">
<!-- Profile Picture -->
<div class="ec-img-cont">
<img loading="lazy" src="assets/images/whatsapp/profile_01.jpg" class="ec-user-img" alt="Profile image">
<span class="ec-status-icon"></span>
</div>
<!-- Display Name & Last Seen -->
<div class="ec-user-info">
<span>Sahar Darya</span>
<p>Sahar left 7 mins ago</p>
</div>
<!-- Chat iCon -->
<div class="ec-chat-icon">
<i class="fa fa-whatsapp"></i>
</div>
</div>
</a>
</li>
<!--/ End Single Contact List -->
<!-- Start Single Contact List -->
<li>
<a class="ec-list" data-number="918866774266" data-message="Please help me! I have got wrong product - ORDER ID is : #654321485">
<div class="d-flex bd-highlight">
<!-- Profile Picture -->
<div class="ec-img-cont">
<img loading="lazy" src="assets/images/whatsapp/profile_02.jpg" class="ec-user-img" alt="Profile image">
<span class="ec-status-icon ec-online"></span>
</div>
<!-- Display Name & Last Seen -->
<div class="ec-user-info">
<span>Yolduz Rafi</span>
<p>Yolduz is online</p>
</div>
<!-- Chat iCon -->
<div class="ec-chat-icon">
<i class="fa fa-whatsapp"></i>
</div>
</div>
</a>
</li>
<!--/ End Single Contact List -->
<!-- Start Single Contact List -->
<li>
<a class="ec-list" data-number="918866774266" data-message="Please help me! I have got wrong product - ORDER ID is : #654321485">
<div class="d-flex bd-highlight">
<!-- Profile Picture -->
<div class="ec-img-cont">
<img loading="lazy" src="assets/images/whatsapp/profile_03.jpg" class="ec-user-img" alt="Profile image">
<span class="ec-status-icon ec-offline"></span>
</div>
<!-- Display Name & Last Seen -->
<div class="ec-user-info">
<span>Nargis Hawa</span>
<p>Nargis left 30 mins ago</p>
</div>
<!-- Chat iCon -->
<div class="ec-chat-icon">
<i class="fa fa-whatsapp"></i>
</div>
</div>
</a>
</li>
<!--/ End Single Contact List -->
<!-- Start Single Contact List -->
<li>
<a class="ec-list" data-number="918866774266" data-message="Please help me! I have got wrong product - ORDER ID is : #654321485">
<div class="d-flex bd-highlight">
<!-- Profile Picture -->
<div class="ec-img-cont">
<img loading="lazy" src="assets/images/whatsapp/profile_04.jpg" class="ec-user-img" alt="Profile image">
<span class="ec-status-icon ec-offline"></span>
</div>
<!-- Display Name & Last Seen -->
<div class="ec-user-info">
<span>Khadija Mehr</span>
<p>Khadija left 50 mins ago</p>
</div>
<!-- Chat iCon -->
<div class="ec-chat-icon">
<i class="fa fa-whatsapp"></i>
</div>
</div>
</a>
</li>
<!--/ End Single Contact List -->
</ul>
</div>
</div>
<!--/ End Floating Panel Container -->
<!-- Start Right Floating Button-->
<div class="ec-right-bottom">
<div class="ec-box">
<div class="ec-button rotateBackward">
<img loading="lazy" class="whatsapp" src="assets/images/common/whatsapp.png" alt="whatsapp icon" />
</div>
</div>
</div>
<!--/ End Right Floating Button-->
</div>
<!-- Whatsapp end -->
<!-- Feature tools -->
<div class="ec-tools-sidebar-overlay"></div>

View File

@ -19,7 +19,10 @@
<meta name="msapplication-TileImage" content="assets/images/favicon/favicon.png" />
<!-- css Icon Font -->
<link rel="stylesheet" href="assets/css/vendor/ecicons.min.css" />
<link rel="stylesheet" href="assets/css/vendor/ecicons.min.css" />
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.2/css/all.min.css"
integrity="sha512-SnH5WK+bZxgPHs44uWIX+LLJAJ9/2PkPKZ5QiAj6Ta86w+fsb2TkcmfRyVX3pBnMFcV7oQPJkl9QevSCWr3W6A=="
crossorigin="anonymous" referrerpolicy="no-referrer" />
<!-- css All Plugins Files -->
<link rel="stylesheet" href="assets/css/plugins/animate.css" />
@ -247,129 +250,7 @@
</div>
<!-- Cart Floating Button end -->
<!-- Whatsapp -->
<div class="ec-style ec-right-bottom">
<!-- Start Floating Panel Container -->
<div class="ec-panel">
<!-- Panel Header -->
<div class="ec-header">
<strong>Need Help?</strong>
<p>Chat with us on WhatsApp</p>
</div>
<!-- Panel Content -->
<div class="ec-body">
<ul>
<!-- Start Single Contact List -->
<li>
<a class="ec-list" data-number="918866774266"
data-message="Please help me! I have got wrong product - ORDER ID is : #654321485">
<div class="d-flex bd-highlight">
<!-- Profile Picture -->
<div class="ec-img-cont">
<img loading="lazy" src="assets/images/whatsapp/profile_01.jpg" class="ec-user-img"
alt="Profile image">
<span class="ec-status-icon"></span>
</div>
<!-- Display Name & Last Seen -->
<div class="ec-user-info">
<span>Sahar Darya</span>
<p>Sahar left 7 mins ago</p>
</div>
<!-- Chat iCon -->
<div class="ec-chat-icon">
<i class="fa fa-whatsapp"></i>
</div>
</div>
</a>
</li>
<!--/ End Single Contact List -->
<!-- Start Single Contact List -->
<li>
<a class="ec-list" data-number="918866774266"
data-message="Please help me! I have got wrong product - ORDER ID is : #654321485">
<div class="d-flex bd-highlight">
<!-- Profile Picture -->
<div class="ec-img-cont">
<img loading="lazy" src="assets/images/whatsapp/profile_02.jpg" class="ec-user-img"
alt="Profile image">
<span class="ec-status-icon ec-online"></span>
</div>
<!-- Display Name & Last Seen -->
<div class="ec-user-info">
<span>Yolduz Rafi</span>
<p>Yolduz is online</p>
</div>
<!-- Chat iCon -->
<div class="ec-chat-icon">
<i class="fa fa-whatsapp"></i>
</div>
</div>
</a>
</li>
<!--/ End Single Contact List -->
<!-- Start Single Contact List -->
<li>
<a class="ec-list" data-number="918866774266"
data-message="Please help me! I have got wrong product - ORDER ID is : #654321485">
<div class="d-flex bd-highlight">
<!-- Profile Picture -->
<div class="ec-img-cont">
<img loading="lazy" src="assets/images/whatsapp/profile_03.jpg" class="ec-user-img"
alt="Profile image">
<span class="ec-status-icon ec-offline"></span>
</div>
<!-- Display Name & Last Seen -->
<div class="ec-user-info">
<span>Nargis Hawa</span>
<p>Nargis left 30 mins ago</p>
</div>
<!-- Chat iCon -->
<div class="ec-chat-icon">
<i class="fa fa-whatsapp"></i>
</div>
</div>
</a>
</li>
<!--/ End Single Contact List -->
<!-- Start Single Contact List -->
<li>
<a class="ec-list" data-number="918866774266"
data-message="Please help me! I have got wrong product - ORDER ID is : #654321485">
<div class="d-flex bd-highlight">
<!-- Profile Picture -->
<div class="ec-img-cont">
<img loading="lazy" src="assets/images/whatsapp/profile_04.jpg" class="ec-user-img"
alt="Profile image">
<span class="ec-status-icon ec-offline"></span>
</div>
<!-- Display Name & Last Seen -->
<div class="ec-user-info">
<span>Khadija Mehr</span>
<p>Khadija left 50 mins ago</p>
</div>
<!-- Chat iCon -->
<div class="ec-chat-icon">
<i class="fa fa-whatsapp"></i>
</div>
</div>
</a>
</li>
<!--/ End Single Contact List -->
</ul>
</div>
</div>
<!--/ End Floating Panel Container -->
<!-- Start Right Floating Button-->
<div class="ec-right-bottom">
<div class="ec-box">
<div class="ec-button rotateBackward">
<img loading="lazy" class="whatsapp" src="assets/images/common/whatsapp.png" alt="whatsapp icon" />
</div>
</div>
</div>
<!--/ End Right Floating Button-->
</div>
<!-- Whatsapp end -->
<!-- Feature tools -->
<div class="ec-tools-sidebar-overlay"></div>

View File

@ -24,7 +24,7 @@ $_SESSION["email"] = $_POST["name"];
// Check if the customer exists in the database
$result = customerExists($_SESSION["email"]);
if ($result > 0) {
if ($result) {
$forgot = forgot_password($_SESSION["email"]);
if($forgot){
header("location: forget_otp.php");

View File

@ -2010,3 +2010,48 @@ function updatePayout($token, $payoutId)
return $response;
}
function getAllCustomers ()
{
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "https://" . $_SESSION["data_endpoint"] . "/api/v1/customers",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'GET',
CURLOPT_HTTPHEADER => array(
'X-Api-Key: {{apiKey}}'
),
));
$response = curl_exec($curl);
curl_close($curl);
$json = json_decode($response, true);
return $json;
}
function getAllVendors ()
{
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "https://" . $_SESSION["data_endpoint"] . "/api/v1/vendors",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'GET',
CURLOPT_HTTPHEADER => array(
'X-Api-Key: {{apiKey}}'
),
));
$response = curl_exec($curl);
curl_close($curl);
$json = json_decode($response, true);
return $json;
}

2832
header.php

File diff suppressed because it is too large Load Diff

176
index.php
View File

@ -39,7 +39,10 @@ if ($_SESSION["userId"] <> "") {
<meta name="msapplication-TileImage" content="assets/images/favicon/favicon.png" />
<!-- css Icon Font -->
<link rel="stylesheet" href="assets/css/vendor/ecicons.min.css" />
<link rel="stylesheet" href="assets/css/vendor/ecicons.min.css" />
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.2/css/all.min.css"
integrity="sha512-SnH5WK+bZxgPHs44uWIX+LLJAJ9/2PkPKZ5QiAj6Ta86w+fsb2TkcmfRyVX3pBnMFcV7oQPJkl9QevSCWr3W6A=="
crossorigin="anonymous" referrerpolicy="no-referrer" />
<!-- css All Plugins Files -->
<link rel="stylesheet" href="assets/css/plugins/animate.css" />
@ -76,11 +79,13 @@ if ($_SESSION["userId"] <> "") {
}
</style>
<script>
function updateCartItemCount() {
function updateCartItemCount() {
$.get("cartitems.php?id=<?php echo $_SESSION['customerId']; ?>", function(data, status) {
if (data != "") {
console.log("Data: " + data + "\nStatus: " + status);
document.getElementById("cartItemCount").innerHTML = data;
document.getElementById("cartNewItemCount").innerHTML = data;
}
});
}
@ -89,6 +94,8 @@ if ($_SESSION["userId"] <> "") {
$.get("wishlistitems.php?id=<?php echo $_SESSION['customerId']; ?>", function(data) {
if (data != "") {
document.getElementById("wishItemCount").innerHTML = data;
document.getElementById("wishNewItemCount").innerHTML = data;
}
});
}
@ -187,13 +194,13 @@ if ($_SESSION["userId"] <> "") {
<!-- Tab Start -->
<div class="col-md-12 text-center">
<ul class="ec-pro-tab-nav nav justify-content-center">
<li class="nav-item"><a class="nav-link active" data-bs-toggle="tab" href="#tab-pro-for-all">For
<li class="nav-item"><a class="nav-link active" data-bs-toggle="tab" href="#all-top-products">For
All</a></li>
<li class="nav-item"><a class="nav-link" data-bs-toggle="tab" href="#tab-pro-for-men">For
<li class="nav-item"><a class="nav-link" data-bs-toggle="tab" href="#electronics">For
Electronics</a></li>
<li class="nav-item"><a class="nav-link" data-bs-toggle="tab" href="#tab-pro-for-women">For
<li class="nav-item"><a class="nav-link" data-bs-toggle="tab" href="#smart-home">For
Smart Home</a></li>
<li class="nav-item"><a class="nav-link" data-bs-toggle="tab" href="#tab-pro-for-child">For
<li class="nav-item"><a class="nav-link" data-bs-toggle="tab" href="#e-vehicle">For
E-Vehicle</a></li>
</ul>
</div>
@ -203,7 +210,7 @@ if ($_SESSION["userId"] <> "") {
<div class="col">
<div class="tab-content">
<!-- 1st Product tab start -->
<div class="tab-pane fade show active" id="tab-pro-for-all">
<div class="tab-pane fade show active" id="all-top-products">
<div class="row">
<!-- Product Content -->
<?php
@ -224,9 +231,9 @@ if ($_SESSION["userId"] <> "") {
$vendorOfProduct = getVendorbyId($forAll[$pid]['vendor_api_id']);
?>
<div class="col-lg-3 col-md-6 col-sm-6 col-xs-6 mb-6 ec-product-content" data-animation="fadeIn">
<div class="ec-product-inner" style="width: 260px;">
<div class="ec-product-inner">
<!-- raymart added style feb 26 2024 -->
<div class="ec-pro-image-outer">
<div class="ec-pro-image-outer" style="max-width: 290px; height: 350px;">
<!-- <div class="ec-pro-image-outer"> -->
<div class="ec-pro-image">
<a href="product-left-sidebar.php?id=<?php echo $forAll[$pid]["_id"]; ?>">
@ -237,7 +244,7 @@ if ($_SESSION["userId"] <> "") {
if (!empty($image_urls)) {
$first_image_url = trim($image_urls[0]);
?>
<img loading="lazy" class="main-image" src="<?php echo $first_image_url; ?>" alt="edit" style="border: 1px solid #eeeeee; height: 280px;" />
<img loading="lazy" class="main-image" src="<?php echo $first_image_url; ?>" alt="edit" style="border: 1px solid #eeeeee; height: 330px; object-fit: cover;" />
<?php
}
} else {
@ -327,7 +334,7 @@ if ($_SESSION["userId"] <> "") {
</div>
<!-- ec 1st Product tab end -->
<!-- ec 2nd Product tab start -->
<div class="tab-pane fade" id="tab-pro-for-men">
<div class="tab-pane fade" id="electronics">
<div class="row">
<!-- Product Content -->
<?php
@ -344,9 +351,9 @@ if ($_SESSION["userId"] <> "") {
$vendorOfProduct = getVendorbyId($electronics[$pid]['vendor_api_id']);
?>
<div class="col-lg-3 col-md-6 col-sm-6 col-xs-6 mb-6 ec-product-content" data-animation="fadeIn">
<div class="ec-product-inner" style="width: 260px;">
<div class="ec-product-inner">
<!-- raymart added style feb 26 2024 -->
<div class="ec-pro-image-outer">
<div class="ec-pro-image-outer" style="max-width: 290px; height: 350px;">
<!-- <div class="ec-pro-image-outer"> -->
<div class="ec-pro-image">
<a href="product-left-sidebar.php?id=<?php echo $electronics[$pid]["_id"]; ?>">
@ -357,7 +364,7 @@ if ($_SESSION["userId"] <> "") {
if (!empty($image_urls)) {
$first_image_url = trim($image_urls[0]);
?>
<img loading="lazy" class="main-image" src="<?php echo $first_image_url; ?>" alt="edit" style="border: 1px solid #eeeeee; height: 280px;" />
<img loading="lazy" class="main-image" src="<?php echo $first_image_url; ?>" alt="edit" style="border: 1px solid #eeeeee; height: 330px; object-fit: cover;" />
<?php
}
} else {
@ -449,7 +456,7 @@ if ($_SESSION["userId"] <> "") {
</div>
<!-- ec 2nd Product tab end -->
<!-- ec 3rd Product tab start -->
<div class="tab-pane fade" id="tab-pro-for-women">
<div class="tab-pane fade" id="smart-home">
<div class="row">
<!-- Product Content -->
<?php
@ -466,9 +473,9 @@ if ($_SESSION["userId"] <> "") {
$vendorOfProduct = getVendorbyId($smartHome[$pid]['vendor_api_id']);
?>
<div class="col-lg-3 col-md-6 col-sm-6 col-xs-6 mb-6 ec-product-content" data-animation="fadeIn">
<div class="ec-product-inner" style="width: 260px;">
<div class="ec-product-inner">
<!-- raymart added style feb 26 2024 -->
<div class="ec-pro-image-outer">
<div class="ec-pro-image-outer" style="max-width: 290px; height: 350px;">
<!-- <div class="ec-pro-image-outer"> -->
<div class="ec-pro-image">
<a href="product-left-sidebar.php?id=<?php echo $smartHome[$pid]["_id"]; ?>">
@ -479,7 +486,7 @@ if ($_SESSION["userId"] <> "") {
if (!empty($image_urls)) {
$first_image_url = trim($image_urls[0]);
?>
<img loading="lazy" class="main-image" src="<?php echo $first_image_url; ?>" alt="edit" style="border: 1px solid #eeeeee; height: 280px;" />
<img loading="lazy" class="main-image" src="<?php echo $first_image_url; ?>" alt="edit" style="border: 1px solid #eeeeee; height: 330px; object-fit: cover;" />
<?php
}
} else {
@ -569,7 +576,7 @@ if ($_SESSION["userId"] <> "") {
</div>
<!-- ec 3rd Product tab end -->
<!-- ec 4th Product tab start -->
<div class="tab-pane fade" id="tab-pro-for-child">
<div class="tab-pane fade" id="e-vehicle">
<div class="row">
<!-- Product Content -->
<?php
@ -586,9 +593,9 @@ if ($_SESSION["userId"] <> "") {
$vendorOfProduct = getVendorbyId($forVehicle[$pid]['vendor_api_id']);
?>
<div class="col-lg-3 col-md-6 col-sm-6 col-xs-6 mb-6 ec-product-content" data-animation="fadeIn">
<div class="ec-product-inner" style="width: 260px;">
<div class="ec-product-inner">
<!-- raymart added style feb 26 2024-->
<div class="ec-pro-image-outer">
<div class="ec-pro-image-outer" style="max-width: 290px; height: 350px;">
<!-- <div class="ec-pro-image-outer"> -->
<div class="ec-pro-image">
<a href="product-left-sidebar.php?id=<?php echo $forVehicle[$pid]["_id"]; ?>">
@ -599,7 +606,7 @@ if ($_SESSION["userId"] <> "") {
if (!empty($image_urls)) {
$first_image_url = trim($image_urls[0]);
?>
<img loading="lazy" class="main-image" src="<?php echo $first_image_url; ?>" alt="edit" style="border: 1px solid #eeeeee; height: 280px;" />
<img loading="lazy" class="main-image" src="<?php echo $first_image_url; ?>" alt="edit" style="border: 1px solid #eeeeee; height: 330px; object-fit: cover;" />
<?php
}
} else {
@ -1229,9 +1236,9 @@ if ($_SESSION["userId"] <> "") {
$vendorOfProduct = getVendorbyId($newArrival[$pid]['vendor_api_id']);
?>
<div class="col-lg-3 col-md-6 col-sm-6 col-xs-6 mb-6 ec-product-content" data-animation="flipInY">
<div class="ec-product-inner" style="width: 260px;">
<div class="ec-product-inner">
<!-- raymart added style feb 26 2024 -->
<div class="ec-pro-image-outer">
<div class="ec-pro-image-outer" style="max-width: 290px; height: 350px;">
<!-- <div class="ec-pro-image-outer"> -->
<div class="ec-pro-image">
<a href="product-left-sidebar.php?id=<?php echo $newArrival[$pid]["_id"]; ?>">
@ -1242,7 +1249,7 @@ if ($_SESSION["userId"] <> "") {
if (!empty($image_urls)) {
$first_image_url = trim($image_urls[0]);
?>
<img loading="lazy" class="main-image" src="<?php echo $first_image_url; ?>" alt="edit" style="border: 1px solid #eeeeee; height: 280px;" />
<img loading="lazy" class="main-image" src="<?php echo $first_image_url; ?>" alt="edit" style="border: 1px solid #eeeeee; height: 330px; object-fit: cover;" />
<?php
}
} else {
@ -1671,7 +1678,7 @@ if ($_SESSION["userId"] <> "") {
</div>
<!-- Newsletter Modal end -->
<!-- Footer navigation panel for responsive display -->
<div class="ec-nav-toolbar">
<!-- <div class="ec-nav-toolbar">
<div class="container">
<div class="ec-nav-panel">
<div class="ec-nav-panel-icons">
@ -1692,7 +1699,7 @@ if ($_SESSION["userId"] <> "") {
</div>
</div>
</div>
</div> -->
<!-- Footer navigation panel for responsive display end -->
<!-- Recent Purchase Popup -->
@ -1717,121 +1724,6 @@ if ($_SESSION["userId"] <> "") {
</div>
<!-- Cart Floating Button end -->
<!-- Whatsapp -->
<div class="ec-style ec-right-bottom">
<!-- Start Floating Panel Container -->
<div class="ec-panel">
<!-- Panel Header -->
<div class="ec-header">
<strong>Need Help?</strong>
<p>Chat with us on WhatsApp</p>
</div>
<!-- Panel Content -->
<div class="ec-body">
<ul>
<!-- Start Single Contact List -->
<li>
<a class="ec-list" data-number="918866774266" data-message="Please help me! I have got wrong product - ORDER ID is : #654321485">
<div class="d-flex bd-highlight">
<!-- Profile Picture -->
<div class="ec-img-cont">
<img loading="lazy" src="assets/images/whatsapp/profile_01.jpg" class="ec-user-img" alt="Profile image">
<span class="ec-status-icon"></span>
</div>
<!-- Display Name & Last Seen -->
<div class="ec-user-info">
<span>Sahar Darya</span>
<p>Sahar left 7 mins ago</p>
</div>
<!-- Chat iCon -->
<div class="ec-chat-icon">
<i class="fa fa-whatsapp"></i>
</div>
</div>
</a>
</li>
<!--/ End Single Contact List -->
<!-- Start Single Contact List -->
<li>
<a class="ec-list" data-number="918866774266" data-message="Please help me! I have got wrong product - ORDER ID is : #654321485">
<div class="d-flex bd-highlight">
<!-- Profile Picture -->
<div class="ec-img-cont">
<img loading="lazy" src="assets/images/whatsapp/profile_02.jpg" class="ec-user-img" alt="Profile image">
<span class="ec-status-icon ec-online"></span>
</div>
<!-- Display Name & Last Seen -->
<div class="ec-user-info">
<span>Yolduz Rafi</span>
<p>Yolduz is online</p>
</div>
<!-- Chat iCon -->
<div class="ec-chat-icon">
<i class="fa fa-whatsapp"></i>
</div>
</div>
</a>
</li>
<!--/ End Single Contact List -->
<!-- Start Single Contact List -->
<li>
<a class="ec-list" data-number="918866774266" data-message="Please help me! I have got wrong product - ORDER ID is : #654321485">
<div class="d-flex bd-highlight">
<!-- Profile Picture -->
<div class="ec-img-cont">
<img loading="lazy" src="assets/images/whatsapp/profile_03.jpg" class="ec-user-img" alt="Profile image">
<span class="ec-status-icon ec-offline"></span>
</div>
<!-- Display Name & Last Seen -->
<div class="ec-user-info">
<span>Nargis Hawa</span>
<p>Nargis left 30 mins ago</p>
</div>
<!-- Chat iCon -->
<div class="ec-chat-icon">
<i class="fa fa-whatsapp"></i>
</div>
</div>
</a>
</li>
<!--/ End Single Contact List -->
<!-- Start Single Contact List -->
<li>
<a class="ec-list" data-number="918866774266" data-message="Please help me! I have got wrong product - ORDER ID is : #654321485">
<div class="d-flex bd-highlight">
<!-- Profile Picture -->
<div class="ec-img-cont">
<img loading="lazy" src="assets/images/whatsapp/profile_04.jpg" class="ec-user-img" alt="Profile image">
<span class="ec-status-icon ec-offline"></span>
</div>
<!-- Display Name & Last Seen -->
<div class="ec-user-info">
<span>Khadija Mehr</span>
<p>Khadija left 50 mins ago</p>
</div>
<!-- Chat iCon -->
<div class="ec-chat-icon">
<i class="fa fa-whatsapp"></i>
</div>
</div>
</a>
</li>
<!--/ End Single Contact List -->
</ul>
</div>
</div>
<!--/ End Floating Panel Container -->
<!-- Start Right Floating Button-->
<div class="ec-right-bottom">
<div class="ec-box">
<div class="ec-button rotateBackward">
<img loading="lazy" class="whatsapp" src="assets/images/common/whatsapp.png" alt="whatsapp icon">
</div>
</div>
</div>
<!--/ End Right Floating Button-->
</div>
<!-- Whatsapp end -->
<!-- Feature tools -->
<div class="ec-tools-sidebar-overlay"></div>

129
login.php
View File

@ -21,7 +21,10 @@
<meta name="msapplication-TileImage" content="assets/images/favicon/favicon.png" />
<!-- css Icon Font -->
<link rel="stylesheet" href="assets/css/vendor/ecicons.min.css" />
<link rel="stylesheet" href="assets/css/vendor/ecicons.min.css" />
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.2/css/all.min.css"
integrity="sha512-SnH5WK+bZxgPHs44uWIX+LLJAJ9/2PkPKZ5QiAj6Ta86w+fsb2TkcmfRyVX3pBnMFcV7oQPJkl9QevSCWr3W6A=="
crossorigin="anonymous" referrerpolicy="no-referrer" />
<!-- css All Plugins Files -->
<link rel="stylesheet" href="assets/css/plugins/animate.css" />
@ -255,129 +258,7 @@
</div>
<!-- Cart Floating Button end -->
<!-- Whatsapp -->
<div class="ec-style ec-right-bottom">
<!-- Start Floating Panel Container -->
<div class="ec-panel">
<!-- Panel Header -->
<div class="ec-header">
<strong>Need Help?</strong>
<p>Chat with us on WhatsApp</p>
</div>
<!-- Panel Content -->
<div class="ec-body">
<ul>
<!-- Start Single Contact List -->
<li>
<a class="ec-list" data-number="918866774266"
data-message="Please help me! I have got wrong product - ORDER ID is : #654321485">
<div class="d-flex bd-highlight">
<!-- Profile Picture -->
<div class="ec-img-cont">
<img loading="lazy" src="assets/images/whatsapp/profile_01.jpg" class="ec-user-img"
alt="Profile image">
<span class="ec-status-icon"></span>
</div>
<!-- Display Name & Last Seen -->
<div class="ec-user-info">
<span>Sahar Darya</span>
<p>Sahar left 7 mins ago</p>
</div>
<!-- Chat iCon -->
<div class="ec-chat-icon">
<i class="fa fa-whatsapp"></i>
</div>
</div>
</a>
</li>
<!--/ End Single Contact List -->
<!-- Start Single Contact List -->
<li>
<a class="ec-list" data-number="918866774266"
data-message="Please help me! I have got wrong product - ORDER ID is : #654321485">
<div class="d-flex bd-highlight">
<!-- Profile Picture -->
<div class="ec-img-cont">
<img loading="lazy" src="assets/images/whatsapp/profile_02.jpg" class="ec-user-img"
alt="Profile image">
<span class="ec-status-icon ec-online"></span>
</div>
<!-- Display Name & Last Seen -->
<div class="ec-user-info">
<span>Yolduz Rafi</span>
<p>Yolduz is online</p>
</div>
<!-- Chat iCon -->
<div class="ec-chat-icon">
<i class="fa fa-whatsapp"></i>
</div>
</div>
</a>
</li>
<!--/ End Single Contact List -->
<!-- Start Single Contact List -->
<li>
<a class="ec-list" data-number="918866774266"
data-message="Please help me! I have got wrong product - ORDER ID is : #654321485">
<div class="d-flex bd-highlight">
<!-- Profile Picture -->
<div class="ec-img-cont">
<img loading="lazy" src="assets/images/whatsapp/profile_03.jpg" class="ec-user-img"
alt="Profile image">
<span class="ec-status-icon ec-offline"></span>
</div>
<!-- Display Name & Last Seen -->
<div class="ec-user-info">
<span>Nargis Hawa</span>
<p>Nargis left 30 mins ago</p>
</div>
<!-- Chat iCon -->
<div class="ec-chat-icon">
<i class="fa fa-whatsapp"></i>
</div>
</div>
</a>
</li>
<!--/ End Single Contact List -->
<!-- Start Single Contact List -->
<li>
<a class="ec-list" data-number="918866774266"
data-message="Please help me! I have got wrong product - ORDER ID is : #654321485">
<div class="d-flex bd-highlight">
<!-- Profile Picture -->
<div class="ec-img-cont">
<img loading="lazy" src="assets/images/whatsapp/profile_04.jpg" class="ec-user-img"
alt="Profile image">
<span class="ec-status-icon ec-offline"></span>
</div>
<!-- Display Name & Last Seen -->
<div class="ec-user-info">
<span>Khadija Mehr</span>
<p>Khadija left 50 mins ago</p>
</div>
<!-- Chat iCon -->
<div class="ec-chat-icon">
<i class="fa fa-whatsapp"></i>
</div>
</div>
</a>
</li>
<!--/ End Single Contact List -->
</ul>
</div>
</div>
<!--/ End Floating Panel Container -->
<!-- Start Right Floating Button-->
<div class="ec-right-bottom">
<div class="ec-box">
<div class="ec-button rotateBackward">
<img loading="lazy" class="whatsapp" src="assets/images/common/whatsapp.png" alt="whatsapp icon" />
</div>
</div>
</div>
<!--/ End Right Floating Button-->
</div>
<!-- Whatsapp end -->
<!-- Feature tools -->
<div class="ec-tools-sidebar-overlay"></div>

View File

@ -1,5 +1,7 @@
<?php
include "functions.php";
include "../";
$url = $_SESSION["url"];
$_SESSION["email"] = $_POST["name"];

View File

@ -33,7 +33,10 @@ $vendorSearchResult = $_SESSION["vendorSearchResult"];
<meta name="msapplication-TileImage" content="assets/images/favicon/favicon.png" />
<!-- css Icon Font -->
<link rel="stylesheet" href="assets/css/vendor/ecicons.min.css" />
<link rel="stylesheet" href="assets/css/vendor/ecicons.min.css" />
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.2/css/all.min.css"
integrity="sha512-SnH5WK+bZxgPHs44uWIX+LLJAJ9/2PkPKZ5QiAj6Ta86w+fsb2TkcmfRyVX3pBnMFcV7oQPJkl9QevSCWr3W6A=="
crossorigin="anonymous" referrerpolicy="no-referrer" />
<!-- css All Plugins Files -->
<link rel="stylesheet" href="assets/css/plugins/animate.css" />
@ -252,121 +255,7 @@ $vendorSearchResult = $_SESSION["vendorSearchResult"];
</div>
<!-- Cart Floating Button end -->
<!-- Whatsapp -->
<div class="ec-style ec-right-bottom">
<!-- Start Floating Panel Container -->
<div class="ec-panel">
<!-- Panel Header -->
<div class="ec-header">
<strong>Need Help?</strong>
<p>Chat with us on WhatsApp</p>
</div>
<!-- Panel Content -->
<div class="ec-body">
<ul>
<!-- Start Single Contact List -->
<li>
<a class="ec-list" data-number="918866774266" data-message="Please help me! I have got wrong product - ORDER ID is : #654321485">
<div class="d-flex bd-highlight">
<!-- Profile Picture -->
<div class="ec-img-cont">
<img loading="lazy" src="assets/images/whatsapp/profile_01.jpg" class="ec-user-img" alt="Profile image">
<span class="ec-status-icon"></span>
</div>
<!-- Display Name & Last Seen -->
<div class="ec-user-info">
<span>Sahar Darya</span>
<p>Sahar left 7 mins ago</p>
</div>
<!-- Chat iCon -->
<div class="ec-chat-icon">
<i class="fa fa-whatsapp"></i>
</div>
</div>
</a>
</li>
<!--/ End Single Contact List -->
<!-- Start Single Contact List -->
<li>
<a class="ec-list" data-number="918866774266" data-message="Please help me! I have got wrong product - ORDER ID is : #654321485">
<div class="d-flex bd-highlight">
<!-- Profile Picture -->
<div class="ec-img-cont">
<img loading="lazy" src="assets/images/whatsapp/profile_02.jpg" class="ec-user-img" alt="Profile image">
<span class="ec-status-icon ec-online"></span>
</div>
<!-- Display Name & Last Seen -->
<div class="ec-user-info">
<span>Yolduz Rafi</span>
<p>Yolduz is online</p>
</div>
<!-- Chat iCon -->
<div class="ec-chat-icon">
<i class="fa fa-whatsapp"></i>
</div>
</div>
</a>
</li>
<!--/ End Single Contact List -->
<!-- Start Single Contact List -->
<li>
<a class="ec-list" data-number="918866774266" data-message="Please help me! I have got wrong product - ORDER ID is : #654321485">
<div class="d-flex bd-highlight">
<!-- Profile Picture -->
<div class="ec-img-cont">
<img loading="lazy" src="assets/images/whatsapp/profile_03.jpg" class="ec-user-img" alt="Profile image">
<span class="ec-status-icon ec-offline"></span>
</div>
<!-- Display Name & Last Seen -->
<div class="ec-user-info">
<span>Nargis Hawa</span>
<p>Nargis left 30 mins ago</p>
</div>
<!-- Chat iCon -->
<div class="ec-chat-icon">
<i class="fa fa-whatsapp"></i>
</div>
</div>
</a>
</li>
<!--/ End Single Contact List -->
<!-- Start Single Contact List -->
<li>
<a class="ec-list" data-number="918866774266" data-message="Please help me! I have got wrong product - ORDER ID is : #654321485">
<div class="d-flex bd-highlight">
<!-- Profile Picture -->
<div class="ec-img-cont">
<img loading="lazy" src="assets/images/whatsapp/profile_04.jpg" class="ec-user-img" alt="Profile image">
<span class="ec-status-icon ec-offline"></span>
</div>
<!-- Display Name & Last Seen -->
<div class="ec-user-info">
<span>Khadija Mehr</span>
<p>Khadija left 50 mins ago</p>
</div>
<!-- Chat iCon -->
<div class="ec-chat-icon">
<i class="fa fa-whatsapp"></i>
</div>
</div>
</a>
</li>
<!--/ End Single Contact List -->
</ul>
</div>
</div>
<!--/ End Floating Panel Container -->
<!-- Start Right Floating Button-->
<div class="ec-right-bottom">
<div class="ec-box">
<div class="ec-button rotateBackward">
<img loading="lazy" class="whatsapp" src="assets/images/common/whatsapp.png" alt="whatsapp icon" />
</div>
</div>
</div>
<!--/ End Right Floating Button-->
</div>
<!-- Whatsapp end -->
<!-- Feature tools -->
<div class="ec-tools-sidebar-overlay"></div>

View File

@ -31,7 +31,10 @@ if ($_SESSION["userId"] <> "") {
<meta name="msapplication-TileImage" content="assets/images/favicon/favicon.png" />
<!-- css Icon Font -->
<link rel="stylesheet" href="assets/css/vendor/ecicons.min.css" />
<link rel="stylesheet" href="assets/css/vendor/ecicons.min.css" />
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.2/css/all.min.css"
integrity="sha512-SnH5WK+bZxgPHs44uWIX+LLJAJ9/2PkPKZ5QiAj6Ta86w+fsb2TkcmfRyVX3pBnMFcV7oQPJkl9QevSCWr3W6A=="
crossorigin="anonymous" referrerpolicy="no-referrer" />
<!-- css All Plugins Files -->
<link rel="stylesheet" href="assets/css/plugins/animate.css" />
@ -321,7 +324,7 @@ function loadProducts(page,isFilter) {
let product = prod;
// let vendor = prod.vendor;
let vendorOfProduct = prod.vendor;
let vendorOfProduct = prod;
// let card = document.createElement("div");
let token ="<?php echo $_SESSION['token'] ?>";
let email ="<?php echo $_SESSION['email'] ?>";
@ -334,8 +337,10 @@ function loadProducts(page,isFilter) {
let imageUrls = product.images.split(',');
let firstImageUrl = imageUrls[0].trim();
let img = document.createElement("img");
img.setAttribute("style", "width: 290px; height: 200px; object-fit: cover;");
img.setAttribute("style", "border: 1px solid #eeeeee; height: 330px; object-fit: cover;");
img.setAttribute("class", "main-image");
img.setAttribute("loading", "lazy");
img.setAttribute("src", firstImageUrl);
img.setAttribute("alt", "Product");
img.className = "main-image";
@ -343,8 +348,8 @@ function loadProducts(page,isFilter) {
} else {
let img = document.createElement("img");
img.className = "main-image";
img.setAttribute("style", "width: 290px; height: 200px; object-fit: cover;");
img.setAttribute("style", "border: 1px solid #eeeeee; height: 330px; object-fit: cover;");
img.setAttribute("loading", "lazy");
img.setAttribute("class", "main-image");
img.setAttribute("src", "https://api.obanana.com/images/storage/web_images/1709002636671-viber_image_2024-02-22_15-54-42-498.png");
img.setAttribute("alt", "Product");
@ -356,14 +361,21 @@ function loadProducts(page,isFilter) {
card.classList.add("col-lg-3", "col-md-6", "col-sm-6", "col-xs-6", "mb-6", "pro-gl-content", "width-100");
card.innerHTML = `
<div class="ec-product-inner">
<div class="ec-pro-image-outer" style="width: 290px; height: 200px;">
<div class="ec-pro-image-outer" style="max-width: 290px; height: 350px;">
<div class="ec-pro-image">
<a href="product-left-sidebar.php?id=${product._id}">
${imageContainer.innerHTML} <!-- Include the dynamically loaded image here -->
</a>
<div class="ec-pro-actions" style="bottom: -36px;">
<button title="Add To Cart" onclick="popupAddToCart('${encodeURIComponent(JSON.stringify(product))}','${encodeURIComponent(JSON.stringify(vendorOfProduct))}', '${token}', '${email}', '${password}', '${encodeURIComponent(JSON.stringify(customer_data))}');" class="add-to-cart"><i class="fi-rr-shopping-basket"></i> Add To Cart</button>
<a class="ec-btn-group wishlist" title="Wishlist" onclick="popupWishlist('${encodeURIComponent(JSON.stringify(product))}', '${encodeURIComponent(JSON.stringify(customer_data))}');"><i class="fi-rr-heart"></i></a>
${
(product["sale_price"] && product["sale_price"] > 0) ?
`<button title="Add To Cart" onclick="popupAddToCart('${encodeURIComponent(JSON.stringify(product))}','${encodeURIComponent(JSON.stringify(vendorOfProduct))}', '${token}', '${email}', '${password}', '${encodeURIComponent(JSON.stringify(customer_data))}');" class="add-to-cart"><i class="fi-rr-shopping-basket"></i> Add To Cart</button>
<a class="ec-btn-group wishlist" title="Wishlist" onclick="popupWishlist('${encodeURIComponent(JSON.stringify(product))}', '${encodeURIComponent(JSON.stringify(customer_data))}');"><i class="fi-rr-heart"></i></a>` :
(product["regular_price"] && product["regular_price"] != "") ?
`<button title="Add To Cart" onclick="popupAddToCart('${encodeURIComponent(JSON.stringify(product))}','${encodeURIComponent(JSON.stringify(vendorOfProduct))}', '${token}', '${email}', '${password}', '${encodeURIComponent(JSON.stringify(customer_data))}');" class="add-to-cart"><i class="fi-rr-shopping-basket"></i> Add To Cart</button>
<a class="ec-btn-group wishlist" title="Wishlist" onclick="popupWishlist('${encodeURIComponent(JSON.stringify(product))}', '${encodeURIComponent(JSON.stringify(customer_data))}');"><i class="fi-rr-heart"></i></a>` :
`<a class="ec-btn-group wishlist" title="Wishlist" onclick="popupWishlist('${encodeURIComponent(JSON.stringify(product))}', '${encodeURIComponent(JSON.stringify(customer_data))}');"><i class="fi-rr-heart"></i></a>`
}
</div>
</div>
</div>
@ -923,7 +935,7 @@ maxPriceInput.addEventListener('input', function() {
<!-- Modal end -->
<!-- Footer navigation panel for responsive display -->
<div class="ec-nav-toolbar">
<!-- <div class="ec-nav-toolbar">
<div class="container">
<div class="ec-nav-panel">
<div class="ec-nav-panel-icons">
@ -948,7 +960,7 @@ maxPriceInput.addEventListener('input', function() {
</div>
</div>
</div>
</div> -->
<!-- Footer navigation panel for responsive display end -->
<!-- Recent Purchase Popup -->
@ -973,129 +985,7 @@ maxPriceInput.addEventListener('input', function() {
</div>
<!-- Cart Floating Button end -->
<!-- Whatsapp -->
<div class="ec-style ec-right-bottom">
<!-- Start Floating Panel Container -->
<div class="ec-panel">
<!-- Panel Header -->
<div class="ec-header">
<strong>Need Help?</strong>
<p>Chat with us on WhatsApp</p>
</div>
<!-- Panel Content -->
<div class="ec-body">
<ul>
<!-- Start Single Contact List -->
<li>
<a class="ec-list" data-number="918866774266"
data-message="Please help me! I have got wrong product - ORDER ID is : #654321485">
<div class="d-flex bd-highlight">
<!-- Profile Picture -->
<div class="ec-img-cont">
<img loading="lazy" src="assets/images/whatsapp/profile_01.jpg" class="ec-user-img"
alt="Profile image">
<span class="ec-status-icon"></span>
</div>
<!-- Display Name & Last Seen -->
<div class="ec-user-info">
<span>Sahar Darya</span>
<p>Sahar left 7 mins ago</p>
</div>
<!-- Chat iCon -->
<div class="ec-chat-icon">
<i class="fa fa-whatsapp"></i>
</div>
</div>
</a>
</li>
<!--/ End Single Contact List -->
<!-- Start Single Contact List -->
<li>
<a class="ec-list" data-number="918866774266"
data-message="Please help me! I have got wrong product - ORDER ID is : #654321485">
<div class="d-flex bd-highlight">
<!-- Profile Picture -->
<div class="ec-img-cont">
<img loading="lazy" src="assets/images/whatsapp/profile_02.jpg" class="ec-user-img"
alt="Profile image">
<span class="ec-status-icon ec-online"></span>
</div>
<!-- Display Name & Last Seen -->
<div class="ec-user-info">
<span>Yolduz Rafi</span>
<p>Yolduz is online</p>
</div>
<!-- Chat iCon -->
<div class="ec-chat-icon">
<i class="fa fa-whatsapp"></i>
</div>
</div>
</a>
</li>
<!--/ End Single Contact List -->
<!-- Start Single Contact List -->
<li>
<a class="ec-list" data-number="918866774266"
data-message="Please help me! I have got wrong product - ORDER ID is : #654321485">
<div class="d-flex bd-highlight">
<!-- Profile Picture -->
<div class="ec-img-cont">
<img loading="lazy" src="assets/images/whatsapp/profile_03.jpg" class="ec-user-img"
alt="Profile image">
<span class="ec-status-icon ec-offline"></span>
</div>
<!-- Display Name & Last Seen -->
<div class="ec-user-info">
<span>Nargis Hawa</span>
<p>Nargis left 30 mins ago</p>
</div>
<!-- Chat iCon -->
<div class="ec-chat-icon">
<i class="fa fa-whatsapp"></i>
</div>
</div>
</a>
</li>
<!--/ End Single Contact List -->
<!-- Start Single Contact List -->
<li>
<a class="ec-list" data-number="918866774266"
data-message="Please help me! I have got wrong product - ORDER ID is : #654321485">
<div class="d-flex bd-highlight">
<!-- Profile Picture -->
<div class="ec-img-cont">
<img loading="lazy" src="assets/images/whatsapp/profile_04.jpg" class="ec-user-img"
alt="Profile image">
<span class="ec-status-icon ec-offline"></span>
</div>
<!-- Display Name & Last Seen -->
<div class="ec-user-info">
<span>Khadija Mehr</span>
<p>Khadija left 50 mins ago</p>
</div>
<!-- Chat iCon -->
<div class="ec-chat-icon">
<i class="fa fa-whatsapp"></i>
</div>
</div>
</a>
</li>
<!--/ End Single Contact List -->
</ul>
</div>
</div>
<!--/ End Floating Panel Container -->
<!-- Start Right Floating Button-->
<div class="ec-right-bottom">
<div class="ec-box">
<div class="ec-button rotateBackward">
<img loading="lazy" class="whatsapp" src="assets/images/common/whatsapp.png" alt="whatsapp icon" />
</div>
</div>
</div>
<!--/ End Right Floating Button-->
</div>
<!-- Whatsapp end -->
<!-- Feature tools -->
<div class="ec-tools-sidebar-overlay"></div>

165
offer.php
View File

@ -22,7 +22,8 @@ if ($_SESSION["userId"] <> "") {
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0">
<title>oBanana B2B - Elevate Your Business</title>
<meta name="keywords" content="apparel, catalog, clean, ecommerce, ecommerce HTML, electronics, fashion, html eCommerce, html store, minimal, multipurpose, multipurpose ecommerce, online store, responsive ecommerce template, shops" />
<meta name="keywords"
content="apparel, catalog, clean, ecommerce, ecommerce HTML, electronics, fashion, html eCommerce, html store, minimal, multipurpose, multipurpose ecommerce, online store, responsive ecommerce template, shops" />
<meta name="description" content="Best ecommerce html template for single and multi vendor store.">
<meta name="author" content="ashishmaraviya">
@ -33,6 +34,12 @@ if ($_SESSION["userId"] <> "") {
<!-- css Icon Font -->
<link rel="stylesheet" href="assets/css/vendor/ecicons.min.css" />
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.2/css/all.min.css"
integrity="sha512-SnH5WK+bZxgPHs44uWIX+LLJAJ9/2PkPKZ5QiAj6Ta86w+fsb2TkcmfRyVX3pBnMFcV7oQPJkl9QevSCWr3W6A=="
crossorigin="anonymous" referrerpolicy="no-referrer" />
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.2/css/all.min.css"
integrity="sha512-SnH5WK+bZxgPHs44uWIX+LLJAJ9/2PkPKZ5QiAj6Ta86w+fsb2TkcmfRyVX3pBnMFcV7oQPJkl9QevSCWr3W6A=="
crossorigin="anonymous" referrerpolicy="no-referrer" />
<!-- css All Plugins Files -->
<link rel="stylesheet" href="assets/css/plugins/animate.css" />
@ -49,22 +56,22 @@ if ($_SESSION["userId"] <> "") {
<!-- Background css -->
<link rel="stylesheet" id="bg-switcher-css" href="assets/css/backgrounds/bg-4.css">
<script>
function updateCartItemCount() {
$.get("cartitems.php?id=<?php echo $_SESSION['customerId']; ?>", function(data, status) {
if (data != "") {
console.log("Data: " + data + "\nStatus: " + status);
document.getElementById("cartItemCount").innerHTML = data;
}
});
}
function updateCartItemCount() {
$.get("cartitems.php?id=<?php echo $_SESSION['customerId']; ?>", function(data, status) {
if (data != "") {
console.log("Data: " + data + "\nStatus: " + status);
document.getElementById("cartItemCount").innerHTML = data;
}
});
}
function updateWishItemCount() {
$.get("wishlistitems.php?id=<?php echo $_SESSION['customerId']; ?>", function(data) {
if (data != "") {
document.getElementById("wishItemCount").innerHTML = data;
}
});
}
function updateWishItemCount() {
$.get("wishlistitems.php?id=<?php echo $_SESSION['customerId']; ?>", function(data) {
if (data != "") {
document.getElementById("wishItemCount").innerHTML = data;
}
});
}
</script>
</head>
@ -228,16 +235,20 @@ if ($_SESSION["userId"] <> "") {
<div class="container">
<div class="ec-nav-panel">
<div class="ec-nav-panel-icons">
<a href="#ec-mobile-menu" class="navbar-toggler-btn ec-header-btn ec-side-toggle"><i class="fi-rr-menu-burger"></i></a>
<a href="#ec-mobile-menu" class="navbar-toggler-btn ec-header-btn ec-side-toggle"><i
class="fi-rr-menu-burger"></i></a>
</div>
<div class="ec-nav-panel-icons">
<a href="#ec-side-cart" class="toggle-cart ec-header-btn ec-side-toggle"><i class="fi-rr-shopping-bag"></i><span class="ec-cart-noti ec-header-count cart-count-lable">3</span></a>
<a href="#ec-side-cart" class="toggle-cart ec-header-btn ec-side-toggle"><i
class="fi-rr-shopping-bag"></i><span
class="ec-cart-noti ec-header-count cart-count-lable">3</span></a>
</div>
<div class="ec-nav-panel-icons">
<a href="index.php" class="ec-header-btn"><i class="fi-rr-home"></i></a>
</div>
<div class="ec-nav-panel-icons">
<a href="wishlist.html" class="ec-header-btn"><i class="fi-rr-heart"></i><span class="ec-cart-noti">4</span></a>
<a href="wishlist.html" class="ec-header-btn"><i class="fi-rr-heart"></i><span
class="ec-cart-noti">4</span></a>
</div>
<div class="ec-nav-panel-icons">
<a href="login.php" class="ec-header-btn"><i class="fi-rr-user"></i></a>
@ -271,121 +282,7 @@ if ($_SESSION["userId"] <> "") {
</div>
<!-- Cart Floating Button end -->
<!-- Whatsapp -->
<div class="ec-style ec-right-bottom">
<!-- Start Floating Panel Container -->
<div class="ec-panel">
<!-- Panel Header -->
<div class="ec-header">
<strong>Need Help?</strong>
<p>Chat with us on WhatsApp</p>
</div>
<!-- Panel Content -->
<div class="ec-body">
<ul>
<!-- Start Single Contact List -->
<li>
<a class="ec-list" data-number="918866774266" data-message="Please help me! I have got wrong product - ORDER ID is : #654321485">
<div class="d-flex bd-highlight">
<!-- Profile Picture -->
<div class="ec-img-cont">
<img loading="lazy" src="assets/images/whatsapp/profile_01.jpg" class="ec-user-img" alt="Profile image">
<span class="ec-status-icon"></span>
</div>
<!-- Display Name & Last Seen -->
<div class="ec-user-info">
<span>Sahar Darya</span>
<p>Sahar left 7 mins ago</p>
</div>
<!-- Chat iCon -->
<div class="ec-chat-icon">
<i class="fa fa-whatsapp"></i>
</div>
</div>
</a>
</li>
<!--/ End Single Contact List -->
<!-- Start Single Contact List -->
<li>
<a class="ec-list" data-number="918866774266" data-message="Please help me! I have got wrong product - ORDER ID is : #654321485">
<div class="d-flex bd-highlight">
<!-- Profile Picture -->
<div class="ec-img-cont">
<img loading="lazy" src="assets/images/whatsapp/profile_02.jpg" class="ec-user-img" alt="Profile image">
<span class="ec-status-icon ec-online"></span>
</div>
<!-- Display Name & Last Seen -->
<div class="ec-user-info">
<span>Yolduz Rafi</span>
<p>Yolduz is online</p>
</div>
<!-- Chat iCon -->
<div class="ec-chat-icon">
<i class="fa fa-whatsapp"></i>
</div>
</div>
</a>
</li>
<!--/ End Single Contact List -->
<!-- Start Single Contact List -->
<li>
<a class="ec-list" data-number="918866774266" data-message="Please help me! I have got wrong product - ORDER ID is : #654321485">
<div class="d-flex bd-highlight">
<!-- Profile Picture -->
<div class="ec-img-cont">
<img loading="lazy" src="assets/images/whatsapp/profile_03.jpg" class="ec-user-img" alt="Profile image">
<span class="ec-status-icon ec-offline"></span>
</div>
<!-- Display Name & Last Seen -->
<div class="ec-user-info">
<span>Nargis Hawa</span>
<p>Nargis left 30 mins ago</p>
</div>
<!-- Chat iCon -->
<div class="ec-chat-icon">
<i class="fa fa-whatsapp"></i>
</div>
</div>
</a>
</li>
<!--/ End Single Contact List -->
<!-- Start Single Contact List -->
<li>
<a class="ec-list" data-number="918866774266" data-message="Please help me! I have got wrong product - ORDER ID is : #654321485">
<div class="d-flex bd-highlight">
<!-- Profile Picture -->
<div class="ec-img-cont">
<img loading="lazy" src="assets/images/whatsapp/profile_04.jpg" class="ec-user-img" alt="Profile image">
<span class="ec-status-icon ec-offline"></span>
</div>
<!-- Display Name & Last Seen -->
<div class="ec-user-info">
<span>Khadija Mehr</span>
<p>Khadija left 50 mins ago</p>
</div>
<!-- Chat iCon -->
<div class="ec-chat-icon">
<i class="fa fa-whatsapp"></i>
</div>
</div>
</a>
</li>
<!--/ End Single Contact List -->
</ul>
</div>
</div>
<!--/ End Floating Panel Container -->
<!-- Start Right Floating Button-->
<div class="ec-right-bottom">
<div class="ec-box">
<div class="ec-button rotateBackward">
<img loading="lazy" class="whatsapp" src="assets/images/common/whatsapp.png" alt="whatsapp icon" />
</div>
</div>
</div>
<!--/ End Right Floating Button-->
</div>
<!-- Whatsapp end -->
<!-- Feature tools -->
<div class="ec-tools-sidebar-overlay"></div>

View File

@ -17,7 +17,10 @@
<meta name="msapplication-TileImage" content="assets/images/favicon/favicon.png" />
<!-- css Icon Font -->
<link rel="stylesheet" href="assets/css/vendor/ecicons.min.css" />
<link rel="stylesheet" href="assets/css/vendor/ecicons.min.css" />
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.2/css/all.min.css"
integrity="sha512-SnH5WK+bZxgPHs44uWIX+LLJAJ9/2PkPKZ5QiAj6Ta86w+fsb2TkcmfRyVX3pBnMFcV7oQPJkl9QevSCWr3W6A=="
crossorigin="anonymous" referrerpolicy="no-referrer" />
<!-- css All Plugins Files -->
<link rel="stylesheet" href="assets/css/plugins/animate.css" />
@ -444,121 +447,7 @@
</div>
<!-- Cart Floating Button end -->
<!-- Whatsapp -->
<div class="ec-style ec-right-bottom">
<!-- Start Floating Panel Container -->
<div class="ec-panel">
<!-- Panel Header -->
<div class="ec-header">
<strong>Need Help?</strong>
<p>Chat with us on WhatsApp</p>
</div>
<!-- Panel Content -->
<div class="ec-body">
<ul>
<!-- Start Single Contact List -->
<li>
<a class="ec-list" data-number="918866774266" data-message="Please help me! I have got wrong product - ORDER ID is : #654321485">
<div class="d-flex bd-highlight">
<!-- Profile Picture -->
<div class="ec-img-cont">
<img loading="lazy" src="assets/images/whatsapp/profile_01.jpg" class="ec-user-img" alt="Profile image">
<span class="ec-status-icon"></span>
</div>
<!-- Display Name & Last Seen -->
<div class="ec-user-info">
<span>Sahar Darya</span>
<p>Sahar left 7 mins ago</p>
</div>
<!-- Chat iCon -->
<div class="ec-chat-icon">
<i class="fa fa-whatsapp"></i>
</div>
</div>
</a>
</li>
<!--/ End Single Contact List -->
<!-- Start Single Contact List -->
<li>
<a class="ec-list" data-number="918866774266" data-message="Please help me! I have got wrong product - ORDER ID is : #654321485">
<div class="d-flex bd-highlight">
<!-- Profile Picture -->
<div class="ec-img-cont">
<img loading="lazy" src="assets/images/whatsapp/profile_02.jpg" class="ec-user-img" alt="Profile image">
<span class="ec-status-icon ec-online"></span>
</div>
<!-- Display Name & Last Seen -->
<div class="ec-user-info">
<span>Yolduz Rafi</span>
<p>Yolduz is online</p>
</div>
<!-- Chat iCon -->
<div class="ec-chat-icon">
<i class="fa fa-whatsapp"></i>
</div>
</div>
</a>
</li>
<!--/ End Single Contact List -->
<!-- Start Single Contact List -->
<li>
<a class="ec-list" data-number="918866774266" data-message="Please help me! I have got wrong product - ORDER ID is : #654321485">
<div class="d-flex bd-highlight">
<!-- Profile Picture -->
<div class="ec-img-cont">
<img loading="lazy" src="assets/images/whatsapp/profile_03.jpg" class="ec-user-img" alt="Profile image">
<span class="ec-status-icon ec-offline"></span>
</div>
<!-- Display Name & Last Seen -->
<div class="ec-user-info">
<span>Nargis Hawa</span>
<p>Nargis left 30 mins ago</p>
</div>
<!-- Chat iCon -->
<div class="ec-chat-icon">
<i class="fa fa-whatsapp"></i>
</div>
</div>
</a>
</li>
<!--/ End Single Contact List -->
<!-- Start Single Contact List -->
<li>
<a class="ec-list" data-number="918866774266" data-message="Please help me! I have got wrong product - ORDER ID is : #654321485">
<div class="d-flex bd-highlight">
<!-- Profile Picture -->
<div class="ec-img-cont">
<img loading="lazy" src="assets/images/whatsapp/profile_04.jpg" class="ec-user-img" alt="Profile image">
<span class="ec-status-icon ec-offline"></span>
</div>
<!-- Display Name & Last Seen -->
<div class="ec-user-info">
<span>Khadija Mehr</span>
<p>Khadija left 50 mins ago</p>
</div>
<!-- Chat iCon -->
<div class="ec-chat-icon">
<i class="fa fa-whatsapp"></i>
</div>
</div>
</a>
</li>
<!--/ End Single Contact List -->
</ul>
</div>
</div>
<!--/ End Floating Panel Container -->
<!-- Start Right Floating Button-->
<div class="ec-right-bottom">
<div class="ec-box">
<div class="ec-button rotateBackward">
<img loading="lazy" class="whatsapp" src="assets/images/common/whatsapp.png" alt="whatsapp icon" />
</div>
</div>
</div>
<!--/ End Right Floating Button-->
</div>
<!-- Whatsapp end -->
<!-- Feature tools -->
<div class="ec-tools-sidebar-overlay"></div>

File diff suppressed because it is too large Load Diff

View File

@ -17,7 +17,10 @@
<meta name="msapplication-TileImage" content="assets/images/favicon/favicon.png" />
<!-- css Icon Font -->
<link rel="stylesheet" href="assets/css/vendor/ecicons.min.css" />
<link rel="stylesheet" href="assets/css/vendor/ecicons.min.css" />
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.2/css/all.min.css"
integrity="sha512-SnH5WK+bZxgPHs44uWIX+LLJAJ9/2PkPKZ5QiAj6Ta86w+fsb2TkcmfRyVX3pBnMFcV7oQPJkl9QevSCWr3W6A=="
crossorigin="anonymous" referrerpolicy="no-referrer" />
<!-- css All Plugins Files -->
<link rel="stylesheet" href="assets/css/plugins/animate.css" />
@ -294,121 +297,7 @@
</div>
<!-- Cart Floating Button end -->
<!-- Whatsapp -->
<div class="ec-style ec-right-bottom">
<!-- Start Floating Panel Container -->
<div class="ec-panel">
<!-- Panel Header -->
<div class="ec-header">
<strong>Need Help?</strong>
<p>Chat with us on WhatsApp</p>
</div>
<!-- Panel Content -->
<div class="ec-body">
<ul>
<!-- Start Single Contact List -->
<li>
<a class="ec-list" data-number="918866774266" data-message="Please help me! I have got wrong product - ORDER ID is : #654321485">
<div class="d-flex bd-highlight">
<!-- Profile Picture -->
<div class="ec-img-cont">
<img loading="lazy" src="assets/images/whatsapp/profile_01.jpg" class="ec-user-img" alt="Profile image">
<span class="ec-status-icon"></span>
</div>
<!-- Display Name & Last Seen -->
<div class="ec-user-info">
<span>Sahar Darya</span>
<p>Sahar left 7 mins ago</p>
</div>
<!-- Chat iCon -->
<div class="ec-chat-icon">
<i class="fa fa-whatsapp"></i>
</div>
</div>
</a>
</li>
<!--/ End Single Contact List -->
<!-- Start Single Contact List -->
<li>
<a class="ec-list" data-number="918866774266" data-message="Please help me! I have got wrong product - ORDER ID is : #654321485">
<div class="d-flex bd-highlight">
<!-- Profile Picture -->
<div class="ec-img-cont">
<img loading="lazy" src="assets/images/whatsapp/profile_02.jpg" class="ec-user-img" alt="Profile image">
<span class="ec-status-icon ec-online"></span>
</div>
<!-- Display Name & Last Seen -->
<div class="ec-user-info">
<span>Yolduz Rafi</span>
<p>Yolduz is online</p>
</div>
<!-- Chat iCon -->
<div class="ec-chat-icon">
<i class="fa fa-whatsapp"></i>
</div>
</div>
</a>
</li>
<!--/ End Single Contact List -->
<!-- Start Single Contact List -->
<li>
<a class="ec-list" data-number="918866774266" data-message="Please help me! I have got wrong product - ORDER ID is : #654321485">
<div class="d-flex bd-highlight">
<!-- Profile Picture -->
<div class="ec-img-cont">
<img loading="lazy" src="assets/images/whatsapp/profile_03.jpg" class="ec-user-img" alt="Profile image">
<span class="ec-status-icon ec-offline"></span>
</div>
<!-- Display Name & Last Seen -->
<div class="ec-user-info">
<span>Nargis Hawa</span>
<p>Nargis left 30 mins ago</p>
</div>
<!-- Chat iCon -->
<div class="ec-chat-icon">
<i class="fa fa-whatsapp"></i>
</div>
</div>
</a>
</li>
<!--/ End Single Contact List -->
<!-- Start Single Contact List -->
<li>
<a class="ec-list" data-number="918866774266" data-message="Please help me! I have got wrong product - ORDER ID is : #654321485">
<div class="d-flex bd-highlight">
<!-- Profile Picture -->
<div class="ec-img-cont">
<img loading="lazy" src="assets/images/whatsapp/profile_04.jpg" class="ec-user-img" alt="Profile image">
<span class="ec-status-icon ec-offline"></span>
</div>
<!-- Display Name & Last Seen -->
<div class="ec-user-info">
<span>Khadija Mehr</span>
<p>Khadija left 50 mins ago</p>
</div>
<!-- Chat iCon -->
<div class="ec-chat-icon">
<i class="fa fa-whatsapp"></i>
</div>
</div>
</a>
</li>
<!--/ End Single Contact List -->
</ul>
</div>
</div>
<!--/ End Floating Panel Container -->
<!-- Start Right Floating Button-->
<div class="ec-right-bottom">
<div class="ec-box">
<div class="ec-button rotateBackward">
<img loading="lazy" class="whatsapp" src="assets/images/common/whatsapp.png" alt="whatsapp icon" />
</div>
</div>
</div>
<!--/ End Right Floating Button-->
</div>
<!-- Whatsapp end -->
<!-- Feature tools -->
<div class="ec-tools-sidebar-overlay"></div>

View File

@ -22,7 +22,10 @@ $_SESSION["isVendor"] = false;
<meta name="msapplication-TileImage" content="assets/images/favicon/favicon.png" />
<!-- css Icon Font -->
<link rel="stylesheet" href="assets/css/vendor/ecicons.min.css" />
<link rel="stylesheet" href="assets/css/vendor/ecicons.min.css" />
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.2/css/all.min.css"
integrity="sha512-SnH5WK+bZxgPHs44uWIX+LLJAJ9/2PkPKZ5QiAj6Ta86w+fsb2TkcmfRyVX3pBnMFcV7oQPJkl9QevSCWr3W6A=="
crossorigin="anonymous" referrerpolicy="no-referrer" />
<!-- css All Plugins Files -->
<link rel="stylesheet" href="assets/css/plugins/animate.css" />
@ -111,10 +114,7 @@ $_SESSION["isVendor"] = false;
<label>Password*</label>
<input type="password" name="password" placeholder="Enter your password" required />
</span>
<p><input type="checkbox"> I accept this Terms & Conditions and Privacy Policy</p>
<span class="ec-login-wrap ec-login-fp">
<label><a href="#">Forgot Password?</a></label>
</span>
<p><input type="checkbox" required> I accept this Terms & Conditions and Privacy Policy </p>
<span class="ec-login-wrap ec-login-btn">
<button class="btn btn-primary" type="submit">Register</button>
</span>
@ -178,121 +178,7 @@ $_SESSION["isVendor"] = false;
</div>
<!-- Cart Floating Button end -->
<!-- Whatsapp -->
<div class="ec-style ec-right-bottom">
<!-- Start Floating Panel Container -->
<div class="ec-panel">
<!-- Panel Header -->
<div class="ec-header">
<strong>Need Help?</strong>
<p>Chat with us on WhatsApp</p>
</div>
<!-- Panel Content -->
<div class="ec-body">
<ul>
<!-- Start Single Contact List -->
<li>
<a class="ec-list" data-number="918866774266" data-message="Please help me! I have got wrong product - ORDER ID is : #654321485">
<div class="d-flex bd-highlight">
<!-- Profile Picture -->
<div class="ec-img-cont">
<img loading="lazy" src="assets/images/whatsapp/profile_01.jpg" class="ec-user-img" alt="Profile image">
<span class="ec-status-icon"></span>
</div>
<!-- Display Name & Last Seen -->
<div class="ec-user-info">
<span>Sahar Darya</span>
<p>Sahar left 7 mins ago</p>
</div>
<!-- Chat iCon -->
<div class="ec-chat-icon">
<i class="fa fa-whatsapp"></i>
</div>
</div>
</a>
</li>
<!--/ End Single Contact List -->
<!-- Start Single Contact List -->
<li>
<a class="ec-list" data-number="918866774266" data-message="Please help me! I have got wrong product - ORDER ID is : #654321485">
<div class="d-flex bd-highlight">
<!-- Profile Picture -->
<div class="ec-img-cont">
<img loading="lazy" src="assets/images/whatsapp/profile_02.jpg" class="ec-user-img" alt="Profile image">
<span class="ec-status-icon ec-online"></span>
</div>
<!-- Display Name & Last Seen -->
<div class="ec-user-info">
<span>Yolduz Rafi</span>
<p>Yolduz is online</p>
</div>
<!-- Chat iCon -->
<div class="ec-chat-icon">
<i class="fa fa-whatsapp"></i>
</div>
</div>
</a>
</li>
<!--/ End Single Contact List -->
<!-- Start Single Contact List -->
<li>
<a class="ec-list" data-number="918866774266" data-message="Please help me! I have got wrong product - ORDER ID is : #654321485">
<div class="d-flex bd-highlight">
<!-- Profile Picture -->
<div class="ec-img-cont">
<img loading="lazy" src="assets/images/whatsapp/profile_03.jpg" class="ec-user-img" alt="Profile image">
<span class="ec-status-icon ec-offline"></span>
</div>
<!-- Display Name & Last Seen -->
<div class="ec-user-info">
<span>Nargis Hawa</span>
<p>Nargis left 30 mins ago</p>
</div>
<!-- Chat iCon -->
<div class="ec-chat-icon">
<i class="fa fa-whatsapp"></i>
</div>
</div>
</a>
</li>
<!--/ End Single Contact List -->
<!-- Start Single Contact List -->
<li>
<a class="ec-list" data-number="918866774266" data-message="Please help me! I have got wrong product - ORDER ID is : #654321485">
<div class="d-flex bd-highlight">
<!-- Profile Picture -->
<div class="ec-img-cont">
<img loading="lazy" src="assets/images/whatsapp/profile_04.jpg" class="ec-user-img" alt="Profile image">
<span class="ec-status-icon ec-offline"></span>
</div>
<!-- Display Name & Last Seen -->
<div class="ec-user-info">
<span>Khadija Mehr</span>
<p>Khadija left 50 mins ago</p>
</div>
<!-- Chat iCon -->
<div class="ec-chat-icon">
<i class="fa fa-whatsapp"></i>
</div>
</div>
</a>
</li>
<!--/ End Single Contact List -->
</ul>
</div>
</div>
<!--/ End Floating Panel Container -->
<!-- Start Right Floating Button-->
<div class="ec-right-bottom">
<div class="ec-box">
<div class="ec-button rotateBackward">
<img loading="lazy" class="whatsapp" src="assets/images/common/whatsapp.png" alt="whatsapp icon" />
</div>
</div>
</div>
<!--/ End Right Floating Button-->
</div>
<!-- Whatsapp end -->
<!-- Feature tools -->
<div class="ec-tools-sidebar-overlay"></div>

View File

@ -25,7 +25,10 @@ $customerData = json_decode($customers, true);
<meta name="msapplication-TileImage" content="assets/images/favicon/favicon.png" />
<!-- css Icon Font -->
<link rel="stylesheet" href="assets/css/vendor/ecicons.min.css" />
<link rel="stylesheet" href="assets/css/vendor/ecicons.min.css" />
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.2/css/all.min.css"
integrity="sha512-SnH5WK+bZxgPHs44uWIX+LLJAJ9/2PkPKZ5QiAj6Ta86w+fsb2TkcmfRyVX3pBnMFcV7oQPJkl9QevSCWr3W6A=="
crossorigin="anonymous" referrerpolicy="no-referrer" />
<!-- css All Plugins Files -->
<link rel="stylesheet" href="assets/css/plugins/animate.css" />
@ -129,8 +132,7 @@ $customerData = json_decode($customers, true);
</span>
<span class="ec-register-wrap ec-register-half">
<label>Phone Number*</label>
<input type="text" name="phonenumber" value="<?php echo $_SESSION["phone"] ?>" placeholder="Enter your phone number"
required />
<input type="text" name="phonenumber" value="+63 <?php echo $_SESSION["phone"] ?>" oninput="preventEraseInPrefix(this)" required />
</span>
<span class="ec-register-wrap ec-register-btn">
<?php
@ -153,6 +155,25 @@ $customerData = json_decode($customers, true);
</div>
</div>
</section>
<script>
function preventEraseInPrefix(input) { /* edit details */
var numericValue = input.value.replace(/\D/g, '');
if (numericValue.startsWith('63')) {
input.value = "+63 " + numericValue.substring(2);
} else {
input.value = "+63 " + numericValue;
}
if (input.value.length > 14) {
input.value = input.value.slice(0, 14);
}
}
</script>
<!-- End Register -->
<!-- Footer Start -->
@ -212,129 +233,7 @@ $customerData = json_decode($customers, true);
</div>
<!-- Cart Floating Button end -->
<!-- Whatsapp -->
<div class="ec-style ec-right-bottom">
<!-- Start Floating Panel Container -->
<div class="ec-panel">
<!-- Panel Header -->
<div class="ec-header">
<strong>Need Help?</strong>
<p>Chat with us on WhatsApp</p>
</div>
<!-- Panel Content -->
<div class="ec-body">
<ul>
<!-- Start Single Contact List -->
<li>
<a class="ec-list" data-number="918866774266"
data-message="Please help me! I have got wrong product - ORDER ID is : #654321485">
<div class="d-flex bd-highlight">
<!-- Profile Picture -->
<div class="ec-img-cont">
<img loading="lazy" src="assets/images/whatsapp/profile_01.jpg" class="ec-user-img"
alt="Profile image">
<span class="ec-status-icon"></span>
</div>
<!-- Display Name & Last Seen -->
<div class="ec-user-info">
<span>Sahar Darya</span>
<p>Sahar left 7 mins ago</p>
</div>
<!-- Chat iCon -->
<div class="ec-chat-icon">
<i class="fa fa-whatsapp"></i>
</div>
</div>
</a>
</li>
<!--/ End Single Contact List -->
<!-- Start Single Contact List -->
<li>
<a class="ec-list" data-number="918866774266"
data-message="Please help me! I have got wrong product - ORDER ID is : #654321485">
<div class="d-flex bd-highlight">
<!-- Profile Picture -->
<div class="ec-img-cont">
<img loading="lazy" src="assets/images/whatsapp/profile_02.jpg" class="ec-user-img"
alt="Profile image">
<span class="ec-status-icon ec-online"></span>
</div>
<!-- Display Name & Last Seen -->
<div class="ec-user-info">
<span>Yolduz Rafi</span>
<p>Yolduz is online</p>
</div>
<!-- Chat iCon -->
<div class="ec-chat-icon">
<i class="fa fa-whatsapp"></i>
</div>
</div>
</a>
</li>
<!--/ End Single Contact List -->
<!-- Start Single Contact List -->
<li>
<a class="ec-list" data-number="918866774266"
data-message="Please help me! I have got wrong product - ORDER ID is : #654321485">
<div class="d-flex bd-highlight">
<!-- Profile Picture -->
<div class="ec-img-cont">
<img loading="lazy" src="assets/images/whatsapp/profile_03.jpg" class="ec-user-img"
alt="Profile image">
<span class="ec-status-icon ec-offline"></span>
</div>
<!-- Display Name & Last Seen -->
<div class="ec-user-info">
<span>Nargis Hawa</span>
<p>Nargis left 30 mins ago</p>
</div>
<!-- Chat iCon -->
<div class="ec-chat-icon">
<i class="fa fa-whatsapp"></i>
</div>
</div>
</a>
</li>
<!--/ End Single Contact List -->
<!-- Start Single Contact List -->
<li>
<a class="ec-list" data-number="918866774266"
data-message="Please help me! I have got wrong product - ORDER ID is : #654321485">
<div class="d-flex bd-highlight">
<!-- Profile Picture -->
<div class="ec-img-cont">
<img loading="lazy" src="assets/images/whatsapp/profile_04.jpg" class="ec-user-img"
alt="Profile image">
<span class="ec-status-icon ec-offline"></span>
</div>
<!-- Display Name & Last Seen -->
<div class="ec-user-info">
<span>Khadija Mehr</span>
<p>Khadija left 50 mins ago</p>
</div>
<!-- Chat iCon -->
<div class="ec-chat-icon">
<i class="fa fa-whatsapp"></i>
</div>
</div>
</a>
</li>
<!--/ End Single Contact List -->
</ul>
</div>
</div>
<!--/ End Floating Panel Container -->
<!-- Start Right Floating Button-->
<div class="ec-right-bottom">
<div class="ec-box">
<div class="ec-button rotateBackward">
<img loading="lazy" class="whatsapp" src="assets/images/common/whatsapp.png" alt="whatsapp icon" />
</div>
</div>
</div>
<!--/ End Right Floating Button-->
</div>
<!-- Whatsapp end -->
<!-- Feature tools -->
<div class="ec-tools-sidebar-overlay"></div>

View File

@ -20,7 +20,10 @@
<meta name="msapplication-TileImage" content="assets/images/favicon/favicon.png" />
<!-- css Icon Font -->
<link rel="stylesheet" href="assets/css/vendor/ecicons.min.css" />
<link rel="stylesheet" href="assets/css/vendor/ecicons.min.css" />
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.2/css/all.min.css"
integrity="sha512-SnH5WK+bZxgPHs44uWIX+LLJAJ9/2PkPKZ5QiAj6Ta86w+fsb2TkcmfRyVX3pBnMFcV7oQPJkl9QevSCWr3W6A=="
crossorigin="anonymous" referrerpolicy="no-referrer" />
<!-- css All Plugins Files -->
<link rel="stylesheet" href="assets/css/plugins/animate.css" />
@ -181,121 +184,7 @@
</div>
<!-- Cart Floating Button end -->
<!-- Whatsapp -->
<div class="ec-style ec-right-bottom">
<!-- Start Floating Panel Container -->
<div class="ec-panel">
<!-- Panel Header -->
<div class="ec-header">
<strong>Need Help?</strong>
<p>Chat with us on WhatsApp</p>
</div>
<!-- Panel Content -->
<div class="ec-body">
<ul>
<!-- Start Single Contact List -->
<li>
<a class="ec-list" data-number="918866774266" data-message="Please help me! I have got wrong product - ORDER ID is : #654321485">
<div class="d-flex bd-highlight">
<!-- Profile Picture -->
<div class="ec-img-cont">
<img loading="lazy" src="assets/images/whatsapp/profile_01.jpg" class="ec-user-img" alt="Profile image">
<span class="ec-status-icon"></span>
</div>
<!-- Display Name & Last Seen -->
<div class="ec-user-info">
<span>Sahar Darya</span>
<p>Sahar left 7 mins ago</p>
</div>
<!-- Chat iCon -->
<div class="ec-chat-icon">
<i class="fa fa-whatsapp"></i>
</div>
</div>
</a>
</li>
<!--/ End Single Contact List -->
<!-- Start Single Contact List -->
<li>
<a class="ec-list" data-number="918866774266" data-message="Please help me! I have got wrong product - ORDER ID is : #654321485">
<div class="d-flex bd-highlight">
<!-- Profile Picture -->
<div class="ec-img-cont">
<img loading="lazy" src="assets/images/whatsapp/profile_02.jpg" class="ec-user-img" alt="Profile image">
<span class="ec-status-icon ec-online"></span>
</div>
<!-- Display Name & Last Seen -->
<div class="ec-user-info">
<span>Yolduz Rafi</span>
<p>Yolduz is online</p>
</div>
<!-- Chat iCon -->
<div class="ec-chat-icon">
<i class="fa fa-whatsapp"></i>
</div>
</div>
</a>
</li>
<!--/ End Single Contact List -->
<!-- Start Single Contact List -->
<li>
<a class="ec-list" data-number="918866774266" data-message="Please help me! I have got wrong product - ORDER ID is : #654321485">
<div class="d-flex bd-highlight">
<!-- Profile Picture -->
<div class="ec-img-cont">
<img loading="lazy" src="assets/images/whatsapp/profile_03.jpg" class="ec-user-img" alt="Profile image">
<span class="ec-status-icon ec-offline"></span>
</div>
<!-- Display Name & Last Seen -->
<div class="ec-user-info">
<span>Nargis Hawa</span>
<p>Nargis left 30 mins ago</p>
</div>
<!-- Chat iCon -->
<div class="ec-chat-icon">
<i class="fa fa-whatsapp"></i>
</div>
</div>
</a>
</li>
<!--/ End Single Contact List -->
<!-- Start Single Contact List -->
<li>
<a class="ec-list" data-number="918866774266" data-message="Please help me! I have got wrong product - ORDER ID is : #654321485">
<div class="d-flex bd-highlight">
<!-- Profile Picture -->
<div class="ec-img-cont">
<img loading="lazy" src="assets/images/whatsapp/profile_04.jpg" class="ec-user-img" alt="Profile image">
<span class="ec-status-icon ec-offline"></span>
</div>
<!-- Display Name & Last Seen -->
<div class="ec-user-info">
<span>Khadija Mehr</span>
<p>Khadija left 50 mins ago</p>
</div>
<!-- Chat iCon -->
<div class="ec-chat-icon">
<i class="fa fa-whatsapp"></i>
</div>
</div>
</a>
</li>
<!--/ End Single Contact List -->
</ul>
</div>
</div>
<!--/ End Floating Panel Container -->
<!-- Start Right Floating Button-->
<div class="ec-right-bottom">
<div class="ec-box">
<div class="ec-button rotateBackward">
<img loading="lazy" class="whatsapp" src="assets/images/common/whatsapp.png" alt="whatsapp icon" />
</div>
</div>
</div>
<!--/ End Right Floating Button-->
</div>
<!-- Whatsapp end -->
<!-- Feature tools -->
<div class="ec-tools-sidebar-overlay"></div>

View File

@ -25,7 +25,10 @@ $vendorData = json_decode($vendors, true);
<meta name="msapplication-TileImage" content="assets/images/favicon/favicon.png" />
<!-- css Icon Font -->
<link rel="stylesheet" href="assets/css/vendor/ecicons.min.css" />
<link rel="stylesheet" href="assets/css/vendor/ecicons.min.css" />
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.2/css/all.min.css"
integrity="sha512-SnH5WK+bZxgPHs44uWIX+LLJAJ9/2PkPKZ5QiAj6Ta86w+fsb2TkcmfRyVX3pBnMFcV7oQPJkl9QevSCWr3W6A=="
crossorigin="anonymous" referrerpolicy="no-referrer" />
<!-- css All Plugins Files -->
<link rel="stylesheet" href="assets/css/plugins/animate.css" />
@ -144,7 +147,7 @@ $vendorData = json_decode($vendors, true);
</span>
<span class="ec-register-wrap ec-register-half">
<label>Phone Number*</label>
<input type="text" name="phonenumber" value="<?php echo $vendorData['phone'] ?>" placeholder="Enter your phone number" required />
<input type="text" name="phonenumber" value="+63 <?php echo $vendorData['phone'] ?>" oninput="preventEraseInPrefix(this)" required />
</span>
<!-- <span class="ec-register-wrap">
@ -224,6 +227,25 @@ $vendorData = json_decode($vendors, true);
</div>
</div>
</section>
<script>
function preventEraseInPrefix(input) { /* edit details */
var numericValue = input.value.replace(/\D/g, '');
if (numericValue.startsWith('63')) {
input.value = "+63 " + numericValue.substring(2);
} else {
input.value = "+63 " + numericValue;
}
if (input.value.length > 14) {
input.value = input.value.slice(0, 14);
}
}
</script>
<!-- End Register -->
<!-- Footer Start -->
@ -279,121 +301,7 @@ $vendorData = json_decode($vendors, true);
</div>
<!-- Cart Floating Button end -->
<!-- Whatsapp -->
<div class="ec-style ec-right-bottom">
<!-- Start Floating Panel Container -->
<div class="ec-panel">
<!-- Panel Header -->
<div class="ec-header">
<strong>Need Help?</strong>
<p>Chat with us on WhatsApp</p>
</div>
<!-- Panel Content -->
<div class="ec-body">
<ul>
<!-- Start Single Contact List -->
<li>
<a class="ec-list" data-number="918866774266" data-message="Please help me! I have got wrong product - ORDER ID is : #654321485">
<div class="d-flex bd-highlight">
<!-- Profile Picture -->
<div class="ec-img-cont">
<img loading="lazy" src="assets/images/whatsapp/profile_01.jpg" class="ec-user-img" alt="Profile image">
<span class="ec-status-icon"></span>
</div>
<!-- Display Name & Last Seen -->
<div class="ec-user-info">
<span>Sahar Darya</span>
<p>Sahar left 7 mins ago</p>
</div>
<!-- Chat iCon -->
<div class="ec-chat-icon">
<i class="fa fa-whatsapp"></i>
</div>
</div>
</a>
</li>
<!--/ End Single Contact List -->
<!-- Start Single Contact List -->
<li>
<a class="ec-list" data-number="918866774266" data-message="Please help me! I have got wrong product - ORDER ID is : #654321485">
<div class="d-flex bd-highlight">
<!-- Profile Picture -->
<div class="ec-img-cont">
<img loading="lazy" src="assets/images/whatsapp/profile_02.jpg" class="ec-user-img" alt="Profile image">
<span class="ec-status-icon ec-online"></span>
</div>
<!-- Display Name & Last Seen -->
<div class="ec-user-info">
<span>Yolduz Rafi</span>
<p>Yolduz is online</p>
</div>
<!-- Chat iCon -->
<div class="ec-chat-icon">
<i class="fa fa-whatsapp"></i>
</div>
</div>
</a>
</li>
<!--/ End Single Contact List -->
<!-- Start Single Contact List -->
<li>
<a class="ec-list" data-number="918866774266" data-message="Please help me! I have got wrong product - ORDER ID is : #654321485">
<div class="d-flex bd-highlight">
<!-- Profile Picture -->
<div class="ec-img-cont">
<img loading="lazy" src="assets/images/whatsapp/profile_03.jpg" class="ec-user-img" alt="Profile image">
<span class="ec-status-icon ec-offline"></span>
</div>
<!-- Display Name & Last Seen -->
<div class="ec-user-info">
<span>Nargis Hawa</span>
<p>Nargis left 30 mins ago</p>
</div>
<!-- Chat iCon -->
<div class="ec-chat-icon">
<i class="fa fa-whatsapp"></i>
</div>
</div>
</a>
</li>
<!--/ End Single Contact List -->
<!-- Start Single Contact List -->
<li>
<a class="ec-list" data-number="918866774266" data-message="Please help me! I have got wrong product - ORDER ID is : #654321485">
<div class="d-flex bd-highlight">
<!-- Profile Picture -->
<div class="ec-img-cont">
<img loading="lazy" src="assets/images/whatsapp/profile_04.jpg" class="ec-user-img" alt="Profile image">
<span class="ec-status-icon ec-offline"></span>
</div>
<!-- Display Name & Last Seen -->
<div class="ec-user-info">
<span>Khadija Mehr</span>
<p>Khadija left 50 mins ago</p>
</div>
<!-- Chat iCon -->
<div class="ec-chat-icon">
<i class="fa fa-whatsapp"></i>
</div>
</div>
</a>
</li>
<!--/ End Single Contact List -->
</ul>
</div>
</div>
<!--/ End Floating Panel Container -->
<!-- Start Right Floating Button-->
<div class="ec-right-bottom">
<div class="ec-box">
<div class="ec-button rotateBackward">
<img loading="lazy" class="whatsapp" src="assets/images/common/whatsapp.png" alt="whatsapp icon" />
</div>
</div>
</div>
<!--/ End Right Floating Button-->
</div>
<!-- Whatsapp end -->
<!-- Feature tools -->
<div class="ec-tools-sidebar-overlay"></div>

View File

@ -32,7 +32,10 @@ if ($_SESSION["userId"] <> "") {
<meta name="msapplication-TileImage" content="assets/images/favicon/favicon.png" />
<!-- css Icon Font -->
<link rel="stylesheet" href="assets/css/vendor/ecicons.min.css" />
<link rel="stylesheet" href="assets/css/vendor/ecicons.min.css" />
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.2/css/all.min.css"
integrity="sha512-SnH5WK+bZxgPHs44uWIX+LLJAJ9/2PkPKZ5QiAj6Ta86w+fsb2TkcmfRyVX3pBnMFcV7oQPJkl9QevSCWr3W6A=="
crossorigin="anonymous" referrerpolicy="no-referrer" />
<!-- css All Plugins Files -->
<link rel="stylesheet" href="assets/css/plugins/animate.css" />
@ -268,121 +271,7 @@ if ($_SESSION["userId"] <> "") {
</div>
<!-- Cart Floating Button end -->
<!-- Whatsapp -->
<div class="ec-style ec-right-bottom">
<!-- Start Floating Panel Container -->
<div class="ec-panel">
<!-- Panel Header -->
<div class="ec-header">
<strong>Need Help?</strong>
<p>Chat with us on WhatsApp</p>
</div>
<!-- Panel Content -->
<div class="ec-body">
<ul>
<!-- Start Single Contact List -->
<li>
<a class="ec-list" data-number="918866774266" data-message="Please help me! I have got wrong product - ORDER ID is : #654321485">
<div class="d-flex bd-highlight">
<!-- Profile Picture -->
<div class="ec-img-cont">
<img loading="lazy" src="assets/images/whatsapp/profile_01.jpg" class="ec-user-img" alt="Profile image">
<span class="ec-status-icon"></span>
</div>
<!-- Display Name & Last Seen -->
<div class="ec-user-info">
<span>Sahar Darya</span>
<p>Sahar left 7 mins ago</p>
</div>
<!-- Chat iCon -->
<div class="ec-chat-icon">
<i class="fa fa-whatsapp"></i>
</div>
</div>
</a>
</li>
<!--/ End Single Contact List -->
<!-- Start Single Contact List -->
<li>
<a class="ec-list" data-number="918866774266" data-message="Please help me! I have got wrong product - ORDER ID is : #654321485">
<div class="d-flex bd-highlight">
<!-- Profile Picture -->
<div class="ec-img-cont">
<img loading="lazy" src="assets/images/whatsapp/profile_02.jpg" class="ec-user-img" alt="Profile image">
<span class="ec-status-icon ec-online"></span>
</div>
<!-- Display Name & Last Seen -->
<div class="ec-user-info">
<span>Yolduz Rafi</span>
<p>Yolduz is online</p>
</div>
<!-- Chat iCon -->
<div class="ec-chat-icon">
<i class="fa fa-whatsapp"></i>
</div>
</div>
</a>
</li>
<!--/ End Single Contact List -->
<!-- Start Single Contact List -->
<li>
<a class="ec-list" data-number="918866774266" data-message="Please help me! I have got wrong product - ORDER ID is : #654321485">
<div class="d-flex bd-highlight">
<!-- Profile Picture -->
<div class="ec-img-cont">
<img loading="lazy" src="assets/images/whatsapp/profile_03.jpg" class="ec-user-img" alt="Profile image">
<span class="ec-status-icon ec-offline"></span>
</div>
<!-- Display Name & Last Seen -->
<div class="ec-user-info">
<span>Nargis Hawa</span>
<p>Nargis left 30 mins ago</p>
</div>
<!-- Chat iCon -->
<div class="ec-chat-icon">
<i class="fa fa-whatsapp"></i>
</div>
</div>
</a>
</li>
<!--/ End Single Contact List -->
<!-- Start Single Contact List -->
<li>
<a class="ec-list" data-number="918866774266" data-message="Please help me! I have got wrong product - ORDER ID is : #654321485">
<div class="d-flex bd-highlight">
<!-- Profile Picture -->
<div class="ec-img-cont">
<img loading="lazy" src="assets/images/whatsapp/profile_04.jpg" class="ec-user-img" alt="Profile image">
<span class="ec-status-icon ec-offline"></span>
</div>
<!-- Display Name & Last Seen -->
<div class="ec-user-info">
<span>Khadija Mehr</span>
<p>Khadija left 50 mins ago</p>
</div>
<!-- Chat iCon -->
<div class="ec-chat-icon">
<i class="fa fa-whatsapp"></i>
</div>
</div>
</a>
</li>
<!--/ End Single Contact List -->
</ul>
</div>
</div>
<!--/ End Floating Panel Container -->
<!-- Start Right Floating Button-->
<div class="ec-right-bottom">
<div class="ec-box">
<div class="ec-button rotateBackward">
<img loading="lazy" class="whatsapp" src="assets/images/common/whatsapp.png" alt="whatsapp icon" />
</div>
</div>
</div>
<!--/ End Right Floating Button-->
</div>
<!-- Whatsapp end -->
<!-- Feature tools -->
<div class="ec-tools-sidebar-overlay"></div>

View File

@ -28,7 +28,10 @@
<meta name="msapplication-TileImage" content="assets/images/favicon/favicon.png" />
<!-- css Icon Font -->
<link rel="stylesheet" href="assets/css/vendor/ecicons.min.css" />
<link rel="stylesheet" href="assets/css/vendor/ecicons.min.css" />
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.2/css/all.min.css"
integrity="sha512-SnH5WK+bZxgPHs44uWIX+LLJAJ9/2PkPKZ5QiAj6Ta86w+fsb2TkcmfRyVX3pBnMFcV7oQPJkl9QevSCWr3W6A=="
crossorigin="anonymous" referrerpolicy="no-referrer" />
<!-- css All Plugins Files -->
<link rel="stylesheet" href="assets/css/plugins/animate.css" />
@ -1080,129 +1083,7 @@
</div>
<!-- Cart Floating Button end -->
<!-- Whatsapp -->
<div class="ec-style ec-right-bottom">
<!-- Start Floating Panel Container -->
<div class="ec-panel">
<!-- Panel Header -->
<div class="ec-header">
<strong>Need Help?</strong>
<p>Chat with us on WhatsApp</p>
</div>
<!-- Panel Content -->
<div class="ec-body">
<ul>
<!-- Start Single Contact List -->
<li>
<a class="ec-list" data-number="918866774266"
data-message="Please help me! I have got wrong product - ORDER ID is : #654321485">
<div class="d-flex bd-highlight">
<!-- Profile Picture -->
<div class="ec-img-cont">
<img loading="lazy" src="assets/images/whatsapp/profile_01.jpg" class="ec-user-img"
alt="Profile image">
<span class="ec-status-icon"></span>
</div>
<!-- Display Name & Last Seen -->
<div class="ec-user-info">
<span>Sahar Darya</span>
<p>Sahar left 7 mins ago</p>
</div>
<!-- Chat iCon -->
<div class="ec-chat-icon">
<i class="fa fa-whatsapp"></i>
</div>
</div>
</a>
</li>
<!--/ End Single Contact List -->
<!-- Start Single Contact List -->
<li>
<a class="ec-list" data-number="918866774266"
data-message="Please help me! I have got wrong product - ORDER ID is : #654321485">
<div class="d-flex bd-highlight">
<!-- Profile Picture -->
<div class="ec-img-cont">
<img loading="lazy" src="assets/images/whatsapp/profile_02.jpg" class="ec-user-img"
alt="Profile image">
<span class="ec-status-icon ec-online"></span>
</div>
<!-- Display Name & Last Seen -->
<div class="ec-user-info">
<span>Yolduz Rafi</span>
<p>Yolduz is online</p>
</div>
<!-- Chat iCon -->
<div class="ec-chat-icon">
<i class="fa fa-whatsapp"></i>
</div>
</div>
</a>
</li>
<!--/ End Single Contact List -->
<!-- Start Single Contact List -->
<li>
<a class="ec-list" data-number="918866774266"
data-message="Please help me! I have got wrong product - ORDER ID is : #654321485">
<div class="d-flex bd-highlight">
<!-- Profile Picture -->
<div class="ec-img-cont">
<img loading="lazy" src="assets/images/whatsapp/profile_03.jpg" class="ec-user-img"
alt="Profile image">
<span class="ec-status-icon ec-offline"></span>
</div>
<!-- Display Name & Last Seen -->
<div class="ec-user-info">
<span>Nargis Hawa</span>
<p>Nargis left 30 mins ago</p>
</div>
<!-- Chat iCon -->
<div class="ec-chat-icon">
<i class="fa fa-whatsapp"></i>
</div>
</div>
</a>
</li>
<!--/ End Single Contact List -->
<!-- Start Single Contact List -->
<li>
<a class="ec-list" data-number="918866774266"
data-message="Please help me! I have got wrong product - ORDER ID is : #654321485">
<div class="d-flex bd-highlight">
<!-- Profile Picture -->
<div class="ec-img-cont">
<img loading="lazy" src="assets/images/whatsapp/profile_04.jpg" class="ec-user-img"
alt="Profile image">
<span class="ec-status-icon ec-offline"></span>
</div>
<!-- Display Name & Last Seen -->
<div class="ec-user-info">
<span>Khadija Mehr</span>
<p>Khadija left 50 mins ago</p>
</div>
<!-- Chat iCon -->
<div class="ec-chat-icon">
<i class="fa fa-whatsapp"></i>
</div>
</div>
</a>
</li>
<!--/ End Single Contact List -->
</ul>
</div>
</div>
<!--/ End Floating Panel Container -->
<!-- Start Right Floating Button-->
<div class="ec-right-bottom">
<div class="ec-box">
<div class="ec-button rotateBackward">
<img loading="lazy" class="whatsapp" src="assets/images/common/whatsapp.png" alt="whatsapp icon" />
</div>
</div>
</div>
<!--/ End Right Floating Button-->
</div>
<!-- Whatsapp end -->
<!-- Feature tools -->
<div class="ec-tools-sidebar-overlay"></div>

View File

@ -104,7 +104,10 @@ if (!empty($_GET['minPrice']) || !empty($_GET['maxPrice']) || !empty($_GET['cate
<meta name="msapplication-TileImage" content="assets/images/favicon/favicon.png" />
<!-- css Icon Font -->
<link rel="stylesheet" href="assets/css/vendor/ecicons.min.css" />
<link rel="stylesheet" href="assets/css/vendor/ecicons.min.css" />
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.2/css/all.min.css"
integrity="sha512-SnH5WK+bZxgPHs44uWIX+LLJAJ9/2PkPKZ5QiAj6Ta86w+fsb2TkcmfRyVX3pBnMFcV7oQPJkl9QevSCWr3W6A=="
crossorigin="anonymous" referrerpolicy="no-referrer" />
<!-- css All Plugins Files -->
<link rel="stylesheet" href="assets/css/plugins/animate.css" />
@ -794,121 +797,7 @@ if (!empty($_GET['minPrice']) || !empty($_GET['maxPrice']) || !empty($_GET['cate
</div>
<!-- Cart Floating Button end -->
<!-- Whatsapp -->
<div class="ec-style ec-right-bottom">
<!-- Start Floating Panel Container -->
<div class="ec-panel">
<!-- Panel Header -->
<div class="ec-header">
<strong>Need Help?</strong>
<p>Chat with us on WhatsApp</p>
</div>
<!-- Panel Content -->
<div class="ec-body">
<ul>
<!-- Start Single Contact List -->
<li>
<a class="ec-list" data-number="918866774266" data-message="Please help me! I have got wrong product - ORDER ID is : #654321485">
<div class="d-flex bd-highlight">
<!-- Profile Picture -->
<div class="ec-img-cont">
<img loading="lazy" src="assets/images/whatsapp/profile_01.jpg" class="ec-user-img" alt="Profile image">
<span class="ec-status-icon"></span>
</div>
<!-- Display Name & Last Seen -->
<div class="ec-user-info">
<span>Sahar Darya</span>
<p>Sahar left 7 mins ago</p>
</div>
<!-- Chat iCon -->
<div class="ec-chat-icon">
<i class="fa fa-whatsapp"></i>
</div>
</div>
</a>
</li>
<!--/ End Single Contact List -->
<!-- Start Single Contact List -->
<li>
<a class="ec-list" data-number="918866774266" data-message="Please help me! I have got wrong product - ORDER ID is : #654321485">
<div class="d-flex bd-highlight">
<!-- Profile Picture -->
<div class="ec-img-cont">
<img loading="lazy" src="assets/images/whatsapp/profile_02.jpg" class="ec-user-img" alt="Profile image">
<span class="ec-status-icon ec-online"></span>
</div>
<!-- Display Name & Last Seen -->
<div class="ec-user-info">
<span>Yolduz Rafi</span>
<p>Yolduz is online</p>
</div>
<!-- Chat iCon -->
<div class="ec-chat-icon">
<i class="fa fa-whatsapp"></i>
</div>
</div>
</a>
</li>
<!--/ End Single Contact List -->
<!-- Start Single Contact List -->
<li>
<a class="ec-list" data-number="918866774266" data-message="Please help me! I have got wrong product - ORDER ID is : #654321485">
<div class="d-flex bd-highlight">
<!-- Profile Picture -->
<div class="ec-img-cont">
<img loading="lazy" src="assets/images/whatsapp/profile_03.jpg" class="ec-user-img" alt="Profile image">
<span class="ec-status-icon ec-offline"></span>
</div>
<!-- Display Name & Last Seen -->
<div class="ec-user-info">
<span>Nargis Hawa</span>
<p>Nargis left 30 mins ago</p>
</div>
<!-- Chat iCon -->
<div class="ec-chat-icon">
<i class="fa fa-whatsapp"></i>
</div>
</div>
</a>
</li>
<!--/ End Single Contact List -->
<!-- Start Single Contact List -->
<li>
<a class="ec-list" data-number="918866774266" data-message="Please help me! I have got wrong product - ORDER ID is : #654321485">
<div class="d-flex bd-highlight">
<!-- Profile Picture -->
<div class="ec-img-cont">
<img loading="lazy" src="assets/images/whatsapp/profile_04.jpg" class="ec-user-img" alt="Profile image">
<span class="ec-status-icon ec-offline"></span>
</div>
<!-- Display Name & Last Seen -->
<div class="ec-user-info">
<span>Khadija Mehr</span>
<p>Khadija left 50 mins ago</p>
</div>
<!-- Chat iCon -->
<div class="ec-chat-icon">
<i class="fa fa-whatsapp"></i>
</div>
</div>
</a>
</li>
<!--/ End Single Contact List -->
</ul>
</div>
</div>
<!--/ End Floating Panel Container -->
<!-- Start Right Floating Button-->
<div class="ec-right-bottom">
<div class="ec-box">
<div class="ec-button rotateBackward">
<img loading="lazy" class="whatsapp" src="assets/images/common/whatsapp.png" alt="whatsapp icon" />
</div>
</div>
</div>
<!--/ End Right Floating Button-->
</div>
<!-- Whatsapp end -->
<!-- Feature tools -->
<div class="ec-tools-sidebar-overlay"></div>

File diff suppressed because it is too large Load Diff

View File

@ -33,7 +33,10 @@ if ($_SESSION["userId"] <> "") {
<meta name="msapplication-TileImage" content="assets/images/favicon/favicon.png" />
<!-- css Icon Font -->
<link rel="stylesheet" href="assets/css/vendor/ecicons.min.css" />
<link rel="stylesheet" href="assets/css/vendor/ecicons.min.css" />
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.2/css/all.min.css"
integrity="sha512-SnH5WK+bZxgPHs44uWIX+LLJAJ9/2PkPKZ5QiAj6Ta86w+fsb2TkcmfRyVX3pBnMFcV7oQPJkl9QevSCWr3W6A=="
crossorigin="anonymous" referrerpolicy="no-referrer" />
<!-- css All Plugins Files -->
<link rel="stylesheet" href="assets/css/plugins/animate.css" />
@ -50,12 +53,15 @@ if ($_SESSION["userId"] <> "") {
<!-- Background css -->
<link rel="stylesheet" id="bg-switcher-css" href="assets/css/backgrounds/bg-4.css">
<script>
function updateCartItemCount() {
$.get("cartitems.php?id=<?php echo $_SESSION['customerId']; ?>", function(data, status) {
if (data != "") {
console.log("Data: " + data + "\nStatus: " + status);
document.getElementById("cartItemCount").innerHTML = data;
document.getElementById("cartNewItemCount").innerHTML = data;
}
});
}
@ -64,10 +70,13 @@ if ($_SESSION["userId"] <> "") {
$.get("wishlistitems.php?id=<?php echo $_SESSION['customerId']; ?>", function(data) {
if (data != "") {
document.getElementById("wishItemCount").innerHTML = data;
document.getElementById("wishNewItemCount").innerHTML = data;
}
});
}
</script>
<!-- raymart added css feb 14 2024 -->
<style>
.ec-product-inner .ec-pro-image .ec-pro-actions .add-to-cart {
@ -789,121 +798,7 @@ if ($_SESSION["userId"] <> "") {
</div>
<!-- Cart Floating Button end -->
<!-- Whatsapp -->
<div class="ec-style ec-right-bottom">
<!-- Start Floating Panel Container -->
<div class="ec-panel">
<!-- Panel Header -->
<div class="ec-header">
<strong>Need Help?</strong>
<p>Chat with us on WhatsApp</p>
</div>
<!-- Panel Content -->
<div class="ec-body">
<ul>
<!-- Start Single Contact List -->
<li>
<a class="ec-list" data-number="918866774266" data-message="Please help me! I have got wrong product - ORDER ID is : #654321485">
<div class="d-flex bd-highlight">
<!-- Profile Picture -->
<div class="ec-img-cont">
<img loading="lazy" src="assets/images/whatsapp/profile_01.jpg" class="ec-user-img" alt="Profile image">
<span class="ec-status-icon"></span>
</div>
<!-- Display Name & Last Seen -->
<div class="ec-user-info">
<span>Sahar Darya</span>
<p>Sahar left 7 mins ago</p>
</div>
<!-- Chat iCon -->
<div class="ec-chat-icon">
<i class="fa fa-whatsapp"></i>
</div>
</div>
</a>
</li>
<!--/ End Single Contact List -->
<!-- Start Single Contact List -->
<li>
<a class="ec-list" data-number="918866774266" data-message="Please help me! I have got wrong product - ORDER ID is : #654321485">
<div class="d-flex bd-highlight">
<!-- Profile Picture -->
<div class="ec-img-cont">
<img loading="lazy" src="assets/images/whatsapp/profile_02.jpg" class="ec-user-img" alt="Profile image">
<span class="ec-status-icon ec-online"></span>
</div>
<!-- Display Name & Last Seen -->
<div class="ec-user-info">
<span>Yolduz Rafi</span>
<p>Yolduz is online</p>
</div>
<!-- Chat iCon -->
<div class="ec-chat-icon">
<i class="fa fa-whatsapp"></i>
</div>
</div>
</a>
</li>
<!--/ End Single Contact List -->
<!-- Start Single Contact List -->
<li>
<a class="ec-list" data-number="918866774266" data-message="Please help me! I have got wrong product - ORDER ID is : #654321485">
<div class="d-flex bd-highlight">
<!-- Profile Picture -->
<div class="ec-img-cont">
<img loading="lazy" src="assets/images/whatsapp/profile_03.jpg" class="ec-user-img" alt="Profile image">
<span class="ec-status-icon ec-offline"></span>
</div>
<!-- Display Name & Last Seen -->
<div class="ec-user-info">
<span>Nargis Hawa</span>
<p>Nargis left 30 mins ago</p>
</div>
<!-- Chat iCon -->
<div class="ec-chat-icon">
<i class="fa fa-whatsapp"></i>
</div>
</div>
</a>
</li>
<!--/ End Single Contact List -->
<!-- Start Single Contact List -->
<li>
<a class="ec-list" data-number="918866774266" data-message="Please help me! I have got wrong product - ORDER ID is : #654321485">
<div class="d-flex bd-highlight">
<!-- Profile Picture -->
<div class="ec-img-cont">
<img loading="lazy" src="assets/images/whatsapp/profile_04.jpg" class="ec-user-img" alt="Profile image">
<span class="ec-status-icon ec-offline"></span>
</div>
<!-- Display Name & Last Seen -->
<div class="ec-user-info">
<span>Khadija Mehr</span>
<p>Khadija left 50 mins ago</p>
</div>
<!-- Chat iCon -->
<div class="ec-chat-icon">
<i class="fa fa-whatsapp"></i>
</div>
</div>
</a>
</li>
<!--/ End Single Contact List -->
</ul>
</div>
</div>
<!--/ End Floating Panel Container -->
<!-- Start Right Floating Button-->
<div class="ec-right-bottom">
<div class="ec-box">
<div class="ec-button rotateBackward">
<img loading="lazy" class="whatsapp" src="assets/images/common/whatsapp.png" alt="whatsapp icon" />
</div>
</div>
</div>
<!--/ End Right Floating Button-->
</div>
<!-- Whatsapp end -->
<!-- Feature tools -->
<div class="ec-tools-sidebar-overlay"></div>

View File

@ -17,7 +17,10 @@
<meta name="msapplication-TileImage" content="assets/images/favicon/favicon.png" />
<!-- css Icon Font -->
<link rel="stylesheet" href="assets/css/vendor/ecicons.min.css" />
<link rel="stylesheet" href="assets/css/vendor/ecicons.min.css" />
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.2/css/all.min.css"
integrity="sha512-SnH5WK+bZxgPHs44uWIX+LLJAJ9/2PkPKZ5QiAj6Ta86w+fsb2TkcmfRyVX3pBnMFcV7oQPJkl9QevSCWr3W6A=="
crossorigin="anonymous" referrerpolicy="no-referrer" />
<!-- css All Plugins Files -->
<link rel="stylesheet" href="assets/css/plugins/animate.css" />
@ -450,121 +453,7 @@
</div>
<!-- Cart Floating Button end -->
<!-- Whatsapp -->
<div class="ec-style ec-right-bottom">
<!-- Start Floating Panel Container -->
<div class="ec-panel">
<!-- Panel Header -->
<div class="ec-header">
<strong>Need Help?</strong>
<p>Chat with us on WhatsApp</p>
</div>
<!-- Panel Content -->
<div class="ec-body">
<ul>
<!-- Start Single Contact List -->
<li>
<a class="ec-list" data-number="918866774266" data-message="Please help me! I have got wrong product - ORDER ID is : #654321485">
<div class="d-flex bd-highlight">
<!-- Profile Picture -->
<div class="ec-img-cont">
<img loading="lazy" src="assets/images/whatsapp/profile_01.jpg" class="ec-user-img" alt="Profile image">
<span class="ec-status-icon"></span>
</div>
<!-- Display Name & Last Seen -->
<div class="ec-user-info">
<span>Sahar Darya</span>
<p>Sahar left 7 mins ago</p>
</div>
<!-- Chat iCon -->
<div class="ec-chat-icon">
<i class="fa fa-whatsapp"></i>
</div>
</div>
</a>
</li>
<!--/ End Single Contact List -->
<!-- Start Single Contact List -->
<li>
<a class="ec-list" data-number="918866774266" data-message="Please help me! I have got wrong product - ORDER ID is : #654321485">
<div class="d-flex bd-highlight">
<!-- Profile Picture -->
<div class="ec-img-cont">
<img loading="lazy" src="assets/images/whatsapp/profile_02.jpg" class="ec-user-img" alt="Profile image">
<span class="ec-status-icon ec-online"></span>
</div>
<!-- Display Name & Last Seen -->
<div class="ec-user-info">
<span>Yolduz Rafi</span>
<p>Yolduz is online</p>
</div>
<!-- Chat iCon -->
<div class="ec-chat-icon">
<i class="fa fa-whatsapp"></i>
</div>
</div>
</a>
</li>
<!--/ End Single Contact List -->
<!-- Start Single Contact List -->
<li>
<a class="ec-list" data-number="918866774266" data-message="Please help me! I have got wrong product - ORDER ID is : #654321485">
<div class="d-flex bd-highlight">
<!-- Profile Picture -->
<div class="ec-img-cont">
<img loading="lazy" src="assets/images/whatsapp/profile_03.jpg" class="ec-user-img" alt="Profile image">
<span class="ec-status-icon ec-offline"></span>
</div>
<!-- Display Name & Last Seen -->
<div class="ec-user-info">
<span>Nargis Hawa</span>
<p>Nargis left 30 mins ago</p>
</div>
<!-- Chat iCon -->
<div class="ec-chat-icon">
<i class="fa fa-whatsapp"></i>
</div>
</div>
</a>
</li>
<!--/ End Single Contact List -->
<!-- Start Single Contact List -->
<li>
<a class="ec-list" data-number="918866774266" data-message="Please help me! I have got wrong product - ORDER ID is : #654321485">
<div class="d-flex bd-highlight">
<!-- Profile Picture -->
<div class="ec-img-cont">
<img loading="lazy" src="assets/images/whatsapp/profile_04.jpg" class="ec-user-img" alt="Profile image">
<span class="ec-status-icon ec-offline"></span>
</div>
<!-- Display Name & Last Seen -->
<div class="ec-user-info">
<span>Khadija Mehr</span>
<p>Khadija left 50 mins ago</p>
</div>
<!-- Chat iCon -->
<div class="ec-chat-icon">
<i class="fa fa-whatsapp"></i>
</div>
</div>
</a>
</li>
<!--/ End Single Contact List -->
</ul>
</div>
</div>
<!--/ End Floating Panel Container -->
<!-- Start Right Floating Button-->
<div class="ec-right-bottom">
<div class="ec-box">
<div class="ec-button rotateBackward">
<img loading="lazy" class="whatsapp" src="assets/images/common/whatsapp.png" alt="whatsapp icon" />
</div>
</div>
</div>
<!--/ End Right Floating Button-->
</div>
<!-- Whatsapp end -->
<!-- Feature tools -->
<div class="ec-tools-sidebar-overlay"></div>

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -19,6 +19,11 @@ if ($_SESSION["userId"] <> "") {
$_SESSION["isLoggedIn"] = false;
header("location: login.php");
}
if ($_SESSION["isCustomer"] == true) {
header("location: user-profile.php");
}
$products = productList();
?>
<!--=========================================================
@ -48,7 +53,10 @@ $products = productList();
<meta name="msapplication-TileImage" content="assets/images/favicon/favicon.png" />
<!-- css Icon Font -->
<link rel="stylesheet" href="assets/css/vendor/ecicons.min.css" />
<link rel="stylesheet" href="assets/css/vendor/ecicons.min.css" />
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.2/css/all.min.css"
integrity="sha512-SnH5WK+bZxgPHs44uWIX+LLJAJ9/2PkPKZ5QiAj6Ta86w+fsb2TkcmfRyVX3pBnMFcV7oQPJkl9QevSCWr3W6A=="
crossorigin="anonymous" referrerpolicy="no-referrer" />
<!-- css All Plugins Files -->
<link rel="stylesheet" href="assets/css/plugins/animate.css" />
@ -65,7 +73,9 @@ $products = productList();
<!-- Background css -->
<link rel="stylesheet" id="bg-switcher-css" href="assets/css/backgrounds/bg-4.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.1/css/all.min.css" integrity="sha512-DTOQO9RWCH3ppGqcWaEA1BIZOC6xxalwEsw9c2QQeAIftl+Vegovlnee1c9QX4TctnWMn13TZye+giMm8e2LwA==" crossorigin="anonymous" referrerpolicy="no-referrer" />
<link rel="stylesheet" href="https://cdn.metroui.org.ua/current/metro.css">
<script src="https://cdn.metroui.org.ua/current/metro.js"></script>
<style>
.pagination {
display: flex;
@ -104,6 +114,10 @@ $products = productList();
<!-- ekka Cart End -->
<!-- Category Sidebar start -->
<?php include "category-slider.php" ?>
<!-- Ec breadcrumb start -->
<div class="sticky-header-next-sec ec-breadcrumb section-space-mb">
<div class="container">
@ -186,16 +200,28 @@ $products = productList();
</div>
<div class="ec-vendor-card-body">
<div class="ec-vendor-card-table">
<table class="table ec-table">
<table class="table ec-table"
id="order-table"
data-role="table"
data-pagination="true"
data-searching="true"
data-filtering="true"
data-sorting="true"
data-show-rows-steps="5,10,20,-1"
data-horizontal-scroll="true"
data-rownum="true"
data-table-info-title="Display from $1 to $2 of $3 product(s)"
>
<thead>
<tr>
<th scope="col">Image</th>
<th scope="col">Name</th>
<th scope="col">Regular Price</th>
<th scope="col">Sale Price</th>
<th scope="col">Minimum Order</th>
<th scope="col">Stock</th>
<th scope="col">Action</th>
<th data-sortable="false" scope="col">Image</th>
<th data-sortable="true" scope="col">Name</th>
<th data-sortable="true" scope="col">Regular Price</th>
<th data-sortable="true" scope="col">Sale Price</th>
<th data-sortable="true" scope="col">Minimum Order</th>
<th data-sortable="true" scope="col">Stock</th>
<th data-sortable="true" scope="col" style=" flex-direction:row; width:200px">Action</th>
</tr>
@ -245,19 +271,22 @@ $products = productList();
</td>
<td><span style="margin-top:8px;"><?php echo $product['product_name']; ?></span></td>
<td><span style="margin-top:8px;"><?php echo $product['regular_price']; ?></span></td>
<td><span style="margin-top:8px;"><?php echo $product['sale_price']; ?></span></td>
<td><span style="margin-top:8px;"><?php echo $product['minimum_order']; ?></span></td>
<td><span style="margin-top:8px;"><?php echo $product['stock']; ?></span></td>
<td style="display:flex; justify-content:space-around;">
<span style="margin-top:4px;">
<input type="checkbox" name="product_checkbox[]" style="width:20px; height:33px; " value="<?php echo $product['_id']; ?>">
</span>
<span style="margin-top:4px;" onclick="editProduct('<?php echo $product['_id'] ?>');">
<a class="mdi mdi-circle-edit-outline" style="font-size:20px;"></a>
</span>
<span style="margin-top:4px;" onclick="deleteProduct('<?php echo $product['_id'] ?>');">
<a class="mdi mdi mdi-delete-outline" style="font-size:20px;"></a>
</span>
<td><span style="margin-top:8px;"><?php echo !empty($product['sale_price']) ?$product['sale_price']: "N/A"; ?></span></td>
<td><span style="margin-top:8px;"><?php echo !empty($product['minimum_order']) ?$product['minimum_order']: "N/A"; ?></span></td>
<td><span style="margin-top:8px;"><?php echo !empty($product['stock']) ?$product['stock']: "N/A"; ?></span></td>
<td >
<div style="display:flex; flex-direction:row; min-width:100px; flex-wrap:nowrap">
<span style="margin-right: 10px;margin-top:4px; color:blue" onclick="editProduct('<?php echo $product['_id'] ?>');">
<a class="mdi mdi-circle-edit-outline" style="font-size:20px; color:blue"></a>
</span>
<span style="margin-top:4px; margin-right: 10px;color:red" onclick="deleteProduct('<?php echo $product['_id'] ?>');">
<a class="mdi mdi mdi-delete-outline" style="font-size:20px; color:red"></a>
</span>
<span style="margin-top:4px; margin-right: 10px;">
<input type="checkbox" name="product_checkbox[]" style="width:20px; height:33px; " value="<?php echo $product['_id']; ?>">
</span>
</div>
</td>
</tr>
<?php
@ -268,13 +297,13 @@ $products = productList();
</div>
</div>
<!-- 03-11-2024 Stacy added pagination -->
<div class="pagination mt-3">
<!-- <div class="pagination mt-3">
<?php
for ($p = 1; $p <= $totalPages; $p++) {
echo "<a href='?page=$p' class='" . ($currentpage == $p ? 'active' : '') . "'>$p</a>";
}
// for ($p = 1; $p <= $totalPages; $p++) {
// echo "<a style='margin-bottom:10px' href='?page=$p' class='" . ($currentpage == $p ? 'active' : '') . "'>$p</a>";
// }
?>
</div>
</div> -->
</div>
</div>
@ -394,6 +423,7 @@ $products = productList();
} else {
console.error("Product row with ID " + productId + " not found in the DOM.");
}
location.reload();
} else {
throw new Error("Error deleting product with ID " + productId + ": " + response.statusText);
}
@ -403,10 +433,7 @@ $products = productList();
});
});
}
}
}
</script>
</section>
<!-- End Vendor dashboard section -->
@ -464,121 +491,7 @@ $products = productList();
</div>
<!-- Cart Floating Button end -->
<!-- Whatsapp -->
<div class="ec-style ec-right-bottom">
<!-- Start Floating Panel Container -->
<div class="ec-panel">
<!-- Panel Header -->
<div class="ec-header">
<strong>Need Help?</strong>
<p>Chat with us on WhatsApp</p>
</div>
<!-- Panel Content -->
<div class="ec-body">
<ul>
<!-- Start Single Contact List -->
<li>
<a class="ec-list" data-number="918866774266" data-message="Please help me! I have got wrong product - ORDER ID is : #654321485">
<div class="d-flex bd-highlight">
<!-- Profile Picture -->
<div class="ec-img-cont">
<img loading="lazy" src="assets/images/whatsapp/profile_01.jpg" class="ec-user-img" alt="Profile image">
<span class="ec-status-icon"></span>
</div>
<!-- Display Name & Last Seen -->
<div class="ec-user-info">
<span>Sahar Darya</span>
<p>Sahar left 7 mins ago</p>
</div>
<!-- Chat iCon -->
<div class="ec-chat-icon">
<i class="fa fa-whatsapp"></i>
</div>
</div>
</a>
</li>
<!--/ End Single Contact List -->
<!-- Start Single Contact List -->
<li>
<a class="ec-list" data-number="918866774266" data-message="Please help me! I have got wrong product - ORDER ID is : #654321485">
<div class="d-flex bd-highlight">
<!-- Profile Picture -->
<div class="ec-img-cont">
<img loading="lazy" src="assets/images/whatsapp/profile_02.jpg" class="ec-user-img" alt="Profile image">
<span class="ec-status-icon ec-online"></span>
</div>
<!-- Display Name & Last Seen -->
<div class="ec-user-info">
<span>Yolduz Rafi</span>
<p>Yolduz is online</p>
</div>
<!-- Chat iCon -->
<div class="ec-chat-icon">
<i class="fa fa-whatsapp"></i>
</div>
</div>
</a>
</li>
<!--/ End Single Contact List -->
<!-- Start Single Contact List -->
<li>
<a class="ec-list" data-number="918866774266" data-message="Please help me! I have got wrong product - ORDER ID is : #654321485">
<div class="d-flex bd-highlight">
<!-- Profile Picture -->
<div class="ec-img-cont">
<img loading="lazy" src="assets/images/whatsapp/profile_03.jpg" class="ec-user-img" alt="Profile image">
<span class="ec-status-icon ec-offline"></span>
</div>
<!-- Display Name & Last Seen -->
<div class="ec-user-info">
<span>Nargis Hawa</span>
<p>Nargis left 30 mins ago</p>
</div>
<!-- Chat iCon -->
<div class="ec-chat-icon">
<i class="fa fa-whatsapp"></i>
</div>
</div>
</a>
</li>
<!--/ End Single Contact List -->
<!-- Start Single Contact List -->
<li>
<a class="ec-list" data-number="918866774266" data-message="Please help me! I have got wrong product - ORDER ID is : #654321485">
<div class="d-flex bd-highlight">
<!-- Profile Picture -->
<div class="ec-img-cont">
<img loading="lazy" src="assets/images/whatsapp/profile_04.jpg" class="ec-user-img" alt="Profile image">
<span class="ec-status-icon ec-offline"></span>
</div>
<!-- Display Name & Last Seen -->
<div class="ec-user-info">
<span>Khadija Mehr</span>
<p>Khadija left 50 mins ago</p>
</div>
<!-- Chat iCon -->
<div class="ec-chat-icon">
<i class="fa fa-whatsapp"></i>
</div>
</div>
</a>
</li>
<!--/ End Single Contact List -->
</ul>
</div>
</div>
<!--/ End Floating Panel Container -->
<!-- Start Right Floating Button-->
<div class="ec-right-bottom">
<div class="ec-box">
<div class="ec-button rotateBackward">
<img loading="lazy" class="whatsapp" src="assets/images/common/whatsapp.png" alt="whatsapp icon" />
</div>
</div>
</div>
<!--/ End Right Floating Button-->
</div>
<!-- Whatsapp end -->
<!-- Feature tools -->
<div class="ec-tools-sidebar-overlay"></div>
@ -665,6 +578,7 @@ $products = productList();
<script src="assets/js/vendor/jquery.magnific-popup.min.js"></script>
<script src="assets/js/plugins/chart.min.js"></script>
<script src="assets/js/plugins/jquery.sticky-sidebar.js"></script>
<script src="https://cdn.metroui.org.ua/current/metro.js"></script>
<!-- Main Js -->
<script src="assets/js/chart-main.js"></script>

View File

@ -15,6 +15,11 @@ if ($_SESSION["userId"] <> "") {
$_SESSION["isLoggedIn"] = false;
header("location: login.php");
}
if ($_SESSION["isCustomer"] == true) {
header("location: user-profile.php");
}
if (isset($_GET['id'])) {
$_SESSION['vendorOrderId'] = $_GET['id'];
}
@ -40,7 +45,10 @@ $array = json_decode($result, true);
<meta name="msapplication-TileImage" content="assets/images/favicon/favicon.png" />
<!-- css Icon Font -->
<link rel="stylesheet" href="assets/css/vendor/ecicons.min.css" />
<link rel="stylesheet" href="assets/css/vendor/ecicons.min.css" />
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.2/css/all.min.css"
integrity="sha512-SnH5WK+bZxgPHs44uWIX+LLJAJ9/2PkPKZ5QiAj6Ta86w+fsb2TkcmfRyVX3pBnMFcV7oQPJkl9QevSCWr3W6A=="
crossorigin="anonymous" referrerpolicy="no-referrer" />
<!-- css All Plugins Files -->
<link rel="stylesheet" href="assets/css/plugins/animate.css" />
@ -218,11 +226,11 @@ $array = json_decode($result, true);
if ($array['status'] === 'TO SHIP' || $array['status'] === 'To Ship') {
echo '<div class="col-md-6">
<label for="inputEmail4" class="form-label">Tracking Number</label>
<input type="text" name="tracking_number" class="form-control slug-title" value="' . $array['tracking_number'] . '" >
<input type="text" name="tracking_number" class="form-control slug-title" value="' . $array['tracking_number'] . '" required>
</div>';
echo '<div class="col-md-6">
<label for="inputEmail4" class="form-label">COURIER NAME</label>
<input type="text" name="courier_name" class="form-control slug-title" value="' . $array['courier_name'] . '" >
<input type="text" name="courier_name" class="form-control slug-title" value="' . $array['courier_name'] . '" required>
</div>';
} elseif ($array['status'] === 'TO RECEIVE' || $array['status'] === 'To Receive') {
echo '<div class="col-md-6">
@ -252,11 +260,19 @@ $array = json_decode($result, true);
<?php
if ($array['status'] === 'TO PAY' || $array['status'] === 'To Pay') {
echo '<button type="submit" class="btn btn-primary">To Ship</button>';
echo '<button type="button" value="Back" onclick="window.history.back();" class="btn btn-primary mt-3">Back</button>';
} elseif ($array['status'] === 'TO SHIP' || $array['status'] === 'To Ship') {
echo '<button type="submit" class="btn btn-primary">To Receive</button>';
echo '<button type="button" value="Back" onclick="window.history.back();" class="btn btn-primary mt-3">Back</button>';
} elseif ($array['status'] === 'TO RECEIVE' || $array['status'] === 'To Receive') {
echo '<button type="submit" class="btn btn-primary">Completed</button>';
echo '<button type="button" value="Back" onclick="window.history.back();" class="btn btn-primary mt-3">Back</button>';
} elseif ($array['status'] === 'COMPLETED' || $array['status'] === 'Completed') {
echo '<button type="button" value="Back" onclick="window.history.back();" class="btn btn-primary">Back</button>';
} elseif ($array['status'] === 'RETURNED' || $array['status'] === 'Returned') {
echo '<button type="button" value="Back" onclick="window.history.back();" class="btn btn-primary">Back</button>';
}
?>
</div>
</form>
@ -323,121 +339,7 @@ $array = json_decode($result, true);
</div>
<!-- Cart Floating Button end -->
<!-- Whatsapp -->
<div class="ec-style ec-right-bottom">
<!-- Start Floating Panel Container -->
<div class="ec-panel">
<!-- Panel Header -->
<div class="ec-header">
<strong>Need Help?</strong>
<p>Chat with us on WhatsApp</p>
</div>
<!-- Panel Content -->
<div class="ec-body">
<ul>
<!-- Start Single Contact List -->
<li>
<a class="ec-list" data-number="918866774266" data-message="Please help me! I have got wrong product - ORDER ID is : #654321485">
<div class="d-flex bd-highlight">
<!-- Profile Picture -->
<div class="ec-img-cont">
<img loading="lazy" src="assets/images/whatsapp/profile_01.jpg" class="ec-user-img" alt="Profile image">
<span class="ec-status-icon"></span>
</div>
<!-- Display Name & Last Seen -->
<div class="ec-user-info">
<span>Sahar Darya</span>
<p>Sahar left 7 mins ago</p>
</div>
<!-- Chat iCon -->
<div class="ec-chat-icon">
<i class="fa fa-whatsapp"></i>
</div>
</div>
</a>
</li>
<!--/ End Single Contact List -->
<!-- Start Single Contact List -->
<li>
<a class="ec-list" data-number="918866774266" data-message="Please help me! I have got wrong product - ORDER ID is : #654321485">
<div class="d-flex bd-highlight">
<!-- Profile Picture -->
<div class="ec-img-cont">
<img loading="lazy" src="assets/images/whatsapp/profile_02.jpg" class="ec-user-img" alt="Profile image">
<span class="ec-status-icon ec-online"></span>
</div>
<!-- Display Name & Last Seen -->
<div class="ec-user-info">
<span>Yolduz Rafi</span>
<p>Yolduz is online</p>
</div>
<!-- Chat iCon -->
<div class="ec-chat-icon">
<i class="fa fa-whatsapp"></i>
</div>
</div>
</a>
</li>
<!--/ End Single Contact List -->
<!-- Start Single Contact List -->
<li>
<a class="ec-list" data-number="918866774266" data-message="Please help me! I have got wrong product - ORDER ID is : #654321485">
<div class="d-flex bd-highlight">
<!-- Profile Picture -->
<div class="ec-img-cont">
<img loading="lazy" src="assets/images/whatsapp/profile_03.jpg" class="ec-user-img" alt="Profile image">
<span class="ec-status-icon ec-offline"></span>
</div>
<!-- Display Name & Last Seen -->
<div class="ec-user-info">
<span>Nargis Hawa</span>
<p>Nargis left 30 mins ago</p>
</div>
<!-- Chat iCon -->
<div class="ec-chat-icon">
<i class="fa fa-whatsapp"></i>
</div>
</div>
</a>
</li>
<!--/ End Single Contact List -->
<!-- Start Single Contact List -->
<li>
<a class="ec-list" data-number="918866774266" data-message="Please help me! I have got wrong product - ORDER ID is : #654321485">
<div class="d-flex bd-highlight">
<!-- Profile Picture -->
<div class="ec-img-cont">
<img loading="lazy" src="assets/images/whatsapp/profile_04.jpg" class="ec-user-img" alt="Profile image">
<span class="ec-status-icon ec-offline"></span>
</div>
<!-- Display Name & Last Seen -->
<div class="ec-user-info">
<span>Khadija Mehr</span>
<p>Khadija left 50 mins ago</p>
</div>
<!-- Chat iCon -->
<div class="ec-chat-icon">
<i class="fa fa-whatsapp"></i>
</div>
</div>
</a>
</li>
<!--/ End Single Contact List -->
</ul>
</div>
</div>
<!--/ End Floating Panel Container -->
<!-- Start Right Floating Button-->
<div class="ec-right-bottom">
<div class="ec-box">
<div class="ec-button rotateBackward">
<img loading="lazy" class="whatsapp" src="assets/images/common/whatsapp.png" alt="whatsapp icon" />
</div>
</div>
</div>
<!--/ End Right Floating Button-->
</div>
<!-- Whatsapp end -->
<!-- Feature tools -->
<div class="ec-tools-sidebar-overlay"></div>

View File

@ -19,6 +19,8 @@ $products = productList();
$shopOrders = getOrderbyVendorId($vendorId);
$vendorOrderss = json_decode($shopOrders);
$vendorOrders1 = json_encode($shopOrders);
if (is_array($vendorOrderss)) {
$vendorOrders = json_decode($shopOrders);
@ -50,7 +52,8 @@ if ($_SESSION["isCustomer"] == true) {
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0">
<title>oBanana B2B - Elevate Your Business</title>
<meta name="keywords" content="apparel, catalog, clean, ecommerce, ecommerce HTML, electronics, fashion, html eCommerce, html store, minimal, multipurpose, multipurpose ecommerce, online store, responsive ecommerce template, shops" />
<meta name="keywords"
content="apparel, catalog, clean, ecommerce, ecommerce HTML, electronics, fashion, html eCommerce, html store, minimal, multipurpose, multipurpose ecommerce, online store, responsive ecommerce template, shops" />
<meta name="description" content="Best ecommerce html template for single and multi vendor store.">
<meta name="author" content="ashishmaraviya">
<link href="https://cdn.materialdesignicons.com/4.4.95/css/materialdesignicons.min.css" rel="stylesheet" />
@ -62,6 +65,9 @@ if ($_SESSION["isCustomer"] == true) {
<!-- css Icon Font -->
<link rel="stylesheet" href="assets/css/vendor/ecicons.min.css" />
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.2/css/all.min.css"
integrity="sha512-SnH5WK+bZxgPHs44uWIX+LLJAJ9/2PkPKZ5QiAj6Ta86w+fsb2TkcmfRyVX3pBnMFcV7oQPJkl9QevSCWr3W6A=="
crossorigin="anonymous" referrerpolicy="no-referrer" />
<!-- css All Plugins Files -->
<link rel="stylesheet" href="assets/css/plugins/animate.css" />
@ -69,7 +75,8 @@ if ($_SESSION["isCustomer"] == true) {
<link rel="stylesheet" href="assets/css/plugins/jquery-ui.min.css" />
<link rel="stylesheet" href="assets/css/plugins/countdownTimer.css" />
<link rel="stylesheet" href="assets/css/plugins/slick.min.css" />
<link rel="stylesheet" href="assets/css/plugins/bootstrap.css" />
<link rel="stylesheet" href="https://cdn.metroui.org.ua/current/metro.css">
<!-- <link rel="stylesheet" href="assets/css/plugins/bootstrap.css" /> -->
<!-- Main Style -->
<link rel="stylesheet" href="assets/css/style.css" />
@ -77,23 +84,38 @@ if ($_SESSION["isCustomer"] == true) {
<!-- Background css -->
<link rel="stylesheet" id="bg-switcher-css" href="assets/css/backgrounds/bg-4.css">
<style>
#pagination {
display: flex;
list-style: none;
padding: 0;
margin: 0;
justify-content: center;
}
#pagination {
display: flex;
list-style: none;
padding: 0;
margin: 0;
justify-content: center;
}
#pagination a {
color: #333;
text-decoration: none;
padding: 5px 10px;
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;
#pagination a {
color: #333;
text-decoration: none;
padding: 5px 10px;
border: 1px solid #ccc;
border-radius: 4px;
}
}
</style>
</head>
@ -116,10 +138,10 @@ if ($_SESSION["isCustomer"] == true) {
<!-- Ec breadcrumb start -->
<div class="sticky-header-next-sec ec-breadcrumb section-space-mb">
<div class="container">
<div class="row">
<div class="bootstrap-section container">
<div class="bootstrap-section row ">
<div class="col-12">
<div class="row ec_breadcrumb_inner">
<div class="row ec_breadcrumb_inner roww">
<div class="col-md-6 col-sm-12">
<h2 class="ec-breadcrumb-title">Vendor Dashboard</h2>
</div>
@ -140,8 +162,8 @@ if ($_SESSION["isCustomer"] == true) {
<!-- Vendor dashboard section -->
<section class="ec-page-content ec-vendor-dashboard section-space-p">
<div class="container">
<div class="row">
<div id="bootstrap-section" class="container container1">
<div class="row roww">
<!-- Sidebar Area Start -->
<div class="ec-shop-leftside ec-vendor-sidebar col-lg-3 col-md-12">
<div class="ec-sidebar-wrap ec-border-box">
@ -151,9 +173,13 @@ if ($_SESSION["isCustomer"] == true) {
<!-- 03-12-2024 Stacy added placeholder for vendor banner -->
<?php
if (!empty($vendorData['vendor_banner'])) { ?>
<div class="ec-vendor-block-bg" style="background-image: url(<?php echo $vendorData['vendor_banner'] ?>) !important;"></div>
<?php } else { ?>
<div class="ec-vendor-block-bg" style="background-color: orange; background-image: url(<?php echo $vendorData['vendor_banner'] ?>) !important;"></div>
<div class="ec-vendor-block-bg"
style="background-image: url(<?php echo $vendorData['vendor_banner'] ?>) !important;">
</div>
<?php } else { ?>
<div class="ec-vendor-block-bg"
style="background-color: orange; background-image: url(<?php echo $vendorData['vendor_banner'] ?>) !important;">
</div>
<?php } ?>
<!-- <div class="ec-vendor-block-bg" style="background-image: url(<?php #echo $vendorData['vendor_banner'] ?>) !important;"></div> -->
<div class="ec-vendor-block-detail">
@ -161,9 +187,12 @@ if ($_SESSION["isCustomer"] == true) {
<!-- 03-12-2024 Stacy added placeholder for vendor profile -->
<?php
if (!empty($vendorData['vendor_image'])) { ?>
<img loading="lazy" class="v-img" src=<?php echo $vendorData['vendor_image'] ?> alt="vendor image">
<img loading="lazy" class="v-img" src=<?php echo $vendorData['vendor_image'] ?>
alt="vendor image">
<?php } else { ?>
<img loading="lazy" class="v-img" src="https://yourteachingmentor.com/wp-content/uploads/2020/12/istockphoto-1223671392-612x612-1.jpg" alt="vendor image">
<img loading="lazy" class="v-img"
src="https://yourteachingmentor.com/wp-content/uploads/2020/12/istockphoto-1223671392-612x612-1.jpg"
alt="vendor image">
<?php } ?>
<h5 class="name"><?php echo $vendorData['user_login'] ?></h5>
</div>
@ -180,7 +209,16 @@ if ($_SESSION["isCustomer"] == true) {
</div>
</div>
</div>
<div class="ec-shop-rightside col-lg-9 col-md-12">
<?php
$filteredOrders = array_filter($vendorOrders, function($order) {
$orderArray1 = json_encode($order, true);
$orderItems1 = json_decode($orderArray1, true);
return $orderItems1['status'] !== 'TO CHECKOUT';
});
// var_dump($filteredOrders);
?>
<div class="row">
<div class="col-lg-3 col-md-6">
<div class="ec-vendor-dashboard-sort-card color-blue">
@ -197,7 +235,10 @@ if ($_SESSION["isCustomer"] == true) {
<div class="col-lg-3 col-md-6">
<div class="ec-vendor-dashboard-sort-card color-pink">
<h5>Orders</h5>
<h3> <?php echo count($vendorOrders); ?></h3>
<h3> <?php
echo count($filteredOrders );
?></h3>
</div>
</div>
<!-- 02-26-2024 Stacy commented out -->
@ -222,16 +263,20 @@ if ($_SESSION["isCustomer"] == true) {
</div>
</div>
<div class="ec-vendor-card-body">
<div class="ec-vendor-card-table">
<table class="table ec-table">
<div class="table-container">
<table class="table striped hovered" id="order-table" style="overflow-x: auto;"
data-role="table" data-pagination="true" data-searching="true" data-filtering="true"
data-sorting="true" data-show-rows-steps="5,10,20,-1" data-horizontal-scroll="true"
data-rownum="true" data-table-info-title="Display from $1 to $2 of $3 order(s)">
<thead>
<tr>
<th scope="col">Image</th>
<th scope="col">Name</th>
<th scope="col">Status</th>
<th scope="col">Customer Shipping Address</th>
<th scope="col">Total</th>
<th scope="col">Action</th>
<th data-sortable="false">Image</th>
<th data-sortable="true">Name</th>
<th data-sortable="true">Status</th>
<th data-sortable="true">Customer</th>
<th data-sortable="true">Total</th>
<th>Action</th>
</tr>
</thead>
<tbody id="orderItemsBody">
@ -243,170 +288,238 @@ if ($_SESSION["isCustomer"] == true) {
$order = $vendorOrders[$i];
$orderArray = json_encode($order, true);
$orderItems = json_decode($orderArray, true);
if ($orderItems['status'] !== 'TO CHECKOUT' ) {
foreach ($orderItems['items'] as $item) {
?>
<tr>
<td>
<!-- raymart added function feb 21 2024 -->
<?php
<tr>
<td>
<!-- raymart added function feb 21 2024 -->
<?php
# 03-11-2024 Stacy modified
if (isset($orderItems['items'][0]['product']['product_image'])) {
?>
<img loading="lazy" class="prod-img" src="<?php echo $orderItems['items'][0]['product']['product_image']; ?>" alt="edit" />
<?php
<img loading="lazy" style="height:50px; width:50px" class="prod-img"
src="<?php echo $orderItems['items'][0]['product']['product_image']; ?>"
alt="edit" />
<?php
} else {
?>
<img loading="lazy" class="prod-img rounded-circle" src="https://upload.wikimedia.org/wikipedia/commons/thumb/6/65/No-Image-Placeholder.svg/495px-No-Image-Placeholder.svg.png?20200912122019" alt="edit" />
<?php
<img loading="lazy" style="height:50px; width:50px"
class="prod-img rounded-circle"
src="https://upload.wikimedia.org/wikipedia/commons/thumb/6/65/No-Image-Placeholder.svg/495px-No-Image-Placeholder.svg.png?20200912122019"
alt="edit" />
<?php
}
?>
<!-- <?php
<!-- <?php
if (isset($item['product']['product_image']) && !empty($item['product']['product_image'])) {
echo '<img loading="lazy" src="' . $item['product']['product_image'] . '" alt="Product Image" class="prod-img">';
echo '<img loading="lazy " style="height:50px; width:50px" src="' . $item['product']['product_image'] . '" alt="Product Image" class="prod-img">';
} else {
echo '<img loading="lazy" src="assets/img/vendor/u1.jpg" class="prod-img rounded-circle" alt="Placeholder Image">';
echo '<img loading="lazy " style="height:50px; width:50px" src="assets/img/vendor/u1.jpg" class="prod-img rounded-circle" alt="Placeholder Image">';
}
?> -->
</td>
<td style="max-width:300px;"><span class="text-truncate"><?php echo $item['product']['name']; ?></span></td>
<td><span><?php echo $orderItems['status']; ?></span></td>
<td><span><?php echo $orderItems['shipping_address']['shipping_first_name']; ?></span></td>
<td><span><?php echo $orderItems['total_amount']; ?></span></td>
<td style="display:flex; justify-content:center; margin-top:-4px;">
<span onclick="editVendorOrder('<?php echo $orderItems['_id'] ?>');">
<a class="mdi mdi-circle-edit-outline" style="font-size: 20px;"></a>
</span>
</td>
</tr>
</td>
<td style="max-width:300px;"><span
class="text-truncate"><?php echo $item['product']['name']; ?></span>
</td>
<?php
$status = $orderItems['status'];
$style = '';
$textColor = '';
$borderColor = '';
switch (strtoupper($status)) {
case 'TO SHIP':
$backgroundColor = '#8061ef';
$textColor = 'white';
break;
case 'TO PAY':
$backgroundColor = '#1E6E58';
$textColor = 'white';
break;
case 'TO RECEIVE':
$backgroundColor = '#FFD700';
$textColor = 'black';
break;
case 'COMPLETED':
$backgroundColor = '#4c84ff';
$textColor = 'white';
break;
case 'RETURNED':
$backgroundColor = '#ff7b7b';
$textColor = 'white';
break;
default:
$backgroundColor = '#464646';
$textColor = 'white';
}
// Generating style attribute based on the selected colors
$style = "display: flex; height: 15px; font-weight: bold;
width: 90px; font-size: 10px !important;
justify-content: center; align-items: center; padding: 10px;
background-color: $backgroundColor; border-radius: 30px; color: $textColor;";
?>
<td><span style="<?php echo $style; ?>">
<p><?php echo $status; ?></p>
</span></td>
<td><span
style="text-transform:capitalize"><?php echo $orderItems['shipping_address']['shipping_first_name']; ?></span>
</td>
<td><span><?php echo $orderItems['total_amount']; ?></span></td>
<td style="display:flex; justify-content:center; margin-top:-4px;">
<span onclick="editVendorOrder('<?php echo $orderItems['_id'] ?>');">
<a class="mdi mdi-circle-edit-outline" style="font-size: 20px;"></a>
</span>
</td>
</tr>
<?php
}
}
}
?>
</tbody>
</table>
<!-- <button id="exportBtn">Export to CSV</button> -->
</div>
<div id="pagination"></div>
<!-- <div id="pagination"></div> -->
</div>
<script>
var sessionToken = '<?php echo isset($_SESSION["token"]) ? $_SESSION["token"] : ""; ?>';
var email = '<?php echo isset($_SESSION["email"]) ? $_SESSION["email"] : ""; ?>';
var password = '<?php echo isset($_SESSION["password"]) ? $_SESSION["password"] : ""; ?>';
function login(username, password, callback) {
fetch("https://<?php echo $_SESSION["data_endpoint"]; ?>/api/v1/login", {
method: "POST",
headers: {
"Content-Type": "application/json",
"X-Api-Key": "{{apiKey}}"
},
body: JSON.stringify({
username: username,
password: password
})
})
.then(response => {
if (response.ok) {
return response.json();
} else {
throw new Error("Unable to login");
}
})
.then(data => {
// Update the session token on the server side
fetch("update-token-session.php", {
method: "POST",
headers: {
"Content-Type": "application/json"
},
body: JSON.stringify({
token: data.token
})
})
.then(response => response.json())
.then(result => {
if (result.status === 'success') {
// Update the session token in the client-side variable
sessionToken = data.token;
console.log("New Token:", sessionToken);
callback();
} else {
throw new Error("Unable to update session token");
}
});
})
.catch(error => {
console.error("Error:", error.message);
});
}
function editVendorOrder(vendorOrderId) {
console.log("Session Token:", sessionToken);
login(email, password, function() {
window.open("vendor-dashboard-orders-edit.php?id=" + vendorOrderId, "_self");
})
}
function addProduct() {
console.log("Session Token:", sessionToken);
login(email, password, function() {
// Removed the call to updateSessionToken
window.open("vendor-uploads-add-product-action.php", "_self");
});
}
// Initialize Metro UI components
// var tables = document.querySelectorAll('[data-role="table"]');
// tables.forEach(function(table) {
// new METRO.Table(table);
// });
// document.getElementById("exportBtn").addEventListener("click", function() {
// var table = document.querySelector('#order-table')._metroTable;
// table.export('CSV', 'all', 'table-export.csv', {
// csvDelimiter: "\t",
// csvNewLine: "\r\n",
// includeHeader: true
// });
// });
</script>
<script>
const itemsPerPage = 5;
const totalItems = <?php echo $totalOrders; ?>;
const totalPages = Math.ceil(totalItems / itemsPerPage);
var sessionToken = '<?php echo isset($_SESSION["token"]) ? $_SESSION["token"] : ""; ?>';
var email = '<?php echo isset($_SESSION["email"]) ? $_SESSION["email"] : ""; ?>';
var password = '<?php echo isset($_SESSION["password"]) ? $_SESSION["password"] : ""; ?>';
//03-11-2024 Stacy modified for the pagination UI
function showPage(page) {
const startIndex = (page - 1) * itemsPerPage;
const endIndex = startIndex + itemsPerPage;
const tableRows = document.querySelectorAll('#orderItemsBody tr');
// for pagination button
const pager = document.querySelectorAll('.page-btn')
pager.forEach((row, index) => {
if (index!==page-1) {
row.style.backgroundColor="white";
row.style.color="black";
function login(username, password, callback) {
fetch("https://<?php echo $_SESSION["data_endpoint"]; ?>/api/v1/login", {
method: "POST",
headers: {
"Content-Type": "application/json",
"X-Api-Key": "{{apiKey}}"
},
body: JSON.stringify({
username: username,
password: password
})
})
.then(response => {
if (response.ok) {
return response.json();
} else {
row.style.backgroundColor="#007bff";
row.style.color="white";
throw new Error("Unable to login");
}
})
.then(data => {
// Update the session token on the server side
fetch("update-token-session.php", {
method: "POST",
headers: {
"Content-Type": "application/json"
},
body: JSON.stringify({
token: data.token
})
})
.then(response => response.json())
.then(result => {
if (result.status === 'success') {
// Update the session token in the client-side variable
sessionToken = data.token;
console.log("New Token:", sessionToken);
callback();
} else {
throw new Error("Unable to update session token");
}
});
})
.catch(error => {
console.error("Error:", error.message);
});
}
// document.querySelector('.page-' + page).style.backgroundColor="red";
tableRows.forEach((row, index) => {
if (index >= startIndex && index < endIndex) {
row.style.display = 'table-row';
} else {
row.style.display = 'none';
}
});
}
function createPagination() {
const paginationContainer = document.getElementById('pagination');
function editVendorOrder(vendorOrderId) {
for (let i = 1; i <= totalPages; i++) {
// created a tag
const pageButton = document.createElement('a');
// created class for a tag
pageButton.className = "page-btn page-" + i
pageButton.textContent = i;
pageButton.addEventListener('click', () => showPage(i));
paginationContainer.appendChild(pageButton);
console.log("Session Token:", sessionToken);
login(email, password, function() {
window.open("vendor-dashboard-orders-edit.php?id=" + vendorOrderId, "_self");
})
}
function addProduct() {
console.log("Session Token:", sessionToken);
login(email, password, function() {
// Removed the call to updateSessionToken
window.open("vendor-uploads-add-product-action.php", "_self");
});
}
</script>
<script>
const itemsPerPage = 5;
const totalItems = <?php echo $totalOrders; ?>;
const totalPages = Math.ceil(totalItems / itemsPerPage);
//03-11-2024 Stacy modified for the pagination UI
function showPage(page) {
const startIndex = (page - 1) * itemsPerPage;
const endIndex = startIndex + itemsPerPage;
const tableRows = document.querySelectorAll('#orderItemsBody tr');
// for pagination button
const pager = document.querySelectorAll('.page-btn')
pager.forEach((row, index) => {
if (index !== page - 1) {
row.style.backgroundColor = "white";
row.style.color = "black";
} else {
row.style.backgroundColor = "#007bff";
row.style.color = "white";
}
}
});
createPagination();
showPage(1); // Show the first page by default
// document.querySelector('.page-' + page).style.backgroundColor="red";
tableRows.forEach((row, index) => {
if (index >= startIndex && index < endIndex) {
row.style.display = 'table-row';
} else {
row.style.display = 'none';
}
});
}
// function createPagination() {
// const paginationContainer = document.getElementById('pagination');
// for (let i = 1; i <= totalPages; i++) {
// // created a tag
// const pageButton = document.createElement('a');
// // created class for a tag
// pageButton.className = "page-btn page-" + i
// pageButton.style="margin:5px"
// pageButton.textContent = i;
// pageButton.addEventListener('click', () => showPage(i));
// paginationContainer.appendChild(pageButton);
// }
// }
// createPagination();
showPage(1); // Show the first page by default
</script>
</div>
@ -416,20 +529,24 @@ if ($_SESSION["isCustomer"] == true) {
<div class="ec-header-btn">
<a class="btn btn-lg btn-primary" href="vendor-all-product-list.php">View All</a>
<!-- <a class="btn btn-lg btn-primary" href="vendor-uploads-add-product-action.php">Add</a> -->
<a class="btn btn-lg btn-primary" href="vendor-uploads-add-product-action.php" onclick="addProduct('<?php echo $product['_id'] ?>');">Add</a>
<a class="btn btn-lg btn-primary" href="vendor-uploads-add-product-action.php"
onclick="addProduct('<?php echo $product['_id'] ?>');">Add</a>
</div>
</div>
<div class="ec-vendor-card-body">
<div class="ec-vendor-card-table">
<table class="table ec-table">
<table class="table ec-table" id="order-table" data-role="table" data-searching="true"
data-filtering="true" data-sorting="true" data-show-rows-steps="5,10,20,-1"
data-horizontal-scroll="true" data-rownum="true"
data-table-info-title="Display from $1 to $2 of $3 product(s)">
<thead>
<tr>
<th scope="col">Image</th>
<th scope="col">Name</th>
<th scope="col">Regular Price</th>
<th scope="col">Sale Price</th>
<th scope="col">Minimum Order</th>
<th scope="col">Stock</th>
<th data-sortable="false" scope="col">Image</th>
<th data-sortable="true" scope="col">Name</th>
<th data-sortable="true" scope="col">Regular Price</th>
<th data-sortable="true" scope="col">Sale Price</th>
<th data-sortable="true" scope="col">Minimum Order</th>
<th data-sortable="true" scope="col">Stock</th>
</tr>
</thead>
@ -438,49 +555,59 @@ if ($_SESSION["isCustomer"] == true) {
$products = productListVendor($vendorId);
$totalProducts = count($products);
$displayLimit = 5;
// for ($i = 0; $i < min($totalProducts, $displayLimit); $i++) {
for ($i = 0; $i < min($totalProducts, $displayLimit); $i++) {
$product = $products[$i];
?>
<tr>
<td>
<!-- raymart added function feb 21 2024 -->
<?php
<tr>
<td>
<!-- raymart added function feb 21 2024 -->
<?php
if (isset($product['images'])) {
$image_urls = explode(',', $product['images']);
if (!empty($image_urls)) {
$first_image_url = trim($image_urls[0]);
?>
<img loading="lazy" class="prod-img" src="<?php echo $first_image_url; ?>" alt="edit" />
<?php
<img loading="lazy" class="prod-img"
src="<?php echo $first_image_url; ?>" alt="edit" />
<?php
}
} else {
?>
<img loading="lazy" class="prod-img rounded-circle" src="https://upload.wikimedia.org/wikipedia/commons/thumb/6/65/No-Image-Placeholder.svg/495px-No-Image-Placeholder.svg.png?20200912122019" alt="edit" />
<?php
<img loading="lazy" class="prod-img rounded-circle"
src="https://upload.wikimedia.org/wikipedia/commons/thumb/6/65/No-Image-Placeholder.svg/495px-No-Image-Placeholder.svg.png?20200912122019"
alt="edit" />
<?php
}
?>
<!-- <?php
<!-- <?php
if (isset($product['product_image']) && !empty($product['product_image'])) {
echo '<img loading="lazy" src="' . $product['product_image'] . '" alt="Product Image" class="prod-img" >';
} else {
echo '<img loading="lazy" src="assets/img/vendor/u1.jpg" class="prod-img rounded-circle" alt="Placeholder Image" >';
}
?> -->
</td>
<td style="max-width:300px;"><span class="text-truncate"><?php echo $product['product_name']; ?></span></td>
<td><span><?php echo $product['regular_price']; ?></span></td>
<td><span><?php echo $product['sale_price']; ?></span></td>
<td><span><?php echo $product['minimum_order']; ?></span></td>
<td><span><?php echo $product['stock']; ?></span></td>
</tr>
</td>
<td style="max-width:300px;"><span
class="text-truncate"><?php echo $product['product_name']; ?></span>
</td>
<td><span><?php echo $product['regular_price']; ?></span></td>
<td><span><?php echo !empty($product['sale_price']) ?$product['sale_price']: "N/A"; ?></span>
</td>
<td><span><?php echo !empty($product['minimum_order']) ?$product['minimum_order']: "N/A";?></span>
</td>
<td><span><?php echo !empty($product['stock']) ?$product['stock']: "0"; ?></span>
</td>
</tr>
<?php
}
?>
</tbody>
</table>
</div>
<div id="pagination"></div>
<!-- <div id="pagination"></div> -->
</div>
</div>
<!-- 02-26-2024 Stacy commented out -->
@ -516,42 +643,53 @@ if ($_SESSION["isCustomer"] == true) {
<!-- Swiper -->
<div class="qty-product-cover">
<div class="qty-slide">
<img loading="lazy" class="img-responsive" src="assets/images/product-image/3_1.jpg" alt="">
<img loading="lazy" class="img-responsive" src="assets/images/product-image/3_1.jpg"
alt="">
</div>
<div class="qty-slide">
<img loading="lazy" class="img-responsive" src="assets/images/product-image/3_2.jpg" alt="">
<img loading="lazy" class="img-responsive" src="assets/images/product-image/3_2.jpg"
alt="">
</div>
<div class="qty-slide">
<img loading="lazy" class="img-responsive" src="assets/images/product-image/3_3.jpg" alt="">
<img loading="lazy" class="img-responsive" src="assets/images/product-image/3_3.jpg"
alt="">
</div>
<div class="qty-slide">
<img loading="lazy" class="img-responsive" src="assets/images/product-image/3_4.jpg" alt="">
<img loading="lazy" class="img-responsive" src="assets/images/product-image/3_4.jpg"
alt="">
</div>
<div class="qty-slide">
<img loading="lazy" class="img-responsive" src="assets/images/product-image/3_5.jpg" alt="">
<img loading="lazy" class="img-responsive" src="assets/images/product-image/3_5.jpg"
alt="">
</div>
</div>
<div class="qty-nav-thumb">
<div class="qty-slide">
<img loading="lazy" class="img-responsive" src="assets/images/product-image/3_1.jpg" alt="">
<img loading="lazy" class="img-responsive" src="assets/images/product-image/3_1.jpg"
alt="">
</div>
<div class="qty-slide">
<img loading="lazy" class="img-responsive" src="assets/images/product-image/3_2.jpg" alt="">
<img loading="lazy" class="img-responsive" src="assets/images/product-image/3_2.jpg"
alt="">
</div>
<div class="qty-slide">
<img loading="lazy" class="img-responsive" src="assets/images/product-image/3_3.jpg" alt="">
<img loading="lazy" class="img-responsive" src="assets/images/product-image/3_3.jpg"
alt="">
</div>
<div class="qty-slide">
<img loading="lazy" class="img-responsive" src="assets/images/product-image/3_4.jpg" alt="">
<img loading="lazy" class="img-responsive" src="assets/images/product-image/3_4.jpg"
alt="">
</div>
<div class="qty-slide">
<img loading="lazy" class="img-responsive" src="assets/images/product-image/3_5.jpg" alt="">
<img loading="lazy" class="img-responsive" src="assets/images/product-image/3_5.jpg"
alt="">
</div>
</div>
</div>
<div class="col-md-7 col-sm-12 col-xs-12">
<div class="quickview-pro-content">
<h5 class="ec-quick-title"><a href="shop-left-sidebar-col-4.php">Handbag leather purse for women</a>
<h5 class="ec-quick-title"><a href="shop-left-sidebar-col-4.php">Handbag leather purse
for women</a>
</h5>
<div class="ec-quickview-rating">
<i class="ecicon eci-star fill"></i>
@ -585,7 +723,8 @@ if ($_SESSION["isCustomer"] == true) {
<span>Size</span>
<div class="ec-pro-variation-content">
<ul class="ec-opt-size">
<li class="active"><a href="#" class="ec-opt-sz" data-tooltip="Small">S</a></li>
<li class="active"><a href="#" class="ec-opt-sz"
data-tooltip="Small">S</a></li>
<li><a href="#" class="ec-opt-sz" data-tooltip="Medium">M</a></li>
<li><a href="#" class="ec-opt-sz" data-tooltip="Large">X</a></li>
<li><a href="#" class="ec-opt-sz" data-tooltip="Extra Large">XL</a></li>
@ -598,7 +737,8 @@ if ($_SESSION["isCustomer"] == true) {
<input class="qty-input" type="text" name="ec_qtybtn" value="1" />
</div>
<div class="ec-quickview-cart ">
<button class="btn btn-primary"><i class="fi-rr-shopping-basket"></i> Add To Cart</button>
<button class="btn btn-primary"><i class="fi-rr-shopping-basket"></i> Add To
Cart</button>
</div>
</div>
</div>
@ -615,16 +755,20 @@ if ($_SESSION["isCustomer"] == true) {
<div class="container">
<div class="ec-nav-panel">
<div class="ec-nav-panel-icons">
<a href="#ec-mobile-menu" class="navbar-toggler-btn ec-header-btn ec-side-toggle"><i class="fi-rr-menu-burger"></i></a>
<a href="#ec-mobile-menu" class="navbar-toggler-btn ec-header-btn ec-side-toggle"><i
class="fi-rr-menu-burger"></i></a>
</div>
<div class="ec-nav-panel-icons">
<a href="#ec-side-cart" class="toggle-cart ec-header-btn ec-side-toggle"><i class="fi-rr-shopping-bag"></i><span class="ec-cart-noti ec-header-count cart-count-lable">3</span></a>
<a href="#ec-side-cart" class="toggle-cart ec-header-btn ec-side-toggle"><i
class="fi-rr-shopping-bag"></i><span
class="ec-cart-noti ec-header-count cart-count-lable">3</span></a>
</div>
<div class="ec-nav-panel-icons">
<a href="index.php" class="ec-header-btn"><i class="fi-rr-home"></i></a>
</div>
<div class="ec-nav-panel-icons">
<a href="wishlist.html" class="ec-header-btn"><i class="fi-rr-heart"></i><span class="ec-cart-noti">4</span></a>
<a href="wishlist.html" class="ec-header-btn"><i class="fi-rr-heart"></i><span
class="ec-cart-noti">4</span></a>
</div>
<div class="ec-nav-panel-icons">
<a href="login.php" class="ec-header-btn"><i class="fi-rr-user"></i></a>
@ -658,121 +802,7 @@ if ($_SESSION["isCustomer"] == true) {
</div>
<!-- Cart Floating Button end -->
<!-- Whatsapp -->
<div class="ec-style ec-right-bottom">
<!-- Start Floating Panel Container -->
<div class="ec-panel">
<!-- Panel Header -->
<div class="ec-header">
<strong>Need Help?</strong>
<p>Chat with us on WhatsApp</p>
</div>
<!-- Panel Content -->
<div class="ec-body">
<ul>
<!-- Start Single Contact List -->
<li>
<a class="ec-list" data-number="918866774266" data-message="Please help me! I have got wrong product - ORDER ID is : #654321485">
<div class="d-flex bd-highlight">
<!-- Profile Picture -->
<div class="ec-img-cont">
<img loading="lazy" src="assets/images/whatsapp/profile_01.jpg" class="ec-user-img" alt="Profile image">
<span class="ec-status-icon"></span>
</div>
<!-- Display Name & Last Seen -->
<div class="ec-user-info">
<span>Sahar Darya</span>
<p>Sahar left 7 mins ago</p>
</div>
<!-- Chat iCon -->
<div class="ec-chat-icon">
<i class="fa fa-whatsapp"></i>
</div>
</div>
</a>
</li>
<!--/ End Single Contact List -->
<!-- Start Single Contact List -->
<li>
<a class="ec-list" data-number="918866774266" data-message="Please help me! I have got wrong product - ORDER ID is : #654321485">
<div class="d-flex bd-highlight">
<!-- Profile Picture -->
<div class="ec-img-cont">
<img loading="lazy" src="assets/images/whatsapp/profile_02.jpg" class="ec-user-img" alt="Profile image">
<span class="ec-status-icon ec-online"></span>
</div>
<!-- Display Name & Last Seen -->
<div class="ec-user-info">
<span>Yolduz Rafi</span>
<p>Yolduz is online</p>
</div>
<!-- Chat iCon -->
<div class="ec-chat-icon">
<i class="fa fa-whatsapp"></i>
</div>
</div>
</a>
</li>
<!--/ End Single Contact List -->
<!-- Start Single Contact List -->
<li>
<a class="ec-list" data-number="918866774266" data-message="Please help me! I have got wrong product - ORDER ID is : #654321485">
<div class="d-flex bd-highlight">
<!-- Profile Picture -->
<div class="ec-img-cont">
<img loading="lazy" src="assets/images/whatsapp/profile_03.jpg" class="ec-user-img" alt="Profile image">
<span class="ec-status-icon ec-offline"></span>
</div>
<!-- Display Name & Last Seen -->
<div class="ec-user-info">
<span>Nargis Hawa</span>
<p>Nargis left 30 mins ago</p>
</div>
<!-- Chat iCon -->
<div class="ec-chat-icon">
<i class="fa fa-whatsapp"></i>
</div>
</div>
</a>
</li>
<!--/ End Single Contact List -->
<!-- Start Single Contact List -->
<li>
<a class="ec-list" data-number="918866774266" data-message="Please help me! I have got wrong product - ORDER ID is : #654321485">
<div class="d-flex bd-highlight">
<!-- Profile Picture -->
<div class="ec-img-cont">
<img loading="lazy" src="assets/images/whatsapp/profile_04.jpg" class="ec-user-img" alt="Profile image">
<span class="ec-status-icon ec-offline"></span>
</div>
<!-- Display Name & Last Seen -->
<div class="ec-user-info">
<span>Khadija Mehr</span>
<p>Khadija left 50 mins ago</p>
</div>
<!-- Chat iCon -->
<div class="ec-chat-icon">
<i class="fa fa-whatsapp"></i>
</div>
</div>
</a>
</li>
<!--/ End Single Contact List -->
</ul>
</div>
</div>
<!--/ End Floating Panel Container -->
<!-- Start Right Floating Button-->
<div class="ec-right-bottom">
<div class="ec-box">
<div class="ec-button rotateBackward">
<img loading="lazy" class="whatsapp" src="assets/images/common/whatsapp.png" alt="whatsapp icon" />
</div>
</div>
</div>
<!--/ End Right Floating Button-->
</div>
<!-- Whatsapp end -->
<!-- Feature tools -->
<div class="ec-tools-sidebar-overlay"></div>
@ -847,7 +877,7 @@ if ($_SESSION["isCustomer"] == true) {
<script src="assets/js/vendor/bootstrap.min.js"></script>
<script src="assets/js/vendor/jquery-migrate-3.3.0.min.js"></script>
<script src="assets/js/vendor/modernizr-3.11.2.min.js"></script>
<script src="https://cdn.metroui.org.ua/current/metro.js"></script>
<!--Plugins JS-->
<script src="assets/js/plugins/swiper-bundle.min.js"></script>
<script src="assets/js/plugins/nouislider.js"></script>

View File

@ -33,7 +33,10 @@ $products = productList();
<meta name="msapplication-TileImage" content="assets/images/favicon/favicon.png" />
<!-- css Icon Font -->
<link rel="stylesheet" href="assets/css/vendor/ecicons.min.css" />
<link rel="stylesheet" href="assets/css/vendor/ecicons.min.css" />
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.2/css/all.min.css"
integrity="sha512-SnH5WK+bZxgPHs44uWIX+LLJAJ9/2PkPKZ5QiAj6Ta86w+fsb2TkcmfRyVX3pBnMFcV7oQPJkl9QevSCWr3W6A=="
crossorigin="anonymous" referrerpolicy="no-referrer" />
<!-- css All Plugins Files -->
<link rel="stylesheet" href="assets/css/plugins/animate.css" />
@ -74,7 +77,7 @@ $products = productList();
text-decoration: none;
padding: 5px 10px;
border: 1px solid #ccc;
/* margin: 0 5px; */
margin: 0 5px;
border-radius: 4px;
}
@ -262,7 +265,8 @@ $products = productList();
<a href="catalog-single-vendor.php?id=<?php echo $vendor['_id'] ?>">
<h6>Seller since</h6>
</a>
<p><?php echo $vendor['date_registered']; ?></p>
<!-- <p><?php echo $vendor['date_registered']; ?></p> -->
<p><?php echo date('F j, Y', strtotime($vendor['date_registered'])); ?></p>
</div>
</div>
</div>
@ -417,7 +421,7 @@ $products = productList();
<!-- Modal end -->
<!-- Footer navigation panel for responsive display -->
<div class="ec-nav-toolbar">
<!-- <div class="ec-nav-toolbar">
<div class="container">
<div class="ec-nav-panel">
<div class="ec-nav-panel-icons">
@ -438,7 +442,7 @@ $products = productList();
</div>
</div>
</div>
</div> -->
<!-- Footer navigation panel for responsive display end -->
<!-- raymart remove popup feb 20 2024 -->
@ -464,121 +468,7 @@ $products = productList();
</div>
<!-- Cart Floating Button end -->
<!-- Whatsapp -->
<div class="ec-style ec-right-bottom">
<!-- Start Floating Panel Container -->
<div class="ec-panel">
<!-- Panel Header -->
<div class="ec-header">
<strong>Need Help?</strong>
<p>Chat with us on WhatsApp</p>
</div>
<!-- Panel Content -->
<div class="ec-body">
<ul>
<!-- Start Single Contact List -->
<li>
<a class="ec-list" data-number="918866774266" data-message="Please help me! I have got wrong product - ORDER ID is : #654321485">
<div class="d-flex bd-highlight">
<!-- Profile Picture -->
<div class="ec-img-cont">
<img loading="lazy" src="assets/images/whatsapp/profile_01.jpg" class="ec-user-img" alt="Profile image">
<span class="ec-status-icon"></span>
</div>
<!-- Display Name & Last Seen -->
<div class="ec-user-info">
<span>Sahar Darya</span>
<p>Sahar left 7 mins ago</p>
</div>
<!-- Chat iCon -->
<div class="ec-chat-icon">
<i class="fa fa-whatsapp"></i>
</div>
</div>
</a>
</li>
<!--/ End Single Contact List -->
<!-- Start Single Contact List -->
<li>
<a class="ec-list" data-number="918866774266" data-message="Please help me! I have got wrong product - ORDER ID is : #654321485">
<div class="d-flex bd-highlight">
<!-- Profile Picture -->
<div class="ec-img-cont">
<img loading="lazy" src="assets/images/whatsapp/profile_02.jpg" class="ec-user-img" alt="Profile image">
<span class="ec-status-icon ec-online"></span>
</div>
<!-- Display Name & Last Seen -->
<div class="ec-user-info">
<span>Yolduz Rafi</span>
<p>Yolduz is online</p>
</div>
<!-- Chat iCon -->
<div class="ec-chat-icon">
<i class="fa fa-whatsapp"></i>
</div>
</div>
</a>
</li>
<!--/ End Single Contact List -->
<!-- Start Single Contact List -->
<li>
<a class="ec-list" data-number="918866774266" data-message="Please help me! I have got wrong product - ORDER ID is : #654321485">
<div class="d-flex bd-highlight">
<!-- Profile Picture -->
<div class="ec-img-cont">
<img loading="lazy" src="assets/images/whatsapp/profile_03.jpg" class="ec-user-img" alt="Profile image">
<span class="ec-status-icon ec-offline"></span>
</div>
<!-- Display Name & Last Seen -->
<div class="ec-user-info">
<span>Nargis Hawa</span>
<p>Nargis left 30 mins ago</p>
</div>
<!-- Chat iCon -->
<div class="ec-chat-icon">
<i class="fa fa-whatsapp"></i>
</div>
</div>
</a>
</li>
<!--/ End Single Contact List -->
<!-- Start Single Contact List -->
<li>
<a class="ec-list" data-number="918866774266" data-message="Please help me! I have got wrong product - ORDER ID is : #654321485">
<div class="d-flex bd-highlight">
<!-- Profile Picture -->
<div class="ec-img-cont">
<img loading="lazy" src="assets/images/whatsapp/profile_04.jpg" class="ec-user-img" alt="Profile image">
<span class="ec-status-icon ec-offline"></span>
</div>
<!-- Display Name & Last Seen -->
<div class="ec-user-info">
<span>Khadija Mehr</span>
<p>Khadija left 50 mins ago</p>
</div>
<!-- Chat iCon -->
<div class="ec-chat-icon">
<i class="fa fa-whatsapp"></i>
</div>
</div>
</a>
</li>
<!--/ End Single Contact List -->
</ul>
</div>
</div>
<!--/ End Floating Panel Container -->
<!-- Start Right Floating Button-->
<div class="ec-right-bottom">
<div class="ec-box">
<div class="ec-button rotateBackward">
<img loading="lazy" class="whatsapp" src="assets/images/common/whatsapp.png" alt="whatsapp icon" />
</div>
</div>
</div>
<!--/ End Right Floating Button-->
</div>
<!-- Whatsapp end -->
<!-- Feature tools -->
<div class="ec-tools-sidebar-overlay"></div>

View File

@ -45,10 +45,11 @@ if ($_SESSION["isCustomer"] == true) {
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0">
<title>oBanana B2B - Elevate Your Business</title>
<meta name="keywords" content="apparel, catalog, clean, ecommerce, ecommerce HTML, electronics, fashion, html eCommerce, html store, minimal, multipurpose, multipurpose ecommerce, online store, responsive ecommerce template, shops" />
<meta name="keywords"
content="apparel, catalog, clean, ecommerce, ecommerce HTML, electronics, fashion, html eCommerce, html store, minimal, multipurpose, multipurpose ecommerce, online store, responsive ecommerce template, shops" />
<meta name="description" content="Best ecommerce html template for single and multi vendor store.">
<meta name="author" content="ashishmaraviya">
<!-- site Favicon -->
<link rel="icon" href="assets/images/favicon/favicon.png" sizes="32x32" />
<link rel="apple-touch-icon" href="assets/images/favicon/favicon.png" />
@ -56,6 +57,9 @@ if ($_SESSION["isCustomer"] == true) {
<!-- css Icon Font -->
<link rel="stylesheet" href="assets/css/vendor/ecicons.min.css" />
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.2/css/all.min.css"
integrity="sha512-SnH5WK+bZxgPHs44uWIX+LLJAJ9/2PkPKZ5QiAj6Ta86w+fsb2TkcmfRyVX3pBnMFcV7oQPJkl9QevSCWr3W6A=="
crossorigin="anonymous" referrerpolicy="no-referrer" />
<!-- css All Plugins Files -->
<link rel="stylesheet" href="assets/css/plugins/animate.css" />
@ -70,43 +74,62 @@ if ($_SESSION["isCustomer"] == true) {
<link rel="stylesheet" href="assets/css/style2.css" />
<link rel="stylesheet" href="assets/css/responsive.css" />
<link rel="stylesheet" href="https://cdn.metroui.org.ua/current/metro.css">
<script src="https://cdn.metroui.org.ua/current/metro.js"></script>
<!-- Background css -->
<link rel="stylesheet" id="bg-switcher-css" href="assets/css/backgrounds/bg-4.css">
<style>
.tab.active {
background-color: #ffaa00;
/* Set your desired background color for the active tab */
color: #ffffff;
/* Set your desired text color for the active tab */
.tab.active {
background-color: #ffaa00;
/* Set your desired background color for the active tab */
color: #ffffff;
/* Set your desired text color for the active tab */
}
#pagination {
display: flex;
list-style: none;
padding: 0;
margin: 0;
justify-content: center;
margin-top: 20px;
}
#pagination a {
color: #333;
text-decoration: none;
padding: 5px 10px;
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;
}
#pagination {
display: flex;
list-style: none;
padding: 0;
margin: 0;
justify-content: center;
margin-top: 20px;
}
#pagination a {
color: #333;
text-decoration: none;
padding: 5px 10px;
border: 1px solid #ccc;
border-radius: 4px;
}
}
</style>
<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
<script>
function updateCartItemCount() {
$.get("cartitems.php?id=<?php echo $_SESSION['customerId']; ?>", function(data, status) {
if (data != "") {
console.log("Data: " + data + "\nStatus: " + status);
document.getElementById("cartItemCount").innerHTML = data;
}
});
}
function updateCartItemCount() {
$.get("cartitems.php?id=<?php echo $_SESSION['customerId']; ?>", function(data, status) {
if (data != "") {
console.log("Data: " + data + "\nStatus: " + status);
document.getElementById("cartItemCount").innerHTML = data;
}
});
}
</script>
</head>
@ -122,18 +145,22 @@ if ($_SESSION["isCustomer"] == true) {
<!-- Header start -->
<?php include "header.php" ?>
<!-- Header End -->
<!-- ekka Cart Start -->
<!-- ekka Cart End -->
<!-- Category Sidebar start -->
<?php include "category-slider.php" ?>
<!-- Ec breadcrumb start -->
<div class="sticky-header-next-sec ec-breadcrumb section-space-mb">
<div class="container">
<div class="row">
<div class="col-12">
<div class="row ec_breadcrumb_inner">
<div class="row ec_breadcrumb_inner roww">
<div class="col-md-6 col-sm-12">
<h2 class="ec-breadcrumb-title">User History</h2>
</div>
@ -150,12 +177,12 @@ if ($_SESSION["isCustomer"] == true) {
</div>
</div>
</div>
<!-- Ec breadcrumb end -->
<!-- Ec breadcrumb end -->
<section class="ec-page-content ec-vendor-uploads ec-user-account section-space-p">
<div class="container">
<div class="row">
<div class="row roww">
<!-- Sidebar Area Start -->
<div class="ec-shop-leftside ec-vendor-sidebar col-lg-3 col-md-12">
<div class="ec-shop-leftside ec-vendor-sidebar col-lg-3 col-md-12 ">
<div class="ec-sidebar-wrap ec-border-box">
<!-- Sidebar Category Block -->
<div class="ec-sidebar-block">
@ -163,18 +190,25 @@ if ($_SESSION["isCustomer"] == true) {
<!-- 03-12-2024 Stacy added placeholder for vendor banner -->
<?php
if (!empty($vendorData['vendor_banner'])) { ?>
<div class="ec-vendor-block-bg" style="background-image: url(<?php echo $vendorData['vendor_banner'] ?>) !important;"></div>
<?php } else { ?>
<div class="ec-vendor-block-bg" style="background-color: orange; background-image: url(<?php echo $vendorData['vendor_banner'] ?>) !important;"></div>
<div class="ec-vendor-block-bg"
style="background-image: url(<?php echo $vendorData['vendor_banner'] ?>) !important;">
</div>
<?php } else { ?>
<div class="ec-vendor-block-bg"
style="background-color: orange; background-image: url(<?php echo $vendorData['vendor_banner'] ?>) !important;">
</div>
<?php } ?>
<!-- <div class="ec-vendor-block-bg" style="background-image: url(<?php echo $vendorData['vendor_banner'] ?>) !important;"></div> -->
<div class="ec-vendor-block-detail">
<?php
<?php
if (!empty($vendorData['vendor_image'])) { ?>
<img loading="lazy" class="v-img" src=<?php echo $vendorData['vendor_image'] ?> alt="vendor image">
<?php } else { ?>
<img loading="lazy" class="v-img" src="https://yourteachingmentor.com/wp-content/uploads/2020/12/istockphoto-1223671392-612x612-1.jpg" alt="vendor image">
<?php } ?>
<img loading="lazy" class="v-img" src=<?php echo $vendorData['vendor_image'] ?>
alt="vendor image">
<?php } else { ?>
<img loading="lazy" class="v-img"
src="https://yourteachingmentor.com/wp-content/uploads/2020/12/istockphoto-1223671392-612x612-1.jpg"
alt="vendor image">
<?php } ?>
<!-- <img loading="lazy" class="v-img" src=<?php #echo $vendorData['vendor_image'] ?> alt="vendor image"> -->
<h5 class="name"><?php echo $vendorData['user_login'] ?></h5>
</div>
@ -184,11 +218,11 @@ if ($_SESSION["isCustomer"] == true) {
<li><a href="vendor-uploads.php">Upload Product</a></li>
<li><a href="vendor-settings.php">Settings (Edit)</a></li>
<li><a href="user-refund-history.php">User Refund History</a></li> -->
<!-- <li><a href="cart.html">Cart</a></li>
<!-- <li><a href="cart.html">Cart</a></li>
<li><a href="checkout.html">Checkout</a></li>
<li><a href="track-order.html">Track Order</a></li>
<li><a href="user-invoice.html">Invoice</a></li> -->
<!-- </ul>
<!-- </ul>
</div> -->
<?php include "vendor-user-tabs.php" ?>
</div>
@ -198,23 +232,27 @@ if ($_SESSION["isCustomer"] == true) {
<div class="ec-shop-rightside col-lg-9 col-md-12">
<div class="ec-vendor-dashboard-card">
<div class="ec-vendor-card-header">
<h5>Payments</h5>
<h5>Payments</h5>
</div>
<div class="ec-vendor-card-body">
<div class="ec-vendor-card-table">
<div id="payments" class="tab-content active">
<!-- Gelo added vendor payments tab -->
<table class="table ec-table">
<table class="table ec-table" id="order-table" style="overflow-x: auto;"
data-role="table" data-pagination="true" data-searching="true"
data-filtering="true" data-sorting="true" data-show-rows-steps="5,10,20,-1"
data-horizontal-scroll="true" data-rownum="true"
data-table-info-title="Display from $1 to $2 of $3 payment(s)">
<thead>
<tr>
<th scope="col">Payment Method</th>
<th scope="col">Amount</th>
<th scope="col">Status</th>
<th scope="col">Description</th>
<th scope="col">Date Created</th>
<th scope="col">Action</th>
<th data-sortable="true" scope="col">Payment Method</th>
<th data-sortable="true" scope="col">Amount</th>
<th data-sortable="true" scope="col">Status</th>
<th data-sortable="true" scope="col">Description</th>
<th data-sortable="true" scope="col">Date Created</th>
<th data-sortable="true" scope="col">Action</th>
</tr>
</thead>
<tbody id="paymentsTableBody">
@ -232,16 +270,19 @@ if ($_SESSION["isCustomer"] == true) {
}
$totalPayments++;
?>
<tr>
<td><?php echo $orderItems['payment_method']; ?></td>
<td> <?php echo $orderItems['total_amount']; ?></td>
<td><?php echo $orderItems['payment']['status']; ?></td>
<td><?php echo $orderItems['items'][0]['product']['name']; ?></td>
<td><?php echo $formattedDate?></td>
<td><button type="button" class="btn btn-primary showSinglePaymentBtn" data-order-id="<?php echo $orderItems['_id']; ?>" data-bs-toggle="modal" data-bs-target="#vendorPaymentsModal">View</button></td>
<tr>
<td><?php echo $orderItems['payment_method']; ?></td>
<td> <?php echo $orderItems['total_amount']; ?></td>
<td><?php echo $orderItems['payment']['status']; ?></td>
<td><?php echo $orderItems['items'][0]['product']['name']; ?></td>
<td><?php echo $formattedDate?></td>
<td><button type="button" class="btn btn-primary showSinglePaymentBtn"
data-order-id="<?php echo $orderItems['_id']; ?>"
data-bs-toggle="modal"
data-bs-target="#vendorPaymentsModal">View</button></td>
</tr>
</tr>
<?php
}
}
@ -250,194 +291,194 @@ if ($_SESSION["isCustomer"] == true) {
</tbody>
</table>
</div>
<div id="pagination"></div>
<!-- <div id="pagination"></div> -->
<script>
const itemsPerPage = 5;
const totalItems = <?php echo $totalPayments; ?>;
const totalPages = Math.ceil(totalItems / itemsPerPage);
const itemsPerPage = 5;
const totalItems = <?php echo $totalPayments; ?>;
const totalPages = Math.ceil(totalItems / itemsPerPage);
function showPage(page) {
const startIndex = (page - 1) * itemsPerPage;
const endIndex = startIndex + itemsPerPage;
const tableRows = document.querySelectorAll('#paymentsTableBody tr');
// for pagination button
const pager = document.querySelectorAll('.page-btn')
pager.forEach((row, index) => {
if (index!==page-1) {
row.style.backgroundColor="white";
row.style.color="black";
} else {
row.style.backgroundColor="#007bff";
row.style.color="white";
}
});
tableRows.forEach((row, index) => {
if (index >= startIndex && index < endIndex) {
row.style.display = 'table-row';
} else {
row.style.display = 'none';
}
});
}
function showPage(page) {
const startIndex = (page - 1) * itemsPerPage;
const endIndex = startIndex + itemsPerPage;
const tableRows = document.querySelectorAll('#paymentsTableBody tr');
function createPagination() {
const paginationContainer = document.getElementById('pagination');
for (let i = 1; i <= totalPages; i++) {
// created a tag
const pageButton = document.createElement('a');
// created class for a tag
pageButton.className = "page-btn page-" + i
pageButton.textContent = i;
pageButton.addEventListener('click', () => showPage(i));
paginationContainer.appendChild(pageButton);
// for pagination button
const pager = document.querySelectorAll('.page-btn')
pager.forEach((row, index) => {
if (index !== page - 1) {
row.style.backgroundColor = "white";
row.style.color = "black";
} else {
row.style.backgroundColor = "#007bff";
row.style.color = "white";
}
}
});
createPagination();
showPage(1); // Show the first page by default
tableRows.forEach((row, index) => {
if (index >= startIndex && index < endIndex) {
row.style.display = 'table-row';
} else {
row.style.display = 'none';
}
});
}
// function createPagination() {
// const paginationContainer = document.getElementById('pagination');
// for (let i = 1; i <= totalPages; i++) {
// // created a tag
// const pageButton = document.createElement('a');
// // created class for a tag
// pageButton.className = "page-btn page-" + i
// pageButton.textContent = i;
// pageButton.addEventListener('click', () => showPage(i));
// paginationContainer.appendChild(pageButton);
// }
// }
// createPagination();
showPage(1); // Show the first page by default
</script>
<script>
var sessionToken = '<?php echo isset($_SESSION["token"]) ? $_SESSION["token"] : ""; ?>';
var email = '<?php echo isset($_SESSION["email"]) ? $_SESSION["email"] : ""; ?>';
var password = '<?php echo isset($_SESSION["password"]) ? $_SESSION["password"] : ""; ?>';
var sessionToken = '<?php echo isset($_SESSION["token"]) ? $_SESSION["token"] : ""; ?>';
var email = '<?php echo isset($_SESSION["email"]) ? $_SESSION["email"] : ""; ?>';
var password =
'<?php echo isset($_SESSION["password"]) ? $_SESSION["password"] : ""; ?>';
function login(username, password, callback) {
fetch("https://<?php echo $_SESSION["data_endpoint"]; ?>/api/v1/login", {
method: "POST",
function login(username, password, callback) {
fetch("https://<?php echo $_SESSION["data_endpoint"]; ?>/api/v1/login", {
method: "POST",
headers: {
"Content-Type": "application/json",
"X-Api-Key": "{{apiKey}}"
},
body: JSON.stringify({
username: username,
password: password
})
})
.then(response => {
if (response.ok) {
return response.json();
} else {
throw new Error("Unable to login");
}
})
.then(data => {
// Update the session token on the server side
fetch("update-token-session.php", {
method: "POST",
headers: {
"Content-Type": "application/json"
},
body: JSON.stringify({
token: data.token
})
})
.then(response => response.json())
.then(result => {
if (result.status === 'success') {
// Update the session token in the client-side variable
sessionToken = data.token;
console.log("New Token:", sessionToken);
callback();
} else {
throw new Error("Unable to update session token");
}
});
})
.catch(error => {
console.error("Error:", error.message);
});
}
function updateRefundShipStatus(orderId, image, reason) {
login(email, password, function() {
fetch(`https://<?php echo $_SESSION["data_endpoint"]; ?>/api/v1/orders/${orderId}`, {
method: 'PATCH',
headers: {
"Content-Type": "application/json",
"X-Api-Key": "{{apiKey}}"
'Content-Type': 'application/json',
'Authorization': 'Bearer ' + sessionToken,
},
body: JSON.stringify({
username: username,
password: password
})
return_order: {
reason: reason,
image: image,
status: 'To Ship',
}
}),
})
.then(response => {
if (response.ok) {
return response.json();
.then(response => response.json())
.then(data => {
// Assuming the server responds with a JSON object indicating success or failure
if (data && data !== "") {
// Update the status in the table without reloading the page
// document.querySelector(`[data-order-id="${orderId}"] .order-status`).innerText = 'COMPLETED';
// location.reload();
} else {
throw new Error("Unable to login");
alert('Failed to update order status');
}
})
.catch(error => {
console.error('Error:', error);
alert('An error occurred while updating order status');
});
})
}
function updateRefundReceiveStatus(orderId, image, reason) {
login(email, password, function() {
fetch(`https://<?php echo $_SESSION["data_endpoint"]; ?>/api/v1/orders/${orderId}`, {
method: 'PATCH',
headers: {
'Content-Type': 'application/json',
'Authorization': 'Bearer ' + sessionToken,
},
body: JSON.stringify({
return_order: {
reason: reason,
image: image,
status: 'To Refund',
}
}),
})
.then(response => response.json())
.then(data => {
// Update the session token on the server side
fetch("update-token-session.php", {
method: "POST",
headers: {
"Content-Type": "application/json"
},
body: JSON.stringify({
token: data.token
})
})
.then(response => response.json())
.then(result => {
if (result.status === 'success') {
// Update the session token in the client-side variable
sessionToken = data.token;
console.log("New Token:", sessionToken);
callback();
} else {
throw new Error("Unable to update session token");
}
});
// Assuming the server responds with a JSON object indicating success or failure
if (data && data !== "") {
// Update the status in the table without reloading the page
// document.querySelector(`[data-order-id="${orderId}"] .order-status`).innerText = 'COMPLETED';
location.reload();
} else {
alert('Failed to update order status');
}
})
.catch(error => {
console.error("Error:", error.message);
console.error('Error:', error);
alert('An error occurred while updating order status');
});
}
})
function updateRefundShipStatus(orderId, image, reason) {
login(email, password, function() {
fetch(`https://<?php echo $_SESSION["data_endpoint"]; ?>/api/v1/orders/${orderId}`, {
method: 'PATCH',
headers: {
'Content-Type': 'application/json',
'Authorization': 'Bearer ' + sessionToken,
},
body: JSON.stringify({
return_order: {
reason: reason,
image: image,
status: 'To Ship',
}
}),
})
.then(response => response.json())
.then(data => {
// Assuming the server responds with a JSON object indicating success or failure
if (data && data !== "") {
// Update the status in the table without reloading the page
// document.querySelector(`[data-order-id="${orderId}"] .order-status`).innerText = 'COMPLETED';
// location.reload();
} else {
alert('Failed to update order status');
}
})
.catch(error => {
console.error('Error:', error);
alert('An error occurred while updating order status');
});
})
}
function updateRefundReceiveStatus(orderId, image, reason) {
login(email, password, function() {
fetch(`https://<?php echo $_SESSION["data_endpoint"]; ?>/api/v1/orders/${orderId}`, {
method: 'PATCH',
headers: {
'Content-Type': 'application/json',
'Authorization': 'Bearer ' + sessionToken,
},
body: JSON.stringify({
return_order: {
reason: reason,
image: image,
status: 'To Refund',
}
}),
})
.then(response => response.json())
.then(data => {
// Assuming the server responds with a JSON object indicating success or failure
if (data && data !== "") {
// Update the status in the table without reloading the page
// document.querySelector(`[data-order-id="${orderId}"] .order-status`).innerText = 'COMPLETED';
location.reload();
} else {
alert('Failed to update order status');
}
})
.catch(error => {
console.error('Error:', error);
alert('An error occurred while updating order status');
});
})
}
}
//S 03-06-2024 Stacy added upload function
function addProduct() {
console.log("Session Token:", sessionToken);
login(email, password, function() {
// Removed the call to updateSessionToken
window.open("vendor-uploads-add-product-action.php", "_self");
});
}
//S 03-06-2024 Stacy added upload function
function addProduct() {
console.log("Session Token:", sessionToken);
login(email, password, function() {
// Removed the call to updateSessionToken
window.open("vendor-uploads-add-product-action.php", "_self");
});
}
</script>
</div>
</div>
@ -447,11 +488,13 @@ if ($_SESSION["isCustomer"] == true) {
</div>
</section>
<!--Gelo added payment details modal-->
<div class="modal fade" id="vendorPaymentsModal" tabindex="-1" aria-labelledby="vendorPaymentsModalLabel" aria-hidden="true">
<div class="modal fade" id="vendorPaymentsModal" tabindex="-1" aria-labelledby="vendorPaymentsModalLabel"
aria-hidden="true">
<div class="modal-dialog modal-xl" style="min-width: 90%;">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title fs-5" id="vendorPaymentsModalLabel">Payment ID: <span id="paymentIdSpan"></span></h5>
<h5 class="modal-title fs-5" id="vendorPaymentsModalLabel">Payment ID: <span
id="paymentIdSpan"></span></h5>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
</div>
<div class="modal-body">
@ -467,48 +510,54 @@ if ($_SESSION["isCustomer"] == true) {
</div>
<!-- GELO ADDED AJAX FUNCTION FOR MODAL BOX QUERY -->
<script>
$(document).ready(function() {
$('.showSinglePaymentBtn').click(function() {
var orderId = $(this).data('order-id');
$(document).ready(function() {
$('.showSinglePaymentBtn').click(function() {
var orderId = $(this).data('order-id');
var token = "<?php echo $authtoken;?>";
<?php
var token = "<?php echo $authtoken;?>";
<?php
?>
$.ajax({
// url: 'https://api.obanana.shop/api/v1/orders/' + orderId,
url: 'https://<?php echo $_SESSION["data_endpoint"]; ?>/api/v1/orders/' + orderId,
type: 'GET',
headers: {
'Authorization': 'Bearer ' + token
},
success: function(response) {
$.ajax({
// url: 'https://api.obanana.shop/api/v1/orders/' + orderId,
url: 'https://<?php echo $_SESSION["data_endpoint"]; ?>/api/v1/orders/' +
orderId,
type: 'GET',
headers: {
'Authorization': 'Bearer ' + token
},
success: function(response) {
// Handle successful response
console.log(response);
var paymentId = response.payment.reference_number;
$('#paymentIdSpan').text(paymentId);
var gross_price = (response.payment.details[0]?.attributes.data.attributes.amount / 100).toFixed(2);
var payment_status = response.payment.status;
var fee = response.payment.details[0]?.attributes.data.attributes.fee;
var net_amount = (response.payment.details[0]?.attributes.data.attributes.payments[0].attributes.net_amount / 100).toFixed(2);
var desc = response.items[0].product.name;
var method = response.payment_method;
var name = response.billing_address.billing_first_name + " " + response.billing_address.billing_last_name;
var email = response.payment.details[0]?.attributes.data.attributes.payments[0].attributes.billing?.email;
var phone = response.billing_address.billing_phone;
var rawDate = response.payment.details[0]?.attributes.data.attributes.payments[0]?.createdAt;
var payoutStatus = response.payout_status[0]?.status;
if (rawDate){
var createdAtDate = new Date(rawDate);
var month = String(createdAtDate.getMonth() + 1).padStart(2, '0');
var day = String(createdAtDate.getDate()).padStart(2, '0');
var year = createdAtDate.getFullYear();
var date = month + '/' + day + '/' + year;
}
var paymentId = response.payment.reference_number;
$('#paymentIdSpan').text(paymentId);
var gross_price = (response.payment.details[0]?.attributes.data
.attributes.amount / 100).toFixed(2);
var payment_status = response.payment.status;
var fee = response.payment.details[0]?.attributes.data.attributes.fee;
var net_amount = (response.payment.details[0]?.attributes.data
.attributes.payments[0].attributes.net_amount / 100).toFixed(2);
var desc = response.items[0].product.name;
var method = response.payment_method;
var name = response.billing_address.billing_first_name + " " + response
.billing_address.billing_last_name;
var email = response.payment.details[0]?.attributes.data.attributes
.payments[0].attributes.billing?.email;
var phone = response.billing_address.billing_phone;
var rawDate = response.payment.details[0]?.attributes.data.attributes
.payments[0]?.createdAt;
var payoutStatus = response.payout_status[0]?.status;
if (rawDate) {
var createdAtDate = new Date(rawDate);
var month = String(createdAtDate.getMonth() + 1).padStart(2, '0');
var day = String(createdAtDate.getDate()).padStart(2, '0');
var year = createdAtDate.getFullYear();
var date = month + '/' + day + '/' + year;
}
if(payoutStatus === 'Deposited'){
var orderDetailsHtml = `
if (payoutStatus === 'Deposited') {
var orderDetailsHtml = `
<div class="row">
<div class="col-12">
@ -575,8 +624,8 @@ if ($_SESSION["isCustomer"] == true) {
</div>
</div>
`;
}else{
var orderDetailsHtml = `
} else {
var orderDetailsHtml = `
<div class="row">
<div class="col-12">
@ -636,13 +685,13 @@ if ($_SESSION["isCustomer"] == true) {
</div>
</div>
`;
}
$('#orderDetailsContainer').html(orderDetailsHtml);
},
})
});
}
$('#orderDetailsContainer').html(orderDetailsHtml);
},
})
});
});
</script>
<!-- Footer Start -->
<?php include "footer.php" ?>
@ -654,16 +703,20 @@ if ($_SESSION["isCustomer"] == true) {
<div class="container">
<div class="ec-nav-panel">
<div class="ec-nav-panel-icons">
<a href="#ec-mobile-menu" class="navbar-toggler-btn ec-header-btn ec-side-toggle"><i class="fi-rr-menu-burger"></i></a>
<a href="#ec-mobile-menu" class="navbar-toggler-btn ec-header-btn ec-side-toggle"><i
class="fi-rr-menu-burger"></i></a>
</div>
<div class="ec-nav-panel-icons">
<a href="#ec-side-cart" class="toggle-cart ec-header-btn ec-side-toggle"><i class="fi-rr-shopping-bag"></i><span class="ec-cart-noti ec-header-count cart-count-lable">3</span></a>
<a href="#ec-side-cart" class="toggle-cart ec-header-btn ec-side-toggle"><i
class="fi-rr-shopping-bag"></i><span
class="ec-cart-noti ec-header-count cart-count-lable">3</span></a>
</div>
<div class="ec-nav-panel-icons">
<a href="index.php" class="ec-header-btn"><i class="fi-rr-home"></i></a>
</div>
<div class="ec-nav-panel-icons">
<a href="wishlist.html" class="ec-header-btn"><i class="fi-rr-heart"></i><span class="ec-cart-noti">4</span></a>
<a href="wishlist.html" class="ec-header-btn"><i class="fi-rr-heart"></i><span
class="ec-cart-noti">4</span></a>
</div>
<div class="ec-nav-panel-icons">
<a href="login.php" class="ec-header-btn"><i class="fi-rr-user"></i></a>
@ -683,121 +736,7 @@ if ($_SESSION["isCustomer"] == true) {
</div>
<!-- Cart Floating Button end -->
<!-- Whatsapp -->
<div class="ec-style ec-right-bottom">
<!-- Start Floating Panel Container -->
<div class="ec-panel">
<!-- Panel Header -->
<div class="ec-header">
<strong>Need Help?</strong>
<p>Chat with us on WhatsApp</p>
</div>
<!-- Panel Content -->
<div class="ec-body">
<ul>
<!-- Start Single Contact List -->
<li>
<a class="ec-list" data-number="918866774266" data-message="Please help me! I have got wrong product - ORDER ID is : #654321485">
<div class="d-flex bd-highlight">
<!-- Profile Picture -->
<div class="ec-img-cont">
<img loading="lazy" src="assets/images/whatsapp/profile_01.jpg" class="ec-user-img" alt="Profile image">
<span class="ec-status-icon"></span>
</div>
<!-- Display Name & Last Seen -->
<div class="ec-user-info">
<span>Sahar Darya</span>
<p>Sahar left 7 mins ago</p>
</div>
<!-- Chat iCon -->
<div class="ec-chat-icon">
<i class="fa fa-whatsapp"></i>
</div>
</div>
</a>
</li>
<!--/ End Single Contact List -->
<!-- Start Single Contact List -->
<li>
<a class="ec-list" data-number="918866774266" data-message="Please help me! I have got wrong product - ORDER ID is : #654321485">
<div class="d-flex bd-highlight">
<!-- Profile Picture -->
<div class="ec-img-cont">
<img loading="lazy" src="assets/images/whatsapp/profile_02.jpg" class="ec-user-img" alt="Profile image">
<span class="ec-status-icon ec-online"></span>
</div>
<!-- Display Name & Last Seen -->
<div class="ec-user-info">
<span>Yolduz Rafi</span>
<p>Yolduz is online</p>
</div>
<!-- Chat iCon -->
<div class="ec-chat-icon">
<i class="fa fa-whatsapp"></i>
</div>
</div>
</a>
</li>
<!--/ End Single Contact List -->
<!-- Start Single Contact List -->
<li>
<a class="ec-list" data-number="918866774266" data-message="Please help me! I have got wrong product - ORDER ID is : #654321485">
<div class="d-flex bd-highlight">
<!-- Profile Picture -->
<div class="ec-img-cont">
<img loading="lazy" src="assets/images/whatsapp/profile_03.jpg" class="ec-user-img" alt="Profile image">
<span class="ec-status-icon ec-offline"></span>
</div>
<!-- Display Name & Last Seen -->
<div class="ec-user-info">
<span>Nargis Hawa</span>
<p>Nargis left 30 mins ago</p>
</div>
<!-- Chat iCon -->
<div class="ec-chat-icon">
<i class="fa fa-whatsapp"></i>
</div>
</div>
</a>
</li>
<!--/ End Single Contact List -->
<!-- Start Single Contact List -->
<li>
<a class="ec-list" data-number="918866774266" data-message="Please help me! I have got wrong product - ORDER ID is : #654321485">
<div class="d-flex bd-highlight">
<!-- Profile Picture -->
<div class="ec-img-cont">
<img loading="lazy" src="assets/images/whatsapp/profile_04.jpg" class="ec-user-img" alt="Profile image">
<span class="ec-status-icon ec-offline"></span>
</div>
<!-- Display Name & Last Seen -->
<div class="ec-user-info">
<span>Khadija Mehr</span>
<p>Khadija left 50 mins ago</p>
</div>
<!-- Chat iCon -->
<div class="ec-chat-icon">
<i class="fa fa-whatsapp"></i>
</div>
</div>
</a>
</li>
<!--/ End Single Contact List -->
</ul>
</div>
</div>
<!--/ End Floating Panel Container -->
<!-- Start Right Floating Button-->
<div class="ec-right-bottom">
<div class="ec-box">
<div class="ec-button rotateBackward">
<img loading="lazy" class="whatsapp" src="assets/images/common/whatsapp.png" alt="whatsapp icon" />
</div>
</div>
</div>
<!--/ End Right Floating Button-->
</div>
<!-- Whatsapp end -->
<!-- Feature tools -->
<div class="ec-tools-sidebar-overlay"></div>
@ -872,7 +811,7 @@ if ($_SESSION["isCustomer"] == true) {
<script src="assets/js/vendor/bootstrap.min.js"></script>
<script src="assets/js/vendor/jquery-migrate-3.3.0.min.js"></script>
<script src="assets/js/vendor/modernizr-3.11.2.min.js"></script>
<!--Plugins JS-->
@ -885,9 +824,10 @@ if ($_SESSION["isCustomer"] == true) {
<script src="assets/js/vendor/jquery.magnific-popup.min.js"></script>
<script src="assets/js/plugins/jquery.sticky-sidebar.js"></script>
<script src="assets/js/plugins/nouislider.js"></script>
<script>
const tooltipTriggerList = document.querySelectorAll('[data-bs-toggle="tooltip"]')
const tooltipList = [...tooltipTriggerList].map(tooltipTriggerEl => new bootstrap.Tooltip(tooltipTriggerEl))
<!-- <script src="https://cdn.metroui.org.ua/current/metro.js"></script> -->
<script>
const tooltipTriggerList = document.querySelectorAll('[data-bs-toggle="tooltip"]')
const tooltipList = [...tooltipTriggerList].map(tooltipTriggerEl => new bootstrap.Tooltip(tooltipTriggerEl))
</script>
<!-- Main Js -->
<script src="assets/js/vendor/index.js"></script>

View File

@ -51,7 +51,8 @@ $vendorPayoutData = json_decode($response, true);
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0">
<title>oBanana B2B - Elevate Your Business</title>
<meta name="keywords" content="apparel, catalog, clean, ecommerce, ecommerce HTML, electronics, fashion, html eCommerce, html store, minimal, multipurpose, multipurpose ecommerce, online store, responsive ecommerce template, shops" />
<meta name="keywords"
content="apparel, catalog, clean, ecommerce, ecommerce HTML, electronics, fashion, html eCommerce, html store, minimal, multipurpose, multipurpose ecommerce, online store, responsive ecommerce template, shops" />
<meta name="description" content="Best ecommerce html template for single and multi vendor store.">
<meta name="author" content="ashishmaraviya">
@ -62,6 +63,9 @@ $vendorPayoutData = json_decode($response, true);
<!-- css Icon Font -->
<link rel="stylesheet" href="assets/css/vendor/ecicons.min.css" />
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.2/css/all.min.css"
integrity="sha512-SnH5WK+bZxgPHs44uWIX+LLJAJ9/2PkPKZ5QiAj6Ta86w+fsb2TkcmfRyVX3pBnMFcV7oQPJkl9QevSCWr3W6A=="
crossorigin="anonymous" referrerpolicy="no-referrer" />
<!-- css All Plugins Files -->
<link rel="stylesheet" href="assets/css/plugins/animate.css" />
@ -75,34 +79,55 @@ $vendorPayoutData = json_decode($response, true);
<link rel="stylesheet" href="assets/css/style.css" />
<link rel="stylesheet" href="assets/css/style2.css" />
<link rel="stylesheet" href="assets/css/responsive.css" />
<link href="https://cdn.datatables.net/v/bs5/dt-2.0.3/r-3.0.0/sp-2.3.0/datatables.min.css" rel="stylesheet">
<link rel="stylesheet" href="https://cdn.metroui.org.ua/current/metro.css">
<script src="https://cdn.metroui.org.ua/current/metro.js"></script>
<!-- Background css -->
<link rel="stylesheet" id="bg-switcher-css" href="assets/css/backgrounds/bg-4.css">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/select2@latest/dist/css/select2.min.css" crossorigin="anonymous" referrerpolicy="no-referrer" />
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/select2@latest/dist/css/select2.min.css"
crossorigin="anonymous" referrerpolicy="no-referrer" />
<script src="https://code.jquery.com/jquery-3.6.4.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/select2@latest/dist/js/select2.min.js" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
<script src="https://cdn.jsdelivr.net/npm/select2@latest/dist/js/select2.min.js" crossorigin="anonymous"
referrerpolicy="no-referrer"></script>
<script>
function renewToken() {
var xhr = new XMLHttpRequest();
xhr.open("GET", "vendor-payoutsTokenRN.php", true);
xhr.send();
}
function renewToken() {
var xhr = new XMLHttpRequest();
xhr.open("GET", "vendor-payoutsTokenRN.php", true);
xhr.send();
}
setInterval(function() {
var currentTime = <?php echo time(); ?>;
var renewalTime = <?php echo $renewal_time; ?>;
var expirationTime = <?php echo $expiration_time; ?>;
setInterval(function() {
var currentTime = <?php echo time(); ?>;
var renewalTime = <?php echo $renewal_time; ?>;
var expirationTime = <?php echo $expiration_time; ?>;
if (currentTime >= renewalTime || currentTime >= expirationTime) {
renewToken();
}
}, 60000);
if (currentTime >= renewalTime || currentTime >= expirationTime) {
renewToken();
}
}, 60000);
</script>
</head>
<style>
.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;
}
}
</style>
<body class="shop_page">
<div id="ec-overlay">
@ -130,15 +155,15 @@ $vendorPayoutData = json_decode($response, true);
<div class="container">
<div class="row">
<div class="col-12">
<div class="row ec_breadcrumb_inner">
<div class="row ec_breadcrumb_inner roww">
<div class="col-md-6 col-sm-12">
<h2 class="ec-breadcrumb-title">Vendor Settings</h2>
<h2 class="ec-breadcrumb-title">Vendor Payouts</h2>
</div>
<div class="col-md-6 col-sm-12">
<!-- ec-breadcrumb-list start -->
<ul class="ec-breadcrumb-list">
<li class="ec-breadcrumb-item"><a href="index.php">Home</a></li>
<li class="ec-breadcrumb-item active">Settings</li>
<li class="ec-breadcrumb-item active">Payouts</li>
</ul>
<!-- ec-breadcrumb-list end -->
</div>
@ -152,183 +177,230 @@ $vendorPayoutData = json_decode($response, true);
<!-- Vendor setting section -->
<section class="ec-page-content ec-vendor-uploads section-space-p">
<div class="container">
<div class="row">
<div class="row roww">
<!-- Sidebar Area Start -->
<div class="ec-shop-leftside ec-vendor-sidebar col-lg-3 col-md-12">
<div class="ec-sidebar-wrap ec-border-box">
<!-- Sidebar Category Block -->
<div class="ec-sidebar-block">
<div class="ec-vendor-block">
<!-- 03-12-2024 Stacy added placeholder for vendor banner -->
<?php
if (!empty($vendorData['vendor_banner'])) { ?>
<div class="ec-vendor-block-bg"
style="background-image: url(<?php echo $vendorData['vendor_banner'] ?>) !important;">
</div>
<?php } else { ?>
<div class="ec-vendor-block-bg"
style="background-color: orange; background-image: url(<?php echo $vendorData['vendor_banner'] ?>) !important;">
</div>
<?php } ?>
<!-- <div class="ec-vendor-block-bg" style="background-image: url(<?php #echo $vendorData['vendor_banner'] ?>) !important;"></div> -->
<div class="ec-vendor-block-detail">
<!-- <img loading="lazy" class="v-img" src=<?php #echo $vendorData['vendor_image'] ?> alt="vendor image"> -->
<!-- 03-12-2024 Stacy added placeholder for vendor profile -->
<?php
if (!empty($vendorData['vendor_image'])) { ?>
<img loading="lazy" class="v-img" src=<?php echo $vendorData['vendor_image'] ?>
alt="vendor image">
<?php } else { ?>
<img loading="lazy" class="v-img"
src="https://yourteachingmentor.com/wp-content/uploads/2020/12/istockphoto-1223671392-612x612-1.jpg"
alt="vendor image">
<?php } ?>
<h5 class="name"><?php echo $vendorData['user_login'] ?></h5>
</div>
<!-- <div class="ec-vendor-block-items">
<ul>
<li><a href="vendor-dashboard.php">Dashboard</a></li>
<li><a onclick="addProduct();" href="">Upload Product</a></li>
<li><a href="vendor-settings.php">Settings (Edit)</a></li>
</ul>
</div> -->
<?php include "vendor-user-tabs.php" ?>
</div>
</div>
</div>
</div>
<div class="ec-shop-rightside col-lg-9 col-md-12">
<div class="ec-vendor-dashboard-card ec-vendor-setting-card">
<div class="ec-vendor-card-body">
<div class="row">
<div class="col-md-12 mb-5">
<div class="panel panel-primary">
<div class="panel-heading">
<h5 class="panel-title"><strong>Upcoming Payout</strong></h5>
</div>
<div class="panel-body ">
<div class="row">
<h4 style="color: #444;">
<div class="d-flex align-items-center">
<?php
$response = getOrderbyVendorId($vendorId);
$upcomingPayout = json_decode($response, true);
$payoutSum = 0;
foreach ($upcomingPayout as $x => $val) {
$paymentStatus = strtolower($val['payment']['status']);
$orderStatus = strtolower($val['status']);
$payoutStatus = empty($val['payout_status']);
if(( $paymentStatus == "paid") && ( $orderStatus == "completed") && ($payoutStatus == true)){
$orderAmount = $val['total_amount'];
$payoutSum += $orderAmount;
}
}
$finalPayoutSum = number_format($payoutSum, 2, '.', ',');
?>
<strong>
<?php echo $finalPayoutSum ?>
</strong>
</div>
</h4>
<!-- <div class="text-sm mt-3">
Payout Generation: Tue, Mar 19, 2024
</div>
<div class="text-sm">
Receive Payout on or before: Wed, Mar 20, 2024
</div> -->
<div class="text-sm">
<?php
$vendorResponse = getVendorbyId($vendorId);
$vendorInformation = json_decode($vendorResponse, true);
$bankAccountNumber = $vendorInformation['bank_acount_details'][0]['bank_account_number'];
$bankNumEnding = substr($bankAccountNumber, -3);
?>
Receipient: Philippine National Bank (PNB) Account ending in <?php echo $bankNumEnding?>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-md-12">
<div class="ec-vendor-dashboard-card">
<div class="ec-vendor-card-header">
<h5><strong>Upcoming Payout</strong></h5>
</div>
<!-- ADDITIONAL PANELS FOR PAYOUTS FOR FUTURE USE, DO NOT REMOVE -->
<!-- <div class="col-md-4 mb-5">
<div class="panel panel-primary">
<div class="panel-heading">
<h5 class="panel-title"><strong>Payout Generation Schedule</strong></h5>
</div>
<div class="panel-body ">
<div class="row">
<h4 style="color: #444;">
<div class="d-flex align-items-center">
<i class="fi-rs-calendar mt-1 mr-3 "></i>
<strong>
Weekly
</strong>
</div>
</h4>
<div class="mt-3">
<h6>
<strong class="text-primary ">Every Tuesday</strong>
</h6>
</div>
<div class="text-sm">
Payouts that will fall on holiday will be processed the next banking day
</div>
</div>
</div>
</div>
</div>
<div class="col-md-4 mb-5">
<div class="panel panel-primary">
<div class="panel-heading">
<h5 class="panel-title"><strong>Next Payout</strong></h5>
</div>
<div class="panel-body ">
<div class="row">
<h4 style="color: #444;">
<div class="d-flex align-items-center">
<strong>
0.00
</strong>
</div>
</h4>
<- <div class="text-sm mt-3">
Payout Generation: Tue, Mar 25, 2024
</div>
<div class="text-sm">
Receive Payout on or before: Wed, Mar 26, 2024
</div> -
<div class="text-sm">
Receipient: Philippine National Bank (PNB) Account ending in <php echo $bankNumEnding?>
</div>
</div>
</div>
</div>
</div> -->
<div class="col-md-12 mt-3">
<h5 class='m-0'><strong>Payout History</strong></h5>
<div class="table-responsive px-4">
<table id='payoutsTableContent' class="table ec-table">
<thead>
<tr>
<th scope="col">Amount</th>
<th scope="col">Bank</th>
<th scope="col">Account Number</th>
<th scope="col">Payout Generation</th>
<th scope="col">Status</th>
<th scope="col">Action</th>
<div class="ec-vendor-card-body">
<div class="row">
<h4 style="color: #444;">
<div class="d-flex align-items-center">
<?php
$response = getOrderbyVendorId($vendorId);
$upcomingPayout = json_decode($response, true);
$payoutSum = 0;
</tr>
</thead>
<tbody class='table-group-divider'>
<?php
foreach ($vendorPayoutData as $x => $val) {
$vendorIdCheck = $val['vendor_details'][0]['vendor_id'];
$status = ucfirst(strtolower($val['status']));
$payoutDate = date("F d, Y", strtotime($val['createdAt']));
$payoutId = $val['_id'];
if ((empty($vendorIdCheck) == false) && ($vendorIdCheck == $vendorId) && ($status == "Deposited")) { ?>
<tr>
<td> <?php echo "" . $val['net_amount'] ?> </td>
<?php if (empty($val['bank_information'][0]['bank_name']) == false) {
?>
<td> <?php echo $val['bank_information'][0]['bank_name'] ?> </td>
<?php } else { ?>
<td> N/A </td>
<?php }
if (empty($val['bank_information'][0]['bank_account_number']) == false) {
$accNum = $val['bank_information'][0]['bank_account_number'];
// Replace characters with asterisks for all characters except the last three segments
$maskedAccNum = substr_replace($accNum, str_repeat('*', strlen($accNum) - 3), 0, -3); ?>
<td> <?php echo $maskedAccNum ?> </td>
<?php } else { ?>
<td> N/A </td>
<?php } ?>
<td> <?php echo $payoutDate ?> </td>
<td> <?php echo $status ?> </td>
<td>
<button type="button" class="btn btn-primary btn-sm showSinglePayoutBtn" data-order-id="<?php echo $payoutId; ?>" data-bs-toggle="modal" data-bs-target="#payoutsModal">View</button>
</td>
</tr>
<?php
foreach ($upcomingPayout as $x => $val) {
$paymentStatus = strtolower($val['payment']['status']);
$orderStatus = strtolower($val['status']);
$payoutStatus = empty($val['payout_status']);
if(( $paymentStatus == "paid") && ( $orderStatus == "completed") && ($payoutStatus == true)){
$orderAmount = $val['total_amount'];
$payoutSum += $orderAmount;
}
} ?>
</tbody>
</table>
}
$finalPayoutSum = number_format($payoutSum, 2, '.', ',');
?>
<strong>
<?php echo $finalPayoutSum ?>
</strong>
</div>
</h4>
<!-- <div class="text-sm mt-3">
Payout Generation: Tue, Mar 19, 2024
</div>
<div class="text-sm">
Receive Payout on or before: Wed, Mar 20, 2024
</div> -->
<div class="text-sm">
<?php
$vendorResponse = getVendorbyId($vendorId);
$vendorInformation = json_decode($vendorResponse, true);
$bankAccountNumber = $vendorInformation['bank_acount_details'][0]['bank_account_number'];
$bankDetails = $vendorInformation['bank_acount_details'];
foreach ($bankDetails as $details) {
if ($details['bank_payout'] === true) {
$bankName = $details['bank_name'];
$bankAccountNumber = $details['bank_account_number'];
}
}
$bankNumEnding = substr($bankAccountNumber, -3);
?>
Receipient: <?php echo $bankName; ?> Account ending in
<?php echo $bankNumEnding?>
</div>
</div>
</div>
</div>
</div>
<!-- ADDITIONAL PANELS FOR PAYOUTS FOR FUTURE USE, DO NOT REMOVE -->
<!-- <div class="col-md-12">
<div class="ec-vendor-dashboard-card">
<div class="ec-vendor-card-header">
<h5><strong>Payout Generation Schedule</strong></h5>
</div>
<div class="ec-vendor-card-body">
<div class="row">
<h4 style="color: #444;">
<div class="d-flex align-items-center">
<i class="fi-rs-calendar mt-1 mr-3 "></i>
<strong>
Weekly
</strong>
</div>
</h4>
<div class="mt-3">
<h6>
<strong class="text-primary ">Every Tuesday</strong>
</h6>
</div>
<div class="text-sm">
Payouts that will fall on holiday will be processed the next banking day
</div>
</div>
</div>
</div>
</div>
<div class="col-md-12">
<div class="ec-vendor-dashboard-card">
<div class="ec-vendor-card-header">
<h5><strong>Next Payout</strong></h5>
</div>
<div class="ec-vendor-card-body">
<div class="row">
<h4 style="color: #444;">
<div class="d-flex align-items-center">
<strong>
0.00
</strong>
</div>
</h4>
<div class="text-sm mt-3">
Payout Generation: Tue, Mar 25, 2024
</div>
<div class="text-sm">
Receive Payout on or before: Wed, Mar 26, 2024
</div>
<div class="text-sm">
Receipient: Philippine National Bank (PNB) Account ending in 123
</div>
</div>
</div>
</div>
</div> -->
</div>
<div class="ec-vendor-dashboard-card space-bottom-30">
<div class="ec-vendor-card-header">
<h5>Payout History</h5>
</div>
<div class="ec-vendor-card-body">
<div class="ec-vendor-card-table">
<table class="table ec-table" id="payout-table" style="overflow-x: auto;"
data-role="table" data-pagination="true" data-searching="true" data-filtering="true"
data-sorting="true" data-show-rows-steps="5,10,20,-1" data-horizontal-scroll="true"
data-rownum="true" data-table-info-title="Display from $1 to $2 of $3 payment(s)">
<thead>
<tr>
<th data-sortable="true" scope="col">Amount</th>
<th data-sortable="true" scope="col">Bank</th>
<th data-sortable="true" scope="col">Account Number</th>
<th data-sortable="true" scope="col">Payout Generation</th>
<th data-sortable="true" scope="col">Status</th>
<th data-sortable="true" scope="col">Action</th>
</tr>
</thead>
<tbody class='table-group-divider'>
<?php
foreach (array_reverse($vendorPayoutData) as $x => $val) {
$vendorIdCheck = $val['vendor_details'][0]['vendor_id'];
$status = ucfirst(strtolower($val['status']));
$payoutDate = date("F d, Y", strtotime($val['createdAt']));
$payoutId = $val['_id'];
if ((empty($vendorIdCheck) == false) && ($vendorIdCheck == $vendorId) && ($status == "Deposited")) { ?>
<tr>
<td> <?php echo "" . $val['net_amount'] ?> </td>
<?php if (empty($val['bank_information'][0]['bank_name']) == false) {
?>
<td> <?php echo $val['bank_information'][0]['bank_name'] ?> </td>
<?php } else { ?>
<td> N/A </td>
<?php }
if (empty($val['bank_information'][0]['bank_account_number']) == false) {
$accNum = $val['bank_information'][0]['bank_account_number'];
// Replace characters with asterisks for all characters except the last three segments
$maskedAccNum = substr_replace($accNum, str_repeat('*', strlen($accNum) - 3), 0, -3); ?>
<td> <?php echo $maskedAccNum ?> </td>
<?php } else { ?>
<td> N/A </td>
<?php } ?>
<td> <?php echo $payoutDate ?> </td>
<td> <?php echo $status ?> </td>
<td>
<button type="button" class="btn btn-primary btn-sm showSinglePayoutBtn"
data-order-id="<?php echo $payoutId; ?>" data-bs-toggle="modal"
data-bs-target="#payoutsModal">View</button>
</td>
</tr>
<?php
}
} ?>
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
</div>
@ -387,121 +459,7 @@ $vendorPayoutData = json_decode($response, true);
</div>
<!-- Cart Floating Button end -->
<!-- Whatsapp -->
<div class="ec-style ec-right-bottom">
<!-- Start Floating Panel Container -->
<div class="ec-panel">
<!-- Panel Header -->
<div class="ec-header">
<strong>Need Help?</strong>
<p>Chat with us on WhatsApp</p>
</div>
<!-- Panel Content -->
<div class="ec-body">
<ul>
<!-- Start Single Contact List -->
<li>
<a class="ec-list" data-number="918866774266" data-message="Please help me! I have got wrong product - ORDER ID is : #654321485">
<div class="d-flex bd-highlight">
<!-- Profile Picture -->
<div class="ec-img-cont">
<img loading="lazy" src="assets/images/whatsapp/profile_01.jpg" class="ec-user-img" alt="Profile image">
<span class="ec-status-icon"></span>
</div>
<!-- Display Name & Last Seen -->
<div class="ec-user-info">
<span>Sahar Darya</span>
<p>Sahar left 7 mins ago</p>
</div>
<!-- Chat iCon -->
<div class="ec-chat-icon">
<i class="fa fa-whatsapp"></i>
</div>
</div>
</a>
</li>
<!--/ End Single Contact List -->
<!-- Start Single Contact List -->
<li>
<a class="ec-list" data-number="918866774266" data-message="Please help me! I have got wrong product - ORDER ID is : #654321485">
<div class="d-flex bd-highlight">
<!-- Profile Picture -->
<div class="ec-img-cont">
<img loading="lazy" src="assets/images/whatsapp/profile_02.jpg" class="ec-user-img" alt="Profile image">
<span class="ec-status-icon ec-online"></span>
</div>
<!-- Display Name & Last Seen -->
<div class="ec-user-info">
<span>Yolduz Rafi</span>
<p>Yolduz is online</p>
</div>
<!-- Chat iCon -->
<div class="ec-chat-icon">
<i class="fa fa-whatsapp"></i>
</div>
</div>
</a>
</li>
<!--/ End Single Contact List -->
<!-- Start Single Contact List -->
<li>
<a class="ec-list" data-number="918866774266" data-message="Please help me! I have got wrong product - ORDER ID is : #654321485">
<div class="d-flex bd-highlight">
<!-- Profile Picture -->
<div class="ec-img-cont">
<img loading="lazy" src="assets/images/whatsapp/profile_03.jpg" class="ec-user-img" alt="Profile image">
<span class="ec-status-icon ec-offline"></span>
</div>
<!-- Display Name & Last Seen -->
<div class="ec-user-info">
<span>Nargis Hawa</span>
<p>Nargis left 30 mins ago</p>
</div>
<!-- Chat iCon -->
<div class="ec-chat-icon">
<i class="fa fa-whatsapp"></i>
</div>
</div>
</a>
</li>
<!--/ End Single Contact List -->
<!-- Start Single Contact List -->
<li>
<a class="ec-list" data-number="918866774266" data-message="Please help me! I have got wrong product - ORDER ID is : #654321485">
<div class="d-flex bd-highlight">
<!-- Profile Picture -->
<div class="ec-img-cont">
<img loading="lazy" src="assets/images/whatsapp/profile_04.jpg" class="ec-user-img" alt="Profile image">
<span class="ec-status-icon ec-offline"></span>
</div>
<!-- Display Name & Last Seen -->
<div class="ec-user-info">
<span>Khadija Mehr</span>
<p>Khadija left 50 mins ago</p>
</div>
<!-- Chat iCon -->
<div class="ec-chat-icon">
<i class="fa fa-whatsapp"></i>
</div>
</div>
</a>
</li>
<!--/ End Single Contact List -->
</ul>
</div>
</div>
<!--/ End Floating Panel Container -->
<!-- Start Right Floating Button-->
<div class="ec-right-bottom">
<div class="ec-box">
<div class="ec-button rotateBackward">
<img loading="lazy" class="whatsapp" src="assets/images/common/whatsapp.png" alt="whatsapp icon" />
</div>
</div>
</div>
<!--/ End Right Floating Button-->
</div>
<!-- Whatsapp end -->
<!-- Feature tools -->
<div class="ec-tools-sidebar-overlay"></div>
@ -588,7 +546,8 @@ $vendorPayoutData = json_decode($response, true);
<script src="assets/js/plugins/jquery.sticky-sidebar.js"></script>
<script src="assets/js/plugins/nouislider.js"></script>
<script src="https://cdn.datatables.net/v/bs5/dt-2.0.3/r-3.0.0/sp-2.3.0/datatables.min.js"></script>
<!-- <script src="https://cdn.metroui.org.ua/current/metro.js"></script> -->
<!-- <script>
const tooltipTriggerList = document.querySelectorAll('[data-bs-toggle="tooltip"]')
const tooltipList = [...tooltipTriggerList].map(tooltipTriggerEl => new bootstrap.Tooltip(tooltipTriggerEl))
@ -600,52 +559,56 @@ $vendorPayoutData = json_decode($response, true);
<!-- JS CRIPT FOR DYNAMIC MODAL BOX USING AJAX - JOHN LOUIE C. SUPERALIS MARCH 22, 2024 -->
<script>
$(document).ready(function() {
$('.showSinglePayoutBtn').click(function() {
var payoutId = $(this).data('order-id');
var token = "<?php echo $authToken; ?>";
$('#payoutIdSpan').text(payoutId);
$.ajax({
// url: 'https://api.obanana.shop/api/v1/payouts/' + payoutId,
url: 'https://<?php echo $_SESSION["data_endpoint"]; ?>/api/v1/payouts/' + payoutId,
type: 'GET',
headers: {
'Authorization': 'Bearer ' + token
},
success: function(response) {
// Handle successful response
console.log(response);
var grossAmount = response.gross_amount;
var totalFees = response.fees_deduction_adjustment;
var feeBreakdown = response.breakdown[0].transfer_fee;
var netAmount = response.net_amount;
var payoutStatus = response.status;
payoutStatus = payoutStatus.charAt(0).toUpperCase() + payoutStatus.slice(1).toLowerCase();
var bankName = response.bank_information[0].bank_name;
var bankNum = response.bank_information[0].bank_account_number;
var bankNumEnding = bankNum.slice(-3); // Extract last three characters of bankNum
var maskedBankNum = "Ending in " + bankNumEnding; // Create message
var bankAccName = response.bank_information[0].bank_account_name;
var transactionLogsHtml = ''; // Initialize empty string to store HTML for transaction logs
response.transaction_logs.forEach(function(log)
{
var paymentType = log.Type;
var transDate = new Date(log?.Transaction_date).toLocaleString('en-US', {
year: 'numeric',
month: '2-digit',
$(document).ready(function() {
$('.showSinglePayoutBtn').click(function() {
var payoutId = $(this).data('order-id');
var token = "<?php echo $authToken; ?>";
$('#payoutIdSpan').text(payoutId);
$.ajax({
// url: 'https://api.obanana.shop/api/v1/payouts/' + payoutId,
url: 'https://<?php echo $_SESSION["data_endpoint"]; ?>/api/v1/payouts/' +
payoutId,
type: 'GET',
headers: {
'Authorization': 'Bearer ' + token
},
success: function(response) {
// Handle successful response
console.log(response);
var grossAmount = response.gross_amount;
var totalFees = response.fees_deduction_adjustment;
var feeBreakdown = response.breakdown[0].transfer_fee;
var netAmount = response.net_amount;
var payoutStatus = response.status;
payoutStatus = payoutStatus.charAt(0).toUpperCase() + payoutStatus
.slice(1).toLowerCase();
var bankName = response.bank_information[0].bank_name;
var bankNum = response.bank_information[0].bank_account_number;
var bankNumEnding = bankNum.slice(-
3); // Extract last three characters of bankNum
var maskedBankNum = "Ending in " + bankNumEnding; // Create message
var bankAccName = response.bank_information[0].bank_account_name;
var transactionLogsHtml =
''; // Initialize empty string to store HTML for transaction logs
response.transaction_logs.forEach(function(log) {
var paymentType = log.Type;
var transDate = new Date(log?.Transaction_date)
.toLocaleString('en-US', {
year: 'numeric',
month: '2-digit',
day: '2-digit',
hour: 'numeric',
minute: '2-digit',
hour12: true
});
var transGrossAmount = log?.Gross_Amount;
var transFee = log.Fee;
var transNetAmount = log?.Net_Amount;
var transDesc = log.Description;
// Append HTML for current transaction log to the transactionLogsHtml string
transactionLogsHtml += `
var transGrossAmount = log?.Gross_Amount;
var transFee = log.Fee;
var transNetAmount = log?.Net_Amount;
var transDesc = log.Description;
// Append HTML for current transaction log to the transactionLogsHtml string
transactionLogsHtml += `
<tr>
<td>${paymentType}</td>
<td>${transDate}</td>
@ -654,11 +617,11 @@ $vendorPayoutData = json_decode($response, true);
<td> ${transNetAmount}</td>
<td>${transDesc}</td>
</tr>`;
});
});
// Populate data dynamically using the response
var payoutDetailsHtml = `
// Populate data dynamically using the response
var payoutDetailsHtml = `
<div class="row">
<div class="col-md-7 mb-4">
<div class="d-flex flex-column">
@ -666,8 +629,9 @@ $vendorPayoutData = json_decode($response, true);
<div>
<h6><strong>Payout Information</strong></h6>
</div>
<button class="fw-bold border border-success border-2 btn-outline-success btn-sm" disabled>${payoutStatus}</button>
<div>
<button disabled style="border: 2px solid #198754; color: #198754 !important; border-radius: 5px;">${payoutStatus}</button>
</div>
</div>
<div class="d-flex justify-content-between p-2">
<div class="fw-bold">Gross Amount</div>
@ -686,7 +650,7 @@ $vendorPayoutData = json_decode($response, true);
</div>
</div>
<div class="col-md-5 mb-4">
<div class="d-flex flex-column" style="border-bottom: 1px solid #000;">
<div class="d-flex flex-column" >
<div class="d-flex justify-content-between p-2">
<h6><strong>Bank Information</strong></h6>
</div>
@ -729,18 +693,13 @@ $vendorPayoutData = json_decode($response, true);
</div>
</div>
</div>`;
$('#payoutDetailsContainer').html(payoutDetailsHtml);
$('#payoutDetailsContainer').html(payoutDetailsHtml);
},
})
},
})
});
});
</script>
<script>
$(document).ready( function () {
$('#payoutsTableContent').DataTable();
} );
});
</script>
</body>

View File

@ -28,7 +28,10 @@
<meta name="msapplication-TileImage" content="assets/images/favicon/favicon.png" />
<!-- css Icon Font -->
<link rel="stylesheet" href="assets/css/vendor/ecicons.min.css" />
<link rel="stylesheet" href="assets/css/vendor/ecicons.min.css" />
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.2/css/all.min.css"
integrity="sha512-SnH5WK+bZxgPHs44uWIX+LLJAJ9/2PkPKZ5QiAj6Ta86w+fsb2TkcmfRyVX3pBnMFcV7oQPJkl9QevSCWr3W6A=="
crossorigin="anonymous" referrerpolicy="no-referrer" />
<!-- css All Plugins Files -->
<link rel="stylesheet" href="assets/css/plugins/animate.css" />
@ -417,129 +420,7 @@
</div>
<!-- Cart Floating Button end -->
<!-- Whatsapp -->
<div class="ec-style ec-right-bottom">
<!-- Start Floating Panel Container -->
<div class="ec-panel">
<!-- Panel Header -->
<div class="ec-header">
<strong>Need Help?</strong>
<p>Chat with us on WhatsApp</p>
</div>
<!-- Panel Content -->
<div class="ec-body">
<ul>
<!-- Start Single Contact List -->
<li>
<a class="ec-list" data-number="918866774266"
data-message="Please help me! I have got wrong product - ORDER ID is : #654321485">
<div class="d-flex bd-highlight">
<!-- Profile Picture -->
<div class="ec-img-cont">
<img loading="lazy" src="assets/images/whatsapp/profile_01.jpg" class="ec-user-img"
alt="Profile image">
<span class="ec-status-icon"></span>
</div>
<!-- Display Name & Last Seen -->
<div class="ec-user-info">
<span>Sahar Darya</span>
<p>Sahar left 7 mins ago</p>
</div>
<!-- Chat iCon -->
<div class="ec-chat-icon">
<i class="fa fa-whatsapp"></i>
</div>
</div>
</a>
</li>
<!--/ End Single Contact List -->
<!-- Start Single Contact List -->
<li>
<a class="ec-list" data-number="918866774266"
data-message="Please help me! I have got wrong product - ORDER ID is : #654321485">
<div class="d-flex bd-highlight">
<!-- Profile Picture -->
<div class="ec-img-cont">
<img loading="lazy" src="assets/images/whatsapp/profile_02.jpg" class="ec-user-img"
alt="Profile image">
<span class="ec-status-icon ec-online"></span>
</div>
<!-- Display Name & Last Seen -->
<div class="ec-user-info">
<span>Yolduz Rafi</span>
<p>Yolduz is online</p>
</div>
<!-- Chat iCon -->
<div class="ec-chat-icon">
<i class="fa fa-whatsapp"></i>
</div>
</div>
</a>
</li>
<!--/ End Single Contact List -->
<!-- Start Single Contact List -->
<li>
<a class="ec-list" data-number="918866774266"
data-message="Please help me! I have got wrong product - ORDER ID is : #654321485">
<div class="d-flex bd-highlight">
<!-- Profile Picture -->
<div class="ec-img-cont">
<img loading="lazy" src="assets/images/whatsapp/profile_03.jpg" class="ec-user-img"
alt="Profile image">
<span class="ec-status-icon ec-offline"></span>
</div>
<!-- Display Name & Last Seen -->
<div class="ec-user-info">
<span>Nargis Hawa</span>
<p>Nargis left 30 mins ago</p>
</div>
<!-- Chat iCon -->
<div class="ec-chat-icon">
<i class="fa fa-whatsapp"></i>
</div>
</div>
</a>
</li>
<!--/ End Single Contact List -->
<!-- Start Single Contact List -->
<li>
<a class="ec-list" data-number="918866774266"
data-message="Please help me! I have got wrong product - ORDER ID is : #654321485">
<div class="d-flex bd-highlight">
<!-- Profile Picture -->
<div class="ec-img-cont">
<img loading="lazy" src="assets/images/whatsapp/profile_04.jpg" class="ec-user-img"
alt="Profile image">
<span class="ec-status-icon ec-offline"></span>
</div>
<!-- Display Name & Last Seen -->
<div class="ec-user-info">
<span>Khadija Mehr</span>
<p>Khadija left 50 mins ago</p>
</div>
<!-- Chat iCon -->
<div class="ec-chat-icon">
<i class="fa fa-whatsapp"></i>
</div>
</div>
</a>
</li>
<!--/ End Single Contact List -->
</ul>
</div>
</div>
<!--/ End Floating Panel Container -->
<!-- Start Right Floating Button-->
<div class="ec-right-bottom">
<div class="ec-box">
<div class="ec-button rotateBackward">
<img loading="lazy" class="whatsapp" src="assets/images/common/whatsapp.png" alt="whatsapp icon" />
</div>
</div>
</div>
<!--/ End Right Floating Button-->
</div>
<!-- Whatsapp end -->
<!-- Feature tools -->
<div class="ec-tools-sidebar-overlay"></div>

View File

@ -52,7 +52,10 @@ if ($_SESSION["isCustomer"] == true) {
<meta name="msapplication-TileImage" content="assets/images/favicon/favicon.png" />
<!-- css Icon Font -->
<link rel="stylesheet" href="assets/css/vendor/ecicons.min.css" />
<link rel="stylesheet" href="assets/css/vendor/ecicons.min.css" />
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.2/css/all.min.css"
integrity="sha512-SnH5WK+bZxgPHs44uWIX+LLJAJ9/2PkPKZ5QiAj6Ta86w+fsb2TkcmfRyVX3pBnMFcV7oQPJkl9QevSCWr3W6A=="
crossorigin="anonymous" referrerpolicy="no-referrer" />
<!-- css All Plugins Files -->
<link rel="stylesheet" href="assets/css/plugins/animate.css" />
@ -69,9 +72,14 @@ if ($_SESSION["isCustomer"] == true) {
<link rel="stylesheet" href="assets/css/style.css" />
<link rel="stylesheet" href="assets/css/style2.css" />
<link rel="stylesheet" href="assets/css/responsive.css" />
<link href="https://cdn.datatables.net/v/bs5/dt-2.0.3/r-3.0.0/sp-2.3.0/datatables.min.css" rel="stylesheet">
<!-- Background css -->
<link rel="stylesheet" id="bg-switcher-css" href="assets/css/backgrounds/bg-4.css">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/select2@latest/dist/css/select2.min.css" crossorigin="anonymous" referrerpolicy="no-referrer" />
<script src="https://code.jquery.com/jquery-3.6.4.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/select2@latest/dist/js/select2.min.js" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
<style>
.tab.active {
background-color: #ffffff;
@ -260,7 +268,7 @@ if ($_SESSION["isCustomer"] == true) {
<h5 class="name"><?php echo $vendorData['user_login'] ?></h5>
</div>
<!-- <div class="ec-vendor-block-items">
<!-- <ul>
<ul>
<li><a href="vendor-dashboard.php">Dashboard</a></li>
<li><a href="vendor-uploads.php">Upload Product</a></li>
<li><a href="vendor-settings.php">Settings (Edit)</a></li>
@ -319,8 +327,8 @@ if ($_SESSION["isCustomer"] == true) {
<!-- 03-26-2024 Stacy added tab for all orders -->
<!-- Content for "All Refunds" tab -->
<div id="allRefunds" class="tab-content active">
<table class="table ec-table">
<div id="allRefunds" class="tab-content mt-1 active">
<table id="allRefundsTbl" class="table ec-table">
<thead id="allRefundTHead">
<tr class="Title">
<th scope="col">Image</th>
@ -353,12 +361,13 @@ if ($_SESSION["isCustomer"] == true) {
<?php
$jsonorder = json_encode($order);
?>
<tr class="tableView" data-value=' <?php echo $jsonorder; ?>' data-bs-toggle="modal" data-bs-target="#productDetails">
<tr class="tableView" style="cursor:pointer;" onmouseover="this.style.backgroundColor='#e5e5e5'" onmouseout="this.style.backgroundColor='#ffffff'"
data-value=' <?php echo $jsonorder; ?>' data-bs-toggle="modal" data-bs-target="#productDetails">
<td><img loading="lazy" class="prod-img" src="<?php echo $order['items'][0]['product']['product_image']; ?>" alt="product"></td>
<td><span class="text-truncate"><?php echo $order['items'][0]['product']['name']; ?></span></td>
<td><span><?php echo $order['items'][0]['quantity']; ?></span></td>
<td><span><?php echo $order['items'][0]['price']; ?></span></td>
<td><span><?php echo $order['total_amount'] ?></span></td>
<td><span class="text-truncate" style="width:20em;"><?php echo $order['items'][0]['product']['name']; ?></span></td>
<td><span style="width:3em;"><?php echo $order['items'][0]['quantity']; ?></span></td>
<td><span style="width:4em;"><?php echo $order['items'][0]['price']; ?></span></td>
<td><span style="width:3em;"><?php echo $order['total_amount'] ?></span></td>
<td><span><?php echo $order['return_order']['status']; ?></span></td>
<!-- <td><span><?php # echo $order['return_order']['reason']; ?></span></td>
<td><img loading="lazy" class="prod-img" src="<?php # echo $order['return_order']['image']; ?>" alt="product"></td> -->
@ -388,8 +397,8 @@ if ($_SESSION["isCustomer"] == true) {
<!-- Content for "To Approve" tab -->
<div id="toApprove" class="tab-content">
<table class="table ec-table">
<div id="toApprove" class="tab-content mt-1">
<table id="toApproveTbl" class="table ec-table">
<thead id="toApproveTHead">
<tr class="Title">
<th scope="col">Image</th>
@ -420,12 +429,12 @@ if ($_SESSION["isCustomer"] == true) {
<?php
$jsonorder = json_encode($order);
?>
<tr class="tableView">
<tr class="tableView" style="cursor:pointer;" onmouseover="this.style.backgroundColor='#e5e5e5'" onmouseout="this.style.backgroundColor='#ffffff'">
<td data-value=' <?php echo $jsonorder; ?>' data-bs-toggle="modal" data-bs-target="#productDetails"><img loading="lazy" class="prod-img" src="<?php echo $order['items'][0]['product']['product_image']; ?>" alt="product"></td>
<td data-value=' <?php echo $jsonorder; ?>' data-bs-toggle="modal" data-bs-target="#productDetails"><span class="text-truncate"><?php echo $order['items'][0]['product']['name']; ?></span></td>
<td data-value=' <?php echo $jsonorder; ?>' data-bs-toggle="modal" data-bs-target="#productDetails"><span><?php echo $order['items'][0]['quantity']; ?></span></td>
<td data-value=' <?php echo $jsonorder; ?>' data-bs-toggle="modal" data-bs-target="#productDetails"><span><?php echo $order['items'][0]['price']; ?></span></td>
<td data-value=' <?php echo $jsonorder; ?>' data-bs-toggle="modal" data-bs-target="#productDetails"><span><?php echo $order['total_amount'] ?></span></td>
<td data-value=' <?php echo $jsonorder; ?>' data-bs-toggle="modal" data-bs-target="#productDetails"><span class="text-truncate" style="width:20em;"><?php echo $order['items'][0]['product']['name']; ?></span></td>
<td data-value=' <?php echo $jsonorder; ?>' data-bs-toggle="modal" data-bs-target="#productDetails"><span style="width:3em;"><?php echo $order['items'][0]['quantity']; ?></span></td>
<td data-value=' <?php echo $jsonorder; ?>' data-bs-toggle="modal" data-bs-target="#productDetails"><span style="width:4em;"><?php echo $order['items'][0]['price']; ?></span></td>
<td data-value=' <?php echo $jsonorder; ?>' data-bs-toggle="modal" data-bs-target="#productDetails"><span style="width:3em;"><?php echo $order['total_amount'] ?></span></td>
<td data-value=' <?php echo $jsonorder; ?>' data-bs-toggle="modal" data-bs-target="#productDetails"><span><?php echo $order['return_order']['status']; ?></span></td>
<!-- <td><span><?php # echo $order['return_order']['reason']; ?></span></td>
<td><img loading="lazy" class="prod-img" src="<?php # echo $order['return_order']['image']; ?>" alt="product"></td> -->
@ -459,8 +468,8 @@ if ($_SESSION["isCustomer"] == true) {
<!-- Content for "To Ship" tab -->
<div id="toShip" class="tab-content">
<table class="table ec-table">
<div id="toShip" class="tab-content mt-1">
<table id="toShipTbl" class="table ec-table">
<thead id="toShipTHead">
<tr class="Title">
<th scope="col">Image</th>
@ -491,12 +500,13 @@ if ($_SESSION["isCustomer"] == true) {
<?php
$jsonorder = json_encode($order);
?>
<tr class="tableView" data-value=' <?php echo $jsonorder; ?>' data-bs-toggle="modal" data-bs-target="#productDetails">
<tr class="tableView" style="cursor:pointer;" onmouseover="this.style.backgroundColor='#e5e5e5'" onmouseout="this.style.backgroundColor='#ffffff'"
data-value=' <?php echo $jsonorder; ?>' data-bs-toggle="modal" data-bs-target="#productDetails">
<td><img loading="lazy" class="prod-img" src="<?php echo $order['items'][0]['product']['product_image']; ?>" alt="product"></td>
<td><span class="text-truncate"><?php echo $order['items'][0]['product']['name']; ?></span></td>
<td><span><?php echo $order['items'][0]['quantity']; ?></span></td>
<td><span><?php echo $order['items'][0]['price']; ?></span></td>
<td><span><?php echo $order['total_amount'] ?></span></td>
<td><span class="text-truncate" style="width:20em;"><?php echo $order['items'][0]['product']['name']; ?></span></td>
<td><span style="width:3em;"><?php echo $order['items'][0]['quantity']; ?></span></td>
<td><span style="width:4em;"><?php echo $order['items'][0]['price']; ?></span></td>
<td><span style="width:3em;"><?php echo $order['total_amount'] ?></span></td>
<td><span><?php echo $order['return_order']['status']; ?></span></td>
<!-- <td><span><?php # echo $order['return_order']['reason']; ?></span></td>
<td><img loading="lazy" class="prod-img" src="<?php # echo $order['return_order']['image']; ?>" alt="product"></td> -->
@ -526,8 +536,8 @@ if ($_SESSION["isCustomer"] == true) {
<!-- Content for "To Receive" tab -->
<div id="toReceive" class="tab-content">
<table class="table ec-table">
<div id="toReceive" class="tab-content mt-1">
<table id="toReceiveTbl" class="table ec-table">
<thead id="toReceiveTHead">
<tr class="Title">
<th scope="col">Image</th>
@ -557,12 +567,12 @@ if ($_SESSION["isCustomer"] == true) {
<?php
$jsonorder = json_encode($order);
?>
<tr class="tableView">
<tr class="tableView" style="cursor:pointer;" onmouseover="this.style.backgroundColor='#e5e5e5'" onmouseout="this.style.backgroundColor='#ffffff'">
<td data-value=' <?php echo $jsonorder; ?>' data-bs-toggle="modal" data-bs-target="#productDetails"><img loading="lazy" class="prod-img" src="<?php echo $order['items'][0]['product']['product_image']; ?>" alt="product"></td>
<td data-value=' <?php echo $jsonorder; ?>' data-bs-toggle="modal" data-bs-target="#productDetails"><span class="text-truncate"><?php echo $order['items'][0]['product']['name']; ?></span></td>
<td data-value=' <?php echo $jsonorder; ?>' data-bs-toggle="modal" data-bs-target="#productDetails"><span><?php echo $order['items'][0]['quantity']; ?></span></td>
<td data-value=' <?php echo $jsonorder; ?>' data-bs-toggle="modal" data-bs-target="#productDetails"><span><?php echo $order['items'][0]['price']; ?></span></td>
<td data-value=' <?php echo $jsonorder; ?>' data-bs-toggle="modal" data-bs-target="#productDetails"><span><?php echo $order['total_amount'] ?></span></td>
<td data-value=' <?php echo $jsonorder; ?>' data-bs-toggle="modal" data-bs-target="#productDetails"><span class="text-truncate" style="width:20em;"><?php echo $order['items'][0]['product']['name']; ?></span></td>
<td data-value=' <?php echo $jsonorder; ?>' data-bs-toggle="modal" data-bs-target="#productDetails"><span style="width:3em;"><?php echo $order['items'][0]['quantity']; ?></span></td>
<td data-value=' <?php echo $jsonorder; ?>' data-bs-toggle="modal" data-bs-target="#productDetails"><span style="width:4em;"><?php echo $order['items'][0]['price']; ?></span></td>
<td data-value=' <?php echo $jsonorder; ?>' data-bs-toggle="modal" data-bs-target="#productDetails"><span style="width:3em;"><?php echo $order['total_amount'] ?></span></td>
<td data-value=' <?php echo $jsonorder; ?>' data-bs-toggle="modal" data-bs-target="#productDetails"><span><?php echo $order['return_order']['status']; ?></span></td>
<!-- <td><span><?php # echo $order['return_order']['reason']; ?></span></td>
<td><img loading="lazy" class="prod-img" src="<?php # echo $order['return_order']['image']; ?>" alt="product"></td> -->
@ -595,8 +605,8 @@ if ($_SESSION["isCustomer"] == true) {
<!-- Content for "To Refund" tab -->
<div id="toRefund" class="tab-content">
<table class="table ec-table">
<div id="toRefund" class="tab-content mt-1">
<table id="toRefundTbl" class="table ec-table">
<thead id="toRefundTHead">
<tr class="Title">
<th scope="col">Image</th>
@ -626,12 +636,13 @@ if ($_SESSION["isCustomer"] == true) {
<?php
$jsonorder = json_encode($order);
?>
<tr class="tableView" data-value=' <?php echo $jsonorder; ?>' data-bs-toggle="modal" data-bs-target="#productDetails">
<tr class="tableView" style="cursor:pointer;" onmouseover="this.style.backgroundColor='#e5e5e5'" onmouseout="this.style.backgroundColor='#ffffff'"
data-value=' <?php echo $jsonorder; ?>' data-bs-toggle="modal" data-bs-target="#productDetails">
<td><img loading="lazy" class="prod-img" src="<?php echo $order['items'][0]['product']['product_image']; ?>" alt="product"></td>
<td><span class="text-truncate"><?php echo $order['items'][0]['product']['name']; ?></span></td>
<td><span><?php echo $order['items'][0]['quantity']; ?></span></td>
<td><span><?php echo $order['items'][0]['price']; ?></span></td>
<td><span><?php echo $order['total_amount'] ?></span></td>
<td><span class="text-truncate" style="width:20em;"><?php echo $order['items'][0]['product']['name']; ?></span></td>
<td><span style="width:3em;"><?php echo $order['items'][0]['quantity']; ?></span></td>
<td><span style="width:4em;"><?php echo $order['items'][0]['price']; ?></span></td>
<td><span style="width:3em;"><?php echo $order['total_amount'] ?></span></td>
<td><span><?php echo $order['return_order']['status']; ?></span></td>
<!-- <td><span><?php # echo $order['return_order']['reason']; ?></span></td>
<td><img loading="lazy" class="prod-img" src="<?php # echo $order['return_order']['image']; ?>" alt="product"></td> -->
@ -664,8 +675,8 @@ if ($_SESSION["isCustomer"] == true) {
<!-- Content for "Return Complete" tab -->
<div id="returnComplete" class="tab-content">
<table class="table ec-table">
<div id="returnComplete" class="tab-content mt-1">
<table id="returnCompleteTbl" class="table ec-table">
<thead id="returnCompleteTHead">
<tr class="Title">
<th scope="col">Image</th>
@ -695,12 +706,13 @@ if ($_SESSION["isCustomer"] == true) {
<?php
$jsonorder = json_encode($order);
?>
<tr class="tableView" data-value=' <?php echo $jsonorder; ?>' data-bs-toggle="modal" data-bs-target="#productDetails">
<tr class="tableView" style="cursor:pointer;" onmouseover="this.style.backgroundColor='#e5e5e5'" onmouseout="this.style.backgroundColor='#ffffff'"
data-value=' <?php echo $jsonorder; ?>' data-bs-toggle="modal" data-bs-target="#productDetails">
<td><img loading="lazy" class="prod-img" src="<?php echo $order['items'][0]['product']['product_image']; ?>" alt="product"></td>
<td><span class="text-truncate"><?php echo $order['items'][0]['product']['name']; ?></span></td>
<td><span><?php echo $order['items'][0]['quantity']; ?></span></td>
<td><span><?php echo $order['items'][0]['price']; ?></span></td>
<td><span><?php echo $order['total_amount'] ?></span></td>
<td><span class="text-truncate" style="width:20em;"><?php echo $order['items'][0]['product']['name']; ?></span></td>
<td><span style="width:3em;"><?php echo $order['items'][0]['quantity']; ?></span></td>
<td><span style="width:4em;"><?php echo $order['items'][0]['price']; ?></span></td>
<td><span style="width:3em;"><?php echo $order['total_amount'] ?></span></td>
<td><span><?php echo $order['return_order']['status']; ?></span></td>
<!-- <td><span><?php # echo $order['return_order']['reason']; ?></span></td>
<td><img loading="lazy" class="prod-img" src="<?php # echo $order['return_order']['image']; ?>" alt="product"></td> -->
@ -1076,7 +1088,7 @@ if ($_SESSION["isCustomer"] == true) {
if (jsonObject.return_order.status === 'To Approve') {
modal.innerHTML = `
<div class="modal-header" style="height:5px;">
<div class="modal-header" style="height:5px; padding:10px;">
<h5 class="modal-title fs-5 font-weight-bold">${jsonObject.items[0].product.name}</h5>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
</div>
@ -1246,7 +1258,7 @@ if ($_SESSION["isCustomer"] == true) {
<!-- Footer navigation panel for responsive display -->
<div class="ec-nav-toolbar">
<!-- <div class="ec-nav-toolbar">
<div class="container">
<div class="ec-nav-panel">
<div class="ec-nav-panel-icons">
@ -1267,7 +1279,7 @@ if ($_SESSION["isCustomer"] == true) {
</div>
</div>
</div>
</div> -->
<!-- Footer navigation panel for responsive display end -->
<!-- raymart remove popup feb 20 2024 -->
@ -1293,121 +1305,7 @@ if ($_SESSION["isCustomer"] == true) {
</div>
<!-- Cart Floating Button end -->
<!-- Whatsapp -->
<div class="ec-style ec-right-bottom">
<!-- Start Floating Panel Container -->
<div class="ec-panel">
<!-- Panel Header -->
<div class="ec-header">
<strong>Need Help?</strong>
<p>Chat with us on WhatsApp</p>
</div>
<!-- Panel Content -->
<div class="ec-body">
<ul>
<!-- Start Single Contact List -->
<li>
<a class="ec-list" data-number="918866774266" data-message="Please help me! I have got wrong product - ORDER ID is : #654321485">
<div class="d-flex bd-highlight">
<!-- Profile Picture -->
<div class="ec-img-cont">
<img loading="lazy" src="assets/images/whatsapp/profile_01.jpg" class="ec-user-img" alt="Profile image">
<span class="ec-status-icon"></span>
</div>
<!-- Display Name & Last Seen -->
<div class="ec-user-info">
<span>Sahar Darya</span>
<p>Sahar left 7 mins ago</p>
</div>
<!-- Chat iCon -->
<div class="ec-chat-icon">
<i class="fa fa-whatsapp"></i>
</div>
</div>
</a>
</li>
<!--/ End Single Contact List -->
<!-- Start Single Contact List -->
<li>
<a class="ec-list" data-number="918866774266" data-message="Please help me! I have got wrong product - ORDER ID is : #654321485">
<div class="d-flex bd-highlight">
<!-- Profile Picture -->
<div class="ec-img-cont">
<img loading="lazy" src="assets/images/whatsapp/profile_02.jpg" class="ec-user-img" alt="Profile image">
<span class="ec-status-icon ec-online"></span>
</div>
<!-- Display Name & Last Seen -->
<div class="ec-user-info">
<span>Yolduz Rafi</span>
<p>Yolduz is online</p>
</div>
<!-- Chat iCon -->
<div class="ec-chat-icon">
<i class="fa fa-whatsapp"></i>
</div>
</div>
</a>
</li>
<!--/ End Single Contact List -->
<!-- Start Single Contact List -->
<li>
<a class="ec-list" data-number="918866774266" data-message="Please help me! I have got wrong product - ORDER ID is : #654321485">
<div class="d-flex bd-highlight">
<!-- Profile Picture -->
<div class="ec-img-cont">
<img loading="lazy" src="assets/images/whatsapp/profile_03.jpg" class="ec-user-img" alt="Profile image">
<span class="ec-status-icon ec-offline"></span>
</div>
<!-- Display Name & Last Seen -->
<div class="ec-user-info">
<span>Nargis Hawa</span>
<p>Nargis left 30 mins ago</p>
</div>
<!-- Chat iCon -->
<div class="ec-chat-icon">
<i class="fa fa-whatsapp"></i>
</div>
</div>
</a>
</li>
<!--/ End Single Contact List -->
<!-- Start Single Contact List -->
<li>
<a class="ec-list" data-number="918866774266" data-message="Please help me! I have got wrong product - ORDER ID is : #654321485">
<div class="d-flex bd-highlight">
<!-- Profile Picture -->
<div class="ec-img-cont">
<img loading="lazy" src="assets/images/whatsapp/profile_04.jpg" class="ec-user-img" alt="Profile image">
<span class="ec-status-icon ec-offline"></span>
</div>
<!-- Display Name & Last Seen -->
<div class="ec-user-info">
<span>Khadija Mehr</span>
<p>Khadija left 50 mins ago</p>
</div>
<!-- Chat iCon -->
<div class="ec-chat-icon">
<i class="fa fa-whatsapp"></i>
</div>
</div>
</a>
</li>
<!--/ End Single Contact List -->
</ul>
</div>
</div>
<!--/ End Floating Panel Container -->
<!-- Start Right Floating Button-->
<div class="ec-right-bottom">
<div class="ec-box">
<div class="ec-button rotateBackward">
<img loading="lazy" class="whatsapp" src="assets/images/common/whatsapp.png" alt="whatsapp icon" />
</div>
</div>
</div>
<!--/ End Right Floating Button-->
</div>
<!-- Whatsapp end -->
<!-- Feature tools -->
<div class="ec-tools-sidebar-overlay"></div>
@ -1476,6 +1374,33 @@ if ($_SESSION["isCustomer"] == true) {
</div>
<!-- Feature tools end -->
<!-- DataTables -->
<script>
$(document).ready( function () {
$('#allRefundsTbl').DataTable();
} );
$(document).ready( function () {
$('#toApproveTbl').DataTable();
} );
$(document).ready( function () {
$('#toShipTbl').DataTable();
} );
$(document).ready( function () {
$('#toReceiveTbl').DataTable();
} );
$(document).ready( function () {
$('#toRefundTbl').DataTable();
} );
$(document).ready( function () {
$('#returnCompleteTbl').DataTable();
} );
</script>
<!-- Vendor JS -->
<script src="assets/js/vendor/jquery-3.5.1.min.js"></script>
<script src="assets/js/vendor/popper.min.js"></script>
@ -1493,6 +1418,7 @@ if ($_SESSION["isCustomer"] == true) {
<script src="assets/js/vendor/jquery.magnific-popup.min.js"></script>
<script src="assets/js/plugins/jquery.sticky-sidebar.js"></script>
<script src="assets/js/plugins/nouislider.js"></script>
<script src="https://cdn.datatables.net/v/bs5/dt-2.0.3/r-3.0.0/sp-2.3.0/datatables.min.js"></script>
<!-- Main Js -->
<script src="assets/js/vendor/index.js"></script>

View File

@ -17,7 +17,10 @@
<meta name="msapplication-TileImage" content="assets/images/favicon/favicon.png" />
<!-- css Icon Font -->
<link rel="stylesheet" href="assets/css/vendor/ecicons.min.css" />
<link rel="stylesheet" href="assets/css/vendor/ecicons.min.css" />
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.2/css/all.min.css"
integrity="sha512-SnH5WK+bZxgPHs44uWIX+LLJAJ9/2PkPKZ5QiAj6Ta86w+fsb2TkcmfRyVX3pBnMFcV7oQPJkl9QevSCWr3W6A=="
crossorigin="anonymous" referrerpolicy="no-referrer" />
<!-- css All Plugins Files -->
<link rel="stylesheet" href="assets/css/plugins/animate.css" />
@ -223,121 +226,7 @@
</div>
<!-- Cart Floating Button end -->
<!-- Whatsapp -->
<div class="ec-style ec-right-bottom">
<!-- Start Floating Panel Container -->
<div class="ec-panel">
<!-- Panel Header -->
<div class="ec-header">
<strong>Need Help?</strong>
<p>Chat with us on WhatsApp</p>
</div>
<!-- Panel Content -->
<div class="ec-body">
<ul>
<!-- Start Single Contact List -->
<li>
<a class="ec-list" data-number="918866774266" data-message="Please help me! I have got wrong product - ORDER ID is : #654321485">
<div class="d-flex bd-highlight">
<!-- Profile Picture -->
<div class="ec-img-cont">
<img loading="lazy" src="assets/images/whatsapp/profile_01.jpg" class="ec-user-img" alt="Profile image">
<span class="ec-status-icon"></span>
</div>
<!-- Display Name & Last Seen -->
<div class="ec-user-info">
<span>Sahar Darya</span>
<p>Sahar left 7 mins ago</p>
</div>
<!-- Chat iCon -->
<div class="ec-chat-icon">
<i class="fa fa-whatsapp"></i>
</div>
</div>
</a>
</li>
<!--/ End Single Contact List -->
<!-- Start Single Contact List -->
<li>
<a class="ec-list" data-number="918866774266" data-message="Please help me! I have got wrong product - ORDER ID is : #654321485">
<div class="d-flex bd-highlight">
<!-- Profile Picture -->
<div class="ec-img-cont">
<img loading="lazy" src="assets/images/whatsapp/profile_02.jpg" class="ec-user-img" alt="Profile image">
<span class="ec-status-icon ec-online"></span>
</div>
<!-- Display Name & Last Seen -->
<div class="ec-user-info">
<span>Yolduz Rafi</span>
<p>Yolduz is online</p>
</div>
<!-- Chat iCon -->
<div class="ec-chat-icon">
<i class="fa fa-whatsapp"></i>
</div>
</div>
</a>
</li>
<!--/ End Single Contact List -->
<!-- Start Single Contact List -->
<li>
<a class="ec-list" data-number="918866774266" data-message="Please help me! I have got wrong product - ORDER ID is : #654321485">
<div class="d-flex bd-highlight">
<!-- Profile Picture -->
<div class="ec-img-cont">
<img loading="lazy" src="assets/images/whatsapp/profile_03.jpg" class="ec-user-img" alt="Profile image">
<span class="ec-status-icon ec-offline"></span>
</div>
<!-- Display Name & Last Seen -->
<div class="ec-user-info">
<span>Nargis Hawa</span>
<p>Nargis left 30 mins ago</p>
</div>
<!-- Chat iCon -->
<div class="ec-chat-icon">
<i class="fa fa-whatsapp"></i>
</div>
</div>
</a>
</li>
<!--/ End Single Contact List -->
<!-- Start Single Contact List -->
<li>
<a class="ec-list" data-number="918866774266" data-message="Please help me! I have got wrong product - ORDER ID is : #654321485">
<div class="d-flex bd-highlight">
<!-- Profile Picture -->
<div class="ec-img-cont">
<img loading="lazy" src="assets/images/whatsapp/profile_04.jpg" class="ec-user-img" alt="Profile image">
<span class="ec-status-icon ec-offline"></span>
</div>
<!-- Display Name & Last Seen -->
<div class="ec-user-info">
<span>Khadija Mehr</span>
<p>Khadija left 50 mins ago</p>
</div>
<!-- Chat iCon -->
<div class="ec-chat-icon">
<i class="fa fa-whatsapp"></i>
</div>
</div>
</a>
</li>
<!--/ End Single Contact List -->
</ul>
</div>
</div>
<!--/ End Floating Panel Container -->
<!-- Start Right Floating Button-->
<div class="ec-right-bottom">
<div class="ec-box">
<div class="ec-button rotateBackward">
<img loading="lazy" class="whatsapp" src="assets/images/common/whatsapp.png" alt="whatsapp icon" />
</div>
</div>
</div>
<!--/ End Right Floating Button-->
</div>
<!-- Whatsapp end -->
<!-- Feature tools -->
<div class="ec-tools-sidebar-overlay"></div>

View File

@ -47,7 +47,10 @@ if ($_SESSION["isCustomer"] == true) {
<meta name="msapplication-TileImage" content="assets/images/favicon/favicon.png" />
<!-- css Icon Font -->
<link rel="stylesheet" href="assets/css/vendor/ecicons.min.css" />
<link rel="stylesheet" href="assets/css/vendor/ecicons.min.css" />
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.2/css/all.min.css"
integrity="sha512-SnH5WK+bZxgPHs44uWIX+LLJAJ9/2PkPKZ5QiAj6Ta86w+fsb2TkcmfRyVX3pBnMFcV7oQPJkl9QevSCWr3W6A=="
crossorigin="anonymous" referrerpolicy="no-referrer" />
<!-- css All Plugins Files -->
<link rel="stylesheet" href="assets/css/plugins/animate.css" />
@ -239,6 +242,9 @@ if ($_SESSION["isCustomer"] == true) {
<div class="shipping">
<?php foreach ($vendorData['address'] as $address) : ?>
<?php if ($address['shipping']) : ?>
<div>
<span style="font-size:16px;font-weight:800;">Shipping Address:</span>
</div>
<div class="sName">
<span>Name:
<span id="selectedFName"><?php echo $address['first_name']; ?></span>
@ -259,18 +265,70 @@ if ($_SESSION["isCustomer"] == true) {
</span>
</div>
<?php endif; ?>
<?php if ($address['billing']) : ?>
<div>
<span style="font-size:16px;font-weight:800;">Billing Address:</span>
</div>
<div class="sName">
<span>Name:
<span id="selectedBillingFName"><?php echo $address['first_name']; ?></span>
<span id="selectedBillingLName"> <?php echo $address['last_name']; ?></span>
</span>
</div>
<div class="sContact">
<span id="selectedBillingContact">Contact #: <?php echo $address['phone']; ?></span>
</div>
<div class="sAddress">
<span>Address:
<span id="sBillingBuilding"><?php echo $address['address_1']; ?></span>
<span id="sBillingStreet"><?php echo $address['address_2']; ?></span>
<span id="sBillingBarangay"><?php echo $address['barangay']; ?></span>
<span id="sBillingCity"><?php echo $address['city']; ?></span>
<span id="sBillingProvince"><?php echo $address['province']; ?></span>
<span id="sBillingCountry"><?php echo $address['country']; ?></span>
</span>
</div>
<?php endif; ?>
<?php endforeach; ?>
</div>
<!-- <div class="billing">
<php foreach ($vendorData['address'] as $address) : ?>
<php if ($address['billing']) : ?>
<div>
<span style="font-size:16px;font-weight:800;">Billing Address:</span>
</div>
<div class="sName">
<span>Name:
<span id="selectedBillingFName"><php echo $address['first_name']; ?></span>
<span id="selectedBillingLName"> <php echo $address['last_name']; ?></span>
</span>
</div>
<div class="sContact">
<span id="selectedBillingContact">Contact #: <php echo $address['phone']; ?></span>
</div>
<div class="sAddress">
<span>Address:
<span id="sBillingBuilding"><php echo $address['address_1']; ?></span>
<span id="sBillingStreet"><php echo $address['address_2']; ?></span>
<span id="sBillingBarangay"><php echo $address['barangay']; ?></span>
<span id="sBillingCity"><php echo $address['city']; ?></span>
<span id="sBillingProvince"><php echo $address['province']; ?></span>
<span id="sBillingCountry"><php echo $address['country']; ?></span>
</span>
</div>
<php endif; ?>
<php endforeach; ?>
</div> -->
</div>
</div>
</div>
<!-- 03-19-24 Jun Jihad Bank Information -->
<div class="col-md-12 col-sm-12" style="display:flex; justify-content: space-between">
<h5>Bank Information </h5>
<button type="button" class="btn btn-primary" id="vendorBankModalBtn" data-bs-toggle="modal" data-bs-target="#vendorBankModal">My Banks</button>
</div>
<!-- 03-19-24 Jun Jihad Bank Information -->
<div class="col-md-12 col-sm-12" style="display:flex; justify-content: space-between">
<h5>Bank Information </h5>
<button type="button" class="btn btn-primary" id="vendorBankModalBtn" data-bs-toggle="modal" data-bs-target="#vendorBankModal">My Banks</button>
</div>
<div class="row">
<div class="col-md-12 col-sm-12">
<div class="py-3 col-md-12 col-sm-12">
<?php foreach ($vendorData['bank_acount_details'] as $bank_acount_details) : ?>
<?php if ($bank_acount_details['bank_payout']) : ?>
<table style="width:100%; border-collapse: collapse;">
@ -380,27 +438,27 @@ if ($_SESSION["isCustomer"] == true) {
<form>
<div class="form-group">
<label for="addressFirstName" class="text-dark font-weight-medium pt-3 mb-2">First Name</label>
<input type="text" class="form-control" id="addressFirstName">
<input type="text" class="form-control" id="addressFirstName" required>
</div>
<div class="form-group">
<label for="addressLastName" class="text-dark font-weight-medium pt-3 mb-2">Last Name</label>
<input type="text" class="form-control" id="addressLastName">
<input type="text" class="form-control" id="addressLastName" required>
</div>
<div class="form-group">
<label for="addressContact" class="text-dark font-weight-medium pt-3 mb-2">Contact Number</label>
<input type="number" class="form-control" id="addressContact">
<input type="text" class="form-control" id="addressContact" value="+63 " oninput="preventErasePrefix(this)" required>
</div>
<div class="form-group">
<label for="addressBuilding" class="text-dark font-weight-medium pt-3 mb-2"> Building,Number </label>
<input type="text" class="form-control" id="addressBuilding">
<label for="addressBuilding" class="text-dark font-weight-medium pt-3 mb-2"> House/Unit/Flr #, Bldg Name, Blk or Lot # </label>
<input type="text" class="form-control" id="addressBuilding" required>
</div>
<div class="form-group">
<label for="addressStreet" class="text-dark font-weight-medium pt-3 mb-2"> Street </label>
<input type="text" class="form-control" id="addressStreet">
<input type="text" class="form-control" id="addressStreet" required>
</div>
<div class="form-group">
<label for="provinceSelect">Province</label>
<select class="form-select" id="provinceSelect">
<select class="form-select" id="provinceSelect" required>
<option value="" disabled selected hidden>Select Province</option>
</select>
</div>
@ -418,7 +476,7 @@ if ($_SESSION["isCustomer"] == true) {
</div>
<div class="form-group">
<label for="addressCountry" class="text-dark font-weight-medium pt-3 mb-2">Country</label>
<input type="text" class="form-control" id="addressCountry">
<input type="text" class="form-control" id="addressCountry" value="Philippines" required>
</div>
<button type="button" class="btn btn-primary mt-4" id="submitBtn">Submit</button>
@ -455,7 +513,7 @@ if ($_SESSION["isCustomer"] == true) {
<div class="form-group">
<label for="addressContact" class="text-dark font-weight-medium pt-3 mb-2">Contact Number</label>
<input type="text" class="form-control" id="addressContact2" value="<?php echo $address['phone']; ?>">
<input type="text" class="form-control" id="addressContact2" value="<?php echo $address['phone']; ?>" oninput="preventEraseThePrefix(this)">
<!-- <label for="addressContact" class="text-dark font-weight-medium pt-3 mb-2">Contact Number</label>
@ -463,7 +521,7 @@ if ($_SESSION["isCustomer"] == true) {
</div>
<div class="form-group">
<label for="addressBuilding" class="text-dark font-weight-medium pt-3 mb-2">Building,Number</label>
<label for="addressBuilding" class="text-dark font-weight-medium pt-3 mb-2">House/Unit/Floor #, Bldg Name, Block or Lot #</label>
<input type="text" class="form-control" id="addressBuilding2" value="<?php echo $address['address_1']; ?>">
<!-- <label for="addressBuilding" class="text-dark font-weight-medium pt-3 mb-2"> Building,Number </label>
@ -513,7 +571,6 @@ if ($_SESSION["isCustomer"] == true) {
</div>
</div>
<!-- Bank -->
<div class="modal fade" id="vendorBankModal" tabindex="-1" role="dialog" aria-hidden="true">
<div class="modal-dialog modal-dialog-centered modal-sm" role="document" style="max-width: 800px;">
@ -530,16 +587,34 @@ if ($_SESSION["isCustomer"] == true) {
<div class="card-body">
<div class="container">
<div class="row">
<div class="col-md-12 mx-auto">
<label class="form-check-label" for="address_<?php echo $vendor_index; ?>_<?php echo $bank_index; ?>">
<strong style="font-weight: bold;">Bank Name: </strong><?php echo $bank['bank_name']; ?> <br>
<strong style="font-weight: bold;">Bank Account Number: </strong><?php echo $bank['bank_account_number']; ?> <br>
<strong style="font-weight: bold;">Bank Account Name: </strong><?php echo $bank['bank_account_name']; ?>
<div class="selectWrap" style="display: flex; justify-content: center; align-items: center; width: 50%;">
<input type="radio" name="payout_bank" id="payout_bank_<?php echo $vendor_index; ?>_<?php echo $bank_index; ?>" value="<?php echo $vendor_index; ?>_<?php echo $bank_index; ?>" onchange="setPayoutBank('<?php echo $vendor['_id']; ?>', <?php echo $bank_index; ?>, true)" <?php echo $bank['bank_payout'] ? 'checked' : ''; ?>>
<label for="payout_bank_<?php echo $vendor_index; ?>_<?php echo $bank_index; ?>">Set as Payout Bank</label>
<div class="col-md-10 mx-auto">
<div class="form-check" style="display: flex; align-items: center;">
<label class="form-check-label" for="address_<?php echo $vendor_index; ?>_<?php echo $bank_index; ?>">
<strong style="font-weight: bold;">Bank Name: </strong><?php echo $bank['bank_name']; ?> <br>
<strong style="font-weight: bold;">Bank Account Number: </strong><?php echo $bank['bank_account_number']; ?> <br>
<strong style="font-weight: bold;">Bank Account Name: </strong><?php echo $bank['bank_account_name']; ?>
</label>
<div class="selectWrap" style="margin-left: auto; display: flex; align-items: center;">
<input type="radio" style="height:15px !important; width: 15px !important;" name="payout_bank" id="payout_bank_<?php echo $vendor_index; ?>_<?php echo $bank_index; ?>" value="<?php echo $vendor_index; ?>_<?php echo $bank_index; ?>" onchange="setPayoutBank('<?php echo $vendor['_id']; ?>', <?php echo $bank_index; ?>, true)" <?php echo $bank['bank_payout'] ? 'checked' : ''; ?>>
<label for="payout_bank_<?php echo $vendor_index; ?>_<?php echo $bank_index; ?>" style="margin-bottom: 0; margin-left: 5px;">Set as Payout Bank</label>
</div>
</label>
</div>
</div>
<div class="col-md-2 mx-auto">
<div id="editDelete" style="display:flex; float:right; width:20px; margin-right:-10px;" >
<?php
$bank['id'] =$bank_index;
$jsonBank = json_encode($bank)?>
<a href="javascript:0" data-bs-toggle="modal" data-value=' <?php echo $jsonBank; ?>' data-bs-target="#editBankModal">
<i class="fa-regular fa-pen-to-square" style="font-size:15px; float:right;"></i></a>
<!-- <i class="fa-regular fa-trash-can" style="font-size:15px; float:right;"></i> -->
</div>
<div id="editDelete" style="display:flex; float:right; width:20px; margin-top:20px; margin-right:-20px; margin-top:30px;">
<!-- <i class="fa-solid fa-pen" style="font-size:15px; float:right;"></i></a> -->
<i onclick="deleteBank('<?php echo $vendor['_id']; ?>', <?php echo $bank_index; ?>, true)"
class="fa-regular fa-trash-can" style="font-size:15px; float:right;"></i>
</div>
</div>
</div>
</div>
@ -564,13 +639,12 @@ if ($_SESSION["isCustomer"] == true) {
</div>
<div class="form-group">
<label for="bankAccountNumber" class="text-dark font-weight-medium pt-3 mb-2">Bank Account Number</label>
<input type="text" class="form-control" id="bankAccountNumber">
<input type="number" class="form-control" id="bankAccountNumber">
</div>
<div class="form-group">
<label for="bankAccountName" class="text-dark font-weight-medium pt-3 mb-2">Bank Account Name</label>
<input type="text" class="form-control" id="bankAccountName">
</div>
<button type="button" class="btn btn-primary mt-4" id="submitBankBtn">Add Bank</button>
</form>
@ -579,6 +653,94 @@ if ($_SESSION["isCustomer"] == true) {
</div>
</div>
</div>
<!-- Louie Added Edit Bank Modal -->
<div class="modal fade" id="editBankModal" tabindex="-1" role="dialog" aria-hidden="true">
<div class="modal-dialog modal-dialog-centered modal-sm" role="document" style="max-width: 800px;">
<div class="modal-content">
<div class="modal-body" style="overflow-y: auto; max-height: 90vh;">
<form>
<div class="form-group">
<label for="bankName" class="text-dark font-weight-medium pt-3 mb-2">Bank Name</label>
<input type="text" class="form-control"
id="bankName2"
value="<?php echo $bank['bank_name']; ?>">
<!-- <label for="addressFirstName" class="text-dark font-weight-medium pt-3 mb-2">First Name</label>-->
<input type="hidden" class="form-control" id="bankId" >
<input type="hidden" class="form-control" id="bankPayoutStatus" >
</div>
<div class="form-group">
<label for="bankAccNum" class="text-dark font-weight-medium pt-3 mb-2">Bank Account Number</label>
<input min="0" type="number" class="form-control" id="bankAccNum" value="<?php echo $bank['bank_account_number']; ?>">
<!-- <label for="addressLastName" class="text-dark font-weight-medium pt-3 mb-2">Last Name</label>
<input type="text" class="form-control" id="addressLastName"> -->
</div>
<div class="form-group">
<label for="bankAccName" class="text-dark font-weight-medium pt-3 mb-2">Bank Account Name</label>
<input type="text" class="form-control" id="bankAccName" value="<?php echo $bank['bank_account_name']; ?>" >
<!-- <label for="addressContact" class="text-dark font-weight-medium pt-3 mb-2">Contact Number</label>
<input type="number" class="form-control" id="addressContact"> -->
</div>
<button type="button" class="btn btn-primary mt-4" id="editBankBtn">Submit</button>
</form>
</div>
</div>
</div>
</div>
<script>
function preventErasePrefix(input) { /* secondmodal */
var numericValue = input.value.replace(/\D/g, '');
if (numericValue.startsWith('63')) {
input.value = "+63 " + numericValue.substring(2);
} else {
input.value = "+63 " + numericValue;
}
if (input.value.length > 14) {
input.value = input.value.slice(0, 14);
}
}
function preventEraseThePrefix(input) { /* thirdmodal */
var numericValue = input.value.replace(/\D/g, '');
if (numericValue.startsWith('63')) {
input.value = "+63 " + numericValue.substring(2);
} else {
input.value = "+63 " + numericValue;
}
if (input.value.length > 14) {
input.value = input.value.slice(0, 14);
}
}
function preventEraseInPrefix(input) { /* edit details */
var numericValue = input.value.replace(/\D/g, '');
if (numericValue.startsWith('63')) {
input.value = "+63 " + numericValue.substring(2);
} else {
input.value = "+63 " + numericValue;
}
if (input.value.length > 14) {
input.value = input.value.slice(0, 14);
}
}
</script>
<script>
function editUser() {
// var fileInput = document.getElementById('fileInput' + vendorId);
@ -607,11 +769,11 @@ if ($_SESSION["isCustomer"] == true) {
})
.then(response => {
if (response.ok) {
console.log('Email update successful');
console.log('Profile updated successful');
location.reload();
// Handle any other actions after the successful email update
} else {
console.error('Email update failed');
console.error('Profile failed to update');
// Handle errors or display a message to the user
}
})
@ -654,7 +816,7 @@ if ($_SESSION["isCustomer"] == true) {
})
.then(response => {
if (response.ok) {
// location.reload();
location.reload();
// filter the delete action
document.getElementById('form-check-' + addressIndex).remove();
} else {
@ -833,6 +995,8 @@ if ($_SESSION["isCustomer"] == true) {
});
</script>
<script>
const vendorid = `<?php echo $_SESSION["LoggedInVendorId"]; ?>`;
document.addEventListener('DOMContentLoaded', function() {
@ -865,7 +1029,6 @@ if ($_SESSION["isCustomer"] == true) {
}
})
.then(provincesData => {
provincesData.forEach(province => {
const option = new Option(province.name, province.code);
provinceSelect.append(option);
@ -942,62 +1105,66 @@ if ($_SESSION["isCustomer"] == true) {
});
$('#submitBtn').on('click', function() {
console.log('clickkkkkkkk')
fetch('https://<?php echo $_SESSION["data_endpoint"]; ?>/api/v1/vendors/' + vendorid)
.then(response => response.json())
.then(data => {
const existingAddresses = data.address || [];
console.log('clickkkkkkkk')
fetch('https://<?php echo $_SESSION["data_endpoint"]; ?>/api/v1/vendors/' + vendorid)
.then(response => response.json())
.then(data => {
const existingAddresses = data.address || [];
const firstName = $('#addressFirstName').val();
const lastName = $('#addressLastName').val();
const contact = $('#addressContact').val();
const buildingNumber = $('#addressBuilding').val();
const street = $('#addressStreet').val();
const province = $('#provinceSelect :selected').text();
const city = $('#citySelect :selected').text();
const barangay = $('#barangaySelect :selected').text();
const country = $('#addressCountry').val();
const firstName = $('#addressFirstName').val();
const lastName = $('#addressLastName').val();
const contact = $('#addressContact').val();
const buildingNumber = $('#addressBuilding').val();
const street = $('#addressStreet').val();
const province = $('#provinceSelect :selected').text();
const city = $('#citySelect :selected').text();
const barangay = $('#barangaySelect :selected').text();
const country = $('#addressCountry').val();
const newAddress = {
first_name: firstName,
last_name: lastName,
phone: contact,
address_1: buildingNumber,
address_2: street,
city: city,
province: province,
barangay: barangay,
country: country,
};
const newAddress = {
first_name: firstName,
last_name: lastName,
phone: contact,
address_1: buildingNumber,
address_2: street,
city: city,
province: province,
barangay: barangay,
country: country,
};
// Check if it's the first address
if (existingAddresses.length === 0) {
newAddress.shipping = true; // Set shipping to true
}
existingAddresses.push(newAddress);
existingAddresses.push(newAddress);
return fetch('https://<?php echo $_SESSION["data_endpoint"]; ?>/api/v1/vendors/' + vendorid, {
method: 'PATCH',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify({
address: existingAddresses
}),
});
})
.then(response => {
if (response.ok) {
location.reload();
} else {
console.error('Failed to submit data');
alert('Failed to submit data');
}
})
.catch(error => {
console.error('Error:', error);
alert('Error submitting data');
});
});
return fetch('https://<?php echo $_SESSION["data_endpoint"]; ?>/api/v1/vendors/' + vendorid, {
method: 'PATCH',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify({
address: existingAddresses
}),
});
})
.then(response => {
if (response.ok) {
location.reload();
} else {
console.error('Failed to submit data');
alert('Failed to submit data');
}
})
.catch(error => {
console.error('Error:', error);
alert('Error submitting data');
});
});
});
@ -1099,7 +1266,6 @@ if ($_SESSION["isCustomer"] == true) {
const bankName = $('#bankName').val();
const bankAccountNumber = $('#bankAccountNumber').val();
const bankAccountName = $('#bankAccountName').val();
const newBank = {
bank_name: bankName,
bank_account_number: bankAccountNumber,
@ -1132,7 +1298,7 @@ if ($_SESSION["isCustomer"] == true) {
});
});
</script>
<script>
<script>
async function updateAddressBilling(vendorid, addressIndex, isBilling) {
try {
const apiUrl = `https://<?php echo $_SESSION["data_endpoint"]; ?>/api/v1/vendors/${vendorid}`;
@ -1180,6 +1346,27 @@ if ($_SESSION["isCustomer"] == true) {
if (!updateResponse.ok) {
throw new Error(`Failed to update address: ${updateResponse.status}`);
}
// console.log(`Address updated successfully for vendor ${vendorid}`);
const selectedBillingElement = document.getElementById('selectedBillingFName');
const selectedBillingLNameElement = document.getElementById('selectedBillingLName');
const selectedBillingContactElement = document.getElementById('selectedBillingContact');
const sBillingBuildingElement = document.getElementById('sBillingBuilding');
const sBillingStreetElement = document.getElementById('sBillingStreet');
const sBillingBarangayElement = document.getElementById('sBillingBarangay');
const sBillingCityElement = document.getElementById('sBillingCity');
const sBillingProvinceElement = document.getElementById('sBillingProvince');
const sBillingCountryElement = document.getElementById('sBillingCountry');
if (selectedBillingElement) {
selectedBillingElement.textContent = vendorsData.address[addressIndex].first_name;
selectedBillingLNameElement.textContent = vendorsData.address[addressIndex].last_name;
selectedBillingContactElement.textContent = 'Contact #: ' + vendorsData.address[addressIndex].phone;
sBillingBuildingElement.textContent = vendorsData.address[addressIndex].address_1;
sBillingStreetElement.textContent = vendorsData.address[addressIndex].address_2;
sBillingBarangayElement.textContent = vendorsData.address[addressIndex].barangay;
sBillingCityElement.textContent = vendorsData.address[addressIndex].city;
sBillingProvinceElement.textContent = vendorsData.address[addressIndex].province;
sBillingCountryElement.textContent = vendorsData.address[addressIndex].country;
}
console.log(`Address updated successfully for vendor ${vendorid}`);
} catch (error) {
console.error('Error updating address:', error.message);
@ -1310,6 +1497,128 @@ if ($_SESSION["isCustomer"] == true) {
}
</script>
<!-- Script added by Louie for Dynamic Edit Modal Box. May 08, 2024 -->
<script>
$('#editBankModal').on('shown.bs.modal', function (event) {
var jsonString = $(event.relatedTarget).data('value');
var jsonObject = JSON.parse(jsonString);
console.log("This is the data", jsonObject)
// shows inputed data by the vendor
document.querySelector('input[id="bankName2"]').value = jsonObject.bank_name;
document.querySelector('input[id="bankAccNum"]').value = jsonObject.bank_account_number;
document.querySelector('input[id="bankAccName"]').value = jsonObject.bank_account_name;
document.querySelector('input[id="bankPayoutStatus"]').value = jsonObject.bank_payout;
document.querySelector('input[id="bankId"]').value = jsonObject.id;
})
$('#editBankBtn').on('click', function() {
const vendorid = `<?php echo $_SESSION["LoggedInVendorId"]; ?>`;
console.log("The vendorid is", vendorid)
// fetch('https://api.obanana.shop/api/v1/customers/65482e8d209ff8d348bd30fd')
fetch('https://<?php echo $_SESSION["data_endpoint"]; ?>/api/v1/vendors/' + vendorid)
.then(response => response.json())
.then(data => {
// Get the existing addresses array
const existingBankDetails = data.bank_acount_details || [];
console.log("This is the existing data", existingBankDetails)
// Get the new bank details
const editedbankName = $('#bankName2').val();
const editedAccNum = $('#bankAccNum').val();
const editedAccName = $('#bankAccName').val();
const editedPayout = $('#bankPayoutStatus').val() === "true";
const id = $('#bankId').val();
console.log('this is the bank id '+ id)
console.log(typeof editedPayout);
console.log(editedPayout);
// Create a new address object
let bankDetails = existingBankDetails
bankDetails[id]={
bank_name: editedbankName,
bank_account_number: editedAccNum,
bank_account_name: editedAccName,
bank_payout: editedPayout,
};
console.log( bankDetails[id])
// Make a PATCH request to update the addresses array
return fetch('https://<?php echo $_SESSION["data_endpoint"]; ?>/api/v1/vendors/' + vendorid, {
method: 'PATCH',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify({
bank_acount_details: bankDetails
}),
});
})
.then(response => {
if (response.ok) {
// Handle success (e.g., show a success message)
location.reload();
} else {
// Handle error
console.error('Failed to submit data');
alert('Failed to submit data');
}
})
.catch(error => {
// Handle network or other errors
console.error('Error:', error);
alert('Error submitting data');
});
});
</script>
<!-- Script added by Louie for Deleting Bank Information. May 08, 2024 -->
<script>
const vendorId = `<?php echo $_SESSION["LoggedInVendorId"]; ?>`;
function deleteBank(vendorId, bankIndex) {
fetch('https://<?php echo $_SESSION["data_endpoint"]; ?>/api/v1/vendors/' + vendorId)
.then(response => response.json())
.then(data => {
let existingBank = data.bank_acount_details || [];
if (bankIndex >= 0 && bankIndex < existingBank.length) {
existingBank.splice(bankIndex, 1);
fetch('https://<?php echo $_SESSION["data_endpoint"]; ?>/api/v1/vendors/' + vendorId, {
method: 'PATCH',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify({
bank_acount_details: existingBank
}),
})
.then(response => {
if (response.ok) {
location.reload();
// filter the delete action
document.getElementById('form-check-' + bankIndex).remove();
} else {
console.error('Failed to submit data');
alert('Failed to submit data');
}
})
.catch(error => {
console.error('Error:', error);
alert('Error submitting data');
});
} else {
console.log("Invalid address index.");
}
})
.catch(error => {
console.error('Error:', error);
alert('Error fetching vendor data');
});
}
</script>
</section>
<!-- End Vendor setting section -->
@ -1434,10 +1743,10 @@ if ($_SESSION["isCustomer"] == true) {
})
.then(secondResponse => {
if (secondResponse.ok) {
console.log('Second request successful');
location.reload();
console.log('Profile Image Uploaded Successful');
// location.reload();
} else {
console.error('Second request failed');
console.error('Profile Image Failed to Upload');
}
})
.catch(error => {
@ -1527,10 +1836,10 @@ if ($_SESSION["isCustomer"] == true) {
})
.then(secondResponse => {
if (secondResponse.ok) {
console.log('Second request successful');
location.reload();
console.log('Profile Banner Uploaded Successful');
// location.reload();
} else {
console.error('Second request failed');
console.error('Profile Banner Failed to Upload');
}
})
.catch(error => {
@ -1567,7 +1876,7 @@ if ($_SESSION["isCustomer"] == true) {
</div>
<div class="form-group">
<label for="cphone-" class="text-dark font-weight-medium pt-3 mb-2">Contact Number</label>
<input type="text" class="form-control" id="cphone-" value="<?php echo $vendorData['phone'] ?>">
<input type="text" class="form-control" id="cphone-" value="<?php echo $vendorData['phone'] ?>" oninput="preventEraseInPrefix(this)">
</div>
<!-- 02-23-2023 Jun Jihad Vendor Description Field-->
<div class="form-group">
@ -1593,7 +1902,7 @@ if ($_SESSION["isCustomer"] == true) {
<!-- Modal end -->
<!-- Footer navigation panel for responsive display -->
<div class="ec-nav-toolbar">
<!-- <div class="ec-nav-toolbar">
<div class="container">
<div class="ec-nav-panel">
<div class="ec-nav-panel-icons">
@ -1614,7 +1923,7 @@ if ($_SESSION["isCustomer"] == true) {
</div>
</div>
</div>
</div> -->
<!-- Footer navigation panel for responsive display end -->
<!-- raymart remove popup feb 20 2024 -->
@ -1640,121 +1949,7 @@ if ($_SESSION["isCustomer"] == true) {
</div>
<!-- Cart Floating Button end -->
<!-- Whatsapp -->
<div class="ec-style ec-right-bottom">
<!-- Start Floating Panel Container -->
<div class="ec-panel">
<!-- Panel Header -->
<div class="ec-header">
<strong>Need Help?</strong>
<p>Chat with us on WhatsApp</p>
</div>
<!-- Panel Content -->
<div class="ec-body">
<ul>
<!-- Start Single Contact List -->
<li>
<a class="ec-list" data-number="918866774266" data-message="Please help me! I have got wrong product - ORDER ID is : #654321485">
<div class="d-flex bd-highlight">
<!-- Profile Picture -->
<div class="ec-img-cont">
<img loading="lazy" src="assets/images/whatsapp/profile_01.jpg" class="ec-user-img" alt="Profile image">
<span class="ec-status-icon"></span>
</div>
<!-- Display Name & Last Seen -->
<div class="ec-user-info">
<span>Sahar Darya</span>
<p>Sahar left 7 mins ago</p>
</div>
<!-- Chat iCon -->
<div class="ec-chat-icon">
<i class="fa fa-whatsapp"></i>
</div>
</div>
</a>
</li>
<!--/ End Single Contact List -->
<!-- Start Single Contact List -->
<li>
<a class="ec-list" data-number="918866774266" data-message="Please help me! I have got wrong product - ORDER ID is : #654321485">
<div class="d-flex bd-highlight">
<!-- Profile Picture -->
<div class="ec-img-cont">
<img loading="lazy" src="assets/images/whatsapp/profile_02.jpg" class="ec-user-img" alt="Profile image">
<span class="ec-status-icon ec-online"></span>
</div>
<!-- Display Name & Last Seen -->
<div class="ec-user-info">
<span>Yolduz Rafi</span>
<p>Yolduz is online</p>
</div>
<!-- Chat iCon -->
<div class="ec-chat-icon">
<i class="fa fa-whatsapp"></i>
</div>
</div>
</a>
</li>
<!--/ End Single Contact List -->
<!-- Start Single Contact List -->
<li>
<a class="ec-list" data-number="918866774266" data-message="Please help me! I have got wrong product - ORDER ID is : #654321485">
<div class="d-flex bd-highlight">
<!-- Profile Picture -->
<div class="ec-img-cont">
<img loading="lazy" src="assets/images/whatsapp/profile_03.jpg" class="ec-user-img" alt="Profile image">
<span class="ec-status-icon ec-offline"></span>
</div>
<!-- Display Name & Last Seen -->
<div class="ec-user-info">
<span>Nargis Hawa</span>
<p>Nargis left 30 mins ago</p>
</div>
<!-- Chat iCon -->
<div class="ec-chat-icon">
<i class="fa fa-whatsapp"></i>
</div>
</div>
</a>
</li>
<!--/ End Single Contact List -->
<!-- Start Single Contact List -->
<li>
<a class="ec-list" data-number="918866774266" data-message="Please help me! I have got wrong product - ORDER ID is : #654321485">
<div class="d-flex bd-highlight">
<!-- Profile Picture -->
<div class="ec-img-cont">
<img loading="lazy" src="assets/images/whatsapp/profile_04.jpg" class="ec-user-img" alt="Profile image">
<span class="ec-status-icon ec-offline"></span>
</div>
<!-- Display Name & Last Seen -->
<div class="ec-user-info">
<span>Khadija Mehr</span>
<p>Khadija left 50 mins ago</p>
</div>
<!-- Chat iCon -->
<div class="ec-chat-icon">
<i class="fa fa-whatsapp"></i>
</div>
</div>
</a>
</li>
<!--/ End Single Contact List -->
</ul>
</div>
</div>
<!--/ End Floating Panel Container -->
<!-- Start Right Floating Button-->
<div class="ec-right-bottom">
<div class="ec-box">
<div class="ec-button rotateBackward">
<img loading="lazy" class="whatsapp" src="assets/images/common/whatsapp.png" alt="whatsapp icon" />
</div>
</div>
</div>
<!--/ End Right Floating Button-->
</div>
<!-- Whatsapp end -->
<!-- Feature tools -->
<div class="ec-tools-sidebar-overlay"></div>

View File

@ -31,19 +31,19 @@ $token = $_SESSION["token"];
$response = addProduct(
$vendorId,
$productName,
$stock,
$price,
$salePrice,
$weight,
$length,
$width,
$height,
$specifications,
$productType,
$parentId,
$token);
$vendorId,
$productName,
$stock,
$price,
$salePrice,
$weight,
$length,
$width,
$height,
$specifications,
$productType,
$parentId,
$token);
$array = json_decode($response,true);
$_SESSION['newProductId'] = $array['_id'];
header("location: vendor-uploads.php");

View File

@ -54,32 +54,32 @@ for ($i = 0; $i < count($quantities); $i++) {
$response = editProduct(
$productId,
$vendorId,
$productName,
$stock,
$ndd,
$sdd,
$freeSf,
$price,
$salePrice,
$weight,
$length,
$width,
$height,
$description,
$specifications,
$productType,
$productCategory,
$productSf,
$productStatus,
$parentId,
$minimumOrder,
$color,
$material,
$size,
$priceMatrix,
$token);
$productId,
$vendorId,
$productName,
$stock,
$ndd,
$sdd,
$freeSf,
$price,
$salePrice,
$weight,
$length,
$width,
$height,
$description,
$specifications,
$productType,
$productCategory,
$productSf,
$productStatus,
$parentId,
$minimumOrder,
$color,
$material,
$size,
$priceMatrix,
$token);
$array = json_decode($response,true);
$_SESSION['newProdictId'] = $array['_id'];
header("location: vendor-all-product-list.php");

View File

@ -47,7 +47,10 @@ if ($_SESSION["isCustomer"] == true) {
<!-- css Icon Font -->
<link rel="stylesheet" href="assets/css/vendor/ecicons.min.css" />
<link rel="stylesheet" href="assets/css/vendor/ecicons.min.css" />
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.2/css/all.min.css"
integrity="sha512-SnH5WK+bZxgPHs44uWIX+LLJAJ9/2PkPKZ5QiAj6Ta86w+fsb2TkcmfRyVX3pBnMFcV7oQPJkl9QevSCWr3W6A=="
crossorigin="anonymous" referrerpolicy="no-referrer" />
<!-- css All Plugins Files -->
<link rel="stylesheet" href="assets/css/plugins/animate.css" />
@ -278,11 +281,11 @@ if ($_SESSION["isCustomer"] == true) {
<div class="row g-3">
<div class="col-md-6">
<label for="inputEmail4" class="form-label">Product name</label>
<input type="text" class="form-control slug-title" id="inputEmail4" name="product_name" value="<?php echo $array['product_name']; ?>">
<input type="text" class="form-control slug-title" id="inputEmail4" name="product_name" value="<?php echo $array['product_name']; ?>" required>
</div>
<div class="col-md-6">
<label class="form-label">Product Type</label>
<select id="Categories" class="form-select" name="product_type" onchange="variables()">
<select id="Categories" class="form-select" name="product_type" onchange="variables()" >
<option value="simple" <?php if ($array['product_type'] == 'simple') {
echo 'selected';
} ?>>Simple</option>
@ -342,32 +345,32 @@ if ($_SESSION["isCustomer"] == true) {
<div class="col-md-12">
<label for="slug" class="col-12 col-form-label">Slug</label>
<div class="col-12">
<input id="slug" name="slug" class="form-control here set-slug" type="text">
<input id="slug" name="slug" class="form-control here set-slug" type="text" required>
</div>
</div>
<div class="col-md-6">
<!-- <label for="weight" class="form-label">Weight</label> -->
<!-- raymart edit weight -->
<label for="weight" class="form-label">Weight(grams)</label>
<input type="number" class="form-control slug-title" id="width" name="weight" value="<?php echo $array['weight']; ?>">
<input type="number" class="form-control slug-title" id="width" name="weight" value="<?php echo $array['weight']; ?>" required>
</div>
<div class="col-md-6">
<!-- <label for="length" class="form-label">Length</label> -->
<!-- raymart edit length -->
<label for="length" class="form-label">Length(cm)</label>
<input type="number" class="form-control slug-title" id="width" name="length" value="<?php echo $array['length']; ?>">
<input type="number" class="form-control slug-title" id="width" name="length" value="<?php echo $array['length']; ?>" required>
</div>
<div class="col-md-6">
<!-- <label for="width" class="form-label">Width</label> -->
<!-- raymart edit width -->
<label for="width" class="form-label">Width(cm)</label>
<input type="number" class="form-control slug-title" id="width" name="width" value="<?php echo $array['width']; ?>">
<input type="number" class="form-control slug-title" id="width" name="width" value="<?php echo $array['width']; ?>" required>
</div>
<div class="col-md-6">
<!-- <label for="height" class="form-label">Height</label> -->
<!-- raymart edit height -->
<label for="height" class="form-label">Height(cm)</label>
<input type="number" class="form-control slug-title" id="height" name="height" value="<?php echo $array['height']; ?>">
<input type="number" class="form-control slug-title" id="height" name="height" value="<?php echo $array['height']; ?>" required>
</div>
<!-- raymart added short des feb 21 2024 -->
<div class="col-md-12">
@ -467,7 +470,7 @@ if ($_SESSION["isCustomer"] == true) {
</div> -->
<div class="col-md-6">
<label class="form-label">Product Category</label>
<select class="form-select" name="product_category" id="product_category">
<select class="form-select" name="product_category" id="product_category" required>
<option value="">Select Category</option>
<option value="Electronics" <?php echo ($array['product_category'] === 'Electronics') ? 'selected' : ''; ?>>Electronics</option>
<option value="Solar" <?php echo ($array['product_category'] === 'Solar') ? 'selected' : ''; ?>>Solar</option>
@ -486,7 +489,7 @@ if ($_SESSION["isCustomer"] == true) {
</div>
<div class="col-md-6">
<label class="form-label">Product Status</label>
<select class="form-select" name="status" id="status">
<select class="form-select" name="status" id="status" required>
<option value="">Select Product Status</option>
<option value="Active" <?php echo ($array['status'] === 'Active') ? 'selected' : ''; ?>>Active</option>
<option value="Inactive" <?php echo ($array['status'] === 'Inactive') ? 'selected' : ''; ?>>Inactive</option>
@ -932,121 +935,7 @@ if ($_SESSION["isCustomer"] == true) {
</div>
<!-- Cart Floating Button end -->
<!-- Whatsapp -->
<div class="ec-style ec-right-bottom">
<!-- Start Floating Panel Container -->
<div class="ec-panel">
<!-- Panel Header -->
<div class="ec-header">
<strong>Need Help?</strong>
<p>Chat with us on WhatsApp</p>
</div>
<!-- Panel Content -->
<div class="ec-body">
<ul>
<!-- Start Single Contact List -->
<li>
<a class="ec-list" data-number="918866774266" data-message="Please help me! I have got wrong product - ORDER ID is : #654321485">
<div class="d-flex bd-highlight">
<!-- Profile Picture -->
<div class="ec-img-cont">
<img loading="lazy" src="assets/images/whatsapp/profile_01.jpg" class="ec-user-img" alt="Profile image">
<span class="ec-status-icon"></span>
</div>
<!-- Display Name & Last Seen -->
<div class="ec-user-info">
<span>Sahar Darya</span>
<p>Sahar left 7 mins ago</p>
</div>
<!-- Chat iCon -->
<div class="ec-chat-icon">
<i class="fa fa-whatsapp"></i>
</div>
</div>
</a>
</li>
<!--/ End Single Contact List -->
<!-- Start Single Contact List -->
<li>
<a class="ec-list" data-number="918866774266" data-message="Please help me! I have got wrong product - ORDER ID is : #654321485">
<div class="d-flex bd-highlight">
<!-- Profile Picture -->
<div class="ec-img-cont">
<img loading="lazy" src="assets/images/whatsapp/profile_02.jpg" class="ec-user-img" alt="Profile image">
<span class="ec-status-icon ec-online"></span>
</div>
<!-- Display Name & Last Seen -->
<div class="ec-user-info">
<span>Yolduz Rafi</span>
<p>Yolduz is online</p>
</div>
<!-- Chat iCon -->
<div class="ec-chat-icon">
<i class="fa fa-whatsapp"></i>
</div>
</div>
</a>
</li>
<!--/ End Single Contact List -->
<!-- Start Single Contact List -->
<li>
<a class="ec-list" data-number="918866774266" data-message="Please help me! I have got wrong product - ORDER ID is : #654321485">
<div class="d-flex bd-highlight">
<!-- Profile Picture -->
<div class="ec-img-cont">
<img loading="lazy" src="assets/images/whatsapp/profile_03.jpg" class="ec-user-img" alt="Profile image">
<span class="ec-status-icon ec-offline"></span>
</div>
<!-- Display Name & Last Seen -->
<div class="ec-user-info">
<span>Nargis Hawa</span>
<p>Nargis left 30 mins ago</p>
</div>
<!-- Chat iCon -->
<div class="ec-chat-icon">
<i class="fa fa-whatsapp"></i>
</div>
</div>
</a>
</li>
<!--/ End Single Contact List -->
<!-- Start Single Contact List -->
<li>
<a class="ec-list" data-number="918866774266" data-message="Please help me! I have got wrong product - ORDER ID is : #654321485">
<div class="d-flex bd-highlight">
<!-- Profile Picture -->
<div class="ec-img-cont">
<img loading="lazy" src="assets/images/whatsapp/profile_04.jpg" class="ec-user-img" alt="Profile image">
<span class="ec-status-icon ec-offline"></span>
</div>
<!-- Display Name & Last Seen -->
<div class="ec-user-info">
<span>Khadija Mehr</span>
<p>Khadija left 50 mins ago</p>
</div>
<!-- Chat iCon -->
<div class="ec-chat-icon">
<i class="fa fa-whatsapp"></i>
</div>
</div>
</a>
</li>
<!--/ End Single Contact List -->
</ul>
</div>
</div>
<!--/ End Floating Panel Container -->
<!-- Start Right Floating Button-->
<div class="ec-right-bottom">
<div class="ec-box">
<div class="ec-button rotateBackward">
<img loading="lazy" class="whatsapp" src="assets/images/common/whatsapp.png" alt="whatsapp icon" />
</div>
</div>
</div>
<!--/ End Right Floating Button-->
</div>
<!-- Whatsapp end -->
<!-- Feature tools -->
<div class="ec-tools-sidebar-overlay"></div>

View File

@ -7,7 +7,7 @@ $current_page = basename($_SERVER['PHP_SELF']);
<ul>
<li <?php if ($current_page == 'vendor-dashboard.php') echo 'class="active"'; ?>><a href="vendor-dashboard.php" id="vendor-dashboard-link">Dashboards</a></li>
<li <?php if ($current_page == 'vendor-uploads.php') echo 'class="active"'; ?>><a onclick="addProduct();" id="vendor-uploads-link">Uploads</a></li>
<li <?php if ($current_page == 'vendor-settings.php') echo 'class="active"'; ?>><a href="vendor-settings.php" id="vendor-settings-link">Settings (edit)</a></li>
<li <?php if ($current_page == 'vendor-settings.php') echo 'class="active"'; ?>><a href="vendor-settings.php" id="vendor-settings-link">Vendor Profile</a></li>
<li <?php if ($current_page == 'vendor-refund-history.php') echo 'class="active"'; ?>><a href="vendor-refund-history.php" id="vendor-refund-history-link">Vendor Refund History</a></li>
<li <?php if ($current_page == 'vendor-payments.php') echo 'class="active"'; ?>><a href="vendor-payments.php" id="vendor-payments-link">Payments</a></li>
<li <?php if ($current_page == 'vendor-payouts.php') echo 'class="active"'; ?>><a href="vendor-payouts.php" id="vendor-payouts-link">Payouts</a></li>

View File

@ -41,7 +41,10 @@ if ($_SESSION["isVendor"] == true) {
<!-- css Icon Font -->
<link rel="stylesheet" href="assets/css/vendor/ecicons.min.css" />
<link rel="stylesheet" href="assets/css/vendor/ecicons.min.css" />
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.2/css/all.min.css"
integrity="sha512-SnH5WK+bZxgPHs44uWIX+LLJAJ9/2PkPKZ5QiAj6Ta86w+fsb2TkcmfRyVX3pBnMFcV7oQPJkl9QevSCWr3W6A=="
crossorigin="anonymous" referrerpolicy="no-referrer" />
<!-- css All Plugins Files -->
@ -174,229 +177,244 @@ if ($_SESSION["isVendor"] == true) {
</div>
<div class="row margin-minus-b-30">
<?php foreach ($customer['favorites']['products'] as $product) {
// raymart added vendorproduct feb 14 2024
$vendorOfProduct = getVendorbyId($product['vendor_api_id']);
?>
<div class="col-lg-3 col-md-4 col-sm-6 col-xs-6 mb-6 pro-gl-content">
<div class="ec-product-inner">
<!-- raymart added style for checkboxes feb 19 2024 -->
<input type="checkbox" class="product-checkbox" style="width: 20px; height: 20px; "value="<?php echo $product["_id"]; ?>">
<div class="ec-pro-image-outer">
<div class="ec-pro-image">
<a href="product-left-sidebar.php?id=<?php echo $product["_id"]; ?>" class="image">
<!-- <a href="shop-left-sidebar-col-4.php" class="image"> -->
<img loading="lazy" class="main-image" src="<?php echo $product["product_image"]; ?>" alt="Product" />
<!-- <img loading="lazy" class="hover-image" src="<?php echo $product["product_image"]; ?>" alt="Product" /> -->
</a>
<span class="ec-com-remove ec-remove-wishlist">
<a href="javascript:void(0)" class="remove-product" data-product-id="<?php echo $product["_id"]; ?>" id="removeItem<?php echo $product["_id"]; ?>">×</a>
</span>
<!-- raymart edit action feb 14 2024 -->
<div class="ec-pro-actions">
<button title="Add To Cart" onclick="popupAddToCart(`<?php echo htmlspecialchars(json_encode($product), ENT_QUOTES, 'UTF-8'); ?>`,`<?php echo htmlspecialchars($vendorOfProduct, ENT_QUOTES, 'UTF-8'); ?>`, `<?php echo isset($_SESSION['token']) ? $_SESSION['token'] : ''; ?>` , `<?php echo isset($_SESSION['email']) ? $_SESSION['email'] : ''; ?>` , `<?php echo isset($_SESSION['password']) ? $_SESSION['password'] : ''; ?>` , `<?php echo htmlspecialchars(json_encode($customer_data), ENT_QUOTES, 'UTF-8'); ?>`);" class="add-to-cart"><i class="fi-rr-shopping-basket"></i> Add To Cart</button>
<a class="ec-btn-group wishlist" title="Wishlist" onclick="popupWishlist('<?php echo htmlspecialchars(json_encode($product), ENT_QUOTES, 'UTF-8'); ?>', '<?php echo htmlspecialchars(json_encode($customer_data), ENT_QUOTES, 'UTF-8'); ?>');"><i class="fi-rr-heart"></i></a>
<?php
if (empty($customer['favorites']['products'])) {
echo '<div class="col-12 text-center fs-2"><p>No wishlist</p></div>'; // Display "No wishlist" message if wishlist is empty
} else {
foreach ($customer['favorites']['products'] as $product) {
// raymart added vendorproduct feb 14 2024
$vendorOfProduct = getVendorbyId($product['vendor_api_id']);
?>
<div class="col-lg-3 col-md-4 col-sm-6 col-xs-6 mb-6 pro-gl-content">
<div class="ec-product-inner">
<!-- raymart added style for checkboxes feb 19 2024 -->
<input type="checkbox" class="product-checkbox" style="width: 20px; height: 20px; "value="<?php echo $product["_id"]; ?>">
<div class="ec-pro-image-outer" style="max-width: 290px; height: 350px;">
<div class="ec-pro-image">
<a href="product-left-sidebar.php?id=<?php echo $product["_id"]; ?>" class="image">
<!-- <a href="shop-left-sidebar-col-4.php" class="image"> -->
<img loading="lazy" class="main-image" src="<?php echo $product["images"]; ?>" alt="Product" style="border: 1px solid #eeeeee; height: 330px; object-fit: cover;"/>
<!-- <img loading="lazy" class="hover-image" src="<?php echo $product["images"]; ?>" alt="Product" /> -->
</a>
<span class="ec-com-remove ec-remove-wishlist">
<a href="javascript:void(0)" class="remove-product" data-product-id="<?php echo $product["_id"]; ?>" id="removeItem<?php echo $product["_id"]; ?>">×</a>
</span>
<!-- raymart edit action feb 14 2024 -->
<div class="ec-pro-actions" style="bottom: -70px;">
<!-- <button title="Add To Cart" onclick="popupAddToCart(`<?php echo htmlspecialchars(json_encode($product), ENT_QUOTES, 'UTF-8'); ?>`,`<?php echo htmlspecialchars($vendorOfProduct, ENT_QUOTES, 'UTF-8'); ?>`, `<?php echo isset($_SESSION['token']) ? $_SESSION['token'] : ''; ?>` , `<?php echo isset($_SESSION['email']) ? $_SESSION['email'] : ''; ?>` , `<?php echo isset($_SESSION['password']) ? $_SESSION['password'] : ''; ?>` , `<?php echo htmlspecialchars(json_encode($customer_data), ENT_QUOTES, 'UTF-8'); ?>`);" class="add-to-cart"><i class="fi-rr-shopping-basket"></i> Add To Cart</button> -->
<!-- <a class="ec-btn-group wishlist" title="Wishlist" onclick="popupWishlist('<?php echo htmlspecialchars(json_encode($product), ENT_QUOTES, 'UTF-8'); ?>', '<?php echo htmlspecialchars(json_encode($customer_data), ENT_QUOTES, 'UTF-8'); ?>');"><i class="fi-rr-heart"></i></a> -->
<?php if (isset($product["sale_price"]) && $product["sale_price"] > 0) : ?>
<button title="Add To Cart" onclick="popupAddToCart(`<?php echo htmlspecialchars(json_encode($product), ENT_QUOTES, 'UTF-8'); ?>`,`<?php echo htmlspecialchars($vendorOfProduct, ENT_QUOTES, 'UTF-8'); ?>`, `<?php echo isset($_SESSION['token']) ? $_SESSION['token'] : ''; ?>` , `<?php echo isset($_SESSION['email']) ? $_SESSION['email'] : ''; ?>` , `<?php echo isset($_SESSION['password']) ? $_SESSION['password'] : ''; ?>` , `<?php echo htmlspecialchars(json_encode($customer_data), ENT_QUOTES, 'UTF-8'); ?>`);" class="add-to-cart"><i class="fi-rr-shopping-basket"></i> Add To Cart</button>
<?php elseif (isset($product["regular_price"]) && $product["regular_price"] != "") : ?>
<button title="Add To Cart" onclick="popupAddToCart(`<?php echo htmlspecialchars(json_encode($product), ENT_QUOTES, 'UTF-8'); ?>`,`<?php echo htmlspecialchars($vendorOfProduct, ENT_QUOTES, 'UTF-8'); ?>`, `<?php echo isset($_SESSION['token']) ? $_SESSION['token'] : ''; ?>` , `<?php echo isset($_SESSION['email']) ? $_SESSION['email'] : ''; ?>` , `<?php echo isset($_SESSION['password']) ? $_SESSION['password'] : ''; ?>` , `<?php echo htmlspecialchars(json_encode($customer_data), ENT_QUOTES, 'UTF-8'); ?>`);" class="add-to-cart"><i class="fi-rr-shopping-basket"></i> Add To Cart</button>
<?php else : ($product["regular_price"] == "" || $product["regular_price"] == null) ?>
<?php endif; ?>
</div>
</div>
</div>
</div>
<div class="ec-pro-content">
<h5 class="ec-pro-title"><a href="product-left-sidebar.php?id=<?php echo $product["_id"]; ?>"><?php echo $product["product_name"]; ?></a></h5>
<!-- <div class="ec-pro-rating">
<i class="ecicon eci-star fill"></i>
<i class="ecicon eci-star fill"></i>
<i class="ecicon eci-star fill"></i>
<i class="ecicon eci-star fill"></i>
<i class="ecicon eci-star"></i>
</div> -->
<!-- <div class="ec-pro-list-desc">Lorem Ipsum is simply dummy text of the
printing and typesetting industry. Lorem Ipsum is simply dutmmy text
ever since the 1500s, when an unknown printer took a galley.</div> -->
<?php if ($product['product_type'] === 'variable') {
$variation_products = getProductVariations($product['_id']);
if ($variation_products) {
$variation_details = json_decode($variation_products, true);
}
} ?>
<!-- <span class="ec-price">
<span class="old-price">$12.00 <?php echo $product["regular_price"]; ?></span>
<span class="new-price">$10.00</span>
</span> -->
<?php
if ($product['product_type'] === "simple") {
if (isset($product['sale_price']) && $product['sale_price'] > 0) {
echo '<span class="ec-price">';
echo '<span class="old-price">' . $product['regular_price'] . '</span>';
echo '<span class="new-price">' . $product['sale_price'] . '</span>';
echo '</span>';
} else {
echo '<span class="new-price">' . $product['regular_price'] . '</span>';
}
} elseif ($product['product_type'] === "variable") {
$lowest_regular_price = null;
$highest_regular_price = null;
$lowest_sale_price = null;
$highest_sale_price = null;
<div class="ec-pro-content">
<h5 class="ec-pro-title"><a href="product-left-sidebar.php?id=<?php echo $product["_id"]; ?>"><?php echo $product["product_name"]; ?></a></h5>
<!-- <div class="ec-pro-rating">
<i class="ecicon eci-star fill"></i>
<i class="ecicon eci-star fill"></i>
<i class="ecicon eci-star fill"></i>
<i class="ecicon eci-star fill"></i>
<i class="ecicon eci-star"></i>
</div> -->
<!-- <div class="ec-pro-list-desc">Lorem Ipsum is simply dummy text of the
printing and typesetting industry. Lorem Ipsum is simply dutmmy text
ever since the 1500s, when an unknown printer took a galley.</div> -->
<?php if ($product['product_type'] === 'variable') {
$variation_products = getProductVariations($product['_id']);
if ($variation_products) {
$variation_details = json_decode($variation_products, true);
}
} ?>
<!-- <span class="ec-price">
<span class="old-price">$12.00 <?php echo $product["regular_price"]; ?></span>
<span class="new-price">$10.00</span>
</span> -->
<?php
if ($product['product_type'] === "simple") {
if (isset($product['sale_price']) && $product['sale_price'] > 0) {
echo '<span class="ec-price">';
echo '<span class="old-price">' . $product['regular_price'] . '</span>';
echo '<span class="new-price">' . $product['sale_price'] . '</span>';
echo '</span>';
} else {
echo '<span class="new-price">' . $product['regular_price'] . '</span>';
}
} elseif ($product['product_type'] === "variable") {
$lowest_regular_price = null;
$highest_regular_price = null;
$lowest_sale_price = null;
$highest_sale_price = null;
if (isset($variation_details) && is_array($variation_details)) {
foreach ($variation_details as $index => $variation) {
$regular_price = isset($variation['regular_price']) ? $variation['regular_price'] : 0;
$sale_price = isset($variation['sale_price']) ? $variation['sale_price'] : 0;
if (isset($variation_details) && is_array($variation_details)) {
foreach ($variation_details as $index => $variation) {
$regular_price = isset($variation['regular_price']) ? $variation['regular_price'] : 0;
$sale_price = isset($variation['sale_price']) ? $variation['sale_price'] : 0;
// Update the minimum and maximum prices only if they are not null
if ($lowest_regular_price === null || $regular_price < $lowest_regular_price) {
$lowest_regular_price = $regular_price;
}
// Update the minimum and maximum prices only if they are not null
if ($lowest_regular_price === null || $regular_price < $lowest_regular_price) {
$lowest_regular_price = $regular_price;
}
if ($highest_regular_price === null || $regular_price > $highest_regular_price) {
$highest_regular_price = $regular_price;
}
if ($highest_regular_price === null || $regular_price > $highest_regular_price) {
$highest_regular_price = $regular_price;
}
if ($lowest_sale_price === null || $sale_price < $lowest_sale_price) {
$lowest_sale_price = $sale_price;
}
if ($lowest_sale_price === null || $sale_price < $lowest_sale_price) {
$lowest_sale_price = $sale_price;
}
if ($highest_sale_price === null || $sale_price > $highest_sale_price) {
$highest_sale_price = $sale_price;
if ($highest_sale_price === null || $sale_price > $highest_sale_price) {
$highest_sale_price = $sale_price;
}
}
}
}
// Display the range of prices based on the presence of sale prices
if ($lowest_sale_price !== null && $highest_sale_price !== null && $lowest_sale_price > 0 && $highest_sale_price > 0) {
echo '<span id="productPrice" class="new-price">' . '&#8369;' . $lowest_sale_price . ' - &#8369;' . $highest_sale_price . '</span>';
} elseif ($lowest_regular_price !== null && $highest_regular_price !== null) {
echo '<span id="productPrice" class="new-price">' . '&#8369;' . $lowest_regular_price . ' - &#8369;' . $highest_regular_price . '</span>';
// Display the range of prices based on the presence of sale prices
if ($lowest_sale_price !== null && $highest_sale_price !== null && $lowest_sale_price > 0 && $highest_sale_price > 0) {
echo '<span id="productPrice" class="new-price">' . '&#8369;' . $lowest_sale_price . ' - &#8369;' . $highest_sale_price . '</span>';
} elseif ($lowest_regular_price !== null && $highest_regular_price !== null) {
echo '<span id="productPrice" class="new-price">' . '&#8369;' . $lowest_regular_price . ' - &#8369;' . $highest_regular_price . '</span>';
}
}
}
?>
?>
</div>
</div>
</div>
</div>
<script>
customerId = '<?php echo $_SESSION['customerId']; ?>'
// Add event listener to remove button
document.addEventListener('DOMContentLoaded', function() {
var removeButtons = document.querySelectorAll('.remove-product');
removeButtons.forEach(function(removeButton) {
removeButton.addEventListener('click', function() {
var productId = removeButton.getAttribute('data-product-id');
removeProduct(productId);
<script>
customerId = '<?php echo $_SESSION['customerId']; ?>'
// Add event listener to remove button
document.addEventListener('DOMContentLoaded', function() {
var removeButtons = document.querySelectorAll('.remove-product');
removeButtons.forEach(function(removeButton) {
removeButton.addEventListener('click', function() {
var productId = removeButton.getAttribute('data-product-id');
removeProduct(productId);
});
});
var deleteButton = document.getElementById('delete-button');
deleteButton.addEventListener('click', function() {
var selectedProducts = [];
var checkboxes = document.querySelectorAll('.product-checkbox');
checkboxes.forEach(function(checkbox) {
if (checkbox.checked) {
selectedProducts.push(checkbox.value);
}
});
deleteProducts(selectedProducts);
});
});
var deleteButton = document.getElementById('delete-button');
deleteButton.addEventListener('click', function() {
var selectedProducts = [];
var checkboxes = document.querySelectorAll('.product-checkbox');
checkboxes.forEach(function(checkbox) {
if (checkbox.checked) {
selectedProducts.push(checkbox.value);
}
var selectAllButton = document.querySelector('#select-button');
selectAllButton.addEventListener('click', function() {
var selectedProducts = [];
var checkboxes = document.querySelectorAll('.product-checkbox');
// checkboxes.forEach(function(checkbox) {
// }
console.log('clicked')
for (let i = 0; i < checkboxes.length; i++ ) {
checkboxes[i].checked = selectAllButton.checked
// checkboxes[i].checked = true
}})
// Function to remove product
function removeProduct(productId) {
// Get all product IDs except the one to remove
var remainingProductIds = Array.from(document.querySelectorAll('.remove-product')).map(function(button) {
return button.getAttribute('data-product-id');
}).filter(function(id) {
return id !== productId;
});
deleteProducts(selectedProducts);
});
});
var selectAllButton = document.querySelector('#select-button');
selectAllButton.addEventListener('click', function() {
var selectedProducts = [];
var checkboxes = document.querySelectorAll('.product-checkbox');
// checkboxes.forEach(function(checkbox) {
// }
console.log('clicked')
for (let i = 0; i < checkboxes.length; i++ ) {
checkboxes[i].checked = selectAllButton.checked
// checkboxes[i].checked = true
}})
// Function to remove product
function removeProduct(productId) {
// Get all product IDs except the one to remove
var remainingProductIds = Array.from(document.querySelectorAll('.remove-product')).map(function(button) {
return button.getAttribute('data-product-id');
}).filter(function(id) {
return id !== productId;
});
// Make an AJAX request to update the favorites with the remaining products
var xhr = new XMLHttpRequest();
// xhr.open('PATCH', 'https://api.obanana.shop/api/v1/customers/' + customerId, true);
xhr.open('PATCH', 'https://<?php echo $_SESSION["data_endpoint"]; ?>/api/v1/customers/' + customerId, true);
xhr.setRequestHeader('Content-Type', 'application/json');
xhr.onreadystatechange = function() {
if (xhr.readyState === XMLHttpRequest.DONE) {
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
} else {
// Handle error response
console.error('Error removing product:', xhr.responseText);
// Make an AJAX request to update the favorites with the remaining products
var xhr = new XMLHttpRequest();
// xhr.open('PATCH', 'https://api.obanana.shop/api/v1/customers/' + customerId, true);
xhr.open('PATCH', 'https://<?php echo $_SESSION["data_endpoint"]; ?>/api/v1/customers/' + customerId, true);
xhr.setRequestHeader('Content-Type', 'application/json');
xhr.onreadystatechange = function() {
if (xhr.readyState === XMLHttpRequest.DONE) {
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
} else {
// Handle error response
console.error('Error removing product:', xhr.responseText);
}
}
}
};
// Construct data object with the remaining product IDs
var data = JSON.stringify({
favorites: {
products: remainingProductIds.map(function(id) {
// Find the product object with the corresponding ID
var remainingProduct = <?php echo json_encode($customer['favorites']['products']); ?>.find(function(product) {
return product['_id'] === id;
});
};
// Construct data object with the remaining product IDs
var data = JSON.stringify({
favorites: {
products: remainingProductIds.map(function(id) {
// Find the product object with the corresponding ID
var remainingProduct = <?php echo json_encode($customer['favorites']['products']); ?>.find(function(product) {
return product['_id'] === id;
});
// Return the entire product object
return remainingProduct;
})
}
});
xhr.send(data);
}
// Function to delete multiple products
function deleteProducts(productIds) {
var xhr = new XMLHttpRequest();
// xhr.open('PATCH', 'https://api.obanana.shop/api/v1/customers/' + customerId, true);
xhr.open('PATCH', 'https://<?php echo $_SESSION["data_endpoint"]; ?>/api/v1/customers/' + customerId, true);
xhr.setRequestHeader('Content-Type', 'application/json');
xhr.onreadystatechange = function() {
if (xhr.readyState === XMLHttpRequest.DONE) {
if (xhr.status === 200) {
console.log('Products removed successfully');
// location.reload();
} else {
console.error('Error removing products:', xhr.responseText);
// Return the entire product object
return remainingProduct;
})
}
}
};
var remainingProductIds = Array.from(document.querySelectorAll('.remove-product')).map(function(button) {
return button.getAttribute('data-product-id');
}).filter(function(id) {
return !productIds.includes(id);
});
var data = JSON.stringify({
favorites: {
products: remainingProductIds.map(function(id) {
var remainingProduct = <?php echo json_encode($customer['favorites']['products']); ?>.find(function(product) {
return product['_id'] === id;
});
return remainingProduct;
})
}
});
xhr.send(data);
}
});
xhr.send(data);
}
// Function to delete multiple products
function deleteProducts(productIds) {
var xhr = new XMLHttpRequest();
// xhr.open('PATCH', 'https://api.obanana.shop/api/v1/customers/' + customerId, true);
xhr.open('PATCH', 'https://<?php echo $_SESSION["data_endpoint"]; ?>/api/v1/customers/' + customerId, true);
xhr.setRequestHeader('Content-Type', 'application/json');
xhr.onreadystatechange = function() {
if (xhr.readyState === XMLHttpRequest.DONE) {
if (xhr.status === 200) {
console.log('Products removed successfully');
location.reload();
} else {
console.error('Error removing products:', xhr.responseText);
}
}
};
var remainingProductIds = Array.from(document.querySelectorAll('.remove-product')).map(function(button) {
return button.getAttribute('data-product-id');
}).filter(function(id) {
return !productIds.includes(id);
});
var data = JSON.stringify({
favorites: {
products: remainingProductIds.map(function(id) {
var remainingProduct = <?php echo json_encode($customer['favorites']['products']); ?>.find(function(product) {
return product['_id'] === id;
});
return remainingProduct;
})
}
});
xhr.send(data);
}
</script>
<?php } ?>
<?php } }?>
</div>
</div>
@ -516,7 +534,7 @@ if ($_SESSION["isVendor"] == true) {
<!-- Footer navigation panel for responsive display -->
<div class="ec-nav-toolbar">
<!-- <div class="ec-nav-toolbar">
<div class="container">
<div class="ec-nav-panel">
<div class="ec-nav-panel-icons">
@ -538,7 +556,7 @@ if ($_SESSION["isVendor"] == true) {
</div>
</div>
</div>
</div> -->
<!-- Footer navigation panel for responsive display end -->
@ -566,121 +584,7 @@ if ($_SESSION["isVendor"] == true) {
<!-- Cart Floating Button end -->
<!-- Whatsapp -->
<div class="ec-style ec-right-bottom">
<!-- Start Floating Panel Container -->
<div class="ec-panel">
<!-- Panel Header -->
<div class="ec-header">
<strong>Need Help?</strong>
<p>Chat with us on WhatsApp</p>
</div>
<!-- Panel Content -->
<div class="ec-body">
<ul>
<!-- Start Single Contact List -->
<li>
<a class="ec-list" data-number="918866774266" data-message="Please help me! I have got wrong product - ORDER ID is : #654321485">
<div class="d-flex bd-highlight">
<!-- Profile Picture -->
<div class="ec-img-cont">
<img loading="lazy" src="assets/images/whatsapp/profile_01.jpg" class="ec-user-img" alt="Profile image">
<span class="ec-status-icon"></span>
</div>
<!-- Display Name & Last Seen -->
<div class="ec-user-info">
<span>Sahar Darya</span>
<p>Sahar left 7 mins ago</p>
</div>
<!-- Chat iCon -->
<div class="ec-chat-icon">
<i class="fa fa-whatsapp"></i>
</div>
</div>
</a>
</li>
<!--/ End Single Contact List -->
<!-- Start Single Contact List -->
<li>
<a class="ec-list" data-number="918866774266" data-message="Please help me! I have got wrong product - ORDER ID is : #654321485">
<div class="d-flex bd-highlight">
<!-- Profile Picture -->
<div class="ec-img-cont">
<img loading="lazy" src="assets/images/whatsapp/profile_02.jpg" class="ec-user-img" alt="Profile image">
<span class="ec-status-icon ec-online"></span>
</div>
<!-- Display Name & Last Seen -->
<div class="ec-user-info">
<span>Yolduz Rafi</span>
<p>Yolduz is online</p>
</div>
<!-- Chat iCon -->
<div class="ec-chat-icon">
<i class="fa fa-whatsapp"></i>
</div>
</div>
</a>
</li>
<!--/ End Single Contact List -->
<!-- Start Single Contact List -->
<li>
<a class="ec-list" data-number="918866774266" data-message="Please help me! I have got wrong product - ORDER ID is : #654321485">
<div class="d-flex bd-highlight">
<!-- Profile Picture -->
<div class="ec-img-cont">
<img loading="lazy" src="assets/images/whatsapp/profile_03.jpg" class="ec-user-img" alt="Profile image">
<span class="ec-status-icon ec-offline"></span>
</div>
<!-- Display Name & Last Seen -->
<div class="ec-user-info">
<span>Nargis Hawa</span>
<p>Nargis left 30 mins ago</p>
</div>
<!-- Chat iCon -->
<div class="ec-chat-icon">
<i class="fa fa-whatsapp"></i>
</div>
</div>
</a>
</li>
<!--/ End Single Contact List -->
<!-- Start Single Contact List -->
<li>
<a class="ec-list" data-number="918866774266" data-message="Please help me! I have got wrong product - ORDER ID is : #654321485">
<div class="d-flex bd-highlight">
<!-- Profile Picture -->
<div class="ec-img-cont">
<img loading="lazy" src="assets/images/whatsapp/profile_04.jpg" class="ec-user-img" alt="Profile image">
<span class="ec-status-icon ec-offline"></span>
</div>
<!-- Display Name & Last Seen -->
<div class="ec-user-info">
<span>Khadija Mehr</span>
<p>Khadija left 50 mins ago</p>
</div>
<!-- Chat iCon -->
<div class="ec-chat-icon">
<i class="fa fa-whatsapp"></i>
</div>
</div>
</a>
</li>
<!--/ End Single Contact List -->
</ul>
</div>
</div>
<!--/ End Floating Panel Container -->
<!-- Start Right Floating Button-->
<div class="ec-right-bottom">
<div class="ec-box">
<div class="ec-button rotateBackward">
<img loading="lazy" class="whatsapp" src="assets/images/common/whatsapp.png" alt="whatsapp icon" />
</div>
</div>
</div>
<!--/ End Right Floating Button-->
</div>
<!-- Whatsapp end -->
<!-- Feature tools -->
@ -777,7 +681,7 @@ if ($_SESSION["isVendor"] == true) {
<!-- <script src="assets/js/tester10.js"></script> -->
<?php
if ($_SESSION["is_test"]==true) {
echo '<script src="assets/js/tester10.js"></script>';
echo '<script src="assets/js/tester11.js"></script>';
} else {
echo '<script src="assets/js/produc3.js"></script>';
}