Merge pull request 'dynamic search bar and filtering min & max' (#40) from raymart_branch into main
Reviewed-on: #40
This commit is contained in:
commit
8c0454570a
|
@ -48,13 +48,11 @@ if($_SESSION["user_type"]!="admin"){
|
|||
|
||||
<body class="ec-header-fixed ec-sidebar-fixed ec-sidebar-light ec-header-light" id="body">
|
||||
|
||||
<!-- WRAPPER -->
|
||||
<div class="wrapper">
|
||||
|
||||
<!-- LEFT MAIN SIDEBAR -->
|
||||
|
||||
<?php include 'left-main-sidebar.php' ?>
|
||||
<!-- LEFT MAIN SIDEBAR -->
|
||||
<?php include 'left-main-sidebar.php' ?>
|
||||
|
||||
<!-- WRAPPER -->
|
||||
<div class="wrapper">
|
||||
<!-- PAGE WRAPPER -->
|
||||
<div class="ec-page-wrapper">
|
||||
|
||||
|
@ -65,13 +63,21 @@ if($_SESSION["user_type"]!="admin"){
|
|||
<button id="sidebar-toggler" class="sidebar-toggle"></button>
|
||||
<!-- search form -->
|
||||
<div class="search-form d-lg-inline-block">
|
||||
<div class="input-group">
|
||||
<form action="vendor-product-search-action.php">
|
||||
<div class="input-group">
|
||||
<input type="text" name="search" id="search-input" class="form-control" placeholder="search.." autofocus autocomplete="off" />
|
||||
<button class="submit" type="submit" id="search-btn" class="btn btn-flat">
|
||||
<i class="mdi mdi-magnify" style="font-size:20px; color:gray; padding-right:8px;"></i>
|
||||
</button>
|
||||
</div>
|
||||
</form>
|
||||
<!-- <div class="input-group">
|
||||
<input type="text" name="query" id="search-input" class="form-control"
|
||||
placeholder="search.." autofocus autocomplete="off" />
|
||||
<button type="button" name="search" id="search-btn" class="btn btn-flat">
|
||||
<i class="mdi mdi-magnify"></i>
|
||||
</button>
|
||||
</div>
|
||||
</div> -->
|
||||
<div id="search-results-container">
|
||||
<ul id="search-results"></ul>
|
||||
</div>
|
||||
|
|
|
@ -103,7 +103,7 @@
|
|||
|
||||
<!-- Products -->
|
||||
<li class="has-sub">
|
||||
<a class="sidenav-item-link" href="javascript:void(0)">
|
||||
<a class="sidenav-item-link" href="product-grid.php">
|
||||
<i class="mdi mdi-palette-advanced"></i>
|
||||
<span class="nav-text">Products</span> <b class="caret"></b>
|
||||
</a>
|
||||
|
|
|
@ -0,0 +1,26 @@
|
|||
<?php
|
||||
include "../functions.php";
|
||||
$productId = $_GET['id'];
|
||||
$curl = curl_init();
|
||||
$url = "https://".$_SESSION["data_endpoint"]."/api/v1/products/".$productId;
|
||||
curl_setopt($curl,CURLOPT_URL,$url);
|
||||
curl_setopt_array($curl, array(
|
||||
//CURLOPT_URL => 'https://api.obanana.shop/api/v1/products/656717579624f6181c49cdda',
|
||||
CURLOPT_RETURNTRANSFER => true,
|
||||
CURLOPT_ENCODING => '',
|
||||
CURLOPT_MAXREDIRS => 10,
|
||||
CURLOPT_TIMEOUT => 0,
|
||||
CURLOPT_FOLLOWLOCATION => true,
|
||||
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
|
||||
CURLOPT_CUSTOMREQUEST => 'DELETE',
|
||||
CURLOPT_HTTPHEADER => array(
|
||||
'X-Api-Key: {{apiKey}}'
|
||||
),
|
||||
));
|
||||
|
||||
$response = curl_exec($curl);
|
||||
|
||||
curl_close($curl);
|
||||
header("location: vendor-product-search.php");
|
||||
echo $response;
|
||||
?>
|
|
@ -39,7 +39,9 @@ if($_SESSION["user_type"]!="admin"){
|
|||
<link id="ekka-css" rel="stylesheet" href="assets/css/ekka.css" />
|
||||
|
||||
<!-- FAVICON -->
|
||||
<link href="assets/img/favicon.png" rel="shortcut icon" />
|
||||
<!-- <link href="assets/img/favicon.png" rel="shortcut icon" /> -->
|
||||
<link href="assets/img/favicon/favicon.png" rel="shortcut icon" />
|
||||
|
||||
</head>
|
||||
|
||||
<body class="ec-header-fixed ec-sidebar-fixed ec-sidebar-dark ec-header-light" id="body">
|
||||
|
@ -52,560 +54,8 @@ if($_SESSION["user_type"]!="admin"){
|
|||
<!-- PAGE WRAPPER -->
|
||||
<div class="ec-page-wrapper">
|
||||
|
||||
<!-- Header -->
|
||||
<header class="ec-main-header" id="header">
|
||||
<nav class="navbar navbar-static-top navbar-expand-lg">
|
||||
<!-- Sidebar toggle button -->
|
||||
<button id="sidebar-toggler" class="sidebar-toggle"></button>
|
||||
<!-- search form -->
|
||||
<div class="search-form d-lg-inline-block">
|
||||
<div class="input-group">
|
||||
<input type="text" name="query" id="search-input" class="form-control" placeholder="search.." autofocus autocomplete="off" />
|
||||
<button type="button" name="search" id="search-btn" class="btn btn-flat">
|
||||
<i class="mdi mdi-magnify"></i>
|
||||
</button>
|
||||
</div>
|
||||
<div id="search-results-container">
|
||||
<ul id="search-results"></ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- navbar right -->
|
||||
<div class="navbar-right">
|
||||
<ul class="nav navbar-nav">
|
||||
<!-- User Account -->
|
||||
<li class="dropdown user-menu">
|
||||
<button class="dropdown-toggle nav-link ec-drop" data-bs-toggle="dropdown" aria-expanded="false">
|
||||
<img src="assets/img/user/user.png" class="user-image" alt="User Image" />
|
||||
</button>
|
||||
<ul class="dropdown-menu dropdown-menu-right ec-dropdown-menu">
|
||||
<!-- User image -->
|
||||
<li class="dropdown-header">
|
||||
<img src="assets/img/user/user.png" class="img-circle" alt="User Image" />
|
||||
<div class="d-inline-block">
|
||||
John Deo <small class="pt-1">john.example@gmail.com</small>
|
||||
</div>
|
||||
</li>
|
||||
<li>
|
||||
<a href="user-profile.html">
|
||||
<i class="mdi mdi-account"></i> My Profile
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="#">
|
||||
<i class="mdi mdi-email"></i> Message
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="#"> <i class="mdi mdi-diamond-stone"></i> Projects </a>
|
||||
</li>
|
||||
<li class="right-sidebar-in">
|
||||
<a href="javascript:0"> <i class="mdi mdi-settings-outline"></i> Setting </a>
|
||||
</li>
|
||||
<li class="dropdown-footer">
|
||||
<a href="/logout.php"> <i class="mdi mdi-logout"></i> Log Out </a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="dropdown notifications-menu custom-dropdown">
|
||||
<button class="dropdown-toggle notify-toggler custom-dropdown-toggler">
|
||||
<i class="mdi mdi-bell-outline"></i>
|
||||
</button>
|
||||
|
||||
<div class="card card-default dropdown-notify dropdown-menu-right mb-0">
|
||||
<div class="card-header card-header-border-bottom px-3">
|
||||
<h2>Notifications</h2>
|
||||
</div>
|
||||
|
||||
<div class="card-body px-0 py-0">
|
||||
<ul class="nav nav-tabs nav-style-border p-0 justify-content-between" id="myTab" role="tablist">
|
||||
<li class="nav-item mx-3 my-0 py-0">
|
||||
<a href="#" class="nav-link active pb-3" id="home2-tab" data-bs-toggle="tab" data-bs-target="#home2" role="tab" aria-controls="home2" aria-selected="true">All (10)</a>
|
||||
</li>
|
||||
|
||||
<li class="nav-item mx-3 my-0 py-0">
|
||||
<a href="#" class="nav-link pb-3" id="profile2-tab" data-bs-toggle="tab" data-bs-target="#profile2" role="tab" aria-controls="profile2" aria-selected="false">Msgs (5)</a>
|
||||
</li>
|
||||
|
||||
<li class="nav-item mx-3 my-0 py-0">
|
||||
<a href="#" class="nav-link pb-3" id="contact2-tab" data-bs-toggle="tab" data-bs-target="#contact2" role="tab" aria-controls="contact2" aria-selected="false">Others (5)</a>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<div class="tab-content" id="myTabContent3">
|
||||
<div class="tab-pane fade show active" id="home2" role="tabpanel" aria-labelledby="home2-tab">
|
||||
<ul class="list-unstyled" data-simplebar style="height: 360px">
|
||||
<li>
|
||||
<a href="javscript:void(0)" class="media media-message media-notification">
|
||||
<div class="position-relative mr-3">
|
||||
<img class="rounded-circle" src="assets/img/user/u2.jpg" alt="Image">
|
||||
<span class="status away"></span>
|
||||
</div>
|
||||
<div class="media-body d-flex justify-content-between">
|
||||
<div class="message-contents">
|
||||
<h4 class="title">Nitin</h4>
|
||||
<p class="last-msg">Lorem ipsum dolor sit, amet
|
||||
consectetur adipisicing elit. Nam itaque
|
||||
doloremque odio, eligendi delectus vitae.</p>
|
||||
|
||||
<span class="font-size-12 font-weight-medium text-secondary">
|
||||
<i class="mdi mdi-clock-outline"></i> 30 min
|
||||
ago...
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<a href="javscript:void(0)" class="media media-message media-notification media-active">
|
||||
<div class="position-relative mr-3">
|
||||
<img class="rounded-circle" src="assets/img/user/u1.jpg" alt="Image">
|
||||
<span class="status active"></span>
|
||||
</div>
|
||||
<div class="media-body d-flex justify-content-between">
|
||||
<div class="message-contents">
|
||||
<h4 class="title">Lovina</h4>
|
||||
<p class="last-msg">Donec mattis augue a nisl
|
||||
consequat, nec imperdiet ex rutrum. Fusce et
|
||||
vehicula enim. Sed in enim eu odio vehic.</p>
|
||||
|
||||
<span class="font-size-12 font-weight-medium text-white">
|
||||
<i class="mdi mdi-clock-outline"></i> Just
|
||||
now...
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<a href="javscript:void(0)" class="media media-message media-notification">
|
||||
<div class="position-relative mr-3">
|
||||
<img class="rounded-circle" src="assets/img/user/u5.jpg" alt="Image">
|
||||
<span class="status away"></span>
|
||||
</div>
|
||||
<div class="media-body d-flex justify-content-between">
|
||||
<div class="message-contents">
|
||||
<h4 class="title">Crinali</h4>
|
||||
<p class="last-msg">Lorem ipsum dolor sit, amet
|
||||
consectetur adipisicing elit. Nam itaque
|
||||
doloremque odio, eligendi delectus vitae.</p>
|
||||
|
||||
<span class="font-size-12 font-weight-medium text-secondary">
|
||||
<i class="mdi mdi-clock-outline"></i> 1 hrs
|
||||
ago...
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<a href="javscript:void(0)" class="media media-message media-notification event-active">
|
||||
|
||||
<div class="d-flex rounded-circle align-items-center justify-content-center mr-3 media-icon iconbox-45 bg-info text-white">
|
||||
<i class="mdi mdi-calendar-check font-size-20"></i>
|
||||
</div>
|
||||
|
||||
<div class="media-body d-flex justify-content-between">
|
||||
<div class="message-contents">
|
||||
<h4 class="title">Upcomming event added</h4>
|
||||
<p class="last-msg font-size-14">03/Jan/2020 (1pm -
|
||||
2pm)</p>
|
||||
|
||||
<span class="font-size-12 font-weight-medium text-secondary">
|
||||
<i class="mdi mdi-clock-outline"></i> 10 min
|
||||
ago...
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<a href="javscript:void(0)" class="media media-message media-notification">
|
||||
|
||||
<div class="d-flex rounded-circle align-items-center justify-content-center mr-3 media-icon iconbox-45 bg-warning text-white">
|
||||
<i class="mdi mdi-chart-areaspline font-size-20"></i>
|
||||
</div>
|
||||
|
||||
<div class="media-body d-flex justify-content-between">
|
||||
<div class="message-contents">
|
||||
<h4 class="title">Yearly Sales report</h4>
|
||||
<p class="last-msg font-size-14">Lorem ipsum dolor
|
||||
sit, amet consectetur adipisicing elit. Nam
|
||||
itaque doloremque odio, eligendi delectus vitae.
|
||||
</p>
|
||||
|
||||
<span class="font-size-12 font-weight-medium text-secondary">
|
||||
<i class="mdi mdi-clock-outline"></i> 1 hrs
|
||||
ago...
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<a href="javscript:void(0)" class="media media-message media-notification">
|
||||
|
||||
<div class="d-flex rounded-circle align-items-center justify-content-center mr-3 media-icon iconbox-45 bg-primary text-white">
|
||||
<i class="mdi mdi-account-multiple-check font-size-20"></i>
|
||||
</div>
|
||||
|
||||
<div class="media-body d-flex justify-content-between">
|
||||
<div class="message-contents">
|
||||
<h4 class="title">New request</h4>
|
||||
<p class="last-msg font-size-14">Add Dany Jones as
|
||||
your contact consequat nec imperdiet ex rutrum.
|
||||
Fusce et vehicula enim. Sed in enim.</p>
|
||||
|
||||
<span class="my-1 btn btn-sm btn-success">Accept</span>
|
||||
<span class="my-1 btn btn-sm btn-secondary">Delete</span>
|
||||
|
||||
<span class="font-size-12 font-weight-medium text-secondary d-block">
|
||||
<i class="mdi mdi-clock-outline"></i> 5 min
|
||||
ago...
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<a href="javscript:void(0)" class="media media-message media-notification">
|
||||
|
||||
<div class="d-flex rounded-circle align-items-center justify-content-center mr-3 media-icon iconbox-45 bg-danger text-white">
|
||||
<i class="mdi mdi-server-network-off font-size-20"></i>
|
||||
</div>
|
||||
|
||||
<div class="media-body d-flex justify-content-between">
|
||||
<div class="message-contents">
|
||||
<h4 class="title">Server overloaded</h4>
|
||||
<p class="last-msg font-size-14">Donec mattis augue
|
||||
a nisl consequat, nec imperdiet ex rutrum. Fusce
|
||||
et vehicula enim. Sed in enim eu odio vehic.</p>
|
||||
|
||||
<span class="font-size-12 font-weight-medium text-secondary">
|
||||
<i class="mdi mdi-clock-outline"></i> 30 min
|
||||
ago...
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<a href="javscript:void(0)" class="media media-message media-notification">
|
||||
|
||||
<div class="d-flex rounded-circle align-items-center justify-content-center mr-3 media-icon iconbox-45 bg-purple text-white">
|
||||
<i class="mdi mdi-playlist-check font-size-20"></i>
|
||||
</div>
|
||||
|
||||
<div class="media-body d-flex justify-content-between">
|
||||
<div class="message-contents">
|
||||
<h4 class="title">Task complete</h4>
|
||||
<p class="last-msg font-size-14">Nam ut nisi erat.
|
||||
Ut quis tortor varius, hendrerit arcu quis,
|
||||
congue nisl. In scelerisque, sem ut ve.</p>
|
||||
|
||||
<span class="font-size-12 font-weight-medium text-secondary">
|
||||
<i class="mdi mdi-clock-outline"></i> 2 hrs
|
||||
ago...
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div class="tab-pane fade" id="profile2" role="tabpanel" aria-labelledby="profile2-tab">
|
||||
<ul class="list-unstyled" data-simplebar style="height: 360px">
|
||||
<li>
|
||||
<a href="javscript:void(0)" class="media media-message media-notification">
|
||||
<div class="position-relative mr-3">
|
||||
<img class="rounded-circle" src="assets/img/user/u6.jpg" alt="Image">
|
||||
<span class="status away"></span>
|
||||
</div>
|
||||
<div class="media-body d-flex justify-content-between">
|
||||
<div class="message-contents">
|
||||
<h4 class="title">Hardiko</h4>
|
||||
<p class="last-msg">Donec mattis augue a nisl
|
||||
consequat, nec imperdiet ex rutrum. Fusce et
|
||||
vehicula enim. Sed in enim eu odio vehic.</p>
|
||||
|
||||
<span class="font-size-12 font-weight-medium text-secondary">
|
||||
<i class="mdi mdi-clock-outline"></i> 1 hrs
|
||||
ago...
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<a href="javscript:void(0)" class="media media-message media-notification">
|
||||
<div class="position-relative mr-3">
|
||||
<img class="rounded-circle" src="assets/img/user/u7.jpg" alt="Image">
|
||||
<span class="status away"></span>
|
||||
</div>
|
||||
<div class="media-body d-flex justify-content-between">
|
||||
<div class="message-contents">
|
||||
<h4 class="title">Browin</h4>
|
||||
<p class="last-msg">Nam ut nisi erat. Ut quis tortor
|
||||
varius, hendrerit arcu quis, congue nisl. In
|
||||
scelerisque, sem ut ve.</p>
|
||||
|
||||
<span class="font-size-12 font-weight-medium text-secondary">
|
||||
<i class="mdi mdi-clock-outline"></i> 1 hrs
|
||||
ago...
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<a href="javscript:void(0)" class="media media-message media-notification media-active">
|
||||
<div class="position-relative mr-3">
|
||||
<img class="rounded-circle" src="assets/img/user/u1.jpg" alt="Image">
|
||||
<span class="status active"></span>
|
||||
</div>
|
||||
<div class="media-body d-flex justify-content-between">
|
||||
<div class="message-contents">
|
||||
<h4 class="title">jenelia</h4>
|
||||
<p class="last-msg">Donec mattis augue a nisl
|
||||
consequat, nec imperdiet ex rutrum. Fusce et
|
||||
vehicula enim. Sed in enim eu odio vehic.</p>
|
||||
|
||||
<span class="font-size-12 font-weight-medium text-white">
|
||||
<i class="mdi mdi-clock-outline"></i> Just
|
||||
now...
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<a href="javscript:void(0)" class="media media-message media-notification">
|
||||
<div class="position-relative mr-3">
|
||||
<img class="rounded-circle" src="assets/img/user/u2.jpg" alt="Image">
|
||||
<span class="status away"></span>
|
||||
</div>
|
||||
<div class="media-body d-flex justify-content-between">
|
||||
<div class="message-contents">
|
||||
<h4 class="title">Bhavlio</h4>
|
||||
<p class="last-msg">Lorem ipsum dolor sit, amet
|
||||
consectetur adipisicing elit. Nam itaque
|
||||
doloremque odio, eligendi delectus vitae.</p>
|
||||
|
||||
<span class="font-size-12 font-weight-medium text-secondary">
|
||||
<i class="mdi mdi-clock-outline"></i> 1 hrs
|
||||
ago...
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<a href="javscript:void(0)" class="media media-message media-notification">
|
||||
<div class="position-relative mr-3">
|
||||
<img class="rounded-circle" src="assets/img/user/u5.jpg" alt="Image">
|
||||
<span class="status away"></span>
|
||||
</div>
|
||||
<div class="media-body d-flex justify-content-between">
|
||||
<div class="message-contents">
|
||||
<h4 class="title">Browini</h4>
|
||||
<p class="last-msg">Lorem ipsum dolor sit, amet
|
||||
consectetur adipisicing elit. Nam itaque
|
||||
doloremque odio, eligendi delectus vitae.</p>
|
||||
|
||||
<span class="font-size-12 font-weight-medium text-secondary">
|
||||
<i class="mdi mdi-clock-outline"></i> 1 hrs
|
||||
ago...
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div class="tab-pane fade" id="contact2" role="tabpanel" aria-labelledby="contact2-tab">
|
||||
<ul class="list-unstyled" data-simplebar style="height: 360px">
|
||||
<li>
|
||||
<a href="javscript:void(0)" class="media media-message media-notification event-active">
|
||||
|
||||
<div class="d-flex rounded-circle align-items-center justify-content-center mr-3 media-icon iconbox-45 bg-info text-white">
|
||||
<i class="mdi mdi-calendar-check font-size-20"></i>
|
||||
</div>
|
||||
|
||||
<div class="media-body d-flex justify-content-between">
|
||||
<div class="message-contents">
|
||||
<h4 class="title">Upcomming event added</h4>
|
||||
<p class="last-msg font-size-14">03/Jan/2020 (1pm -
|
||||
2pm)</p>
|
||||
|
||||
<span class="font-size-12 font-weight-medium text-secondary">
|
||||
<i class="mdi mdi-clock-outline"></i> 10 min
|
||||
ago...
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<a href="javscript:void(0)" class="media media-message media-notification">
|
||||
|
||||
<div class="d-flex rounded-circle align-items-center justify-content-center mr-3 media-icon iconbox-45 bg-warning text-white">
|
||||
<i class="mdi mdi-chart-areaspline font-size-20"></i>
|
||||
</div>
|
||||
|
||||
<div class="media-body d-flex justify-content-between">
|
||||
<div class="message-contents">
|
||||
<h4 class="title">New Sales report</h4>
|
||||
<p class="last-msg font-size-14">Lorem ipsum dolor
|
||||
sit, amet consectetur adipisicing elit. Nam
|
||||
itaque doloremque odio, eligendi delectus vitae.
|
||||
</p>
|
||||
|
||||
<span class="font-size-12 font-weight-medium text-secondary">
|
||||
<i class="mdi mdi-clock-outline"></i> 1 hrs
|
||||
ago...
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<a href="javscript:void(0)" class="media media-message media-notification">
|
||||
|
||||
<div class="d-flex rounded-circle align-items-center justify-content-center mr-3 media-icon iconbox-45 bg-primary text-white">
|
||||
<i class="mdi mdi-account-multiple-check font-size-20"></i>
|
||||
</div>
|
||||
|
||||
<div class="media-body d-flex justify-content-between">
|
||||
<div class="message-contents">
|
||||
<h4 class="title">New Request</h4>
|
||||
<p class="last-msg font-size-14">Add Dany Jones as
|
||||
your contact consequat nec imperdiet ex rutrum.
|
||||
Fusce et vehicula enim. Sed in enim.</p>
|
||||
|
||||
<span class="my-1 btn btn-sm btn-success">Accept</span>
|
||||
<span class="my-1 btn btn-sm btn-secondary">Delete</span>
|
||||
|
||||
<span class="font-size-12 font-weight-medium text-secondary d-block">
|
||||
<i class="mdi mdi-clock-outline"></i> 5 min
|
||||
ago...
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<a href="javscript:void(0)" class="media media-message media-notification">
|
||||
|
||||
<div class="d-flex rounded-circle align-items-center justify-content-center mr-3 media-icon iconbox-45 bg-danger text-white">
|
||||
<i class="mdi mdi-server-network-off font-size-20"></i>
|
||||
</div>
|
||||
|
||||
<div class="media-body d-flex justify-content-between">
|
||||
<div class="message-contents">
|
||||
<h4 class="title">Server overloaded</h4>
|
||||
<p class="last-msg font-size-14">Donec mattis augue
|
||||
a nisl consequat, nec imperdiet ex rutrum. Fusce
|
||||
et vehicula enim. Sed in enim eu odio vehic.</p>
|
||||
|
||||
<span class="font-size-12 font-weight-medium text-secondary">
|
||||
<i class="mdi mdi-clock-outline"></i> 30 min
|
||||
ago...
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<a href="javscript:void(0)" class="media media-message media-notification">
|
||||
|
||||
<div class="d-flex rounded-circle align-items-center justify-content-center mr-3 media-icon iconbox-45 bg-purple text-white">
|
||||
<i class="mdi mdi-playlist-check font-size-20"></i>
|
||||
</div>
|
||||
|
||||
<div class="media-body d-flex justify-content-between">
|
||||
<div class="message-contents">
|
||||
<h4 class="title">New Task complete</h4>
|
||||
<p class="last-msg font-size-14">Nam ut nisi erat.
|
||||
Ut quis tortor varius, hendrerit arcu quis,
|
||||
congue nisl. In scelerisque, sem ut ve.</p>
|
||||
|
||||
<span class="font-size-12 font-weight-medium text-secondary">
|
||||
<i class="mdi mdi-clock-outline"></i> 2 hrs
|
||||
ago...
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<ul class="dropdown-menu dropdown-menu-right d-none">
|
||||
<li class="dropdown-header">You have 5 notifications</li>
|
||||
<li>
|
||||
<a href="#">
|
||||
<i class="mdi mdi-account-plus"></i> New user registered
|
||||
<span class=" font-size-12 d-inline-block float-right"><i class="mdi mdi-clock-outline"></i> 10 AM</span>
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="#">
|
||||
<i class="mdi mdi-account-remove"></i> User deleted
|
||||
<span class=" font-size-12 d-inline-block float-right"><i class="mdi mdi-clock-outline"></i> 07 AM</span>
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="#">
|
||||
<i class="mdi mdi-chart-areaspline"></i> Sales report is ready
|
||||
<span class=" font-size-12 d-inline-block float-right"><i class="mdi mdi-clock-outline"></i> 12 PM</span>
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="#">
|
||||
<i class="mdi mdi-account-supervisor"></i> New client
|
||||
<span class=" font-size-12 d-inline-block float-right"><i class="mdi mdi-clock-outline"></i> 10 AM</span>
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="#">
|
||||
<i class="mdi mdi-server-network-off"></i> Server overloaded
|
||||
<span class=" font-size-12 d-inline-block float-right"><i class="mdi mdi-clock-outline"></i> 05 AM</span>
|
||||
</a>
|
||||
</li>
|
||||
<li class="dropdown-footer">
|
||||
<a class="text-center" href="#"> View All </a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="right-sidebar-in right-sidebar-2-menu">
|
||||
<i class="mdi mdi-settings-outline mdi-spin"></i>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</nav>
|
||||
</header>
|
||||
<!-- HEADER -->
|
||||
<?php include 'header.php' ?>
|
||||
|
||||
<!-- CONTENT WRAPPER -->
|
||||
<div class="ec-content-wrapper">
|
||||
|
@ -630,7 +80,12 @@ if($_SESSION["user_type"]!="admin"){
|
|||
<div class="card-header card-header-border-bottom d-flex justify-content-between">
|
||||
<div class="card-bar">
|
||||
<div class="col-lg-6 col-md-12">
|
||||
<input type="text" class="form-control" id="searchProduct" placeholder="search with product name..">
|
||||
<form style="display:flex;">
|
||||
<input type="text" name="search" class="form-control" id="searchProduct" placeholder="search with product name..">
|
||||
<button class="submit" type="submit" id="search-btn" class="btn btn-flat">
|
||||
<i class="mdi mdi-magnify" style="font-size:20px; color:gray; margin-left:-40px;"></i>
|
||||
</button>
|
||||
</form>
|
||||
</div>
|
||||
<div class="col-lg-6 col-md-12 sort">
|
||||
<div class="col-lg-4 col-md-6 p-space">
|
||||
|
@ -655,10 +110,37 @@ if($_SESSION["user_type"]!="admin"){
|
|||
</div>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div class="row">
|
||||
|
||||
<div class="row" id="productWrap">
|
||||
<?php
|
||||
$products = productListVendor($vendorId);
|
||||
$totalProducts = count($products);
|
||||
|
||||
// 03-14-2024 Raymart created Search product start
|
||||
// $productsCopy = $products;
|
||||
|
||||
// if (!empty($_GET['search']) ) {
|
||||
// $filteredProducts=[];
|
||||
// foreach ($productsCopy as $result) {
|
||||
// $productName = strtolower($result['product_name']);
|
||||
// if (
|
||||
// strpos($productName,$_GET['search'])!==false
|
||||
// ) {
|
||||
// $filteredProducts[] = $result;
|
||||
// } else{
|
||||
// }
|
||||
// }
|
||||
|
||||
// $products = $filteredProducts;
|
||||
// $totalProducts = count($filteredProducts);
|
||||
// // $vendorsPerPage = 20;
|
||||
// }
|
||||
// if ($totalProducts == 0) {
|
||||
// echo '<p style="padding-top:30px; padding-left:20px;">No Product Found.</p>';
|
||||
// }
|
||||
|
||||
// 03-14-2024 Raymart created Search product end
|
||||
|
||||
for ($i = 0; $i <= $totalProducts - 1; $i++) {
|
||||
$product = $products[$i];
|
||||
?>
|
||||
|
@ -667,13 +149,21 @@ if($_SESSION["user_type"]!="admin"){
|
|||
<div class="card-container">
|
||||
<div class="card-top">
|
||||
<div class="image-container" style="height: 300px;"> <!-- Adjust the height as needed -->
|
||||
<?php
|
||||
if (isset($product['images'])) {
|
||||
$image_urls = explode(',', $product['images']);
|
||||
if (!empty($image_urls)) {
|
||||
$first_image_url = trim($image_urls[0]);
|
||||
?>
|
||||
<img class="img-fluid" src="<?php echo $first_image_url; ?>" alt="edit" style="object-fit: cover; width: 100%; height: 100%;"/>
|
||||
<?php
|
||||
if (isset($product['product_image']) && !empty($product['product_image'])) {
|
||||
echo '<img src="' . $product['product_image'] . '" alt="Product Image" class="img-fluid" style="object-fit: cover; width: 100%; height: 100%;">';
|
||||
} else {
|
||||
echo '<img src="assets/img/vendor/u1.jpg" class="img-fluid rounded-circle" alt="Placeholder Image" style="object-fit: cover; width: 100%; height: 100%;">';
|
||||
}
|
||||
} else {
|
||||
?>
|
||||
<img class="img-fluid rounded-circle" src="https://api.obanana.com/images/storage/web_images/1710214273217-no_image.png" alt="edit" />
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-bottom">
|
||||
|
@ -692,6 +182,82 @@ if($_SESSION["user_type"]!="admin"){
|
|||
}
|
||||
?>
|
||||
</div>
|
||||
<!-- 3-18-24 raymart add function for search bar -->
|
||||
<script>
|
||||
|
||||
const productData = <?php $prod = json_encode($products); echo $prod;?>;
|
||||
const productDataFinal = JSON.stringify(productData[0])
|
||||
const array = new Array(productData)
|
||||
console.log(array)
|
||||
// const parseJs =JSON.parse(productData)
|
||||
function searchProduct(e){
|
||||
const searchInput = document.getElementById('searchProduct')
|
||||
|
||||
let search = []
|
||||
|
||||
if(searchInput.value !=="" &&searchInput.value !==undefined ){
|
||||
search =array[0].filter((o)=>o.product_name.toLowerCase().includes(searchInput.value))??[];
|
||||
console.log(array[0])
|
||||
}else{
|
||||
search =array[0]
|
||||
|
||||
}
|
||||
const productWrap = document.getElementById('productWrap');
|
||||
productWrap.innerHTML=''
|
||||
if(search.length > 1){
|
||||
|
||||
search?.forEach(function(prod){
|
||||
const productImage = prod.images.split(',') ??[]
|
||||
// console.log(productImage)
|
||||
const image = productImage[0] ?`
|
||||
<img class="img-fluid" src="${productImage[0]}" alt="edit" style="object-fit: cover; width: 100%; height: 100%;"/>
|
||||
|
||||
`:`
|
||||
<img class="img-fluid rounded-circle" src="https://api.obanana.com/images/storage/web_images/1710214273217-no_image.png" alt="edit" style="object-fit: cover; width: 100%; height: 100%;"/>
|
||||
|
||||
`
|
||||
const card = document.createElement('div')
|
||||
card.classList.add('col-lg-3','col-md-4','col-sm-6')
|
||||
card.innerHTML=`
|
||||
|
||||
<div class="card-wrapper">
|
||||
<div class="card-container">
|
||||
<div class="card-top">
|
||||
<div class="image-container" style="height: 300px;"> <!-- Adjust the height as needed -->
|
||||
${image}
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-bottom">
|
||||
<h3>${prod.product_name}</h3>
|
||||
<p>₱${prod.regular_price}</p>
|
||||
</div>
|
||||
<div class="card-action">
|
||||
<div class="card-edit" onclick="editProduct('${prod._id}');"><i class="mdi mdi-circle-edit-outline"></i></div>
|
||||
<div class="card-preview"><i class="mdi mdi-eye-outline"></i></div>
|
||||
<div class="card-remove" onclick="deleteProduct('${prod._id}');"><i class="mdi mdi mdi-delete-outline"></i></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
`
|
||||
productWrap.appendChild(card)
|
||||
|
||||
|
||||
})
|
||||
}else{
|
||||
const productWrap = document.getElementById('productWrap');
|
||||
productWrap.innerHTML=`
|
||||
<p style="padding-top:10px; padding-left:20px;">No Product Found.</p>
|
||||
`
|
||||
}
|
||||
|
||||
|
||||
// console.log(search)
|
||||
}
|
||||
const search = document.getElementById('searchProduct')
|
||||
search.addEventListener("input", searchProduct)
|
||||
</script>
|
||||
<!-- 3-18-24 raymart add function for search bar -->
|
||||
<!-- <div class="row">
|
||||
<nav aria-label="Page navigation example p-0">
|
||||
<ul class="pagination pagination-seperated pagination-seperated-rounded">
|
||||
|
|
|
@ -0,0 +1,26 @@
|
|||
<?php
|
||||
// 3-19-24 raymart added action for search bar ven-pro-search.php
|
||||
include "../functions.php";
|
||||
|
||||
|
||||
if (isset($_GET["category"])) {
|
||||
$category = $_GET["category"];
|
||||
// You can use $category in your searchProducts function to filter results based on the category
|
||||
$result = searchProducts( $category);
|
||||
} else {
|
||||
$result = searchProducts($_GET["search"]);
|
||||
$result2 = searchVendor($_GET["search"]);
|
||||
}
|
||||
|
||||
$array = json_decode($result,true);
|
||||
$array2 = json_decode($result2,true);
|
||||
|
||||
$_SESSION["productSearchResult"] = $array;
|
||||
$_SESSION["vendorSearchResult"] = $array2;
|
||||
|
||||
header("location: vendor-product-search.php");
|
||||
// $search = isset($_POST['search']) ? $_POST['search'] : null;
|
||||
|
||||
// header("location: vendor-product-search.php?&search=$search");
|
||||
// 3-19-24 raymart added action for search bar ven-pro-search.php
|
||||
?>
|
|
@ -0,0 +1,865 @@
|
|||
<?php
|
||||
include "../functions.php";
|
||||
|
||||
$_SESSION["url"] = $_SERVER['REQUEST_URI'];
|
||||
if ($_SESSION["userId"] <> "") {
|
||||
$_SESSION["isLoggedIn"] = true;
|
||||
$customer_data = getCustomerbyLoginId($_SESSION["userId"]);
|
||||
} else {
|
||||
$_SESSION["isLoggedIn"] = false;
|
||||
header("location: login.php");
|
||||
exit();
|
||||
}
|
||||
if ($_SESSION["user_type"] != "admin") {
|
||||
header("location: login.php?alert=Only admins allowed here!");
|
||||
}
|
||||
|
||||
$productSearchResult = $_SESSION["productSearchResult"];
|
||||
$vendorSearchResult = $_SESSION["vendorSearchResult"];
|
||||
?>
|
||||
|
||||
<!DOCTYPE html>
|
||||
<html lang="en" dir="ltr">
|
||||
|
||||
<head>
|
||||
<!-- <style>
|
||||
.pagination {
|
||||
display: flex;
|
||||
list-style: none;
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.pagination a {
|
||||
color: #333;
|
||||
text-decoration: none;
|
||||
padding: 5px 10px;
|
||||
border: 1px solid #ccc;
|
||||
margin: 0 5px;
|
||||
border-radius: 4px;
|
||||
}
|
||||
|
||||
.pagination a.active {
|
||||
background-color: #007bff;
|
||||
color: #fff;
|
||||
}
|
||||
</style> -->
|
||||
|
||||
<meta charset="utf-8" />
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||
<meta name="description" content="oBanana B2B - Admin Dashboard">
|
||||
|
||||
<title>oBanana B2B - Admin Dashboard</title>
|
||||
|
||||
<!-- GOOGLE FONTS -->
|
||||
<link rel="preconnect" href="https://fonts.googleapis.com">
|
||||
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
|
||||
<link href="https://fonts.googleapis.com/css2?family=Montserrat:wght@200;300;400;500;600;700;800&family=Poppins:wght@300;400;500;600;700;800;900&family=Roboto:wght@400;500;700;900&display=swap" rel="stylesheet">
|
||||
|
||||
<link href="https://cdn.materialdesignicons.com/4.4.95/css/materialdesignicons.min.css" rel="stylesheet" />
|
||||
|
||||
<!-- PLUGINS CSS STYLE -->
|
||||
<link href="assets/plugins/simplebar/simplebar.css" rel="stylesheet" />
|
||||
|
||||
<!-- Ekka CSS -->
|
||||
<link id="ekka-css" rel="stylesheet" href="assets/css/ekka.css" />
|
||||
|
||||
<!-- FAVICON -->
|
||||
<!-- <link href="assets/img/favicon.png" rel="shortcut icon" /> -->
|
||||
<link href="assets/img/favicon/favicon.png" rel="shortcut icon" />
|
||||
|
||||
<!-- FONTAWESOME -->
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.1/css/all.min.css" integrity="sha512-DTOQO9RWCH3ppGqcWaEA1BIZOC6xxalwEsw9c2QQeAIftl+Vegovlnee1c9QX4TctnWMn13TZye+giMm8e2LwA==" crossorigin="anonymous" referrerpolicy="no-referrer" />
|
||||
|
||||
|
||||
</head>
|
||||
|
||||
<body class="ec-header-fixed ec-sidebar-fixed ec-sidebar-dark ec-header-light" id="body">
|
||||
|
||||
<!-- WRAPPER -->
|
||||
<div class="wrapper">
|
||||
|
||||
<!-- LEFT MAIN SIDEBAR -->
|
||||
<?php include 'left-main-sidebar.php' ?>
|
||||
|
||||
<!-- PAGE WRAPPER -->
|
||||
<div class="ec-page-wrapper">
|
||||
|
||||
<!-- Header -->
|
||||
<header class="ec-main-header" id="header">
|
||||
<nav class="navbar navbar-static-top navbar-expand-lg">
|
||||
<!-- Sidebar toggle button -->
|
||||
<button id="sidebar-toggler" class="sidebar-toggle"></button>
|
||||
<!-- search form -->
|
||||
|
||||
<!-- 03-07-2024 Stacy & Raymart modified this block of code -->
|
||||
<div class="search-form d-lg-inline-block">
|
||||
<form action="vendor-product-search-action.php">
|
||||
<div class="input-group">
|
||||
<input type="text" name="search" id="search-input" class="form-control" placeholder="search.." autofocus autocomplete="off" />
|
||||
<button class="submit" type="submit" id="search-btn" class="btn btn-flat">
|
||||
<i class="mdi mdi-magnify" style="font-size:20px; color:gray; padding-right:8px;"></i>
|
||||
</button>
|
||||
</div>
|
||||
</form>
|
||||
<div id="search-results-container">
|
||||
<ul id="search-results"></ul>
|
||||
</div>
|
||||
</div>
|
||||
<!-- 03-07-2024 Stacy & Raymart modified this block of code -->
|
||||
|
||||
<!-- navbar right -->
|
||||
<div class="navbar-right">
|
||||
<ul class="nav navbar-nav">
|
||||
<!-- User Account -->
|
||||
<li class="dropdown user-menu">
|
||||
<button class="dropdown-toggle nav-link ec-drop" data-bs-toggle="dropdown" aria-expanded="false">
|
||||
<img src="assets/img/user/user.png" class="user-image" alt="User Image" />
|
||||
</button>
|
||||
<ul class="dropdown-menu dropdown-menu-right ec-dropdown-menu">
|
||||
<!-- User image -->
|
||||
<li class="dropdown-header">
|
||||
<img src="assets/img/user/user.png" class="img-circle" alt="User Image" />
|
||||
<div class="d-inline-block">
|
||||
John Deo <small class="pt-1">john.example@gmail.com</small>
|
||||
</div>
|
||||
</li>
|
||||
<li>
|
||||
<a href="user-profile.html">
|
||||
<i class="mdi mdi-account"></i> My Profile
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="#">
|
||||
<i class="mdi mdi-email"></i> Message
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="#"> <i class="mdi mdi-diamond-stone"></i> Projects </a>
|
||||
</li>
|
||||
<li class="right-sidebar-in">
|
||||
<a href="javascript:0"> <i class="mdi mdi-settings-outline"></i> Setting </a>
|
||||
</li>
|
||||
<li class="dropdown-footer">
|
||||
<a href="/logout.php"> <i class="mdi mdi-logout"></i> Log Out </a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="dropdown notifications-menu custom-dropdown">
|
||||
<button class="dropdown-toggle notify-toggler custom-dropdown-toggler">
|
||||
<i class="mdi mdi-bell-outline"></i>
|
||||
</button>
|
||||
|
||||
<div class="card card-default dropdown-notify dropdown-menu-right mb-0">
|
||||
<div class="card-header card-header-border-bottom px-3">
|
||||
<h2>Notifications</h2>
|
||||
</div>
|
||||
|
||||
<div class="card-body px-0 py-0">
|
||||
<ul class="nav nav-tabs nav-style-border p-0 justify-content-between" id="myTab" role="tablist">
|
||||
<li class="nav-item mx-3 my-0 py-0">
|
||||
<a href="#" class="nav-link active pb-3" id="home2-tab" data-bs-toggle="tab" data-bs-target="#home2" role="tab" aria-controls="home2" aria-selected="true">All (10)</a>
|
||||
</li>
|
||||
|
||||
<li class="nav-item mx-3 my-0 py-0">
|
||||
<a href="#" class="nav-link pb-3" id="profile2-tab" data-bs-toggle="tab" data-bs-target="#profile2" role="tab" aria-controls="profile2" aria-selected="false">Msgs (5)</a>
|
||||
</li>
|
||||
|
||||
<li class="nav-item mx-3 my-0 py-0">
|
||||
<a href="#" class="nav-link pb-3" id="contact2-tab" data-bs-toggle="tab" data-bs-target="#contact2" role="tab" aria-controls="contact2" aria-selected="false">Others (5)</a>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<div class="tab-content" id="myTabContent3">
|
||||
<div class="tab-pane fade show active" id="home2" role="tabpanel">
|
||||
<ul class="list-unstyled" data-simplebar style="height: 360px">
|
||||
<li>
|
||||
<a href="javscript:void(0)" class="media media-message media-notification">
|
||||
<div class="position-relative mr-3">
|
||||
<img class="rounded-circle" src="assets/img/user/u2.jpg" alt="Image">
|
||||
<span class="status away"></span>
|
||||
</div>
|
||||
<div class="media-body d-flex justify-content-between">
|
||||
<div class="message-contents">
|
||||
<h4 class="title">Nitin</h4>
|
||||
<p class="last-msg">Lorem ipsum dolor sit, amet
|
||||
consectetur adipisicing elit. Nam itaque
|
||||
doloremque odio, eligendi delectus vitae.</p>
|
||||
|
||||
<span class="font-size-12 font-weight-medium text-secondary">
|
||||
<i class="mdi mdi-clock-outline"></i> 30 min
|
||||
ago...
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<a href="javscript:void(0)" class="media media-message media-notification media-active">
|
||||
<div class="position-relative mr-3">
|
||||
<img class="rounded-circle" src="assets/img/user/u1.jpg" alt="Image">
|
||||
<span class="status active"></span>
|
||||
</div>
|
||||
<div class="media-body d-flex justify-content-between">
|
||||
<div class="message-contents">
|
||||
<h4 class="title">Lovina</h4>
|
||||
<p class="last-msg">Donec mattis augue a nisl
|
||||
consequat, nec imperdiet ex rutrum. Fusce et
|
||||
vehicula enim. Sed in enim eu odio vehic.</p>
|
||||
|
||||
<span class="font-size-12 font-weight-medium text-white">
|
||||
<i class="mdi mdi-clock-outline"></i> Just
|
||||
now...
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<a href="javscript:void(0)" class="media media-message media-notification">
|
||||
<div class="position-relative mr-3">
|
||||
<img class="rounded-circle" src="assets/img/user/u5.jpg" alt="Image">
|
||||
<span class="status away"></span>
|
||||
</div>
|
||||
<div class="media-body d-flex justify-content-between">
|
||||
<div class="message-contents">
|
||||
<h4 class="title">Crinali</h4>
|
||||
<p class="last-msg">Lorem ipsum dolor sit, amet
|
||||
consectetur adipisicing elit. Nam itaque
|
||||
doloremque odio, eligendi delectus vitae.</p>
|
||||
|
||||
<span class="font-size-12 font-weight-medium text-secondary">
|
||||
<i class="mdi mdi-clock-outline"></i> 1 hrs
|
||||
ago...
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<a href="javscript:void(0)" class="media media-message media-notification event-active">
|
||||
|
||||
<div class="d-flex rounded-circle align-items-center justify-content-center mr-3 media-icon iconbox-45 bg-info text-white">
|
||||
<i class="mdi mdi-calendar-check font-size-20"></i>
|
||||
</div>
|
||||
|
||||
<div class="media-body d-flex justify-content-between">
|
||||
<div class="message-contents">
|
||||
<h4 class="title">Upcomming event added</h4>
|
||||
<p class="last-msg font-size-14">03/Jan/2020 (1pm -
|
||||
2pm)</p>
|
||||
|
||||
<span class="font-size-12 font-weight-medium text-secondary">
|
||||
<i class="mdi mdi-clock-outline"></i> 10 min
|
||||
ago...
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<a href="javscript:void(0)" class="media media-message media-notification">
|
||||
|
||||
<div class="d-flex rounded-circle align-items-center justify-content-center mr-3 media-icon iconbox-45 bg-warning text-white">
|
||||
<i class="mdi mdi-chart-areaspline font-size-20"></i>
|
||||
</div>
|
||||
|
||||
<div class="media-body d-flex justify-content-between">
|
||||
<div class="message-contents">
|
||||
<h4 class="title">Yearly Sales report</h4>
|
||||
<p class="last-msg font-size-14">Lorem ipsum dolor
|
||||
sit, amet consectetur adipisicing elit. Nam
|
||||
itaque doloremque odio, eligendi delectus vitae.
|
||||
</p>
|
||||
|
||||
<span class="font-size-12 font-weight-medium text-secondary">
|
||||
<i class="mdi mdi-clock-outline"></i> 1 hrs
|
||||
ago...
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<a href="javscript:void(0)" class="media media-message media-notification">
|
||||
|
||||
<div class="d-flex rounded-circle align-items-center justify-content-center mr-3 media-icon iconbox-45 bg-primary text-white">
|
||||
<i class="mdi mdi-account-multiple-check font-size-20"></i>
|
||||
</div>
|
||||
|
||||
<div class="media-body d-flex justify-content-between">
|
||||
<div class="message-contents">
|
||||
<h4 class="title">New request</h4>
|
||||
<p class="last-msg font-size-14">Add Dany Jones as
|
||||
your contact consequat nec imperdiet ex rutrum.
|
||||
Fusce et vehicula enim. Sed in enim.</p>
|
||||
|
||||
<span class="my-1 btn btn-sm btn-success">Accept</span>
|
||||
<span class="my-1 btn btn-sm btn-secondary">Delete</span>
|
||||
|
||||
<span class="font-size-12 font-weight-medium text-secondary d-block">
|
||||
<i class="mdi mdi-clock-outline"></i> 5 min
|
||||
ago...
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<a href="javscript:void(0)" class="media media-message media-notification">
|
||||
|
||||
<div class="d-flex rounded-circle align-items-center justify-content-center mr-3 media-icon iconbox-45 bg-danger text-white">
|
||||
<i class="mdi mdi-server-network-off font-size-20"></i>
|
||||
</div>
|
||||
|
||||
<div class="media-body d-flex justify-content-between">
|
||||
<div class="message-contents">
|
||||
<h4 class="title">Server overloaded</h4>
|
||||
<p class="last-msg font-size-14">Donec mattis augue
|
||||
a nisl consequat, nec imperdiet ex rutrum. Fusce
|
||||
et vehicula enim. Sed in enim eu odio vehic.</p>
|
||||
|
||||
<span class="font-size-12 font-weight-medium text-secondary">
|
||||
<i class="mdi mdi-clock-outline"></i> 30 min
|
||||
ago...
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<a href="javscript:void(0)" class="media media-message media-notification">
|
||||
|
||||
<div class="d-flex rounded-circle align-items-center justify-content-center mr-3 media-icon iconbox-45 bg-purple text-white">
|
||||
<i class="mdi mdi-playlist-check font-size-20"></i>
|
||||
</div>
|
||||
|
||||
<div class="media-body d-flex justify-content-between">
|
||||
<div class="message-contents">
|
||||
<h4 class="title">Task complete</h4>
|
||||
<p class="last-msg font-size-14">Nam ut nisi erat.
|
||||
Ut quis tortor varius, hendrerit arcu quis,
|
||||
congue nisl. In scelerisque, sem ut ve.</p>
|
||||
|
||||
<span class="font-size-12 font-weight-medium text-secondary">
|
||||
<i class="mdi mdi-clock-outline"></i> 2 hrs
|
||||
ago...
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div class="tab-pane fade" id="profile2" role="tabpanel">
|
||||
<ul class="list-unstyled" data-simplebar style="height: 360px">
|
||||
<li>
|
||||
<a href="javscript:void(0)" class="media media-message media-notification">
|
||||
<div class="position-relative mr-3">
|
||||
<img class="rounded-circle" src="assets/img/user/u6.jpg" alt="Image">
|
||||
<span class="status away"></span>
|
||||
</div>
|
||||
<div class="media-body d-flex justify-content-between">
|
||||
<div class="message-contents">
|
||||
<h4 class="title">Hardiko</h4>
|
||||
<p class="last-msg">Donec mattis augue a nisl
|
||||
consequat, nec imperdiet ex rutrum. Fusce et
|
||||
vehicula enim. Sed in enim eu odio vehic.</p>
|
||||
|
||||
<span class="font-size-12 font-weight-medium text-secondary">
|
||||
<i class="mdi mdi-clock-outline"></i> 1 hrs
|
||||
ago...
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<a href="javscript:void(0)" class="media media-message media-notification">
|
||||
<div class="position-relative mr-3">
|
||||
<img class="rounded-circle" src="assets/img/user/u7.jpg" alt="Image">
|
||||
<span class="status away"></span>
|
||||
</div>
|
||||
<div class="media-body d-flex justify-content-between">
|
||||
<div class="message-contents">
|
||||
<h4 class="title">Browin</h4>
|
||||
<p class="last-msg">Nam ut nisi erat. Ut quis tortor
|
||||
varius, hendrerit arcu quis, congue nisl. In
|
||||
scelerisque, sem ut ve.</p>
|
||||
|
||||
<span class="font-size-12 font-weight-medium text-secondary">
|
||||
<i class="mdi mdi-clock-outline"></i> 1 hrs
|
||||
ago...
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<a href="javscript:void(0)" class="media media-message media-notification media-active">
|
||||
<div class="position-relative mr-3">
|
||||
<img class="rounded-circle" src="assets/img/user/u1.jpg" alt="Image">
|
||||
<span class="status active"></span>
|
||||
</div>
|
||||
<div class="media-body d-flex justify-content-between">
|
||||
<div class="message-contents">
|
||||
<h4 class="title">jenelia</h4>
|
||||
<p class="last-msg">Donec mattis augue a nisl
|
||||
consequat, nec imperdiet ex rutrum. Fusce et
|
||||
vehicula enim. Sed in enim eu odio vehic.</p>
|
||||
|
||||
<span class="font-size-12 font-weight-medium text-white">
|
||||
<i class="mdi mdi-clock-outline"></i> Just
|
||||
now...
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<a href="javscript:void(0)" class="media media-message media-notification">
|
||||
<div class="position-relative mr-3">
|
||||
<img class="rounded-circle" src="assets/img/user/u2.jpg" alt="Image">
|
||||
<span class="status away"></span>
|
||||
</div>
|
||||
<div class="media-body d-flex justify-content-between">
|
||||
<div class="message-contents">
|
||||
<h4 class="title">Bhavlio</h4>
|
||||
<p class="last-msg">Lorem ipsum dolor sit, amet
|
||||
consectetur adipisicing elit. Nam itaque
|
||||
doloremque odio, eligendi delectus vitae.</p>
|
||||
|
||||
<span class="font-size-12 font-weight-medium text-secondary">
|
||||
<i class="mdi mdi-clock-outline"></i> 1 hrs
|
||||
ago...
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<a href="javscript:void(0)" class="media media-message media-notification">
|
||||
<div class="position-relative mr-3">
|
||||
<img class="rounded-circle" src="assets/img/user/u5.jpg" alt="Image">
|
||||
<span class="status away"></span>
|
||||
</div>
|
||||
<div class="media-body d-flex justify-content-between">
|
||||
<div class="message-contents">
|
||||
<h4 class="title">Browini</h4>
|
||||
<p class="last-msg">Lorem ipsum dolor sit, amet
|
||||
consectetur adipisicing elit. Nam itaque
|
||||
doloremque odio, eligendi delectus vitae.</p>
|
||||
|
||||
<span class="font-size-12 font-weight-medium text-secondary">
|
||||
<i class="mdi mdi-clock-outline"></i> 1 hrs
|
||||
ago...
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div class="tab-pane fade" id="contact2" role="tabpanel">
|
||||
<ul class="list-unstyled" data-simplebar style="height: 360px">
|
||||
<li>
|
||||
<a href="javscript:void(0)" class="media media-message media-notification event-active">
|
||||
|
||||
<div class="d-flex rounded-circle align-items-center justify-content-center mr-3 media-icon iconbox-45 bg-info text-white">
|
||||
<i class="mdi mdi-calendar-check font-size-20"></i>
|
||||
</div>
|
||||
|
||||
<div class="media-body d-flex justify-content-between">
|
||||
<div class="message-contents">
|
||||
<h4 class="title">Upcomming event added</h4>
|
||||
<p class="last-msg font-size-14">03/Jan/2020 (1pm -
|
||||
2pm)</p>
|
||||
|
||||
<span class="font-size-12 font-weight-medium text-secondary">
|
||||
<i class="mdi mdi-clock-outline"></i> 10 min
|
||||
ago...
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<a href="javscript:void(0)" class="media media-message media-notification">
|
||||
|
||||
<div class="d-flex rounded-circle align-items-center justify-content-center mr-3 media-icon iconbox-45 bg-warning text-white">
|
||||
<i class="mdi mdi-chart-areaspline font-size-20"></i>
|
||||
</div>
|
||||
|
||||
<div class="media-body d-flex justify-content-between">
|
||||
<div class="message-contents">
|
||||
<h4 class="title">New Sales report</h4>
|
||||
<p class="last-msg font-size-14">Lorem ipsum dolor
|
||||
sit, amet consectetur adipisicing elit. Nam
|
||||
itaque doloremque odio, eligendi delectus vitae.
|
||||
</p>
|
||||
|
||||
<span class="font-size-12 font-weight-medium text-secondary">
|
||||
<i class="mdi mdi-clock-outline"></i> 1 hrs
|
||||
ago...
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<a href="javscript:void(0)" class="media media-message media-notification">
|
||||
|
||||
<div class="d-flex rounded-circle align-items-center justify-content-center mr-3 media-icon iconbox-45 bg-primary text-white">
|
||||
<i class="mdi mdi-account-multiple-check font-size-20"></i>
|
||||
</div>
|
||||
|
||||
<div class="media-body d-flex justify-content-between">
|
||||
<div class="message-contents">
|
||||
<h4 class="title">New Request</h4>
|
||||
<p class="last-msg font-size-14">Add Dany Jones as
|
||||
your contact consequat nec imperdiet ex rutrum.
|
||||
Fusce et vehicula enim. Sed in enim.</p>
|
||||
|
||||
<span class="my-1 btn btn-sm btn-success">Accept</span>
|
||||
<span class="my-1 btn btn-sm btn-secondary">Delete</span>
|
||||
|
||||
<span class="font-size-12 font-weight-medium text-secondary d-block">
|
||||
<i class="mdi mdi-clock-outline"></i> 5 min
|
||||
ago...
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<a href="javscript:void(0)" class="media media-message media-notification">
|
||||
|
||||
<div class="d-flex rounded-circle align-items-center justify-content-center mr-3 media-icon iconbox-45 bg-danger text-white">
|
||||
<i class="mdi mdi-server-network-off font-size-20"></i>
|
||||
</div>
|
||||
|
||||
<div class="media-body d-flex justify-content-between">
|
||||
<div class="message-contents">
|
||||
<h4 class="title">Server overloaded</h4>
|
||||
<p class="last-msg font-size-14">Donec mattis augue
|
||||
a nisl consequat, nec imperdiet ex rutrum. Fusce
|
||||
et vehicula enim. Sed in enim eu odio vehic.</p>
|
||||
|
||||
<span class="font-size-12 font-weight-medium text-secondary">
|
||||
<i class="mdi mdi-clock-outline"></i> 30 min
|
||||
ago...
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<a href="javscript:void(0)" class="media media-message media-notification">
|
||||
|
||||
<div class="d-flex rounded-circle align-items-center justify-content-center mr-3 media-icon iconbox-45 bg-purple text-white">
|
||||
<i class="mdi mdi-playlist-check font-size-20"></i>
|
||||
</div>
|
||||
|
||||
<div class="media-body d-flex justify-content-between">
|
||||
<div class="message-contents">
|
||||
<h4 class="title">New Task complete</h4>
|
||||
<p class="last-msg font-size-14">Nam ut nisi erat.
|
||||
Ut quis tortor varius, hendrerit arcu quis,
|
||||
congue nisl. In scelerisque, sem ut ve.</p>
|
||||
|
||||
<span class="font-size-12 font-weight-medium text-secondary">
|
||||
<i class="mdi mdi-clock-outline"></i> 2 hrs
|
||||
ago...
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<ul class="dropdown-menu dropdown-menu-right d-none">
|
||||
<li class="dropdown-header">You have 5 notifications</li>
|
||||
<li>
|
||||
<a href="#">
|
||||
<i class="mdi mdi-account-plus"></i> New user registered
|
||||
<span class=" font-size-12 d-inline-block float-right"><i class="mdi mdi-clock-outline"></i> 10 AM</span>
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="#">
|
||||
<i class="mdi mdi-account-remove"></i> User deleted
|
||||
<span class=" font-size-12 d-inline-block float-right"><i class="mdi mdi-clock-outline"></i> 07 AM</span>
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="#">
|
||||
<i class="mdi mdi-chart-areaspline"></i> Sales report is ready
|
||||
<span class=" font-size-12 d-inline-block float-right"><i class="mdi mdi-clock-outline"></i> 12 PM</span>
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="#">
|
||||
<i class="mdi mdi-account-supervisor"></i> New client
|
||||
<span class=" font-size-12 d-inline-block float-right"><i class="mdi mdi-clock-outline"></i> 10 AM</span>
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="#">
|
||||
<i class="mdi mdi-server-network-off"></i> Server overloaded
|
||||
<span class=" font-size-12 d-inline-block float-right"><i class="mdi mdi-clock-outline"></i> 05 AM</span>
|
||||
</a>
|
||||
</li>
|
||||
<li class="dropdown-footer">
|
||||
<a class="text-center" href="#"> View All </a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="right-sidebar-in right-sidebar-2-menu">
|
||||
<i class="mdi mdi-settings-outline mdi-spin"></i>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</nav>
|
||||
</header>
|
||||
|
||||
|
||||
<!-- 3-19-24 raymart added vendor search -->
|
||||
<?php if (!empty($vendorSearchResult['results'])) : ?>
|
||||
<div class="shop-pro-content" style="margin-bottom:40px; margin-right: 2%; margin-left: 2%;">
|
||||
<div class="ec-product-inner">
|
||||
<h5 class="ec-pro-title" style="margin-top: 25px; margin-left: 5%; font-size: 25px;">Vendor Search Results</h5>
|
||||
<div class="row mt-4">
|
||||
<?php
|
||||
$count = 0;
|
||||
foreach ($vendorSearchResult['results'] as $vendor) {
|
||||
if ($count < 2) {
|
||||
?>
|
||||
<div class="col-md-12">
|
||||
<div class="card" style="margin:5px">
|
||||
<div class="card-body">
|
||||
<div class="vendor-info" style="display: flex; align-items: center;">
|
||||
<div class="ec-catalog-vendor" style="display: inline-block;">
|
||||
<a href="vendor-profile.php?id=<?php echo $vendor["_id"] ?>">
|
||||
<?php if (isset($vendor['vendor_image'])) : ?>
|
||||
<img src="<?php echo $vendor['vendor_image']; ?>" alt="<?php echo $vendor['user_login']; ?>" class="vendor-image" style="max-width: 100px; max-height: 100px;">
|
||||
<?php else : ?>
|
||||
<img src="https://api.obanana.com/images/storage/web_images/1708588564876-viber_image_2024-02-22_15-54-42-498.png" class="vendor-image-placeholder" style="max-width: 100px; max-height: 100px;">
|
||||
<?php endif; ?>
|
||||
</a>
|
||||
</div>
|
||||
<div class="vendor-details" style="display:inline-block;">
|
||||
<h6 class="ec-pro-title" style="padding:0 30px;font-family: Poppins, sans-serif; text-decoration: none; color: #777;white-space: nowrap;text-overflow: ellipsis;display: block;font-size: 16px;font-weight: 400;">
|
||||
<a href="vendor-profile.php?id=<?php echo $vendor["_id"] ?>">
|
||||
<?php echo $vendor['user_login']; ?>
|
||||
</a>
|
||||
</h6>
|
||||
</div>
|
||||
<div class="card text-center" style="margin-left: auto; margin-right: 5px;">
|
||||
<div class="card-body">
|
||||
<h6>Seller Products</h6>
|
||||
<?php
|
||||
$products = productList();
|
||||
$vendorId = $vendor['_id'];
|
||||
$product = array_filter($products, function ($var) use ($vendorId) {
|
||||
return ($var['vendor_api_id'] == $vendorId);
|
||||
});
|
||||
?>
|
||||
<p><?php echo count($product); ?></p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card text-center" style="margin-left: 5px; margin-right: 5px;">
|
||||
<div class="card-body">
|
||||
<h6>Seller since</h6>
|
||||
<p><?php echo $vendor['date_registered']; ?></p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php
|
||||
}
|
||||
$count++;
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
<!-- vendor search end -->
|
||||
|
||||
<!-- 3-19-24 raymart added Shop content Start -->
|
||||
<div class="shop-pro-content" style="margin-right: 2%; margin-left: 2%;">
|
||||
<div class="shop-pro-inner list-view">
|
||||
<div class="row">
|
||||
<?php
|
||||
// $productSearchResult = [];
|
||||
// foreach ($productSearchResult['results'] as $product => $productListVendor) {
|
||||
// echo "$product .":" . $productListVendor";
|
||||
// $vendorOfProduct = getVendorbyId($product['vendor_api_id']);
|
||||
|
||||
$products = productListVendor($vendorId);
|
||||
$totalProducts = count($products);
|
||||
|
||||
|
||||
for ($i = 0; $i <= $totalProducts - 1; $i++) {
|
||||
$product = $products[$i];
|
||||
?>
|
||||
<div class="col-lg-3 col-md-4 col-sm-6">
|
||||
<div class="card-wrapper">
|
||||
<div class="card-container">
|
||||
<div class="card-top">
|
||||
<div class="image-container" style="height: 300px;"> <!-- Adjust the height as needed -->
|
||||
<?php
|
||||
if (isset($product['images'])) {
|
||||
$image_urls = explode(',', $product['images']);
|
||||
if (!empty($image_urls)) {
|
||||
$first_image_url = trim($image_urls[0]);
|
||||
?>
|
||||
<img class="img-fluid" src="<?php echo $first_image_url; ?>" alt="edit" style="object-fit: cover; width: 100%; height: 100%;"/>
|
||||
<?php
|
||||
}
|
||||
} else {
|
||||
?>
|
||||
<img class="img-fluid rounded-circle" src="https://api.obanana.com/images/storage/web_images/1710214273217-no_image.png" alt="edit" />
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-bottom">
|
||||
<h3><?php echo $product['product_name']; ?></h3>
|
||||
<p>₱<?php echo $product['regular_price']; ?></p>
|
||||
</div>
|
||||
<div class="card-action">
|
||||
<div class="card-edit" onclick="editProduct('<?php echo $product['_id'] ?>');"><i class="mdi mdi-circle-edit-outline"></i></div>
|
||||
<div class="card-preview"><i class="mdi mdi-eye-outline"></i></div>
|
||||
<div class="card-remove" onclick="deleteProd('<?php echo $product['_id'] ?>');"><i class="mdi mdi mdi-delete-outline"></i></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!--Shop content End -->
|
||||
|
||||
<!-- 3-19-24 raymart added function for delete & edit -->
|
||||
<script>
|
||||
|
||||
var sessionToken = '<?php echo isset($_SESSION["token"]) ? $_SESSION["token"] : ""; ?>';
|
||||
var email = '<?php echo isset($_SESSION["email"]) ? $_SESSION["email"] : ""; ?>';
|
||||
var password = '<?php echo isset($_SESSION["password"]) ? $_SESSION["password"] : ""; ?>';
|
||||
|
||||
function editProduct(productId) {
|
||||
console.log("Session Token:", sessionToken);
|
||||
login(email, password, function() {
|
||||
// Removed the call to updateSessionToken
|
||||
window.open("product-edit.php?id=" + productId, "_self");
|
||||
});
|
||||
}
|
||||
|
||||
function deleteProd(productId) {
|
||||
let text = "Please confirm delete action!\nClick OK or Cancel button.";
|
||||
if (confirm(text) == true) {
|
||||
window.open("vendor-delete-action1.php?id=" + productId, "_self");
|
||||
}
|
||||
}
|
||||
|
||||
function login(username, password, callback) {
|
||||
fetch("https://<?php echo $_SESSION["data_endpoint"]; ?>/api/v1/login", {
|
||||
method: "POST",
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
"X-Api-Key": "{{apiKey}}"
|
||||
},
|
||||
body: JSON.stringify({
|
||||
username: username,
|
||||
password: password
|
||||
})
|
||||
})
|
||||
.then(response => {
|
||||
if (response.ok) {
|
||||
return response.json();
|
||||
} else {
|
||||
throw new Error("Unable to login");
|
||||
}
|
||||
})
|
||||
.then(data => {
|
||||
// Update the session token on the server side
|
||||
fetch("update-token-session.php", {
|
||||
method: "POST",
|
||||
headers: {
|
||||
"Content-Type": "application/json"
|
||||
},
|
||||
body: JSON.stringify({
|
||||
token: data.token
|
||||
})
|
||||
})
|
||||
.then(response => response.json())
|
||||
.then(result => {
|
||||
if (result.status === 'success') {
|
||||
// Update the session token in the client-side variable
|
||||
sessionToken = data.token;
|
||||
console.log("New Token:", sessionToken);
|
||||
callback();
|
||||
} else {
|
||||
throw new Error("Unable to update session token");
|
||||
}
|
||||
});
|
||||
})
|
||||
.catch(error => {
|
||||
console.error("Error:", error.message);
|
||||
});
|
||||
}
|
||||
|
||||
</script>
|
||||
<!-- 3-19-24 raymart added function for delete & edit -->
|
||||
|
||||
|
||||
<!-- Common Javascript -->
|
||||
<script src="assets/plugins/jquery/jquery-3.5.1.min.js"></script>
|
||||
<script src="assets/js/bootstrap.bundle.min.js"></script>
|
||||
<script src="assets/plugins/simplebar/simplebar.min.js"></script>
|
||||
<script src="assets/plugins/jquery-zoom/jquery.zoom.min.js"></script>
|
||||
<script src="assets/plugins/slick/slick.min.js"></script>
|
||||
|
||||
<!-- Option Switcher -->
|
||||
<script src="assets/plugins/options-sidebar/optionswitcher.js"></script>
|
||||
|
||||
<!-- Ekka Custom -->
|
||||
<script src="assets/js/ekka.js"></script>
|
||||
|
||||
</body>
|
||||
|
||||
</html>
|
|
@ -0,0 +1,30 @@
|
|||
<?php
|
||||
// 03-14-2024 Raymart & stacy Search Filter Action
|
||||
|
||||
$categories = isset($_POST['category']) ? $_POST['category'] : array();
|
||||
$vendorId= $_POST['vendorId'];
|
||||
$categoryFinal = null;
|
||||
$count=0;
|
||||
|
||||
foreach ($categories as $category) {
|
||||
// Perform checks or actions for each category
|
||||
// For example:
|
||||
$categoriesCopy = $categoryFinal;
|
||||
$categoryFinal =$categoryFinal!== null? $categoriesCopy . '&category['.$count.']='.$category:$categoriesCopy . 'category['.$count.']='.$category;
|
||||
$count+=1;
|
||||
|
||||
|
||||
echo $categoryFinal;
|
||||
// You can add your logic here
|
||||
}
|
||||
$minPrice = isset($_POST['minPrice']) ? $_POST['minPrice'] : null;
|
||||
$maxPrice = isset($_POST['maxPrice']) ? $_POST['maxPrice'] : null;
|
||||
if(isset($categoryFinal)){
|
||||
header("location: catalog-single-vendor.php?id=$vendorId&$categoryFinal&minPrice=$minPrice&maxPrice=$maxPrice");
|
||||
|
||||
}else{
|
||||
|
||||
header("location: catalog-single-vendor.php?id=$vendorId&minPrice=$minPrice&maxPrice=$maxPrice");
|
||||
|
||||
}
|
||||
// 03-14-2024 Raymart & stacy Search Filter Action
|
|
@ -11,6 +11,89 @@ if ($_SESSION["userId"] <> "") {
|
|||
} else {
|
||||
$_SESSION["isLoggedIn"] = false;
|
||||
}
|
||||
$products = productListVendor($_GET["id"]);
|
||||
|
||||
$filteredProducts = [];
|
||||
|
||||
if (!empty($_GET['minPrice']) || !empty($_GET['maxPrice']) || !empty($_GET['category'])) {
|
||||
$filteredProducts = [];
|
||||
$minPrice = isset($_GET['minPrice']) && $_GET['minPrice'] !== '' ? floatval($_GET['minPrice']) : null;
|
||||
$maxPrice = isset($_GET['maxPrice']) && $_GET['maxPrice'] !== '' ? floatval($_GET['maxPrice']) : null;
|
||||
|
||||
// echo "Min Price: " . ($minPrice !== null ? $minPrice : "null") . "<br>";
|
||||
// echo "Max Price: " . ($maxPrice !== null ? $maxPrice : "null") . "<br>";
|
||||
|
||||
$selectedCategories = isset($_GET['category']) ? $_GET['category'] : [];
|
||||
|
||||
if (!empty($selectedCategories) && (($minPrice == null) && ($maxPrice == null))) {
|
||||
// var_dump("filtering categories without price");
|
||||
foreach ($selectedCategories as $selectedCategory) {
|
||||
$category = strtolower(trim($selectedCategory));
|
||||
foreach ($products as $result) {
|
||||
$product = $result;
|
||||
|
||||
$productCategory = strtolower(trim($product['product_category']));
|
||||
|
||||
if (
|
||||
$productCategory == $category
|
||||
) {
|
||||
$filteredProducts[] = $result;
|
||||
}
|
||||
}
|
||||
}
|
||||
} elseif (!empty($selectedCategories) && (!empty($minPrice) || !empty($maxPrice))) {
|
||||
// var_dump("filtering categories and price");
|
||||
if ($minPrice === null) {
|
||||
$minPrice = 0;
|
||||
}
|
||||
if ($maxPrice === null) {
|
||||
$maxPrice = PHP_FLOAT_MAX;
|
||||
}
|
||||
foreach ($selectedCategories as $selectedCategory) {
|
||||
$category = strtolower(trim($selectedCategory));
|
||||
foreach ($products as $result) {
|
||||
$product = $result;
|
||||
$productPrice = isset($product['sale_price']) ? $product['sale_price'] : $product['regular_price'];
|
||||
$productCategory = strtolower(trim($product['product_category']));
|
||||
if (
|
||||
$productCategory = $category && (($productPrice >= $minPrice) &&
|
||||
($productPrice <= $maxPrice))
|
||||
) {
|
||||
$filteredProducts[] = $result;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
foreach ($products as $result) {
|
||||
// var_dump("filtering");
|
||||
$product = $result;
|
||||
$productPrice = isset($product['sale_price']) ? $product['sale_price'] : $product['regular_price'];
|
||||
// var_dump( $minPrice);
|
||||
// var_dump( $productPrice);
|
||||
// var_dump( $productPrice >= $minPrice);
|
||||
|
||||
|
||||
|
||||
if ($minPrice === null) {
|
||||
$minPrice = 0;
|
||||
}
|
||||
|
||||
if ($maxPrice === null) {
|
||||
$maxPrice = PHP_FLOAT_MAX;
|
||||
}
|
||||
if (($minPrice === null || $productPrice >= $minPrice) &&
|
||||
($maxPrice === null || $productPrice <= $maxPrice)
|
||||
) {
|
||||
$filteredProducts[] = $result;
|
||||
// var_dump("filtering heree");
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
$filteredProducts = $products;
|
||||
}
|
||||
?>
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
|
@ -268,7 +351,6 @@ if ($_SESSION["userId"] <> "") {
|
|||
<a href="vendor-profile.html">
|
||||
<h6>Seller Products</h6>
|
||||
<?php
|
||||
$products = productListVendor($_GET["id"]);
|
||||
?>
|
||||
</a>
|
||||
<p><?php echo count($products) ?> Products</p>
|
||||
|
@ -334,7 +416,7 @@ if ($_SESSION["userId"] <> "") {
|
|||
<div class="row">
|
||||
<?php
|
||||
//var_dump($products);
|
||||
foreach ($products as $product){
|
||||
foreach ($filteredProducts as $product){
|
||||
|
||||
// $vendorOfProduct = getVendorbyId($product['vendor_api_id']);
|
||||
// $pid = $i;
|
||||
|
@ -358,7 +440,7 @@ if ($_SESSION["userId"] <> "") {
|
|||
}
|
||||
} else {
|
||||
?>
|
||||
<img class="main-image" src="https://upload.wikimedia.org/wikipedia/commons/thumb/6/65/No-Image-Placeholder.svg/495px-No-Image-Placeholder.svg.png?20200912122019" alt="edit" />
|
||||
<img class="main-image" src="https://api.obanana.com/images/storage/web_images/1710214273217-no_image.png" alt="edit" />
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
|
@ -489,64 +571,83 @@ if ($_SESSION["userId"] <> "") {
|
|||
|
||||
<!-- Sidebar Category Block -->
|
||||
<div class="ec-sidebar-block">
|
||||
<div class="ec-sb-title">
|
||||
<h3 class="ec-sidebar-title">Category</h3>
|
||||
</div>
|
||||
<div class="ec-sb-block-content">
|
||||
<ul>
|
||||
<li>
|
||||
<div class="ec-sidebar-block-item">
|
||||
<input type="checkbox" checked /> <a href="#">clothes</a><span class="checked"></span>
|
||||
</div>
|
||||
</li>
|
||||
<li>
|
||||
<div class="ec-sidebar-block-item">
|
||||
<input type="checkbox" /> <a href="#">Bags</a><span class="checked"></span>
|
||||
</div>
|
||||
</li>
|
||||
<li>
|
||||
<div class="ec-sidebar-block-item">
|
||||
<input type="checkbox" /> <a href="#">Shoes</a><span class="checked"></span>
|
||||
</div>
|
||||
</li>
|
||||
<li>
|
||||
<div class="ec-sidebar-block-item">
|
||||
<input type="checkbox" /> <a href="#">cosmetics</a><span class="checked"></span>
|
||||
</div>
|
||||
</li>
|
||||
<li>
|
||||
<div class="ec-sidebar-block-item">
|
||||
<input type="checkbox" /> <a href="#">electrics</a><span class="checked"></span>
|
||||
</div>
|
||||
</li>
|
||||
<li>
|
||||
<div class="ec-sidebar-block-item">
|
||||
<input type="checkbox" /> <a href="#">phone</a><span class="checked"></span>
|
||||
</div>
|
||||
</li>
|
||||
<li id="ec-more-toggle-content" style="padding: 0; display: none;">
|
||||
<div class="ec-sb-title">
|
||||
<h3 class="ec-sidebar-title">Category</h3>
|
||||
</div>
|
||||
<div class="ec-sb-block-content">
|
||||
<form method="POST" action="catalog-single-vendor-action.php">
|
||||
<ul>
|
||||
<input type="hidden" name="vendorId" value="<?php echo $_GET["id"]?>"/>
|
||||
|
||||
<li>
|
||||
<div class="ec-sidebar-block-item">
|
||||
<input type="checkbox" /> <a href="#">Watch</a><span class="checked"></span>
|
||||
<input type="checkbox" name="category[]" value="Electronics" <?php echo (isset($_POST['category']) && in_array('Electronics', $_POST['category'])) || (isset($_GET['category']) && in_array('Electronics', $_GET['category'])) ? 'checked' : ''; ?> /> <a>Electronics</a><span class="checked"></span>
|
||||
</div>
|
||||
</li>
|
||||
<li>
|
||||
<div class="ec-sidebar-block-item">
|
||||
<input type="checkbox" /> <a href="#">Cap</a><span class="checked"></span>
|
||||
<input type="checkbox" name="category[]" value="Solar" <?php echo (isset($_POST['category']) && in_array('Solar', $_POST['category'])) || (isset($_GET['category']) && in_array('Solar', $_GET['category'])) ? 'checked' : ''; ?> /> <a>Solar</a><span class="checked"></span>
|
||||
</div>
|
||||
</li>
|
||||
<li>
|
||||
<div class="ec-sidebar-block-item">
|
||||
<input type="checkbox" name="category[]" value="E-bike" <?php echo (isset($_POST['category']) && in_array('E-bike', $_POST['category'])) || (isset($_GET['category']) && in_array('E-bike', $_GET['category'])) ? 'checked' : ''; ?> /> <a>E-bike</a><span class="checked"></span>
|
||||
</div>
|
||||
</li>
|
||||
<li>
|
||||
<div class="ec-sidebar-block-item">
|
||||
<input type="checkbox" name="category[]" value="E-vehicle" <?php echo (isset($_POST['category']) && in_array('E-vehicle', $_POST['category'])) || (isset($_GET['category']) && in_array('E-vehicle', $_GET['category'])) ? 'checked' : ''; ?> /> <a>E-vehicle</a><span class="checked"></span>
|
||||
|
||||
</div>
|
||||
</li>
|
||||
<li>
|
||||
<div class="ec-sidebar-block-item">
|
||||
<input type="checkbox" name="category[]" value="Appliance" <?php echo (isset($_POST['category']) && in_array('Appliance', $_POST['category'])) || (isset($_GET['category']) && in_array('Appliance', $_GET['category'])) ? 'checked' : ''; ?> /> <a>Appliance</a><span class="checked"></span>
|
||||
|
||||
</div>
|
||||
</li>
|
||||
<li>
|
||||
<div class="ec-sidebar-block-item">
|
||||
<input type="checkbox" name="category[]" value="Smart Home" <?php echo (isset($_POST['category']) && in_array('Smart Home', $_POST['category'])) || (isset($_GET['category']) && in_array('Smart Home', $_GET['category'])) ? 'checked' : ''; ?> /> <a>Smart Home</a><span class="checked"></span>
|
||||
</div>
|
||||
</li>
|
||||
<li>
|
||||
<div class="ec-sidebar-block-item">
|
||||
<input type="checkbox" name="category[]" value="Home" <?php echo (isset($_POST['category']) && in_array('Home', $_POST['category'])) || (isset($_GET['category']) && in_array('Home', $_GET['category'])) ? 'checked' : ''; ?> /> <a>Home</a><span class="checked"></span>
|
||||
</div>
|
||||
</li>
|
||||
<li>
|
||||
<div class="ec-sidebar-block-item">
|
||||
<input type="checkbox" name="category[]" value="Apparel" <?php echo (isset($_POST['category']) && in_array('Apparel', $_POST['category'])) || (isset($_GET['category']) && in_array('Apparel', $_GET['category'])) ? 'checked' : ''; ?> /> <a>Apparel</a><span class="checked"></span>
|
||||
</div>
|
||||
</li>
|
||||
<li>
|
||||
<div class="ec-sidebar-block-item">
|
||||
<input type="checkbox" name="category[]" value="Heavy Equipment" <?php echo (isset($_POST['category']) && in_array('Heavy Equipment', $_POST['category'])) || (isset($_GET['category']) && in_array('Heavy Equipment', $_GET['category'])) ? 'checked' : ''; ?> /> <a>Heavy Equipment</a><span class="checked"></span>
|
||||
</div>
|
||||
</li>
|
||||
<li>
|
||||
<div style="padding-top:10px;">
|
||||
<label for="minPrice" style="margin-bottom:-5px;">Min Price:</label>
|
||||
<input style="height:40px" type="number" name="minPrice" id="minPrice" value="<?php echo isset($_POST['minPrice']) ? $_POST['minPrice'] : (isset($_GET['minPrice']) ? $_GET['minPrice'] : ''); ?>" />
|
||||
</div>
|
||||
</li>
|
||||
<li>
|
||||
<div>
|
||||
<label for="maxPrice" style="margin-bottom:-5px;">Max Price:</label>
|
||||
<input style="height:40px" type="number" name="maxPrice" id="maxPrice" value="<?php echo isset($_POST['maxPrice']) ? $_POST['maxPrice'] : (isset($_GET['maxPrice']) ? $_GET['maxPrice'] : ''); ?>" />
|
||||
</div>
|
||||
</li>
|
||||
<li>
|
||||
<div style="padding-top:10px;">
|
||||
<button style="font-size:12px; height:30px; width:60px;" class="btn-primary" type="submit">Apply</button>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li>
|
||||
<div class="ec-sidebar-block-item ec-more-toggle">
|
||||
<span class="checked"></span><span id="ec-more-toggle">More
|
||||
Categories</span>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
<!-- <button type="submit">Apply</button> -->
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- Sidebar Size Block -->
|
||||
<!-- <div class="ec-sidebar-block">
|
||||
<div class="ec-sb-title">
|
||||
|
|
|
@ -993,13 +993,13 @@ if (isset($customer_data[0]["address"]) && is_array($customer_data[0]["address"]
|
|||
</div>
|
||||
<div class="ec-pro-content">
|
||||
<h5 class="ec-pro-title"><a href="product-left-sidebar.php?id=<?php echo $item['product']['product_id']; ?>"><?php echo $item['product']['name']; ?></a></h5>
|
||||
<div class="ec-pro-rating">
|
||||
<!-- <div class="ec-pro-rating">
|
||||
<i class="ecicon eci-star fill"></i>
|
||||
<i class="ecicon eci-star fill"></i>
|
||||
<i class="ecicon eci-star fill"></i>
|
||||
<i class="ecicon eci-star fill"></i>
|
||||
<i class="ecicon eci-star"></i>
|
||||
</div>
|
||||
</div> -->
|
||||
<span class="ec-price">
|
||||
<span class="new-price"><?php echo $item['price']; ?> x <?php echo $item['quantity']; ?></span>
|
||||
</span>
|
||||
|
|
Loading…
Reference in New Issue