diff --git a/controllers/bannerController.js b/controllers/bannerController.js new file mode 100644 index 00000000..e23854b4 --- /dev/null +++ b/controllers/bannerController.js @@ -0,0 +1,18 @@ +const UserDB = require("../models/userModel").User; +const ProductDB = require("../models/productsModel").product; +const CategoryDB = require("../models/productsModel").category; +const OrderDB = require("../models/orderModel").Order; +const BannerDB = require("../models/productsModel").banner; + + +const BannerPageLoader = async(req,res)=>{ + try { + res.render('banner') + } catch (error) { + console.log(error.message); + } +} + +module.exports ={ + BannerPageLoader +} \ No newline at end of file diff --git a/controllers/categoryController.js b/controllers/categoryController.js index f73f37af..3a1c923e 100644 --- a/controllers/categoryController.js +++ b/controllers/categoryController.js @@ -33,6 +33,7 @@ const categoryPageLoad = async (req, res) => { let result = await category.save(); console.log(result); + req.session.CategoryAdded=1 res.redirect("/admin/category"); } catch (error) { console.log(error.message); diff --git a/controllers/couponController.js b/controllers/couponController.js index e826e557..905e43b0 100644 --- a/controllers/couponController.js +++ b/controllers/couponController.js @@ -38,7 +38,14 @@ const calculateTotalPrice = async (userId) => { const couponPageLoad = async (req, res) => { try { const Coupons = await CouponDB.find(); - res.render("coupon", { Coupons }); + res.render("coupon", { Coupons,couponAdded:req.session.couponAdded },(err, html) => { + if (!err) { + req.session.couponAdded=false + res.send(html); // Send the rendered HTML to the client + } else { + console.log(err.message); + } + }); } catch (error) { console.log(error.message); } @@ -92,6 +99,7 @@ const addNewCoupon = async (req, res) => { maxUsers, }); await coupon.save(); + req.session.couponAdded =1 return res.redirect("/admin/coupon"); }else{ req.session.couponErr = 1 @@ -228,7 +236,7 @@ const editCoupon = async (req, res) => { }, } ); - + req.session.couponAdded =2 return res.redirect("/admin/coupon"); } catch (error) { diff --git a/controllers/orderController.js b/controllers/orderController.js index 106c0c9d..862662cd 100644 --- a/controllers/orderController.js +++ b/controllers/orderController.js @@ -730,6 +730,7 @@ const cancelOrder = async (req, res) => { productInfo.updatedAt = Date.now(); if(order.paymentMethod!=="Cash on Delivery"){ + req.session.OrderCanceled = 2 let refundStatus = await refundManagement( oderId, productId, @@ -737,9 +738,11 @@ const cancelOrder = async (req, res) => { req.session.user_id ); console.log(); + }else{ + req.session.OrderCanceled = 1 } - + const result = await order.save(); console.log(result); diff --git a/controllers/productsController.js b/controllers/productsController.js index 1a10b821..003e7900 100644 --- a/controllers/productsController.js +++ b/controllers/productsController.js @@ -61,7 +61,14 @@ const productPageLoad = async (req, res) => { try { let products = await ProductDB.find({}); // console.log(products); - res.render("products", { products: products }); + res.render("products", { products: products ,productcAdded:req.session.productcAdded},(err, html) => { + if (!err) { + req.session.productcAdded=false + res.send(html); // Send the rendered HTML to the client + } else { + console.log(err.message); + } + }); } catch (error) { console.log(error.message); } @@ -125,6 +132,7 @@ const addProduct = async (req, res) => { let result = await product.save(); console.log(result); + req.session.productcAdded=1 res.redirect("/admin/products"); } catch (error) { console.log(error.message); @@ -219,7 +227,7 @@ const updateProduct = async (req, res) => { ); console.log(update); - + req.session.productcAdded=2 res.redirect("/admin/products"); } catch (error) { if (req.fileFilterError && req.fileFilterError.redirectTo) { diff --git a/controllers/userController.js b/controllers/userController.js index bb068899..49545286 100644 --- a/controllers/userController.js +++ b/controllers/userController.js @@ -177,6 +177,17 @@ const homePageLoad = async (req, res) => { res.render("home", { user: req.session.user_id, products: product, + SignupMess:req.session.SignupMess + }, + (err, html) => { + if (!err) { + // Set session variables to false after rendering + req.session.SignupMess=false + + res.send(html); // Send the rendered HTML to the client + } else { + console.log(err.message); + } }); } catch (error) { console.log(error.message); @@ -401,12 +412,12 @@ const otpValid = async (req, res) => { let num = req.body; if (req.query.userId) { console.log("expire called...."); - res.render("verifyNotfy", { wrong: 1, userId: req.query.userId }); + return res.render("verifyNotfy", { wrong: 1, userId: req.query.userId }); console.log("otp expired.."); otp=null } else if (req.query.forget) { console.log("expire called...."); - res.render("verifyNotfy", { wrong: 3, userId: 0 }); + return res.render("verifyNotfy", { wrong: 3, userId: 0 }); console.log("otp expired.."); } else { enterdOtp = "" + num.a + num.b + num.c + num.d + num.e + num.f; @@ -419,9 +430,10 @@ const otpValid = async (req, res) => { console.log(updatInfo); req.session.loggedIn = true; req.session.user_id = req.query.id; - res.render("verifyNotfy", { wrong: 0 }); + req.session.SignupMess = 1 + return res.render("verifyNotfy", { wrong: 0 }); } else { - res.render("verifyNotfy", { userId: req.query.id, wrong: 2 }); + return res.render("verifyNotfy", { userId: req.query.id, wrong: 2 }); console.log("otp wrong"); } } @@ -442,12 +454,14 @@ const profilePageLoad = async (req, res) => { user: userData, updatePassErr: req.session.updatePassErr, updatePass: req.session.updatePass, + profilUpdate:req.session.profilUpdate }, (err, html) => { if (!err) { // Reset session variables after rendering req.session.updatePassErr = false; req.session.updatePass = false; + req.session.profilUpdate= false res.send(html); } else { console.log(err.message); @@ -492,6 +506,7 @@ const updatePhoto = async (req, res) => { { $set: { image: req.file.filename } } ); console.log(updatePhoto); + req.session.profilUpdate = 2 userData = await takeUserData(req.session.user_id); // res.render("userProfile", { user: userData }); res.render( @@ -500,12 +515,14 @@ const updatePhoto = async (req, res) => { user: userData, updatePassErr: req.session.updatePassErr, updatePass: req.session.updatePass, + profilUpdate:req.session.profilUpdate }, (err, html) => { if (!err) { // Reset session variables after rendering req.session.updatePassErr = false; req.session.updatePass = false; + req.session.profilUpdate = false; res.send(html); } else { console.log(err.message); @@ -542,6 +559,7 @@ const updateUserData = async (req, res) => { ); console.log(updateUser); userData = await takeUserData(req.session.user_id); + req.session.profilUpdate = 1 // res.render("userProfile", { user: userData }); res.render( "userProfile", @@ -549,12 +567,14 @@ const updateUserData = async (req, res) => { user: userData, updatePassErr: req.session.updatePassErr, updatePass: req.session.updatePass, + profilUpdate:req.session.profilUpdate }, (err, html) => { if (!err) { // Reset session variables after rendering req.session.updatePassErr = false; req.session.updatePass = false; + req.session.profilUpdate =false res.send(html); } else { console.log(err.message); @@ -1014,6 +1034,14 @@ const allOrdersPageLoad = async (req, res) => { res.render("allorders", { user: req.session.user_id, products: productWiseOrders, + cancel:req.session.OrderCanceled + },(err,html)=>{ + if (!err) { + req.session.OrderCanceled=false + res.send(html); // Send the rendered HTML to the client + } else { + console.log(err.message); + } }); } catch (error) { console.log(error.message); @@ -1099,6 +1127,7 @@ const updateShippingAddress = async (req, res) => { selectedAddress.city = Addres.city; selectedAddress.state = Addres.state; await userAddress.save(); + // req.session.profilUpdate = 1 res.redirect("/profile/user_address"); // console.log(selectedAddress); diff --git a/models/productsModel.js b/models/productsModel.js index 15792c3d..59acc215 100644 --- a/models/productsModel.js +++ b/models/productsModel.js @@ -67,10 +67,29 @@ const categorySchema = mongoose.Schema({ } }) +// Define the banner schema +const bannerSchema = new mongoose.Schema({ + image: { + type: String, // You can store the image URL or file path as a string + required: true, + }, + subtext: { + type: String, + required: true, + }, + mainHead: { + type: String, + required: true, + }, + }); +// Create the Banner model +const Banner = mongoose.model('Banner', bannerSchema); + const category = mongoose.model('category',categorySchema) const product = mongoose.model("product",productSchema) module.exports = { product, - category + category, + Banner } \ No newline at end of file diff --git a/public/admin/js/ajaxScript.js b/public/admin/js/ajaxScript.js index 07e23e79..1630939b 100644 --- a/public/admin/js/ajaxScript.js +++ b/public/admin/js/ajaxScript.js @@ -1,5 +1,9 @@ +setTimeout(function() { + document.getElementById('myAlert').style.display = 'none'; +}, 5000); + function blockButton(id) { // Send an AJAX request to update the user's block status $.ajax({ @@ -112,3 +116,5 @@ function formatDate(inputDate) { } }); } + + diff --git a/public/products/crop/image1-1696244637114.jpg b/public/products/crop/image1-1696244637114.jpg index 57cf3080..02c62767 100644 Binary files a/public/products/crop/image1-1696244637114.jpg and b/public/products/crop/image1-1696244637114.jpg differ diff --git a/public/products/crop/image1-1699276281527.jpg b/public/products/crop/image1-1699276281527.jpg new file mode 100644 index 00000000..6059be4e Binary files /dev/null and b/public/products/crop/image1-1699276281527.jpg differ diff --git a/public/products/crop/image1-1699284525043.jpg b/public/products/crop/image1-1699284525043.jpg new file mode 100644 index 00000000..91cf4b71 Binary files /dev/null and b/public/products/crop/image1-1699284525043.jpg differ diff --git a/public/products/crop/image1-1699284730323.jpg b/public/products/crop/image1-1699284730323.jpg new file mode 100644 index 00000000..d456a71e Binary files /dev/null and b/public/products/crop/image1-1699284730323.jpg differ diff --git a/public/products/crop/image1-1699285063667.jpg b/public/products/crop/image1-1699285063667.jpg new file mode 100644 index 00000000..0635d901 Binary files /dev/null and b/public/products/crop/image1-1699285063667.jpg differ diff --git a/public/products/crop/image1-1699285318899.jpg b/public/products/crop/image1-1699285318899.jpg new file mode 100644 index 00000000..d72270c1 Binary files /dev/null and b/public/products/crop/image1-1699285318899.jpg differ diff --git a/public/products/crop/image1-1699285459396.jpg b/public/products/crop/image1-1699285459396.jpg new file mode 100644 index 00000000..ff4dc7e1 Binary files /dev/null and b/public/products/crop/image1-1699285459396.jpg differ diff --git a/public/products/crop/image2-1696244637114.jpg b/public/products/crop/image2-1696244637114.jpg index a17e1152..724289e0 100644 Binary files a/public/products/crop/image2-1696244637114.jpg and b/public/products/crop/image2-1696244637114.jpg differ diff --git a/public/products/crop/image2-1699276281531.jpg b/public/products/crop/image2-1699276281531.jpg new file mode 100644 index 00000000..f2517ff3 Binary files /dev/null and b/public/products/crop/image2-1699276281531.jpg differ diff --git a/public/products/crop/image2-1699284525043.jpg b/public/products/crop/image2-1699284525043.jpg new file mode 100644 index 00000000..c74b6935 Binary files /dev/null and b/public/products/crop/image2-1699284525043.jpg differ diff --git a/public/products/crop/image2-1699284730326.jpg b/public/products/crop/image2-1699284730326.jpg new file mode 100644 index 00000000..093c53d0 Binary files /dev/null and b/public/products/crop/image2-1699284730326.jpg differ diff --git a/public/products/crop/image2-1699285063669.jpg b/public/products/crop/image2-1699285063669.jpg new file mode 100644 index 00000000..ee543ac3 Binary files /dev/null and b/public/products/crop/image2-1699285063669.jpg differ diff --git a/public/products/crop/image2-1699285318900.jpg b/public/products/crop/image2-1699285318900.jpg new file mode 100644 index 00000000..dc15653b Binary files /dev/null and b/public/products/crop/image2-1699285318900.jpg differ diff --git a/public/products/crop/image2-1699285459398.jpg b/public/products/crop/image2-1699285459398.jpg new file mode 100644 index 00000000..c42e7d84 Binary files /dev/null and b/public/products/crop/image2-1699285459398.jpg differ diff --git a/public/products/crop/image3-1696244637114.jpg b/public/products/crop/image3-1696244637114.jpg index ce8d4356..029f984b 100644 Binary files a/public/products/crop/image3-1696244637114.jpg and b/public/products/crop/image3-1696244637114.jpg differ diff --git a/public/products/crop/image3-1699276281542.jpg b/public/products/crop/image3-1699276281542.jpg new file mode 100644 index 00000000..58b0123e Binary files /dev/null and b/public/products/crop/image3-1699276281542.jpg differ diff --git a/public/products/crop/image3-1699284525050.jpg b/public/products/crop/image3-1699284525050.jpg new file mode 100644 index 00000000..630be734 Binary files /dev/null and b/public/products/crop/image3-1699284525050.jpg differ diff --git a/public/products/crop/image3-1699284730327.jpg b/public/products/crop/image3-1699284730327.jpg new file mode 100644 index 00000000..d886ce93 Binary files /dev/null and b/public/products/crop/image3-1699284730327.jpg differ diff --git a/public/products/crop/image3-1699285063672.jpg b/public/products/crop/image3-1699285063672.jpg new file mode 100644 index 00000000..b65bd271 Binary files /dev/null and b/public/products/crop/image3-1699285063672.jpg differ diff --git a/public/products/crop/image3-1699285318901.jpg b/public/products/crop/image3-1699285318901.jpg new file mode 100644 index 00000000..5d748a76 Binary files /dev/null and b/public/products/crop/image3-1699285318901.jpg differ diff --git a/public/products/crop/image3-1699285459399.jpg b/public/products/crop/image3-1699285459399.jpg new file mode 100644 index 00000000..f7294d02 Binary files /dev/null and b/public/products/crop/image3-1699285459399.jpg differ diff --git a/public/products/crop/image4-1696244637114.jpg b/public/products/crop/image4-1696244637114.jpg index 805761d0..9ee9801a 100644 Binary files a/public/products/crop/image4-1696244637114.jpg and b/public/products/crop/image4-1696244637114.jpg differ diff --git a/public/products/crop/image4-1699276281542.png b/public/products/crop/image4-1699276281542.png new file mode 100644 index 00000000..25c62227 Binary files /dev/null and b/public/products/crop/image4-1699276281542.png differ diff --git a/public/products/crop/image4-1699284525053.jpg b/public/products/crop/image4-1699284525053.jpg new file mode 100644 index 00000000..b61fbe41 Binary files /dev/null and b/public/products/crop/image4-1699284525053.jpg differ diff --git a/public/products/crop/image4-1699284730330.jpg b/public/products/crop/image4-1699284730330.jpg new file mode 100644 index 00000000..3b0f47ce Binary files /dev/null and b/public/products/crop/image4-1699284730330.jpg differ diff --git a/public/products/crop/image4-1699285063678.jpg b/public/products/crop/image4-1699285063678.jpg new file mode 100644 index 00000000..5e1bfce9 Binary files /dev/null and b/public/products/crop/image4-1699285063678.jpg differ diff --git a/public/products/crop/image4-1699285318902.jpg b/public/products/crop/image4-1699285318902.jpg new file mode 100644 index 00000000..0bf7bfb1 Binary files /dev/null and b/public/products/crop/image4-1699285318902.jpg differ diff --git a/public/products/crop/image4-1699285459401.jpg b/public/products/crop/image4-1699285459401.jpg new file mode 100644 index 00000000..4bfbdf07 Binary files /dev/null and b/public/products/crop/image4-1699285459401.jpg differ diff --git a/public/products/images/image1-1699276281527.jpg b/public/products/images/image1-1699276281527.jpg new file mode 100644 index 00000000..9b00700e Binary files /dev/null and b/public/products/images/image1-1699276281527.jpg differ diff --git a/public/products/images/image1-1699284525043.jpg b/public/products/images/image1-1699284525043.jpg new file mode 100644 index 00000000..0b8c19bf Binary files /dev/null and b/public/products/images/image1-1699284525043.jpg differ diff --git a/public/products/images/image1-1699284730323.jpg b/public/products/images/image1-1699284730323.jpg new file mode 100644 index 00000000..f99d70f3 Binary files /dev/null and b/public/products/images/image1-1699284730323.jpg differ diff --git a/public/products/images/image1-1699285063667.jpg b/public/products/images/image1-1699285063667.jpg new file mode 100644 index 00000000..1aacbd55 Binary files /dev/null and b/public/products/images/image1-1699285063667.jpg differ diff --git a/public/products/images/image1-1699285318899.jpg b/public/products/images/image1-1699285318899.jpg new file mode 100644 index 00000000..33175256 Binary files /dev/null and b/public/products/images/image1-1699285318899.jpg differ diff --git a/public/products/images/image1-1699285459396.jpg b/public/products/images/image1-1699285459396.jpg new file mode 100644 index 00000000..867ae926 Binary files /dev/null and b/public/products/images/image1-1699285459396.jpg differ diff --git a/public/products/images/image2-1699276281531.jpg b/public/products/images/image2-1699276281531.jpg new file mode 100644 index 00000000..bd8dcab8 Binary files /dev/null and b/public/products/images/image2-1699276281531.jpg differ diff --git a/public/products/images/image2-1699284525043.jpg b/public/products/images/image2-1699284525043.jpg new file mode 100644 index 00000000..cb75f4c6 Binary files /dev/null and b/public/products/images/image2-1699284525043.jpg differ diff --git a/public/products/images/image2-1699284730326.jpg b/public/products/images/image2-1699284730326.jpg new file mode 100644 index 00000000..ba0f33ad Binary files /dev/null and b/public/products/images/image2-1699284730326.jpg differ diff --git a/public/products/images/image2-1699285063669.jpg b/public/products/images/image2-1699285063669.jpg new file mode 100644 index 00000000..c8e5ebc6 Binary files /dev/null and b/public/products/images/image2-1699285063669.jpg differ diff --git a/public/products/images/image2-1699285318900.jpg b/public/products/images/image2-1699285318900.jpg new file mode 100644 index 00000000..69538caf Binary files /dev/null and b/public/products/images/image2-1699285318900.jpg differ diff --git a/public/products/images/image2-1699285459398.jpg b/public/products/images/image2-1699285459398.jpg new file mode 100644 index 00000000..443a22b2 Binary files /dev/null and b/public/products/images/image2-1699285459398.jpg differ diff --git a/public/products/images/image3-1699276281542.jpg b/public/products/images/image3-1699276281542.jpg new file mode 100644 index 00000000..e200f0cc Binary files /dev/null and b/public/products/images/image3-1699276281542.jpg differ diff --git a/public/products/images/image3-1699284525050.jpg b/public/products/images/image3-1699284525050.jpg new file mode 100644 index 00000000..a1d6bc3b Binary files /dev/null and b/public/products/images/image3-1699284525050.jpg differ diff --git a/public/products/images/image3-1699284730327.jpg b/public/products/images/image3-1699284730327.jpg new file mode 100644 index 00000000..3b211334 Binary files /dev/null and b/public/products/images/image3-1699284730327.jpg differ diff --git a/public/products/images/image3-1699285063672.jpg b/public/products/images/image3-1699285063672.jpg new file mode 100644 index 00000000..39ababb7 Binary files /dev/null and b/public/products/images/image3-1699285063672.jpg differ diff --git a/public/products/images/image3-1699285318901.jpg b/public/products/images/image3-1699285318901.jpg new file mode 100644 index 00000000..9c4c55f0 Binary files /dev/null and b/public/products/images/image3-1699285318901.jpg differ diff --git a/public/products/images/image3-1699285459399.jpg b/public/products/images/image3-1699285459399.jpg new file mode 100644 index 00000000..37ebfa94 Binary files /dev/null and b/public/products/images/image3-1699285459399.jpg differ diff --git a/public/products/images/image4-1699276281542.png b/public/products/images/image4-1699276281542.png new file mode 100644 index 00000000..9fa07b0f Binary files /dev/null and b/public/products/images/image4-1699276281542.png differ diff --git a/public/products/images/image4-1699284525053.jpg b/public/products/images/image4-1699284525053.jpg new file mode 100644 index 00000000..e7ac0bcb Binary files /dev/null and b/public/products/images/image4-1699284525053.jpg differ diff --git a/public/products/images/image4-1699284730330.jpg b/public/products/images/image4-1699284730330.jpg new file mode 100644 index 00000000..f31b490d Binary files /dev/null and b/public/products/images/image4-1699284730330.jpg differ diff --git a/public/products/images/image4-1699285063678.jpg b/public/products/images/image4-1699285063678.jpg new file mode 100644 index 00000000..44422f99 Binary files /dev/null and b/public/products/images/image4-1699285063678.jpg differ diff --git a/public/products/images/image4-1699285318902.jpg b/public/products/images/image4-1699285318902.jpg new file mode 100644 index 00000000..4935bdb8 Binary files /dev/null and b/public/products/images/image4-1699285318902.jpg differ diff --git a/public/products/images/image4-1699285459401.jpg b/public/products/images/image4-1699285459401.jpg new file mode 100644 index 00000000..8c1525d3 Binary files /dev/null and b/public/products/images/image4-1699285459401.jpg differ diff --git a/public/user/images/userImages/1699269428465-out. (1).jpg b/public/user/images/userImages/1699269428465-out. (1).jpg new file mode 100644 index 00000000..3de56711 Binary files /dev/null and b/public/user/images/userImages/1699269428465-out. (1).jpg differ diff --git a/public/user/images/userImages/1699269436582-photo-1535713875002-d1d0cf377fde.jpeg b/public/user/images/userImages/1699269436582-photo-1535713875002-d1d0cf377fde.jpeg new file mode 100644 index 00000000..ade1c7a9 Binary files /dev/null and b/public/user/images/userImages/1699269436582-photo-1535713875002-d1d0cf377fde.jpeg differ diff --git a/public/user/js/formValidations.js b/public/user/js/formValidations.js index 131f4f52..9ecec218 100644 --- a/public/user/js/formValidations.js +++ b/public/user/js/formValidations.js @@ -44,9 +44,9 @@ function validateEmail(email) { return emailRegex.test(email); } -function validatePincode(pincode) { - return !isNaN(pincode); -} +// function validatePincode(pincode) { +// return !isNaN(pincode); +// } @@ -91,8 +91,7 @@ function validateMobileNumber(mobileNumber) { } function validatePincode(pincode) { - return /^\d{6}$/.test(pincode); - // return !isNaN(pincode); + return !isNaN(pincode); } diff --git a/routes/adminRouter.js b/routes/adminRouter.js index fed8073e..d2ff3013 100644 --- a/routes/adminRouter.js +++ b/routes/adminRouter.js @@ -10,6 +10,7 @@ const categoryController = require('../controllers/categoryController') const orderController = require('../controllers/orderController') const couponController = require('../controllers/couponController') const reportController = require('../controllers/reportController') +const bannerController = require('../controllers/bannerController') //auth checking middleware const auth = require('../middleware/admin') @@ -30,17 +31,23 @@ router.get('/users',auth.isLogin,adminController.usersPageLoad) // user managment related routers +// ===================================== + router.post('/blockuser',auth.isLogin,adminController.userBlock) router.get('/edituser',auth.isLogin,adminController.editUserPageLoad) router.post('/edituser',auth.isLogin,adminController.updateUserData) router.get('/searchUsers',auth.isLogin,adminController.searchUsers) // admin ath related routers +// ===================================== + router.get('/login',auth.isLogout,adminController.loginPageLoad) router.post('/login',auth.isLogout,adminController.doLogin) router.get('/logout',auth.isLogin,adminController.adminLogOut) //product management routers +// ===================================== + router.get('/products',auth.isLogin,productController.productPageLoad) router.get('/products/searchproduct',auth.isLogin,productController.searchproduct) router.get('/products/addproduct',auth.isLogin,productController.addproductPageLoad) @@ -52,6 +59,7 @@ router.post('/productlist',auth.jsonIsLogin,productController.prducutListUnlist) // category related Routers +// ===================================== router.get('/category',auth.isLogin,categoryController.categoryPageLoad) router.post('/category',auth.isLogin,fileUpload.uploadCategory.single('icon'),categoryController.addCategory) router.get('/category/delete',auth.isLogin,categoryController.deleteCategory) @@ -60,13 +68,17 @@ router.post('/category/block',auth.isLogin,categoryController.categoryBlock) //orders related routers +// ===================================== + router.get('/orders',auth.isLogin,orderController.orderPageLoad) router.get('/orders/manage',auth.isLogin,orderController.orderMangePageLoad) router.post('/orders/manage/cancel',auth.isLogin,orderController.cancelOrder) router.post('/orders/manage/changestatus',auth.isLogin,orderController.changeOrderStatus) //coupon related routers -router.get('/coupon',couponController.couponPageLoad) +// ===================================== + +router.get('/coupon',auth.isLogin,couponController.couponPageLoad) router.get('/coupon/add',auth.isLogin,couponController.addCouponPageLoad) router.post('/coupon/add',auth.isLogin,couponController.addNewCoupon) router.get('/coupon/delete',auth.isLogin,couponController.deleteCoupon) @@ -75,17 +87,20 @@ router.post('/coupon/update',couponController.editCoupon) //report make related routers +// ===================================== + router.post('/report/genarate',auth.jsonIsLogin,adminController.genarateSalesReports) router.get('/sales-report',auth.isLogin,reportController.salesReportPageLoad) // router.get('/sales-report/filter',reportController.salesReportSearchPageLoad) router.post('/sales-report/portfolio',auth.isLogin,reportController.portfolioFiltering) - router.get('/sales-report/export-report',auth.isLogin,reportController.generateExcelReports) router.get('/sales-report/export-PDF-report',auth.isLogin,reportController.generatePDFReports) router.get('/admin/error-page',adminController.errorpageHandil) +// router.get('/banner',bannerController.BannerPageLoader) + //exporting module.exports = router diff --git a/views/admin/banner.ejs b/views/admin/banner.ejs new file mode 100644 index 00000000..703f8a04 --- /dev/null +++ b/views/admin/banner.ejs @@ -0,0 +1,85 @@ +<%- include('../admin/layouts/header.ejs') %> + +
+
+ + + + +
+
+
+
+ +
+

+

Banner Management +

+ +
+
+
+
+ banner-img +
+
+

Topsale Collection

+

Frame Your World

+ + +
+
+ +
+
+
+
+ + +
+ + + + + + <%- include('../admin/layouts/footer.ejs') %> \ No newline at end of file diff --git a/views/admin/coupon.ejs b/views/admin/coupon.ejs index e879c09d..ac0aecbb 100644 --- a/views/admin/coupon.ejs +++ b/views/admin/coupon.ejs @@ -165,8 +165,21 @@
+ <%if(couponAdded==1){%> diff --git a/views/admin/layouts/header.ejs b/views/admin/layouts/header.ejs index fbb7e19a..91e2d26f 100644 --- a/views/admin/layouts/header.ejs +++ b/views/admin/layouts/header.ejs @@ -174,6 +174,14 @@ Coupon + diff --git a/views/admin/products.ejs b/views/admin/products.ejs index 1712cfae..36ce1588 100644 --- a/views/admin/products.ejs +++ b/views/admin/products.ejs @@ -173,7 +173,19 @@ diff --git a/views/user/allorders.ejs b/views/user/allorders.ejs index 99268926..4def73fe 100644 --- a/views/user/allorders.ejs +++ b/views/user/allorders.ejs @@ -484,6 +484,22 @@ aria-label="Close">x --> + <%if(cancel==1){%> + + <%}else if(cancel==2){%> + + <%}%> + + + diff --git a/views/user/home.ejs b/views/user/home.ejs index ed2a0b17..959d5538 100644 --- a/views/user/home.ejs +++ b/views/user/home.ejs @@ -422,7 +422,17 @@ - + + <%if(SignupMess==1){%> + + <%}%> + diff --git a/views/user/signup.ejs b/views/user/signup.ejs index 9350396f..16b9ff9a 100644 --- a/views/user/signup.ejs +++ b/views/user/signup.ejs @@ -117,6 +117,9 @@ showFormValidAlert() -->