MMCT TEAM
Server IP : 217.21.85.138  /  Your IP : 216.73.216.103
Web Server : LiteSpeed
System : Linux in-mum-web906.main-hosting.eu 4.18.0-553.37.1.lve.el8.x86_64 #1 SMP Mon Feb 10 22:45:17 UTC 2025 x86_64
User : u915722082 ( 915722082)
PHP Version : 7.4.33
Disable Function : system, exec, shell_exec, passthru, mysql_list_dbs, ini_alter, dl, symlink, link, chgrp, leak, popen, apache_child_terminate, virtual, mb_send_mail
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : OFF  |  Python : OFF
Directory (0755) :  /home/u915722082/.nvm/../public_html/lohri/vendor_admin/

[  Home  ][  C0mmand  ][  Upload File  ]

Current File : /home/u915722082/.nvm/../public_html/lohri/vendor_admin/profile.php
<?php
session_start();
include "../config/db.php";

$vendor_id = isset($_GET['id']) ? intval($_GET['id']) : null;

if (!$vendor_id || $vendor_id != $_SESSION['vendor_id']) {
    header("Location: ../vendor_admin/profile.php?id=" . $_SESSION['vendor_id']);
    exit;
}

$stmt = $con->prepare("SELECT * FROM vendors WHERE id = ? AND status = 'active'");
$stmt->bind_param("i", $vendor_id);
$stmt->execute();
$result = $stmt->get_result();
$vendor = $result->fetch_assoc();

if (!$vendor) {
    session_destroy();
    header("Location: ../ui/login");
    exit;
}

// ========================================
// CALCULATE VENDOR STATISTICS
// ========================================

// 1. Total Earnings (sum of vendor_price from ordered products)
$earnings_query = "
    SELECT COALESCE(SUM(oi.quantity * p.vendor_price), 0) as total_earnings
    FROM order_items oi
    INNER JOIN orders o ON oi.order_id = o.order_id
    INNER JOIN products p ON oi.product_id = p.pid
    WHERE p.vendor_id = ? AND o.payment_status = 'paid'
";
$earnings_stmt = $con->prepare($earnings_query);
if (!$earnings_stmt) {
    die("Earnings Query Error: " . $con->error);
}
$earnings_stmt->bind_param("i", $vendor_id);
$earnings_stmt->execute();
$earnings_result = $earnings_stmt->get_result();
$earnings_data = $earnings_result->fetch_assoc();
$total_earnings = $earnings_data['total_earnings'];

// 2. Total Products Count
$total_products_query = "SELECT COUNT(*) as total_products FROM products WHERE vendor_id = ?";
$total_products_stmt = $con->prepare($total_products_query);
if (!$total_products_stmt) {
    die("Total Products Query Error: " . $con->error);
}
$total_products_stmt->bind_param("i", $vendor_id);
$total_products_stmt->execute();
$total_products_result = $total_products_stmt->get_result();
$total_products_data = $total_products_result->fetch_assoc();
$total_products = $total_products_data['total_products'];

// 3. Ordered Products Count (distinct products that have been ordered)
$ordered_products_query = "
    SELECT COUNT(DISTINCT p.pid) as ordered_products
    FROM products p
    INNER JOIN order_items oi ON p.pid = oi.product_id
    WHERE p.vendor_id = ?
";
$ordered_products_stmt = $con->prepare($ordered_products_query);
if (!$ordered_products_stmt) {
    die("Ordered Products Query Error: " . $con->error);
}
$ordered_products_stmt->bind_param("i", $vendor_id);
$ordered_products_stmt->execute();
$ordered_products_result = $ordered_products_stmt->get_result();
$ordered_products_data = $ordered_products_result->fetch_assoc();
$ordered_products = $ordered_products_data['ordered_products'];

// 4. Unordered Products Count
$unordered_products = $total_products - $ordered_products;

// 5. Total Orders Count (number of orders containing vendor's products)
$total_orders_query = "
    SELECT COUNT(DISTINCT o.order_id) as total_orders
    FROM orders o
    INNER JOIN order_items oi ON o.order_id = oi.order_id
    INNER JOIN products p ON oi.product_id = p.pid
    WHERE p.vendor_id = ?
";
$total_orders_stmt = $con->prepare($total_orders_query);
if (!$total_orders_stmt) {
    die("Total Orders Query Error: " . $con->error);
}
$total_orders_stmt->bind_param("i", $vendor_id);
$total_orders_stmt->execute();
$total_orders_result = $total_orders_stmt->get_result();
$total_orders_data = $total_orders_result->fetch_assoc();
$total_orders = $total_orders_data['total_orders'];

// 6. Pending Earnings (orders not yet paid)
$pending_earnings_query = "
    SELECT COALESCE(SUM(oi.quantity * p.vendor_price), 0) as pending_earnings
    FROM order_items oi
    INNER JOIN orders o ON oi.order_id = o.order_id
    INNER JOIN products p ON oi.product_id = p.pid
    WHERE p.vendor_id = ? AND o.payment_status = 'pending'
";
$pending_earnings_stmt = $con->prepare($pending_earnings_query);
if (!$pending_earnings_stmt) {
    die("Pending Earnings Query Error: " . $con->error);
}
$pending_earnings_stmt->bind_param("i", $vendor_id);
$pending_earnings_stmt->execute();
$pending_earnings_result = $pending_earnings_stmt->get_result();
$pending_earnings_data = $pending_earnings_result->fetch_assoc();
$pending_earnings = $pending_earnings_data['pending_earnings'];

?>


<html lang="en">
	<!--begin::Head-->
	<head><base href="../"/>
		<title>Metronic - the world's #1 selling Bootstrap Admin Theme Ecosystem for HTML, Vue, React, Angular & Laravel by Keenthemes</title>
		<meta charset="utf-8" />
		<meta name="description" content="The most advanced Bootstrap Admin Theme on Themeforest trusted by 100,000 beginners and professionals. Multi-demo, Dark Mode, RTL support and complete React, Angular, Vue, Asp.Net Core, Rails, Spring, Blazor, Django, Flask & Laravel versions. Grab your copy now and get life-time updates for free." />
		<meta name="keywords" content="metronic, bootstrap, bootstrap 5, angular, VueJs, React, Asp.Net Core, Rails, Spring, Blazor, Django, Flask & Laravel starter kits, admin themes, web design, figma, web development, free templates, free admin themes, bootstrap theme, bootstrap template, bootstrap dashboard, bootstrap dak mode, bootstrap button, bootstrap datepicker, bootstrap timepicker, fullcalendar, datatables, flaticon" />
		<meta name="viewport" content="width=device-width, initial-scale=1" />
		<meta property="og:locale" content="en_US" />
		<meta property="og:type" content="article" />
		<meta property="og:title" content="Metronic - Bootstrap 5 HTML, VueJS, React, Angular. Laravel, Asp.Net Core, Ruby on Rails, Spring Boot, Blazor, Django, Express Node.js & Flask Admin Dashboard Theme" />
		<meta property="og:url" content="https://keenthemes.com/metronic" />
		<meta property="og:site_name" content="Keenthemes | Metronic" />
		<link rel="canonical" href="https://preview.keenthemes.com/metronic8" />
		<link rel="shortcut icon" href="assets/media/logos/favicon.ico" />
		<!--begin::Fonts(mandatory for all pages)-->
		<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Inter:300,400,500,600,700" />
		<!--end::Fonts-->
		<!--begin::Vendor Stylesheets(used for this page only)-->
		<link href="assets/plugins/custom/datatables/datatables.bundle.css" rel="stylesheet" type="text/css" />
		<!--end::Vendor Stylesheets-->
		<!--begin::Global Stylesheets Bundle(mandatory for all pages)-->
		<link href="assets/plugins/global/plugins.bundle.css" rel="stylesheet" type="text/css" />
		<link href="assets/css/style.bundle.css" rel="stylesheet" type="text/css" />
		<!--end::Global Stylesheets Bundle-->
	</head>
	<!--end::Head-->
	<!--begin::Body-->
	<body id="kt_app_body" data-kt-app-layout="dark-sidebar" data-kt-app-header-fixed="true" data-kt-app-sidebar-enabled="true" data-kt-app-sidebar-fixed="true" data-kt-app-sidebar-hoverable="true" data-kt-app-sidebar-push-header="true" data-kt-app-sidebar-push-toolbar="true" data-kt-app-sidebar-push-footer="true" data-kt-app-toolbar-enabled="true" class="app-default">
		<!--begin::Theme mode setup on page load-->
		<script>var defaultThemeMode = "light"; var themeMode; if ( document.documentElement ) { if ( document.documentElement.hasAttribute("data-theme-mode")) { themeMode = document.documentElement.getAttribute("data-theme-mode"); } else { if ( localStorage.getItem("data-theme") !== null ) { themeMode = localStorage.getItem("data-theme"); } else { themeMode = defaultThemeMode; } } if (themeMode === "system") { themeMode = window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light"; } document.documentElement.setAttribute("data-theme", themeMode); }
		</script>
		<!--end::Theme mode setup on page load-->
		<!--begin::App-->
		<div class="d-flex flex-column flex-root app-root" id="kt_app_root">
			<!--begin::Page-->
			<div class="app-page flex-column flex-column-fluid" id="kt_app_page">
				<!--begin::Header-->
				<div id="kt_app_header" class="app-header">
					<!--begin::Header container-->
					<div class="app-container container-fluid d-flex align-items-stretch justify-content-between" id="kt_app_header_container">
						<!--begin::Sidebar mobile toggle-->
						<div class="d-flex align-items-center d-lg-none ms-n3 me-1 me-md-2" title="Show sidebar menu">
							<div class="btn btn-icon btn-active-color-primary w-35px h-35px" id="kt_app_sidebar_mobile_toggle">
								<!--begin::Svg Icon | path: icons/duotune/abstract/abs015.svg-->
								<span class="svg-icon svg-icon-2 svg-icon-md-1">
									<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
										<path d="M21 7H3C2.4 7 2 6.6 2 6V4C2 3.4 2.4 3 3 3H21C21.6 3 22 3.4 22 4V6C22 6.6 21.6 7 21 7Z" fill="currentColor" />
										<path opacity="0.3" d="M21 14H3C2.4 14 2 13.6 2 13V11C2 10.4 2.4 10 3 10H21C21.6 10 22 10.4 22 11V13C22 13.6 21.6 14 21 14ZM22 20V18C22 17.4 21.6 17 21 17H3C2.4 17 2 17.4 2 18V20C2 20.6 2.4 21 3 21H21C21.6 21 22 20.6 22 20Z" fill="currentColor" />
									</svg>
								</span>
								<!--end::Svg Icon-->
							</div>
						</div>
						<!--end::Sidebar mobile toggle-->
						<!--begin::Mobile logo-->
						<div class="d-flex align-items-center flex-grow-1 flex-lg-grow-0">
							<a href="../../demo1/dist/index.html" class="d-lg-none">
								<img alt="Logo" src="assets/media/logos/default-small.svg" class="h-30px" />
							</a>
						</div>
						<!--end::Mobile logo-->
						<!--begin::Header wrapper-->
							<div class="d-flex align-items-stretch justify-content-between flex-lg-grow-1" id="kt_app_header_wrapper">
							<!--begin::Menu wrapper-->
							<div class="app-header-menu app-header-mobile-drawer align-items-stretch" data-kt-drawer="true" data-kt-drawer-name="app-header-menu" data-kt-drawer-activate="{default: true, lg: false}" data-kt-drawer-overlay="true" data-kt-drawer-width="250px" data-kt-drawer-direction="end" data-kt-drawer-toggle="#kt_app_header_menu_toggle" data-kt-swapper="true" data-kt-swapper-mode="{default: 'append', lg: 'prepend'}" data-kt-swapper-parent="{default: '#kt_app_body', lg: '#kt_app_header_wrapper'}">
								<!--begin::Menu-->
								<div class="menu menu-rounded menu-column menu-lg-row my-5 my-lg-0 align-items-stretch fw-semibold px-2 px-lg-0" id="kt_app_header_menu" data-kt-menu="true">
									<!--begin:Menu item-->
									
									<!--end:Menu item-->
								</div>
								<!--end::Menu-->
							</div>
							<!--end::Menu wrapper-->
							<!--begin::Navbar-->
							<div class="app-navbar flex-shrink-0">
								
							
								<!--end::My apps links-->
								<!--begin::Theme mode-->
								<div class="app-navbar-item ms-1 ms-md-3">
									<!--begin::Menu toggle-->
									<a href="#" class="btn btn-icon btn-custom btn-icon-muted btn-active-light btn-active-color-primary w-30px h-30px w-md-40px h-md-40px" data-kt-menu-trigger="{default:'click', lg: 'hover'}" data-kt-menu-attach="parent" data-kt-menu-placement="bottom-end">
										<!--begin::Svg Icon | path: icons/duotune/general/gen060.svg-->
										<span class="svg-icon theme-light-show svg-icon-2">
											<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
												<path d="M11.9905 5.62598C10.7293 5.62574 9.49646 5.9995 8.44775 6.69997C7.39903 7.40045 6.58159 8.39619 6.09881 9.56126C5.61603 10.7263 5.48958 12.0084 5.73547 13.2453C5.98135 14.4823 6.58852 15.6185 7.48019 16.5104C8.37186 17.4022 9.50798 18.0096 10.7449 18.2557C11.9818 18.5019 13.2639 18.3757 14.429 17.8931C15.5942 17.4106 16.5901 16.5933 17.2908 15.5448C17.9915 14.4962 18.3655 13.2634 18.3655 12.0023C18.3637 10.3119 17.6916 8.69129 16.4964 7.49593C15.3013 6.30056 13.6808 5.62806 11.9905 5.62598Z" fill="currentColor" />
												<path d="M22.1258 10.8771H20.627C20.3286 10.8771 20.0424 10.9956 19.8314 11.2066C19.6204 11.4176 19.5018 11.7038 19.5018 12.0023C19.5018 12.3007 19.6204 12.5869 19.8314 12.7979C20.0424 13.0089 20.3286 13.1274 20.627 13.1274H22.1258C22.4242 13.1274 22.7104 13.0089 22.9214 12.7979C23.1324 12.5869 23.2509 12.3007 23.2509 12.0023C23.2509 11.7038 23.1324 11.4176 22.9214 11.2066C22.7104 10.9956 22.4242 10.8771 22.1258 10.8771Z" fill="currentColor" />
												<path d="M11.9905 19.4995C11.6923 19.5 11.4064 19.6187 11.1956 19.8296C10.9848 20.0405 10.8663 20.3265 10.866 20.6247V22.1249C10.866 22.4231 10.9845 22.7091 11.1953 22.9199C11.4062 23.1308 11.6922 23.2492 11.9904 23.2492C12.2886 23.2492 12.5746 23.1308 12.7854 22.9199C12.9963 22.7091 13.1147 22.4231 13.1147 22.1249V20.6247C13.1145 20.3265 12.996 20.0406 12.7853 19.8296C12.5745 19.6187 12.2887 19.5 11.9905 19.4995Z" fill="currentColor" />
												<path d="M4.49743 12.0023C4.49718 11.704 4.37865 11.4181 4.16785 11.2072C3.95705 10.9962 3.67119 10.8775 3.37298 10.8771H1.87445C1.57603 10.8771 1.28984 10.9956 1.07883 11.2066C0.867812 11.4176 0.749266 11.7038 0.749266 12.0023C0.749266 12.3007 0.867812 12.5869 1.07883 12.7979C1.28984 13.0089 1.57603 13.1274 1.87445 13.1274H3.37299C3.6712 13.127 3.95706 13.0083 4.16785 12.7973C4.37865 12.5864 4.49718 12.3005 4.49743 12.0023Z" fill="currentColor" />
												<path d="M11.9905 4.50058C12.2887 4.50012 12.5745 4.38141 12.7853 4.17048C12.9961 3.95954 13.1147 3.67361 13.1149 3.3754V1.87521C13.1149 1.57701 12.9965 1.29103 12.7856 1.08017C12.5748 0.869313 12.2888 0.750854 11.9906 0.750854C11.6924 0.750854 11.4064 0.869313 11.1955 1.08017C10.9847 1.29103 10.8662 1.57701 10.8662 1.87521V3.3754C10.8664 3.67359 10.9849 3.95952 11.1957 4.17046C11.4065 4.3814 11.6923 4.50012 11.9905 4.50058Z" fill="currentColor" />
												<path d="M18.8857 6.6972L19.9465 5.63642C20.0512 5.53209 20.1343 5.40813 20.1911 5.27163C20.2479 5.13513 20.2772 4.98877 20.2774 4.84093C20.2775 4.69309 20.2485 4.54667 20.192 4.41006C20.1355 4.27344 20.0526 4.14932 19.948 4.04478C19.8435 3.94024 19.7194 3.85734 19.5828 3.80083C19.4462 3.74432 19.2997 3.71531 19.1519 3.71545C19.0041 3.7156 18.8577 3.7449 18.7212 3.80167C18.5847 3.85845 18.4607 3.94159 18.3564 4.04633L17.2956 5.10714C17.1909 5.21147 17.1077 5.33543 17.0509 5.47194C16.9942 5.60844 16.9649 5.7548 16.9647 5.90264C16.9646 6.05048 16.9936 6.19689 17.0501 6.33351C17.1066 6.47012 17.1895 6.59425 17.294 6.69878C17.3986 6.80332 17.5227 6.88621 17.6593 6.94272C17.7959 6.99923 17.9424 7.02824 18.0902 7.02809C18.238 7.02795 18.3844 6.99865 18.5209 6.94187C18.6574 6.88509 18.7814 6.80195 18.8857 6.6972Z" fill="currentColor" />
												<path d="M18.8855 17.3073C18.7812 17.2026 18.6572 17.1195 18.5207 17.0627C18.3843 17.006 18.2379 16.9767 18.0901 16.9766C17.9423 16.9764 17.7959 17.0055 17.6593 17.062C17.5227 17.1185 17.3986 17.2014 17.2941 17.3059C17.1895 17.4104 17.1067 17.5345 17.0501 17.6711C16.9936 17.8077 16.9646 17.9541 16.9648 18.1019C16.9649 18.2497 16.9942 18.3961 17.0509 18.5326C17.1077 18.6691 17.1908 18.793 17.2955 18.8974L18.3563 19.9582C18.4606 20.0629 18.5846 20.146 18.721 20.2027C18.8575 20.2595 19.0039 20.2887 19.1517 20.2889C19.2995 20.289 19.4459 20.26 19.5825 20.2035C19.7191 20.147 19.8432 20.0641 19.9477 19.9595C20.0523 19.855 20.1351 19.7309 20.1916 19.5943C20.2482 19.4577 20.2772 19.3113 20.277 19.1635C20.2769 19.0157 20.2476 18.8694 20.1909 18.7329C20.1341 18.5964 20.051 18.4724 19.9463 18.3681L18.8855 17.3073Z" fill="currentColor" />
												<path d="M5.09528 17.3072L4.0345 18.368C3.92972 18.4723 3.84655 18.5963 3.78974 18.7328C3.73294 18.8693 3.70362 19.0156 3.70346 19.1635C3.7033 19.3114 3.7323 19.4578 3.78881 19.5944C3.84532 19.7311 3.92822 19.8552 4.03277 19.9598C4.13732 20.0643 4.26147 20.1472 4.3981 20.2037C4.53473 20.2602 4.68117 20.2892 4.82902 20.2891C4.97688 20.2889 5.12325 20.2596 5.25976 20.2028C5.39627 20.146 5.52024 20.0628 5.62456 19.958L6.68536 18.8973C6.79007 18.7929 6.87318 18.6689 6.92993 18.5325C6.98667 18.396 7.01595 18.2496 7.01608 18.1018C7.01621 17.954 6.98719 17.8076 6.93068 17.671C6.87417 17.5344 6.79129 17.4103 6.68676 17.3058C6.58224 17.2012 6.45813 17.1183 6.32153 17.0618C6.18494 17.0053 6.03855 16.9763 5.89073 16.9764C5.74291 16.9766 5.59657 17.0058 5.46007 17.0626C5.32358 17.1193 5.19962 17.2024 5.09528 17.3072Z" fill="currentColor" />
												<path d="M5.09541 6.69715C5.19979 6.8017 5.32374 6.88466 5.4602 6.94128C5.59665 6.9979 5.74292 7.02708 5.89065 7.02714C6.03839 7.0272 6.18469 6.99815 6.32119 6.94164C6.45769 6.88514 6.58171 6.80228 6.68618 6.69782C6.79064 6.59336 6.87349 6.46933 6.93 6.33283C6.9865 6.19633 7.01556 6.05003 7.01549 5.9023C7.01543 5.75457 6.98625 5.60829 6.92963 5.47184C6.87301 5.33539 6.79005 5.21143 6.6855 5.10706L5.6247 4.04626C5.5204 3.94137 5.39643 3.8581 5.25989 3.80121C5.12335 3.74432 4.97692 3.71493 4.82901 3.71472C4.68109 3.71452 4.53458 3.7435 4.39789 3.80001C4.26119 3.85652 4.13699 3.93945 4.03239 4.04404C3.9278 4.14864 3.84487 4.27284 3.78836 4.40954C3.73185 4.54624 3.70287 4.69274 3.70308 4.84066C3.70329 4.98858 3.73268 5.135 3.78957 5.27154C3.84646 5.40808 3.92974 5.53205 4.03462 5.63635L5.09541 6.69715Z" fill="currentColor" />
											</svg>
										</span>
										<!--end::Svg Icon-->
										<!--begin::Svg Icon | path: icons/duotune/general/gen061.svg-->
										<span class="svg-icon theme-dark-show svg-icon-2">
											<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
												<path d="M19.0647 5.43757C19.3421 5.43757 19.567 5.21271 19.567 4.93534C19.567 4.65796 19.3421 4.43311 19.0647 4.43311C18.7874 4.43311 18.5625 4.65796 18.5625 4.93534C18.5625 5.21271 18.7874 5.43757 19.0647 5.43757Z" fill="currentColor" />
												<path d="M20.0692 9.48884C20.3466 9.48884 20.5714 9.26398 20.5714 8.98661C20.5714 8.70923 20.3466 8.48438 20.0692 8.48438C19.7918 8.48438 19.567 8.70923 19.567 8.98661C19.567 9.26398 19.7918 9.48884 20.0692 9.48884Z" fill="currentColor" />
												<path d="M12.0335 20.5714C15.6943 20.5714 18.9426 18.2053 20.1168 14.7338C20.1884 14.5225 20.1114 14.289 19.9284 14.161C19.746 14.034 19.5003 14.0418 19.3257 14.1821C18.2432 15.0546 16.9371 15.5156 15.5491 15.5156C12.2257 15.5156 9.48884 12.8122 9.48884 9.48886C9.48884 7.41079 10.5773 5.47137 12.3449 4.35752C12.5342 4.23832 12.6 4.00733 12.5377 3.79251C12.4759 3.57768 12.2571 3.42859 12.0335 3.42859C7.32556 3.42859 3.42857 7.29209 3.42857 12C3.42857 16.7079 7.32556 20.5714 12.0335 20.5714Z" fill="currentColor" />
												<path d="M13.0379 7.47998C13.8688 7.47998 14.5446 8.15585 14.5446 8.98668C14.5446 9.26428 14.7693 9.48891 15.0469 9.48891C15.3245 9.48891 15.5491 9.26428 15.5491 8.98668C15.5491 8.15585 16.225 7.47998 17.0558 7.47998C17.3334 7.47998 17.558 7.25535 17.558 6.97775C17.558 6.70015 17.3334 6.47552 17.0558 6.47552C16.225 6.47552 15.5491 5.76616 15.5491 4.93534C15.5491 4.65774 15.3245 4.43311 15.0469 4.43311C14.7693 4.43311 14.5446 4.65774 14.5446 4.93534C14.5446 5.76616 13.8688 6.47552 13.0379 6.47552C12.7603 6.47552 12.5357 6.70015 12.5357 6.97775C12.5357 7.25535 12.7603 7.47998 13.0379 7.47998Z" fill="currentColor" />
											</svg>
										</span>
										<!--end::Svg Icon-->
									</a>
									<!--begin::Menu toggle-->
									<!--begin::Menu-->
									<div class="menu menu-sub menu-sub-dropdown menu-column menu-rounded menu-title-gray-700 menu-icon-muted menu-active-bg menu-state-color fw-semibold py-4 fs-base w-150px" data-kt-menu="true" data-kt-element="theme-mode-menu">
										<!--begin::Menu item-->
										<div class="menu-item px-3 my-0">
											<a href="#" class="menu-link px-3 py-2" data-kt-element="mode" data-kt-value="light">
												<span class="menu-icon" data-kt-element="icon">
													<!--begin::Svg Icon | path: icons/duotune/general/gen060.svg-->
													<span class="svg-icon svg-icon-3">
														<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
															<path d="M11.9905 5.62598C10.7293 5.62574 9.49646 5.9995 8.44775 6.69997C7.39903 7.40045 6.58159 8.39619 6.09881 9.56126C5.61603 10.7263 5.48958 12.0084 5.73547 13.2453C5.98135 14.4823 6.58852 15.6185 7.48019 16.5104C8.37186 17.4022 9.50798 18.0096 10.7449 18.2557C11.9818 18.5019 13.2639 18.3757 14.429 17.8931C15.5942 17.4106 16.5901 16.5933 17.2908 15.5448C17.9915 14.4962 18.3655 13.2634 18.3655 12.0023C18.3637 10.3119 17.6916 8.69129 16.4964 7.49593C15.3013 6.30056 13.6808 5.62806 11.9905 5.62598Z" fill="currentColor" />
															<path d="M22.1258 10.8771H20.627C20.3286 10.8771 20.0424 10.9956 19.8314 11.2066C19.6204 11.4176 19.5018 11.7038 19.5018 12.0023C19.5018 12.3007 19.6204 12.5869 19.8314 12.7979C20.0424 13.0089 20.3286 13.1274 20.627 13.1274H22.1258C22.4242 13.1274 22.7104 13.0089 22.9214 12.7979C23.1324 12.5869 23.2509 12.3007 23.2509 12.0023C23.2509 11.7038 23.1324 11.4176 22.9214 11.2066C22.7104 10.9956 22.4242 10.8771 22.1258 10.8771Z" fill="currentColor" />
															<path d="M11.9905 19.4995C11.6923 19.5 11.4064 19.6187 11.1956 19.8296C10.9848 20.0405 10.8663 20.3265 10.866 20.6247V22.1249C10.866 22.4231 10.9845 22.7091 11.1953 22.9199C11.4062 23.1308 11.6922 23.2492 11.9904 23.2492C12.2886 23.2492 12.5746 23.1308 12.7854 22.9199C12.9963 22.7091 13.1147 22.4231 13.1147 22.1249V20.6247C13.1145 20.3265 12.996 20.0406 12.7853 19.8296C12.5745 19.6187 12.2887 19.5 11.9905 19.4995Z" fill="currentColor" />
															<path d="M4.49743 12.0023C4.49718 11.704 4.37865 11.4181 4.16785 11.2072C3.95705 10.9962 3.67119 10.8775 3.37298 10.8771H1.87445C1.57603 10.8771 1.28984 10.9956 1.07883 11.2066C0.867812 11.4176 0.749266 11.7038 0.749266 12.0023C0.749266 12.3007 0.867812 12.5869 1.07883 12.7979C1.28984 13.0089 1.57603 13.1274 1.87445 13.1274H3.37299C3.6712 13.127 3.95706 13.0083 4.16785 12.7973C4.37865 12.5864 4.49718 12.3005 4.49743 12.0023Z" fill="currentColor" />
															<path d="M11.9905 4.50058C12.2887 4.50012 12.5745 4.38141 12.7853 4.17048C12.9961 3.95954 13.1147 3.67361 13.1149 3.3754V1.87521C13.1149 1.57701 12.9965 1.29103 12.7856 1.08017C12.5748 0.869313 12.2888 0.750854 11.9906 0.750854C11.6924 0.750854 11.4064 0.869313 11.1955 1.08017C10.9847 1.29103 10.8662 1.57701 10.8662 1.87521V3.3754C10.8664 3.67359 10.9849 3.95952 11.1957 4.17046C11.4065 4.3814 11.6923 4.50012 11.9905 4.50058Z" fill="currentColor" />
															<path d="M18.8857 6.6972L19.9465 5.63642C20.0512 5.53209 20.1343 5.40813 20.1911 5.27163C20.2479 5.13513 20.2772 4.98877 20.2774 4.84093C20.2775 4.69309 20.2485 4.54667 20.192 4.41006C20.1355 4.27344 20.0526 4.14932 19.948 4.04478C19.8435 3.94024 19.7194 3.85734 19.5828 3.80083C19.4462 3.74432 19.2997 3.71531 19.1519 3.71545C19.0041 3.7156 18.8577 3.7449 18.7212 3.80167C18.5847 3.85845 18.4607 3.94159 18.3564 4.04633L17.2956 5.10714C17.1909 5.21147 17.1077 5.33543 17.0509 5.47194C16.9942 5.60844 16.9649 5.7548 16.9647 5.90264C16.9646 6.05048 16.9936 6.19689 17.0501 6.33351C17.1066 6.47012 17.1895 6.59425 17.294 6.69878C17.3986 6.80332 17.5227 6.88621 17.6593 6.94272C17.7959 6.99923 17.9424 7.02824 18.0902 7.02809C18.238 7.02795 18.3844 6.99865 18.5209 6.94187C18.6574 6.88509 18.7814 6.80195 18.8857 6.6972Z" fill="currentColor" />
															<path d="M18.8855 17.3073C18.7812 17.2026 18.6572 17.1195 18.5207 17.0627C18.3843 17.006 18.2379 16.9767 18.0901 16.9766C17.9423 16.9764 17.7959 17.0055 17.6593 17.062C17.5227 17.1185 17.3986 17.2014 17.2941 17.3059C17.1895 17.4104 17.1067 17.5345 17.0501 17.6711C16.9936 17.8077 16.9646 17.9541 16.9648 18.1019C16.9649 18.2497 16.9942 18.3961 17.0509 18.5326C17.1077 18.6691 17.1908 18.793 17.2955 18.8974L18.3563 19.9582C18.4606 20.0629 18.5846 20.146 18.721 20.2027C18.8575 20.2595 19.0039 20.2887 19.1517 20.2889C19.2995 20.289 19.4459 20.26 19.5825 20.2035C19.7191 20.147 19.8432 20.0641 19.9477 19.9595C20.0523 19.855 20.1351 19.7309 20.1916 19.5943C20.2482 19.4577 20.2772 19.3113 20.277 19.1635C20.2769 19.0157 20.2476 18.8694 20.1909 18.7329C20.1341 18.5964 20.051 18.4724 19.9463 18.3681L18.8855 17.3073Z" fill="currentColor" />
															<path d="M5.09528 17.3072L4.0345 18.368C3.92972 18.4723 3.84655 18.5963 3.78974 18.7328C3.73294 18.8693 3.70362 19.0156 3.70346 19.1635C3.7033 19.3114 3.7323 19.4578 3.78881 19.5944C3.84532 19.7311 3.92822 19.8552 4.03277 19.9598C4.13732 20.0643 4.26147 20.1472 4.3981 20.2037C4.53473 20.2602 4.68117 20.2892 4.82902 20.2891C4.97688 20.2889 5.12325 20.2596 5.25976 20.2028C5.39627 20.146 5.52024 20.0628 5.62456 19.958L6.68536 18.8973C6.79007 18.7929 6.87318 18.6689 6.92993 18.5325C6.98667 18.396 7.01595 18.2496 7.01608 18.1018C7.01621 17.954 6.98719 17.8076 6.93068 17.671C6.87417 17.5344 6.79129 17.4103 6.68676 17.3058C6.58224 17.2012 6.45813 17.1183 6.32153 17.0618C6.18494 17.0053 6.03855 16.9763 5.89073 16.9764C5.74291 16.9766 5.59657 17.0058 5.46007 17.0626C5.32358 17.1193 5.19962 17.2024 5.09528 17.3072Z" fill="currentColor" />
															<path d="M5.09541 6.69715C5.19979 6.8017 5.32374 6.88466 5.4602 6.94128C5.59665 6.9979 5.74292 7.02708 5.89065 7.02714C6.03839 7.0272 6.18469 6.99815 6.32119 6.94164C6.45769 6.88514 6.58171 6.80228 6.68618 6.69782C6.79064 6.59336 6.87349 6.46933 6.93 6.33283C6.9865 6.19633 7.01556 6.05003 7.01549 5.9023C7.01543 5.75457 6.98625 5.60829 6.92963 5.47184C6.87301 5.33539 6.79005 5.21143 6.6855 5.10706L5.6247 4.04626C5.5204 3.94137 5.39643 3.8581 5.25989 3.80121C5.12335 3.74432 4.97692 3.71493 4.82901 3.71472C4.68109 3.71452 4.53458 3.7435 4.39789 3.80001C4.26119 3.85652 4.13699 3.93945 4.03239 4.04404C3.9278 4.14864 3.84487 4.27284 3.78836 4.40954C3.73185 4.54624 3.70287 4.69274 3.70308 4.84066C3.70329 4.98858 3.73268 5.135 3.78957 5.27154C3.84646 5.40808 3.92974 5.53205 4.03462 5.63635L5.09541 6.69715Z" fill="currentColor" />
														</svg>
													</span>
													<!--end::Svg Icon-->
												</span>
												<span class="menu-title">Light</span>
											</a>
										</div>
										<!--end::Menu item-->
										<!--begin::Menu item-->
										<div class="menu-item px-3 my-0">
											<a href="#" class="menu-link px-3 py-2" data-kt-element="mode" data-kt-value="dark">
												<span class="menu-icon" data-kt-element="icon">
													<!--begin::Svg Icon | path: icons/duotune/general/gen061.svg-->
													<span class="svg-icon svg-icon-3">
														<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
															<path d="M19.0647 5.43757C19.3421 5.43757 19.567 5.21271 19.567 4.93534C19.567 4.65796 19.3421 4.43311 19.0647 4.43311C18.7874 4.43311 18.5625 4.65796 18.5625 4.93534C18.5625 5.21271 18.7874 5.43757 19.0647 5.43757Z" fill="currentColor" />
															<path d="M20.0692 9.48884C20.3466 9.48884 20.5714 9.26398 20.5714 8.98661C20.5714 8.70923 20.3466 8.48438 20.0692 8.48438C19.7918 8.48438 19.567 8.70923 19.567 8.98661C19.567 9.26398 19.7918 9.48884 20.0692 9.48884Z" fill="currentColor" />
															<path d="M12.0335 20.5714C15.6943 20.5714 18.9426 18.2053 20.1168 14.7338C20.1884 14.5225 20.1114 14.289 19.9284 14.161C19.746 14.034 19.5003 14.0418 19.3257 14.1821C18.2432 15.0546 16.9371 15.5156 15.5491 15.5156C12.2257 15.5156 9.48884 12.8122 9.48884 9.48886C9.48884 7.41079 10.5773 5.47137 12.3449 4.35752C12.5342 4.23832 12.6 4.00733 12.5377 3.79251C12.4759 3.57768 12.2571 3.42859 12.0335 3.42859C7.32556 3.42859 3.42857 7.29209 3.42857 12C3.42857 16.7079 7.32556 20.5714 12.0335 20.5714Z" fill="currentColor" />
															<path d="M13.0379 7.47998C13.8688 7.47998 14.5446 8.15585 14.5446 8.98668C14.5446 9.26428 14.7693 9.48891 15.0469 9.48891C15.3245 9.48891 15.5491 9.26428 15.5491 8.98668C15.5491 8.15585 16.225 7.47998 17.0558 7.47998C17.3334 7.47998 17.558 7.25535 17.558 6.97775C17.558 6.70015 17.3334 6.47552 17.0558 6.47552C16.225 6.47552 15.5491 5.76616 15.5491 4.93534C15.5491 4.65774 15.3245 4.43311 15.0469 4.43311C14.7693 4.43311 14.5446 4.65774 14.5446 4.93534C14.5446 5.76616 13.8688 6.47552 13.0379 6.47552C12.7603 6.47552 12.5357 6.70015 12.5357 6.97775C12.5357 7.25535 12.7603 7.47998 13.0379 7.47998Z" fill="currentColor" />
														</svg>
													</span>
													<!--end::Svg Icon-->
												</span>
												<span class="menu-title">Dark</span>
											</a>
										</div>
										<!--end::Menu item-->
										<!--begin::Menu item-->
										<div class="menu-item px-3 my-0">
											<a href="#" class="menu-link px-3 py-2" data-kt-element="mode" data-kt-value="system">
												<span class="menu-icon" data-kt-element="icon">
													<!--begin::Svg Icon | path: icons/duotune/general/gen062.svg-->
													<span class="svg-icon svg-icon-3">
														<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
															<path fill-rule="evenodd" clip-rule="evenodd" d="M1.34375 3.9463V15.2178C1.34375 16.119 2.08105 16.8563 2.98219 16.8563H8.65093V19.4594H6.15702C5.38853 19.4594 4.75981 19.9617 4.75981 20.5757V21.6921H19.2403V20.5757C19.2403 19.9617 18.6116 19.4594 17.8431 19.4594H15.3492V16.8563H21.0179C21.919 16.8563 22.6562 16.119 22.6562 15.2178V3.9463C22.6562 3.04516 21.9189 2.30786 21.0179 2.30786H2.98219C2.08105 2.30786 1.34375 3.04516 1.34375 3.9463ZM12.9034 9.9016C13.241 9.98792 13.5597 10.1216 13.852 10.2949L15.0393 9.4353L15.9893 10.3853L15.1297 11.5727C15.303 11.865 15.4366 12.1837 15.523 12.5212L16.97 12.7528V13.4089H13.9851C13.9766 12.3198 13.0912 11.4394 12 11.4394C10.9089 11.4394 10.0235 12.3198 10.015 13.4089H7.03006V12.7528L8.47712 12.5211C8.56345 12.1836 8.69703 11.8649 8.87037 11.5727L8.0107 10.3853L8.96078 9.4353L10.148 10.2949C10.4404 10.1215 10.759 9.98788 11.0966 9.9016L11.3282 8.45467H12.6718L12.9034 9.9016ZM16.1353 7.93758C15.6779 7.93758 15.3071 7.56681 15.3071 7.1094C15.3071 6.652 15.6779 6.28122 16.1353 6.28122C16.5926 6.28122 16.9634 6.652 16.9634 7.1094C16.9634 7.56681 16.5926 7.93758 16.1353 7.93758ZM2.71385 14.0964V3.90518C2.71385 3.78023 2.81612 3.67796 2.94107 3.67796H21.0589C21.1839 3.67796 21.2861 3.78023 21.2861 3.90518V14.0964C15.0954 14.0964 8.90462 14.0964 2.71385 14.0964Z" fill="currentColor" />
														</svg>
													</span>
													<!--end::Svg Icon-->
												</span>
												<span class="menu-title">System</span>
											</a>
										</div>
										<!--end::Menu item-->
									</div>
									<!--end::Menu-->
								</div>
								<!--end::Theme mode-->
								<!--begin::User menu-->
								<div class="app-navbar-item ms-1 ms-md-3" id="kt_header_user_menu_toggle">
									<!--begin::Menu wrapper-->
									<div class="cursor-pointer symbol symbol-30px symbol-md-40px" data-kt-menu-trigger="{default: 'click', lg: 'hover'}" data-kt-menu-attach="parent" data-kt-menu-placement="bottom-end">
										<img src="assets/media/avatars/300-1.jpg" alt="user" />
									</div>
									<!--begin::User account menu-->
									<div class="menu menu-sub menu-sub-dropdown menu-column menu-rounded menu-gray-800 menu-state-bg menu-state-color fw-semibold py-4 fs-6 w-275px" data-kt-menu="true">
										
									
									
										<div class="menu-item px-5">
											<a href="vendor_admin/logout" class="menu-link px-5">Sign Out</a>
										</div>
										<!--end::Menu item-->
									</div>
									<!--end::User account menu-->
									<!--end::Menu wrapper-->
								</div>
								<!--end::User menu-->
								<!--begin::Header menu toggle-->
								<div class="app-navbar-item d-lg-none ms-2 me-n3" title="Show header menu">
									<div class="btn btn-icon btn-active-color-primary w-30px h-30px w-md-35px h-md-35px" id="kt_app_header_menu_toggle">
										<!--begin::Svg Icon | path: icons/duotune/text/txt001.svg-->
										<span class="svg-icon svg-icon-2 svg-icon-md-1">
											<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
												<path d="M13 11H3C2.4 11 2 10.6 2 10V9C2 8.4 2.4 8 3 8H13C13.6 8 14 8.4 14 9V10C14 10.6 13.6 11 13 11ZM22 5V4C22 3.4 21.6 3 21 3H3C2.4 3 2 3.4 2 4V5C2 5.6 2.4 6 3 6H21C21.6 6 22 5.6 22 5Z" fill="currentColor" />
												<path opacity="0.3" d="M21 16H3C2.4 16 2 15.6 2 15V14C2 13.4 2.4 13 3 13H21C21.6 13 22 13.4 22 14V15C22 15.6 21.6 16 21 16ZM14 20V19C14 18.4 13.6 18 13 18H3C2.4 18 2 18.4 2 19V20C2 20.6 2.4 21 3 21H13C13.6 21 14 20.6 14 20Z" fill="currentColor" />
											</svg>	
										</span>
										<!--end::Svg Icon-->
									</div>
								</div>
								<!--end::Header menu toggle-->
							</div>
							<!--end::Navbar-->
						</div>
						<!--end::Header wrapper-->
					</div>
					<!--end::Header container-->
				</div>
				<!--end::Header-->
				<!--begin::Wrapper-->
				<div class="app-wrapper flex-column flex-row-fluid" id="kt_app_wrapper">
					<!--begin::Sidebar-->
				<div id="kt_app_sidebar" class="app-sidebar flex-column" data-kt-drawer="true" data-kt-drawer-name="app-sidebar" data-kt-drawer-activate="{default: true, lg: false}" data-kt-drawer-overlay="true" data-kt-drawer-width="225px" data-kt-drawer-direction="start" data-kt-drawer-toggle="#kt_app_sidebar_mobile_toggle">
						<!--begin::Logo-->
						<div class="app-sidebar-logo px-6" id="kt_app_sidebar_logo">
							<!--begin::Logo image-->
							<a href="../../demo1/dist/index.html">
								<img alt="Logo" src="assets/media/logos/LOGO.png" class="h-25px app-sidebar-logo-default" />
								<img alt="Logo" src="assets/media/logos/default-small.svg" class="h-20px app-sidebar-logo-minimize" />
							</a>
							<!--end::Logo image-->
							<!--begin::Sidebar toggle-->
							<div id="kt_app_sidebar_toggle" class="app-sidebar-toggle btn btn-icon btn-shadow btn-sm btn-color-muted btn-active-color-primary body-bg h-30px w-30px position-absolute top-50 start-100 translate-middle rotate" data-kt-toggle="true" data-kt-toggle-state="active" data-kt-toggle-target="body" data-kt-toggle-name="app-sidebar-minimize">
								<!--begin::Svg Icon | path: icons/duotune/arrows/arr079.svg-->
								<span class="svg-icon svg-icon-2 rotate-180">
									<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
										<path opacity="0.5" d="M14.2657 11.4343L18.45 7.25C18.8642 6.83579 18.8642 6.16421 18.45 5.75C18.0358 5.33579 17.3642 5.33579 16.95 5.75L11.4071 11.2929C11.0166 11.6834 11.0166 12.3166 11.4071 12.7071L16.95 18.25C17.3642 18.6642 18.0358 18.6642 18.45 18.25C18.8642 17.8358 18.8642 17.1642 18.45 16.75L14.2657 12.5657C13.9533 12.2533 13.9533 11.7467 14.2657 11.4343Z" fill="currentColor" />
										<path d="M8.2657 11.4343L12.45 7.25C12.8642 6.83579 12.8642 6.16421 12.45 5.75C12.0358 5.33579 11.3642 5.33579 10.95 5.75L5.40712 11.2929C5.01659 11.6834 5.01659 12.3166 5.40712 12.7071L10.95 18.25C11.3642 18.6642 12.0358 18.6642 12.45 18.25C12.8642 17.8358 12.8642 17.1642 12.45 16.75L8.2657 12.5657C7.95328 12.2533 7.95328 11.7467 8.2657 11.4343Z" fill="currentColor" />
									</svg>
								</span>
								<!--end::Svg Icon-->
							</div>
							<!--end::Sidebar toggle-->
						</div>
						<!--end::Logo-->
						<!--begin::sidebar menu-->
						<?php include "sidebar.php"; ?>
						<!--end::sidebar menu-->
						<!--begin::Footer-->
						
						<!--end::Footer-->
					</div>
					<!--end::Sidebar-->
					<!--begin::Main-->
					<div class="app-main flex-column flex-row-fluid" id="kt_app_main">
						<!--begin::Content wrapper-->
						<div class="d-flex flex-column flex-column-fluid">
							<!--begin::Toolbar-->
							<div id="kt_app_toolbar" class="app-toolbar py-3 py-lg-6">
								<!--begin::Toolbar container-->
								<div id="kt_app_toolbar_container" class="app-container container-xxl d-flex flex-stack">
									<!--begin::Page title-->
									<div class="page-title d-flex flex-column justify-content-center flex-wrap me-3">
										<!--begin::Title-->
										<h1 class="page-heading d-flex text-dark fw-bold fs-3 flex-column justify-content-center my-0">Customer Details</h1>
										<!--end::Title-->
										<!--begin::Breadcrumb-->
										<ul class="breadcrumb breadcrumb-separatorless fw-semibold fs-7 my-0 pt-1">
											<!--begin::Item-->
											<li class="breadcrumb-item text-muted">
												<a href="../../demo1/dist/index.html" class="text-muted text-hover-primary">Home</a>
											</li>
											<!--end::Item-->
											<!--begin::Item-->
											<li class="breadcrumb-item">
												<span class="bullet bg-gray-400 w-5px h-2px"></span>
											</li>
											<!--end::Item-->
											<!--begin::Item-->
											<li class="breadcrumb-item text-muted">Customers</li>
											<!--end::Item-->
										</ul>
										<!--end::Breadcrumb-->
									</div>
									<!--end::Page title-->
									<!--begin::Actions-->
									
									<!--end::Actions-->
								</div>
								<!--end::Toolbar container-->
							</div>
							<!--end::Toolbar-->
							<!--begin::Content-->
							<div id="kt_app_content" class="app-content flex-column-fluid">
								<!--begin::Content container-->
								<div id="kt_app_content_container" class="app-container container-xxl">
									<!--begin::Layout-->
									<div class="d-flex flex-column flex-xl-row">
										<!--begin::Sidebar-->
										<div class="flex-column flex-lg-row-auto w-100 w-xl-350px mb-10">
											<!--begin::Card-->
											<div class="card mb-5 mb-xl-8">
    <!--begin::Card body-->
    <div class="card-body pt-15">
        <!--begin::Summary-->
        <div class="d-flex flex-center flex-column mb-5">
            <!--begin::Avatar-->
            <div class="symbol symbol-100px symbol-circle mb-7">
                <img src="<?php echo !empty($vendor['image']) ? './Images/Vendor/' . $vendor['image'] : 'assets/media/avatars/300-1.jpg'; ?>" alt="image" class="vendor-avatar" />
            </div>
            <!--end::Avatar-->
            <!--begin::Name-->
            <a class="fs-3 text-gray-800 text-hover-primary fw-bold mb-1 vendor-name"><?php echo htmlspecialchars($vendor["name"]) ?></a>
            <!--end::Name-->
            <!--begin::Position-->
            <div class="fs-5 fw-semibold text-muted mb-6 vendor-business-type"><?php echo htmlspecialchars($vendor["business_type"]) ?></div>
            <!--end::Position-->
            <!--begin::Info-->
            
            <!--end::Info-->
        </div>
        <!--end::Summary-->
        <!--begin::Details toggle-->
        <div class="d-flex flex-stack fs-4 py-3">
            <div class="fw-bold rotate collapsible" data-bs-toggle="collapse" href="#kt_customer_view_details" role="button" aria-expanded="false" aria-controls="kt_customer_view_details">Details
            <span class="ms-2 rotate-180">
                <!--begin::Svg Icon | path: icons/duotune/arrows/arr072.svg-->
                <span class="svg-icon svg-icon-3">
                    <svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
                        <path d="M11.4343 12.7344L7.25 8.55005C6.83579 8.13583 6.16421 8.13584 5.75 8.55005C5.33579 8.96426 5.33579 9.63583 5.75 10.05L11.2929 15.5929C11.6834 15.9835 12.3166 15.9835 12.7071 15.5929L18.25 10.05C18.6642 9.63584 18.6642 8.96426 18.25 8.55005C17.8358 8.13584 17.1642 8.13584 16.75 8.55005L12.5657 12.7344C12.2533 13.0468 11.7467 13.0468 11.4343 12.7344Z" fill="currentColor" />
                    </svg>
                </span>
                <!--end::Svg Icon-->
            </span></div>
            <span data-bs-toggle="tooltip" data-bs-trigger="hover" title="Edit customer details">
                <a href="#" class="btn btn-sm btn-light-primary" data-bs-toggle="modal" data-bs-target="#kt_modal_update_customer">Edit</a>
            </span>
        </div>
        <!--end::Details toggle-->
        <div class="separator separator-dashed my-3"></div>
        <!--begin::Details content-->
        <div id="kt_customer_view_details" class="collapse">
            <div class="py-5 fs-6">
                <!--begin::Badge-->
               
                <!--begin::Badge-->
                <!--begin::Details item-->
                <div class="fw-bold mt-5">Account ID</div>
                <div class="text-gray-600 vendor-id">ID-<?php echo htmlspecialchars($vendor['id'] ?? '45453423'); ?></div>
                <!--begin::Details item-->
                <!--begin::Details item-->
                <div class="fw-bold mt-5">Email</div>
                <div class="text-gray-600">
                    <a href="mailto:<?php echo htmlspecialchars($vendor['email']); ?>" class="text-gray-600 text-hover-primary vendor-email"><?php echo htmlspecialchars($vendor['email']); ?></a>
                </div>
                <!--begin::Details item-->
                <!--begin::Details item-->
                <div class="fw-bold mt-5">Phone</div>
                <div class="text-gray-600 vendor-phone"><?php echo htmlspecialchars($vendor['phone'] ?? 'Not provided'); ?></div>
                <!--begin::Details item-->
                <!--begin::Details item-->
                <div class="fw-bold mt-5">Company Name</div>
                <div class="text-gray-600 vendor-company"><?php echo htmlspecialchars($vendor['company_name'] ?? 'Not provided'); ?></div>
                <!--begin::Details item-->
                <!--begin::Details item-->
                <div class="fw-bold mt-5">Occupation</div>
                <div class="text-gray-600 vendor-occupation"><?php echo htmlspecialchars($vendor['occupation'] ?? 'Not provided'); ?></div>
                <!--begin::Details item-->
                <!--begin::Details item-->
                <div class="fw-bold mt-5">Address</div>
                <div class="text-gray-600 vendor-address"><?php echo nl2br(htmlspecialchars($vendor['address'] ?? 'Not provided')); ?></div>
                <!--begin::Details item-->
                <!--begin::Details item-->
                <div class="fw-bold mt-5">PAN Number</div>
                <div class="text-gray-600 vendor-pan"><?php echo htmlspecialchars($vendor['pan_num'] ?? 'Not provided'); ?></div>
                <!--begin::Details item-->
                <!--begin::Details item-->
                <div class="fw-bold mt-5">GST Number</div>
                <div class="text-gray-600 vendor-gst"><?php echo htmlspecialchars($vendor['gst_number'] ?? 'Not provided'); ?></div>
                <!--begin::Details item-->
            </div>
        </div>
        <!--end::Details content-->
    </div>
    <!--end::Card body-->
</div>
										
										</div>
										<!--end::Sidebar-->
										<!--begin::Content-->
										<div class="flex-lg-row-fluid ms-lg-15">
											<!--begin:::Tabs-->
											<ul class="nav nav-custom nav-tabs nav-line-tabs nav-line-tabs-2x border-0 fs-4 fw-semibold mb-8">
												<!--begin:::Tab item-->
												<li class="nav-item">
													<a class="nav-link text-active-primary pb-4 active" data-bs-toggle="tab" href="#kt_customer_view_overview_tab">Overview</a>
												</li>
											<li class="nav-item">
													<a class="nav-link text-active-primary pb-4" data-bs-toggle="tab" href="#kt_customer_view_overview_tab02">Order Summary</a>
												</li>
											</ul>
											<!--end:::Tabs-->
											<!--begin:::Tab content-->
											<div class="tab-content" id="myTabContent">

                                           <div class="tab-pane fade" id="kt_customer_view_overview_tab02" role="tabpanel">
    <!--begin::Card-->
    <div class="card pt-4 mb-6 mb-xl-9">
        <!--begin::Card header-->
        <div class="card-header border-0">
            <!--begin::Card title-->
            <div class="card-title">
                <h2>Statistics Overview</h2>
            </div>
            <!--end::Card title-->
        </div>
        <!--end::Card header-->
        
        <!--begin::Card body-->
        <div class="card-body pt-0 pb-5">
            <!--begin::Heading-->
            <h3 class="text-gray-800 fw-bold mb-7">Financial Metrics</h3>
            <!--end::Heading-->
            
            <!--begin::Stats-->
            <div class="d-flex flex-wrap mb-10">
                <!--begin::Stat-->
                <div class="border border-gray-300 border-dashed rounded py-3 px-4 me-4 mb-3">
                    <div class="fs-4 fw-bold text-gray-700">
                        <span class="w-75px">₹<?php echo number_format($total_earnings, 2); ?></span>
                        <!--begin::Svg Icon-->
                        <span class="svg-icon svg-icon-3 svg-icon-success">
                            <svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
                                <rect opacity="0.5" x="13" y="6" width="13" height="2" rx="1" transform="rotate(90 13 6)" fill="currentColor"></rect>
                                <path d="M12.5657 8.56569L16.75 12.75C17.1642 13.1642 17.8358 13.1642 18.25 12.75C18.6642 12.3358 18.6642 11.6642 18.25 11.25L12.7071 5.70711C12.3166 5.31658 11.6834 5.31658 11.2929 5.70711L5.75 11.25C5.33579 11.6642 5.33579 12.3358 5.75 12.75C6.16421 13.1642 6.83579 13.1642 7.25 12.75L11.4343 8.56569C11.7467 8.25327 12.2533 8.25327 12.5657 8.56569Z" fill="currentColor"></path>
                            </svg>
                        </span>
                        <!--end::Svg Icon-->
                    </div>
                    <div class="fw-semibold text-muted">Total Earnings (Paid)</div>
                </div>
                <!--end::Stat-->
                
                <!--begin::Stat-->
                <div class="border border-gray-300 border-dashed rounded py-3 px-4 me-6 mb-3">
                    <div class="fs-4 fw-bold text-gray-700">
                        <span class="w-50px"><?php echo $total_orders; ?></span>
                        <!--begin::Svg Icon-->
                        <span class="svg-icon svg-icon-3 svg-icon-primary">
                            <svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
                                <rect opacity="0.5" x="13" y="6" width="13" height="2" rx="1" transform="rotate(90 13 6)" fill="currentColor"></rect>
                                <path d="M12.5657 8.56569L16.75 12.75C17.1642 13.1642 17.8358 13.1642 18.25 12.75C18.6642 12.3358 18.6642 11.6642 18.25 11.25L12.7071 5.70711C12.3166 5.31658 11.6834 5.31658 11.2929 5.70711L5.75 11.25C5.33579 11.6642 5.33579 12.3358 5.75 12.75C6.16421 13.1642 6.83579 13.1642 7.25 12.75L11.4343 8.56569C11.7467 8.25327 12.2533 8.25327 12.5657 8.56569Z" fill="currentColor"></path>
                            </svg>
                        </span>
                        <!--end::Svg Icon-->
                    </div>
                    <div class="fw-semibold text-muted">Total Orders</div>
                </div>
                <!--end::Stat-->
                
                <!--begin::Stat-->
                <div class="border border-gray-300 border-dashed rounded py-3 px-4 me-6 mb-3">
                    <div class="fs-4 fw-bold text-gray-700">
                        <span class="w-50px"><?php echo $total_products; ?></span>
                    </div>
                    <div class="fw-semibold text-muted">Total Products</div>
                </div>
                <!--end::Stat-->
                
                <!--begin::Stat-->
                <div class="border border-gray-300 border-dashed rounded py-3 px-4 mb-3">
                    <div class="fs-4 fw-bold text-gray-700">
                        <span class="w-75px">₹<?php echo number_format($pending_earnings, 2); ?></span>
                        <!--begin::Svg Icon-->
                        <span class="svg-icon svg-icon-3 svg-icon-warning">
                            <svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
                                <rect opacity="0.5" x="11" y="18" width="13" height="2" rx="1" transform="rotate(-90 11 18)" fill="currentColor"></rect>
                                <path d="M11.4343 15.4343L7.25 11.25C6.83579 10.8358 6.16421 10.8358 5.75 11.25C5.33579 11.6642 5.33579 12.3358 5.75 12.75L11.2929 18.2929C11.6834 18.6834 12.3166 18.6834 12.7071 18.2929L18.25 12.75C18.6642 12.3358 18.6642 11.6642 18.25 11.25C17.8358 10.8358 17.1642 10.8358 16.75 11.25L12.5657 15.4343C12.2533 15.7467 11.7467 15.7467 11.4343 15.4343Z" fill="currentColor"></path>
                            </svg>
                        </span>
                        <!--end::Svg Icon-->
                    </div>
                    <div class="fw-semibold text-muted">Pending Earnings</div>
                </div>
                <!--end::Stat-->
            </div>
            <!--end::Stats-->
            
            <!--begin::Heading-->
            <h3 class="text-gray-800 fw-bold mb-7">Product Performance</h3>
            <!--end::Heading-->
            
            <!--begin::Stats-->
            <div class="d-flex flex-wrap">
                <!--begin::Stat-->
                <div class="border border-gray-300 border-dashed rounded py-3 px-4 me-6 mb-3">
                    <div class="fs-4 fw-bold text-gray-700">
                        <span class="w-50px"><?php echo $ordered_products; ?></span>
                        <!--begin::Svg Icon-->
                        <span class="svg-icon svg-icon-3 svg-icon-success">
                            <svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
                                <rect opacity="0.5" x="13" y="6" width="13" height="2" rx="1" transform="rotate(90 13 6)" fill="currentColor"></rect>
                                <path d="M12.5657 8.56569L16.75 12.75C17.1642 13.1642 17.8358 13.1642 18.25 12.75C18.6642 12.3358 18.6642 11.6642 18.25 11.25L12.7071 5.70711C12.3166 5.31658 11.6834 5.31658 11.2929 5.70711L5.75 11.25C5.33579 11.6642 5.33579 12.3358 5.75 12.75C6.16421 13.1642 6.83579 13.1642 7.25 12.75L11.4343 8.56569C11.7467 8.25327 12.2533 8.25327 12.5657 8.56569Z" fill="currentColor"></path>
                            </svg>
                        </span>
                        <!--end::Svg Icon-->
                    </div>
                    <div class="fw-semibold text-muted">Ordered Products</div>
                </div>
                <!--end::Stat-->
                
                <!--begin::Stat-->
                <div class="border border-gray-300 border-dashed rounded py-3 px-4 me-6 mb-3">
                    <div class="fs-4 fw-bold text-gray-700">
                        <span class="w-50px"><?php echo $unordered_products; ?></span>
                        <!--begin::Svg Icon-->
                        <span class="svg-icon svg-icon-3 svg-icon-danger">
                            <svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
                                <rect opacity="0.5" x="11" y="18" width="13" height="2" rx="1" transform="rotate(-90 11 18)" fill="currentColor"></rect>
                                <path d="M11.4343 15.4343L7.25 11.25C6.83579 10.8358 6.16421 10.8358 5.75 11.25C5.33579 11.6642 5.33579 12.3358 5.75 12.75L11.2929 18.2929C11.6834 18.6834 12.3166 18.6834 12.7071 18.2929L18.25 12.75C18.6642 12.3358 18.6642 11.6642 18.25 11.25C17.8358 10.8358 17.1642 10.8358 16.75 11.25L12.5657 15.4343C12.2533 15.7467 11.7467 15.7467 11.4343 15.4343Z" fill="currentColor"></path>
                            </svg>
                        </span>
                        <!--end::Svg Icon-->
                    </div>
                    <div class="fw-semibold text-muted">Unordered Products</div>
                </div>
                <!--end::Stat-->
                
                <!--begin::Stat-->
                <div class="border border-gray-300 border-dashed rounded py-3 px-4 mb-3">
                    <div class="fs-4 fw-bold text-gray-700">
                        <span class="w-50px">
                            <?php 
                            $success_rate = $total_products > 0 ? round(($ordered_products / $total_products) * 100, 1) : 0;
                            echo $success_rate . '%'; 
                            ?>
                        </span>
                    </div>
                    <div class="fw-semibold text-muted">Product Order Rate</div>
                </div>
                <!--end::Stat-->
            </div>
            <!--end::Stats-->
        </div>
        <!--end::Card body-->
    </div>
    <!--end::Card-->
</div>
												<!--begin:::Tab pane-->
												<div class="tab-pane fade show active" id="kt_customer_view_overview_tab" role="tabpanel">
													
												
<?php
// Get vendor details
$vendor_sql = "SELECT * FROM vendors WHERE id = ?";
$vendor_stmt = mysqli_prepare($con, $vendor_sql);
mysqli_stmt_bind_param($vendor_stmt, "i", $vendor_id);
mysqli_stmt_execute($vendor_stmt);
$vendor_result = mysqli_stmt_get_result($vendor_stmt);
$vendor = mysqli_fetch_assoc($vendor_result);

if (!$vendor) {
    echo "Vendor not found";
    exit;
}

// Get approved products with delete request status for this vendor
$approved_sql = "SELECT p.*, 
                 pdr.status as delete_request_status 
                 FROM products p
                 LEFT JOIN product_delete_requests pdr ON p.pid = pdr.product_id AND pdr.vendor_id = ?
                 WHERE p.vendor_id = ? AND p.status = 'approved' 
                 ORDER BY p.insertTime DESC";
$approved_stmt = mysqli_prepare($con, $approved_sql);
mysqli_stmt_bind_param($approved_stmt, "ii", $vendor_id, $vendor_id);
mysqli_stmt_execute($approved_stmt);
$approved_products = mysqli_fetch_all(mysqli_stmt_get_result($approved_stmt), MYSQLI_ASSOC);

// Get pending products for this vendor
$pending_sql = "SELECT * FROM products WHERE vendor_id = ? AND status = 'pending' ORDER BY insertTime DESC";
$pending_stmt = mysqli_prepare($con, $pending_sql);
mysqli_stmt_bind_param($pending_stmt, "i", $vendor_id);
mysqli_stmt_execute($pending_stmt);
$pending_products = mysqli_fetch_all(mysqli_stmt_get_result($pending_stmt), MYSQLI_ASSOC);
?>

<div class="card pt-2 mb-6 mb-xl-9">

<div class="card-header border-0 align-items-center">
    <!--begin::Title-->
    <div class="card-title">
        <h2 class="mb-0">Products</h2>
    </div>
    <!--end::Title-->

    <!--begin::Toolbar-->
    <div class="card-toolbar flex-row-fluid d-flex justify-content-center">
        <!--begin::Tab nav-->
        <ul class="nav nav-stretch fs-5 fw-semibold nav-line-tabs nav-line-tabs-2x border-transparent" role="tablist">
            <li class="nav-item" role="presentation">
                <a id="kt_approved_tab" class="nav-link text-active-primary active" data-bs-toggle="tab" role="tab" href="#kt_approved_products">
                    Approved
                </a>
            </li>
            <li class="nav-item" role="presentation">
                <a id="kt_requested_tab" class="nav-link text-active-primary ms-3" data-bs-toggle="tab" role="tab" href="#kt_requested_products">
                    Requested
                </a>
            </li>
        </ul>
        <!--end::Tab nav-->
    </div>
    <!--end::Toolbar-->

    <!--begin::Add Product button-->
    <div class="card-toolbar">
        <a href="vendor_admin/add-product.php" class="btn btn-sm btn-primary">
            <i class="bi bi-plus-circle me-1"></i> Add Product
        </a>
    </div>
    <!--end::Add Product button-->
</div>

    <!--end::Card header-->
    <!--begin::Card body-->
    <div class="card-body pt-0">
        <!--begin::Tab Content-->
        <div id="kt_products_tab_content" class="tab-content">
            <!--begin::Approved Products Tab-->
            <div id="kt_approved_products" class="py-0 tab-pane fade show active" role="tabpanel">
                <!--begin::Table-->
                <table class="table align-middle table-row-dashed fs-6 fw-bold gy-5">
                    <!--begin::Thead-->
                    <thead class="border-bottom border-gray-200 fs-7 text-uppercase fw-bold">
                        <tr class="text-start text-muted gs-0">
                            <th class="min-w-100px">Product ID</th>
                            <th class="min-w-150px">Product Name</th>
                            <th class="min-w-100px">Price</th>
                            <th class="min-w-100px">Status</th>
                            <th class="min-w-125px">Date Added</th>
                            <th class="min-w-150px text-end pe-7">Actions</th>
                        </tr>
                    </thead>
                    <!--end::Thead-->
                    <!--begin::Tbody-->
                    <tbody class="fs-6 fw-semibold text-gray-600">
                        <?php foreach ($approved_products as $product): ?>
                        <tr>
                            <td>
                                <span class="text-gray-600"><?php echo htmlspecialchars($product['pid']); ?></span>
                            </td>
                            <td>
                                <span class="text-gray-800"><?php echo htmlspecialchars($product['pname']); ?></span>
                            </td>
                            <td class="text-success">
                                $<?php echo number_format($product['customer_final_price'], 2); ?>
                            </td>
                            <td>
                                <span class="badge badge-light-success">Approved</span>
                            </td>
                            <td><?php echo date('M d, Y', strtotime($product['insertTime'])); ?></td>
                            <td class="text-end">
    <!-- <a href="edit-product.php?id=<?php echo $product['pid']; ?>" class="btn btn-sm btn-primary me-2">Edit</a> -->
    <?php if ($product['delete_request_status'] === 'approved'): ?>
        <button class="btn btn-sm btn-danger" onclick="deleteApprovedProduct(<?php echo $product['pid']; ?>, '<?php echo htmlspecialchars($product['pname'], ENT_QUOTES); ?>')">
            <i class="fas fa-trash"></i> 
        </button>
    <?php elseif ($product['delete_request_status'] === 'pending'): ?>
        <button class="btn btn-sm btn-warning" disabled>
            <i class="fas fa-clock"></i> Pending
        </button>
    <?php else: ?>
        <button class="btn btn-sm btn-danger" onclick="requestDelete(<?php echo $product['pid']; ?>, '<?php echo htmlspecialchars($product['pname'], ENT_QUOTES); ?>')">
            Delete
        </button>
    <?php endif; ?>
</td>
                        </tr>
                        <?php endforeach; ?>
                        <?php if (empty($approved_products)): ?>
                        <tr>
                            <td colspan="6" class="text-center text-muted">No approved products found</td>
                        </tr>
                        <?php endif; ?>
                    </tbody>
                    <!--end::Tbody-->
                </table>
                <!--end::Table-->
            </div>
            <!--end::Approved Products Tab-->
            
            <!--begin::Requested Products Tab-->
            <div id="kt_requested_products" class="py-0 tab-pane fade" role="tabpanel">
                <!--begin::Table-->
                <table class="table align-middle table-row-dashed fs-6 fw-bold gy-5">
                    <!--begin::Thead-->
                    <thead class="border-bottom border-gray-200 fs-7 text-uppercase fw-bold">
                        <tr class="text-start text-muted gs-0">
                            <th class="min-w-100px">Product ID</th>
                            <th class="min-w-150px">Product Name</th>
                            <th class="min-w-100px">Price</th>
                            <th class="min-w-100px">Status</th>
                            <th class="min-w-125px">Date Requested</th>
                        </tr>
                    </thead>
                    <!--end::Thead-->
                    <!--begin::Tbody-->
                    <tbody class="fs-6 fw-semibold text-gray-600">
                        <?php foreach ($pending_products as $product): ?>
                        <tr>
                            <td>
                                <span class="text-gray-600"><?php echo htmlspecialchars($product['pid']); ?></span>
                            </td>
                            <td>
                                <span class="text-gray-800"><?php echo htmlspecialchars($product['pname']); ?></span>
                            </td>
                            <td class="text-primary">
                                $<?php echo number_format($product['customer_final_price'], 2); ?>
                            </td>
                            <td>
                                <span class="badge badge-light-warning">Pending</span>
                            </td>
                            <td><?php echo date('M d, Y', strtotime($product['insertTime'])); ?></td>
                        </tr>
                        <?php endforeach; ?>
                        <?php if (empty($pending_products)): ?>
                        <tr>
                            <td colspan="5" class="text-center text-muted">No pending products found</td>
                        </tr>
                        <?php endif; ?>
                    </tbody>
                    <!--end::Tbody-->
                </table>
                <!--end::Table-->
            </div>
            <!--end::Requested Products Tab-->
        </div>
        <!--end::Tab Content-->
    </div>
    <!--end::Card body-->
</div>

<!-- Delete Request Modal -->
<div class="modal fade" id="deleteRequestModal" tabindex="-1" aria-hidden="true">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <h5 class="modal-title">Request Product Deletion</h5>
                <button type="button" class="btn-close" data-bs-dismiss="modal"></button>
            </div>
            <div class="modal-body">
                <form id="deleteRequestForm">
                    <input type="hidden" id="delete_product_id" name="product_id">
                    <input type="hidden" name="vendor_id" value="<?php echo $vendor_id; ?>">
                    <div class="mb-3">
                        <label class="form-label">Product Name:</label>
                        <input type="text" id="delete_product_name" class="form-control" readonly>
                    </div>
                    <div class="mb-3">
                        <label for="delete_reason" class="form-label">Reason for deletion:</label>
                        <textarea class="form-control" id="delete_reason" name="reason" rows="3" required></textarea>
                    </div>
                </form>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Cancel</button>
                <button type="button" class="btn btn-danger" onclick="submitDeleteRequest()">Request Deletion</button>
            </div>
        </div>
    </div>
</div>


													<!--end::Card-->
												</div>
												<!--end:::Tab pane-->
												<!--begin:::Tab pane-->
												<div class="tab-pane fade" id="kt_customer_view_overview_events_and_logs_tab" role="tabpanel">
													<!--begin::Card-->
													<div class="card pt-4 mb-6 mb-xl-9">
														<!--begin::Card header-->
														<div class="card-header border-0">
															<!--begin::Card title-->
															<div class="card-title">
																<h2>Logs</h2>
															</div>
															<!--end::Card title-->
															<!--begin::Card toolbar-->
															<div class="card-toolbar">
																<!--begin::Button-->
																<button type="button" class="btn btn-sm btn-light-primary">
																<!--begin::Svg Icon | path: icons/duotune/files/fil021.svg-->
																<span class="svg-icon svg-icon-3">
																	<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
																		<path opacity="0.3" d="M19 15C20.7 15 22 13.7 22 12C22 10.3 20.7 9 19 9C18.9 9 18.9 9 18.8 9C18.9 8.7 19 8.3 19 8C19 6.3 17.7 5 16 5C15.4 5 14.8 5.2 14.3 5.5C13.4 4 11.8 3 10 3C7.2 3 5 5.2 5 8C5 8.3 5 8.7 5.1 9H5C3.3 9 2 10.3 2 12C2 13.7 3.3 15 5 15H19Z" fill="currentColor" />
																		<path d="M13 17.4V12C13 11.4 12.6 11 12 11C11.4 11 11 11.4 11 12V17.4H13Z" fill="currentColor" />
																		<path opacity="0.3" d="M8 17.4H16L12.7 20.7C12.3 21.1 11.7 21.1 11.3 20.7L8 17.4Z" fill="currentColor" />
																	</svg>
																</span>
																<!--end::Svg Icon-->Download Report</button>
																<!--end::Button-->
															</div>
															<!--end::Card toolbar-->
														</div>
														<!--end::Card header-->
														<!--begin::Card body-->
														<div class="card-body py-0">
															<!--begin::Table wrapper-->
															<div class="table-responsive">
																<!--begin::Table-->
																<table class="table align-middle table-row-dashed fw-semibold text-gray-600 fs-6 gy-5" id="kt_table_customers_logs">
																	<!--begin::Table body-->
																	<tbody>
																		<!--begin::Table row-->
																		<tr>
																			<!--begin::Badge=-->
																			<td class="min-w-70px">
																				<div class="badge badge-light-warning">404 WRN</div>
																			</td>
																			<!--end::Badge=-->
																			<!--begin::Status=-->
																			<td>POST /v1/customer/c_637dcbb8a8a21/not_found</td>
																			<!--end::Status=-->
																			<!--begin::Timestamp=-->
																			<td class="pe-0 text-end min-w-200px">10 Nov 2022, 5:30 pm</td>
																			<!--end::Timestamp=-->
																		</tr>
																		<!--end::Table row-->
																		<!--begin::Table row-->
																		<tr>
																			<!--begin::Badge=-->
																			<td class="min-w-70px">
																				<div class="badge badge-light-success">200 OK</div>
																			</td>
																			<!--end::Badge=-->
																			<!--begin::Status=-->
																			<td>POST /v1/invoices/in_5229_1595/payment</td>
																			<!--end::Status=-->
																			<!--begin::Timestamp=-->
																			<td class="pe-0 text-end min-w-200px">05 May 2022, 9:23 pm</td>
																			<!--end::Timestamp=-->
																		</tr>
																		<!--end::Table row-->
																		<!--begin::Table row-->
																		<tr>
																			<!--begin::Badge=-->
																			<td class="min-w-70px">
																				<div class="badge badge-light-danger">500 ERR</div>
																			</td>
																			<!--end::Badge=-->
																			<!--begin::Status=-->
																			<td>POST /v1/invoice/in_1430_9254/invalid</td>
																			<!--end::Status=-->
																			<!--begin::Timestamp=-->
																			<td class="pe-0 text-end min-w-200px">25 Jul 2022, 10:30 am</td>
																			<!--end::Timestamp=-->
																		</tr>
																		<!--end::Table row-->
																		<!--begin::Table row-->
																		<tr>
																			<!--begin::Badge=-->
																			<td class="min-w-70px">
																				<div class="badge badge-light-danger">500 ERR</div>
																			</td>
																			<!--end::Badge=-->
																			<!--begin::Status=-->
																			<td>POST /v1/invoice/in_3140_8823/invalid</td>
																			<!--end::Status=-->
																			<!--begin::Timestamp=-->
																			<td class="pe-0 text-end min-w-200px">20 Jun 2022, 9:23 pm</td>
																			<!--end::Timestamp=-->
																		</tr>
																		<!--end::Table row-->
																		<!--begin::Table row-->
																		<tr>
																			<!--begin::Badge=-->
																			<td class="min-w-70px">
																				<div class="badge badge-light-danger">500 ERR</div>
																			</td>
																			<!--end::Badge=-->
																			<!--begin::Status=-->
																			<td>POST /v1/invoice/in_8524_8737/invalid</td>
																			<!--end::Status=-->
																			<!--begin::Timestamp=-->
																			<td class="pe-0 text-end min-w-200px">24 Jun 2022, 6:43 am</td>
																			<!--end::Timestamp=-->
																		</tr>
																		<!--end::Table row-->
																		<!--begin::Table row-->
																		<tr>
																			<!--begin::Badge=-->
																			<td class="min-w-70px">
																				<div class="badge badge-light-success">200 OK</div>
																			</td>
																			<!--end::Badge=-->
																			<!--begin::Status=-->
																			<td>POST /v1/invoices/in_3533_8369/payment</td>
																			<!--end::Status=-->
																			<!--begin::Timestamp=-->
																			<td class="pe-0 text-end min-w-200px">19 Aug 2022, 9:23 pm</td>
																			<!--end::Timestamp=-->
																		</tr>
																		<!--end::Table row-->
																		<!--begin::Table row-->
																		<tr>
																			<!--begin::Badge=-->
																			<td class="min-w-70px">
																				<div class="badge badge-light-danger">500 ERR</div>
																			</td>
																			<!--end::Badge=-->
																			<!--begin::Status=-->
																			<td>POST /v1/invoice/in_8524_8737/invalid</td>
																			<!--end::Status=-->
																			<!--begin::Timestamp=-->
																			<td class="pe-0 text-end min-w-200px">25 Oct 2022, 5:20 pm</td>
																			<!--end::Timestamp=-->
																		</tr>
																		<!--end::Table row-->
																		<!--begin::Table row-->
																		<tr>
																			<!--begin::Badge=-->
																			<td class="min-w-70px">
																				<div class="badge badge-light-warning">404 WRN</div>
																			</td>
																			<!--end::Badge=-->
																			<!--begin::Status=-->
																			<td>POST /v1/customer/c_637dcbb8a8a21/not_found</td>
																			<!--end::Status=-->
																			<!--begin::Timestamp=-->
																			<td class="pe-0 text-end min-w-200px">19 Aug 2022, 9:23 pm</td>
																			<!--end::Timestamp=-->
																		</tr>
																		<!--end::Table row-->
																		<!--begin::Table row-->
																		<tr>
																			<!--begin::Badge=-->
																			<td class="min-w-70px">
																				<div class="badge badge-light-success">200 OK</div>
																			</td>
																			<!--end::Badge=-->
																			<!--begin::Status=-->
																			<td>POST /v1/invoices/in_7803_2570/payment</td>
																			<!--end::Status=-->
																			<!--begin::Timestamp=-->
																			<td class="pe-0 text-end min-w-200px">21 Feb 2022, 5:20 pm</td>
																			<!--end::Timestamp=-->
																		</tr>
																		<!--end::Table row-->
																		<!--begin::Table row-->
																		<tr>
																			<!--begin::Badge=-->
																			<td class="min-w-70px">
																				<div class="badge badge-light-success">200 OK</div>
																			</td>
																			<!--end::Badge=-->
																			<!--begin::Status=-->
																			<td>POST /v1/invoices/in_3666_7802/payment</td>
																			<!--end::Status=-->
																			<!--begin::Timestamp=-->
																			<td class="pe-0 text-end min-w-200px">15 Apr 2022, 10:10 pm</td>
																			<!--end::Timestamp=-->
																		</tr>
																		<!--end::Table row-->
																	</tbody>
																	<!--end::Table body-->
																</table>
																<!--end::Table-->
															</div>
															<!--end::Table wrapper-->
														</div>
														<!--end::Card body-->
													</div>
													<!--end::Card-->
													<!--begin::Card-->
													<div class="card pt-4 mb-6 mb-xl-9">
														<!--begin::Card header-->
														<div class="card-header border-0">
															<!--begin::Card title-->
															<div class="card-title">
																<h2>Events</h2>
															</div>
															<!--end::Card title-->
															<!--begin::Card toolbar-->
															<div class="card-toolbar">
																<!--begin::Button-->
																<button type="button" class="btn btn-sm btn-light-primary">
																<!--begin::Svg Icon | path: icons/duotune/files/fil021.svg-->
																<span class="svg-icon svg-icon-3">
																	<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
																		<path opacity="0.3" d="M19 15C20.7 15 22 13.7 22 12C22 10.3 20.7 9 19 9C18.9 9 18.9 9 18.8 9C18.9 8.7 19 8.3 19 8C19 6.3 17.7 5 16 5C15.4 5 14.8 5.2 14.3 5.5C13.4 4 11.8 3 10 3C7.2 3 5 5.2 5 8C5 8.3 5 8.7 5.1 9H5C3.3 9 2 10.3 2 12C2 13.7 3.3 15 5 15H19Z" fill="currentColor" />
																		<path d="M13 17.4V12C13 11.4 12.6 11 12 11C11.4 11 11 11.4 11 12V17.4H13Z" fill="currentColor" />
																		<path opacity="0.3" d="M8 17.4H16L12.7 20.7C12.3 21.1 11.7 21.1 11.3 20.7L8 17.4Z" fill="currentColor" />
																	</svg>
																</span>
																<!--end::Svg Icon-->Download Report</button>
																<!--end::Button-->
															</div>
															<!--end::Card toolbar-->
														</div>
														<!--end::Card header-->
														<!--begin::Card body-->
														<div class="card-body py-0">
															<!--begin::Table-->
															<table class="table align-middle table-row-dashed fs-6 text-gray-600 fw-semibold gy-5" id="kt_table_customers_events">
																<!--begin::Table body-->
																<tbody>
																	<!--begin::Table row-->
																	<tr>
																		<!--begin::Event=-->
																		<td class="min-w-400px">
																		<a href="#" class="text-gray-600 text-hover-primary me-1">Sean Bean</a>has made payment to
																		<a href="#" class="fw-bold text-gray-900 text-hover-primary">#XRS-45670</a></td>
																		<!--end::Event=-->
																		<!--begin::Timestamp=-->
																		<td class="pe-0 text-gray-600 text-end min-w-200px">20 Jun 2022, 10:10 pm</td>
																		<!--end::Timestamp=-->
																	</tr>
																	<!--end::Table row-->
																	<!--begin::Table row-->
																	<tr>
																		<!--begin::Event=-->
																		<td class="min-w-400px">Invoice
																		<a href="#" class="fw-bold text-gray-900 text-hover-primary me-1">#LOP-45640</a>has been
																		<span class="badge badge-light-danger">Declined</span></td>
																		<!--end::Event=-->
																		<!--begin::Timestamp=-->
																		<td class="pe-0 text-gray-600 text-end min-w-200px">05 May 2022, 5:30 pm</td>
																		<!--end::Timestamp=-->
																	</tr>
																	<!--end::Table row-->
																	<!--begin::Table row-->
																	<tr>
																		<!--begin::Event=-->
																		<td class="min-w-400px">Invoice
																		<a href="#" class="fw-bold text-gray-900 text-hover-primary me-1">#KIO-45656</a>status has changed from
																		<span class="badge badge-light-succees me-1">In Transit</span>to
																		<span class="badge badge-light-success">Approved</span></td>
																		<!--end::Event=-->
																		<!--begin::Timestamp=-->
																		<td class="pe-0 text-gray-600 text-end min-w-200px">10 Nov 2022, 6:05 pm</td>
																		<!--end::Timestamp=-->
																	</tr>
																	<!--end::Table row-->
																	<!--begin::Table row-->
																	<tr>
																		<!--begin::Event=-->
																		<td class="min-w-400px">
																		<a href="#" class="text-gray-600 text-hover-primary me-1">Melody Macy</a>has made payment to
																		<a href="#" class="fw-bold text-gray-900 text-hover-primary">#XRS-45670</a></td>
																		<!--end::Event=-->
																		<!--begin::Timestamp=-->
																		<td class="pe-0 text-gray-600 text-end min-w-200px">25 Oct 2022, 2:40 pm</td>
																		<!--end::Timestamp=-->
																	</tr>
																	<!--end::Table row-->
																	<!--begin::Table row-->
																	<tr>
																		<!--begin::Event=-->
																		<td class="min-w-400px">
																		<a href="#" class="text-gray-600 text-hover-primary me-1">Sean Bean</a>has made payment to
																		<a href="#" class="fw-bold text-gray-900 text-hover-primary">#XRS-45670</a></td>
																		<!--end::Event=-->
																		<!--begin::Timestamp=-->
																		<td class="pe-0 text-gray-600 text-end min-w-200px">22 Sep 2022, 9:23 pm</td>
																		<!--end::Timestamp=-->
																	</tr>
																	<!--end::Table row-->
																	<!--begin::Table row-->
																	<tr>
																		<!--begin::Event=-->
																		<td class="min-w-400px">
																		<a href="#" class="text-gray-600 text-hover-primary me-1">Max Smith</a>has made payment to
																		<a href="#" class="fw-bold text-gray-900 text-hover-primary">#SDK-45670</a></td>
																		<!--end::Event=-->
																		<!--begin::Timestamp=-->
																		<td class="pe-0 text-gray-600 text-end min-w-200px">10 Nov 2022, 11:05 am</td>
																		<!--end::Timestamp=-->
																	</tr>
																	<!--end::Table row-->
																	<!--begin::Table row-->
																	<tr>
																		<!--begin::Event=-->
																		<td class="min-w-400px">
																		<a href="#" class="text-gray-600 text-hover-primary me-1">Brian Cox</a>has made payment to
																		<a href="#" class="fw-bold text-gray-900 text-hover-primary">#OLP-45690</a></td>
																		<!--end::Event=-->
																		<!--begin::Timestamp=-->
																		<td class="pe-0 text-gray-600 text-end min-w-200px">10 Nov 2022, 6:43 am</td>
																		<!--end::Timestamp=-->
																	</tr>
																	<!--end::Table row-->
																	<!--begin::Table row-->
																	<tr>
																		<!--begin::Event=-->
																		<td class="min-w-400px">Invoice
																		<a href="#" class="fw-bold text-gray-900 text-hover-primary me-1">#DER-45645</a>status has changed from
																		<span class="badge badge-light-info me-1">In Progress</span>to
																		<span class="badge badge-light-primary">In Transit</span></td>
																		<!--end::Event=-->
																		<!--begin::Timestamp=-->
																		<td class="pe-0 text-gray-600 text-end min-w-200px">20 Dec 2022, 2:40 pm</td>
																		<!--end::Timestamp=-->
																	</tr>
																	<!--end::Table row-->
																	<!--begin::Table row-->
																	<tr>
																		<!--begin::Event=-->
																		<td class="min-w-400px">
																		<a href="#" class="text-gray-600 text-hover-primary me-1">Brian Cox</a>has made payment to
																		<a href="#" class="fw-bold text-gray-900 text-hover-primary">#OLP-45690</a></td>
																		<!--end::Event=-->
																		<!--begin::Timestamp=-->
																		<td class="pe-0 text-gray-600 text-end min-w-200px">20 Dec 2022, 8:43 pm</td>
																		<!--end::Timestamp=-->
																	</tr>
																	<!--end::Table row-->
																	<!--begin::Table row-->
																	<tr>
																		<!--begin::Event=-->
																		<td class="min-w-400px">Invoice
																		<a href="#" class="fw-bold text-gray-900 text-hover-primary me-1">#LOP-45640</a>has been
																		<span class="badge badge-light-danger">Declined</span></td>
																		<!--end::Event=-->
																		<!--begin::Timestamp=-->
																		<td class="pe-0 text-gray-600 text-end min-w-200px">24 Jun 2022, 6:43 am</td>
																		<!--end::Timestamp=-->
																	</tr>
																	<!--end::Table row-->
																</tbody>
																<!--end::Table body-->
															</table>
															<!--end::Table-->
														</div>
														<!--end::Card body-->
													</div>
													<!--end::Card-->
												</div>
												<!--end:::Tab pane-->
												<!--begin:::Tab pane-->
												
												<!--end:::Tab pane-->
											</div>
											<!--end:::Tab content-->
										</div>
										<!--end::Content-->
									</div>
									
<div class="modal fade" id="kt_modal_update_customer" tabindex="-1" aria-hidden="true">
    <!--begin::Modal dialog-->
    <div class="modal-dialog modal-dialog-centered mw-750px">
        <!--begin::Modal content-->
        <div class="modal-content">
            <!--begin::Form-->
            <form class="form" action="#" id="kt_modal_update_customer_form_01" enctype="multipart/form-data">
                <input type="hidden" name="action" value="update_vendor">
                <input type="hidden" name="vendor_id" value="<?php echo $vendor['id']; ?>">
                
                <!--begin::Modal header-->
                <div class="modal-header" id="kt_modal_update_customer_header">
                    <!--begin::Modal title-->
                    <h2 class="fw-bold">Update Customer</h2>
                    <!--end::Modal title-->
                    <!--begin::Close-->
                    <button type="button" class="btn btn-icon btn-sm btn-active-icon-primary" data-bs-dismiss="modal" aria-label="Close">
                        <!--begin::Svg Icon | path: icons/duotune/arrows/arr061.svg-->
                        <span class="svg-icon svg-icon-1">
                            <svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
                                <rect opacity="0.5" x="6" y="17.3137" width="16" height="2" rx="1" transform="rotate(-45 6 17.3137)" fill="currentColor" />
                                <rect x="7.41422" y="6" width="16" height="2" rx="1" transform="rotate(45 7.41422 6)" fill="currentColor" />
                            </svg>
                        </span>
                        <!--end::Svg Icon-->
                    </button>
                    <!--end::Close-->
                </div>
                <!--end::Modal header-->
                
                <!--begin::Modal body-->
                <div class="modal-body py-10 px-lg-17">
                    <!--begin::Scroll-->
                    <div class="d-flex flex-column scroll-y me-n7 pe-7" id="kt_modal_update_customer_scroll" data-kt-scroll="true" data-kt-scroll-activate="{default: false, lg: true}" data-kt-scroll-max-height="auto" data-kt-scroll-dependencies="#kt_modal_update_customer_header" data-kt-scroll-wrappers="#kt_modal_update_customer_scroll" data-kt-scroll-offset="300px">
                        
                        <!--begin::User toggle-->
                        <div class="fw-bold fs-3 rotate collapsible mb-7" data-bs-toggle="collapse" href="#kt_modal_update_customer_user_info" role="button" aria-expanded="false" aria-controls="kt_modal_update_customer_user_info">User Information
                        <span class="ms-2 rotate-180">
                            <!--begin::Svg Icon | path: icons/duotune/arrows/arr072.svg-->
                            <span class="svg-icon svg-icon-3">
                                <svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
                                    <path d="M11.4343 12.7344L7.25 8.55005C6.83579 8.13583 6.16421 8.13584 5.75 8.55005C5.33579 8.96426 5.33579 9.63583 5.75 10.05L11.2929 15.5929C11.6834 15.9835 12.3166 15.9835 12.7071 15.5929L18.25 10.05C18.6642 9.63584 18.6642 8.96426 18.25 8.55005C17.8358 8.13584 17.1642 8.13584 16.75 8.55005L12.5657 12.7344C12.2533 13.0468 11.7467 13.0468 11.4343 12.7344Z" fill="currentColor" />
                                </svg>
                            </span>
                            <!--end::Svg Icon-->
                        </span></div>
                        <!--end::User toggle-->
                        
                        <!--begin::User form-->
                        <div id="kt_modal_update_customer_user_info" class="collapse show">
                            <!--begin::Input group-->
                            <div class="mb-7">
                                <!--begin::Label-->
                                <label class="fs-6 fw-semibold mb-2">
                                    <span>Update Avatar</span>
                                    <i class="fas fa-exclamation-circle ms-1 fs-7" data-bs-toggle="tooltip" title="Allowed file types: png, jpg, jpeg."></i>
                                </label>
                                <!--end::Label-->
                                <!--begin::Image input wrapper-->
                                <div class="mt-1">
                                    <!--begin::Image input-->
                                    <div class="image-input image-input-outline" data-kt-image-input="true" style="background-image: url('assets/media/svg/avatars/blank.svg')">
                                        <!--begin::Preview existing avatar-->
                                        <div class="image-input-wrapper w-125px h-125px" id="vendor-avatar" 
                                            style="background-image: url('<?php echo !empty($vendor['image']) ? './Images/Vendor/' . $vendor['image'] : 'assets/media/avatars/300-1.jpg'; ?>');">
                                        </div>
                                        <!--end::Preview existing avatar-->
                                        <!--begin::Edit-->
                                        <label class="btn btn-icon btn-circle btn-active-color-primary w-25px h-25px bg-body shadow" data-kt-image-input-action="change" data-bs-toggle="tooltip" title="Change avatar">
                                            <i class="bi bi-pencil-fill fs-7"></i>
                                            <!--begin::Inputs-->
                                            <input type="file" name="avatar" accept=".png, .jpg, .jpeg" />
                                            <input type="hidden" name="avatar_remove" />
                                            <!--end::Inputs-->
                                        </label>
                                        <!--end::Edit-->
                                        <!--begin::Cancel-->
                                        <span class="btn btn-icon btn-circle btn-active-color-primary w-25px h-25px bg-body shadow" data-kt-image-input-action="cancel" data-bs-toggle="tooltip" title="Cancel avatar">
                                            <i class="bi bi-x fs-2"></i>
                                        </span>
                                        <!--end::Cancel-->
                                        <!--begin::Remove-->
                                        <span class="btn btn-icon btn-circle btn-active-color-primary w-25px h-25px bg-body shadow" data-kt-image-input-action="remove" data-bs-toggle="tooltip" title="Remove avatar">
                                            <i class="bi bi-x fs-2"></i>
                                        </span>
                                        <!--end::Remove-->
                                    </div>
                                    <!--end::Image input-->
                                </div>
                                <!--end::Image input wrapper-->
                            </div>
                            <!--end::Input group-->
                            
                            <!--begin::Input group - Name & Email-->
                            <div class="fv-row mb-7 row">
                                <div class="col-lg-6">
                                    <!--begin::Label-->
                                    <label class="fs-6 fw-semibold mb-2">Name</label>
                                    <!--end::Label-->
                                    <!--begin::Input-->
                                    <input type="text" class="form-control form-control-solid" placeholder="" name="name" value="<?php echo htmlspecialchars($vendor['name']); ?>" />
                                </div>
                                <div class="col-lg-6">
                                    <!--begin::Label-->
                                    <label class="fs-6 fw-semibold mb-2">
                                        <span>Email</span>
                                        <i class="fas fa-exclamation-circle ms-1 fs-7" data-bs-toggle="tooltip" title="Email address must be active"></i>
                                    </label>
                                    <!--end::Label-->
                                    <!--begin::Input-->
                                    <input type="email" class="form-control form-control-solid" placeholder="" name="email" value="<?php echo htmlspecialchars($vendor['email']); ?>" />
                                    <!--end::Input-->
                                </div>
                            </div>
                            <!--end::Input group-->
                            
                            <!--begin::Input group - Phone & Company Name-->
                            <div class="fv-row mb-7 row">
                                <div class="col-lg-6">
                                    <label class="fs-6 fw-semibold mb-2">Phone</label>
                                    <!--end::Label-->
                                    <!--begin::Input-->
                                    <input class="form-control form-control-solid" placeholder="" name="phone" value="<?php echo htmlspecialchars($vendor['phone']); ?>" />
                                </div>
                                <div class="col-lg-6">
                                    <!--begin::Label-->
                                    <label class="fs-6 fw-semibold mb-2">Company Name</label>
                                    <!--end::Label-->
                                    <!--begin::Input-->
                                    <input type="text" class="form-control form-control-solid" placeholder="" name="company_name" value="<?php echo htmlspecialchars($vendor['company_name']); ?>" />
                                    <!--end::Input-->
                                </div>
                            </div>
                            <!--end::Input group-->
                            
                            <!--begin::Input group - Address (Full Width)-->
                            <div class="fv-row mb-7">
                                <!--begin::Label-->
                                <label class="fs-6 fw-semibold mb-2">Address</label>
                                <!--end::Label-->
                                <!--begin::Input-->
                                <input class="form-control form-control-solid" placeholder="" name="address" value="<?php echo htmlspecialchars($vendor['address']); ?>"/>
                                <!--end::Input-->
                            </div>
                            <!--end::Input group-->
                            
                            <!--begin::Input group - Pincode & City-->
                            <div class="fv-row mb-7 row">
                                <div class="col-lg-6">
                                    <!--begin::Label-->
                                    <label class="fs-6 fw-semibold mb-2">Pincode</label>
                                    <!--end::Label-->
                                    <!--begin::Input-->
                                    <input type="text" class="form-control form-control-solid" placeholder="" name="pincode" value="<?php echo htmlspecialchars($vendor['pincode']); ?>" />
                                </div>
                                <div class="col-lg-6">
                                    <!--begin::Label-->
                                    <label class="fs-6 fw-semibold mb-2">City</label>
                                    <!--end::Label-->
                                    <!--begin::Input-->
                                    <input type="text" class="form-control form-control-solid" placeholder="" name="city" value="<?php echo htmlspecialchars($vendor['city']); ?>" />
                                    <!--end::Input-->
                                </div>
                            </div>
                            <!--end::Input group-->
                            
                            <!--begin::Input group - State & Country-->
                            <div class="fv-row mb-7 row">
                                <div class="col-lg-6">
                                    <!--begin::Label-->
                                    <label class="fs-6 fw-semibold mb-2">State</label>
                                    <!--end::Label-->
                                    <!--begin::Input-->
                                    <input type="text" class="form-control form-control-solid" placeholder="" name="state" value="<?php echo htmlspecialchars($vendor['state']); ?>" />
                                </div>
                                <div class="col-lg-6">
                                    <!--begin::Label-->
                                    <label class="fs-6 fw-semibold mb-2">Country</label>
                                    <!--end::Label-->
                                    <!--begin::Input-->
                                    <input type="text" class="form-control form-control-solid" placeholder="" name="country" value="<?php echo htmlspecialchars($vendor['country']); ?>" />
                                    <!--end::Input-->
                                </div>
                            </div>
                            <!--end::Input group-->
                        </div>
                        <!--end::User form-->
                        
                        <!--begin::Billing toggle-->
                        <div class="fw-bold fs-3 rotate collapsible collapsed mb-7" data-bs-toggle="collapse" href="#kt_modal_update_customer_billing_info" role="button" aria-expanded="false" aria-controls="kt_modal_update_customer_billing_info">More Information
                        <span class="ms-2 rotate-180">
                            <!--begin::Svg Icon | path: icons/duotune/arrows/arr072.svg-->
                            <span class="svg-icon svg-icon-3">
                                <svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
                                    <path d="M11.4343 12.7344L7.25 8.55005C6.83579 8.13583 6.16421 8.13584 5.75 8.55005C5.33579 8.96426 5.33579 9.63583 5.75 10.05L11.2929 15.5929C11.6834 15.9835 12.3166 15.9835 12.7071 15.5929L18.25 10.05C18.6642 9.63584 18.6642 8.96426 18.25 8.55005C17.8358 8.13584 17.1642 8.13584 16.75 8.55005L12.5657 12.7344C12.2533 13.0468 11.7467 13.0468 11.4343 12.7344Z" fill="currentColor" />
                                </svg>
                            </span>
                            <!--end::Svg Icon-->
                        </span></div>
                        <!--end::Billing toggle-->
                        
                        <!--begin::Billing form-->
                        <div id="kt_modal_update_customer_billing_info" class="collapse">
                            <!--begin::Input group - Business Type-->
                          <!-- Row 1: Business Type & Occupation -->
                                <div class="row mb-7">
                                    <div class="col-md-6 fv-row">
                                        <label class="fs-6 fw-semibold mb-2">Business Type</label>
                                        <select class="form-select form-select-solid" 
                                                data-control="select2" 
                                                data-hide-search="true" 
                                                data-placeholder="Select Business Type" 
                                                name="business_type" 
                                                id="kt_vendor_business_type_select">
                                            <option value="">-- Select Business Type --</option>
                                            <option value="Individual" <?php echo ($vendor['business_type'] == 'Individual') ? 'selected' : ''; ?>>Individual</option>
                                            <option value="Proprietorship" <?php echo ($vendor['business_type'] == 'Proprietorship') ? 'selected' : ''; ?>>Proprietorship</option>
                                            <option value="Partnership" <?php echo ($vendor['business_type'] == 'Partnership') ? 'selected' : ''; ?>>Partnership</option>
                                            <option value="Private Limited" <?php echo ($vendor['business_type'] == 'Private Limited') ? 'selected' : ''; ?>>Private Limited</option>
                                            <option value="LLP" <?php echo ($vendor['business_type'] == 'LLP') ? 'selected' : ''; ?>>LLP</option>
                                            <option value="Trust/NGO" <?php echo ($vendor['business_type'] == 'Trust/NGO') ? 'selected' : ''; ?>>Trust/NGO</option>
                                            <option value="Wholesaler" <?php echo ($vendor['business_type'] == 'Wholesaler') ? 'selected' : ''; ?>>Wholesaler</option>
                                            <option value="Retailer" <?php echo ($vendor['business_type'] == 'Retailer') ? 'selected' : ''; ?>>Retailer</option>
                                            <option value="Manufacturer" <?php echo ($vendor['business_type'] == 'Manufacturer') ? 'selected' : ''; ?>>Manufacturer</option>
                                            <option value="Distributor" <?php echo ($vendor['business_type'] == 'Distributor') ? 'selected' : ''; ?>>Distributor</option>
                                        </select>
                                    </div>

                                    <div class="col-md-6 fv-row">
                                        <label class="fs-6 fw-semibold mb-2">Occupation</label>
                                        <select class="form-select form-select-solid"
                                                name="occupation"
                                                data-control="select2"
                                                data-hide-search="true"
                                                data-placeholder="Select Occupation"
                                                required>
                                            <option value="">-- Select Occupation --</option>
                                            <option value="student" <?php echo ($vendor['occupation'] == 'student') ? 'selected' : ''; ?>>Student</option>
                                            <option value="working" <?php echo ($vendor['occupation'] == 'working') ? 'selected' : ''; ?>>Working</option>
                                            <option value="business" <?php echo ($vendor['occupation'] == 'business') ? 'selected' : ''; ?>>Business</option>
                                        </select>
                                    </div>
                                </div>

                                <!-- Row 2: PAN & GST -->
                                <div class="row mb-7">
                                    <div class="col-md-6 fv-row">
                                        <label class="fs-6 fw-semibold mb-2">PAN Number</label>
                                        <input type="text" 
                                            class="form-control form-control-solid" 
                                            name="pan_number" 
                                            placeholder="Enter PAN Number"
                                            value="<?php echo htmlspecialchars($vendor['pan_num']); ?>" />
                                    </div>

                                    <div class="col-md-6 fv-row">
                                        <label class="fs-6 fw-semibold mb-2">GST Number</label>
                                        <input type="text" 
                                            class="form-control form-control-solid" 
                                            name="gst_number" 
                                            placeholder="Enter GST Number"
                                            value="<?php echo htmlspecialchars($vendor['gst_number']); ?>" />
                                    </div>
                                </div>

                            <!--end::Input group-->
                        </div>
                        <!--end::Billing form-->
                    </div>
                    <!--end::Scroll-->
                </div>
                <!--end::Modal body-->
                
                <!--begin::Modal footer-->
                <div class="modal-footer flex-center">
                    <!--begin::Button-->
                    <button type="button" class="btn btn-light me-3" data-bs-dismiss="modal">Discard</button>
                    <!--end::Button-->
                    <!--begin::Button-->
                    <button type="submit" id="kt_modal_update_customer_submit" class="btn btn-primary">
                        <span class="indicator-label">Submit</span>
                        <span class="indicator-progress">Please wait...
                        <span class="spinner-border spinner-border-sm align-middle ms-2"></span></span>
                    </button>
                    <!--end::Button-->
                </div>
                <!--end::Modal footer-->
            </form>
            <!--end::Form-->
        </div>
    </div>
</div>


								
								</div>
								<!--end::Content container-->
							</div>
							<!--end::Content-->
						</div>
						<!--end::Content wrapper-->
						<!--begin::Footer-->
						<div id="kt_app_footer" class="app-footer">
							<!--begin::Footer container-->
							<!--begin::Footer container-->
							<div class="app-container container-fluid d-flex flex-column flex-md-row flex-center flex-md-stack py-3">
								<!--begin::Copyright-->
								<div class="text-gray-900 order-2 order-md-1">
									<span class="text-muted fw-semibold me-1">2024&copy;</span>
									<a href="https://thedotstudios.com/" target="_blank" class="text-gray-800 text-hover-primary">Copyright  All rights reserved | Made with <span class="fa fa-heart text-danger"></span> <b> by TheDotStudios.</b></a>
								</div>
								<!--end::Copyright-->
								<!--begin::Menu-->
								<ul class="menu menu-gray-600 menu-hover-primary fw-semibold order-1">
									<li class="menu-item">
										<a href="https://thedotstudios.com/" target="_blank" class="menu-link px-2">About</a>
									</li>
									<li class="menu-item">
										<a href="https://thedotstudios.com/" target="_blank" class="menu-link px-2">Support</a>
									</li>
									<li class="menu-item">
										<!-- <a href="https://1.envato.market/EA4JP" target="_blank" class="menu-link px-2">Purchase</a> -->
									</li>
								</ul>
								<!--end::Menu-->
							</div>
							<!--end::Footer container-->
						</div>
						<!--end::Footer-->
					</div>
					<!--end:::Main-->
				</div>
				<!--end::Wrapper-->
			</div>
			<!--end::Page-->
		</div>
	
		<!--begin::Javascript-->
		<script>var hostUrl = "assets/";</script>
		<!--begin::Global Javascript Bundle(mandatory for all pages)-->
		<script src="assets/plugins/global/plugins.bundle.js"></script>
		<script src="assets/js/scripts.bundle.js"></script>
		<!--end::Global Javascript Bundle-->
		<!--begin::Vendors Javascript(used for this page only)-->
		<script src="assets/plugins/custom/datatables/datatables.bundle.js"></script>
		<!--end::Vendors Javascript-->
		<!--begin::Custom Javascript(used for this page only)-->
		<script src="assets/js/custom/apps/customers/view/add-payment.js"></script>
		<script src="assets/js/custom/apps/customers/view/adjust-balance.js"></script>
		<script src="assets/js/custom/apps/customers/view/invoices.js"></script>
		<script src="assets/js/custom/apps/customers/view/payment-method.js"></script>
		<script src="assets/js/custom/apps/customers/view/payment-table.js"></script>
		<script src="assets/js/custom/apps/customers/view/statement.js"></script>
		<script src="assets/js/custom/apps/customers/update.js"></script>
		<script src="assets/js/widgets.bundle.js"></script>
		<script src="assets/js/custom/widgets.js"></script>
		<script src="assets/js/custom/apps/chat/chat.js"></script>
		<script src="assets/js/custom/utilities/modals/upgrade-plan.js"></script>
		<script src="assets/js/custom/utilities/modals/create-app.js"></script>
		<script src="assets/js/custom/utilities/modals/new-card.js"></script>
		<script src="assets/js/custom/utilities/modals/users-search.js"></script>
		<!--end::Custom Javascript-->
		<!--end::Javascript-->
	</body>

	
<script>
	$(document).ready(function() {
    console.log('Modal update script loaded');
    
    // Pincode API Integration
    let pincodeTimeout;
    const $pincodeInput = $('input[name="pincode"]');
    const $cityInput = $('input[name="city"]');
    const $stateInput = $('input[name="state"]');
    const $countryInput = $('input[name="country"]');
    
    // Disable city, state, country fields initially (they will be auto-filled)
    $cityInput.prop('readonly', true).addClass('bg-light-secondary');
    $stateInput.prop('readonly', true).addClass('bg-light-secondary');
    $countryInput.prop('readonly', true).addClass('bg-light-secondary');
    
    // Add error message container after pincode input if it doesn't exist
    if (!$pincodeInput.next('.pincode-error').length) {
        $pincodeInput.after('<div class="pincode-error text-danger fs-7 mt-1" style="display:none;"></div>');
    }
    
    // Listen for pincode input changes
    $pincodeInput.on('input', function() {
        const pincode = $(this).val().trim();
        const $errorDiv = $pincodeInput.next('.pincode-error');
        
        // Clear previous timeout
        clearTimeout(pincodeTimeout);
        
        // Hide error message
        $errorDiv.hide().text('');
        
        // Remove loading state
        $pincodeInput.removeClass('loading');
        
        // Check if pincode is valid length (Indian pincode is 6 digits)
        if (pincode.length === 6 && /^\d{6}$/.test(pincode)) {
            // Add loading indicator
            $pincodeInput.addClass('loading');
            
            // Debounce API call
            pincodeTimeout = setTimeout(function() {
                fetchLocationByPincode(pincode);
            }, 500);
        } else if (pincode.length === 0) {
            // Clear fields if pincode is empty
            clearLocationFields();
        } else if (pincode.length > 6) {
            // Show error for invalid length
            showPincodeError('Pincode must be exactly 6 digits.');
        }
    });
    
    function fetchLocationByPincode(pincode) {
        const $errorDiv = $pincodeInput.next('.pincode-error');
        
        // Using India Post Pincode API
        $.ajax({
            url: `https://api.postalpincode.in/pincode/${pincode}`,
            type: 'GET',
            dataType: 'json',
            timeout: 10000,
            success: function(response) {
                $pincodeInput.removeClass('loading');
                
                if (response && response[0] && response[0].Status === 'Success') {
                    const postOffice = response[0].PostOffice[0];
                    
                    // Fill in the location fields
                    $cityInput.val(postOffice.District || postOffice.Block || '').trigger('change');
                    $stateInput.val(postOffice.State || '').trigger('change');
                    $countryInput.val(postOffice.Country || 'India').trigger('change');
                    
                    // Add success indicator
                    $pincodeInput.addClass('is-valid').removeClass('is-invalid');
                    $cityInput.removeClass('is-invalid');
                    $stateInput.removeClass('is-invalid');
                    $countryInput.removeClass('is-invalid');
                    
                    setTimeout(function() {
                        $pincodeInput.removeClass('is-valid');
                    }, 2000);
                    
                } else {
                    // Invalid pincode
                    showPincodeError('Invalid pincode. Please enter a valid pincode.');
                    clearLocationFields();
                }
            },
            error: function(xhr, status, error) {
                $pincodeInput.removeClass('loading');
                
                if (status === 'timeout') {
                    showPincodeError('Request timed out. Please try again.');
                } else {
                    showPincodeError('Unable to fetch location details. Please try again.');
                }
                
                clearLocationFields();
                console.error('Pincode API Error:', error);
            }
        });
    }
    
    function showPincodeError(message) {
        const $errorDiv = $pincodeInput.next('.pincode-error');
        $errorDiv.text(message).show();
        $pincodeInput.addClass('is-invalid').removeClass('is-valid');
    }
    
    function clearLocationFields() {
        $cityInput.val('');
        $stateInput.val('');
        $countryInput.val('');
        $pincodeInput.removeClass('is-valid is-invalid');
    }
    
    // Simple form submission handler
    $('#kt_modal_update_customer_form_01').on('submit', function(e) {
        e.preventDefault();
        
        // Check if pincode has error
        if ($('.pincode-error:visible').length > 0) {
            showError('Please enter a valid pincode.');
            return false;
        }
        
        // Check if pincode is entered
        const pincode = $pincodeInput.val().trim();
        if (pincode.length === 6 && /^\d{6}$/.test(pincode)) {
            handleFormSubmission();
        } else {
            showError('Please enter a valid 6-digit pincode.');
            return false;
        }
    });
    
    // Handle submit button click
    $('#kt_modal_update_customer_submit').on('click', function(e) {
        e.preventDefault();
        $('#kt_modal_update_customer_form_01').submit();
    });
});

function handleFormSubmission() {
    var form = $('#kt_modal_update_customer_form_01');
    var submitBtn = $('#kt_modal_update_customer_submit');
    
    console.log('Form submission started');
    
    // Basic validation
    var name = form.find('input[name="name"]').val().trim();
    var email = form.find('input[name="email"]').val().trim();
    
    if (!name) {
        showError('Name is required');
        return false;
    }
    
    if (!email) {
        showError('Email is required');
        return false;
    }
    
    if (!isValidEmail(email)) {
        showError('Please enter a valid email address');
        return false;
    }
    
    // Show loading state
    setButtonLoading(submitBtn, true);
    
    // Create FormData
    var formData = new FormData(form[0]);
    
    // Debug: Log form data
    console.log('Form data:');
    for (var pair of formData.entries()) {
        console.log(pair[0] + ': ' + pair[1]);
    }
    
    // Send AJAX request
    $.ajax({
        url: 'vendor_admin/update_vendors.php',
        type: 'POST',
        data: formData,
        processData: false,
        contentType: false,
        dataType: 'json',
        timeout: 30000,
        success: function(response) {
            console.log('Success response:', response);
            
            if (response && response.success) {
                showSuccess(response.message || 'Vendor updated successfully!');
                
                // Update display if data provided
                if (response.data && response.data.vendor) {
                    updateVendorDisplay(response.data.vendor);
                }
                
                // Close modal after delay
                setTimeout(function() {
                    $('#kt_modal_update_customer').modal('hide');
                    // Optionally reload the page to reflect changes
                    location.reload();
                }, 2000);
                
            } else {
                showError(response.message || 'Update failed. Please try again.');
            }
        },
        error: function(xhr, status, error) {
            console.error('AJAX Error:');
            console.error('Status:', status);
            console.error('Error:', error);
            console.error('Response:', xhr.responseText);
            console.error('Status Code:', xhr.status);
            
            var errorMsg = 'Update failed. ';
            
            if (xhr.status === 404) {
                errorMsg += 'Update script not found. Please check the file path.';
            } else if (xhr.status === 500) {
                errorMsg += 'Server error occurred.';
            } else if (status === 'timeout') {
                errorMsg += 'Request timed out.';
            } else if (xhr.status === 0) {
                errorMsg += 'Network error. Please check your connection.';
            } else {
                errorMsg += 'Please try again.';
            }
            
            showError(errorMsg);
        },
        complete: function() {
            setButtonLoading(submitBtn, false);
        }
    });
}

function setButtonLoading(btn, loading) {
    if (loading) {
        btn.prop('disabled', true);
        btn.find('.indicator-label').hide();
        btn.find('.indicator-progress').show();
    } else {
        btn.prop('disabled', false);
        btn.find('.indicator-label').show();
        btn.find('.indicator-progress').hide();
    }
}

function showSuccess(message) {
    if (typeof Swal !== 'undefined') {
        Swal.fire({
            text: message,
            icon: "success",
            buttonsStyling: false,
            confirmButtonText: "Ok",
            customClass: {
                confirmButton: "btn btn-primary"
            }
        });
    } else if (typeof toastr !== 'undefined') {
        toastr.success(message);
    } else {
        alert(message);
    }
}

function showError(message) {
    if (typeof Swal !== 'undefined') {
        Swal.fire({
            text: message,
            icon: "error",
            buttonsStyling: false,
            confirmButtonText: "Ok",
            customClass: {
                confirmButton: "btn btn-primary"
            }
        });
    } else if (typeof toastr !== 'undefined') {
        toastr.error(message);
    } else {
        alert(message);
    }
}

function isValidEmail(email) {
    var emailRegex = /^[^\s@]+@[^\s@]+\.[^\s@]+$/;
    return emailRegex.test(email);
}

function updateVendorDisplay(vendor) {
    // Update page elements with new vendor data
    if (vendor.name) $('.vendor-name').text(vendor.name);
    if (vendor.email) $('.vendor-email').text(vendor.email);
    if (vendor.phone) $('.vendor-phone').text(vendor.phone);
    if (vendor.company_name) $('.vendor-company').text(vendor.company_name);
    if (vendor.business_type) $('.vendor-business-type').text(vendor.business_type);
    if (vendor.occupation) $('.vendor-occupation').text(vendor.occupation);
    if (vendor.address) $('.vendor-address').text(vendor.address);
    if (vendor.pincode) $('.vendor-pincode').text(vendor.pincode);
    if (vendor.city) $('.vendor-city').text(vendor.city);
    if (vendor.state) $('.vendor-state').text(vendor.state);
    if (vendor.country) $('.vendor-country').text(vendor.country);
    if (vendor.pan_num) $('.vendor-pan').text(vendor.pan_num);
    if (vendor.gst_number) $('.vendor-gst').text(vendor.gst_number);
    
    // Update avatar image
    if (vendor.image) {
        var imagePath = './Images/Vendor/' + vendor.image;
        $('.vendor-avatar').attr('src', imagePath);
        $('#vendor-avatar').css('background-image', 'url(' + imagePath + ')');
    }
    
    console.log('Vendor display updated');
}
</script>

<script>
function requestDelete(productId, productName) {
    document.getElementById('delete_product_id').value = productId;
    document.getElementById('delete_product_name').value = productName;
    document.getElementById('delete_reason').value = '';
    
    var modal = new bootstrap.Modal(document.getElementById('deleteRequestModal'));
    modal.show();
}

function submitDeleteRequest() {
    const form = document.getElementById('deleteRequestForm');
    const formData = new FormData(form);
    const reason = document.getElementById('delete_reason').value.trim();
    
    // Validate reason field
    if (!reason) {
        Swal.fire({
            icon: 'warning',
            title: 'Missing Information',
            text: 'Please provide a reason for deletion.',
            confirmButtonColor: '#3085d6'
        });
        return;
    }
    
    // Show loading alert
    Swal.fire({
        title: 'Processing Request',
        text: 'Sending delete request and notifying admin...',
        icon: 'info',
        allowOutsideClick: false,
        allowEscapeKey: false,
        showConfirmButton: false,
        didOpen: () => {
            Swal.showLoading();
        }
    });
    
    fetch('vendor_admin/vendor_delete_request.php', {
        method: 'POST',
        body: formData
    })
    .then(response => response.json())
    .then(data => {
        if (data.success) {
            // Close the loading popup and show success
            Swal.fire({
                icon: 'success',
                title: 'Request Submitted!',
                text: 'Your delete request has been submitted successfully. Admin will review your request and get back to you.',
                confirmButtonColor: '#28a745',
                confirmButtonText: 'OK'
            }).then(() => {
                // Close the modal after success
                var modal = bootstrap.Modal.getInstance(document.getElementById('deleteRequestModal'));
                modal.hide();
                
                // Optional: Refresh the page or update the UI
                // location.reload();
            });
        } else {
            // Show error message
            Swal.fire({
                icon: 'error',
                title: 'Submission Failed',
                text: data.message || 'An error occurred while submitting the request.',
                confirmButtonColor: '#dc3545'
            });
        }
    })
    .catch(error => {
        console.error('Error:', error);
        Swal.fire({
            icon: 'error',
            title: 'Network Error',
            text: 'Unable to connect to server. Please check your internet connection and try again.',
            confirmButtonColor: '#dc3545'
        });
    });
}

// Optional: Add confirmation before showing the delete modal
function requestDeleteWithConfirmation(productId, productName) {
    Swal.fire({
        title: 'Request Product Deletion',
        text: `Are you sure you want to request deletion of "${productName}"?`,
        icon: 'question',
        showCancelButton: true,
        confirmButtonColor: '#dc3545',
        cancelButtonColor: '#6c757d',
        confirmButtonText: 'Yes, proceed',
        cancelButtonText: 'Cancel'
    }).then((result) => {
        if (result.isConfirmed) {
            requestDelete(productId, productName);
        }
    });
}
function deleteApprovedProduct(productId, productName) {
    Swal.fire({
        title: 'Delete Product',
        text: `Are you sure you want to delete "${productName}"? This action cannot be undone.`,
        icon: 'warning',
        showCancelButton: true,
        confirmButtonColor: '#dc3545',
        cancelButtonColor: '#6c757d',
        confirmButtonText: 'Yes, delete it!',
        cancelButtonText: 'Cancel'
    }).then((result) => {
        if (result.isConfirmed) {
            Swal.fire({
                title: 'Deleting Product',
                text: 'Please wait...',
                icon: 'info',
                allowOutsideClick: false,
                allowEscapeKey: false,
                showConfirmButton: false,
                didOpen: () => {
                    Swal.showLoading();
                }
            });
            
            const formData = new FormData();
            formData.append('product_id', productId);
            formData.append('vendor_id', <?php echo $vendor_id; ?>);
            
            fetch('vendor_admin/vendor_delete_product.php', {
                method: 'POST',
                body: formData
            })
            .then(response => response.json())
            .then(data => {
                if (data.success) {
                    Swal.fire({
                        icon: 'success',
                        title: 'Deleted!',
                        text: 'Product has been deleted successfully.',
                        confirmButtonColor: '#28a745'
                    }).then(() => {
                        location.reload();
                    });
                } else {
                    Swal.fire({
                        icon: 'error',
                        title: 'Deletion Failed',
                        text: data.message,
                        confirmButtonColor: '#dc3545'
                    });
                }
            })
            .catch(error => {
                console.error('Error:', error);
                Swal.fire({
                    icon: 'error',
                    title: 'Network Error',
                    text: 'Unable to connect to server.',
                    confirmButtonColor: '#dc3545'
                });
            });
        }
    });
}
</script>
	<!--end::Body-->
</html>

MMCT - 2023