obanana_b2b_test/vendor-settings.php

2132 lines
121 KiB
PHP
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<?php
include "functions.php";
if ($_SESSION["userId"] <> "") {
$_SESSION["isLoggedIn"] = true;
// $customer_data = getCustomerbyLoginId($_SESSION["userId"]);
$vendorLoginId = searchVendorbyLoginId($_SESSION["userId"]);
$vendorLoginIdjson = json_decode($vendorLoginId, true);
// var_dump( $vendorLoginIdjson);
if (isset($vendorLoginIdjson['results'][0])) {
$vendorData = $vendorLoginIdjson['results'][0];
$vendorId = $vendorData['_id'];
$_SESSION["LoggedInVendorId"] = $vendorId;
}
// $vendor= getVendorbyId($vendorLoginIdjson['results'][0]['_id']);
// // var_dump($vendor);
// $array = json_decode($vendor,true);
// var_dump($array);
} else {
$_SESSION["isLoggedIn"] = false;
header("location: login.php");
}
if ($_SESSION["isCustomer"] == true) {
header("location: user-profile.php");
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="x-ua-compatible" content="ie=edge" />
<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="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" />
<meta name="msapplication-TileImage" content="assets/images/favicon/favicon.png" />
<!-- css Icon Font -->
<link rel="stylesheet" href="assets/css/vendor/ecicons.min.css" />
<!-- css All Plugins Files -->
<link rel="stylesheet" href="assets/css/plugins/animate.css" />
<link rel="stylesheet" href="assets/css/plugins/swiper-bundle.min.css" />
<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" />
<!-- Main Style -->
<link rel="stylesheet" href="assets/css/style.css" />
<link rel="stylesheet" href="assets/css/style2.css" />
<link rel="stylesheet" href="assets/css/responsive.css" />
<!-- FONTAWESOME -->
<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" />
<!-- 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>
#edit_modal .cover-upload:after{
background-color: orange;
}
.ec-user-account .ec-vendor-block-bg {
width: 100%;
height: 200px;
background-image: none;
background-size: cover;
background-position: center;
background-repeat: no-repeat;
background-blend-mode: overlay;
background-color: rgba(0, 0, 0, 0.6);
border-radius: 5px;
}
#editDelete:hover i{
color: #ffaa00;
cursor: pointer;
}
</style>
</head>
<body class="shop_page">
<div id="ec-overlay">
<div class="ec-ellipsis">
<div></div>
<div></div>
<div></div>
<div></div>
</div>
</div>
<!-- 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="col-md-6 col-sm-12">
<h2 class="ec-breadcrumb-title">Vendor Settings</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>
</ul>
<!-- ec-breadcrumb-list end -->
</div>
</div>
</div>
</div>
</div>
</div>
<!-- Ec breadcrumb end -->
<!-- Vendor setting section -->
<section class="ec-page-content ec-vendor-uploads section-space-p">
<div class="container">
<div class="row">
<!-- 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">
<!-- <div class="ec-vendor-block-items">
<ul>
<li><a href="vendor-dashboard.php">Dashboard</a></li>
<li><a href="vendor-profile.html">Public Profile</a></li>
<li><a href="vendor-uploads.html">Uploads</a></li>
<li><a href="vendor-uploads.php">Uploads</a></li>
<li><a href="#">Track Shipping</a></li>
<li><a href="vendor-settings.php">Settings (Edit)</a></li>
<li><a href="vendor-dashboard.php">Dashboard</a></li>
<li><a href="vendor-uploads-add-product-action.php">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">
<?php
?>
<div class="row">
<div class="col-md-12">
<div class="ec-vendor-block-profile">
<!-- 02-23-2023 Jun Jihad Vendor Header Paceholder -->
<div class="ec-vendor-block-img space-bottom-30 ">
<?php
if (!isset($vendorData['vendor_banner']) || empty($vendorData['vendor_banner'])) {
$banner_style = 'background-color: orange !important; background-image: none !important; width: 100% !important; height: 200px !important; background-size: cover !important; background-position: center !important; border-radius: 5px !important;';
} else {
$banner_style = 'background-image: url(' . $vendorData['vendor_banner'] . ') !important; width: 100% !important; height: 200px !important; background-size: cover !important; background-position: center !important; background-repeat: no-repeat !important; background-blend-mode: overlay !important; background-color: rgba(0, 0, 0, 0.6) !important; border-radius: 5px !important;';
}
?>
<div class="ec-vendor-block-bg" style="<?php echo $banner_style; ?>">
<a href="#" class="btn btn-lg btn-primary" data-link-action="editmodal" title="Edit Detail" data-bs-toggle="modal" data-bs-target="#edit_modal">Edit Detail</a>
</div>
<div class="ec-vendor-block-detail">
<!-- 02-26-2024 Stacy added placeholder-->
<?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 } ?>
<!-- $vendor_image = isset($vendorData[0]['vendor_image']) ? $vendorData[0]['vendor_image'] : 'https://yourteachingmentor.com/wp-content/uploads/2020/12/istockphoto-1223671392-612x612-1.jpg'; -->
<!-- <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>
</div>
<!-- 02-23-2023 Jun Jihad Vendor Header Paceholder -->
<!-- 02-23-2023 Jun Jihad Vendor Description -->
<div class="ec-vendor-block-about space-bottom-30">
<h5>About Us</h5>
<?php if (!empty($vendorData['vendor_description'])): ?>
<p><?php echo $vendorData['vendor_description']; ?></p>
<?php else: ?>
<p>No description available.</p>
<?php endif; ?>
</div>
<!-- 02-23-2023 Jun Jihad Vendor Description -->
<h5>Account Information</h5>
<div class="row">
<div class="col-md-6 col-sm-12">
<div class="ec-vendor-detail-block ec-vendor-block-email space-bottom-30">
<h6>E-mail address </h6>
<ul>
<li style="padding:3%"><strong><?php echo $vendorData["user_email"] ?></strong></li>
</ul>
</div>
</div>
<div class="col-md-6 col-sm-12">
<div class="ec-vendor-detail-block ec-vendor-block-contact space-bottom-30">
<h6>Contact nubmer</h6>
<ul>
<li style="padding:3%"><strong><?php echo $vendorData["phone"] ?></strong></li>
</ul>
</div>
</div>
<div class="col-md-12 col-sm-12">
<div class="ec-vendor-detail-block ec-vendor-block-contact space-bottom-30">
<h6>Address <button type="button" class="btn btn-primary" id="vendorAddressModalBtn" data-bs-toggle="modal" data-bs-target="#vendorAddressModal">My Addresses</button></h6>
<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>
<span id="selectedLName"> <?php echo $address['last_name']; ?></span>
</span>
</div>
<div class="sContact">
<span id="selectedContact">Contact #: <?php echo $address['phone']; ?></span>
</div>
<div class="sAddress">
<span>Address:
<span id="sBuilding"><?php echo $address['address_1']; ?></span>
<span id="sStreet"><?php echo $address['address_2']; ?></span>
<span id="sBarangay"><?php echo $address['barangay']; ?></span>
<span id="sCity"><?php echo $address['city']; ?></span>
<span id="sProvince"><?php echo $address['province']; ?></span>
<span id="sCountry"><?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>
<div class="row">
<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;">
<tr>
<td style="border: 1px solid #dddddd; background-color: #f7f7f7; padding: 8px; font-weight: 700;">Bank Name</td>
<td style="border: 1px solid #dddddd; padding: 8px;font-weight: 500;"><?php echo $bank_acount_details["bank_name"] ?></td>
</tr>
<tr>
<td style="border: 1px solid #dddddd; background-color: #f7f7f7; padding: 8px;font-weight: 700;">Account Number</td>
<td style="border: 1px solid #dddddd; padding: 8px;font-weight: 500;"><?php echo $bank_acount_details["bank_account_number"] ?></td>
</tr>
<tr>
<td style="border: 1px solid #dddddd; background-color: #f7f7f7; padding: 8px;font-weight: 700;">Account Name</td>
<td style="border: 1px solid #dddddd; padding: 8px;font-weight: 500;"><?php echo $bank_acount_details["bank_account_name"] ?></td>
</tr>
</table>
<?php endif; ?>
<?php endforeach; ?>
</div>
</div>
<!-- 03-19-24 Jun Jihad Bank Information -->
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="modal fade" id="vendorAddressModal" 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;">
<button type="button" class="btn btn-primary mb-3" data-bs-toggle="modal" data-bs-target="#secondModal">Add New Address</button>
<!-- Display a list of addresses and let the user choose -->
<form id="addressForm">
<!-- <?php var_dump($vendorData) ?> -->
<?php foreach ($vendorLoginIdjson['results'] as $vendor_index => $vendor) { ?>
<?php foreach ($vendor['address'] as $address_index => $address) { ?>
<!-- added id -->
<div class="card mb-3" id="form-check-<?php echo $address_index ?>">
<div class="card-body">
<div class="selectCon">
<div class="selectWrap" style="display: flex; justify-content: center; align-items: center; width: 50%;">
<input type="radio" style="padding-left: 0px !important; margin: 0px 0px !important;" name="selectedBillingAddress[<?php echo $vendor_index; ?>]" id="billing_address_<?php echo $vendor_index; ?>_<?php echo $address_index; ?>" value="<?php echo $vendor_index; ?>_<?php echo $address_index; ?>" class="form-check-input" onchange="updateAddressBilling('<?php echo $vendor['_id']; ?>', <?php echo $address_index; ?>, true)" <?php echo $address["billing"] ? 'checked' : ''; ?>>
<label class="form-check-label" style="margin: 0px 10px !important;" for="billing_address_<?php echo $vendor_index; ?>_<?php echo $address_index; ?>">
Billing Address
</label>
</div>
<div class="selectWrap" style="display: flex; justify-content: center; align-items: center; width: 50%; margin-left:-20px;">
<input type="radio" style="padding-left: 0px !important; margin: 0px 0px !important;" name="selectedShippingAddress[<?php echo $vendor_index; ?>]" id="shipping_address_<?php echo $vendor_index; ?>_<?php echo $address_index; ?>" value="<?php echo $vendor_index; ?>_<?php echo $address_index; ?>" class="form-check-input" onchange="updateAddressShipping('<?php echo $vendor['_id']; ?>', <?php echo $address_index; ?>, true)" <?php echo $address["shipping"] ? 'checked' : ''; ?>>
<label class="form-check-label" style="margin: 0px 10px !important;" for="shipping_address_<?php echo $vendor_index; ?>_<?php echo $address_index; ?>">
Shipping Address
</label>
</div>
</div>
<!-- Stacy modified this block of code -->
<div class="container">
<div class="row">
<div class="col-md-12 mx-auto"> <!-- Adjust the column size as needed -->
<div id="editDelete" style="display:flex; float:right; width:20px; margin-right:-10px;" >
<?php
$address['id'] =$address_index;
$jsonAddress = json_encode($address)?>
<a href="javascript:0" data-bs-toggle="modal" data-value=' <?php echo $jsonAddress; ?>' data-bs-target="#thirdModal">
<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="deleteAddress('<?php echo $vendor['_id']; ?>', <?php echo $address_index; ?>, true)"
class="fa-regular fa-trash-can" style="font-size:15px; float:right;"></i>
</div>
<label class="form-check-label" for="address_<?php echo $vendor_index; ?>_<?php echo $address_index; ?>">
<?php echo $address['first_name']; ?> <?php echo $address['last_name']; ?><br>
<?php echo $address['address_1']; ?> <?php echo $address['address_2']; ?>
<?php echo $address['barangay']; ?>, <?php echo $address['city']; ?>,
<?php echo $address['province']; ?> <?php echo $address['country']; ?><br>
Phone: <?php echo $address['phone']; ?>
</label>
</div>
</div>
</div>
</div>
</div>
<?php } ?>
<?php } ?>
</form>
</div>
</div>
</div>
</div>
<!-- secondModal -->
<div class="modal fade" id="secondModal" 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="addressFirstName" class="text-dark font-weight-medium pt-3 mb-2">First Name</label>
<input type="text" class="form-control" id="addressFirstName">
</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">
</div>
<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="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>
<input type="text" class="form-control" id="addressBuilding">
</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">
</div>
<div class="form-group">
<label for="provinceSelect">Province</label>
<select class="form-select" id="provinceSelect">
<option value="" disabled selected hidden>Select Province</option>
</select>
</div>
<div class="form-group">
<label for="citySelect">Municipality/City</label>
<select class="form-select" id="citySelect" required>
<option value="" disabled selected hidden>Select Municipality/City</option>
</select>
</div>
<div class="form-group">
<label for="barangaySelect">Barangay</label>
<select class="form-select" id="barangaySelect" required>
<option value="" disabled selected hidden>Select Barangay</option>
</select>
</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" value="Philippines">
</div>
<button type="button" class="btn btn-primary mt-4" id="submitBtn">Submit</button>
</form>
</div>
</div>
</div>
</div>
<!-- Stacy added thirdModal -->
<div class="modal fade" id="thirdModal" 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="addressFirstName" class="text-dark font-weight-medium pt-3 mb-2">First Name</label>
<input type="text" class="form-control"
id="addressFirstName2"
value="<?php echo $address['first_name']; ?>">
<!-- <label for="addressFirstName" class="text-dark font-weight-medium pt-3 mb-2">First Name</label>-->
<input type="hidden" class="form-control" id="addressId" >
</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="addressLastName2" value="<?php echo $address['last_name']; ?>">
<!-- <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="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']; ?>" oninput="preventEraseThePrefix(this)">
<!-- <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>
<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="addressBuilding2" value="<?php echo $address['address_1']; ?>">
<!-- <label for="addressBuilding" class="text-dark font-weight-medium pt-3 mb-2"> Building,Number </label>
<input type="text" class="form-control" id="addressBuilding"> -->
</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="addressStreet2" value="<?php echo $address['address_2']; ?>">
<!-- <label for="addressStreet" class="text-dark font-weight-medium pt-3 mb-2"> Street </label>
<input type="text" class="form-control" id="addressStreet"> -->
</div>
<div class="form-group">
<label for="provinceSelect2">Province</label>
<select class="form-select" id="provinceSelect2">
<option id="provinceSelect2Opt" value="<?php echo $address['province']; ?>" >Select Province</option>
</select>
<!-- <label for="provinceSelect">Province</label>
<select class="form-select" id="provinceSelect">
<option value="" disabled selected hidden>Select Province</option>
</select> -->
</div>
<div class="form-group">
<label for="citySelect2">Municipality/City</label>
<select class="form-select" id="citySelect2" required>
<option value="" id="citySelect2Opt" selected hidden>Select Municipality/City</option>
</select>
</div>
<div class="form-group">
<label for="barangaySelect2">Barangay</label>
<select class="form-select" id="barangaySelect2" required>
<option value="" id="barangaySelect2Opt" selected hidden>Select Barangay</option>
</select>
</div>
<div class="form-group">
<label for="addressCountry2" class="text-dark font-weight-medium pt-3 mb-2">Country</label>
<input type="text" class="form-control" id="addressCountry2">
</div>
<button type="button" class="btn btn-primary mt-4" id="submitBtn2">Submit</button>
</form>
</div>
</div>
</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;">
<div class="modal-content">
<div class="modal-body" style="overflow-y: auto; max-height: 90vh;">
<button type="button" class="btn btn-primary mb-3" data-bs-toggle="modal" data-bs-target="#secondBankModal">Add New Bank</button>
<!-- Display a list of banks and let the user choose -->
<form id="BankForm">
<!-- <?php var_dump($vendorData) ?> -->
<?php foreach ($vendorLoginIdjson['results'] as $vendor_index => $vendor) { ?>
<?php foreach ($vendor['bank_acount_details'] as $bank_index => $bank) { ?>
<div class="card mb-3">
<div class="card-body">
<div class="container">
<div class="row">
<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>
</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>
</div>
</div>
<?php } ?>
<?php } ?>
</form>
</div>
</div>
</div>
</div>
<div class="modal fade" id="secondBankModal" 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="bankName">
</div>
<div class="form-group">
<label for="bankAccountNumber" class="text-dark font-weight-medium pt-3 mb-2">Bank Account Number</label>
<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>
</div>
</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);
// var file = fileInput.files[0];
const vendorid = `<?php echo $_SESSION["LoggedInVendorId"]; ?>`;
const company = document.getElementById('company-').value;
const firstName = document.getElementById('cfirstname-').value;
const lastName = document.getElementById('clastname-').value;
const phone = document.getElementById('cphone-').value;
const description = document.getElementById('cdescription-').value;
// If no file selected, only update the email
fetch(`https://<?php echo $_SESSION["data_endpoint"]; ?>/api/v1/vendors/${vendorid}`, {
method: 'PATCH',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify({
user_login: company,
first_name: firstName,
last_name: lastName,
phone: phone,
vendor_description:description
})
})
.then(response => {
if (response.ok) {
console.log('Profile updated successful');
location.reload();
// Handle any other actions after the successful email update
} else {
console.error('Profile failed to update');
// Handle errors or display a message to the user
}
})
.catch(error => {
console.error('Error during fetch:', error);
// Handle network or other errors
});
}
//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>
<script>
// function for deleting address
// const vendorid = `<?php # echo $_SESSION["LoggedInVendorId"]; ?>`;
function deleteAddress(vendorid, addressIndex) {
fetch('https://<?php echo $_SESSION["data_endpoint"]; ?>/api/v1/vendors/' + vendorid)
.then(response => response.json())
.then(data => {
let existingAddresses = data.address || [];
if (addressIndex >= 0 && addressIndex < existingAddresses.length) {
existingAddresses.splice(addressIndex, 1);
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();
// filter the delete action
document.getElementById('form-check-' + addressIndex).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>
<script>
// added for thirdModal
$('#thirdModal').on('shown.bs.modal', function (event) {
var jsonString = $(event.relatedTarget).data('value');
var jsonObject = JSON.parse(jsonString);
console.log(jsonObject)
// document.getElementById("addressFirstName2").value('mmmm');
// $('#addressFirstName2').setAttribute('value','My default value');
// shows inputed data by the vendor
document.querySelector('input[id="addressFirstName2"]').value = jsonObject.first_name;
document.querySelector('input[id="addressLastName2"]').value = jsonObject.last_name;
document.querySelector('input[id="addressContact2"]').value = jsonObject.phone;
document.querySelector('input[id="addressBuilding2"]').value = jsonObject.address_1;
document.querySelector('input[id="addressStreet2"]').value = jsonObject.address_2;
document.querySelector('option[id="provinceSelect2Opt"]').text = jsonObject.province;
document.querySelector('option[id="provinceSelect2Opt"]').value = jsonObject.province;
document.querySelector('option[id="citySelect2Opt"]').text = jsonObject.city;
document.querySelector('option[id="citySelect2Opt"]').value = jsonObject.city;
document.querySelector('option[id="barangaySelect2Opt"]').text = jsonObject.barangay;
document.querySelector('option[id="barangaySelect2Opt"]').value = jsonObject.barangay;
document.querySelector('input[id="addressCountry2"]').value = jsonObject.country;
document.querySelector('input[id="addressId"]').value = jsonObject.id;
console.log('id ' + jsonObject.id)
const provinceSelect = $('#provinceSelect2'); // Use jQuery to select the element
const citySelect = $('#citySelect2'); // Use jQuery to select the element
const barangaySelect = $('#barangaySelect2'); // Use jQuery to select the element
// Initialize Select2 on the provinceSelect, citySelect, and barangaySelect elements
provinceSelect.select2({
dropdownParent: $('#thirdModal'),
containerCssClass: 'select2-zindex-high' // Optional, add a custom class for styling
});
citySelect.select2({
dropdownParent: $('#thirdModal'),
containerCssClass: 'select2-zindex-high' // Optional, add a custom class for styling
});
barangaySelect.select2({
dropdownParent: $('#thirdModal'),
containerCssClass: 'select2-zindex-high' // Optional, add a custom class for styling
});
// Fetch provinces data
fetch('https://psgc.gitlab.io/api/provinces')
.then(response => {
if (response.ok) {
return response.json();
} else {
console.error('Failed to fetch provinces');
throw new Error('Failed to fetch provinces');
}
})
.then(provincesData => {
// Iterate through the provinces data and add options
provincesData.forEach(province => {
const option = new Option(province.name, province.code);
provinceSelect.append(option);
});
// Add an extra option manually
const extraOption = new Option('Metro Manila', '130000000');
provinceSelect.append(extraOption);
// Add event listener to provinceSelect
provinceSelect.on('change', function() {
// Clear existing options in citySelect and barangaySelect
citySelect.html('<option value="" disabled selected hidden>Select City</option>');
barangaySelect.html('<option value="" disabled selected hidden>Select Barangay</option>');
// Fetch and update cities/municipalities based on the selected province
updateCities();
});
})
.catch(error => {
console.error('Error:', error);
});
// Function to update city/municipality options based on the selected province
function updateCities() {
const selectedProvinceCode = provinceSelect.val(); // Use val() to get the selected value with Select2
if (selectedProvinceCode) {
let citiesEndpoint;
if (selectedProvinceCode === '130000000') {
// Check if Metro Manila is selected
citiesEndpoint = 'https://psgc.gitlab.io/api/regions/130000000/cities-municipalities/';
} else {
citiesEndpoint = `https://psgc.gitlab.io/api/provinces/${selectedProvinceCode}/cities-municipalities/`;
}
fetch(citiesEndpoint)
.then(response => {
if (response.ok) {
return response.json();
} else {
console.error('Failed to fetch cities/municipalities');
throw new Error('Failed to fetch cities/municipalities');
}
})
.then(citiesData => {
// Iterate through the cities data and add options
citiesData.forEach(city => {
const option = new Option(city.name, city.code);
citySelect.append(option);
});
})
.catch(error => {
console.error('Error:', error);
});
}
}
// Add event listener to citySelect
citySelect.on('change', function() {
// Clear existing options in barangaySelect
barangaySelect.html('<option value="" disabled selected hidden>Select Barangay</option>');
// Fetch and update barangays based on the selected city/municipality
const selectedCityCode = citySelect.val();
if (selectedCityCode) {
fetch(`https://psgc.gitlab.io/api/cities-municipalities/${selectedCityCode}/barangays/`)
.then(response => {
if (response.ok) {
return response.json();
} else {
console.error('Failed to fetch barangays');
throw new Error('Failed to fetch barangays');
}
})
.then(barangaysData => {
// Iterate through the barangays data and add options
barangaysData.forEach(barangay => {
const option = new Option(barangay.name, barangay.code);
barangaySelect.append(option);
});
})
.catch(error => {
console.error('Error:', error);
});
}
});
// document.querySelector('input[id="addressFirstName2"]').value = jsonObject.last_name;
});
</script>
<script>
const vendorid = `<?php echo $_SESSION["LoggedInVendorId"]; ?>`;
document.addEventListener('DOMContentLoaded', function() {
const provinceSelect = $('#provinceSelect');
const citySelect = $('#citySelect');
const barangaySelect = $('#barangaySelect');
provinceSelect.select2({
dropdownParent: $('#secondModal'),
containerCssClass: 'select2-zindex-high'
});
citySelect.select2({
dropdownParent: $('#secondModal'),
containerCssClass: 'select2-zindex-high'
});
barangaySelect.select2({
dropdownParent: $('#secondModal'),
containerCssClass: 'select2-zindex-high'
});
// Fetch provinces data
fetch('https://psgc.gitlab.io/api/provinces')
.then(response => {
if (response.ok) {
return response.json();
} else {
console.error('Failed to fetch provinces');
throw new Error('Failed to fetch provinces');
}
})
.then(provincesData => {
provincesData.forEach(province => {
const option = new Option(province.name, province.code);
provinceSelect.append(option);
});
const extraOption = new Option('Metro Manila', '130000000');
provinceSelect.append(extraOption);
provinceSelect.on('change', function() {
citySelect.html('<option value="" disabled selected hidden>Select City</option>');
barangaySelect.html('<option value="" disabled selected hidden>Select Barangay</option>');
updateCities();
});
})
.catch(error => {
console.error('Error:', error);
});
function updateCities() {
const selectedProvinceCode = provinceSelect.val();
if (selectedProvinceCode) {
let citiesEndpoint;
if (selectedProvinceCode === '130000000') {
citiesEndpoint = 'https://psgc.gitlab.io/api/regions/130000000/cities-municipalities/';
} else {
citiesEndpoint = `https://psgc.gitlab.io/api/provinces/${selectedProvinceCode}/cities-municipalities/`;
}
fetch(citiesEndpoint)
.then(response => {
if (response.ok) {
return response.json();
} else {
console.error('Failed to fetch cities/municipalities');
throw new Error('Failed to fetch cities/municipalities');
}
})
.then(citiesData => {
citiesData.forEach(city => {
const option = new Option(city.name, city.code);
citySelect.append(option);
});
})
.catch(error => {
console.error('Error:', error);
});
}
}
citySelect.on('change', function() {
barangaySelect.html('<option value="" disabled selected hidden>Select Barangay</option>');
const selectedCityCode = citySelect.val();
if (selectedCityCode) {
fetch(`https://psgc.gitlab.io/api/cities-municipalities/${selectedCityCode}/barangays/`)
.then(response => {
if (response.ok) {
return response.json();
} else {
console.error('Failed to fetch barangays');
throw new Error('Failed to fetch barangays');
}
})
.then(barangaysData => {
barangaysData.forEach(barangay => {
const option = new Option(barangay.name, barangay.code);
barangaySelect.append(option);
});
})
.catch(error => {
console.error('Error:', error);
});
}
});
$('#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 || [];
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,
};
// Check if it's the first address
if (existingAddresses.length === 0) {
newAddress.shipping = true; // Set shipping to true
}
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');
});
});
});
// Added function for editing the address
$('#submitBtn2').on('click', function() {
// function updateAddress(){
// Retrieve existing addresses from the API
// 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 existingAddresses = data.address || [];
// Get the new address details
const firstName = $('#addressFirstName2').val();
const lastName = $('#addressLastName2').val();
const contact = $('#addressContact2').val();
const buildingNumber = $('#addressBuilding2').val();
const street = $('#addressStreet2').val();
const province = $('#provinceSelect2 :selected').text();
const city = $('#citySelect2 :selected').text();
const barangay = $('#barangaySelect2 :selected').text();
const country = $('#addressCountry2').val();
const id = $('#addressId').val();
console.log('clickkkkkkkk'+ id)
// Create a new address object
const newAddress = {
first_name: firstName,
last_name: lastName,
phone: contact,
address_1: buildingNumber,
address_2: street,
city: city,
province: province,
barangay: barangay,
country: country,
};
// Add the new address to the existing addresses
// existingAddresses.push(newAddress);
// var newAddresses= existingAddresses.filter((e,i)=>i!==id)
let existingAddress = existingAddresses
existingAddress[id]={
first_name: firstName,
last_name: lastName,
phone: contact,
address_1: buildingNumber,
address_2: street,
city: city,
province: province,
barangay: barangay,
country: country,
};
console.log( existingAddress[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({
address: existingAddress
}),
});
})
.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');
});
});
$('#submitBankBtn').on('click', function() {
fetch('https://<?php echo $_SESSION["data_endpoint"]; ?>/api/v1/vendors/' + vendorid)
.then(response => response.json())
.then(data => {
const existingBanks = data.bank_acount_details || [];
const bankName = $('#bankName').val();
const bankAccountNumber = $('#bankAccountNumber').val();
const bankAccountName = $('#bankAccountName').val();
const newBank = {
bank_name: bankName,
bank_account_number: bankAccountNumber,
bank_account_name: bankAccountName,
};
existingBanks.push(newBank);
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: existingBanks
}),
});
})
.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');
});
});
</script>
<script>
async function updateAddressBilling(vendorid, addressIndex, isBilling) {
try {
const apiUrl = `https://<?php echo $_SESSION["data_endpoint"]; ?>/api/v1/vendors/${vendorid}`;
const response = await fetch(apiUrl, {
method: 'GET',
headers: {
'Content-Type': 'application/json',
},
});
if (!response.ok) {
throw new Error(`Failed to fetch vendor data: ${response.status}`);
}
const vendorsData = await response.json();
vendorsData.address.forEach((address, index) => {
if (index === addressIndex) {
if (isBilling !== undefined) {
address.billing = isBilling;
const radioButtonId = `#billing_address_${vendorid}_${addressIndex}`;
$(radioButtonId).prop('checked', isBilling);
}
// if (isShipping !== undefined) {
// address.shipping = isShipping;
// }
} else {
// Set other addresses to false
address.billing = false;
// address.shipping = false;
}
});
// Send a PATCH request to update the customer data
const updateResponse = await fetch(apiUrl, {
method: 'PATCH',
headers: {
'Content-Type': 'application/json',
},
body: JSON.stringify({
address: vendorsData.address
}),
});
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);
}
}
async function updateAddressShipping(vendorid, addressIndex, isShipping) {
try {
const apiUrl = `https://<?php echo $_SESSION["data_endpoint"]; ?>/api/v1/vendors/${vendorid}`;
const response = await fetch(apiUrl, {
method: 'GET',
headers: {
'Content-Type': 'application/json',
},
});
if (!response.ok) {
throw new Error(`Failed to fetch vendor data: ${response.status}`);
}
// console.log(customerId + " ." + addressIndex + "." +isBilling + "." + isShipping)
const vendorsData = await response.json();
// Iterate through addresses and update billing/shipping flags
vendorsData.address.forEach((address, index) => {
if (index === addressIndex) {
// if (isBilling !== undefined) {
// address.billing = isBilling;
// }
if (isShipping !== undefined) {
address.shipping = isShipping;
}
} else {
// Set other addresses to false
// address.billing = false;
address.shipping = false;
}
});
// Send a PATCH request to update the customer data
const updateResponse = await fetch(apiUrl, {
method: 'PATCH',
headers: {
'Content-Type': 'application/json',
},
body: JSON.stringify({
address: vendorsData.address
}),
});
if (!updateResponse.ok) {
throw new Error(`Failed to update address: ${updateResponse.status}`);
}
const selectedShippingElement = document.getElementById('selectedFName');
const selectedLNameElement = document.getElementById('selectedLName');
const selectedContactElement = document.getElementById('selectedContact');
const sBuildingElement = document.getElementById('sBuilding');
const sStreetElement = document.getElementById('sStreet');
const sBarangayElement = document.getElementById('sBarangay');
const sCityElement = document.getElementById('sCity');
const sProvinceElement = document.getElementById('sProvince');
const sCountryElement = document.getElementById('sCountry');
if (selectedShippingElement) {
selectedShippingElement.textContent = vendorsData.address[addressIndex].first_name;
// Update other address details similarly
selectedLNameElement.textContent = vendorsData.address[addressIndex].last_name;
selectedContactElement.textContent = 'Contact #: ' + vendorsData.address[addressIndex].phone;
sBuildingElement.textContent = vendorsData.address[addressIndex].address_1;
sStreetElement.textContent = vendorsData.address[addressIndex].address_2;
sBarangayElement.textContent = vendorsData.address[addressIndex].barangay;
sCityElement.textContent = vendorsData.address[addressIndex].city;
sProvinceElement.textContent = vendorsData.address[addressIndex].province;
sCountryElement.textContent = vendorsData.address[addressIndex].country;
}
console.log(`Address updated successfully for vendor ${vendorid}`);
} catch (error) {
console.error('Error updating address:', error.message);
}
}
async function setPayoutBank(vendorid, bankIndex, isBankPayout) {
try {
const apiUrl = `https://<?php echo $_SESSION["data_endpoint"]; ?>/api/v1/vendors/${vendorid}`;
const response = await fetch(apiUrl, {
method: 'GET',
headers: {
'Content-Type': 'application/json',
},
});
if (!response.ok) {
throw new Error(`Failed to fetch vendor data: ${response.status}`);
}
const vendorsData = await response.json();
vendorsData.bank_acount_details.forEach((bank_acount_details, index) => {
if (index === bankIndex) {
if (isBankPayout !== undefined) {
bank_acount_details.bank_payout = isBankPayout;
const radioButtonId = `#payout_bank__${vendorid}_${bankIndex}`;
$(radioButtonId).prop('checked', isBankPayout);
}
} else {
bank_acount_details.bank_payout = false;
}
});
const updateResponse = await fetch(apiUrl, {
method: 'PATCH',
headers: {
'Content-Type': 'application/json',
},
body: JSON.stringify({
bank_acount_details: vendorsData.bank_acount_details
}),
});
if (!updateResponse.ok) {
throw new Error(`Failed to update address: ${updateResponse.status}`);
}
location.reload()
// console.log(`Address updated successfully for customer ${vendorid}`);
} catch (error) {
console.error('Error updating address:', error.message);
}
}
</script>
<!-- Script added by Louie for Dynamic Edit Modal Box. May 08, 2024 -->
<script>
const vendorid = `<?php echo $_SESSION["LoggedInVendorId"]; ?>`;
$('#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() {
console.log(vendorid)
// function updateAddress(){
// Retrieve existing addresses from the API
// 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 -->
<!-- Footer Start -->
<?php include "footer.php" ?>
<!-- Footer Area End -->
<!-- Start Modal Copy-->
<!-- Modal -->
<div class="modal fade" id="edit_modal" tabindex="-1" role="dialog">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-body">
<div class="row">
<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" onchange="uploadProfileBanner()" />
<label><i class="fi-rr-edit"></i></label>
</div>
<div class="thumb-preview ec-preview">
<div class="image-thumb-preview">
<?php
if (!isset($vendorData['vendor_banner']) || empty($vendorData['vendor_banner'])) {
$banner_style2 = 'background-color: orange !important; background-image: none !important; width: 100% !important; height: 200px !important; background-size: cover !important; background-position: center !important; border-radius: 5px !important;';
echo '<div class="image-thumb-preview ec-image-preview v-img" style="' . $banner_style2 . '"></div>';
} else {
echo '<img loading="lazy" class="image-thumb-preview ec-image-preview v-img" src="' . $vendorData['vendor_banner'] . '" alt="edit" />';
}
?>
</div>
</div>
</div>
</div>
<div class="ec-vendor-block-detail">
<div class="thumb-upload">
<div class="thumb-edit">
<input type='file' id="imageUpload" class="ec-image-upload" accept=".png, .jpg, .jpeg" onchange="uploadVendorProfileImage()" />
<label><i class="fi-rr-edit"></i></label>
</div>
<div class="thumb-preview ec-preview">
<div class="image-thumb-preview">
<?php if (!empty($vendorData['vendor_image'])): ?>
<img loading="lazy" class="image-thumb-preview ec-image-preview v-img" src="<?php echo $vendorData['vendor_image']; ?>" alt="edit" />
<?php else: ?>
<img loading="lazy" class="image-thumb-preview ec-image-preview v-img" src="https://yourteachingmentor.com/wp-content/uploads/2020/12/istockphoto-1223671392-612x612-1.jpg" alt="edit" />
<?php endif; ?>
</div>
</div>
</div>
</div>
<script>
function uploadVendorProfileImage() {
var vendorid = '<?php echo $_SESSION["LoggedInVendorId"] ?>';
var file = document.getElementById('imageUpload').files[0];
if (file) {
const reader = new FileReader();
reader.onload = function(event) {
const img = new Image();
img.onload = function() {
const canvas = document.createElement('canvas');
const ctx = canvas.getContext('2d');
const maxWidth = 1200;
const maxHeight = 1000;
const aspectRatio = img.width / img.height;
let newWidth = img.width;
let newHeight = img.height;
if (img.width > maxWidth) {
newWidth = maxWidth;
newHeight = newWidth / aspectRatio;
}
if (newHeight > maxHeight) {
newHeight = maxHeight;
newWidth = newHeight * aspectRatio;
}
canvas.width = newWidth;
canvas.height = newHeight;
ctx.drawImage(img, 0, 0, newWidth, newHeight);
canvas.toBlob((blob) => {
const resizedFile = new File([blob], file.name, {
type: 'image/jpeg'
});
var formData = new FormData();
formData.append('image_id', vendorid);
formData.append('category', 'vendor');
formData.append('image', resizedFile);
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 = encodeURI(result.filename);
const payload = {
vendor_image: `https://<?php echo $_SESSION["data_endpoint"]; ?>/images/storage/vendor_uploads/${filename}`,
};
console.log('Payload:', payload);
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('Profile Image Uploaded Successful');
// location.reload();
} else {
console.error('Profile Image Failed to Upload');
}
})
.catch(error => {
console.error('Error during fetch:', error);
});
}, 'image/jpeg');
};
img.src = event.target.result;
};
reader.readAsDataURL(file);
}
}
function uploadProfileBanner() {
var vendorid = '<?php echo $_SESSION["LoggedInVendorId"] ?>';
var file = document.getElementById('thumbUpload01').files[0];
if (file) {
const reader = new FileReader();
reader.onload = function(event) {
const img = new Image();
img.onload = function() {
const canvas = document.createElement('canvas');
const ctx = canvas.getContext('2d');
const maxWidth = 1200;
const maxHeight = 1000;
const aspectRatio = img.width / img.height;
let newWidth = img.width;
let newHeight = img.height;
if (img.width > maxWidth) {
newWidth = maxWidth;
newHeight = newWidth / aspectRatio;
}
if (newHeight > maxHeight) {
newHeight = maxHeight;
newWidth = newHeight * aspectRatio;
}
canvas.width = newWidth;
canvas.height = newHeight;
ctx.drawImage(img, 0, 0, newWidth, newHeight);
canvas.toBlob((blob) => {
const resizedFile = new File([blob], file.name, {
type: 'image/jpeg'
});
var formData = new FormData();
formData.append('image_id', vendorid + '_banner');
formData.append('category', 'vendor');
formData.append('image', resizedFile);
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 = encodeURI(result.filename);
// const filename = result.filename;
const payload = {
vendor_banner: `https://<?php echo $_SESSION["data_endpoint"]; ?>/images/storage/vendor_uploads/${filename}`,
};
console.log('Payload:', payload);
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('Profile Banner Uploaded Successful');
// location.reload();
} else {
console.error('Profile Banner Failed to Upload');
}
})
.catch(error => {
console.error('Error during fetch:', error);
});
}, 'image/jpeg');
};
img.src = event.target.result;
};
reader.readAsDataURL(file);
}
}
</script>
<div class="ec-vendor-upload-detail">
<form class="row g-3">
<!-- <div class="col-md-6 space-t-15">
<label class="form-label">First name</label>
<input type="text" class="form-control">
</div> -->
<div class="form-group">
<label for="company-" class="text-dark font-weight-medium pt-3 mb-2">Company</label>
<input type="text" class="form-control" id="company-" value="<?php echo $vendorData['user_login'] ?>">
</div>
<div class="form-group">
<label for="cfirstname-" class="text-dark font-weight-medium pt-3 mb-2">Contact First Name</label>
<input type="text" class="form-control" id="cfirstname-" value="<?php echo $vendorData['first_name'] ?>">
</div>
<div class="form-group">
<label for="clastname-" class="text-dark font-weight-medium pt-3 mb-2">Contact Last Name</label>
<input type="text" class="form-control" id="clastname-" value="<?php echo $vendorData['last_name'] ?>">
</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'] ?>" oninput="preventEraseInPrefix(this)">
</div>
<!-- 02-23-2023 Jun Jihad Vendor Description Field-->
<div class="form-group">
<label for="cdescription-" class="text-dark font-weight-medium pt-3 mb-2">Vendor Description</label>
<textarea class="form-control" id="cdescription-"><?php echo $vendorData['vendor_description']; ?></textarea>
</div>
<!-- 02-23-2023 Jun Jihad Vendor Description Field-->
<!-- <div class="col-md-12 space-t-15">
<button type="submit" class="btn btn-primary">Update</button>
<a href="#" class="btn btn-lg btn-secondary qty_close" data-bs-dismiss="modal"
aria-label="Close">Close</a>
</div> -->
</form>
<button type="button" class="btn btn-primary btn-pill my-3" onclick="editUser()">Upload</button>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<!-- Modal end -->
<!-- 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="#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>
</div>
<div class="ec-nav-panel-icons">
<a href="login.php" class="ec-header-btn"><i class="fi-rr-user"></i></a>
</div>
</div>
</div>
</div> -->
<!-- Footer navigation panel for responsive display end -->
<!-- raymart remove popup feb 20 2024 -->
<!-- Recent Purchase Popup -->
<!-- <div class="recent-purchase">
<img loading="lazy" src="assets/images/product-image/1.jpg" alt="payment image">
<div class="detail">
<p>Someone in new just bought</p>
<h6>stylish baby shoes</h6>
<p>10 Minutes ago</p>
</div>
<a href="javascript:void(0)" class="icon-btn recent-close">×</a>
</div> -->
<!-- Recent Purchase Popup end -->
<!-- Cart Floating Button -->
<div class="ec-cart-float">
<a href="#ec-side-cart" class="ec-header-btn ec-side-toggle">
<div class="header-icon"><i class="fi-rr-shopping-basket"></i>
</div>
<span class="ec-cart-count cart-count-lable">3</span>
</a>
</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>
<div class="ec-tools-sidebar">
<div class="tool-title">
<h3>Features</h3>
</div>
<a href="#" class="ec-tools-sidebar-toggle in-out">
<img loading="lazy" alt="icon" src="assets/images/common/settings.png" />
</a>
<div class="ec-tools-detail">
<div class="ec-tools-sidebar-content ec-change-color ec-color-desc">
<h3>Color Scheme</h3>
<ul class="bg-panel">
<li class="active" data-color="01"><a href="#" class="colorcode1"></a></li>
<li data-color="02"><a href="#" class="colorcode2"></a></li>
<li data-color="03"><a href="#" class="colorcode3"></a></li>
<li data-color="04"><a href="#" class="colorcode4"></a></li>
<li data-color="05"><a href="#" class="colorcode5"></a></li>
</ul>
</div>
<div class="ec-tools-sidebar-content">
<h3>Backgrounds</h3>
<ul class="bg-panel">
<li class="bg"><a class="back-bg-1" id="bg-1">Background-1</a></li>
<li class="bg"><a class="back-bg-2" id="bg-2">Background-2</a></li>
<li class="bg"><a class="back-bg-3" id="bg-3">Background-3</a></li>
<li class="bg"><a class="back-bg-4" id="bg-4">Default</a></li>
</ul>
</div>
<div class="ec-tools-sidebar-content">
<h3>Full Screen mode</h3>
<div class="ec-fullscreen-mode">
<div class="ec-fullscreen-switch">
<div class="ec-fullscreen-btn">Mode</div>
<div class="ec-fullscreen-on">On</div>
<div class="ec-fullscreen-off">Off</div>
</div>
</div>
</div>
<div class="ec-tools-sidebar-content">
<h3>Dark mode</h3>
<div class="ec-change-mode">
<div class="ec-mode-switch">
<div class="ec-mode-btn">Mode</div>
<div class="ec-mode-on">On</div>
<div class="ec-mode-off">Off</div>
</div>
</div>
</div>
<div class="ec-tools-sidebar-content">
<h3>RTL mode</h3>
<div class="ec-change-rtl">
<div class="ec-rtl-switch">
<div class="ec-rtl-btn">Rtl</div>
<div class="ec-rtl-on">On</div>
<div class="ec-rtl-off">Off</div>
</div>
</div>
</div>
<div class="ec-tools-sidebar-content">
<h3>Clear local storage</h3>
<a class="clear-cach" href="javascript:void(0)">Clear Cache & Default</a>
</div>
</div>
</div>
<!-- Feature tools end -->
<!-- Vendor JS -->
<!-- <script src="assets/js/vendor/jquery-3.5.1.min.js"></script> -->
<script src="assets/js/vendor/popper.min.js"></script>
<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-->
<script src="assets/js/plugins/swiper-bundle.min.js"></script>
<script src="assets/js/plugins/countdownTimer.min.js"></script>
<script src="assets/js/plugins/scrollup.js"></script>
<script src="assets/js/plugins/jquery.zoom.min.js"></script>
<script src="assets/js/plugins/slick.min.js"></script>
<script src="assets/js/plugins/infiniteslidev2.js"></script>
<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>
<!-- Main Js -->
<script src="assets/js/vendor/index.js"></script>
<script src="assets/js/main.js"></script>
</body>
</html>