Skip to content

Instantly share code, notes, and snippets.

View Shankjbs571's full-sized avatar
🎯
Focusing

Shashank Kumar Shankjbs571

🎯
Focusing
View GitHub Profile
// Inside Success function of dropzone myAwesomedropzone
if(no == 1)
{
feature = 'block';
hover = 'none';
color = featured_color;
border = '';
// ratio_3_4 = ratio_3_4;
image_array = ['https://www.reborns.com/user/1/17261951281b.webp','https://www.reborns.com/user/1/17261951283b.webp','https://www.reborns.com/user/1/172669568211b.webp','https://www.reborns.com/user/1/17261951284b.webp','https://www.reborns.com/user/1/172669568210b.webp','https://www.reborns.com/user/1/172669568212b.webp'];
if(typeof image_array != 'undefined' && image_array instanceof Array)
{
for( i = 0 ; i < image_array.length; i++)
{
noFiles++;
j = i+1;
@Shankjbs571
Shankjbs571 / edit.js
Last active September 22, 2024 15:57
// replace this fucntion inside edit.js to have ratio_3_4 class to first <li> of <ul> only
function saveOrder() {
i = 0;
var newarr = [];
$('ul').children().each(function(){
if($(this).attr('id') != undefined)
{
newarr.push($(this).find('.br').find('.handle').attr('src'));
var imgElement = $(this).find('.br').find('img');
import React, { useRef, useEffect, useState } from "react";
import { useDispatch, useSelector } from "react-redux";
import { fetchProduct } from "../Redux/Product/productSlice";
import { useNavigate, useParams } from "react-router-dom";
import { FaBarcode } from "react-icons/fa"; // Import the barcode icon from react-icons
import BarcodeReader from "react-barcode-reader";
import ReactToPrint from "react-to-print";
import logo from "../logo.png";
import {jwtDecode }from "jwt-decode";
import {logoutUser } from "../Redux/User/userSlices";
// import React, { useEffect, useState } from "react";
// import Register from "../Auth/Register";
// import {
// FaUser,
// FaHeart,
// FaBox,
// FaSignOutAlt,
// } from "react-icons/fa";
// import { clearUser } from "../../../Redux/User/userSlice";
// import logo from "../../../logo.png";
import React, { useState } from 'react';
import { FaArrowDown, FaEdit, FaTrash } from 'react-icons/fa';
const salesData = [
{ SrNo: 1, Name: 'John Doe', Mobile: '1234567890', GSTNo: '12ABCDE1234F1Z5', Address: '123 Main St, City', Disc: '10%', Taxable: '$1000', IGST: '$18', SGST: '$9', CGST: '$9', CESS: '$0', Less: '$50', Total: '$936', Mode: 'Credit', Pending: '$200', User: 'salescounter1' },
{ SrNo: 2, Name: 'Jane Smith', Mobile: '2345678901', GSTNo: '22BCDEF2345G6H7', Address: '456 Elm St, Town', Disc: '5%', Taxable: '$500', IGST: '$9', SGST: '$4.5', CGST: '$4.5', CESS: '$0', Less: '$25', Total: '$484', Mode: 'Cash', Pending: '$0', User: 'salescounter2' },
{ SrNo: 3, Name: 'Michael Brown', Mobile: '3456789012', GSTNo: '33CDEFG3456H7I8', Address: '789 Oak St, Village', Disc: '8%', Taxable: '$800', IGST: '$14.4', SGST: '$7.2', CGST: '$7.2', CESS: '$0', Less: '$40', Total: '$767.2', Mode: 'Credit', Pending: '$150', User: 'salescounter3' },
{ SrNo: 4, Name: 'Emily Davis', Mobile: '4567890123',
// UserListCreate.js
import React, { useState } from 'react';
import { UserIcon, MailIcon, LockClosedIcon, PhoneIcon, DeviceMobileIcon,BriefcaseIcon } from '@heroicons/react/outline';
const Users = () => {
const [users, setUsers] = useState([
{ id: 1, fullname: 'Boy1', counterNumber:'1' },
{ id: 2, fullname: 'Boy2', counterNumber:'2' },
]);
import React, { useState, useEffect } from 'react';
import { useDispatch, useSelector } from 'react-redux';
import { createProduct, fetchProducts } from '../../../Redux/Product/productSlice';
import { fetchCategories } from '../../../Redux/Category/categoriesSlice';
import { ToastContainer, toast } from 'react-toastify';
import 'react-toastify/dist/ReactToastify.css';
import ReactQuill from 'react-quill';
import 'react-quill/dist/quill.snow.css'; // import styles
const CreateProductForm = () => {
@Shankjbs571
Shankjbs571 / productController.js
Last active July 19, 2024 05:18
updated model for product with no required fields except category
// Create product
export const createProduct = async (req, res) => {
const {
title,
description,
price,
discountedPrice,
discountPercent,
quantity,
brand,
<!DOCTYPE html>
<html>
<head>
<style>
body {
margin: 0;
padding: 0;
}
.header {