├── src ├── main │ ├── resources │ │ ├── data.sql │ │ ├── META-INF │ │ │ └── additional-spring-configuration-metadata.json │ │ └── application.properties │ ├── webapp │ │ ├── pages │ │ │ ├── navfooter │ │ │ │ ├── footer.jsp │ │ │ │ ├── navbar.jsp │ │ │ │ ├── formmodel.css │ │ │ │ └── navcss.css │ │ │ └── display │ │ │ │ ├── showMyProducts.jsp │ │ │ │ ├── showAllProducts.jsp │ │ │ │ ├── KidsProducts.jsp │ │ │ │ ├── MenProducts.jsp │ │ │ │ ├── WomenProducts.jsp │ │ │ │ ├── carddetails.jsp │ │ │ │ ├── sendotp.jsp │ │ │ │ ├── SoldProducts.jsp │ │ │ │ ├── myorders.jsp │ │ │ │ ├── AllSellers.jsp │ │ │ │ ├── customerProfile.jsp │ │ │ │ ├── ordereditems.jsp │ │ │ │ ├── vendorProfile.jsp │ │ │ │ └── mycarts.jsp │ │ ├── css │ │ │ └── productcard.css │ │ └── index.jsp │ └── java │ │ └── com │ │ └── clothes │ │ └── demo │ │ ├── services │ │ ├── MailService.java │ │ └── MailServiceImpl.java │ │ ├── dao │ │ ├── AdminDao.java │ │ ├── OrderDao.java │ │ ├── BillingAddressDao.java │ │ ├── AddressDao.java │ │ ├── VendorDao.java │ │ ├── OrderItemDao.java │ │ ├── CustomerDao.java │ │ └── ProductDao.java │ │ ├── models │ │ ├── products │ │ │ ├── FileUploadUtil.java │ │ │ ├── MvcConfig.java │ │ │ └── Product.java │ │ ├── authenticate │ │ │ └── Admin.java │ │ ├── customer │ │ │ ├── Address.java │ │ │ └── CustomerDetails.java │ │ ├── vendor │ │ │ ├── BillingAddress.java │ │ │ └── Vendor.java │ │ └── orders │ │ │ ├── Order.java │ │ │ └── OrderItem.java │ │ ├── controller │ │ ├── IndexController.java │ │ ├── AddressController.java │ │ ├── AuthenticationController.java │ │ ├── OrderController.java │ │ ├── VendorController.java │ │ ├── CustomerController.java │ │ ├── ProductController.java │ │ └── OrderItemController.java │ │ ├── ClothingsApplication.java │ │ ├── configuration │ │ └── MailConfiguration.java │ │ └── bean │ │ └── Mail.java └── test │ └── java │ └── com │ └── clothes │ └── demo │ └── ClothingsApplicationTests.java ├── product-photos └── 4 │ └── bg2.jpg ├── .mvn └── wrapper │ ├── maven-wrapper.jar │ └── maven-wrapper.properties ├── .gitignore ├── pom.xml ├── mvnw.cmd └── mvnw /src/main/resources/data.sql: -------------------------------------------------------------------------------- 1 | insert into alien values (101,'john'); -------------------------------------------------------------------------------- /product-photos/4/bg2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dharmesh-poriya/JT-project-Clothings-/HEAD/product-photos/4/bg2.jpg -------------------------------------------------------------------------------- /.mvn/wrapper/maven-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dharmesh-poriya/JT-project-Clothings-/HEAD/.mvn/wrapper/maven-wrapper.jar -------------------------------------------------------------------------------- /src/main/webapp/pages/navfooter/footer.jsp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dharmesh-poriya/JT-project-Clothings-/HEAD/src/main/webapp/pages/navfooter/footer.jsp -------------------------------------------------------------------------------- /src/main/webapp/pages/navfooter/navbar.jsp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dharmesh-poriya/JT-project-Clothings-/HEAD/src/main/webapp/pages/navfooter/navbar.jsp -------------------------------------------------------------------------------- /src/main/webapp/pages/display/showMyProducts.jsp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dharmesh-poriya/JT-project-Clothings-/HEAD/src/main/webapp/pages/display/showMyProducts.jsp -------------------------------------------------------------------------------- /src/main/java/com/clothes/demo/services/MailService.java: -------------------------------------------------------------------------------- 1 | package com.clothes.demo.services; 2 | 3 | import com.clothes.demo.bean.Mail; 4 | 5 | public interface MailService { 6 | public void sendEmail(Mail mail); 7 | } 8 | -------------------------------------------------------------------------------- /src/main/resources/META-INF/additional-spring-configuration-metadata.json: -------------------------------------------------------------------------------- 1 | {"properties": [{ 2 | "name": "mail.smtp.debug", 3 | "type": "java.lang.String", 4 | "description": "A description for 'mail.smtp.debug'" 5 | }]} -------------------------------------------------------------------------------- /.mvn/wrapper/maven-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.8.4/apache-maven-3.8.4-bin.zip 2 | wrapperUrl=https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.1.0/maven-wrapper-3.1.0.jar 3 | -------------------------------------------------------------------------------- /src/test/java/com/clothes/demo/ClothingsApplicationTests.java: -------------------------------------------------------------------------------- 1 | package com.clothes.demo; 2 | 3 | import org.junit.jupiter.api.Test; 4 | import org.springframework.boot.test.context.SpringBootTest; 5 | 6 | @SpringBootTest 7 | class ClothingsApplicationTests { 8 | 9 | @Test 10 | void contextLoads() { 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /src/main/java/com/clothes/demo/dao/AdminDao.java: -------------------------------------------------------------------------------- 1 | package com.clothes.demo.dao; 2 | 3 | import java.util.List; 4 | 5 | import org.springframework.data.jpa.repository.JpaRepository; 6 | import org.springframework.data.jpa.repository.Query; 7 | 8 | import com.clothes.demo.models.authenticate.Admin; 9 | 10 | public interface AdminDao extends JpaRepository { 11 | @Query("from Admin where admin_email_id=?1 and admin_password=?2") 12 | List findByadmin_email_idAndadmin_password(String admin_email_id,String admin_password); 13 | } 14 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | HELP.md 2 | target/ 3 | !.mvn/wrapper/maven-wrapper.jar 4 | !**/src/main/**/target/ 5 | !**/src/test/**/target/ 6 | 7 | ### STS ### 8 | .apt_generated 9 | .classpath 10 | .factorypath 11 | .project 12 | .settings 13 | .springBeans 14 | .sts4-cache 15 | 16 | ### IntelliJ IDEA ### 17 | .idea 18 | *.iws 19 | *.iml 20 | *.ipr 21 | 22 | ### NetBeans ### 23 | /nbproject/private/ 24 | /nbbuild/ 25 | /dist/ 26 | /nbdist/ 27 | /.nb-gradle/ 28 | build/ 29 | !**/src/main/**/build/ 30 | !**/src/test/**/build/ 31 | 32 | ### VS Code ### 33 | .vscode/ 34 | -------------------------------------------------------------------------------- /src/main/java/com/clothes/demo/dao/OrderDao.java: -------------------------------------------------------------------------------- 1 | package com.clothes.demo.dao; 2 | 3 | import java.util.List; 4 | 5 | import org.springframework.data.jpa.repository.JpaRepository; 6 | import org.springframework.data.jpa.repository.Query; 7 | 8 | import com.clothes.demo.models.customer.CustomerDetails; 9 | import com.clothes.demo.models.orders.Order; 10 | 11 | public interface OrderDao extends JpaRepository { 12 | @Query("from Order where customer_customer_id=?1 order by order_date desc") 13 | List findByCustomerSorted(CustomerDetails customer); 14 | } 15 | -------------------------------------------------------------------------------- /src/main/java/com/clothes/demo/dao/BillingAddressDao.java: -------------------------------------------------------------------------------- 1 | package com.clothes.demo.dao; 2 | 3 | import org.springframework.data.jpa.repository.JpaRepository; 4 | import org.springframework.data.jpa.repository.Modifying; 5 | import org.springframework.data.jpa.repository.Query; 6 | import org.springframework.transaction.annotation.Transactional; 7 | 8 | import com.clothes.demo.models.vendor.BillingAddress; 9 | 10 | public interface BillingAddressDao extends JpaRepository { 11 | // Update Billing Address details 12 | @Transactional 13 | @Modifying 14 | @Query("update BillingAddress ba set ba.house_no=?1, ba.street=?2, ba.city=?3, ba.district=?4, ba.state=?5, ba.pincode=?6 where ba.aid=?7") 15 | void setBillingAdressById(String house_no,String street,String city,String district,String state,String pincode,Long aid); 16 | 17 | } 18 | -------------------------------------------------------------------------------- /src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | #Database Configuration 2 | spring.datasource.name=JT-Project 3 | spring.datasource.url=jdbc:mysql://localhost:3306/Clothes?createDatabaseIfNotExist=true 4 | spring.datasource.username=root 5 | spring.datasource.driverClassName=com.mysql.jdbc.Driver 6 | spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.MySQL55Dialect 7 | spring.jpa.generate-ddl=true 8 | spring.jpa.hibernate.ddl-auto=update 9 | spring.jpa.show-sql=true 10 | 11 | #Session 12 | spring.session.store-type=jdbc 13 | spring.session.jdbc.initialize-schema=always 14 | spring.session.timeout=900 15 | 16 | #Mail 17 | spring.mail.host=smtp.gmail.com 18 | spring.mail.port=587 19 | spring.mail.username=bot.booter07@gmail.com 20 | spring.mail.password=bot.booter07@bot.booter07 21 | spring.mail.properties.mail.smtp.auth=true 22 | spring.mail.properties.mail.smtp.starttls.enable=true 23 | mail.smtp.debug=true -------------------------------------------------------------------------------- /src/main/java/com/clothes/demo/models/products/FileUploadUtil.java: -------------------------------------------------------------------------------- 1 | package com.clothes.demo.models.products; 2 | 3 | import java.io.*; 4 | import java.nio.file.*; 5 | 6 | import org.springframework.web.multipart.MultipartFile; 7 | 8 | public class FileUploadUtil { 9 | 10 | public static void saveFile(String uploadDir, String fileName, 11 | MultipartFile multipartFile) throws IOException { 12 | Path uploadPath = Paths.get(uploadDir); 13 | 14 | if (!Files.exists(uploadPath)) { 15 | Files.createDirectories(uploadPath); 16 | } 17 | 18 | try (InputStream inputStream = multipartFile.getInputStream()) { 19 | Path filePath = uploadPath.resolve(fileName); 20 | Files.copy(inputStream, filePath, StandardCopyOption.REPLACE_EXISTING); 21 | } catch (IOException ioe) { 22 | throw new IOException("Could not save image file: " + fileName, ioe); 23 | } 24 | } 25 | } -------------------------------------------------------------------------------- /src/main/java/com/clothes/demo/dao/AddressDao.java: -------------------------------------------------------------------------------- 1 | package com.clothes.demo.dao; 2 | 3 | 4 | import java.util.Date; 5 | 6 | import org.springframework.data.jpa.repository.JpaRepository; 7 | import org.springframework.data.jpa.repository.Modifying; 8 | import org.springframework.data.jpa.repository.Query; 9 | import org.springframework.transaction.annotation.Transactional; 10 | 11 | import com.clothes.demo.models.customer.Address; 12 | import com.clothes.demo.models.customer.CustomerDetails; 13 | 14 | public interface AddressDao extends JpaRepository { 15 | @Query("from Address where cd_customer_id=?1") 16 | Address findBycd(CustomerDetails c); 17 | 18 | // Update product details 19 | @Transactional 20 | @Modifying 21 | @Query("update Address ad set ad.house_no=?1, ad.street=?2, ad.city=?3, ad.district=?4, ad.state=?5, ad.pincode=?6 where ad.aid = ?7") 22 | void setAddressById(String house_no, String street, String city, String district, String state, String pincode,Long aid); 23 | 24 | @Transactional 25 | void deleteByCd(CustomerDetails cd); 26 | } 27 | -------------------------------------------------------------------------------- /src/main/java/com/clothes/demo/models/products/MvcConfig.java: -------------------------------------------------------------------------------- 1 | package com.clothes.demo.models.products; 2 | 3 | import java.nio.file.Path; 4 | import java.nio.file.Paths; 5 | 6 | import org.springframework.context.annotation.Configuration; 7 | import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry; 8 | import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; 9 | 10 | @Configuration 11 | public class MvcConfig implements WebMvcConfigurer { 12 | 13 | 14 | @Override 15 | public void addResourceHandlers(ResourceHandlerRegistry registry) { 16 | exposeDirectory("user-photos", registry); 17 | } 18 | 19 | private void exposeDirectory(String dirName, ResourceHandlerRegistry registry) { 20 | Path uploadDir = Paths.get(dirName); 21 | String uploadPath = uploadDir.toFile().getAbsolutePath(); 22 | 23 | if (dirName.startsWith("../")) dirName = dirName.replace("../", ""); 24 | 25 | registry.addResourceHandler("/" + dirName + "/**").addResourceLocations("file:/"+ uploadPath + "/"); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /src/main/java/com/clothes/demo/dao/VendorDao.java: -------------------------------------------------------------------------------- 1 | package com.clothes.demo.dao; 2 | 3 | import java.util.List; 4 | 5 | import org.springframework.data.jpa.repository.JpaRepository; 6 | import org.springframework.data.jpa.repository.Modifying; 7 | import org.springframework.data.jpa.repository.Query; 8 | import org.springframework.transaction.annotation.Transactional; 9 | 10 | import com.clothes.demo.models.vendor.Vendor; 11 | 12 | public interface VendorDao extends JpaRepository { 13 | @Query("from Vendor where vendor_email_id=?1 and vendor_password=?2") 14 | List findByvendor_email_idAndvendor_password(String vendor_email_id, String vendor_password); 15 | 16 | // find by email id 17 | @Query("from Vendor where vendor_email_id=?1") 18 | List findByvendor_email_id(String vendor_email_id); 19 | 20 | // find by contact number 21 | @Query("from Vendor where vendor_contact_number=?1") 22 | List findByvendor_contact_number(String vendor_contact_number); 23 | 24 | // Update Vendor details 25 | @Transactional 26 | @Modifying 27 | @Query("update Vendor v set v.image=?1, v.vendor_contact_number=?2, v.vendor_email_id=?3, v.vendor_name=?4, v.vendor_shop_name=?5 where v.vendor_id=?6") 28 | void setVendorById(String image,String vendor_contact_number,String vendor_email_id,String vendor_name,String vendor_shop_name,Long id); 29 | 30 | 31 | } 32 | -------------------------------------------------------------------------------- /src/main/java/com/clothes/demo/controller/IndexController.java: -------------------------------------------------------------------------------- 1 | package com.clothes.demo.controller; 2 | 3 | import java.util.List; 4 | 5 | import org.springframework.beans.factory.annotation.Autowired; 6 | import org.springframework.stereotype.Controller; 7 | import org.springframework.web.bind.annotation.RequestMapping; 8 | import org.springframework.web.servlet.ModelAndView; 9 | import org.springframework.web.servlet.mvc.support.RedirectAttributes; 10 | 11 | import com.clothes.demo.dao.ProductDao; 12 | import com.clothes.demo.models.products.Product; 13 | 14 | @Controller 15 | public class IndexController { 16 | 17 | @Autowired 18 | ProductDao prodao; 19 | 20 | // @RequestMapping(path="/",method=RequestMethod.POST) write like this or 21 | // @PostMapping(path="/") 22 | @RequestMapping(path="/fashion-factory") 23 | public ModelAndView index(RedirectAttributes redirAttrs) { 24 | List menpro = prodao.findByProduct_category("Men"); 25 | List womenpro = prodao.findByProduct_category("Women"); 26 | List kidspro = prodao.findByProduct_category("Kids"); 27 | 28 | ModelAndView mv = new ModelAndView("index.jsp"); 29 | mv.addObject("menproduct", menpro); 30 | mv.addObject("womenproduct", womenpro); 31 | mv.addObject("kidsproduct", kidspro); 32 | redirAttrs.addFlashAttribute("success", "Everything went just fine."); 33 | return mv; 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /src/main/java/com/clothes/demo/ClothingsApplication.java: -------------------------------------------------------------------------------- 1 | package com.clothes.demo; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.SpringApplication; 5 | import org.springframework.boot.autoconfigure.SpringBootApplication; 6 | import org.springframework.context.ApplicationContext; 7 | import org.springframework.context.annotation.ComponentScan; 8 | 9 | import com.clothes.demo.bean.Mail; 10 | import com.clothes.demo.services.MailService; 11 | 12 | import org.springframework.boot.autoconfigure.SpringBootApplication; 13 | import org.springframework.context.annotation.ComponentScan; 14 | 15 | @SpringBootApplication 16 | @ComponentScan(basePackages = { 17 | "com.clothes.demo" 18 | }) 19 | public class ClothingsApplication { 20 | 21 | public static void main(String[] args) { 22 | ApplicationContext ctx = SpringApplication.run(ClothingsApplication.class, args); 23 | // Mail mail = new Mail(); 24 | // mail.setMailFrom("d.poriya05@gmail.com"); 25 | // mail.setMailTo("dharmeshkporiya@gmail.com"); 26 | // mail.setMailSubject("Spring Boot - Email Example"); 27 | // mail.setMailContent("Learn How to send Email using Spring Boot!!!\n\nThanks\nwww.technicalkeeda.com"); 28 | // 29 | // 30 | // MailService mailService = (MailService) ctx.getBean("mailService"); 31 | // mailService.sendEmail(mail); 32 | } 33 | 34 | } 35 | -------------------------------------------------------------------------------- /src/main/java/com/clothes/demo/dao/OrderItemDao.java: -------------------------------------------------------------------------------- 1 | package com.clothes.demo.dao; 2 | 3 | import java.util.List; 4 | 5 | import org.springframework.data.jpa.repository.JpaRepository; 6 | import org.springframework.data.jpa.repository.Modifying; 7 | import org.springframework.data.jpa.repository.Query; 8 | import org.springframework.transaction.annotation.Transactional; 9 | 10 | import com.clothes.demo.models.orders.Order; 11 | import com.clothes.demo.models.orders.OrderItem; 12 | import com.clothes.demo.models.products.Product; 13 | import com.clothes.demo.models.vendor.Vendor; 14 | 15 | public interface OrderItemDao extends JpaRepository{ 16 | // find item by orderid and product id 17 | @Query("from OrderItem where order_id=?1 and product_id=?2") 18 | List findByOrder_idAndProduct_id(Order o,Product p); 19 | 20 | // Update product details 21 | @Transactional 22 | @Modifying 23 | @Query("update OrderItem oi set oi.quentity=?1 where oi.id = ?2") 24 | void setOrderItemByQuentity(int quentity,Long id); 25 | 26 | // finding by order id 27 | @Query("from OrderItem where order_id=?1") 28 | List findAllByOrder_id(Order o); 29 | 30 | // find all products according to vendor and product id 31 | @Query("from OrderItem as oi where oi.product in (from Product where vendor=?1)") 32 | List findAllByVendor(Vendor v); 33 | 34 | // find all products according to vendor and product id 35 | @Transactional 36 | void deleteAllByOrder(Order o); 37 | 38 | } 39 | -------------------------------------------------------------------------------- /src/main/java/com/clothes/demo/configuration/MailConfiguration.java: -------------------------------------------------------------------------------- 1 | package com.clothes.demo.configuration; 2 | 3 | import java.util.Properties; 4 | 5 | import org.springframework.beans.factory.annotation.Autowired; 6 | import org.springframework.context.annotation.Bean; 7 | import org.springframework.context.annotation.Configuration; 8 | import org.springframework.core.env.Environment; 9 | import org.springframework.mail.javamail.JavaMailSender; 10 | import org.springframework.mail.javamail.JavaMailSenderImpl; 11 | 12 | @Configuration 13 | public class MailConfiguration { 14 | 15 | @Autowired 16 | private Environment env; 17 | 18 | @Bean 19 | public JavaMailSender getMailSender() { 20 | JavaMailSenderImpl mailSender = new JavaMailSenderImpl(); 21 | 22 | mailSender.setHost(env.getProperty("spring.mail.host")); 23 | mailSender.setPort(Integer.valueOf(env.getProperty("spring.mail.port"))); 24 | mailSender.setUsername(env.getProperty("spring.mail.username")); 25 | mailSender.setPassword(env.getProperty("spring.mail.password")); 26 | 27 | Properties javaMailProperties = new Properties(); 28 | javaMailProperties.put("mail.smtp.starttls.enable", "true"); 29 | javaMailProperties.put("mail.smtp.auth", "true"); 30 | javaMailProperties.put("mail.transport.protocol", "smtp"); 31 | javaMailProperties.put("mail.debug", "true"); 32 | 33 | mailSender.setJavaMailProperties(javaMailProperties); 34 | return mailSender; 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /src/main/java/com/clothes/demo/services/MailServiceImpl.java: -------------------------------------------------------------------------------- 1 | package com.clothes.demo.services; 2 | 3 | import java.io.UnsupportedEncodingException; 4 | 5 | import javax.mail.MessagingException; 6 | import javax.mail.internet.InternetAddress; 7 | import javax.mail.internet.MimeMessage; 8 | 9 | import org.springframework.beans.factory.annotation.Autowired; 10 | import org.springframework.mail.javamail.JavaMailSender; 11 | import org.springframework.mail.javamail.MimeMessageHelper; 12 | import org.springframework.stereotype.Service; 13 | 14 | import com.clothes.demo.bean.Mail; 15 | 16 | 17 | 18 | @Service("mailService") 19 | public class MailServiceImpl implements MailService { 20 | 21 | @Autowired 22 | JavaMailSender mailSender; 23 | 24 | public void sendEmail(Mail mail) { 25 | MimeMessage mimeMessage = mailSender.createMimeMessage(); 26 | 27 | try { 28 | 29 | MimeMessageHelper mimeMessageHelper = new MimeMessageHelper(mimeMessage, true); 30 | 31 | mimeMessageHelper.setSubject(mail.getMailSubject()); 32 | mimeMessageHelper.setFrom(new InternetAddress(mail.getMailFrom(), "fashion-factory.com")); 33 | mimeMessageHelper.setTo(mail.getMailTo()); 34 | mimeMessageHelper.setText(mail.getMailContent()); 35 | 36 | mailSender.send(mimeMessageHelper.getMimeMessage()); 37 | 38 | } catch (MessagingException e) { 39 | e.printStackTrace(); 40 | } catch (UnsupportedEncodingException e) { 41 | e.printStackTrace(); 42 | } 43 | } 44 | 45 | } -------------------------------------------------------------------------------- /src/main/java/com/clothes/demo/dao/CustomerDao.java: -------------------------------------------------------------------------------- 1 | package com.clothes.demo.dao; 2 | 3 | import java.util.Date; 4 | import java.util.List; 5 | 6 | import org.springframework.data.jpa.repository.JpaRepository; 7 | import org.springframework.data.jpa.repository.Modifying; 8 | import org.springframework.data.jpa.repository.Query; 9 | import org.springframework.transaction.annotation.Transactional; 10 | 11 | import com.clothes.demo.models.customer.CustomerDetails; 12 | 13 | public interface CustomerDao extends JpaRepository { 14 | @Query("from CustomerDetails where customer_email_id=?1 and customer_password=?2") 15 | List findBycustomer_email_idAndcustomer_password(String customer_email_id,String customer_password); 16 | 17 | // find by emailid 18 | @Query("from CustomerDetails where customer_email_id=?1") 19 | List findBycustomer_email_id(String customer_email_id); 20 | 21 | // find by contact number 22 | @Query("from CustomerDetails where customer_contact_number=?1") 23 | List findBycustomer_contact_number(String customer_contact_number); 24 | 25 | // Update Customer details 26 | @Transactional 27 | @Modifying 28 | @Query("update CustomerDetails cd set cd.customer_name=?1, cd.profile_image=?2, cd. customer_email_id=?3, cd.customer_contact_number=?4, cd.customer_dob=?5 where cd.customer_id = ?6") 29 | void setCustomerDetailsById(String customer_name,String profile_image,String customer_email_id,String customer_contact_number,Date customer_dob,Long id); 30 | 31 | @Transactional 32 | void deleteById(Long id); 33 | } 34 | -------------------------------------------------------------------------------- /src/main/java/com/clothes/demo/models/authenticate/Admin.java: -------------------------------------------------------------------------------- 1 | package com.clothes.demo.models.authenticate; 2 | 3 | import java.io.Serializable; 4 | 5 | import javax.persistence.Column; 6 | import javax.persistence.Entity; 7 | import javax.persistence.GeneratedValue; 8 | import javax.persistence.GenerationType; 9 | import javax.persistence.Id; 10 | 11 | @SuppressWarnings("serial") 12 | @Entity 13 | public class Admin implements Serializable{ 14 | @Id 15 | @GeneratedValue(strategy = GenerationType.AUTO) 16 | private Long admin_id; 17 | private String admin_name; 18 | @Column(name = "admin_email_id",unique=true) 19 | private String admin_email_id; 20 | private String admin_password; 21 | 22 | public Long getAdmin_id() { 23 | return admin_id; 24 | } 25 | public void setAdmin_id(Long admin_id) { 26 | this.admin_id = admin_id; 27 | } 28 | public String getAdmin_name() { 29 | return admin_name; 30 | } 31 | public void setAdmin_name(String admin_name) { 32 | this.admin_name = admin_name; 33 | } 34 | public String getAdmin_email_id() { 35 | return admin_email_id; 36 | } 37 | public void setAdmin_email_id(String admin_email_id) { 38 | this.admin_email_id = admin_email_id; 39 | } 40 | public String getAdmin_password() { 41 | return admin_password; 42 | } 43 | public void setAdmin_password(String admin_password) { 44 | this.admin_password = admin_password; 45 | } 46 | @Override 47 | public String toString() { 48 | return "Admin [admin_id=" + admin_id + ", admin_name=" + admin_name + ", admin_email_id=" + admin_email_id 49 | + ", admin_password=" + admin_password + "]"; 50 | } 51 | 52 | 53 | 54 | 55 | } 56 | -------------------------------------------------------------------------------- /src/main/java/com/clothes/demo/dao/ProductDao.java: -------------------------------------------------------------------------------- 1 | package com.clothes.demo.dao; 2 | 3 | import java.util.Date; 4 | import java.util.List; 5 | 6 | import org.springframework.data.jpa.repository.JpaRepository; 7 | import org.springframework.data.jpa.repository.Modifying; 8 | import org.springframework.data.jpa.repository.Query; 9 | import org.springframework.transaction.annotation.Transactional; 10 | 11 | import com.clothes.demo.models.products.Product; 12 | import com.clothes.demo.models.vendor.Vendor; 13 | 14 | public interface ProductDao extends JpaRepository { 15 | // find product by vendor id 16 | @Query("from Product where vendor_vendor_id=?1 order by product_added_date desc") 17 | List findByVendor(Vendor vendor); 18 | 19 | // Find by product code 20 | @Query("from Product where product_code=?1") 21 | List findByProduct_code(String product_code); 22 | 23 | // Update product details 24 | @Transactional 25 | @Modifying 26 | @Query("update Product p set p.product_code=?1, p.product_image=?2, p.product_name=?3, p.product_description=?4, p.product_price=?5, p.product_category=?6 where p.id = ?7") 27 | void setProductDetailsById(String product_code, String product_image, String product_name, String product_description, Double product_price, String product_category,Long id); 28 | 29 | // find all product by category 30 | @Query("from Product where product_category=?1 order by product_added_date") 31 | List findByProduct_category(String product_category); 32 | 33 | // set sold items by using id 34 | @Transactional 35 | @Modifying 36 | @Query("update Product p set p.sold_quantity=?1 where p.id = ?2") 37 | void setSold_QuantityById(Long quentity,Long id); 38 | } 39 | -------------------------------------------------------------------------------- /src/main/java/com/clothes/demo/models/customer/Address.java: -------------------------------------------------------------------------------- 1 | package com.clothes.demo.models.customer; 2 | 3 | import java.io.Serializable; 4 | 5 | import javax.persistence.Entity; 6 | import javax.persistence.GeneratedValue; 7 | import javax.persistence.GenerationType; 8 | import javax.persistence.Id; 9 | import javax.persistence.OneToOne; 10 | 11 | @SuppressWarnings("serial") 12 | @Entity 13 | public class Address implements Serializable { 14 | @Id 15 | @GeneratedValue(strategy = GenerationType.AUTO) 16 | private Long aid; 17 | private String house_no; 18 | private String street; 19 | private String city; 20 | private String district; 21 | private String state; 22 | private String pincode; 23 | @OneToOne 24 | CustomerDetails cd; 25 | 26 | public Long getAid() { 27 | return aid; 28 | } 29 | 30 | public void setAid(Long aid) { 31 | this.aid = aid; 32 | } 33 | 34 | public String getHouse_no() { 35 | return house_no; 36 | } 37 | 38 | public void setHouse_no(String house_no) { 39 | this.house_no = house_no; 40 | } 41 | 42 | public String getStreet() { 43 | return street; 44 | } 45 | 46 | public void setStreet(String street) { 47 | this.street = street; 48 | } 49 | 50 | public String getCity() { 51 | return city; 52 | } 53 | 54 | public void setCity(String city) { 55 | this.city = city; 56 | } 57 | 58 | public String getDistrict() { 59 | return district; 60 | } 61 | 62 | public void setDistrict(String district) { 63 | this.district = district; 64 | } 65 | 66 | public String getState() { 67 | return state; 68 | } 69 | 70 | public void setState(String state) { 71 | this.state = state; 72 | } 73 | 74 | public String getPincode() { 75 | return pincode; 76 | } 77 | 78 | public void setPincode(String pincode) { 79 | this.pincode = pincode; 80 | } 81 | 82 | public CustomerDetails getCd() { 83 | return cd; 84 | } 85 | 86 | public void setCd(CustomerDetails cd) { 87 | this.cd = cd; 88 | } 89 | 90 | } 91 | -------------------------------------------------------------------------------- /src/main/java/com/clothes/demo/models/vendor/BillingAddress.java: -------------------------------------------------------------------------------- 1 | package com.clothes.demo.models.vendor; 2 | 3 | import java.io.Serializable; 4 | 5 | import javax.persistence.Entity; 6 | import javax.persistence.GeneratedValue; 7 | import javax.persistence.GenerationType; 8 | import javax.persistence.Id; 9 | 10 | @SuppressWarnings("serial") 11 | @Entity 12 | public class BillingAddress implements Serializable { 13 | @Id 14 | @GeneratedValue(strategy = GenerationType.AUTO) 15 | private Long aid; 16 | private String house_no; 17 | private String street; 18 | private String city; 19 | private String district; 20 | private String state; 21 | private String pincode; 22 | 23 | public Long getAid() { 24 | return aid; 25 | } 26 | 27 | public void setAid(Long aid) { 28 | this.aid = aid; 29 | } 30 | 31 | public String getHouse_no() { 32 | return house_no; 33 | } 34 | 35 | public void setHouse_no(String house_no) { 36 | this.house_no = house_no; 37 | } 38 | 39 | public String getStreet() { 40 | return street; 41 | } 42 | 43 | public void setStreet(String street) { 44 | this.street = street; 45 | } 46 | 47 | public String getCity() { 48 | return city; 49 | } 50 | 51 | public void setCity(String city) { 52 | this.city = city; 53 | } 54 | 55 | public String getDistrict() { 56 | return district; 57 | } 58 | 59 | public void setDistrict(String district) { 60 | this.district = district; 61 | } 62 | 63 | public String getState() { 64 | return state; 65 | } 66 | 67 | public void setState(String state) { 68 | this.state = state; 69 | } 70 | 71 | public String getPincode() { 72 | return pincode; 73 | } 74 | 75 | public void setPincode(String pincode) { 76 | this.pincode = pincode; 77 | } 78 | 79 | @Override 80 | public String toString() { 81 | return "BillingAddress [aid=" + aid + ", house_no=" + house_no + ", street=" + street + ", city=" + city 82 | + ", district=" + district + ", state=" + state + ", pincode=" + pincode + "]"; 83 | } 84 | 85 | } 86 | -------------------------------------------------------------------------------- /src/main/webapp/css/productcard.css: -------------------------------------------------------------------------------- 1 | @charset "ISO-8859-1"; 2 | .gallery .content h3 { 3 | text-align: center; 4 | font-size: 30px; 5 | margin: 0; 6 | padding-top: 10px; 7 | } 8 | 9 | .gallery .content a { 10 | text-decoration: none; 11 | } 12 | 13 | .gallery { 14 | display: flex; 15 | flex-wrap: wrap; 16 | width: 100%; 17 | justify-content: center; 18 | align-items: center; 19 | margin: 50px 0; 20 | } 21 | 22 | .gallery .content { 23 | width: 24%; 24 | margin: 15px; 25 | box-sizing: border-box; 26 | float: left; 27 | text-align: center; 28 | border-radius: 10px; 29 | border-top-right-radius: 10px; 30 | border-bottom-right-radius: 10px; 31 | padding-top: 10px; 32 | box-shadow: 0 0 10px rgba(0, 0, 0, 0.1); 33 | transition: .4s; 34 | } 35 | 36 | .gallery .content:hover { 37 | box-shadow: 0 0 11px rgba(33, 33, 33, .2); 38 | transform: translate(0px, -8px); 39 | transition: .6s; 40 | } 41 | 42 | .gallery .content img { 43 | width: 200px; 44 | height: 200px; 45 | text-align: center; 46 | margin: 0 auto; 47 | display: block; 48 | } 49 | 50 | .gallery .content p { 51 | text-align: center; 52 | color: #b2bec3; 53 | padding: 0 8px; 54 | font-weight: bold; 55 | } 56 | 57 | .gallery .content h6 { 58 | font-size: 26px; 59 | text-align: center; 60 | color: #222f3e; 61 | margin: 0; 62 | } 63 | 64 | .gallery .content button { 65 | text-align: center; 66 | font-size: 24px; 67 | color: #fff; 68 | width: 100%; 69 | padding: 15px; 70 | border: 0px; 71 | outline: none; 72 | cursor: pointer; 73 | margin-top: 5px; 74 | border-bottom-right-radius: 10px; 75 | border-bottom-left-radius: 10px; 76 | } 77 | 78 | .gallery .content .buy-1 { 79 | background-color: #2183a2; 80 | } 81 | 82 | .gallery .content .buy-2 { 83 | background-color: #3b3e6e; 84 | } 85 | 86 | .gallery .content .buy-3 { 87 | background-color: #0b0b0b; 88 | } 89 | 90 | @media ( max-width : 1000px) { 91 | .gallery .content { 92 | width: 46%; 93 | } 94 | } 95 | 96 | @media ( max-width : 750px) { 97 | .gallery .content { 98 | width: 100%; 99 | } 100 | } -------------------------------------------------------------------------------- /src/main/java/com/clothes/demo/bean/Mail.java: -------------------------------------------------------------------------------- 1 | package com.clothes.demo.bean; 2 | 3 | import java.util.Date; 4 | import java.util.List; 5 | 6 | public class Mail { 7 | 8 | private String mailFrom; 9 | 10 | private String mailTo; 11 | 12 | private String mailCc; 13 | 14 | private String mailBcc; 15 | 16 | private String mailSubject; 17 | 18 | private String mailContent; 19 | 20 | private String contentType; 21 | 22 | private List < Object > attachments; 23 | 24 | public Mail() { 25 | contentType = "text/plain"; 26 | } 27 | 28 | public String getContentType() { 29 | return contentType; 30 | } 31 | 32 | public void setContentType(String contentType) { 33 | this.contentType = contentType; 34 | } 35 | 36 | public String getMailBcc() { 37 | return mailBcc; 38 | } 39 | 40 | public void setMailBcc(String mailBcc) { 41 | this.mailBcc = mailBcc; 42 | } 43 | 44 | public String getMailCc() { 45 | return mailCc; 46 | } 47 | 48 | public void setMailCc(String mailCc) { 49 | this.mailCc = mailCc; 50 | } 51 | 52 | public String getMailFrom() { 53 | return mailFrom; 54 | } 55 | 56 | public void setMailFrom(String mailFrom) { 57 | this.mailFrom = mailFrom; 58 | } 59 | 60 | public String getMailSubject() { 61 | return mailSubject; 62 | } 63 | 64 | public void setMailSubject(String mailSubject) { 65 | this.mailSubject = mailSubject; 66 | } 67 | 68 | public String getMailTo() { 69 | return mailTo; 70 | } 71 | 72 | public void setMailTo(String mailTo) { 73 | this.mailTo = mailTo; 74 | } 75 | 76 | public Date getMailSendDate() { 77 | return new Date(); 78 | } 79 | 80 | public String getMailContent() { 81 | return mailContent; 82 | } 83 | 84 | public void setMailContent(String mailContent) { 85 | this.mailContent = mailContent; 86 | } 87 | 88 | public List < Object > getAttachments() { 89 | return attachments; 90 | } 91 | 92 | public void setAttachments(List < Object > attachments) { 93 | this.attachments = attachments; 94 | } 95 | 96 | } 97 | -------------------------------------------------------------------------------- /src/main/java/com/clothes/demo/models/orders/Order.java: -------------------------------------------------------------------------------- 1 | package com.clothes.demo.models.orders; 2 | 3 | import java.io.Serializable; 4 | import java.sql.Time; 5 | import java.util.Date; 6 | import java.util.List; 7 | 8 | import javax.persistence.Entity; 9 | import javax.persistence.FetchType; 10 | import javax.persistence.GeneratedValue; 11 | import javax.persistence.GenerationType; 12 | import javax.persistence.Id; 13 | import javax.persistence.ManyToOne; 14 | import javax.persistence.OneToMany; 15 | import javax.persistence.Table; 16 | 17 | import org.springframework.format.annotation.DateTimeFormat; 18 | 19 | import com.clothes.demo.models.customer.CustomerDetails; 20 | 21 | @SuppressWarnings("serial") 22 | @Entity 23 | @Table(name = "myorder") 24 | public class Order implements Serializable { 25 | @Id 26 | @GeneratedValue(strategy = GenerationType.AUTO) 27 | private Long id; 28 | @ManyToOne 29 | private CustomerDetails customer; 30 | @DateTimeFormat(pattern = "yyyy-MM-dd") 31 | private Date order_date; 32 | @DateTimeFormat(pattern = "hh:mm:ss") 33 | private Time order_time; 34 | @OneToMany(mappedBy = "order", fetch = FetchType.EAGER) 35 | private List order_items; 36 | 37 | public Long getId() { 38 | return id; 39 | } 40 | 41 | public void setId(Long id) { 42 | this.id = id; 43 | } 44 | 45 | public CustomerDetails getCustomer() { 46 | return customer; 47 | } 48 | 49 | public void setCustomer(CustomerDetails customer) { 50 | this.customer = customer; 51 | } 52 | 53 | public Date getOrder_date() { 54 | return order_date; 55 | } 56 | 57 | public void setOrder_date(Date order_date) { 58 | this.order_date = order_date; 59 | } 60 | 61 | public Time getOrder_time() { 62 | return order_time; 63 | } 64 | 65 | public void setOrder_time(Time order_time) { 66 | this.order_time = order_time; 67 | } 68 | 69 | public List getOrder_items() { 70 | return order_items; 71 | } 72 | 73 | public void setOrder_items(List order_items) { 74 | this.order_items = order_items; 75 | } 76 | 77 | @Override 78 | public String toString() { 79 | return "Order [id=" + id + ", customer=" + customer + ", order_date=" + order_date + ", order_time=" 80 | + order_time + ", order_items=" + order_items + "]"; 81 | } 82 | 83 | 84 | } 85 | -------------------------------------------------------------------------------- /src/main/java/com/clothes/demo/controller/AddressController.java: -------------------------------------------------------------------------------- 1 | package com.clothes.demo.controller; 2 | 3 | import javax.servlet.http.HttpServletRequest; 4 | import javax.servlet.http.HttpSession; 5 | 6 | import org.springframework.beans.factory.annotation.Autowired; 7 | import org.springframework.stereotype.Controller; 8 | import org.springframework.web.bind.annotation.RequestMapping; 9 | import org.springframework.web.bind.annotation.RequestMethod; 10 | import org.springframework.web.bind.annotation.RequestParam; 11 | import org.springframework.web.servlet.mvc.support.RedirectAttributes; 12 | 13 | import com.clothes.demo.dao.AddressDao; 14 | import com.clothes.demo.dao.CustomerDao; 15 | import com.clothes.demo.models.customer.Address; 16 | import com.clothes.demo.models.customer.CustomerDetails; 17 | 18 | @Controller 19 | public class AddressController { 20 | @Autowired 21 | AddressDao adddao; 22 | @Autowired 23 | CustomerDao custdao; 24 | 25 | // add customer address 26 | @RequestMapping(path = "/fashion-factory/addAddress", method = RequestMethod.POST) 27 | public String addAddress(Address address,@RequestParam("customer_id") Long cust_id,HttpServletRequest request,RedirectAttributes redirAttrs) { 28 | HttpSession session = request.getSession(); 29 | CustomerDetails cust = custdao.findById(cust_id).orElse(null); 30 | address.setCd(cust); 31 | adddao.save(address); 32 | // System.out.println("Address Entered"); 33 | session.setAttribute("SUCCESS", "Addres Added Successfully!!"); 34 | String referer = request.getHeader("Referer"); 35 | return "redirect:" + referer; 36 | } 37 | 38 | // Edit customer address 39 | @RequestMapping(path = "/fashion-factory/editAddress", method = RequestMethod.POST) 40 | public String editAddress(Address address,@RequestParam("customer_id") Long cust_id,@RequestParam("address_id") Long add_id,HttpServletRequest request,RedirectAttributes redirAttrs) { 41 | HttpSession session = request.getSession(); 42 | adddao.setAddressById(address.getHouse_no(),address.getStreet(),address.getCity(),address.getDistrict(),address.getState(),address.getPincode(),add_id); 43 | // System.out.println("Address Edited"); 44 | session.setAttribute("SUCCESS", "Addres Updated Successfully!!"); 45 | String referer = request.getHeader("Referer"); 46 | return "redirect:" + referer; 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /src/main/java/com/clothes/demo/models/orders/OrderItem.java: -------------------------------------------------------------------------------- 1 | package com.clothes.demo.models.orders; 2 | 3 | import java.io.Serializable; 4 | import java.sql.Time; 5 | import java.util.Date; 6 | 7 | import javax.persistence.Entity; 8 | import javax.persistence.GeneratedValue; 9 | import javax.persistence.GenerationType; 10 | import javax.persistence.Id; 11 | import javax.persistence.ManyToOne; 12 | import javax.persistence.OneToOne; 13 | 14 | import org.springframework.format.annotation.DateTimeFormat; 15 | 16 | import com.clothes.demo.models.products.Product; 17 | 18 | @SuppressWarnings("serial") 19 | @Entity 20 | public class OrderItem implements Serializable { 21 | @Id 22 | @GeneratedValue(strategy = GenerationType.AUTO) 23 | private Long id; 24 | private int quentity; 25 | private Double item_price; 26 | @DateTimeFormat(pattern = "yyyy-MM-dd") 27 | private Date order_item_date; 28 | @DateTimeFormat(pattern = "hh:mm:ss") 29 | private Time order_item_time; 30 | @OneToOne 31 | private Product product; 32 | @ManyToOne 33 | private Order order; 34 | 35 | public Long getId() { 36 | return id; 37 | } 38 | 39 | public void setId(Long id) { 40 | this.id = id; 41 | } 42 | 43 | public int getQuentity() { 44 | return quentity; 45 | } 46 | 47 | public void setQuentity(int quentity) { 48 | this.quentity = quentity; 49 | } 50 | 51 | public Double getItem_price() { 52 | return item_price; 53 | } 54 | 55 | public void setItem_price(Double item_price) { 56 | this.item_price = item_price; 57 | } 58 | 59 | public Date getOrder_item_date() { 60 | return order_item_date; 61 | } 62 | 63 | public void setOrder_item_date(Date order_item_date) { 64 | this.order_item_date = order_item_date; 65 | } 66 | 67 | public Time getOrder_item_time() { 68 | return order_item_time; 69 | } 70 | 71 | public void setOrder_item_time(Time order_item_time) { 72 | this.order_item_time = order_item_time; 73 | } 74 | 75 | public Product getProduct() { 76 | return product; 77 | } 78 | 79 | public void setProduct(Product product) { 80 | this.product = product; 81 | } 82 | 83 | public Order getOrder() { 84 | return order; 85 | } 86 | 87 | public void setOrder(Order order) { 88 | this.order = order; 89 | } 90 | 91 | @Override 92 | public String toString() { 93 | return "OrderItem [id=" + id + ", quentity=" + quentity + ", item_price=" + item_price + ", order_item_date=" 94 | + order_item_date + ", order_item_time=" + order_item_time + ", order=" + order + "]"; 95 | } 96 | 97 | 98 | 99 | } 100 | -------------------------------------------------------------------------------- /src/main/webapp/pages/navfooter/formmodel.css: -------------------------------------------------------------------------------- 1 | /*assign full width inputs*/ 2 | input[type=text], input[type=password], input[type=tel],input[type=number],input[type=url], input[type=email], 3 | input[type=date],select { 4 | width: 100%; 5 | padding: 12px 20px; 6 | margin: 8px 0; 7 | display: inline-block; 8 | border: 1px solid #ccc; 9 | box-sizing: border-box; 10 | } 11 | 12 | /*set a style for the buttons*/ 13 | button { 14 | background-color: #4CAF50; 15 | color: white; 16 | padding: 14px 20px; 17 | margin: 8px 0; 18 | border: none; 19 | cursor: pointer; 20 | width: 100%; 21 | } 22 | 23 | /* set a hover effect for the button*/ 24 | button:hover { 25 | opacity: 0.8; 26 | } 27 | 28 | /*set extra style for the cancel button*/ 29 | .cancelbtn { 30 | width: auto; 31 | padding: 10px 18px; 32 | background-color: #f44336; 33 | } 34 | 35 | /*centre the display image inside the container*/ 36 | .imgcontainer { 37 | text-align: center; 38 | margin: 24px 0 12px 0; 39 | position: relative; 40 | } 41 | 42 | /*set image properties*/ 43 | img.avatar { 44 | width: 40%; 45 | border-radius: 50%; 46 | } 47 | 48 | /*set padding to the container*/ 49 | .container { 50 | padding: 16px; 51 | } 52 | 53 | /*set the forgot password text*/ 54 | span.psw { 55 | float: right; 56 | padding-top: 16px; 57 | } 58 | 59 | /*set the Modal background*/ 60 | .modal { 61 | display: none; 62 | position: fixed; 63 | z-index: 1; 64 | left: 0; 65 | top: 0; 66 | width: 100%; 67 | height: 100%; 68 | overflow: auto; 69 | background-color: rgb(0, 0, 0); 70 | background-color: rgba(0, 0, 0, 0.4); 71 | padding-top: 60px; 72 | } 73 | 74 | /*style the model content box*/ 75 | .modal-content { 76 | background-color: #fefefe; 77 | margin: 5% auto 15% auto; 78 | border: 1px solid #888; 79 | width: 80%; 80 | } 81 | 82 | /*style the close button*/ 83 | .close { 84 | position: absolute; 85 | right: 25px; 86 | top: 0; 87 | color: #000; 88 | font-size: 35px; 89 | font-weight: bold; 90 | } 91 | 92 | .close:hover, .close:focus { 93 | color: red; 94 | cursor: pointer; 95 | } 96 | 97 | /* add zoom animation*/ 98 | .animate { 99 | -webkit-animation: animatezoom 0.6s; 100 | animation: animatezoom 0.6s 101 | } 102 | 103 | @-webkit-keyframes animatezoom { 104 | from { -webkit-transform:scale(0)} 105 | to { 106 | -webkit-transform: scale(1) 107 | } 108 | 109 | } 110 | @keyframes animatezoom { 111 | from { transform:scale(0)} 112 | to { 113 | transform: scale(1) 114 | } 115 | 116 | } 117 | @media screen and (max-width: 300px) { 118 | span.psw { 119 | display: block; 120 | float: none; 121 | } 122 | .cancelbtn { 123 | width: 100%; 124 | } 125 | } -------------------------------------------------------------------------------- /pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 4.0.0 6 | 7 | org.springframework.boot 8 | spring-boot-starter-parent 9 | 2.6.4 10 | 11 | 12 | com.clothes 13 | Clothings 14 | 0.0.1-SNAPSHOT 15 | Clothings 16 | Demo project for Spring Boot 17 | 18 | 11 19 | 20 | 21 | 22 | org.springframework.boot 23 | spring-boot-starter-data-jpa 24 | 25 | 26 | org.springframework.boot 27 | spring-boot-starter-jdbc 28 | 29 | 30 | org.springframework.boot 31 | spring-boot-starter-web 32 | 33 | 34 | 35 | org.springframework.boot 36 | spring-boot-devtools 37 | runtime 38 | true 39 | 40 | 41 | mysql 42 | mysql-connector-java 43 | runtime 44 | 45 | 46 | org.springframework.boot 47 | spring-boot-starter-test 48 | test 49 | 50 | 52 | 53 | 54 | org.apache.tomcat 55 | tomcat-jasper 56 | 9.0.58 57 | 58 | 59 | 60 | org.springframework.session 61 | spring-session-core 62 | 63 | 64 | org.springframework.session 65 | spring-session-jdbc 66 | 67 | 68 | 69 | 70 | jstl 71 | jstl 72 | ${jstl.version} 73 | 74 | 75 | 76 | org.springframework.boot 77 | spring-boot-starter-mail 78 | 79 | 80 | 81 | 82 | 83 | 84 | org.springframework.boot 85 | spring-boot-maven-plugin 86 | 87 | 88 | 89 | 90 | 91 | -------------------------------------------------------------------------------- /src/main/java/com/clothes/demo/models/products/Product.java: -------------------------------------------------------------------------------- 1 | package com.clothes.demo.models.products; 2 | 3 | import java.io.Serializable; 4 | import java.util.Date; 5 | 6 | import javax.persistence.Column; 7 | import javax.persistence.Entity; 8 | import javax.persistence.GeneratedValue; 9 | import javax.persistence.GenerationType; 10 | import javax.persistence.Id; 11 | import javax.persistence.ManyToOne; 12 | 13 | import org.springframework.format.annotation.DateTimeFormat; 14 | 15 | import com.clothes.demo.models.vendor.Vendor; 16 | 17 | @SuppressWarnings("serial") 18 | @Entity 19 | public class Product implements Serializable { 20 | @Id 21 | @GeneratedValue(strategy = GenerationType.AUTO) 22 | private Long id; 23 | @Column(name = "product_code", unique = true) 24 | private String product_code; 25 | private String product_image; 26 | private String product_name; 27 | private String product_description; 28 | private Double product_price; 29 | private String product_category; 30 | @DateTimeFormat(pattern = "yyyy-MM-dd") 31 | private Date product_added_date; 32 | @Column(columnDefinition = "long default 0") 33 | private Long sold_quantity; 34 | @ManyToOne 35 | private Vendor vendor; 36 | 37 | public Long getId() { 38 | return id; 39 | } 40 | 41 | public void setId(Long id) { 42 | this.id = id; 43 | } 44 | 45 | public String getProduct_code() { 46 | return product_code; 47 | } 48 | 49 | public void setProduct_code(String product_code) { 50 | this.product_code = product_code; 51 | } 52 | 53 | public String getProduct_image() { 54 | return product_image; 55 | } 56 | 57 | public void setProduct_image(String fileName) { 58 | this.product_image = fileName; 59 | } 60 | 61 | public String getProduct_name() { 62 | return product_name; 63 | } 64 | 65 | public void setProduct_name(String product_name) { 66 | this.product_name = product_name; 67 | } 68 | 69 | public String getProduct_description() { 70 | return product_description; 71 | } 72 | 73 | public void setProduct_description(String product_description) { 74 | this.product_description = product_description; 75 | } 76 | 77 | public Double getProduct_price() { 78 | return product_price; 79 | } 80 | 81 | public void setProduct_price(Double product_price) { 82 | this.product_price = product_price; 83 | } 84 | 85 | public String getProduct_category() { 86 | return product_category; 87 | } 88 | 89 | public void setProduct_category(String product_category) { 90 | this.product_category = product_category; 91 | } 92 | 93 | public Date getProduct_added_date() { 94 | return product_added_date; 95 | } 96 | 97 | public void setProduct_added_date(Date product_added_date) { 98 | this.product_added_date = product_added_date; 99 | } 100 | 101 | public Long getSold_quantity() { 102 | return sold_quantity; 103 | } 104 | 105 | public void setSold_quantity(Long sold_quantity) { 106 | this.sold_quantity = sold_quantity; 107 | } 108 | 109 | public Vendor getVendor() { 110 | return vendor; 111 | } 112 | 113 | public void setVendor(Vendor vendor) { 114 | this.vendor = vendor; 115 | } 116 | 117 | @Override 118 | public String toString() { 119 | return "Product [id=" + id + ", product_code=" + product_code + ", product_image=" + product_image 120 | + ", product_name=" + product_name + ", product_description=" + product_description + ", product_price=" 121 | + product_price + ", product_category=" + product_category + ", product_added_date=" 122 | + product_added_date + ", vendor=" + vendor + "]"; 123 | } 124 | 125 | } 126 | -------------------------------------------------------------------------------- /src/main/webapp/index.jsp: -------------------------------------------------------------------------------- 1 | <%@ page language="java" contentType="text/html; charset=ISO-8859-1" 2 | pageEncoding="ISO-8859-1" isELIgnored="false"%> 3 | 4 | 5 | 6 | 7 | Fashion-Factory 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | <% 17 | response.setHeader("Cache-Control", "no-cache, no-store, must-revalidate"); // this is for HTTP version 1.1 not work for lesser version 18 | response.setHeader("Pragma", "no-cache"); // this is for HTTP version 1.0 19 | response.setHeader("Expires", "0"); // this is for proxies server 20 | %> 21 | 22 | 23 | <%@include file="pages/navfooter/navbar.jsp"%> 24 | 25 | 26 | 27 | 28 | <% 29 | String error_message = (String)session.getAttribute("ERROR"); 30 | String success_message = (String)session.getAttribute("SUCCESS"); 31 | %> 32 | <% if(null != error_message){%> 33 | 37 | <% 38 | session.removeAttribute("ERROR"); 39 | }else if(null != success_message){ 40 | %> 41 | 45 | <% 46 | session.removeAttribute("SUCCESS"); 47 | } %> 48 | 49 |
50 |
51 | 52 | 53 | <%@include file="pages/display/showAllProducts.jsp"%> 54 | 55 | 56 | <%@include file="pages/navfooter/footer.jsp"%> 57 | 58 | 59 | 60 | 61 | 62 | 74 | 75 | 76 | -------------------------------------------------------------------------------- /src/main/java/com/clothes/demo/models/vendor/Vendor.java: -------------------------------------------------------------------------------- 1 | package com.clothes.demo.models.vendor; 2 | 3 | import java.io.Serializable; 4 | import java.util.Date; 5 | import java.util.List; 6 | 7 | import javax.persistence.Column; 8 | import javax.persistence.Entity; 9 | import javax.persistence.FetchType; 10 | import javax.persistence.GeneratedValue; 11 | import javax.persistence.GenerationType; 12 | import javax.persistence.Id; 13 | import javax.persistence.OneToMany; 14 | import javax.persistence.OneToOne; 15 | 16 | import org.springframework.format.annotation.DateTimeFormat; 17 | 18 | import com.clothes.demo.models.products.Product; 19 | 20 | @SuppressWarnings("serial") 21 | @Entity 22 | public class Vendor implements Serializable { 23 | @Id 24 | @GeneratedValue(strategy = GenerationType.AUTO) 25 | private Long vendor_id; 26 | private String vendor_name; 27 | @Column(name = "vendor_contact_number", unique = true) 28 | private String vendor_contact_number; 29 | @Column(name = "vendor_email_id", unique = true) 30 | private String vendor_email_id; 31 | private String image; 32 | private String vendor_password; 33 | private String vendor_shop_name; 34 | @DateTimeFormat(pattern = "yyyy-MM-dd") 35 | private Date vendor_joiningdate; 36 | @OneToOne 37 | private BillingAddress billing_address; 38 | @OneToMany(mappedBy = "vendor",fetch = FetchType.EAGER) 39 | private List product; 40 | 41 | public Long getVendor_id() { 42 | return vendor_id; 43 | } 44 | 45 | public void setVendor_id(Long vendor_id) { 46 | this.vendor_id = vendor_id; 47 | } 48 | 49 | public String getVendor_name() { 50 | return vendor_name; 51 | } 52 | 53 | public void setVendor_name(String vendor_name) { 54 | this.vendor_name = vendor_name; 55 | } 56 | 57 | public String getVendor_contact_number() { 58 | return vendor_contact_number; 59 | } 60 | 61 | public void setVendor_contact_number(String vendor_contact_number) { 62 | this.vendor_contact_number = vendor_contact_number; 63 | } 64 | 65 | public String getVendor_email_id() { 66 | return vendor_email_id; 67 | } 68 | 69 | public void setVendor_email_id(String vendor_email_id) { 70 | this.vendor_email_id = vendor_email_id; 71 | } 72 | 73 | public String getImage() { 74 | return image; 75 | } 76 | 77 | public void setImage(String image) { 78 | this.image = image; 79 | } 80 | 81 | public String getVendor_password() { 82 | return vendor_password; 83 | } 84 | 85 | public void setVendor_password(String vendor_password) { 86 | this.vendor_password = vendor_password; 87 | } 88 | 89 | public String getVendor_shop_name() { 90 | return vendor_shop_name; 91 | } 92 | 93 | public void setVendor_shop_name(String vendor_shop_name) { 94 | this.vendor_shop_name = vendor_shop_name; 95 | } 96 | 97 | public Date getVendor_joiningdate() { 98 | return vendor_joiningdate; 99 | } 100 | 101 | public void setVendor_joiningdate(Date vendor_joiningdate) { 102 | this.vendor_joiningdate = vendor_joiningdate; 103 | } 104 | 105 | public BillingAddress getBilling_address() { 106 | return billing_address; 107 | } 108 | 109 | public void setBilling_address(BillingAddress billing_address) { 110 | this.billing_address = billing_address; 111 | } 112 | 113 | public List getProduct() { 114 | return product; 115 | } 116 | 117 | public void setProduct(List product) { 118 | this.product = product; 119 | } 120 | 121 | @Override 122 | public String toString() { 123 | return "Vendor [vendor_id=" + vendor_id + ", vendor_name=" + vendor_name + ", vendor_contact_number=" 124 | + vendor_contact_number + ", vendor_email_id=" + vendor_email_id + ", vendor_password=" 125 | + vendor_password + ", vendor_shop_name=" + vendor_shop_name + ", vendor_joiningdate=" 126 | + vendor_joiningdate + ", billing_address=" + billing_address + "]"; 127 | } 128 | 129 | } 130 | -------------------------------------------------------------------------------- /src/main/webapp/pages/display/showAllProducts.jsp: -------------------------------------------------------------------------------- 1 | <%@page import="com.clothes.demo.models.authenticate.Admin"%> 2 | <%@page import="com.clothes.demo.models.customer.CustomerDetails"%> 3 | <%@page import="com.clothes.demo.models.vendor.Vendor"%> 4 | <%@page import="com.clothes.demo.models.products.Product"%> 5 | <%@page import="java.util.List"%> 6 | <%@ page language="java" contentType="text/html; charset=ISO-8859-1" 7 | pageEncoding="ISO-8859-1"%> 8 | 9 | 10 | 11 | 12 | All Products 13 | 14 | 15 | 16 | <% 17 | List menproduct = (List) request.getAttribute("menproduct"); 18 | List womenproduct = (List) request.getAttribute("womenproduct"); 19 | List kidsproduct = (List) request.getAttribute("kidsproduct"); 20 | 21 | %> 22 | <% 23 | if (menproduct.isEmpty() && womenproduct.isEmpty() && kidsproduct.isEmpty()) { 24 | %> 25 |

Products Not Available

26 | <% 27 | } else { 28 | %> 29 | 116 | <% 117 | } 118 | %> 119 | 120 | -------------------------------------------------------------------------------- /src/main/webapp/pages/display/KidsProducts.jsp: -------------------------------------------------------------------------------- 1 | <%@page import="com.clothes.demo.models.products.Product"%> 2 | <%@page import="java.util.List"%> 3 | <%@ page language="java" contentType="text/html; charset=ISO-8859-1" 4 | pageEncoding="ISO-8859-1"%> 5 | 6 | 7 | 8 | 9 | Insert title here 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | <% 18 | response.setHeader("Cache-Control", "no-cache, no-store, must-revalidate"); // this is for HTTP version 1.1 not work for lesser version 19 | response.setHeader("Pragma", "no-cache"); // this is for HTTP version 1.0 20 | response.setHeader("Expires", "0"); // this is for proxies server 21 | %> 22 | 23 | 24 | <%@include file="../navfooter/navbar.jsp"%> 25 | 26 | 27 | <% 28 | String error_message = (String)session.getAttribute("ERROR"); 29 | String success_message = (String)session.getAttribute("SUCCESS"); 30 | %> 31 | <% if(null != error_message){%> 32 | 36 | <% 37 | session.removeAttribute("ERROR"); 38 | }else if(null != success_message){ 39 | %> 40 | 44 | <% 45 | session.removeAttribute("SUCCESS"); 46 | } %> 47 | 48 | 49 | <% 50 | List all_kids_products = (List) request.getAttribute("all_kids_products"); 51 | %> 52 | 53 | <% 54 | if (all_kids_products.isEmpty()) { 55 | %> 56 |
57 |
58 |
59 |

Products Not Available Yet!!

60 |
61 |
62 |
63 | <% 64 | } else { 65 | %> 66 | 99 | <% 100 | } 101 | %> 102 | 103 | 104 | <%@include file="../navfooter/footer.jsp"%> 105 | 106 | 107 | -------------------------------------------------------------------------------- /src/main/webapp/pages/display/MenProducts.jsp: -------------------------------------------------------------------------------- 1 | <%@page import="com.clothes.demo.models.products.Product"%> 2 | <%@page import="java.util.List"%> 3 | <%@ page language="java" contentType="text/html; charset=ISO-8859-1" 4 | pageEncoding="ISO-8859-1"%> 5 | 6 | 7 | 8 | 9 | Insert title here 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | <% 18 | response.setHeader("Cache-Control", "no-cache, no-store, must-revalidate"); // this is for HTTP version 1.1 not work for lesser version 19 | response.setHeader("Pragma", "no-cache"); // this is for HTTP version 1.0 20 | response.setHeader("Expires", "0"); // this is for proxies server 21 | %> 22 | 23 | 24 | <%@include file="../navfooter/navbar.jsp"%> 25 | 26 | 27 | 28 | <% 29 | String error_message = (String)session.getAttribute("ERROR"); 30 | String success_message = (String)session.getAttribute("SUCCESS"); 31 | %> 32 | <% if(null != error_message){%> 33 | 37 | <% 38 | session.removeAttribute("ERROR"); 39 | }else if(null != success_message){ 40 | %> 41 | 45 | <% 46 | session.removeAttribute("SUCCESS"); 47 | } %> 48 | 49 | 50 | <% 51 | List all_men_products = (List) request.getAttribute("all_men_products"); 52 | %> 53 | 54 | <% 55 | if (all_men_products.isEmpty()) { 56 | %> 57 |
58 |
59 |
60 |

Products Not Available Yet!!

61 |
62 |
63 |
64 | <% 65 | } else { 66 | %> 67 | 100 | <% 101 | } 102 | %> 103 | 104 | 105 | <%@include file="../navfooter/footer.jsp"%> 106 | 107 | 108 | -------------------------------------------------------------------------------- /src/main/webapp/pages/display/WomenProducts.jsp: -------------------------------------------------------------------------------- 1 | <%@page import="com.clothes.demo.models.products.Product"%> 2 | <%@page import="java.util.List"%> 3 | <%@ page language="java" contentType="text/html; charset=ISO-8859-1" 4 | pageEncoding="ISO-8859-1"%> 5 | 6 | 7 | 8 | 9 | Insert title here 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | <% 18 | response.setHeader("Cache-Control", "no-cache, no-store, must-revalidate"); // this is for HTTP version 1.1 not work for lesser version 19 | response.setHeader("Pragma", "no-cache"); // this is for HTTP version 1.0 20 | response.setHeader("Expires", "0"); // this is for proxies server 21 | %> 22 | 23 | 24 | <%@include file="../navfooter/navbar.jsp"%> 25 | 26 | 27 | 28 | <% 29 | String error_message = (String)session.getAttribute("ERROR"); 30 | String success_message = (String)session.getAttribute("SUCCESS"); 31 | %> 32 | <% if(null != error_message){%> 33 | 37 | <% 38 | session.removeAttribute("ERROR"); 39 | }else if(null != success_message){ 40 | %> 41 | 45 | <% 46 | session.removeAttribute("SUCCESS"); 47 | } %> 48 | 49 | <% 50 | List all_women_products = (List) request.getAttribute("all_women_products"); 51 | %> 52 | 53 | <% 54 | if (all_women_products.isEmpty()) { 55 | %> 56 |
57 |
58 |
59 |

Products Not Available Yet!!

60 |
61 |
62 |
63 | <% 64 | } else { 65 | %> 66 | 99 | <% 100 | } 101 | %> 102 | 103 | 104 | <%@include file="../navfooter/footer.jsp"%> 105 | 106 | 107 | -------------------------------------------------------------------------------- /src/main/java/com/clothes/demo/models/customer/CustomerDetails.java: -------------------------------------------------------------------------------- 1 | package com.clothes.demo.models.customer; 2 | 3 | import java.io.Serializable; 4 | import java.util.Date; 5 | import java.util.List; 6 | 7 | import javax.persistence.Column; 8 | import javax.persistence.Entity; 9 | import javax.persistence.FetchType; 10 | import javax.persistence.GeneratedValue; 11 | import javax.persistence.GenerationType; 12 | import javax.persistence.Id; 13 | import javax.persistence.OneToMany; 14 | 15 | import org.hibernate.annotations.ColumnDefault; 16 | import org.springframework.format.annotation.DateTimeFormat; 17 | 18 | import com.clothes.demo.models.orders.Order; 19 | 20 | @SuppressWarnings("serial") 21 | @Entity 22 | public class CustomerDetails implements Serializable { 23 | @Id 24 | @GeneratedValue(strategy = GenerationType.AUTO) 25 | private Long customer_id; 26 | private String customer_name; 27 | @Column(name="profile_image",columnDefinition = "varchar(500) default 'https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcSyDgkPQavzX7KwcLzeAsf0fgOx_-D51F3fag&usqp=CAU'") 28 | private String profile_image; 29 | @Column(name = "customer_contact_number", unique = true) 30 | private String customer_contact_number; 31 | @Column(name = "customer_email_id", unique = true) 32 | private String customer_email_id; 33 | private String customer_password; 34 | @DateTimeFormat(pattern = "yyyy-MM-dd") 35 | private Date customer_dob; 36 | @DateTimeFormat(pattern = "yyyy-MM-dd") 37 | private Date customer_joiningdate; 38 | @OneToMany(mappedBy = "customer", fetch = FetchType.EAGER) 39 | private List orders; 40 | // @OneToOne 41 | // private Address customer_shipping_add; 42 | 43 | public Long getCustomer_id() { 44 | return customer_id; 45 | } 46 | 47 | public void setCustomer_id(Long customer_id) { 48 | this.customer_id = customer_id; 49 | } 50 | 51 | public String getCustomer_name() { 52 | return customer_name; 53 | } 54 | 55 | public void setCustomer_name(String customer_name) { 56 | this.customer_name = customer_name; 57 | } 58 | 59 | public String getProfile_image() { 60 | return profile_image; 61 | } 62 | 63 | public void setProfile_image(String profile_image) { 64 | this.profile_image = profile_image; 65 | } 66 | 67 | public String getCustomer_contact_number() { 68 | return customer_contact_number; 69 | } 70 | 71 | public void setCustomer_contact_number(String customer_contact_number) { 72 | this.customer_contact_number = customer_contact_number; 73 | } 74 | 75 | public String getCustomer_email_id() { 76 | return customer_email_id; 77 | } 78 | 79 | public void setCustomer_email_id(String customer_email_id) { 80 | this.customer_email_id = customer_email_id; 81 | } 82 | 83 | public String getCustomer_password() { 84 | return customer_password; 85 | } 86 | 87 | public void setCustomer_password(String customer_password) { 88 | this.customer_password = customer_password; 89 | } 90 | 91 | public Date getCustomer_dob() { 92 | return customer_dob; 93 | } 94 | 95 | public void setCustomer_dob(Date customer_dob) { 96 | this.customer_dob = customer_dob; 97 | } 98 | 99 | public Date getCustomer_joiningdate() { 100 | return customer_joiningdate; 101 | } 102 | 103 | public void setCustomer_joiningdate(Date customer_joiningdate) { 104 | this.customer_joiningdate = customer_joiningdate; 105 | } 106 | 107 | public List getOrders() { 108 | return orders; 109 | } 110 | 111 | public void setOrders(List orders) { 112 | this.orders = orders; 113 | } 114 | 115 | @Override 116 | public String toString() { 117 | return "CustomerDetails [customer_id=" + customer_id + ", customer_name=" + customer_name 118 | + ", customer_contact_number=" + customer_contact_number + ", customer_email_id=" + customer_email_id 119 | + ", customer_password=" + customer_password + ", customer_dob=" + customer_dob 120 | + ", customer_joiningdate=" + customer_joiningdate + "]"; 121 | } 122 | 123 | // public Address getCustomer_shipping_add() { 124 | // return customer_shipping_add; 125 | // } 126 | // 127 | // public void setCustomer_shipping_add(Address customer_shipping_add) { 128 | // this.customer_shipping_add = customer_shipping_add; 129 | // } 130 | 131 | } 132 | -------------------------------------------------------------------------------- /src/main/webapp/pages/navfooter/navcss.css: -------------------------------------------------------------------------------- 1 | @charset "ISO-8859-1"; 2 | body { 3 | font-family: 'Varela Round', sans-serif; 4 | } 5 | .form-control { 6 | box-shadow: none; 7 | font-weight: normal; 8 | font-size: 13px; 9 | } 10 | .navbar { 11 | background: #fff; 12 | padding-left: 16px; 13 | padding-right: 16px; 14 | border-bottom: 1px solid #dfe3e8; 15 | border-radius: 0; 16 | } 17 | .nav-link img { 18 | border-radius: 50%; 19 | width: 36px; 20 | height: 36px; 21 | margin: -8px 0; 22 | float: left; 23 | margin-right: 10px; 24 | } 25 | .navbar .navbar-brand { 26 | padding-left: 0; 27 | font-size: 20px; 28 | padding-right: 50px; 29 | } 30 | .navbar .navbar-brand b { 31 | color: #33cabb; 32 | } 33 | .navbar .form-inline { 34 | display: inline-block; 35 | } 36 | .navbar a { 37 | color: #888; 38 | font-size: 15px; 39 | } 40 | .search-box { 41 | position: relative; 42 | } 43 | .search-box input { 44 | padding-right: 35px; 45 | border-color: #dfe3e8; 46 | border-radius: 4px !important; 47 | box-shadow: none 48 | } 49 | .search-box .input-group-text { 50 | min-width: 35px; 51 | border: none; 52 | background: transparent; 53 | position: absolute; 54 | right: 0; 55 | z-index: 9; 56 | padding: 7px; 57 | height: 100%; 58 | } 59 | .search-box i { 60 | color: #a0a5b1; 61 | font-size: 19px; 62 | } 63 | .navbar .sign-up-btn { 64 | min-width: 110px; 65 | max-height: 36px; 66 | } 67 | .navbar .dropdown-menu { 68 | color: #999; 69 | font-weight: normal; 70 | border-radius: 1px; 71 | border-color: #e5e5e5; 72 | box-shadow: 0 2px 8px rgba(0,0,0,.05); 73 | } 74 | .navbar a, .navbar a:active { 75 | color: #888; 76 | padding: 8px 20px; 77 | background: transparent; 78 | line-height: normal; 79 | } 80 | .navbar .navbar-form { 81 | border: none; 82 | } 83 | .navbar .action-form { 84 | width: 280px; 85 | padding: 20px; 86 | left: auto; 87 | right: 0; 88 | font-size: 14px; 89 | } 90 | .navbar .action-form a { 91 | color: #33cabb; 92 | padding: 0 !important; 93 | font-size: 14px; 94 | } 95 | .navbar .action-form .hint-text { 96 | text-align: center; 97 | margin-bottom: 15px; 98 | font-size: 13px; 99 | } 100 | .navbar .btn-primary, .navbar .btn-primary:active { 101 | color: #fff; 102 | background: #33cabb !important; 103 | border: none; 104 | } 105 | .navbar .btn-primary:hover, .navbar .btn-primary:focus { 106 | color: #fff; 107 | background: #31bfb1 !important; 108 | } 109 | .navbar .social-btn .btn, .navbar .social-btn .btn:hover { 110 | color: #fff; 111 | margin: 0; 112 | padding: 0 !important; 113 | font-size: 13px; 114 | border: none; 115 | transition: all 0.4s; 116 | text-align: center; 117 | line-height: 34px; 118 | width: 47%; 119 | text-decoration: none; 120 | } 121 | .navbar .social-btn .facebook-btn { 122 | background: #507cc0; 123 | } 124 | .navbar .social-btn .facebook-btn:hover { 125 | background: #4676bd; 126 | } 127 | .navbar .social-btn .twitter-btn { 128 | background: #64ccf1; 129 | } 130 | .navbar .social-btn .twitter-btn:hover { 131 | background: #4ec7ef; 132 | } 133 | .navbar .social-btn .btn i { 134 | margin-right: 5px; 135 | font-size: 16px; 136 | position: relative; 137 | top: 2px; 138 | } 139 | .or-seperator { 140 | margin-top: 32px; 141 | text-align: center; 142 | border-top: 1px solid #e0e0e0; 143 | } 144 | .or-seperator b { 145 | color: #666; 146 | padding: 0 8px; 147 | width: 30px; 148 | height: 30px; 149 | font-size: 13px; 150 | text-align: center; 151 | line-height: 26px; 152 | background: #fff; 153 | display: inline-block; 154 | border: 1px solid #e0e0e0; 155 | border-radius: 50%; 156 | position: relative; 157 | top: -15px; 158 | z-index: 1; 159 | } 160 | .navbar .action-buttons .dropdown-toggle::after { 161 | display: none; 162 | } 163 | .form-check-label input { 164 | position: relative; 165 | top: 1px; 166 | } 167 | @media (min-width: 1200px){ 168 | .form-inline .input-group { 169 | width: 300px; 170 | margin-left: 30px; 171 | } 172 | } 173 | @media (max-width: 768px){ 174 | .navbar .dropdown-menu.action-form { 175 | width: 100%; 176 | padding: 10px 15px; 177 | background: transparent; 178 | border: none; 179 | } 180 | .navbar .form-inline { 181 | display: block; 182 | } 183 | .navbar .input-group { 184 | width: 100%; 185 | } 186 | } -------------------------------------------------------------------------------- /src/main/webapp/pages/display/carddetails.jsp: -------------------------------------------------------------------------------- 1 | <%@ page language="java" contentType="text/html; charset=ISO-8859-1" 2 | pageEncoding="ISO-8859-1"%> 3 | 4 | 5 | 6 | 7 | Payment 8 | 9 | 14 | 18 | 19 | 20 | 22 | 28 | 29 | 30 | 31 | 32 | <% 33 | String error_message = (String) session.getAttribute("ERROR"); 34 | String success_message = (String) session.getAttribute("SUCCESS"); 35 | %> 36 | <% 37 | if (null != error_message) { 38 | %> 39 | 45 | <% 46 | session.removeAttribute("ERROR"); 47 | } else if (null != success_message) { 48 | %> 49 | 55 | <% 56 | session.removeAttribute("SUCCESS"); 57 | } 58 | %> 59 | 60 | 61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
70 |
71 | 76 |
77 | visa 79 |
80 | 81 |
83 |
84 | 88 |
89 |
90 | 91 |
93 |
94 | 98 |
99 |
100 | 104 |
105 | 108 |
109 |
110 |
111 |
112 |
113 |
114 |
115 |
116 | 117 | 118 | -------------------------------------------------------------------------------- /src/main/webapp/pages/display/sendotp.jsp: -------------------------------------------------------------------------------- 1 | <%@page import="com.clothes.demo.models.orders.Order"%> 2 | <%@page import="com.clothes.demo.models.customer.CustomerDetails"%> 3 | <%@ page language="java" contentType="text/html; charset=ISO-8859-1" 4 | pageEncoding="ISO-8859-1"%> 5 | 6 | 7 | 8 | 9 | OTP Verification 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | <% 23 | String error_message = (String)session.getAttribute("ERROR"); 24 | String success_message = (String)session.getAttribute("SUCCESS"); 25 | %> 26 | <% if(null != error_message){%> 27 | 31 | <% 32 | session.removeAttribute("ERROR"); 33 | }else if(null != success_message){ 34 | %> 35 | 39 | <% 40 | session.removeAttribute("SUCCESS"); 41 | } %> 42 | 43 |


44 | <% 45 | 46 | CustomerDetails customer = (CustomerDetails)session.getAttribute("customer"); 47 | Order currentorder = (Order)session.getAttribute("current_order"); 48 | %> 49 | <% if(null!=currentorder || null!=customer){ %> 50 |
51 |
52 |
53 |
54 |
55 |
Please enter the one time password
56 |
sent to <%= customer.getCustomer_email_id() %>
57 |
58 | 59 | 60 | 61 | 62 | 63 | 64 |
65 |
66 |
67 |
68 |
Didn't get the code 69 |
70 |
71 |
72 | 73 |
74 |
75 |
76 | <% }else{ %> 77 |

Something went wrong

78 | <% } %> 79 | 80 | -------------------------------------------------------------------------------- /src/main/webapp/pages/display/SoldProducts.jsp: -------------------------------------------------------------------------------- 1 | <%@page import="java.text.SimpleDateFormat"%> 2 | <%@page import="com.clothes.demo.models.products.Product"%> 3 | <%@page import="com.clothes.demo.models.orders.OrderItem"%> 4 | <%@page import="java.util.List"%> 5 | <%@ page language="java" contentType="text/html; charset=ISO-8859-1" 6 | pageEncoding="ISO-8859-1"%> 7 | 8 | 9 | 10 | 11 | Sold Products 12 | 13 | 14 | 15 | 16 | 43 | 44 | 45 | <% 46 | response.setHeader("Cache-Control", "no-cache, no-store, must-revalidate"); // this is for HTTP version 1.1 not work for lesser version 47 | response.setHeader("Pragma", "no-cache"); // this is for HTTP version 1.0 48 | response.setHeader("Expires", "0"); // this is for proxies server 49 | %> 50 | 51 | <%@include file="../navfooter/navbar.jsp"%> 52 | 53 | <% 54 | String error_message = (String)session.getAttribute("ERROR"); 55 | String success_message = (String)session.getAttribute("SUCCESS"); 56 | %> 57 | <% if(null != error_message){%> 58 | 62 | <% 63 | session.removeAttribute("ERROR"); 64 | }else if(null != success_message){ 65 | %> 66 | 70 | <% 71 | session.removeAttribute("SUCCESS"); 72 | } %> 73 | 74 |
75 | <% 76 | List soldproduct = (List) request.getAttribute("all_sold_products"); 77 | %> 78 | 79 | <% if(!soldproduct.isEmpty()){ %> 80 | 81 | <% int count = 0; 82 | Double total_earnings = 0.0; 83 | %> 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | <% for(Product p : soldproduct){ %> 97 | 98 | 99 | <% 100 | count ++; 101 | String image = p.getProduct_image(); 102 | String code = p.getProduct_code(); 103 | String name = p.getProduct_name(); 104 | String desc = p.getProduct_description(); 105 | Double price = p.getProduct_price(); 106 | Long quantity = p.getSold_quantity(); 107 | String category = p.getProduct_category(); 108 | SimpleDateFormat formatter = new SimpleDateFormat("MM/dd/yyyy"); 109 | String date = formatter.format(p.getProduct_added_date()); 110 | total_earnings += price*quantity; 111 | %> 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | <% } %> 124 |
No.PhotoCodeNameDescriptionPriceSold QuantityTotal EarningsAdded DateCategory
<%= count%><%= name %><%= code %><%= name %><%= desc %><%= price%> ₹<%= quantity %><%= price*quantity %> ₹<%= date %><%= category %>
125 |
126 |
127 |

Total Earnings :- <%= total_earnings %> ₹

128 |
129 | <% }else{ %> 130 |



131 |

Your Products have not sold!!😓

132 |



133 | <% } %> 134 |
135 |
136 |
137 | <%@include file="../navfooter/footer.jsp"%> 138 | 139 | -------------------------------------------------------------------------------- /src/main/webapp/pages/display/myorders.jsp: -------------------------------------------------------------------------------- 1 | <%@page import="java.util.ArrayList"%> 2 | <%@page import="java.sql.Time"%> 3 | <%@page import="java.text.SimpleDateFormat"%> 4 | <%@page import="com.clothes.demo.models.orders.Order"%> 5 | <%@page import="java.util.List"%> 6 | <%@ page language="java" contentType="text/html; charset=ISO-8859-1" 7 | pageEncoding="ISO-8859-1"%> 8 | 9 | 10 | 11 | 12 | Insert title here 13 | 14 | 15 | 16 | 17 | 18 | 19 | 44 | 45 | 46 | <% 47 | response.setHeader("Cache-Control", "no-cache, no-store, must-revalidate"); // this is for HTTP version 1.1 not work for lesser version 48 | response.setHeader("Pragma", "no-cache"); // this is for HTTP version 1.0 49 | response.setHeader("Expires", "0"); // this is for proxies server 50 | %> 51 | 52 | <%@include file="../navfooter/navbar.jsp"%> 53 | 54 | 55 | <% 56 | String error_message = (String)session.getAttribute("ERROR"); 57 | String success_message = (String)session.getAttribute("SUCCESS"); 58 | %> 59 | <% if(null != error_message){%> 60 | 64 | <% 65 | session.removeAttribute("ERROR"); 66 | }else if(null != success_message){ 67 | %> 68 | 72 | <% 73 | session.removeAttribute("SUCCESS"); 74 | } %> 75 | 76 | 77 | <% 78 | List myorders = (List) request.getAttribute("myorders"); 79 | Order current_cart = (Order)session.getAttribute("current_order"); 80 | 81 | List colors = new ArrayList(); 82 | colors.add("green"); 83 | colors.add("blue"); 84 | colors.add("black"); 85 | colors.add("Lavender"); 86 | colors.add("MediumSlateBlue"); 87 | int colorssize = colors.size(); 88 | %> 89 | 90 | <% 91 | if (myorders.isEmpty() || (1==myorders.size()&¤t_cart!=null&¤t_cart.getId().equals(myorders.get(0).getId()))) { 92 | %> 93 | Empty Cart 94 | <% 95 | } else { 96 | int count = 0; 97 | %> 98 |
99 |
100 |

My Orders

101 |
102 |
103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | <% 114 | for (Order o : myorders) { 115 | if(null != current_cart && o.getId().equals(current_cart.getId())){ 116 | /* out.println("equal"); */ 117 | continue; 118 | } 119 | %> 120 | <% 121 | SimpleDateFormat formatter = new SimpleDateFormat("MM/dd/yyyy"); 122 | count++; 123 | String oid = "O" + o.getId(); 124 | String date = formatter.format(o.getOrder_date()); 125 | Time time = o.getOrder_time(); 126 | Long order_id = o.getId(); 127 | %> 128 | 129 | 130 | 131 | 132 | 133 | 139 | 140 | <% 141 | } 142 | %> 143 |
No.Order IDDateTimeView Items
<%=count%><%=oid%><%=date%><%=time%> 134 |
135 | 136 | 137 |
138 |
144 | 145 | <% 146 | } 147 | %> 148 |


149 | <%@include file="../navfooter/footer.jsp"%> 150 | 151 | -------------------------------------------------------------------------------- /src/main/java/com/clothes/demo/controller/AuthenticationController.java: -------------------------------------------------------------------------------- 1 | package com.clothes.demo.controller; 2 | 3 | import java.util.List; 4 | 5 | import javax.servlet.http.HttpServletRequest; 6 | import javax.servlet.http.HttpSession; 7 | 8 | import org.springframework.beans.factory.annotation.Autowired; 9 | import org.springframework.boot.SpringApplication; 10 | import org.springframework.boot.autoconfigure.SpringBootApplication; 11 | import org.springframework.context.ApplicationContext; 12 | import org.springframework.stereotype.Controller; 13 | import org.springframework.web.bind.annotation.RequestMapping; 14 | import org.springframework.web.bind.annotation.RequestMethod; 15 | import org.springframework.web.bind.annotation.RequestParam; 16 | import org.springframework.web.servlet.mvc.support.RedirectAttributes; 17 | 18 | import com.clothes.demo.ClothingsApplication; 19 | import com.clothes.demo.bean.Mail; 20 | import com.clothes.demo.dao.AdminDao; 21 | import com.clothes.demo.dao.CustomerDao; 22 | import com.clothes.demo.dao.OrderDao; 23 | import com.clothes.demo.dao.OrderItemDao; 24 | import com.clothes.demo.dao.ProductDao; 25 | import com.clothes.demo.dao.VendorDao; 26 | import com.clothes.demo.models.authenticate.Admin; 27 | import com.clothes.demo.models.customer.CustomerDetails; 28 | import com.clothes.demo.models.orders.Order; 29 | import com.clothes.demo.models.orders.OrderItem; 30 | import com.clothes.demo.models.vendor.Vendor; 31 | import com.clothes.demo.services.MailService; 32 | 33 | @Controller 34 | public class AuthenticationController { 35 | @Autowired 36 | CustomerDao cdao; 37 | @Autowired 38 | AdminDao addao; 39 | @Autowired 40 | VendorDao vendao; 41 | @Autowired 42 | OrderDao odao; 43 | @Autowired 44 | OrderItemDao oitemdao; 45 | @Autowired 46 | ProductDao prodao; 47 | @Autowired 48 | MailService mailservice; 49 | 50 | @RequestMapping(path = "/fashion-factory/doLogin", method = RequestMethod.POST) 51 | public String doLogin(@RequestParam("email") String email, @RequestParam("password") String password, 52 | HttpServletRequest request, RedirectAttributes redirAttrs) { 53 | List cd = cdao.findBycustomer_email_idAndcustomer_password(email, password); 54 | List ad = addao.findByadmin_email_idAndadmin_password(email, password); 55 | List vd = vendao.findByvendor_email_idAndvendor_password(email, password); 56 | 57 | HttpSession session = request.getSession(); 58 | session.setAttribute("customer", null); 59 | session.setAttribute("admin", null); 60 | session.setAttribute("vendor", null); 61 | session.setAttribute("ERROR", null); 62 | session.setAttribute("SUCCESS", null); 63 | 64 | if (!cd.isEmpty()) { 65 | System.out.println("Customer Logged In!!"); 66 | System.out.println(cd.get(0)); 67 | session.setAttribute("customer", cd.get(0)); 68 | session.setAttribute("SUCCESS", "Login Successfull!!"); 69 | // Mail mail = new Mail(); 70 | // mail.setMailFrom("d.poriya05@gmail.com"); 71 | // mail.setMailTo(email); 72 | // mail.setMailSubject("Login Attempt"); 73 | // mail.setMailContent("Login Successfull!!"); 74 | // mailservice.sendEmail(mail); 75 | } else if (!ad.isEmpty()) { 76 | System.out.println("Admin Logged In!!"); 77 | System.out.println(ad.get(0)); 78 | session.setAttribute("admin", ad.get(0)); 79 | session.setAttribute("SUCCESS", "Admin Login Successfull"); 80 | } else if (!vd.isEmpty()) { 81 | System.out.println("Vendor Logged In!!"); 82 | System.out.println(); 83 | session.setAttribute("vendor", vd.get(0)); 84 | session.setAttribute("SUCCESS", "Login Successfull"); 85 | } else { 86 | System.out.println("Invalid Credentials"); 87 | session.setAttribute("ERROR", "Invalid Credentials"); 88 | return "redirect:/fashion-factory"; 89 | } 90 | String referer = request.getHeader("Referer"); 91 | return "redirect:" + referer; 92 | } 93 | 94 | // Logout 95 | @RequestMapping(path = "fashion-factory/doLogout", method = RequestMethod.GET) 96 | public String doLogout(HttpServletRequest request, RedirectAttributes redirAttrs) { 97 | HttpSession session = request.getSession(); 98 | session.setAttribute("customer", null); 99 | session.setAttribute("admin", null); 100 | session.setAttribute("vendor", null); 101 | session.removeAttribute("customer"); 102 | session.removeAttribute("admin"); 103 | session.removeAttribute("vendor"); 104 | 105 | // Clearing Current Carts 106 | Order current_order = (Order) session.getAttribute("current_order"); 107 | if (null != current_order) { 108 | List currentcartitems = oitemdao.findAllByOrder_id(current_order); 109 | for (OrderItem oi : currentcartitems) { 110 | Long soldq = oi.getProduct().getSold_quantity() - oi.getQuentity(); 111 | prodao.setSold_QuantityById(soldq, current_order.getId()); 112 | oitemdao.deleteById(oi.getId()); 113 | } 114 | odao.deleteById(current_order.getId()); 115 | } 116 | session.removeAttribute("current_order"); 117 | session.invalidate(); 118 | System.out.println("Logout!!"); 119 | return "redirect:/fashion-factory"; 120 | } 121 | 122 | } 123 | -------------------------------------------------------------------------------- /src/main/java/com/clothes/demo/controller/OrderController.java: -------------------------------------------------------------------------------- 1 | package com.clothes.demo.controller; 2 | 3 | import java.util.List; 4 | import java.util.Random; 5 | 6 | import javax.servlet.http.HttpServletRequest; 7 | import javax.servlet.http.HttpSession; 8 | 9 | import org.springframework.beans.factory.annotation.Autowired; 10 | import org.springframework.stereotype.Controller; 11 | import org.springframework.web.bind.annotation.GetMapping; 12 | import org.springframework.web.bind.annotation.PostMapping; 13 | import org.springframework.web.bind.annotation.RequestMapping; 14 | import org.springframework.web.bind.annotation.RequestMethod; 15 | import org.springframework.web.bind.annotation.RequestParam; 16 | import org.springframework.web.servlet.ModelAndView; 17 | import org.springframework.web.servlet.mvc.support.RedirectAttributes; 18 | 19 | import com.clothes.demo.bean.Mail; 20 | import com.clothes.demo.dao.OrderDao; 21 | import com.clothes.demo.models.customer.CustomerDetails; 22 | import com.clothes.demo.models.orders.Order; 23 | import com.clothes.demo.services.MailService; 24 | 25 | @Controller 26 | public class OrderController { 27 | @Autowired 28 | private OrderDao odao; 29 | @Autowired 30 | private MailService mailservice; 31 | 32 | // my Orders 33 | @RequestMapping(path = "/myOrders") 34 | public ModelAndView myOrders(HttpServletRequest request,RedirectAttributes redirAttrs){ 35 | HttpSession session = request.getSession(); 36 | CustomerDetails customer = (CustomerDetails) session.getAttribute("customer"); 37 | 38 | if(null==customer) { 39 | session.setAttribute("ERROR", "You should first need to Login or SignUp as Customer!!"); 40 | ModelAndView tempmodel = new ModelAndView("redirect:/fashion-factory"); 41 | return tempmodel; 42 | } 43 | ModelAndView mv = new ModelAndView("pages/display/myorders.jsp"); 44 | List myorders = odao.findByCustomerSorted(customer); 45 | mv.addObject("myorders", myorders); 46 | return mv; 47 | } 48 | 49 | // Checkout 50 | @RequestMapping(path = "/checkout", method = RequestMethod.GET) 51 | public String checkOut(HttpServletRequest request,RedirectAttributes redirAttrs){ 52 | HttpSession session = request.getSession(); 53 | CustomerDetails customer = (CustomerDetails) session.getAttribute("customer"); 54 | 55 | if(null==customer) { 56 | session.setAttribute("ERROR", "You should first need to Login or SignUp as Customer!!"); 57 | 58 | return "redirect:/fashion-factory"; 59 | } 60 | return "pages/display/carddetails.jsp"; 61 | } 62 | 63 | // Send OTP 64 | @GetMapping(path = "/sendOtp") 65 | public String sendOtp(HttpServletRequest request) { 66 | HttpSession session = request.getSession(); 67 | session.setAttribute("ERROR", "You should first need to Login or SignUp as Customer!!"); 68 | 69 | return "redirect:/fashion-factory"; 70 | } 71 | @PostMapping(path = "/sendOtp") 72 | public String sendOtp(HttpServletRequest request,RedirectAttributes redirAttrs){ 73 | HttpSession session = request.getSession(); 74 | CustomerDetails customer = (CustomerDetails) session.getAttribute("customer"); 75 | 76 | Random rnd = new Random(); 77 | int number = rnd.nextInt(999999); 78 | // this will convert any number sequence into 6 character. 79 | String otp = String.format("%06d", number); 80 | 81 | Mail mail = new Mail(); 82 | mail.setMailFrom("fashion-factory@gmail.com"); 83 | mail.setMailTo(customer.getCustomer_email_id()); 84 | mail.setMailSubject("Payment Confirmation OTP"); 85 | mail.setMailContent("OTP :- "+otp+"\n\n valid up to 2 minutes only!!"); 86 | mailservice.sendEmail(mail); 87 | session.setAttribute("myotp", otp); 88 | session.setAttribute("SUCCESS", "OTP has been sent Successfully!!"); 89 | // String referer = request.getHeader("Referer"); 90 | return "pages/display/sendotp.jsp"; 91 | } 92 | 93 | // otp verification 94 | // @GetMapping(path = "/otpVerfication") 95 | // public String otpVerfication(HttpServletRequest request) { 96 | // HttpSession session = request.getSession(); 97 | // session.setAttribute("ERROR", "You should first need to Login or SignUp as Customer!!"); 98 | // 99 | // return "redirect:/fashion-factory"; 100 | // } 101 | @RequestMapping(path = "/otpVerfication") 102 | public String otpVerfication(HttpServletRequest request,RedirectAttributes redirAttrs){ 103 | HttpSession session = request.getSession(); 104 | 105 | int d1 = Integer.parseInt(request.getParameter("digit1")); 106 | int d2 = Integer.parseInt(request.getParameter("digit2")); 107 | int d3 = Integer.parseInt(request.getParameter("digit3")); 108 | int d4 = Integer.parseInt(request.getParameter("digit4")); 109 | int d5 = Integer.parseInt(request.getParameter("digit5")); 110 | int d6 = Integer.parseInt(request.getParameter("digit6")); 111 | String temp = ""+d1+d2+d3+d4+d5+d6; 112 | int received_otp = Integer.parseInt(temp); 113 | String tempotp = session.getAttribute("myotp").toString(); 114 | int sent_otp = Integer.parseInt(tempotp); 115 | 116 | if(sent_otp == received_otp) { 117 | session.removeAttribute("current_order"); 118 | session.removeAttribute("myotp"); 119 | System.out.println("Order Placed!!"); 120 | session.setAttribute("SUCCESS", "Your Items has been ordered Successfully!!"); 121 | return "redirect:myOrders"; 122 | }else { 123 | session.setAttribute("ERROR", "Entered OTP is Incorrect"); 124 | } 125 | String referer = request.getHeader("Referer"); 126 | return "redirect:" + referer; 127 | } 128 | } 129 | -------------------------------------------------------------------------------- /src/main/webapp/pages/display/AllSellers.jsp: -------------------------------------------------------------------------------- 1 | <%@page import="com.clothes.demo.models.vendor.BillingAddress"%> 2 | <%@page import="java.text.SimpleDateFormat"%> 3 | <%@page import="java.util.List"%> 4 | <%@ page language="java" contentType="text/html; charset=ISO-8859-1" 5 | pageEncoding="ISO-8859-1"%> 6 | 7 | 8 | 9 | 10 | Insert title here 11 | 12 | 13 | 14 | 15 | 117 | 118 | 119 | 120 | <% 121 | response.setHeader("Cache-Control", "no-cache, no-store, must-revalidate"); // this is for HTTP version 1.1 not work for lesser version 122 | response.setHeader("Pragma", "no-cache"); // this is for HTTP version 1.0 123 | response.setHeader("Expires", "0"); // this is for proxies server 124 | %> 125 | 126 | 127 | <%@include file="../navfooter/navbar.jsp"%> 128 | 129 | 130 | <% 131 | String error_message = (String)session.getAttribute("ERROR"); 132 | String success_message = (String)session.getAttribute("SUCCESS"); 133 | %> 134 | <% if(null != error_message){%> 135 | 139 | <% 140 | session.removeAttribute("ERROR"); 141 | }else if(null != success_message){ 142 | %> 143 | 147 | <% 148 | session.removeAttribute("SUCCESS"); 149 | } %> 150 | 151 | 152 | <% 153 | List all_vendors = (List)request.getAttribute("all_vendors"); 154 | %> 155 | <% if(all_vendors.isEmpty()){ %> 156 |

Vendors Not Registred!!

157 | <% }else{ %> 158 |
159 | <% 160 | for (Vendor v : all_vendors) { 161 | SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd"); 162 | String shopname = v.getVendor_shop_name(); 163 | String shopimage = v.getImage(); 164 | String vname = v.getVendor_name(); 165 | String emailid = v.getVendor_email_id(); 166 | String contact = v.getVendor_contact_number(); 167 | String joiningdate = formatter.format(v.getVendor_joiningdate()); 168 | 169 | BillingAddress baddress = v.getBilling_address(); 170 | Long bid = baddress.getAid(); 171 | String hno = baddress.getHouse_no(); 172 | String street = baddress.getStreet(); 173 | String city = baddress.getCity(); 174 | String district = baddress.getDistrict(); 175 | String state = baddress.getState(); 176 | String pincode = baddress.getPincode(); 177 | String billingaddress = hno + ", " + street + ", " + city + ", " + district + ", " + state + ", " + pincode + "."; 178 | %> 179 |
180 | <%=shopname%> 181 |
182 |

<%=shopname%>

183 |
184 |

<%=vname%>

185 |

<%=emailid%>

186 |

<%=contact%>

187 |

Joining Date :- <%=joiningdate %>

188 |
189 |

Billing Address :- <%=billingaddress %>

190 | 191 |
192 | <% } %> 193 |
194 | <% } %> 195 | 196 | -------------------------------------------------------------------------------- /src/main/java/com/clothes/demo/controller/VendorController.java: -------------------------------------------------------------------------------- 1 | package com.clothes.demo.controller; 2 | 3 | import java.util.Date; 4 | import java.util.List; 5 | 6 | import javax.servlet.http.HttpServletRequest; 7 | import javax.servlet.http.HttpSession; 8 | 9 | import org.springframework.beans.factory.annotation.Autowired; 10 | import org.springframework.stereotype.Controller; 11 | import org.springframework.web.bind.annotation.RequestMapping; 12 | import org.springframework.web.bind.annotation.RequestMethod; 13 | import org.springframework.web.bind.annotation.RequestParam; 14 | import org.springframework.web.servlet.ModelAndView; 15 | import org.springframework.web.servlet.mvc.support.RedirectAttributes; 16 | 17 | import com.clothes.demo.dao.BillingAddressDao; 18 | import com.clothes.demo.dao.VendorDao; 19 | import com.clothes.demo.models.customer.CustomerDetails; 20 | import com.clothes.demo.models.vendor.BillingAddress; 21 | import com.clothes.demo.models.vendor.Vendor; 22 | 23 | @Controller 24 | public class VendorController { 25 | @Autowired 26 | VendorDao vendao; 27 | @Autowired 28 | BillingAddressDao billdao; 29 | 30 | // add Vendor 31 | @RequestMapping(path = "/fashion-factory/addVendor", method = RequestMethod.POST) 32 | public String addCustomer(Vendor vd, BillingAddress billadd, HttpServletRequest request, 33 | RedirectAttributes redirAttrs) { 34 | HttpSession session = request.getSession(); 35 | if (vd != null && billadd != null) { 36 | List emailidexist = vendao.findByvendor_email_id(vd.getVendor_email_id()); 37 | List contactexist = vendao.findByvendor_contact_number(vd.getVendor_contact_number()); 38 | if (!emailidexist.isEmpty()) { 39 | session.setAttribute("ERROR", "Entered Email ID is alredy used"); 40 | } else if (!contactexist.isEmpty()) { 41 | session.setAttribute("ERROR", "Entered Contact Number is alredy used"); 42 | } else { 43 | vd.setBilling_address(billadd); 44 | billdao.save(billadd); 45 | vendao.save(vd); 46 | session.setAttribute("SUCCESS", "Registration Completed!! Try to Login!!"); 47 | } 48 | // System.out.println(billadd); 49 | // System.out.println(vd); 50 | // System.out.println("Vendor Registred!!"); 51 | } else { 52 | session.setAttribute("ERROR", "Something Went Wrong!!"); 53 | } 54 | return "redirect:/fashion-factory"; 55 | } 56 | 57 | // Profile 58 | @RequestMapping(path = "/myVendorProfile", method = RequestMethod.GET) 59 | public String mProfile(HttpServletRequest request, RedirectAttributes redirAttrs) { 60 | return "pages/display/vendorProfile.jsp"; 61 | } 62 | 63 | // Edit Profile 64 | @RequestMapping(path = "/fashion-factory/editVendorProfile", method = RequestMethod.POST) 65 | public String editVendorProfile(Vendor v, @RequestParam("vendor_id") Long vid, HttpServletRequest request, 66 | RedirectAttributes redirAttrs) { 67 | HttpSession session = request.getSession(); 68 | if (null != v) { 69 | 70 | Vendor old_vendor_details = (Vendor) session.getAttribute("vendor"); 71 | if (!old_vendor_details.getVendor_email_id().equals(v.getVendor_email_id())) { 72 | List emailidexist = vendao.findByvendor_email_id(v.getVendor_email_id()); 73 | if (1 == emailidexist.size()) { 74 | if (emailidexist.get(0).getVendor_email_id().equals(v.getVendor_email_id())) { 75 | session.setAttribute("ERROR", "Entered Email ID is alredy used"); 76 | System.out.println("Email Exist!!"); 77 | String referer = request.getHeader("Referer"); 78 | return "redirect:" + referer; 79 | } 80 | } 81 | } else if (!old_vendor_details.getVendor_contact_number().equals(v.getVendor_contact_number())) { 82 | List contactexists = vendao.findByvendor_contact_number(v.getVendor_contact_number()); 83 | if (1 == contactexists.size()) { 84 | if (contactexists.get(0).getVendor_contact_number().equals(v.getVendor_contact_number())) { 85 | session.setAttribute("ERROR", "Entered Contact Number is alredy used"); 86 | System.out.println("Email Exist!!"); 87 | String referer = request.getHeader("Referer"); 88 | return "redirect:" + referer; 89 | } 90 | } 91 | } 92 | String vname = v.getVendor_name(); 93 | String shopname = v.getVendor_shop_name(); 94 | String simage = v.getImage(); 95 | String email = v.getVendor_email_id(); 96 | String contact = v.getVendor_contact_number(); 97 | 98 | vendao.setVendorById(simage, contact, email, vname, shopname, vid); 99 | Vendor vendor = vendao.findById(vid).orElse(v); 100 | session.setAttribute("vendor", vendor); 101 | session.setAttribute("SUCCESS", "Profile Updated Successfull"); 102 | System.out.println("Vendor updated successfully!!"); 103 | 104 | } else { 105 | session.setAttribute("ERROR", "Something Went Wrong!! Try Again!!"); 106 | return "redirect:fashion-factory"; 107 | } 108 | 109 | String referer = request.getHeader("Referer"); 110 | return "redirect:" + referer; 111 | } 112 | 113 | // Edit Billing Address 114 | @RequestMapping(path = "/fashion-factory/editBillingAddress", method = RequestMethod.POST) 115 | public String editBillingAddress(BillingAddress baddress, @RequestParam("aid") Long aid, 116 | @RequestParam("vendor_id") Long vid, HttpServletRequest request, RedirectAttributes redirAttrs) { 117 | if (null != baddress) { 118 | String hno = baddress.getHouse_no(); 119 | String street = baddress.getStreet(); 120 | String city = baddress.getCity(); 121 | String district = baddress.getDistrict(); 122 | String state = baddress.getState(); 123 | String pincord = baddress.getPincode(); 124 | 125 | billdao.setBillingAdressById(hno, street, city, district, state, pincord, aid); 126 | Vendor vendor = vendao.findById(vid).orElse(null); 127 | HttpSession session = request.getSession(); 128 | session.setAttribute("vendor", vendor); 129 | session.setAttribute("SUCCESS", "Billing Address Updated Successfull"); 130 | System.out.println("Billing Address Updated successfully!!"); 131 | } 132 | 133 | String referer = request.getHeader("Referer"); 134 | return "redirect:" + referer; 135 | } 136 | 137 | // All vendors 138 | @RequestMapping(path = "/allSellers", method = RequestMethod.GET) 139 | public ModelAndView viewAllSellers(HttpServletRequest request, RedirectAttributes redirAttrs) { 140 | 141 | List all_vendors = vendao.findAll(); 142 | ModelAndView mv = new ModelAndView("pages/display/AllSellers.jsp"); 143 | mv.addObject("all_vendors", all_vendors); 144 | return mv; 145 | } 146 | } 147 | -------------------------------------------------------------------------------- /src/main/java/com/clothes/demo/controller/CustomerController.java: -------------------------------------------------------------------------------- 1 | package com.clothes.demo.controller; 2 | 3 | import java.net.http.HttpRequest; 4 | import java.util.Date; 5 | import java.util.List; 6 | 7 | import javax.servlet.http.HttpServletRequest; 8 | import javax.servlet.http.HttpSession; 9 | 10 | import org.springframework.beans.factory.annotation.Autowired; 11 | import org.springframework.stereotype.Controller; 12 | import org.springframework.web.bind.annotation.GetMapping; 13 | import org.springframework.web.bind.annotation.PostMapping; 14 | import org.springframework.web.bind.annotation.RequestMapping; 15 | import org.springframework.web.bind.annotation.RequestMethod; 16 | import org.springframework.web.bind.annotation.RequestParam; 17 | import org.springframework.web.bind.annotation.ResponseBody; 18 | import org.springframework.web.servlet.mvc.support.RedirectAttributes; 19 | 20 | import com.clothes.demo.dao.AddressDao; 21 | import com.clothes.demo.dao.CustomerDao; 22 | import com.clothes.demo.dao.OrderDao; 23 | import com.clothes.demo.dao.OrderItemDao; 24 | import com.clothes.demo.models.customer.Address; 25 | import com.clothes.demo.models.customer.CustomerDetails; 26 | import com.clothes.demo.models.orders.Order; 27 | import com.clothes.demo.models.vendor.Vendor; 28 | 29 | @Controller 30 | public class CustomerController { 31 | @Autowired 32 | CustomerDao cdao; 33 | @Autowired 34 | OrderDao odao; 35 | @Autowired 36 | OrderItemDao oitemdao; 37 | @Autowired 38 | AddressDao adddao; 39 | 40 | // add customer 41 | @GetMapping(path = "/fashion-factory/addCustomer") 42 | public String addCustomer(HttpServletRequest request) { 43 | HttpSession session = request.getSession(); 44 | session.setAttribute("ERROR", "You should first need to Login or SignUp as Customer!!"); 45 | 46 | return "redirect:/fashion-factory"; 47 | } 48 | 49 | @PostMapping(path = "/fashion-factory/addCustomer") 50 | public String addCustomer(CustomerDetails cd, HttpServletRequest request, RedirectAttributes redirAttrs) { 51 | HttpSession session = request.getSession(); 52 | session.setAttribute("ERROR", null); 53 | session.setAttribute("SUCCESS", null); 54 | if (cd != null) { 55 | List emailidexist = cdao.findBycustomer_email_id(cd.getCustomer_email_id()); 56 | List contactexist = cdao.findBycustomer_contact_number(cd.getCustomer_contact_number()); 57 | if (!emailidexist.isEmpty()) { 58 | session.setAttribute("ERROR", "Entered Email ID is alredy used"); 59 | } else if (!contactexist.isEmpty()) { 60 | session.setAttribute("ERROR", "Entered Contact Number is alredy used"); 61 | } else { 62 | cdao.save(cd); 63 | // System.out.println(cd); 64 | session.setAttribute("SUCCESS", "Registration Completed!! Try to Login!!"); 65 | } 66 | } else { 67 | session.setAttribute("ERROR", "Something Went Wrong!!"); 68 | } 69 | return "redirect:/fashion-factory"; 70 | } 71 | 72 | // Profile 73 | @RequestMapping(path = "/myProfile", method = RequestMethod.GET) 74 | public String mProfile(HttpServletRequest request, RedirectAttributes redirAttrs) { 75 | HttpSession session = request.getSession(); 76 | CustomerDetails customer = (CustomerDetails) session.getAttribute("customer"); 77 | 78 | if (null == customer) { 79 | session.setAttribute("ERROR", "You should first need to Login or SignUp!!"); 80 | return "redirect:/fashion-factory"; 81 | } 82 | return "pages/display/customerProfile.jsp"; 83 | } 84 | 85 | // Edit Profile 86 | @RequestMapping(path = "/fashion-factory/editProfile", method = RequestMethod.POST) 87 | public String editProfile(CustomerDetails cd, @RequestParam("customer_id") Long cid, HttpServletRequest request, 88 | RedirectAttributes redirAttrs) { 89 | if (null != cd) { 90 | HttpSession session = request.getSession(); 91 | CustomerDetails current_cust_details = (CustomerDetails) session.getAttribute("customer"); 92 | String cname = cd.getCustomer_name(); 93 | String image = cd.getProfile_image(); 94 | String emailid = cd.getCustomer_email_id(); 95 | String contact = cd.getCustomer_contact_number(); 96 | Date dob = cd.getCustomer_dob(); 97 | 98 | if (!current_cust_details.getCustomer_email_id().equals(cd.getCustomer_email_id())) { 99 | List emailidexist = cdao.findBycustomer_email_id(cd.getCustomer_email_id()); 100 | if (1 == emailidexist.size()) { 101 | if (emailidexist.get(0).getCustomer_email_id().equals(cd.getCustomer_email_id())) { 102 | session.setAttribute("ERROR", "Entered Email ID is alredy used"); 103 | System.out.println("Email Exist!!"); 104 | String referer = request.getHeader("Referer"); 105 | return "redirect:" + referer; 106 | } 107 | } 108 | } else if (!current_cust_details.getCustomer_contact_number().equals(cd.getCustomer_contact_number())) { 109 | List contactexist = cdao.findBycustomer_contact_number(cd.getCustomer_contact_number()); 110 | if (1 == contactexist.size()) { 111 | if (contactexist.get(0).getCustomer_contact_number().equals(cd.getCustomer_contact_number())) { 112 | session.setAttribute("ERROR", "Entered Contact Number is alredy used"); 113 | System.out.println("Email Exist!!"); 114 | String referer = request.getHeader("Referer"); 115 | return "redirect:" + referer; 116 | } 117 | } 118 | } 119 | 120 | cdao.setCustomerDetailsById(cname, image, emailid, contact, dob, cid); 121 | CustomerDetails customer = cdao.findById(cid).orElse(null); 122 | session.setAttribute("customer", customer); 123 | session.setAttribute("SUCCESS", "Profile Updated Successfully!!"); 124 | System.out.println("Customer details updated successfully!!"); 125 | 126 | } 127 | 128 | String referer = request.getHeader("Referer"); 129 | return "redirect:" + referer; 130 | } 131 | 132 | // Delete Customer Account 133 | @RequestMapping(path = "/fashion-factory/deleteProfile", method = RequestMethod.POST) 134 | public String deleteProfile(@RequestParam("customer_email_id") String email, 135 | @RequestParam("password") String password, @RequestParam("customer_id") Long cid, 136 | HttpServletRequest request, RedirectAttributes redirAttrs) { 137 | 138 | HttpSession session = request.getSession(); 139 | List cd = cdao.findBycustomer_email_idAndcustomer_password(email, password); 140 | 141 | if (!cd.isEmpty()) { 142 | List myorders = odao.findByCustomerSorted(cd.get(0)); 143 | if (!myorders.isEmpty()) { 144 | for (Order o : myorders) { 145 | oitemdao.deleteAllByOrder(o); 146 | // orderitems deleted 147 | odao.deleteById(o.getId()); 148 | // order deleted 149 | } 150 | } 151 | // deleting address 152 | Address add = adddao.findBycd(cd.get(0)); 153 | if (null != add) { 154 | adddao.deleteByCd(cd.get(0)); 155 | System.out.println("Address Deleted"); 156 | } 157 | cdao.deleteById(cid); 158 | 159 | session.removeAttribute("customer"); 160 | session.removeAttribute("admin"); 161 | session.removeAttribute("vendor"); 162 | session.removeAttribute("current_order"); 163 | session.invalidate(); 164 | session.setAttribute("SUCCESS", "Your Account have been Deleted Successfully!!"); 165 | return "redirect:/fashion-factory"; 166 | } else { 167 | session.setAttribute("ERROR", "Something Went Wrong!! Try Again!!"); 168 | System.out.println("Not Deleted Customer"); 169 | } 170 | 171 | String referer = request.getHeader("Referer"); 172 | return "redirect:" + referer; 173 | } 174 | } 175 | -------------------------------------------------------------------------------- /mvnw.cmd: -------------------------------------------------------------------------------- 1 | @REM ---------------------------------------------------------------------------- 2 | @REM Licensed to the Apache Software Foundation (ASF) under one 3 | @REM or more contributor license agreements. See the NOTICE file 4 | @REM distributed with this work for additional information 5 | @REM regarding copyright ownership. The ASF licenses this file 6 | @REM to you under the Apache License, Version 2.0 (the 7 | @REM "License"); you may not use this file except in compliance 8 | @REM with the License. You may obtain a copy of the License at 9 | @REM 10 | @REM https://www.apache.org/licenses/LICENSE-2.0 11 | @REM 12 | @REM Unless required by applicable law or agreed to in writing, 13 | @REM software distributed under the License is distributed on an 14 | @REM "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | @REM KIND, either express or implied. See the License for the 16 | @REM specific language governing permissions and limitations 17 | @REM under the License. 18 | @REM ---------------------------------------------------------------------------- 19 | 20 | @REM ---------------------------------------------------------------------------- 21 | @REM Maven Start Up Batch script 22 | @REM 23 | @REM Required ENV vars: 24 | @REM JAVA_HOME - location of a JDK home dir 25 | @REM 26 | @REM Optional ENV vars 27 | @REM M2_HOME - location of maven2's installed home dir 28 | @REM MAVEN_BATCH_ECHO - set to 'on' to enable the echoing of the batch commands 29 | @REM MAVEN_BATCH_PAUSE - set to 'on' to wait for a keystroke before ending 30 | @REM MAVEN_OPTS - parameters passed to the Java VM when running Maven 31 | @REM e.g. to debug Maven itself, use 32 | @REM set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000 33 | @REM MAVEN_SKIP_RC - flag to disable loading of mavenrc files 34 | @REM ---------------------------------------------------------------------------- 35 | 36 | @REM Begin all REM lines with '@' in case MAVEN_BATCH_ECHO is 'on' 37 | @echo off 38 | @REM set title of command window 39 | title %0 40 | @REM enable echoing by setting MAVEN_BATCH_ECHO to 'on' 41 | @if "%MAVEN_BATCH_ECHO%" == "on" echo %MAVEN_BATCH_ECHO% 42 | 43 | @REM set %HOME% to equivalent of $HOME 44 | if "%HOME%" == "" (set "HOME=%HOMEDRIVE%%HOMEPATH%") 45 | 46 | @REM Execute a user defined script before this one 47 | if not "%MAVEN_SKIP_RC%" == "" goto skipRcPre 48 | @REM check for pre script, once with legacy .bat ending and once with .cmd ending 49 | if exist "%USERPROFILE%\mavenrc_pre.bat" call "%USERPROFILE%\mavenrc_pre.bat" %* 50 | if exist "%USERPROFILE%\mavenrc_pre.cmd" call "%USERPROFILE%\mavenrc_pre.cmd" %* 51 | :skipRcPre 52 | 53 | @setlocal 54 | 55 | set ERROR_CODE=0 56 | 57 | @REM To isolate internal variables from possible post scripts, we use another setlocal 58 | @setlocal 59 | 60 | @REM ==== START VALIDATION ==== 61 | if not "%JAVA_HOME%" == "" goto OkJHome 62 | 63 | echo. 64 | echo Error: JAVA_HOME not found in your environment. >&2 65 | echo Please set the JAVA_HOME variable in your environment to match the >&2 66 | echo location of your Java installation. >&2 67 | echo. 68 | goto error 69 | 70 | :OkJHome 71 | if exist "%JAVA_HOME%\bin\java.exe" goto init 72 | 73 | echo. 74 | echo Error: JAVA_HOME is set to an invalid directory. >&2 75 | echo JAVA_HOME = "%JAVA_HOME%" >&2 76 | echo Please set the JAVA_HOME variable in your environment to match the >&2 77 | echo location of your Java installation. >&2 78 | echo. 79 | goto error 80 | 81 | @REM ==== END VALIDATION ==== 82 | 83 | :init 84 | 85 | @REM Find the project base dir, i.e. the directory that contains the folder ".mvn". 86 | @REM Fallback to current working directory if not found. 87 | 88 | set MAVEN_PROJECTBASEDIR=%MAVEN_BASEDIR% 89 | IF NOT "%MAVEN_PROJECTBASEDIR%"=="" goto endDetectBaseDir 90 | 91 | set EXEC_DIR=%CD% 92 | set WDIR=%EXEC_DIR% 93 | :findBaseDir 94 | IF EXIST "%WDIR%"\.mvn goto baseDirFound 95 | cd .. 96 | IF "%WDIR%"=="%CD%" goto baseDirNotFound 97 | set WDIR=%CD% 98 | goto findBaseDir 99 | 100 | :baseDirFound 101 | set MAVEN_PROJECTBASEDIR=%WDIR% 102 | cd "%EXEC_DIR%" 103 | goto endDetectBaseDir 104 | 105 | :baseDirNotFound 106 | set MAVEN_PROJECTBASEDIR=%EXEC_DIR% 107 | cd "%EXEC_DIR%" 108 | 109 | :endDetectBaseDir 110 | 111 | IF NOT EXIST "%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config" goto endReadAdditionalConfig 112 | 113 | @setlocal EnableExtensions EnableDelayedExpansion 114 | for /F "usebackq delims=" %%a in ("%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config") do set JVM_CONFIG_MAVEN_PROPS=!JVM_CONFIG_MAVEN_PROPS! %%a 115 | @endlocal & set JVM_CONFIG_MAVEN_PROPS=%JVM_CONFIG_MAVEN_PROPS% 116 | 117 | :endReadAdditionalConfig 118 | 119 | SET MAVEN_JAVA_EXE="%JAVA_HOME%\bin\java.exe" 120 | set WRAPPER_JAR="%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.jar" 121 | set WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain 122 | 123 | set DOWNLOAD_URL="https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.1.0/maven-wrapper-3.1.0.jar" 124 | 125 | FOR /F "usebackq tokens=1,2 delims==" %%A IN ("%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.properties") DO ( 126 | IF "%%A"=="wrapperUrl" SET DOWNLOAD_URL=%%B 127 | ) 128 | 129 | @REM Extension to allow automatically downloading the maven-wrapper.jar from Maven-central 130 | @REM This allows using the maven wrapper in projects that prohibit checking in binary data. 131 | if exist %WRAPPER_JAR% ( 132 | if "%MVNW_VERBOSE%" == "true" ( 133 | echo Found %WRAPPER_JAR% 134 | ) 135 | ) else ( 136 | if not "%MVNW_REPOURL%" == "" ( 137 | SET DOWNLOAD_URL="%MVNW_REPOURL%/org/apache/maven/wrapper/maven-wrapper/3.1.0/maven-wrapper-3.1.0.jar" 138 | ) 139 | if "%MVNW_VERBOSE%" == "true" ( 140 | echo Couldn't find %WRAPPER_JAR%, downloading it ... 141 | echo Downloading from: %DOWNLOAD_URL% 142 | ) 143 | 144 | powershell -Command "&{"^ 145 | "$webclient = new-object System.Net.WebClient;"^ 146 | "if (-not ([string]::IsNullOrEmpty('%MVNW_USERNAME%') -and [string]::IsNullOrEmpty('%MVNW_PASSWORD%'))) {"^ 147 | "$webclient.Credentials = new-object System.Net.NetworkCredential('%MVNW_USERNAME%', '%MVNW_PASSWORD%');"^ 148 | "}"^ 149 | "[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; $webclient.DownloadFile('%DOWNLOAD_URL%', '%WRAPPER_JAR%')"^ 150 | "}" 151 | if "%MVNW_VERBOSE%" == "true" ( 152 | echo Finished downloading %WRAPPER_JAR% 153 | ) 154 | ) 155 | @REM End of extension 156 | 157 | @REM Provide a "standardized" way to retrieve the CLI args that will 158 | @REM work with both Windows and non-Windows executions. 159 | set MAVEN_CMD_LINE_ARGS=%* 160 | 161 | %MAVEN_JAVA_EXE% ^ 162 | %JVM_CONFIG_MAVEN_PROPS% ^ 163 | %MAVEN_OPTS% ^ 164 | %MAVEN_DEBUG_OPTS% ^ 165 | -classpath %WRAPPER_JAR% ^ 166 | "-Dmaven.multiModuleProjectDirectory=%MAVEN_PROJECTBASEDIR%" ^ 167 | %WRAPPER_LAUNCHER% %MAVEN_CONFIG% %* 168 | if ERRORLEVEL 1 goto error 169 | goto end 170 | 171 | :error 172 | set ERROR_CODE=1 173 | 174 | :end 175 | @endlocal & set ERROR_CODE=%ERROR_CODE% 176 | 177 | if not "%MAVEN_SKIP_RC%"=="" goto skipRcPost 178 | @REM check for post script, once with legacy .bat ending and once with .cmd ending 179 | if exist "%USERPROFILE%\mavenrc_post.bat" call "%USERPROFILE%\mavenrc_post.bat" 180 | if exist "%USERPROFILE%\mavenrc_post.cmd" call "%USERPROFILE%\mavenrc_post.cmd" 181 | :skipRcPost 182 | 183 | @REM pause the script if MAVEN_BATCH_PAUSE is set to 'on' 184 | if "%MAVEN_BATCH_PAUSE%"=="on" pause 185 | 186 | if "%MAVEN_TERMINATE_CMD%"=="on" exit %ERROR_CODE% 187 | 188 | cmd /C exit /B %ERROR_CODE% 189 | -------------------------------------------------------------------------------- /src/main/webapp/pages/display/customerProfile.jsp: -------------------------------------------------------------------------------- 1 | <%@page import="java.sql.Date"%> 2 | <%@page import="java.text.SimpleDateFormat"%> 3 | <%@page import="com.clothes.demo.models.customer.CustomerDetails"%> 4 | <%@ page language="java" contentType="text/html; charset=ISO-8859-1" 5 | pageEncoding="ISO-8859-1"%> 6 | 7 | 8 | 9 | 10 | My Profile 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 56 | 57 | 58 | 59 | 60 | 61 | <% 62 | response.setHeader("Cache-Control", "no-cache, no-store, must-revalidate"); // this is for HTTP version 1.1 not work for lesser version 63 | response.setHeader("Pragma", "no-cache"); // this is for HTTP version 1.0 64 | response.setHeader("Expires", "0"); // this is for proxies server 65 | %> 66 | 67 | 68 | <%@include file="../navfooter/navbar.jsp"%> 69 | 70 | 71 | 72 | <% 73 | String error_message = (String)session.getAttribute("ERROR"); 74 | String success_message = (String)session.getAttribute("SUCCESS"); 75 | %> 76 | <% if(null != error_message){%> 77 | 81 | <% 82 | session.removeAttribute("ERROR"); 83 | }else if(null != success_message){ 84 | %> 85 | 89 | <% 90 | session.removeAttribute("SUCCESS"); 91 | } %> 92 | 93 | 94 | <% 95 | SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd"); 96 | Long cid = customer.getCustomer_id(); 97 | String cimage = customer.getProfile_image(); 98 | String cname = customer.getCustomer_name(); 99 | String emailid = customer.getCustomer_email_id(); 100 | String contact = customer.getCustomer_contact_number(); 101 | String dob = formatter.format(customer.getCustomer_dob()); 102 | String joiningdate = formatter.format(customer.getCustomer_joiningdate()); 103 | %> 104 |

105 |

My Profile

106 |
107 | profilepic 108 |

<%=cname%>

109 |

<%=emailid%>

110 |

<%=contact%>

111 |

112 | DOB :- 113 | <%=dob%>

114 |

115 | Joining Date :- 116 | <%=joiningdate%>

117 | 118 |
119 | 122 | 123 |
124 |
125 |
126 | × 129 |

Edit Profile

130 |
131 |
132 |
133 |
134 | 135 | 136 | 137 | 138 | 139 | 140 | <%-- --%> 141 | 142 | 143 |
144 |
145 | 148 |
149 |
150 |
151 |
152 |
153 | 154 | 155 |
156 | 159 | 160 |
161 |
162 |
163 | × 166 |

Delete Account?

167 |
168 |
169 |
170 |
171 | 172 | 173 | 174 | 175 | 176 |
177 |
178 | 181 |
182 |
183 |
184 |
185 |
186 |
187 | 188 | 189 | 190 | <%@include file="../navfooter/footer.jsp"%> 191 | 192 | 193 | -------------------------------------------------------------------------------- /src/main/java/com/clothes/demo/controller/ProductController.java: -------------------------------------------------------------------------------- 1 | package com.clothes.demo.controller; 2 | 3 | 4 | import java.io.IOException; 5 | import java.util.Date; 6 | import java.util.List; 7 | 8 | import javax.servlet.http.HttpServletRequest; 9 | import javax.servlet.http.HttpSession; 10 | 11 | import org.springframework.beans.factory.annotation.Autowired; 12 | import org.springframework.stereotype.Controller; 13 | import org.springframework.web.bind.annotation.GetMapping; 14 | import org.springframework.web.bind.annotation.RequestMapping; 15 | import org.springframework.web.bind.annotation.RequestMethod; 16 | import org.springframework.web.servlet.ModelAndView; 17 | import org.springframework.web.servlet.mvc.support.RedirectAttributes; 18 | 19 | import com.clothes.demo.dao.ProductDao; 20 | import com.clothes.demo.models.orders.OrderItem; 21 | import com.clothes.demo.models.products.Product; 22 | import com.clothes.demo.models.vendor.Vendor; 23 | 24 | @Controller 25 | public class ProductController { 26 | @Autowired 27 | ProductDao prodao; 28 | 29 | /* 30 | @RequestMapping(path = "/fashion-factory/addProduct", method = RequestMethod.POST) 31 | public String addProduct(Product product,@RequestParam("proimage") MultipartFile pimage,RedirectAttributes redirAttrs) throws IOException { 32 | // prodao.save(product); 33 | String fileName = StringUtils.cleanPath(pimage.getOriginalFilename()); 34 | product.setProduct_image(fileName); 35 | 36 | Product savedUser = prodao.save(product); 37 | 38 | String uploadDir = "product-photos/" + savedUser.getId(); 39 | 40 | FileUploadUtil.saveFile(uploadDir, fileName, pimage); 41 | // System.out.println(product); 42 | System.out.println("Product Registred"); 43 | return "redirect:/fashion-factory"; 44 | } 45 | */ 46 | 47 | // Add product 48 | @GetMapping(path = "/fashion-factory/addProduct") 49 | public String addProduct(HttpServletRequest request) { 50 | HttpSession session = request.getSession(); 51 | session.setAttribute("ERROR", "You should first need to Login or SignUp as Customer!!"); 52 | 53 | return "redirect:/fashion-factory"; 54 | } 55 | @RequestMapping(path = "/fashion-factory/addProduct", method = RequestMethod.POST) 56 | public String addProduct(Product product,HttpServletRequest request,RedirectAttributes redirAttrs) throws IOException { 57 | System.out.println("in ADD Product"); 58 | HttpSession session = request.getSession(); 59 | List productcode_exists = prodao.findByProduct_code(product.getProduct_code()); 60 | if(1==productcode_exists.size()) { 61 | session.setAttribute("ERROR", "Entered Product code is alredy used!!"); 62 | String referer = request.getHeader("Referer"); 63 | return "redirect:" + referer; 64 | } 65 | Vendor ven = (Vendor) session.getAttribute("vendor"); 66 | System.out.println(ven); 67 | product.setVendor(ven); 68 | System.out.println(product); 69 | System.out.println("Product Registred"); 70 | prodao.save(product); 71 | session.setAttribute("SUCCESS", "Product Added!!"); 72 | String referer = request.getHeader("Referer"); 73 | return "redirect:" + referer; 74 | } 75 | 76 | // Show my all products (Vendor) 77 | @RequestMapping(path = "myProducts", method = RequestMethod.GET) 78 | public ModelAndView myProduct(HttpServletRequest request,RedirectAttributes redirAttrs) throws IOException { 79 | System.out.println("in MY Product"); 80 | HttpSession session = request.getSession(); 81 | Vendor ven = (Vendor) session.getAttribute("vendor"); 82 | if(null==ven) { 83 | session.setAttribute("ERROR", "You should first need to Login or SignUp as Customer!!"); 84 | ModelAndView mv = new ModelAndView("redirect:/fashion-factory"); 85 | return mv; 86 | } 87 | // System.out.println(ven); 88 | List all_pro = prodao.findByVendor(ven); 89 | System.out.println(all_pro); 90 | ModelAndView mv = new ModelAndView("pages/display/showMyProducts.jsp"); 91 | mv.addObject("all_pro",all_pro); 92 | return mv; 93 | } 94 | 95 | // Edit Product Details 96 | @RequestMapping(path = "/fashion-factory/editProduct", method = RequestMethod.POST) 97 | public String editProduct(Product product,HttpServletRequest request,RedirectAttributes redirAttrs) throws IOException { 98 | System.out.println("Editing Product"); 99 | Long proid = product.getId(); 100 | HttpSession session = request.getSession(); 101 | Product db_product = prodao.findById(proid).orElse(product); 102 | if(null!=db_product) { 103 | if(!db_product.getProduct_code().equals(product.getProduct_code())) { 104 | List newproductcode = prodao.findByProduct_code(product.getProduct_code()); 105 | if(1==newproductcode.size()) { 106 | session.setAttribute("ERROR", "Entered Product code is alredy used!!"); 107 | String referer = request.getHeader("Referer"); 108 | return "redirect:" + referer; 109 | } 110 | } 111 | } 112 | 113 | Vendor ven = (Vendor) session.getAttribute("vendor"); 114 | // System.out.println(ven); 115 | // prodao.deleteById(proid); 116 | String procode = product.getProduct_code(); 117 | String proimge = product.getProduct_image(); 118 | String proname = product.getProduct_name(); 119 | String prodesc = product.getProduct_description(); 120 | Double proprice = product.getProduct_price(); 121 | String procategory = product.getProduct_category(); 122 | 123 | product.setVendor(ven); 124 | prodao.setProductDetailsById(procode, proimge, proname, prodesc, proprice, procategory, proid); 125 | prodao.save(product); 126 | session.setAttribute("SUCCESS", "Product Details Updated Successfull"); 127 | String referer = request.getHeader("Referer"); 128 | return "redirect:" + referer; 129 | } 130 | 131 | // Delete Product 132 | @RequestMapping(path = "/fashion-factory/deleteProduct", method = RequestMethod.POST) 133 | public String deleteProduct(Product product,HttpServletRequest request,RedirectAttributes redirAttrs) throws IOException { 134 | System.out.println("Deleting Product"); 135 | Long pid = product.getId(); 136 | prodao.deleteById(pid); 137 | String referer = request.getHeader("Referer"); 138 | return "redirect:" + referer; 139 | } 140 | 141 | // Showing specific category products 142 | @RequestMapping(path = "/showMenProducts", method = RequestMethod.GET) 143 | public ModelAndView showMenProducts(HttpServletRequest request,RedirectAttributes redirAttrs){ 144 | System.out.println("Show Men Product"); 145 | ModelAndView mv = new ModelAndView("pages/display/MenProducts.jsp"); 146 | List all_men_products = prodao.findByProduct_category("Men"); 147 | mv.addObject("all_men_products", all_men_products); 148 | return mv; 149 | } 150 | @RequestMapping(path = "/showWomenProducts", method = RequestMethod.GET) 151 | public ModelAndView showWomenProducts(HttpServletRequest request,RedirectAttributes redirAttrs){ 152 | System.out.println("Show Men Product"); 153 | ModelAndView mv = new ModelAndView("pages/display/WomenProducts.jsp"); 154 | List all_women_products = prodao.findByProduct_category("Women"); 155 | mv.addObject("all_women_products", all_women_products); 156 | return mv; 157 | } 158 | @RequestMapping(path = "/showKidsProducts", method = RequestMethod.GET) 159 | public ModelAndView showKidsProducts(HttpServletRequest request,RedirectAttributes redirAttrs){ 160 | System.out.println("Show Kids Product"); 161 | ModelAndView mv = new ModelAndView("pages/display/KidsProducts.jsp"); 162 | List all_kids_products = prodao.findByProduct_category("Kids"); 163 | mv.addObject("all_kids_products", all_kids_products); 164 | return mv; 165 | } 166 | 167 | // find all sold products 168 | @RequestMapping(path = "/soldProducts", method = RequestMethod.GET) 169 | public ModelAndView soldProducts(HttpServletRequest request,RedirectAttributes redirAttrs){ 170 | System.out.println("Sold Product"); 171 | ModelAndView mv = new ModelAndView("pages/display/SoldProducts.jsp"); 172 | Vendor vendor = (Vendor) request.getSession().getAttribute("vendor"); 173 | List all_sold_products = prodao.findByVendor(vendor); 174 | mv.addObject("all_sold_products", all_sold_products); 175 | return mv; 176 | } 177 | } 178 | -------------------------------------------------------------------------------- /src/main/webapp/pages/display/ordereditems.jsp: -------------------------------------------------------------------------------- 1 | <%@page import="com.clothes.demo.models.vendor.BillingAddress"%> 2 | <%@page import="java.sql.Time"%> 3 | <%@page import="java.text.SimpleDateFormat"%> 4 | <%@page import="java.util.ArrayList"%> 5 | <%@page import="com.clothes.demo.models.orders.OrderItem"%> 6 | <%@page import="java.util.List"%> 7 | <%@ page language="java" contentType="text/html; charset=ISO-8859-1" 8 | pageEncoding="ISO-8859-1"%> 9 | 10 | 11 | 12 | 13 | Ordered Items 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 85 | 86 | 87 | <% 88 | response.setHeader("Cache-Control", "no-cache, no-store, must-revalidate"); // this is for HTTP version 1.1 not work for lesser version 89 | response.setHeader("Pragma", "no-cache"); // this is for HTTP version 1.0 90 | response.setHeader("Expires", "0"); // this is for proxies server 91 | %> 92 | 93 | <%@include file="../navfooter/navbar.jsp"%> 94 | 95 | 96 | <% 97 | String error_message = (String)session.getAttribute("ERROR"); 98 | String success_message = (String)session.getAttribute("SUCCESS"); 99 | %> 100 | <% if(null != error_message){%> 101 | 105 | <% 106 | session.removeAttribute("ERROR"); 107 | }else if(null != success_message){ 108 | %> 109 | 113 | <% 114 | session.removeAttribute("SUCCESS"); 115 | } %> 116 | 117 | 118 | <% 119 | List orderd_items = (List) request.getAttribute("ordered_items"); 120 | List colors = new ArrayList(); 121 | colors.add("green"); 122 | colors.add("blue"); 123 | colors.add("black"); 124 | colors.add("Lavender"); 125 | colors.add("MediumSlateBlue"); 126 | int colorssize = colors.size(); 127 | %> 128 | 129 | <% 130 | if (!orderd_items.isEmpty()) { 131 | int count = 0; 132 | int total_cost = 0; 133 | %> 134 |
135 |
136 |

137 | Order Items(Order ID :- <%= "O"+orderd_items.get(0).getOrder().getId()%>) 138 |

139 |
140 |
141 | 142 | 143 | 144 | 145 | 146 | 147 | 148 | 149 | 150 | 151 | 152 | 153 | 154 | 155 | 156 | <% 157 | for (OrderItem oi : orderd_items) { 158 | %> 159 | <% 160 | SimpleDateFormat formatter = new SimpleDateFormat("MM/dd/yyyy"); 161 | count++; 162 | String image = oi.getProduct().getProduct_image(); 163 | String name = oi.getProduct().getProduct_name(); 164 | String desc = oi.getProduct().getProduct_description(); 165 | Double price = oi.getItem_price(); 166 | int quantity = oi.getQuentity(); 167 | String date = formatter.format(oi.getOrder_item_date()); 168 | Time time = oi.getOrder_item_time(); 169 | 170 | total_cost += price*quantity; 171 | 172 | String sellerdivid = "seller" + oi.getId(); 173 | String shopname = oi.getProduct().getVendor().getVendor_shop_name(); 174 | String shopimage = oi.getProduct().getVendor().getImage(); 175 | String vendorname = oi.getProduct().getVendor().getVendor_name(); 176 | BillingAddress vendoraddress = oi.getProduct().getVendor().getBilling_address(); 177 | String street = vendoraddress.getStreet(); 178 | String city = vendoraddress.getCity(); 179 | String district = vendoraddress.getDistrict(); 180 | String state = vendoraddress.getState(); 181 | String pincode = vendoraddress.getPincode(); 182 | String venaddress = street + ", " + city + ", " + district + ", " + state + ", " + pincode + "."; 183 | String email = oi.getProduct().getVendor().getVendor_email_id(); 184 | String contact = oi.getProduct().getVendor().getVendor_contact_number(); 185 | %> 186 | 187 | 188 | 189 | 190 | 191 | 192 | 193 | 195 | 196 | 235 | 236 | <% 237 | } 238 | %> 239 |
No.PhotoNameDescriptionPriceQuantityItems CostDateTimeSeller
<%=count%><%=name%><%=name%><%=desc%><%=price%><%=quantity%><%= total_cost %> 194 | <%=date%><%=time%> 197 | 198 |
199 | 202 | 203 |
204 |
205 |
206 | × 209 |

Seller Information

210 |
211 |

212 |
213 |
214 |
215 | John 216 |

<%= shopname %>

217 |

Name : <%= vendorname %>

218 |

Address : <%= venaddress %>

219 |
220 | 224 |
225 |

226 | 227 |

228 |
229 |
230 |
231 |
232 |
233 |
234 |
240 |

241 |

Total Cost :- <%= total_cost %> ₹

242 | <% 243 | } 244 | %> 245 |
246 |
247 |
248 | <%@include file="../navfooter/footer.jsp"%> 249 | 250 | -------------------------------------------------------------------------------- /src/main/webapp/pages/display/vendorProfile.jsp: -------------------------------------------------------------------------------- 1 | <%@page import="com.clothes.demo.models.vendor.BillingAddress"%> 2 | <%@page import="java.sql.Date"%> 3 | <%@page import="java.text.SimpleDateFormat"%> 4 | <%@page import="com.clothes.demo.models.customer.CustomerDetails"%> 5 | <%@ page language="java" contentType="text/html; charset=ISO-8859-1" 6 | pageEncoding="ISO-8859-1"%> 7 | 8 | 9 | 10 | 11 | My Profile 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 59 | 60 | 61 | 62 | <% 63 | response.setHeader("Cache-Control", "no-cache, no-store, must-revalidate"); // this is for HTTP version 1.1 not work for lesser version 64 | response.setHeader("Pragma", "no-cache"); // this is for HTTP version 1.0 65 | response.setHeader("Expires", "0"); // this is for proxies server 66 | %> 67 | 68 | 69 | <%@include file="../navfooter/navbar.jsp"%> 70 | 71 | 72 | 73 | <% 74 | String error_message = (String)session.getAttribute("ERROR"); 75 | String success_message = (String)session.getAttribute("SUCCESS"); 76 | %> 77 | <% if(null != error_message){%> 78 | 82 | <% 83 | session.removeAttribute("ERROR"); 84 | }else if(null != success_message){ 85 | %> 86 | 90 | <% 91 | session.removeAttribute("SUCCESS"); 92 | } %> 93 | 94 | 95 | <% 96 | SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd"); 97 | Long vid = vendor.getVendor_id(); 98 | String simage = vendor.getImage(); 99 | String vname = vendor.getVendor_name(); 100 | String emailid = vendor.getVendor_email_id(); 101 | String contact = vendor.getVendor_contact_number(); 102 | String shopname = vendor.getVendor_shop_name(); 103 | String joiningdate = formatter.format(vendor.getVendor_joiningdate()); 104 | 105 | BillingAddress baddress = vendor.getBilling_address(); 106 | Long bid = baddress.getAid(); 107 | String hno = baddress.getHouse_no(); 108 | String street = baddress.getStreet(); 109 | String city = baddress.getCity(); 110 | String district = baddress.getDistrict(); 111 | String state = baddress.getState(); 112 | String pincode = baddress.getPincode(); 113 | 114 | String billingaddress = hno + ", " + street + ", " + city + ", " + district + ", " + state + ", " + pincode + "."; 115 | %> 116 |
117 |

My Profile

118 |
119 |
120 | profilepic 121 |
122 |

<%=shopname%>

123 |
124 |

<%=vname %>

125 |

<%=emailid%>

126 |

<%=contact%>

127 |

128 |

Joining Date :- <%=joiningdate%>

129 |
130 |

Billing Address :- <%=billingaddress%>

131 |
132 | 133 |
134 | 137 | 138 |
139 |
140 |
141 | × 144 |

Edit Profile

145 |
146 |
147 |
148 |
149 | 150 | 151 | 152 | 153 | 154 | 155 | 156 |
157 |
158 | 161 |
162 |
163 |
164 |
165 |
166 | 167 |
168 | 171 | 172 |
173 |
174 |
175 | × 178 |

Edit Billing Address

179 |
180 |
181 |
182 |
183 | 184 | 185 | 186 | 187 | 188 | 189 | 190 | 191 | 192 |
193 |
194 | 197 |
198 |
199 |
200 |
201 |
202 |
203 | 204 |

205 | 206 | <%@include file="../navfooter/footer.jsp"%> 207 | 208 | 209 | -------------------------------------------------------------------------------- /src/main/java/com/clothes/demo/controller/OrderItemController.java: -------------------------------------------------------------------------------- 1 | package com.clothes.demo.controller; 2 | 3 | import java.io.IOException; 4 | import java.sql.Date; 5 | import java.sql.Time; 6 | import java.util.List; 7 | 8 | import javax.servlet.http.HttpServletRequest; 9 | import javax.servlet.http.HttpSession; 10 | 11 | import org.springframework.beans.factory.annotation.Autowired; 12 | import org.springframework.format.annotation.DateTimeFormat; 13 | import org.springframework.stereotype.Controller; 14 | import org.springframework.web.bind.annotation.GetMapping; 15 | import org.springframework.web.bind.annotation.PostMapping; 16 | import org.springframework.web.bind.annotation.RequestMapping; 17 | import org.springframework.web.bind.annotation.RequestMethod; 18 | import org.springframework.web.bind.annotation.RequestParam; 19 | import org.springframework.web.servlet.ModelAndView; 20 | import org.springframework.web.servlet.mvc.support.RedirectAttributes; 21 | 22 | import com.clothes.demo.dao.AddressDao; 23 | import com.clothes.demo.dao.OrderDao; 24 | import com.clothes.demo.dao.OrderItemDao; 25 | import com.clothes.demo.dao.ProductDao; 26 | import com.clothes.demo.models.authenticate.Admin; 27 | import com.clothes.demo.models.customer.Address; 28 | import com.clothes.demo.models.customer.CustomerDetails; 29 | import com.clothes.demo.models.orders.Order; 30 | import com.clothes.demo.models.orders.OrderItem; 31 | import com.clothes.demo.models.products.Product; 32 | import com.clothes.demo.models.vendor.Vendor; 33 | 34 | @Controller 35 | public class OrderItemController { 36 | @Autowired 37 | private OrderItemDao oitemdao; 38 | @Autowired 39 | private OrderDao odao; 40 | @Autowired 41 | ProductDao prodao; 42 | @Autowired 43 | AddressDao adddao; 44 | 45 | // Add product 46 | @GetMapping(path = "/fashion-factory/addToCart") 47 | public String addProduct(HttpServletRequest request) { 48 | HttpSession session = request.getSession(); 49 | session.setAttribute("ERROR", "You should first need to Login or SignUp as Customer!!"); 50 | 51 | return "redirect:/fashion-factory"; 52 | } 53 | @PostMapping(path = "/fashion-factory/addToCart") 54 | public String addProduct(@RequestParam("product_id") Long proid, @RequestParam("quentity") int quentity, 55 | HttpServletRequest request, RedirectAttributes redirAttrs) throws IOException { 56 | System.out.println("in ADDTOCART"); 57 | HttpSession session = request.getSession(); 58 | CustomerDetails customer = (CustomerDetails) session.getAttribute("customer"); 59 | Vendor vendor = (Vendor) session.getAttribute("vendor"); 60 | Admin admin = (Admin) session.getAttribute("admin"); 61 | // if customer not logged in and try to go this url 62 | if(null!=vendor || null!=admin) { 63 | session.setAttribute("ERROR", "You should first need to Login or SignUp as Customer!!"); 64 | String referer = request.getHeader("Referer"); 65 | return "redirect:" + referer; 66 | }else if(null==customer) { 67 | session.setAttribute("ERROR", "You should first need to Login or SignUp!!"); 68 | String referer = request.getHeader("Referer"); 69 | return "redirect:" + referer; 70 | } 71 | 72 | Order current_order = (Order) session.getAttribute("current_order"); 73 | long millis = System.currentTimeMillis(); 74 | if (null == current_order) { 75 | Order newOrder = new Order(); 76 | newOrder.setOrder_date(new java.sql.Date(millis)); 77 | newOrder.setOrder_time(new java.sql.Time(millis)); 78 | newOrder.setCustomer(customer); 79 | 80 | Order savedOrder = odao.save(newOrder); 81 | session.setAttribute("current_order", savedOrder); 82 | current_order = (Order) session.getAttribute("current_order"); 83 | } 84 | 85 | OrderItem myitem = new OrderItem(); 86 | Product myproduct = prodao.findById(proid).orElse(null); 87 | List itemexist = oitemdao.findByOrder_idAndProduct_id(current_order, myproduct); 88 | Long solditems = myproduct.getSold_quantity(); 89 | solditems += quentity; 90 | if (itemexist.isEmpty()) { 91 | myitem.setItem_price(myproduct.getProduct_price()); 92 | myitem.setQuentity(quentity); 93 | myitem.setOrder_item_date((Date) new java.sql.Date(millis)); 94 | myitem.setOrder_item_time((Time) new java.sql.Time(millis)); 95 | myitem.setProduct(myproduct); 96 | myitem.setOrder(current_order); 97 | } else { 98 | myitem = itemexist.get(0); 99 | session.setAttribute("SUCCESS", quentity+" Added in to the cart"); 100 | quentity += myitem.getQuentity(); 101 | System.out.println(quentity); 102 | oitemdao.setOrderItemByQuentity(quentity, myitem.getId()); 103 | } 104 | oitemdao.save(myitem); 105 | prodao.setSold_QuantityById(solditems, proid); 106 | // temporary printing data 107 | System.out.println("Item added to cart"); 108 | // System.out.println(myitem); 109 | // System.out.println(myproduct); 110 | 111 | String referer = request.getHeader("Referer"); 112 | return "redirect:" + referer; 113 | } 114 | 115 | // showing carts items 116 | @RequestMapping(path = "/myCarts", method = RequestMethod.GET) 117 | public ModelAndView myCarts(HttpServletRequest request,RedirectAttributes redirAttrs){ 118 | System.out.println("In My Carts"); 119 | HttpSession session = request.getSession(); 120 | CustomerDetails customer = (CustomerDetails) session.getAttribute("customer"); 121 | // if customer not logged in and try to go this url 122 | if(null==customer) { 123 | session.setAttribute("ERROR", "You should first need to Login or SignUp as Customer!!"); 124 | ModelAndView tempmodel = new ModelAndView("redirect:/fashion-factory"); 125 | return tempmodel; 126 | } 127 | 128 | ModelAndView mv = new ModelAndView("pages/display/mycarts.jsp"); 129 | 130 | Order current_order = (Order) session.getAttribute("current_order"); 131 | if(null != customer) { 132 | Address customeradd = adddao.findBycd(customer); 133 | mv.addObject("customer_address", customeradd); 134 | } 135 | List carts = oitemdao.findAllByOrder_id(current_order); 136 | mv.addObject("carts", carts); 137 | 138 | return mv; 139 | } 140 | 141 | // Edit purchased Quantity 142 | @GetMapping(path = "/fashion-factory/editCartQuentity") 143 | public String editCartQuentity(HttpServletRequest request) { 144 | HttpSession session = request.getSession(); 145 | session.setAttribute("ERROR", "You should first need to Login or SignUp as Customer!!"); 146 | 147 | return "redirect:/fashion-factory"; 148 | } 149 | @PostMapping(path = "/fashion-factory/editCartQuentity") 150 | public String editCartQuentity(@RequestParam("id") Long id,@RequestParam("quantity") int quentity,HttpServletRequest request,RedirectAttributes redirAttrs){ 151 | OrderItem current_q = oitemdao.findById(id).orElse(null); 152 | HttpSession session = request.getSession(); 153 | CustomerDetails customer = (CustomerDetails) session.getAttribute("customer"); 154 | // if customer not logged in and try to go this url 155 | if(null==customer) { 156 | session.setAttribute("ERROR", "You should first need to Login or SignUp as Customer!!"); 157 | String referer = request.getHeader("Referer"); 158 | return "redirect:" + referer; 159 | } 160 | int q = current_q.getQuentity(); 161 | if(q>quentity) { 162 | Long que = (long) (q-quentity); 163 | que = current_q.getProduct().getSold_quantity()-que; 164 | prodao.setSold_QuantityById(que, current_q.getProduct().getId()); 165 | }else if(q ordered_items = oitemdao.findAllByOrder_id(order); 209 | mv.addObject("ordered_items", ordered_items); 210 | return mv; 211 | } 212 | 213 | 214 | } 215 | -------------------------------------------------------------------------------- /mvnw: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # ---------------------------------------------------------------------------- 3 | # Licensed to the Apache Software Foundation (ASF) under one 4 | # or more contributor license agreements. See the NOTICE file 5 | # distributed with this work for additional information 6 | # regarding copyright ownership. The ASF licenses this file 7 | # to you under the Apache License, Version 2.0 (the 8 | # "License"); you may not use this file except in compliance 9 | # with the License. You may obtain a copy of the License at 10 | # 11 | # https://www.apache.org/licenses/LICENSE-2.0 12 | # 13 | # Unless required by applicable law or agreed to in writing, 14 | # software distributed under the License is distributed on an 15 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16 | # KIND, either express or implied. See the License for the 17 | # specific language governing permissions and limitations 18 | # under the License. 19 | # ---------------------------------------------------------------------------- 20 | 21 | # ---------------------------------------------------------------------------- 22 | # Maven Start Up Batch script 23 | # 24 | # Required ENV vars: 25 | # ------------------ 26 | # JAVA_HOME - location of a JDK home dir 27 | # 28 | # Optional ENV vars 29 | # ----------------- 30 | # M2_HOME - location of maven2's installed home dir 31 | # MAVEN_OPTS - parameters passed to the Java VM when running Maven 32 | # e.g. to debug Maven itself, use 33 | # set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000 34 | # MAVEN_SKIP_RC - flag to disable loading of mavenrc files 35 | # ---------------------------------------------------------------------------- 36 | 37 | if [ -z "$MAVEN_SKIP_RC" ] ; then 38 | 39 | if [ -f /usr/local/etc/mavenrc ] ; then 40 | . /usr/local/etc/mavenrc 41 | fi 42 | 43 | if [ -f /etc/mavenrc ] ; then 44 | . /etc/mavenrc 45 | fi 46 | 47 | if [ -f "$HOME/.mavenrc" ] ; then 48 | . "$HOME/.mavenrc" 49 | fi 50 | 51 | fi 52 | 53 | # OS specific support. $var _must_ be set to either true or false. 54 | cygwin=false; 55 | darwin=false; 56 | mingw=false 57 | case "`uname`" in 58 | CYGWIN*) cygwin=true ;; 59 | MINGW*) mingw=true;; 60 | Darwin*) darwin=true 61 | # Use /usr/libexec/java_home if available, otherwise fall back to /Library/Java/Home 62 | # See https://developer.apple.com/library/mac/qa/qa1170/_index.html 63 | if [ -z "$JAVA_HOME" ]; then 64 | if [ -x "/usr/libexec/java_home" ]; then 65 | export JAVA_HOME="`/usr/libexec/java_home`" 66 | else 67 | export JAVA_HOME="/Library/Java/Home" 68 | fi 69 | fi 70 | ;; 71 | esac 72 | 73 | if [ -z "$JAVA_HOME" ] ; then 74 | if [ -r /etc/gentoo-release ] ; then 75 | JAVA_HOME=`java-config --jre-home` 76 | fi 77 | fi 78 | 79 | if [ -z "$M2_HOME" ] ; then 80 | ## resolve links - $0 may be a link to maven's home 81 | PRG="$0" 82 | 83 | # need this for relative symlinks 84 | while [ -h "$PRG" ] ; do 85 | ls=`ls -ld "$PRG"` 86 | link=`expr "$ls" : '.*-> \(.*\)$'` 87 | if expr "$link" : '/.*' > /dev/null; then 88 | PRG="$link" 89 | else 90 | PRG="`dirname "$PRG"`/$link" 91 | fi 92 | done 93 | 94 | saveddir=`pwd` 95 | 96 | M2_HOME=`dirname "$PRG"`/.. 97 | 98 | # make it fully qualified 99 | M2_HOME=`cd "$M2_HOME" && pwd` 100 | 101 | cd "$saveddir" 102 | # echo Using m2 at $M2_HOME 103 | fi 104 | 105 | # For Cygwin, ensure paths are in UNIX format before anything is touched 106 | if $cygwin ; then 107 | [ -n "$M2_HOME" ] && 108 | M2_HOME=`cygpath --unix "$M2_HOME"` 109 | [ -n "$JAVA_HOME" ] && 110 | JAVA_HOME=`cygpath --unix "$JAVA_HOME"` 111 | [ -n "$CLASSPATH" ] && 112 | CLASSPATH=`cygpath --path --unix "$CLASSPATH"` 113 | fi 114 | 115 | # For Mingw, ensure paths are in UNIX format before anything is touched 116 | if $mingw ; then 117 | [ -n "$M2_HOME" ] && 118 | M2_HOME="`(cd "$M2_HOME"; pwd)`" 119 | [ -n "$JAVA_HOME" ] && 120 | JAVA_HOME="`(cd "$JAVA_HOME"; pwd)`" 121 | fi 122 | 123 | if [ -z "$JAVA_HOME" ]; then 124 | javaExecutable="`which javac`" 125 | if [ -n "$javaExecutable" ] && ! [ "`expr \"$javaExecutable\" : '\([^ ]*\)'`" = "no" ]; then 126 | # readlink(1) is not available as standard on Solaris 10. 127 | readLink=`which readlink` 128 | if [ ! `expr "$readLink" : '\([^ ]*\)'` = "no" ]; then 129 | if $darwin ; then 130 | javaHome="`dirname \"$javaExecutable\"`" 131 | javaExecutable="`cd \"$javaHome\" && pwd -P`/javac" 132 | else 133 | javaExecutable="`readlink -f \"$javaExecutable\"`" 134 | fi 135 | javaHome="`dirname \"$javaExecutable\"`" 136 | javaHome=`expr "$javaHome" : '\(.*\)/bin'` 137 | JAVA_HOME="$javaHome" 138 | export JAVA_HOME 139 | fi 140 | fi 141 | fi 142 | 143 | if [ -z "$JAVACMD" ] ; then 144 | if [ -n "$JAVA_HOME" ] ; then 145 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then 146 | # IBM's JDK on AIX uses strange locations for the executables 147 | JAVACMD="$JAVA_HOME/jre/sh/java" 148 | else 149 | JAVACMD="$JAVA_HOME/bin/java" 150 | fi 151 | else 152 | JAVACMD="`\\unset -f command; \\command -v java`" 153 | fi 154 | fi 155 | 156 | if [ ! -x "$JAVACMD" ] ; then 157 | echo "Error: JAVA_HOME is not defined correctly." >&2 158 | echo " We cannot execute $JAVACMD" >&2 159 | exit 1 160 | fi 161 | 162 | if [ -z "$JAVA_HOME" ] ; then 163 | echo "Warning: JAVA_HOME environment variable is not set." 164 | fi 165 | 166 | CLASSWORLDS_LAUNCHER=org.codehaus.plexus.classworlds.launcher.Launcher 167 | 168 | # traverses directory structure from process work directory to filesystem root 169 | # first directory with .mvn subdirectory is considered project base directory 170 | find_maven_basedir() { 171 | 172 | if [ -z "$1" ] 173 | then 174 | echo "Path not specified to find_maven_basedir" 175 | return 1 176 | fi 177 | 178 | basedir="$1" 179 | wdir="$1" 180 | while [ "$wdir" != '/' ] ; do 181 | if [ -d "$wdir"/.mvn ] ; then 182 | basedir=$wdir 183 | break 184 | fi 185 | # workaround for JBEAP-8937 (on Solaris 10/Sparc) 186 | if [ -d "${wdir}" ]; then 187 | wdir=`cd "$wdir/.."; pwd` 188 | fi 189 | # end of workaround 190 | done 191 | echo "${basedir}" 192 | } 193 | 194 | # concatenates all lines of a file 195 | concat_lines() { 196 | if [ -f "$1" ]; then 197 | echo "$(tr -s '\n' ' ' < "$1")" 198 | fi 199 | } 200 | 201 | BASE_DIR=`find_maven_basedir "$(pwd)"` 202 | if [ -z "$BASE_DIR" ]; then 203 | exit 1; 204 | fi 205 | 206 | ########################################################################################## 207 | # Extension to allow automatically downloading the maven-wrapper.jar from Maven-central 208 | # This allows using the maven wrapper in projects that prohibit checking in binary data. 209 | ########################################################################################## 210 | if [ -r "$BASE_DIR/.mvn/wrapper/maven-wrapper.jar" ]; then 211 | if [ "$MVNW_VERBOSE" = true ]; then 212 | echo "Found .mvn/wrapper/maven-wrapper.jar" 213 | fi 214 | else 215 | if [ "$MVNW_VERBOSE" = true ]; then 216 | echo "Couldn't find .mvn/wrapper/maven-wrapper.jar, downloading it ..." 217 | fi 218 | if [ -n "$MVNW_REPOURL" ]; then 219 | jarUrl="$MVNW_REPOURL/org/apache/maven/wrapper/maven-wrapper/3.1.0/maven-wrapper-3.1.0.jar" 220 | else 221 | jarUrl="https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.1.0/maven-wrapper-3.1.0.jar" 222 | fi 223 | while IFS="=" read key value; do 224 | case "$key" in (wrapperUrl) jarUrl="$value"; break ;; 225 | esac 226 | done < "$BASE_DIR/.mvn/wrapper/maven-wrapper.properties" 227 | if [ "$MVNW_VERBOSE" = true ]; then 228 | echo "Downloading from: $jarUrl" 229 | fi 230 | wrapperJarPath="$BASE_DIR/.mvn/wrapper/maven-wrapper.jar" 231 | if $cygwin; then 232 | wrapperJarPath=`cygpath --path --windows "$wrapperJarPath"` 233 | fi 234 | 235 | if command -v wget > /dev/null; then 236 | if [ "$MVNW_VERBOSE" = true ]; then 237 | echo "Found wget ... using wget" 238 | fi 239 | if [ -z "$MVNW_USERNAME" ] || [ -z "$MVNW_PASSWORD" ]; then 240 | wget "$jarUrl" -O "$wrapperJarPath" || rm -f "$wrapperJarPath" 241 | else 242 | wget --http-user=$MVNW_USERNAME --http-password=$MVNW_PASSWORD "$jarUrl" -O "$wrapperJarPath" || rm -f "$wrapperJarPath" 243 | fi 244 | elif command -v curl > /dev/null; then 245 | if [ "$MVNW_VERBOSE" = true ]; then 246 | echo "Found curl ... using curl" 247 | fi 248 | if [ -z "$MVNW_USERNAME" ] || [ -z "$MVNW_PASSWORD" ]; then 249 | curl -o "$wrapperJarPath" "$jarUrl" -f 250 | else 251 | curl --user $MVNW_USERNAME:$MVNW_PASSWORD -o "$wrapperJarPath" "$jarUrl" -f 252 | fi 253 | 254 | else 255 | if [ "$MVNW_VERBOSE" = true ]; then 256 | echo "Falling back to using Java to download" 257 | fi 258 | javaClass="$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.java" 259 | # For Cygwin, switch paths to Windows format before running javac 260 | if $cygwin; then 261 | javaClass=`cygpath --path --windows "$javaClass"` 262 | fi 263 | if [ -e "$javaClass" ]; then 264 | if [ ! -e "$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.class" ]; then 265 | if [ "$MVNW_VERBOSE" = true ]; then 266 | echo " - Compiling MavenWrapperDownloader.java ..." 267 | fi 268 | # Compiling the Java class 269 | ("$JAVA_HOME/bin/javac" "$javaClass") 270 | fi 271 | if [ -e "$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.class" ]; then 272 | # Running the downloader 273 | if [ "$MVNW_VERBOSE" = true ]; then 274 | echo " - Running MavenWrapperDownloader.java ..." 275 | fi 276 | ("$JAVA_HOME/bin/java" -cp .mvn/wrapper MavenWrapperDownloader "$MAVEN_PROJECTBASEDIR") 277 | fi 278 | fi 279 | fi 280 | fi 281 | ########################################################################################## 282 | # End of extension 283 | ########################################################################################## 284 | 285 | export MAVEN_PROJECTBASEDIR=${MAVEN_BASEDIR:-"$BASE_DIR"} 286 | if [ "$MVNW_VERBOSE" = true ]; then 287 | echo $MAVEN_PROJECTBASEDIR 288 | fi 289 | MAVEN_OPTS="$(concat_lines "$MAVEN_PROJECTBASEDIR/.mvn/jvm.config") $MAVEN_OPTS" 290 | 291 | # For Cygwin, switch paths to Windows format before running java 292 | if $cygwin; then 293 | [ -n "$M2_HOME" ] && 294 | M2_HOME=`cygpath --path --windows "$M2_HOME"` 295 | [ -n "$JAVA_HOME" ] && 296 | JAVA_HOME=`cygpath --path --windows "$JAVA_HOME"` 297 | [ -n "$CLASSPATH" ] && 298 | CLASSPATH=`cygpath --path --windows "$CLASSPATH"` 299 | [ -n "$MAVEN_PROJECTBASEDIR" ] && 300 | MAVEN_PROJECTBASEDIR=`cygpath --path --windows "$MAVEN_PROJECTBASEDIR"` 301 | fi 302 | 303 | # Provide a "standardized" way to retrieve the CLI args that will 304 | # work with both Windows and non-Windows executions. 305 | MAVEN_CMD_LINE_ARGS="$MAVEN_CONFIG $@" 306 | export MAVEN_CMD_LINE_ARGS 307 | 308 | WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain 309 | 310 | exec "$JAVACMD" \ 311 | $MAVEN_OPTS \ 312 | $MAVEN_DEBUG_OPTS \ 313 | -classpath "$MAVEN_PROJECTBASEDIR/.mvn/wrapper/maven-wrapper.jar" \ 314 | "-Dmaven.home=${M2_HOME}" \ 315 | "-Dmaven.multiModuleProjectDirectory=${MAVEN_PROJECTBASEDIR}" \ 316 | ${WRAPPER_LAUNCHER} $MAVEN_CONFIG "$@" 317 | -------------------------------------------------------------------------------- /src/main/webapp/pages/display/mycarts.jsp: -------------------------------------------------------------------------------- 1 | <%@page import="com.clothes.demo.models.customer.Address"%> 2 | <%@page import="java.util.Date"%> 3 | <%@page import="java.sql.Time"%> 4 | <%@page import="java.util.List"%> 5 | <%@page import="com.clothes.demo.dao.OrderItemDao"%> 6 | <%@page import="com.clothes.demo.models.orders.OrderItem"%> 7 | <%@page import="org.springframework.beans.factory.annotation.Autowired"%> 8 | <%@ page language="java" contentType="text/html; charset=ISO-8859-1" 9 | pageEncoding="ISO-8859-1"%> 10 | 11 | 12 | 13 | 14 | My Carts 15 | 16 | 17 | 18 | 19 | 20 | 21 | 54 | 55 | 56 | 57 | 58 | <% 59 | response.setHeader("Cache-Control", "no-cache, no-store, must-revalidate"); // this is for HTTP version 1.1 not work for lesser version 60 | response.setHeader("Pragma", "no-cache"); // this is for HTTP version 1.0 61 | response.setHeader("Expires", "0"); // this is for proxies server 62 | %> 63 | 64 | <%@include file="../navfooter/navbar.jsp"%> 65 | 66 | 67 | <% 68 | String error_message = (String)session.getAttribute("ERROR"); 69 | String success_message = (String)session.getAttribute("SUCCESS"); 70 | %> 71 | <% if(null != error_message){%> 72 | 76 | <% 77 | session.removeAttribute("ERROR"); 78 | }else if(null != success_message){ 79 | %> 80 | 84 | <% 85 | session.removeAttribute("SUCCESS"); 86 | } %> 87 | 88 |
89 | <% 90 | List carts = (List) request.getAttribute("carts"); 91 | Address customeraddress = (Address) request.getAttribute("customer_address"); 92 | %> 93 | 94 | <% 95 | if (carts.isEmpty()) { 96 | %> 97 | Empty Cart 98 | <% 99 | } else { 100 | %> 101 | 102 | 103 | <% 104 | int count = 0; 105 | int total_sum = 0; 106 | %> 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | <% 123 | for (OrderItem oi : carts) { 124 | %> 125 | <% 126 | Long itemid = oi.getId(); 127 | count++; 128 | String image = oi.getProduct().getProduct_image(); 129 | String productname = oi.getProduct().getProduct_name(); 130 | String desc = oi.getProduct().getProduct_description(); 131 | Double price = oi.getItem_price(); 132 | int quantity = oi.getQuentity(); 133 | Date date = oi.getOrder_item_date(); 134 | Time time = oi.getOrder_item_time(); 135 | String seller = oi.getProduct().getVendor().getVendor_shop_name(); 136 | String divid = "cart" + oi.getId(); 137 | 138 | total_sum += price*quantity; 139 | %> 140 | 141 | 142 | 143 | 144 | 145 | 146 | 147 | 148 | 149 | 150 | 185 | <% 186 | divid = "delete" + oi.getId(); 187 | %> 188 | 217 | 218 | 219 | <% 220 | } 221 | %> 222 |
No.PhotoNameDescriptionPriceQuantityItems CostDate/TimeSellerEdit?Delete?
<%=count%><%=productname%><%=productname%><%=desc%><%=price%> ₹<%=quantity%><%= price*quantity %> ₹<%=date%><%=seller%> 151 | 152 |
153 | 156 | 157 |
158 |
159 |
160 | × 163 |

Edit Quantity

164 |
165 |
166 |
167 |
171 | 172 | 173 | 174 |
175 |
176 | 179 |
180 |
181 |
182 |
183 |
184 |
189 | 190 |
191 | 194 | 195 |
196 |
197 |
198 | × 201 |

Are You Sure You Want To Delete This??

202 |
203 |
204 |
205 |
207 | 208 | 211 |
212 |
213 |
214 |
215 |
216 |
223 | 224 | <% 225 | if (null == customeraddress) { 226 | %> 227 |

228 | 229 |
230 | 233 | 234 |
235 |
236 |
237 | × 240 |

Add your Billing Address

241 |
242 |
243 |
244 |
245 | 246 | 247 | 248 | 249 | 250 | 251 | 252 | 253 | 254 | 255 |
256 |
257 | 260 |
261 |
262 |
263 |
264 |
265 | <% 266 | } else { 267 | String hno = customeraddress.getHouse_no(); 268 | String street = customeraddress.getStreet(); 269 | String city = customeraddress.getCity(); 270 | String district = customeraddress.getDistrict(); 271 | String state = customeraddress.getState(); 272 | String pincode = customeraddress.getPincode(); 273 | String currentadd = hno + ", " + street + ", " + city + ", " + district + ", " + state + ", " + pincode + "."; 274 | %> 275 |
276 |
277 | 280 | 281 |
282 |
283 |
284 | × 287 |

Edit your Billing Address

288 |
289 |
290 |
291 |
292 | 293 | 294 | 295 | 296 | 297 | 298 | 299 | 300 | 301 | 302 |
303 |
304 | 307 |
308 |
309 |
310 |
311 |
312 |
313 |

314 | Address :- 315 | <%=currentadd%> 316 |

317 |

Contact No. :- <%= customer.getCustomer_contact_number() %>

318 |
319 |

Total Cost :- <%= total_sum %> ₹

320 | 321 | 323 | <% 324 | session.setAttribute("total_cost", 0); 325 | session.setAttribute("total_cost", total_sum); 326 | %> 327 | <% 328 | } 329 | %> 330 | <% 331 | } 332 | %> 333 | 334 |
335 |
336 |
337 |
338 |
339 |
340 |
341 |
342 |
343 |
344 | <%@include file="../navfooter/footer.jsp"%> 345 | 346 | --------------------------------------------------------------------------------