This commit is contained in:
Kerim 2023-09-03 17:44:14 +05:00
parent bd5540ac8f
commit c30bb7c325
7 changed files with 243 additions and 76 deletions

View File

@ -3,14 +3,16 @@ layout = "seller-master"
title = "Seller/home"
meta_title = "Seller Panel"
==
{% partial "seller/loader" loader_id="loader_seller_report" %}
<div class="grid grid-cols-12 gap-6">
<div class="col-span-12 2xl:col-span-12">
<div class="grid grid-cols-12 gap-6">
<!-- BEGIN: General Report -->
<div class="col-span-12 mt-8">
<div class="col-span-12 mt-8" id="report_content">
<div class="intro-y flex items-center h-10">
<h2 class="text-lg font-medium truncate mr-5">
General Report
{{'report.title'|_}}
</h2>
<a href="" class="ml-auto flex items-center text-primary"> <i data-lucide="refresh-ccw" class="w-4 h-4 mr-3"></i> Reload Data </a>
</div>
@ -20,12 +22,10 @@ meta_title = "Seller Panel"
<div class="box p-5">
<div class="flex">
<i data-lucide="shopping-cart" class="report-box__icon text-primary"></i>
<div class="ml-auto">
<div class="report-box__indicator bg-success tooltip cursor-pointer" title="33% Higher than last month"> 33% <i data-lucide="chevron-up" class="w-4 h-4 ml-0.5"></i> </div>
</div>
</div>
<div class="text-3xl font-medium leading-8 mt-6">4.710</div>
<div class="text-base text-slate-500 mt-1">Item Sales</div>
<div class="text-3xl font-medium leading-8 mt-6" id="dashboard_order"></div>
<div class="text-base text-slate-500 mt-1">{{'dashboard.order.title'|_}}</div>
</div>
</div>
</div>
@ -33,17 +33,14 @@ meta_title = "Seller Panel"
<div class="report-box zoom-in">
<div class="box p-5">
<div class="flex">
<i data-lucide="credit-card" class="report-box__icon text-pending"></i>
<div class="ml-auto">
<div class="report-box__indicator bg-danger tooltip cursor-pointer" title="2% Lower than last month"> 2% <i data-lucide="chevron-down" class="w-4 h-4 ml-0.5"></i> </div>
</div>
<i data-lucide="package" class="report-box__icon text-pending"></i>
</div>
<div class="text-3xl font-medium leading-8 mt-6">3.721</div>
<div class="text-base text-slate-500 mt-1">New Orders</div>
<div class="text-3xl font-medium leading-8 mt-6" id="dashboard_product"></div>
<div class="text-base text-slate-500 mt-1">{{'dashboard.product.title'|_}}</div>
</div>
</div>
</div>
<div class="col-span-12 sm:col-span-6 xl:col-span-3 intro-y">
<!-- <div class="col-span-12 sm:col-span-6 xl:col-span-3 intro-y">
<div class="report-box zoom-in">
<div class="box p-5">
<div class="flex">
@ -70,7 +67,7 @@ meta_title = "Seller Panel"
<div class="text-base text-slate-500 mt-1">Unique Visitor</div>
</div>
</div>
</div>
</div> -->
</div>
</div>
<!-- END: General Report -->
@ -78,4 +75,6 @@ meta_title = "Seller Panel"
</div>
</div>
</div>
</div>
{% partial "sellerApi/getReport" sellerId=user.seller_id %}

View File

@ -1,10 +1,14 @@
title = "Seller order detail"
url = "/seller/order/:id"
meta_title = "Seller Order"
layout = "seller-master"
title = "Seller order detail"
meta_title = "Seller Order"
==
<?php
function onStart() {
$this["orderId"] = $this->param("id");
}
?>
==
<div class="intro-y flex flex-col sm:flex-row items-center mt-8">
<h2 class="text-lg font-medium mr-auto">
{{'order.detail.title'|_}}
@ -15,8 +19,9 @@ layout = "seller-master"
</div>
</div>
<!-- BEGIN: Transaction Details -->
{% partial "seller/loader" loader_id="loader_seller_order" %}
<div class="intro-y grid grid-cols-11 gap-5 mt-5">
<div class="col-span-12 lg:col-span-4 2xl:col-span-3">
<div class="col-span-12 lg:col-span-4 2xl:col-span-3" id="order_content">
<div class="box p-5 rounded-md">
<div class="flex items-center border-b border-slate-200/60 dark:border-darkmode-400 pb-5 mb-5">
<div class="font-medium text-base truncate">{{'order.detail.title'|_}}</div>
@ -24,15 +29,26 @@ layout = "seller-master"
</div>
<div class="flex items-center"> <i data-lucide="clipboard" class="w-4 h-4 text-slate-500 mr-2"></i>
{{'order.no.title'|_}}: <a href=""
class="underline decoration-dotted ml-1">INV/20220217/MPL/2053411933</a> </div>
class="underline decoration-dotted ml-1" id="order_no"></a> </div>
<div class="flex items-center mt-3"> <i data-lucide="user" class="w-4 h-4 text-slate-500 mr-2"></i>
{{'order.customer.title'|_}}: <a href="" class="ml-1" id="order_customer"></a> </div>
<div class="flex items-center mt-3"> <i data-lucide="phone" class="w-4 h-4 text-slate-500 mr-2"></i>
{{'order.phone.title'|_}}: <a href="" class="ml-1" id="order_phone"></a> </div>
<div class="flex items-center mt-3"> <i data-lucide="calendar" class="w-4 h-4 text-slate-500 mr-2"></i>
{{'order.date'|_}} </div>
{{'order.date'|_}}: <a href="" class="ml-1" id="order_date"></a> </div>
<div class="flex items-center mt-3"> <i data-lucide="package" class="w-4 h-4 text-slate-500 mr-2"></i>
{{'order.status.title'|_}} <span class="bg-success/20 text-success rounded px-2 ml-1" id="order_status"></span>
</div>
<div class="flex items-center mt-3"> <i data-lucide="map-pin" class="w-4 h-4 text-slate-500 mr-2"></i>
{{'order.address'|_}} <span class="bg-success/20 text-success rounded px-2 ml-1">Completed</span>
{{'order.address'|_}} <a href="" class="ml-1" id="order_address"></a>
</div>
<div class="flex items-center border-t border-slate-200/60 dark:border-darkmode-400 pt-5 mt-5 font-medium">
<i data-lucide="credit-card" class="w-4 h-4 text-slate-500 mr-2"></i> Grand Total:
<div class="ml-auto">$15,000.00</div>
<i data-lucide="credit-card" class="w-4 h-4 text-slate-500 mr-2"></i> {{'grand.total.title'|_}}
<div class="ml-auto" id="order_total"></div>
</div>
</div>
@ -48,42 +64,13 @@ layout = "seller-master"
<thead>
<tr>
<th class="whitespace-nowrap !py-5">{{'product.title'|_}}</th>
<th class="whitespace-nowrap text-right">{{'product.price.title'|_}}</th>
<th class="whitespace-nowrap text-right">{{'product.qty'|_}}</th>
<th class="whitespace-nowrap text-right">{{'product.total'|_}}</th>
<th class="whitespace-nowrap text-center">{{'product.price.title'|_}}</th>
<th class="whitespace-nowrap text-center">{{'product.qty'|_}}</th>
<th class="whitespace-nowrap text-center">{{'product.total'|_}}</th>
</tr>
</thead>
<tbody>
<tr>
<td class="!py-4">
<div class="flex items-center">
<div class="w-10 h-10 image-fit zoom-in">
<img alt="Midone - HTML Admin Template"
class="rounded-lg border-2 border-white shadow-md tooltip"
src="dist/images/preview-2.jpg" title="Uploaded at 9 October 2020">
</div>
<a href="" class="font-medium whitespace-nowrap ml-4">Nike Tanjun</a>
</div>
</td>
<td class="text-right">$25,000.00</td>
<td class="text-right">2</td>
<td class="text-right">$50,000.00</td>
</tr>
<tr>
<td class="!py-4">
<div class="flex items-center">
<div class="w-10 h-10 image-fit zoom-in">
<img alt="Midone - HTML Admin Template"
class="rounded-lg border-2 border-white shadow-md tooltip"
src="dist/images/preview-9.jpg" title="Uploaded at 23 December 2020">
</div>
<a href="" class="font-medium whitespace-nowrap ml-4">Nike Tanjun</a>
</div>
</td>
<td class="text-right">$69,000.00</td>
<td class="text-right">2</td>
<td class="text-right">$138,000.00</td>
</tr>
<tbody id="order_items">
</tbody>
</table>
@ -92,3 +79,5 @@ layout = "seller-master"
</div>
</div>
<!-- END: Transaction Details -->
{% partial "sellerApi/getOrder" sellerOrderId=orderId %}

View File

@ -18,7 +18,7 @@
placeholder="" disabled>
</div>
<div class="grid grid-cols-12 gap-2">
<div class="mt-3 col-span-6">
<div class="mt-3 col-span-4">
<label for="crud-form-22" class="form-label">{{'product.status.title'|_}} </label>
<select class="form-control w-full" name="stat" id="product_status">
@ -26,13 +26,20 @@
</div>
<div class="mt-3 col-span-6 product_featured">
<div class="mt-3 col-span-4 product_featured">
<label for="crud-form-2" class="form-label">{{'product.featured.title'|_}} </label>
<select class="form-control w-full" name="featured" id="product_featured">
</select>
</div>
<div class="mt-3 col-span-4">
<label for="crud-form-2" class="form-label">{{'product.category.title'|_}} </label>
<select class="form-control w-full" name="categories" id="product_categories">
</select>
</div>
</div>
<div class="grid grid-cols-12 gap-2">
<div class="mt-3 col-span-6">
@ -75,7 +82,8 @@
</div>
</div>
<input style="display:none" name="images[files][]" type="file" multiple class="form-control" id="prodImgs2" />
<input style="display:none" name="images[files][]" type="file" multiple class="form-control"
id="prodImgs2" />
<input name="product_id" value="{{id}}" type="hidden">
<input name="user" value="romanah_" type="hidden">
@ -132,6 +140,36 @@
<script>
getProduct();
vendorCats();
function vendorCats() {
$(document).ready(function () {
$.ajax({
url: `https://nurgul.com.tm/app/api/vendor/{{user.seller_id}}`,
type: 'GET',
dataType: 'json',
success: async function (data, textStatus, xhr) {
// $('#loader').hide();
// $('#deatil_screen').show();
var vendorCats = data.data.categories;
for (var cat of vendorCats) {
$('#product_categories').append(`
<option value="`+cat.id+`">`+ cat.name +`</option>
`);
}
},
error: function (xhr, textStatus, errorThrown) {
console.log('Error in Operation');
}
});
});
}
function getProduct() {
$(document).ready(function () {
@ -185,8 +223,7 @@
let xhrr = new XMLHttpRequest()
xhrr.open("GET", image.original_image_url)
xhrr.responseType = "blob"
xhrr.onload = function()
{
xhrr.onload = function () {
blob = xhrr.response
let file = new File([blob], image.original_image_url);
container.items.add(file);
@ -203,7 +240,7 @@
});
}
async function getFileFromUrl(url, name, defaultType = 'image/jpeg'){
async function getFileFromUrl(url, name, defaultType = 'image/jpeg') {
const response = await fetch(url);
const data = await response.blob();
return new File([data], name, {
@ -225,12 +262,12 @@
let myDropzone = new Dropzone(".dropzone", {
addRemoveLinks: true,
});
myDropzone.on("addedfile", function(file) {
myDropzone.on("addedfile", function (file) {
container.items.add(file);
document.querySelector('#prodImgs2').files = container.files;
});
myDropzone.on("removedfile", function(file) {
myDropzone.on("removedfile", function (file) {
container.items.remove(file);
document.querySelector('#prodImgs2').files = container.files;
});
@ -261,6 +298,7 @@
fd.append('special_price', $("input[name='special_price']").val());
fd.append('weight', 0);
fd.append('qty', $("input[name='qty']").val());
fd.append('categories', $("select[name='categories']").val());
$.ajax({
type: 'POST',
@ -286,6 +324,10 @@
$("#imageUploadForm").submit();
});
});
</script>

View File

@ -10,7 +10,7 @@
class="top-bar-boxed h-[70px] md:h-[65px] z-[51] border-b border-white/[0.08] mt-12 md:mt-0 -mx-3 sm:-mx-8 md:-mx-0 px-3 md:border-b-0 relative md:fixed md:inset-x-0 md:top-0 sm:px-8 md:px-10 md:pt-10 md:bg-gradient-to-b md:from-slate-100 md:to-transparent dark:md:from-darkmode-700">
<div class="h-full flex items-center">
<!-- BEGIN: Logo -->
<a href="/" class="logo -intro-x hidden md:flex xl:w-[180px] block" style="margin-left: 30px;">
<a href="/seller-home" class="logo -intro-x hidden md:flex xl:w-[180px] block" style="margin-left: 30px;">
<img alt="Nurgul" class="logo__image" style="width: 6.5rem;" src="{{'assets/logo_white.svg'|theme}}">
<!-- <span class=" logo__text text-white text-lg ml-3"> Enigma </span> -->
</a>
@ -25,13 +25,13 @@
<!-- END: Breadcrumb -->
<!-- BEGIN: Search -->
<div class="intro-x relative mr-3 sm:mr-6">
<div class="search hidden sm:block">
<!-- <div class="search hidden sm:block">
<input type="text" class="search__input form-control border-transparent"
placeholder="{{'client.page.search'|_}}...">
<i data-lucide="search" class="search__icon dark:text-slate-500"></i>
</div>
<a class="notification notification--light sm:hidden" href=""> <i data-lucide="search"
class="notification__icon dark:text-slate-500"></i> </a>
</div> -->
<!-- <a class="notification notification--light sm:hidden" href=""> <i data-lucide="search"
class="notification__icon dark:text-slate-500"></i> </a> -->
<!-- <div class="search-result">
<div class="search-result__content">
<div class="search-result__content__title">Pages</div>
@ -133,7 +133,7 @@
</div>
<!-- END: Search -->
<!-- BEGIN: Notifications -->
<div class="intro-x dropdown mr-4 sm:mr-6">
<!-- <div class="intro-x dropdown mr-4 sm:mr-6">
<div class="dropdown-toggle notification notification--bullet cursor-pointer" role="button"
aria-expanded="false" data-tw-toggle="dropdown"> <i data-lucide="bell"
class="notification__icon dark:text-slate-500"></i> </div>
@ -232,7 +232,7 @@
</div>
</div>
</div>
</div>
</div> -->
<!-- END: Notifications -->
<!-- BEGIN: Account Menu -->
<div class="intro-x dropdown w-8 h-8">

View File

@ -0,0 +1,92 @@
{% put scripts %}
<script>
function formatDate(date) {
var d = new Date(date),
month = '' + (d.getMonth() + 1),
day = '' + d.getDate(),
year = d.getFullYear();
hour = d.getHours();
minute = d.getMinutes();
if (month.length < 2)
month = '0' + month;
if (day.length < 2)
day = '0' + day;
var date = [day, month, year].join('.');
var time = [hour, minute].join(':');
var result = date + " / " + time;
return result;
}
getOrder(`{{sellerOrderId}}`);
// console.log("qqq");
function getOrder(sellerOrderId) {
let formData = new FormData()
formData.append('user', "romanah_")
formData.append('password', "bt110226$$")
formData.append('order_id', sellerOrderId)
$(document).ready(function () {
$.ajax({
url: `https://nurgul.com.tm/app/api/seller/order`,
type: 'POST',
data: formData,
cache: false,
contentType: false,
processData: false,
beforeSend: function () {
$('#order_content').hide();
$('#loader_seller_order').show();
},
success: function (data, textStatus, xhr) {
$('#loader_seller_order').hide();
$('#order_content').show();
console.log(data.data);
var orderItems = data.items.data;
var order = data.order;
$('#order_status').html(order.status);
$('#order_total').html(order.grand_total + " TMT");
$('#order_customer').html(order.order.customer_first_name);
$('#order_no').html("#Sargyt "+order.order.id);
$('#order_phone').html(order.order.customer.phone);
$('#order_date').html(formatDate(order.created_at));
$('#order_address').html(order.order.shipping_address[0].address1);
for (var item of orderItems) {
$('#order_items').append(`
<tr>
<td class="!py-4">
<div class="flex items-center">
<div class="w-10 h-10 image-fit zoom-in">
<img alt="`+ item.item.name +`"
class="rounded-lg border-2 border-white shadow-md tooltip"
src="`+ item.item.product.images[0].url +`" title="`+ item.item.name +`">
</div>
<a href="" class="font-medium whitespace-nowrap ml-4">`+ item.item.name +`</a>
</div>
</td>
<td class="text-center">`+item.item.base_price+` TMT</td>
<td class="text-center">`+item.item.qty_ordered+`</td>
<td class="text-center">`+item.item.base_total+` TMT</td>
</tr>
`);
}
},
error: function (xhr, textStatus, errorThrown) {
console.log('Error in Operation');
}
});
});
}
</script>
{% endput %}

View File

@ -56,7 +56,7 @@
$('#seller_order').append(`
<tr class="intro-x">
<td class="w-40 !py-4"> <a href="/seller/order/`+order.order_id+`"
<td class="w-40 !py-4"> <a href="/seller/order/`+order.id+`"
class="underline decoration-dotted whitespace-nowrap">#{{'order.title'|_}} `+ order.order_id + `</a> </td>
<td class="w-40">
<a href="" class="font-medium whitespace-nowrap">`+ order.order.customer_first_name + `</a>

View File

@ -0,0 +1,45 @@
{% put scripts %}
<script>
getReport(`{{sellerId}}`);
// console.log("qqq");
function getReport(sellerId) {
let formData = new FormData()
formData.append('user', "romanah_")
formData.append('password', "bt110226$$")
formData.append('seller_id', sellerId)
$(document).ready(function () {
$.ajax({
url: `https://nurgul.com.tm/app/api/seller/report`,
type: 'POST',
data: formData,
cache: false,
contentType: false,
processData: false,
beforeSend: function () {
$('#report_content').hide();
$('#loader_seller_report').show();
},
success: function (data, textStatus, xhr) {
$('#loader_seller_report').hide();
$('#report_content').show();
console.log(data);
var report = data;
$('#dashboard_order').html(report.sellerOrders);
$('#dashboard_product').html(report.sellerProducts);
},
error: function (xhr, textStatus, errorThrown) {
console.log('Error in Operation');
}
});
});
}
</script>
{% endput %}