2024-02-12 10:35:09 +08:00
|
|
|
|
<?php
|
|
|
|
|
include "functions.php";
|
2024-02-15 20:42:37 +08:00
|
|
|
|
|
2024-02-12 10:35:09 +08:00
|
|
|
|
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");
|
|
|
|
|
}
|
2024-04-16 13:47:04 +08:00
|
|
|
|
|
|
|
|
|
if ($_SESSION["isCustomer"] == true) {
|
|
|
|
|
header("location: user-profile.php");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2024-02-12 10:35:09 +08:00
|
|
|
|
?>
|
|
|
|
|
<!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" />
|
|
|
|
|
|
2024-04-08 18:24:45 +08:00
|
|
|
|
<!-- 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" />
|
|
|
|
|
|
2024-02-12 10:35:09 +08:00
|
|
|
|
<!-- 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>
|
2024-04-08 18:24:45 +08:00
|
|
|
|
|
|
|
|
|
<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>
|
2024-02-12 10:35:09 +08:00
|
|
|
|
</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 -->
|
|
|
|
|
|
2024-02-29 16:00:50 +08:00
|
|
|
|
<!-- Category Sidebar start -->
|
|
|
|
|
<?php include "category-slider.php" ?>
|
|
|
|
|
|
2024-02-12 10:35:09 +08:00
|
|
|
|
<!-- 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">
|
2024-02-14 17:47:28 +08:00
|
|
|
|
<!-- <div class="ec-vendor-block-items">
|
2024-02-14 10:32:33 +08:00
|
|
|
|
<ul>
|
2024-02-14 17:47:28 +08:00
|
|
|
|
<li><a href="vendor-dashboard.php">Dashboard</a></li>
|
2024-02-14 10:32:33 +08:00
|
|
|
|
<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>
|
2024-02-14 17:47:28 +08:00
|
|
|
|
<li><a href="vendor-settings.php">Settings (Edit)</a></li>
|
2024-02-14 10:32:33 +08:00
|
|
|
|
<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>
|
2024-02-14 17:47:28 +08:00
|
|
|
|
</div> -->
|
|
|
|
|
<?php include "vendor-user-tabs.php" ?>
|
2024-02-12 10:35:09 +08:00
|
|
|
|
</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">
|
2024-02-27 08:56:59 +08:00
|
|
|
|
<!-- 02-23-2023 Jun Jihad Vendor Header Paceholder -->
|
2024-02-12 10:35:09 +08:00
|
|
|
|
<div class="ec-vendor-block-img space-bottom-30 ">
|
2024-02-27 08:56:59 +08:00
|
|
|
|
<?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;';
|
|
|
|
|
}
|
2024-03-13 10:59:15 +08:00
|
|
|
|
?>
|
2024-02-27 08:56:59 +08:00
|
|
|
|
<div class="ec-vendor-block-bg" style="<?php echo $banner_style; ?>">
|
2024-02-12 10:35:09 +08:00
|
|
|
|
<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">
|
2024-02-27 09:11:14 +08:00
|
|
|
|
<!-- 02-26-2024 Stacy added placeholder-->
|
|
|
|
|
<?php
|
2024-03-13 10:59:15 +08:00
|
|
|
|
if (!empty($vendorData['vendor_image'])) { ?>
|
|
|
|
|
<img class="v-img" src=<?php echo $vendorData['vendor_image'] ?> alt="vendor image">
|
|
|
|
|
<?php } else { ?>
|
|
|
|
|
<img 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 class="v-img" src=<?php #echo $vendorData['vendor_image'] ?> alt="vendor image"> -->
|
2024-02-12 10:35:09 +08:00
|
|
|
|
<h5 class="name"><?php echo $vendorData['user_login'] ?></h5>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
2024-02-27 08:56:59 +08:00
|
|
|
|
<!-- 02-23-2023 Jun Jihad Vendor Header Paceholder -->
|
|
|
|
|
<!-- 02-23-2023 Jun Jihad Vendor Description -->
|
2024-02-12 10:35:09 +08:00
|
|
|
|
<div class="ec-vendor-block-about space-bottom-30">
|
|
|
|
|
<h5>About Us</h5>
|
2024-02-27 08:56:59 +08:00
|
|
|
|
<?php if (!empty($vendorData['vendor_description'])): ?>
|
|
|
|
|
<p><?php echo $vendorData['vendor_description']; ?></p>
|
|
|
|
|
<?php else: ?>
|
|
|
|
|
<p>No description available.</p>
|
|
|
|
|
<?php endif; ?>
|
2024-02-12 10:35:09 +08:00
|
|
|
|
</div>
|
2024-02-27 08:56:59 +08:00
|
|
|
|
<!-- 02-23-2023 Jun Jihad Vendor Description -->
|
2024-02-12 10:35:09 +08:00
|
|
|
|
<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>
|
2024-02-27 08:56:59 +08:00
|
|
|
|
<li style="padding:3%"><strong><?php echo $vendorData["user_email"] ?></strong></li>
|
2024-02-12 10:35:09 +08:00
|
|
|
|
</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>
|
2024-02-27 08:56:59 +08:00
|
|
|
|
<li style="padding:3%"><strong><?php echo $vendorData["phone"] ?></strong></li>
|
2024-02-12 10:35:09 +08:00
|
|
|
|
</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 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>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
2024-03-20 09:36:52 +08:00
|
|
|
|
<!-- 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">
|
|
|
|
|
<?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 -->
|
2024-02-12 10:35:09 +08:00
|
|
|
|
</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" 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) { ?>
|
2024-04-08 18:24:45 +08:00
|
|
|
|
<!-- added id -->
|
|
|
|
|
<div class="card mb-3" id="form-check-<?php echo $address_index ?>">
|
2024-02-12 10:35:09 +08:00
|
|
|
|
<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>
|
|
|
|
|
|
2024-04-08 18:24:45 +08:00
|
|
|
|
<div class="selectWrap" style="display: flex; justify-content: center; align-items: center; width: 50%; margin-left:-20px;">
|
2024-02-12 10:35:09 +08:00
|
|
|
|
<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>
|
|
|
|
|
|
|
|
|
|
|
2024-04-08 18:24:45 +08:00
|
|
|
|
<!-- Stacy modified this block of code -->
|
2024-02-12 10:35:09 +08:00
|
|
|
|
<div class="container">
|
|
|
|
|
<div class="row">
|
|
|
|
|
<div class="col-md-12 mx-auto"> <!-- Adjust the column size as needed -->
|
2024-04-08 18:24:45 +08:00
|
|
|
|
|
|
|
|
|
<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>
|
|
|
|
|
|
2024-02-12 10:35:09 +08:00
|
|
|
|
<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>
|
2024-04-08 18:24:45 +08:00
|
|
|
|
|
2024-02-12 10:35:09 +08:00
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<?php } ?>
|
|
|
|
|
<?php } ?>
|
|
|
|
|
</form>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
|
2024-04-08 18:24:45 +08:00
|
|
|
|
<!-- secondModal -->
|
2024-02-12 10:35:09 +08:00
|
|
|
|
<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="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="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">
|
|
|
|
|
</div>
|
|
|
|
|
<button type="button" class="btn btn-primary" id="submitBtn">Submit</button>
|
|
|
|
|
|
|
|
|
|
</form>
|
|
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
2024-03-20 09:36:52 +08:00
|
|
|
|
|
2024-04-08 18:24:45 +08:00
|
|
|
|
<!-- 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']; ?>">
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<!-- <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" id="submitBtn2">Submit</button>
|
|
|
|
|
|
|
|
|
|
</form>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<!-- Bank -->
|
2024-03-20 09:36:52 +08:00
|
|
|
|
<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" data-bs-toggle="modal" data-bs-target="#secondBankModal">Add New Bank</button>
|
|
|
|
|
|
2024-04-08 18:24:45 +08:00
|
|
|
|
<!-- Display a list of banks and let the user choose -->
|
2024-03-20 09:36:52 +08:00
|
|
|
|
<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-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>
|
|
|
|
|
</label>
|
|
|
|
|
</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="text" 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" id="submitBankBtn">Add Bank</button>
|
|
|
|
|
|
|
|
|
|
</form>
|
|
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
2024-02-12 10:35:09 +08:00
|
|
|
|
<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;
|
2024-02-27 08:56:59 +08:00
|
|
|
|
const description = document.getElementById('cdescription-').value;
|
2024-02-12 10:35:09 +08:00
|
|
|
|
|
|
|
|
|
// If no file selected, only update the email
|
2024-02-15 20:42:37 +08:00
|
|
|
|
fetch(`https://<?php echo $_SESSION["data_endpoint"]; ?>/api/v1/vendors/${vendorid}`, {
|
2024-02-12 10:35:09 +08:00
|
|
|
|
method: 'PATCH',
|
|
|
|
|
headers: {
|
|
|
|
|
'Content-Type': 'application/json'
|
|
|
|
|
},
|
|
|
|
|
body: JSON.stringify({
|
|
|
|
|
user_login: company,
|
|
|
|
|
first_name: firstName,
|
|
|
|
|
last_name: lastName,
|
|
|
|
|
phone: phone,
|
2024-02-27 08:56:59 +08:00
|
|
|
|
vendor_description:description
|
2024-02-12 10:35:09 +08:00
|
|
|
|
})
|
|
|
|
|
})
|
|
|
|
|
.then(response => {
|
|
|
|
|
if (response.ok) {
|
|
|
|
|
console.log('Email update successful');
|
|
|
|
|
location.reload();
|
|
|
|
|
// Handle any other actions after the successful email update
|
|
|
|
|
} else {
|
|
|
|
|
console.error('Email update failed');
|
|
|
|
|
// Handle errors or display a message to the user
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
.catch(error => {
|
|
|
|
|
console.error('Error during fetch:', error);
|
|
|
|
|
// Handle network or other errors
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
}
|
2024-03-07 10:53:15 +08:00
|
|
|
|
|
|
|
|
|
//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");
|
|
|
|
|
});
|
|
|
|
|
}
|
2024-02-12 10:35:09 +08:00
|
|
|
|
</script>
|
2024-04-08 18:24:45 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<script>
|
|
|
|
|
// function for deleting address
|
2024-04-16 10:47:29 +08:00
|
|
|
|
// const vendorid = `<?php # echo $_SESSION["LoggedInVendorId"]; ?>`;
|
2024-04-08 18:24:45 +08:00
|
|
|
|
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) {
|
2024-04-16 10:47:29 +08:00
|
|
|
|
// location.reload();
|
2024-04-08 18:24:45 +08:00
|
|
|
|
// 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>
|
|
|
|
|
|
2024-02-12 10:35:09 +08:00
|
|
|
|
<script>
|
|
|
|
|
const vendorid = `<?php echo $_SESSION["LoggedInVendorId"]; ?>`;
|
|
|
|
|
document.addEventListener('DOMContentLoaded', function() {
|
2024-02-27 08:56:59 +08:00
|
|
|
|
const provinceSelect = $('#provinceSelect');
|
|
|
|
|
const citySelect = $('#citySelect');
|
|
|
|
|
const barangaySelect = $('#barangaySelect');
|
2024-02-12 10:35:09 +08:00
|
|
|
|
|
|
|
|
|
provinceSelect.select2({
|
|
|
|
|
dropdownParent: $('#secondModal'),
|
2024-02-27 08:56:59 +08:00
|
|
|
|
containerCssClass: 'select2-zindex-high'
|
2024-02-12 10:35:09 +08:00
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
citySelect.select2({
|
|
|
|
|
dropdownParent: $('#secondModal'),
|
2024-02-27 08:56:59 +08:00
|
|
|
|
containerCssClass: 'select2-zindex-high'
|
2024-02-12 10:35:09 +08:00
|
|
|
|
});
|
|
|
|
|
barangaySelect.select2({
|
|
|
|
|
dropdownParent: $('#secondModal'),
|
2024-02-27 08:56:59 +08:00
|
|
|
|
containerCssClass: 'select2-zindex-high'
|
2024-02-12 10:35:09 +08:00
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
// 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 => {
|
2024-02-27 08:56:59 +08:00
|
|
|
|
|
2024-02-12 10:35:09 +08:00
|
|
|
|
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() {
|
2024-02-27 08:56:59 +08:00
|
|
|
|
const selectedProvinceCode = provinceSelect.val();
|
2024-02-12 10:35:09 +08:00
|
|
|
|
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() {
|
2024-04-08 18:24:45 +08:00
|
|
|
|
console.log('clickkkkkkkk')
|
2024-02-15 20:42:37 +08:00
|
|
|
|
fetch('https://<?php echo $_SESSION["data_endpoint"]; ?>/api/v1/vendors/' + vendorid)
|
2024-02-12 10:35:09 +08:00
|
|
|
|
.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,
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
existingAddresses.push(newAddress);
|
|
|
|
|
|
2024-02-15 20:42:37 +08:00
|
|
|
|
return fetch('https://<?php echo $_SESSION["data_endpoint"]; ?>/api/v1/vendors/' + vendorid, {
|
2024-02-12 10:35:09 +08:00
|
|
|
|
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');
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
});
|
2024-03-20 09:36:52 +08:00
|
|
|
|
|
2024-04-08 18:24:45 +08:00
|
|
|
|
|
|
|
|
|
// 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');
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
2024-03-20 09:36:52 +08:00
|
|
|
|
$('#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');
|
|
|
|
|
});
|
|
|
|
|
});
|
2024-02-12 10:35:09 +08:00
|
|
|
|
</script>
|
|
|
|
|
<script>
|
|
|
|
|
async function updateAddressBilling(vendorid, addressIndex, isBilling) {
|
|
|
|
|
try {
|
2024-02-15 20:42:37 +08:00
|
|
|
|
const apiUrl = `https://<?php echo $_SESSION["data_endpoint"]; ?>/api/v1/vendors/${vendorid}`;
|
2024-02-12 10:35:09 +08:00
|
|
|
|
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}`);
|
|
|
|
|
}
|
2024-04-08 18:24:45 +08:00
|
|
|
|
console.log(`Address updated successfully for vendor ${vendorid}`);
|
2024-02-12 10:35:09 +08:00
|
|
|
|
} catch (error) {
|
|
|
|
|
console.error('Error updating address:', error.message);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
async function updateAddressShipping(vendorid, addressIndex, isShipping) {
|
|
|
|
|
try {
|
2024-02-15 20:42:37 +08:00
|
|
|
|
const apiUrl = `https://<?php echo $_SESSION["data_endpoint"]; ?>/api/v1/vendors/${vendorid}`;
|
2024-02-12 10:35:09 +08:00
|
|
|
|
const response = await fetch(apiUrl, {
|
|
|
|
|
method: 'GET',
|
|
|
|
|
headers: {
|
|
|
|
|
'Content-Type': 'application/json',
|
|
|
|
|
},
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
if (!response.ok) {
|
2024-04-08 18:24:45 +08:00
|
|
|
|
throw new Error(`Failed to fetch vendor data: ${response.status}`);
|
2024-02-12 10:35:09 +08:00
|
|
|
|
}
|
|
|
|
|
// 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;
|
|
|
|
|
}
|
2024-04-08 18:24:45 +08:00
|
|
|
|
console.log(`Address updated successfully for vendor ${vendorid}`);
|
2024-02-12 10:35:09 +08:00
|
|
|
|
} catch (error) {
|
|
|
|
|
console.error('Error updating address:', error.message);
|
|
|
|
|
}
|
|
|
|
|
}
|
2024-03-20 09:36:52 +08:00
|
|
|
|
|
|
|
|
|
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);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2024-02-12 10:35:09 +08:00
|
|
|
|
</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">
|
2024-02-27 08:56:59 +08:00
|
|
|
|
<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 class="image-thumb-preview ec-image-preview v-img" src="' . $vendorData['vendor_banner'] . '" alt="edit" />';
|
|
|
|
|
}
|
|
|
|
|
?>
|
2024-02-12 10:35:09 +08:00
|
|
|
|
</div>
|
|
|
|
|
</div>
|
2024-02-27 08:56:59 +08:00
|
|
|
|
</div>
|
2024-02-12 10:35:09 +08:00
|
|
|
|
</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">
|
2024-02-27 08:56:59 +08:00
|
|
|
|
<div class="image-thumb-preview">
|
|
|
|
|
<?php if (!empty($vendorData['vendor_image'])): ?>
|
|
|
|
|
<img class="image-thumb-preview ec-image-preview v-img" src="<?php echo $vendorData['vendor_image']; ?>" alt="edit" />
|
|
|
|
|
<?php else: ?>
|
|
|
|
|
<img 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>
|
2024-02-12 10:35:09 +08:00
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<script>
|
2024-02-27 08:56:59 +08:00
|
|
|
|
function uploadVendorProfileImage() {
|
2024-04-08 18:24:45 +08:00
|
|
|
|
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('Second request successful');
|
|
|
|
|
location.reload();
|
|
|
|
|
} else {
|
|
|
|
|
console.error('Second request failed');
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
.catch(error => {
|
|
|
|
|
console.error('Error during fetch:', error);
|
|
|
|
|
});
|
|
|
|
|
}, 'image/jpeg');
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
img.src = event.target.result;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
reader.readAsDataURL(file);
|
|
|
|
|
}
|
|
|
|
|
}
|
2024-02-27 08:56:59 +08:00
|
|
|
|
|
2024-04-08 18:24:45 +08:00
|
|
|
|
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('Second request successful');
|
|
|
|
|
location.reload();
|
|
|
|
|
} else {
|
|
|
|
|
console.error('Second request failed');
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
.catch(error => {
|
|
|
|
|
console.error('Error during fetch:', error);
|
|
|
|
|
});
|
|
|
|
|
}, 'image/jpeg');
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
img.src = event.target.result;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
reader.readAsDataURL(file);
|
|
|
|
|
}
|
|
|
|
|
}
|
2024-02-12 10:35:09 +08:00
|
|
|
|
|
|
|
|
|
</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'] ?>">
|
|
|
|
|
</div>
|
2024-02-27 08:56:59 +08:00
|
|
|
|
<!-- 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-->
|
2024-02-12 10:35:09 +08:00
|
|
|
|
|
|
|
|
|
<!-- <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 -->
|
|
|
|
|
|
2024-02-20 15:54:42 +08:00
|
|
|
|
<!-- raymart remove popup feb 20 2024 -->
|
2024-02-12 10:35:09 +08:00
|
|
|
|
<!-- Recent Purchase Popup -->
|
2024-02-20 15:54:42 +08:00
|
|
|
|
<!-- <div class="recent-purchase">
|
2024-02-12 10:35:09 +08:00
|
|
|
|
<img 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>
|
2024-02-20 15:54:42 +08:00
|
|
|
|
</div> -->
|
2024-02-12 10:35:09 +08:00
|
|
|
|
<!-- 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 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 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 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 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 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 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>
|