├── .gitignore
├── Database
└── shopping.sql
├── LICENSE
├── README.md
└── Source
├── .classpath
├── .project
├── .settings
├── .jsdtscope
├── org.eclipse.core.resources.prefs
├── org.eclipse.jdt.core.prefs
├── org.eclipse.wst.common.component
├── org.eclipse.wst.common.project.facet.core.xml
├── org.eclipse.wst.jsdt.ui.superType.container
└── org.eclipse.wst.jsdt.ui.superType.name
├── WebContent
├── META-INF
│ └── MANIFEST.MF
├── WEB-INF
│ ├── taglib139.tld
│ └── web.xml
├── cart.jsp
├── category.jsp
├── css
│ ├── admin.css
│ ├── bootstrap.min.css
│ ├── cart.css
│ ├── category.css
│ ├── detail.css
│ ├── login.css
│ ├── main.css
│ ├── menu.css
│ ├── product.css
│ └── style.css
├── detail.jsp
├── footer.jsp
├── history.jsp
├── images
│ ├── 1.png
│ ├── 2.png
│ ├── 3.png
│ ├── 4.png
│ ├── 5.png
│ ├── 6.png
│ ├── 7.png
│ ├── arrow.png
│ ├── banner.jpg
│ ├── bg.png
│ ├── blog-icon.png
│ ├── contact-icon.png
│ ├── delete.png
│ ├── dot.png
│ ├── edit.png
│ ├── giohang.png
│ ├── home-icon.png
│ ├── icon-cart.png
│ ├── icon.png
│ ├── icon2.png
│ ├── image-icon.png
│ ├── into.png
│ ├── logout.png
│ ├── mail.png
│ ├── notepad-icon.png
│ ├── search-icon.png
│ ├── settings.png
│ ├── shirt-icon.png
│ ├── store-icon.png
│ ├── tick.png
│ ├── tip.png
│ ├── tip2.png
│ ├── tip3.png
│ ├── top-key.png
│ ├── top-lock.png
│ ├── top-note.png
│ ├── trash.gif
│ ├── update.png
│ ├── user.png
│ └── web-icon.png
├── index.jsp
├── login.jsp
├── product.jsp
├── register.jsp
├── resetpassword.jsp
├── sanpham
│ ├── dep.jpg
│ ├── icon-downprice.png
│ ├── icon-hot.png
│ ├── nam.jpg
│ ├── new.jpg
│ ├── non.jpg
│ ├── nostyle.jpg
│ ├── nu1.jpg
│ ├── nu2.jpg
│ ├── nu3.jpg
│ └── nu4.jpg
├── search_menu.jsp
├── search_page.jsp
└── update_user.jsp
└── src
├── controller
├── ConfirmServlet.java
├── GioHangServlet.java
├── LoginServlet.java
├── LogoutServlet.java
├── RegisterServlet.java
├── ResetPassword.java
├── SearchServlet.java
└── UpdateUser.java
├── dao
├── CategoryDAO.java
├── CategoryDAOImpl.java
├── DBConnect.java
├── HistoryDAO.java
├── HistoryDAOImpl.java
├── ProductDAO.java
├── ProductDAOImpl.java
├── UserDAO.java
└── UserDAOImpl.java
└── model
├── Cart.java
├── Category.java
├── History.java
├── Product.java
└── User.java
/.gitignore:
--------------------------------------------------------------------------------
1 | *.class
2 |
3 | # Mobile Tools for Java (J2ME)
4 | .mtj.tmp/
5 |
6 | # Package Files #
7 | *.jar
8 | *.war
9 | *.ear
10 |
11 | # virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
12 | hs_err_pid*
13 |
--------------------------------------------------------------------------------
/Database/shopping.sql:
--------------------------------------------------------------------------------
1 | /*
2 | Navicat MySQL Data Transfer
3 |
4 | Source Server : database
5 | Source Server Version : 50051
6 | Source Host : localhost:3306
7 | Source Database : shopping
8 |
9 | Target Server Type : MYSQL
10 | Target Server Version : 50051
11 | File Encoding : 65001
12 |
13 | Date: 2015-05-17 15:38:53
14 | */
15 |
16 | SET FOREIGN_KEY_CHECKS=0;
17 |
18 | -- ----------------------------
19 | -- Table structure for category
20 | -- ----------------------------
21 | DROP TABLE IF EXISTS `category`;
22 | CREATE TABLE `category` (
23 | `ma_the_loai` int(11) NOT NULL auto_increment,
24 | `ten_the_loai` varchar(255) collate utf8_unicode_ci default NULL,
25 | `mo_ta` varchar(255) collate utf8_unicode_ci default NULL,
26 | PRIMARY KEY (`ma_the_loai`)
27 | ) ENGINE=MyISAM AUTO_INCREMENT=9 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
28 |
29 | -- ----------------------------
30 | -- Records of category
31 | -- ----------------------------
32 | INSERT INTO `category` VALUES ('1', 'New', 'Quần áo mới thiết kế');
33 | INSERT INTO `category` VALUES ('2', 'Sale', 'Quần áo giảm giá');
34 | INSERT INTO `category` VALUES ('3', 'Style', 'Quần áo dạo phố');
35 | INSERT INTO `category` VALUES ('4', 'Nam', 'Thời trang nam');
36 | INSERT INTO `category` VALUES ('5', 'Nữ', 'Thời trang nữ');
37 | INSERT INTO `category` VALUES ('6', 'Dép', 'Dép thời trang');
38 | INSERT INTO `category` VALUES ('7', 'Nón', 'Nón thời trang');
39 |
40 | -- ----------------------------
41 | -- Table structure for history
42 | -- ----------------------------
43 | DROP TABLE IF EXISTS `history`;
44 | CREATE TABLE `history` (
45 | `id_history` int(11) NOT NULL auto_increment,
46 | `user_id` int(11) default NULL,
47 | `ma_san_pham` int(11) default NULL,
48 | `ngay_mua` timestamp NULL default NULL,
49 | `so_luong` int(11) default NULL,
50 | `thanh_tien` double default NULL,
51 | PRIMARY KEY (`id_history`),
52 | KEY `fk_history_product` USING BTREE (`ma_san_pham`),
53 | KEY `fk_history_user` USING BTREE (`user_id`)
54 | ) ENGINE=MyISAM AUTO_INCREMENT=9 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
55 |
56 | -- ----------------------------
57 | -- Records of history
58 | -- ----------------------------
59 | INSERT INTO `history` VALUES ('8', '13', '2', '2015-05-17 14:55:17', '1', '520000');
60 |
61 | -- ----------------------------
62 | -- Table structure for product
63 | -- ----------------------------
64 | DROP TABLE IF EXISTS `product`;
65 | CREATE TABLE `product` (
66 | `ma_san_pham` int(11) NOT NULL auto_increment,
67 | `ma_the_loai` int(11) default NULL,
68 | `ten_san_pham` varchar(255) collate utf8_unicode_ci default NULL,
69 | `hinh_anh` varchar(255) collate utf8_unicode_ci default NULL,
70 | `gia_ban` double default NULL,
71 | `hang_san_xuat` varchar(255) collate utf8_unicode_ci default NULL,
72 | `thong_tin` varchar(255) collate utf8_unicode_ci default NULL,
73 | PRIMARY KEY (`ma_san_pham`),
74 | KEY `fk_product_category` (`ma_the_loai`)
75 | ) ENGINE=MyISAM AUTO_INCREMENT=9 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
76 |
77 | -- ----------------------------
78 | -- Records of product
79 | -- ----------------------------
80 | INSERT INTO `product` VALUES ('1', '1', 'Áo khoát Adachi mới', 'new.jpg', '100000', 'Oron', 'Đang cập nhật');
81 | INSERT INTO `product` VALUES ('2', '2', 'Áo sale', 'nu1.jpg', '520000', 'Omo', 'Đang cập nhật');
82 | INSERT INTO `product` VALUES ('3', '3', 'Áo no style', 'nostyle.jpg', '520000', 'Mabu', 'Đang cập nhật');
83 | INSERT INTO `product` VALUES ('4', '4', 'Áo nam', 'nam.jpg', '520000', 'Lv', 'Đang cập nhật');
84 | INSERT INTO `product` VALUES ('5', '5', 'Áo nữ 2', 'nu2.jpg', '520000', 'Romano', 'Đang cập nhật');
85 | INSERT INTO `product` VALUES ('6', '6', 'Dép', 'dep.jpg', '520000', 'Bitis', 'Đang cập nhật');
86 | INSERT INTO `product` VALUES ('7', '7', 'Nón', 'non.jpg', '520000', 'Goku', 'Đang cập nhật');
87 |
88 | -- ----------------------------
89 | -- Table structure for user
90 | -- ----------------------------
91 | DROP TABLE IF EXISTS `user`;
92 | CREATE TABLE `user` (
93 | `user_id` int(11) NOT NULL auto_increment,
94 | `username` varchar(255) collate utf8_unicode_ci NOT NULL,
95 | `password` varchar(255) collate utf8_unicode_ci NOT NULL,
96 | `ngaysinh` date default NULL,
97 | `gioitinh` varchar(10) collate utf8_unicode_ci default NULL,
98 | `email` varchar(255) collate utf8_unicode_ci default NULL,
99 | `sdt` varchar(20) collate utf8_unicode_ci default NULL,
100 | `diachi` varchar(255) collate utf8_unicode_ci default NULL,
101 | `role` varchar(255) collate utf8_unicode_ci default NULL,
102 | PRIMARY KEY (`user_id`)
103 | ) ENGINE=MyISAM AUTO_INCREMENT=15 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
104 |
105 | -- ----------------------------
106 | -- Records of user
107 | -- ----------------------------
108 | INSERT INTO `user` VALUES ('13', 'test', 'test', '2015-05-04', 'Nam', 'manhduydl@gmail.com', '0962491151', 'hochiminh', '2');
109 | INSERT INTO `user` VALUES ('14', 'user2', '123', '2015-05-11', 'Nam', 'manhduydl@gmail.com', '0983435628', 'uhiiu', '2');
110 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | The MIT License (MIT)
2 |
3 | Copyright (c) 2015
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
23 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Shopping-web-Jsp-Servlet
2 | Course project use Jsp and Servlet to create Shopping website.
3 | Basic project, not use ajax. I'll update it.
4 |
--------------------------------------------------------------------------------
/Source/.classpath:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
--------------------------------------------------------------------------------
/Source/.project:
--------------------------------------------------------------------------------
1 |
2 |
3 | shop
4 |
5 |
6 |
7 |
8 |
9 | org.eclipse.wst.jsdt.core.javascriptValidator
10 |
11 |
12 |
13 |
14 | org.eclipse.jdt.core.javabuilder
15 |
16 |
17 |
18 |
19 | org.eclipse.wst.common.project.facet.core.builder
20 |
21 |
22 |
23 |
24 | org.eclipse.wst.validation.validationbuilder
25 |
26 |
27 |
28 |
29 |
30 | org.eclipse.jem.workbench.JavaEMFNature
31 | org.eclipse.wst.common.modulecore.ModuleCoreNature
32 | org.eclipse.wst.common.project.facet.core.nature
33 | org.eclipse.jdt.core.javanature
34 | org.eclipse.wst.jsdt.core.jsNature
35 |
36 |
37 |
--------------------------------------------------------------------------------
/Source/.settings/.jsdtscope:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/Source/.settings/org.eclipse.core.resources.prefs:
--------------------------------------------------------------------------------
1 | eclipse.preferences.version=1
2 | encoding//src/controller/ConfirmServlet.java=UTF-8
3 | encoding//src/controller/GioHangServlet.java=UTF-8
4 | encoding//src/controller/LoginServlet.java=UTF-8
5 | encoding//src/controller/RegisterServlet.java=UTF-8
6 | encoding//src/controller/ResetPassword.java=UTF-8
7 | encoding//src/controller/SearchServlet.java=UTF-8
8 | encoding//src/controller/UpdateUser.java=UTF-8
9 | encoding//src/dao/CategoryDAOImpl.java=UTF-8
10 | encoding//src/dao/HistoryDAO.java=UTF-8
11 |
--------------------------------------------------------------------------------
/Source/.settings/org.eclipse.jdt.core.prefs:
--------------------------------------------------------------------------------
1 | eclipse.preferences.version=1
2 | org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
3 | org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7
4 | org.eclipse.jdt.core.compiler.compliance=1.7
5 | org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
6 | org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
7 | org.eclipse.jdt.core.compiler.source=1.7
8 |
--------------------------------------------------------------------------------
/Source/.settings/org.eclipse.wst.common.component:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/Source/.settings/org.eclipse.wst.common.project.facet.core.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/Source/.settings/org.eclipse.wst.jsdt.ui.superType.container:
--------------------------------------------------------------------------------
1 | org.eclipse.wst.jsdt.launching.baseBrowserLibrary
--------------------------------------------------------------------------------
/Source/.settings/org.eclipse.wst.jsdt.ui.superType.name:
--------------------------------------------------------------------------------
1 | Window
--------------------------------------------------------------------------------
/Source/WebContent/META-INF/MANIFEST.MF:
--------------------------------------------------------------------------------
1 | Manifest-Version: 1.0
2 | Class-Path:
3 |
4 |
--------------------------------------------------------------------------------
/Source/WebContent/WEB-INF/taglib139.tld:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | 1.8
6 | 1.1
7 | Paging for data
8 | http://www.servletsuite.com/servlets/pager
9 | Paging for data
10 |
11 |
12 | paging
13 | com.cj.pager.pagingTag
14 | com.cj.pager.intVariable
15 | JSP
16 | splits data
17 |
18 |
19 | idPage
20 | false
21 | true
22 |
23 |
24 |
25 | url
26 | false
27 | true
28 |
29 |
30 |
31 | pageSize
32 | false
33 | true
34 |
35 |
36 |
37 | indexSize
38 | false
39 | true
40 |
41 |
42 |
43 | page
44 | false
45 | true
46 |
47 |
48 |
49 |
50 |
51 | item
52 | com.cj.pager.itemTag
53 | JSP
54 | defines an item
55 |
56 |
57 | invokeAll
58 | false
59 | true
60 |
61 |
62 |
63 |
64 |
65 | index
66 | com.cj.pager.indexTag
67 | JSP
68 | defines an index
69 |
70 |
71 | title
72 | false
73 | true
74 |
75 |
76 |
77 |
78 | title
79 | com.cj.pager.indexTitleTag
80 | JSP
81 | defines a title for index
82 |
83 |
84 |
85 |
86 | page
87 | com.cj.pager.pageTag
88 | com.cj.pager.intVariable1
89 | JSP
90 | defines a link for the page
91 |
92 |
93 |
94 | firstPage
95 | com.cj.pager.firstPageTag
96 | JSP
97 | defines a first page
98 |
99 |
100 |
101 | lastPage
102 | com.cj.pager.lastPageTag
103 | JSP
104 | defines a last page
105 |
106 |
107 |
108 | prevPages
109 | com.cj.pager.prevPagesTag
110 | com.cj.pager.intVariable1
111 | JSP
112 | defines a previous item
113 |
114 |
115 |
116 | nextPages
117 | com.cj.pager.nextPagesTag
118 | com.cj.pager.intVariable1
119 | JSP
120 | defines a next item
121 |
122 |
123 |
124 |
--------------------------------------------------------------------------------
/Source/WebContent/WEB-INF/web.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | shop
4 |
5 | index.html
6 | index.htm
7 | index.jsp
8 | default.html
9 | default.htm
10 | default.jsp
11 |
12 |
13 |
14 | RegisterServlet
15 | RegisterServlet
16 | controller.RegisterServlet
17 |
18 |
19 | RegisterServlet
20 | /RegisterServlet
21 |
22 |
23 |
24 | LoginServlet
25 | LoginServlet
26 | controller.LoginServlet
27 |
28 |
29 | LoginServlet
30 | /LoginServlet
31 |
32 |
33 |
34 | GioHangServlet
35 | GioHangServlet
36 | controller.GioHangServlet
37 |
38 |
39 | GioHangServlet
40 | /GioHangServlet
41 |
42 |
43 |
44 | ThemTheLoai
45 | ThemTheLoai
46 | controller.ThemTheLoai
47 |
48 |
49 | ThemTheLoai
50 | /ThemTheLoai
51 |
52 |
53 |
54 | SuaTheLoai
55 | SuaTheLoai
56 | controller.SuaTheLoai
57 |
58 |
59 | SuaTheLoai
60 | /SuaTheLoai
61 |
62 |
63 |
64 | XoaTheLoai
65 | XoaTheLoai
66 | controller.XoaTheLoai
67 |
68 |
69 | XoaTheLoai
70 | /XoaTheLoai
71 |
72 |
73 |
74 | LogoutServlet
75 | LogoutServlet
76 | controller.LogoutServlet
77 |
78 |
79 | LogoutServlet
80 | /LogoutServlet
81 |
82 |
83 |
84 | ResetPassword
85 | ResetPassword
86 | controller.ResetPassword
87 |
88 |
89 | ResetPassword
90 | /ResetPassword
91 |
92 |
93 |
94 | UpdateUser
95 | UpdateUser
96 | controller.UpdateUser
97 |
98 |
99 | UpdateUser
100 | /UpdateUser
101 |
102 |
103 |
104 | SearchServlet
105 | SearchServlet
106 | controller.SearchServlet
107 |
108 |
109 | SearchServlet
110 | /SearchServlet
111 |
112 |
113 |
114 | ConfirmServlet
115 | ConfirmServlet
116 | controller.ConfirmServlet
117 |
118 |
119 | ConfirmServlet
120 | /ConfirmServlet
121 |
122 |
--------------------------------------------------------------------------------
/Source/WebContent/cart.jsp:
--------------------------------------------------------------------------------
1 | <%@page import="model.Cart"%>
2 | <%@page import="java.util.List"%>
3 | <%@page import="dao.ProductDAOImpl"%>
4 | <%@page import="java.util.ArrayList"%>
5 | <%@page import="java.text.NumberFormat"%>
6 | <%@ page language="java" contentType="text/html; charset=UTF-8"
7 | pageEncoding="UTF-8"%>
8 |
9 |
10 |
11 |
12 | Giỏ hàng
13 |
14 |
15 |
16 |
17 |
59 |
60 |
61 | <%
62 | String username = null;
63 | Cookie[] cookies = request.getCookies();
64 | if(cookies !=null)
65 | {
66 | for(Cookie cookie : cookies)
67 | {
68 | if(cookie.getName().equals("username"))
69 | username = cookie.getValue();
70 | }
71 | }
72 | %>
73 |
74 |
75 |

76 |
77 |
78 |
90 |
91 |
92 |
93 |
94 |
176 |
177 |
178 |
179 |
180 |
181 |
--------------------------------------------------------------------------------
/Source/WebContent/category.jsp:
--------------------------------------------------------------------------------
1 | <%@page import="java.util.ArrayList"%>
2 | <%@page import="model.Category"%>
3 | <%@page import="java.util.List"%>
4 | <%@page import="dao.CategoryDAOImpl"%>
5 | <%@ page language="java" contentType="text/html; charset=UTF-8"
6 | pageEncoding="UTF-8"%>
7 |
8 |
9 |
10 |
11 | Menu dọc
12 |
13 |
14 |
15 | <%
16 | CategoryDAOImpl categoryDAO = new CategoryDAOImpl();
17 | List list = new ArrayList();
18 | list = categoryDAO.getList();
19 | %>
20 |
21 |
36 |
37 |
38 |
--------------------------------------------------------------------------------
/Source/WebContent/css/admin.css:
--------------------------------------------------------------------------------
1 | body{
2 | background-color:#ccd6da;
3 | font-family:Arial, Helvetica, sans-serif;
4 | padding:0;margin:0;
5 | font-size:12px;
6 | color:#000;
7 | }
8 | .clear{clear:both;}
9 | a{color:#0291d4; text-decoration:none;}
10 | a#closebt{ position:absolute; top:130px; left:208px; outline:none; z-index:999;}
11 | a#openbt{ position:absolute; top:130px; left:0px; outline:none; display:none;z-index:999;}
12 | a.button{-moz-border-radius:4px;-webkit-border-radius:4px;border-radius:4px;font-family:arial;font-size:12px;font-weight: bold;padding:8px 12px 8px 12px;text-align: center;cursor:pointer; margin:10px 10px 0 0; float:left;}
13 | .red{color:#fff;background: #eb8484;text-shadow:1px 1px #cc5959;}
14 | .green{color:#fff;background: #7dc44e;text-shadow:1px 1px #4c9021;}
15 | .red:hover{ background-color:#d96060;}
16 | .green:hover{ background-color:#69b736;}
17 |
18 | #panelwrap{width:1000px; margin:20px auto; background-color:#FFFFFF;-moz-border-radius:10px;-webkit-border-radius:10px;-khtml-border-radius:10px; border-radius:10px;border:6px #c0cdd2 solid;}
19 | #loginpanelwrap{width:500px; margin:120px auto auto auto; background-color:#FFFFFF;-moz-border-radius:10px;-webkit-border-radius:10px;-khtml-border-radius:10px; border-radius:10px;border:6px #c0cdd2 solid;}
20 |
21 | .header{ width:100%; height:auto;}
22 | .title{ font-size:26px; float:left; padding:25px 0 0 18px;}
23 | .title a{ color:#366082;font-family: 'Belgrano', serif;}
24 | .header_right{ float:right; padding:20px 20px 0 0;}
25 | .header_right a{ margin:0 0 0 5px; color:#000000; font-weight:bold;}
26 | .header_right a.settings{ background:url(images/settings.png) no-repeat left; padding:0 0 0 22px;}
27 | .header_right a.logout{background:url(images/logout.png) no-repeat left; padding:0 0 0 22px;}
28 | .center_content{clear:both; width:100%; padding:0 0 50px 0;}
29 |
30 | .loginheader{ width:100%; height:auto; text-align:center;}
31 | .logintitle{ font-size:26px; padding:25px 0 0 0px;}
32 | .logintitle a{ color:#366082;font-family: 'Belgrano', serif;}
33 |
34 | .menu{ float:left; clear:both; padding:27px 0 0 15px;}
35 | .menu ul{ padding:0px; margin:0px; list-style:none;}
36 | .menu ul li{ float:left; padding:0px; margin:0px; font-size:13px;}
37 | .menu ul li a{ display:block; float:left; background-color:#f3d987; padding:7px 12px 5px 12px; color:#000; text-decoration:none;
38 | margin:0 4px 0 0;
39 | -moz-border-radius-topleft:6px;-webkit-border-top-left-radius:6px;-khtml-border-top-left-radius:6px;border-top-left-radius:6px;
40 | -moz-border-radius-topright:6px;-webkit-border-top-right-radius:6px;-khtml-border-top-right-radius:6px;border-top-right-radius:6px;
41 | }
42 | .menu ul li a.selected{ display:block; float:left; background-color:#edcd66; padding:7px 12px 5px 12px; color:#000; text-decoration:none;
43 | margin:0 4px 0 0;
44 | -moz-border-radius-topleft:6px;-webkit-border-top-left-radius:6px;-khtml-border-top-left-radius:6px;border-top-left-radius:6px;
45 | -moz-border-radius-topright:6px;-webkit-border-top-right-radius:6px;-khtml-border-top-right-radius:6px;border-top-right-radius:6px;
46 | }
47 | .menu ul li a:hover{background-color:#edcd66;}
48 |
49 | .submenu{ width:100%; height:auto; background-color:#edcd66; clear:both; float:left;}
50 | .submenu ul{ padding:5px 0 5px 25px; margin:0px; list-style:none;}
51 | .submenu ul li{ float:left; padding:0px; margin:0px;}
52 | .submenu ul li a{ display:block; float:left; padding:3px 6px 3px 6px; color:#000; text-decoration:none;
53 | margin:5px 4px 10px 0;font-size:12px;}
54 | .submenu ul li a.selected{display:block; float:left; padding:3px 6px 3px 6px; color:#FFFFFF; text-decoration:none;
55 | margin:5px 4px 8px 0;color:#FFFFFF; font-size:12px; background-color:#366082;
56 | -moz-border-radius:5px;-webkit-border-radius:5px;-khtml-border-radius:5px;border-radius:5px;
57 | }
58 | .submenu ul li a:hover{background-color:#366082; color:#FFFFFF;
59 | -moz-border-radius:5px;-webkit-border-radius:5px;-khtml-border-radius:5px;border-radius:5px;
60 | }
61 |
62 |
63 | .sidebar{
64 | width:222px;
65 | float:left;margin-left: -100%;
66 | padding:0px 0 0 0px;
67 | position:relative;
68 | left:0px;
69 | }
70 | .sidebar h2{
71 | width:187px; margin:10px 10px 0 10px;
72 | -moz-border-radius-topleft:6px;-webkit-border-top-left-radius:6px;-khtml-border-top-left-radius:6px;border-top-left-radius:6px;
73 | -moz-border-radius-topright:6px;-webkit-border-top-right-radius:6px;-khtml-border-top-right-radius:6px;border-top-right-radius:6px;
74 | background-color:#bad7e6; color:#22425e; font-size:14px; font-weight:bold; padding:10px 0 10px 15px; text-shadow:1px 1px #DCEEF7;
75 | border-bottom:1px #8A9296 solid;
76 | }
77 | .sidebar ul{
78 | background-color:#FFFFFF; list-style:none;
79 | width:170px; border:1px #D6D6D6 solid; border-top:none;
80 | padding:10px 15px 15px 15px; margin:0px 0 15px 10px;
81 | -moz-border-radius-bottomleft:6px;-webkit-border-bottom-left-radius:6px;-khtml-border-bottom-left-radius:6px;border-bottom-left-radius:6px;
82 | -moz-border-radius-bottomright:6px;-webkit-border-bottom-right-radius:6px;-khtml-border-bottom-right-radius:6px;border-bottom-right-radius:6px;
83 | }
84 | .sidebar ul li{
85 | border-bottom:1px #ededed solid;
86 | }
87 | .sidebar ul li a{
88 | color:#000000; display:block;padding:5px 0 5px 5px;
89 | }
90 | .sidebar ul li a:hover{
91 | background-color:#ededed;
92 | }
93 | .sidebar_section_text{
94 | background-color:#FFFFFF;
95 | width:170px; border:1px #D6D6D6 solid; border-top:none;
96 | padding:10px 15px 15px 15px; margin:0px 0 15px 10px;
97 | -moz-border-radius-bottomleft:6px;-webkit-border-bottom-left-radius:6px;-khtml-border-bottom-left-radius:6px;border-bottom-left-radius:6px;
98 | -moz-border-radius-bottomright:6px;-webkit-border-bottom-right-radius:6px;-khtml-border-bottom-right-radius:6px;border-bottom-right-radius:6px;}
99 |
100 | #right_wrap{
101 | float: left;
102 | width: 100%;
103 | }
104 | #right_content{
105 | margin:10px 10px 10px 232px;
106 | }
107 | .form_sub_buttons{ padding:0 0 20px 0; float:left;}
108 | #right_content h2{ background-color:#bad7e6;
109 | margin:0px; clear:both;
110 | -moz-border-radius-topleft:6px;-webkit-border-top-left-radius:6px;-khtml-border-top-left-radius:6px;border-top-left-radius:6px;
111 | -moz-border-radius-topright:6px;-webkit-border-top-right-radius:6px;-khtml-border-top-right-radius:6px;border-top-right-radius:6px;
112 | color:#22425e; font-size:14px; font-weight:bold; padding:10px 0 10px 15px; text-shadow:1px 1px #DCEEF7;
113 | border-bottom:1px #ABC7D6 solid;
114 | }
115 |
116 |
117 | #rounded-corner
118 | {
119 | margin:0px;
120 | width:100%;
121 | text-align: left;
122 | border-collapse: collapse;
123 | }
124 | #rounded-corner th
125 | {
126 | padding: 8px;
127 | font-weight: bold;
128 | font-size:12px;
129 | color: #535E66;
130 | background: #dde8f0; text-shadow:1px 1px #F2F8FC;
131 | }
132 | #rounded-corner tr.odd td
133 | {
134 | padding: 8px;
135 | background: #f4f9fd;
136 | border-top: 1px solid #fff;
137 | color: #669;
138 | }
139 | #rounded-corner tr.even td
140 | {
141 | padding: 8px;
142 | background: #fcfdfe;
143 | border-top: 1px solid #fff;
144 | color: #669;
145 | }
146 | #rounded-corner tfoot td
147 | {
148 | background: #dde8f0; font-size:11px;padding:8px 8px 8px 15px;
149 | -moz-border-radius-bottomleft:6px;-webkit-border-bottom-left-radius:6px;-khtml-border-bottom-left-radius:6px;border-bottom-left-radius:6px;
150 | -moz-border-radius-bottomright:6px;-webkit-border-bottom-right-radius:6px;-khtml-border-bottom-right-radius:6px;border-bottom-right-radius:6px;
151 | }
152 | #rounded-corner tbody tr:hover td
153 | {
154 | background: #dde8f0;
155 | }
156 |
157 | /* Toggle
158 | /*------------------------------------------*/
159 | .toogle_wrap{background-color:#bad7e6;
160 | margin:0px; clear:both;
161 | -moz-border-radius:5px;-webkit-border-radius:5px;-khtml-border-radius:5px;border-radius:5px;
162 | color:#22425e; font-size:14px; font-weight:bold; padding:10px 0 10px 15px; text-shadow:1px 1px #DCEEF7;}
163 | .trigger{padding:0px;margin:0;}
164 | .trigger a{color:#22425e; font-size:14px; font-weight:bold; padding:5px 0 5px 0; text-shadow:1px 1px #DCEEF7;text-decoration: none;display: block; }
165 | .active {}
166 | .trigger a:hover, .trigger a:hover:focus{}
167 | .toggle_container{overflow: hidden;padding:0px 10px 0 0;clear: both; font-size:12px; font-weight:normal; line-height:20px;}
168 |
169 | /* Tabs
170 | /*------------------------------------------*/
171 | ul.tabsmenu{ padding:15px 0 0 0;clear:both; list-style:none; margin:0px;}
172 | ul.tabsmenu li a{ width:auto; float:left; margin:0 5px 0 0;text-align:center;
173 | background-color:#bad7e6;
174 | -moz-border-radius-topleft:6px;-webkit-border-top-left-radius:6px;-khtml-border-top-left-radius:6px;border-top-left-radius:6px;
175 | -moz-border-radius-topright:6px;-webkit-border-top-right-radius:6px;-khtml-border-top-right-radius:6px;border-top-right-radius:6px;
176 | color:#22425e; font-size:14px; font-weight:bold; padding:10px 15px; text-shadow:1px 1px #DCEEF7;
177 | }
178 | ul.tabsmenu li.active a{ background-color:#a8c9da;}
179 | ul.tabsmenu li a:hover{background-color:#a8c9da;}
180 | .tabcontent{ padding:10px; clear:both; border:1px #ddd solid; margin:0 0 15px 0;
181 | -moz-border-radius-bottomleft:5px;-webkit-border-bottom-left-radius:5px;-khtml-border-bottom-left-radius:5px;border-bottom-left-radius:5px;
182 | -moz-border-radius-bottomright:5px;-webkit-border-bottom-right-radius:5px;-khtml-border-bottom-right-radius:5px;border-bottom-right-radius:5px;
183 | }
184 | /*-------------------------------------form-------------------------------------*/
185 | .form{padding:20px;}
186 | .form_row{width:610px;float:left;clear:both;margin:0 0 10px 0;}
187 | .form_row label{width:100px;float:left;padding:5px 0 0px 0;font-size:12px; color:#535E66; font-weight:bold; text-shadow:1px 1px #fff; text-align:left;}
188 | .form_input{width:500px;height:34px;float:left;padding:0px 0px 0 4px; background-color:#F4F6F7; border:1px #90A9B7 solid; color:#000;-moz-border-radius:4px;-webkit-border-radius:4px;border-radius:4px;}
189 | select.form_select{width:506px;height:37px;float:left;padding:8px 5px 8px 4px; background-color:#F4F6F7; border:1px #90A9B7 solid; color:#000;-moz-border-radius:4px;-webkit-border-radius:4px;border-radius:4px;}
190 | .form_textarea{width:500px;height:100px;float:left;padding:3px 0px 0 4px; background-color:#F4F6F7; border:1px #90A9B7 solid; color:#000; font-family:Arial, Helvetica, sans-serif; font-size:12px;-moz-border-radius:4px;-webkit-border-radius:4px;border-radius:4px;}
191 | input.form_submit{float:right; clear:both; margin:0px 5px 0 0px;color:#fff;background: #7dc44e;-moz-border-radius:4px;-webkit-border-radius:4px;border-radius:4px;font-family:arial;font-size:12px;font-weight: bold;padding:8px 15px;text-align: center;cursor:pointer; border:none;text-shadow:1px 1px #4c9021;}
192 |
193 | .loginform{padding:20px;}
194 | .loginform_row{width:460px;float:left;clear:both;margin:0 0 10px 0;}
195 | .loginform_row label{width:100px;float:left;padding:5px 0 0px 0;font-size:12px; color:#535E66; font-weight:bold; text-shadow:1px 1px #fff; text-align:left;}
196 | .loginform_input{width:350px;height:34px;float:left;padding:0px 0px 0 4px; background-color:#F4F6F7; border:1px #90A9B7 solid; color:#000;-moz-border-radius:4px;-webkit-border-radius:4px;border-radius:4px;}
197 | input.loginform_submit{float:right; clear:both; margin:0px 5px 0 0px;color:#fff;background: #7dc44e;-moz-border-radius:4px;-webkit-border-radius:4px;border-radius:4px;font-family:arial;font-size:12px;font-weight: bold;padding:8px 15px;text-align: center;cursor:pointer; border:none;text-shadow:1px 1px #4c9021;}
198 |
199 | .footer{height:50px;background-color:#e4e3e0; border-top:1px #fff solid; line-height:50px; padding:0 0 0 20px;}
--------------------------------------------------------------------------------
/Source/WebContent/css/cart.css:
--------------------------------------------------------------------------------
1 | .shopping-cart{
2 | width: 90%;
3 | text-align: center;
4 | margin-left: 50px;
5 | }
6 | .product-image {
7 | float: left;
8 | width: 20%;
9 | }
10 |
11 | .product-details {
12 | float: left;
13 | width: 30%;
14 | }
15 |
16 | .product-price {
17 | float: left;
18 | text-align: center;
19 | width: 18%;
20 | padding-right: 25px;
21 | }
22 |
23 | .product-quantity {
24 | float: left;
25 | width: 13%;
26 | text-align: center;
27 | }
28 |
29 | .product-removal {
30 | float: left;
31 | width: 12%;
32 | }
33 |
34 | .product-line-price {
35 | float: left;
36 | width: 16%;
37 | text-align: center;
38 | }
39 |
40 | /* This is used as the traditional .clearfix class */
41 | .group:before,.shopping-cart:before,.column-labels:before,.product:before,.totals-item:before,.group:after,.shopping-cart:after,.column-labels:after,.product:after,.totals-item:after
42 | {
43 | content: '';
44 | display: table;
45 | }
46 |
47 | .group:after,.shopping-cart:after,.column-labels:after,.product:after,.totals-item:after
48 | {
49 | clear: both;
50 | }
51 |
52 | .group,.shopping-cart,.column-labels,.product,.totals-item {
53 | zoom: 1;
54 | }
55 |
56 | /* Apply clearfix in a few places */
57 | /* Apply dollar signs */
58 | .product .product-price:before,.product .product-line-price:before,.totals-value:before
59 | {
60 | content: '';
61 | }
62 |
63 | /* Body/Header stuff */
64 | body {
65 | padding: 0px 30px 30px 20px;
66 | font-family: "HelveticaNeue-Light", "Helvetica Neue Light",
67 | "Helvetica Neue", Helvetica, Arial, sans-serif;
68 | font-weight: 100;
69 | }
70 |
71 | h1 {
72 | font-weight: 100;
73 | }
74 |
75 | label {
76 | color: #aaa;
77 | }
78 |
79 | .shopping-cart {
80 | margin-top: 25px;
81 | }
82 |
83 | /* Column headers */
84 | .column-labels label {
85 | padding-bottom: 15px;
86 | margin-bottom: 15px;
87 | border-bottom: 1px solid #eee;
88 | }
89 |
90 | .column-labels .product-image,.column-labels .product-details,.column-labels .product-removal
91 | {
92 |
93 | }
94 |
95 | /* Product entries */
96 | .product {
97 | margin-bottom: 20px;
98 | padding-bottom: 10px;
99 | border-bottom: 1px solid #eee;
100 | }
101 |
102 | .product .product-image {
103 | text-align: center;
104 | }
105 |
106 | .product .product-image img {
107 | width: 100px;
108 | }
109 |
110 | .product .product-details .product-title {
111 | margin-right: 20px;
112 | font-family: "HelveticaNeue-Medium", "Helvetica Neue Medium";
113 | }
114 |
115 | .product .product-details .product-description {
116 | margin: 5px 20px 5px 0;
117 | line-height: 1.4em;
118 | }
119 |
120 | .product .product-quantity input {
121 | width: 50px;
122 | }
123 |
124 | .product .remove-product {
125 | border: 0;
126 | padding: 4px 8px;
127 | background-color: #c66;
128 | color: #fff;
129 | font-family: "HelveticaNeue-Medium", "Helvetica Neue Medium";
130 | font-size: 12px;
131 | border-radius: 3px;
132 | }
133 |
134 | .product .remove-product:hover {
135 | background-color: #a44;
136 | }
137 |
138 | /* Totals section */
139 | .totals .totals-item {
140 | float: right;
141 | clear: both;
142 | width: 100%;
143 | margin-bottom: 10px;
144 | }
145 |
146 | .totals .totals-item label {
147 | float: left;
148 | clear: both;
149 | width: 79%;
150 | text-align: right;
151 | }
152 |
153 | .totals .totals-item .totals-value {
154 | float: right;
155 | width: 21%;
156 | text-align: right;
157 | }
158 |
159 | .totals .totals-item-total {
160 | font-family: "HelveticaNeue-Medium", "Helvetica Neue Medium";
161 | }
162 |
163 | .checkout {
164 | float: right;
165 | border: 0;
166 | margin-top: 20px;
167 | margin-right: 20px;
168 | padding: 6px 25px;
169 | background-color: #6b6;
170 | color: #fff;
171 | font-size: 25px;
172 | border-radius: 3px;
173 | margin-bottom: 15px;
174 | }
175 |
176 | .checkout:hover {
177 | background-color: #494;
178 | }
179 |
180 | /* Make adjustments for tablet */
181 | @media screen and (max-width: 650px) {
182 | .shopping-cart {
183 | margin: 0;
184 | padding-top: 20px;
185 | border-top: 1px solid #eee;
186 | }
187 | .column-labels {
188 | display: none;
189 | }
190 | .product-image {
191 | float: right;
192 | width: auto;
193 | }
194 | .product-image img {
195 | margin: 0 0 10px 10px;
196 | }
197 | .product-details {
198 | float: none;
199 | margin-bottom: 10px;
200 | width: auto;
201 | }
202 | .product-price {
203 | clear: both;
204 | width: 70px;
205 | }
206 | .product-quantity {
207 | width: 100px;
208 | }
209 | .product-quantity input {
210 | margin-left: 20px;
211 | }
212 | .product-quantity:before {
213 | content: 'x';
214 | }
215 | .product-removal {
216 | width: auto;
217 | }
218 | .product-line-price {
219 | float: right;
220 | width: 70px;
221 | }
222 | }
223 | /* Make more adjustments for phone */
224 | @media screen and (max-width: 350px) {
225 | .product-removal {
226 | float: right;
227 | }
228 | .product-line-price {
229 | float: right;
230 | clear: left;
231 | width: auto;
232 | margin-top: 10px;
233 | }
234 | .product .product-line-price:before {
235 | content: 'Item Total: $';
236 | }
237 | .totals .totals-item label {
238 | width: 60%;
239 | }
240 | .totals .totals-item .totals-value {
241 | width: 40%;
242 | }
243 | }
--------------------------------------------------------------------------------
/Source/WebContent/css/category.css:
--------------------------------------------------------------------------------
1 | .clearfix:before,.clearfix:after {
2 | content: " ";
3 | display: table;
4 | }
5 |
6 | .clearfix:after {
7 | clear: both;
8 | }
9 |
10 | .clearfix {
11 | *zoom: 1;
12 | }
13 |
14 | .container {
15 | position: relative;
16 | margin: 0px auto;
17 | padding: 0px 0;
18 | clear: both;
19 | }
20 |
21 | @media only screen and (min-width: 1200px) {
22 | .container {
23 | width: 1210px;
24 | }
25 | }
26 |
27 | @media only screen and (min-width: 960px) and (max-width: 1199px) {
28 | .container {
29 | width: 1030px;
30 | }
31 | }
32 |
33 | @media only screen and (min-width: 768px) and (max-width: 959px) {
34 | .container {
35 | width: 682px;
36 | }
37 | }
38 |
39 | @media only screen and (min-width: 480px) and (max-width: 767px) {
40 | .container {
41 | width: 428px;
42 | margin: 0 auto;
43 | }
44 | }
45 |
46 | @media only screen and (max-width: 479px) {
47 | .container {
48 | width: 320px;
49 | margin: 0 auto;
50 | }
51 | }
52 |
53 | .mcd-menu {
54 | list-style: none;
55 | padding: 0;
56 | margin: 0;
57 | /*height: 100px;*/
58 | border-radius: 2px;
59 | -moz-border-radius: 2px;
60 | -webkit-border-radius: 2px;
61 | /* == */
62 | width: 250px;
63 | /* == */
64 | }
65 |
66 | .mcd-menu li {
67 | position: relative;
68 | /*float:left;*/
69 | }
70 |
71 | .mcd-menu li a {
72 | display: block;
73 | text-decoration: none;
74 | padding: 12px 20px;
75 | color: #777;
76 | /*text-align: center;
77 | border-right: 1px solid #E7E7E7;*/
78 | /* == */
79 | text-align: left;
80 | height: 36px;
81 | position: relative;
82 | border-bottom: 1px solid #EEE;
83 | /* == */
84 | }
85 |
86 | .mcd-menu li a i {
87 | /*display: block;
88 | font-size: 30px;
89 | margin-bottom: 10px;*/
90 | /* == */
91 | float: left;
92 | font-size: 20px;
93 | margin: 0 10px 0 0;
94 | /* == */
95 | }
96 | /* == */
97 | .mcd-menu li a p {
98 | float: left;
99 | margin: 0;
100 | }
101 | /* == */
102 | .mcd-menu li a strong {
103 | display: block;
104 | text-transform: uppercase;
105 | }
106 |
107 | .mcd-menu li a small {
108 | display: block;
109 | font-size: 10px;
110 | }
111 |
112 | .mcd-menu li a i,.mcd-menu li a strong,.mcd-menu li a small {
113 | position: relative;
114 | transition: all 300ms linear;
115 | -o-transition: all 300ms linear;
116 | -ms-transition: all 300ms linear;
117 | -moz-transition: all 300ms linear;
118 | -webkit-transition: all 300ms linear;
119 | }
120 |
121 | .mcd-menu li:hover>a i {
122 | opacity: 1;
123 | -webkit-animation: moveFromTop 300ms ease-in-out;
124 | -moz-animation: moveFromTop 300ms ease-in-out;
125 | -ms-animation: moveFromTop 300ms ease-in-out;
126 | -o-animation: moveFromTop 300ms ease-in-out;
127 | animation: moveFromTop 300ms ease-in-out;
128 | }
129 |
130 | .mcd-menu li:hover a strong {
131 | opacity: 1;
132 | -webkit-animation: moveFromLeft 300ms ease-in-out;
133 | -moz-animation: moveFromLeft 300ms ease-in-out;
134 | -ms-animation: moveFromLeft 300ms ease-in-out;
135 | -o-animation: moveFromLeft 300ms ease-in-out;
136 | animation: moveFromLeft 300ms ease-in-out;
137 | }
138 |
139 | .mcd-menu li:hover a small {
140 | opacity: 1;
141 | -webkit-animation: moveFromRight 300ms ease-in-out;
142 | -moz-animation: moveFromRight 300ms ease-in-out;
143 | -ms-animation: moveFromRight 300ms ease-in-out;
144 | -o-animation: moveFromRight 300ms ease-in-out;
145 | animation: moveFromRight 300ms ease-in-out;
146 | }
147 |
148 | .mcd-menu li:hover>a {
149 | color: #e67e22;
150 | }
151 |
152 | .mcd-menu li a.active {
153 | position: relative;
154 | color: #e67e22;
155 | border: 0;
156 | /*border-top: 4px solid #e67e22;
157 | border-bottom: 4px solid #e67e22;
158 | margin-top: -4px;*/
159 | box-shadow: 0 0 5px #DDD;
160 | -moz-box-shadow: 0 0 5px #DDD;
161 | -webkit-box-shadow: 0 0 5px #DDD;
162 | /* == */
163 | border-left: 4px solid #e67e22;
164 | border-right: 4px solid #e67e22;
165 | margin: 0 -4px;
166 | /* == */
167 | }
168 |
169 | .mcd-menu li a.active:before {
170 | content: "";
171 | position: absolute;
172 | /*top: 0;
173 | left: 45%;
174 | border-top: 5px solid #e67e22;
175 | border-left: 5px solid transparent;
176 | border-right: 5px solid transparent;*/
177 | /* == */
178 | top: 42%;
179 | left: 0;
180 | border-left: 5px solid #e67e22;
181 | border-top: 5px solid transparent;
182 | border-bottom: 5px solid transparent;
183 | /* == */
184 | }
185 |
186 | /* == */
187 | .mcd-menu li a.active:after {
188 | content: "";
189 | position: absolute;
190 | top: 42%;
191 | right: 0;
192 | border-right: 5px solid #e67e22;
193 | border-top: 5px solid transparent;
194 | border-bottom: 5px solid transparent;
195 | }
196 | /* == */
197 | @
198 | -webkit-keyframes moveFromTop {from { opacity:0;
199 | -webkit-transform: translateY(200%);
200 | -moz-transform: translateY(200%);
201 | -ms-transform: translateY(200%);
202 | -o-transform: translateY(200%);
203 | transform: translateY(200%);
204 | }
205 |
206 | to {
207 | opacity: 1;
208 | -webkit-transform: translateY(0%);
209 | -moz-transform: translateY(0%);
210 | -ms-transform: translateY(0%);
211 | -o-transform: translateY(0%);
212 | transform: translateY(0%);
213 | }
214 |
215 | }
216 | @
217 | -webkit-keyframes moveFromLeft {from { opacity:0;
218 | -webkit-transform: translateX(200%);
219 | -moz-transform: translateX(200%);
220 | -ms-transform: translateX(200%);
221 | -o-transform: translateX(200%);
222 | transform: translateX(200%);
223 | }
224 |
225 | to {
226 | opacity: 1;
227 | -webkit-transform: translateX(0%);
228 | -moz-transform: translateX(0%);
229 | -ms-transform: translateX(0%);
230 | -o-transform: translateX(0%);
231 | transform: translateX(0%);
232 | }
233 |
234 | }
235 | @
236 | -webkit-keyframes moveFromRight {from { opacity:0;
237 | -webkit-transform: translateX(-200%);
238 | -moz-transform: translateX(-200%);
239 | -ms-transform: translateX(-200%);
240 | -o-transform: translateX(-200%);
241 | transform: translateX(-200%);
242 | }
243 |
244 | to {
245 | opacity: 1;
246 | -webkit-transform: translateX(0%);
247 | -moz-transform: translateX(0%);
248 | -ms-transform: translateX(0%);
249 | -o-transform: translateX(0%);
250 | transform: translateX(0%);
251 | }
252 |
253 | }
254 | .mcd-menu li ul,.mcd-menu li ul li ul {
255 | position: absolute;
256 | height: auto;
257 | min-width: 200px;
258 | padding: 0;
259 | margin: 0;
260 | background: #FFF;
261 | /*border-top: 4px solid #e67e22;*/
262 | opacity: 0;
263 | visibility: hidden;
264 | transition: all 300ms linear;
265 | -o-transition: all 300ms linear;
266 | -ms-transition: all 300ms linear;
267 | -moz-transition: all 300ms linear;
268 | -webkit-transition: all 300ms linear;
269 | /*top: 130px;*/
270 | z-index: 1000;
271 | /* == */
272 | left: 280px;
273 | top: 0px;
274 | border-left: 4px solid #e67e22;
275 | /* == */
276 | }
277 |
278 | .mcd-menu li ul:before {
279 | content: "";
280 | position: absolute;
281 | /*top: -8px;
282 | left: 23%;
283 | border-bottom: 5px solid #e67e22;
284 | border-left: 5px solid transparent;
285 | border-right: 5px solid transparent;*/
286 | /* == */
287 | top: 25px;
288 | left: -9px;
289 | border-right: 5px solid #e67e22;
290 | border-bottom: 5px solid transparent;
291 | border-top: 5px solid transparent;
292 | /* == */
293 | }
294 |
295 | .mcd-menu li:hover>ul,.mcd-menu li ul li:hover>ul {
296 | display: block;
297 | opacity: 1;
298 | visibility: visible;
299 | /*top: 100px;*/
300 | /* == */
301 | left: 250px;
302 | /* == */
303 | }
304 | /*.mcd-menu li ul li {
305 | float: none;
306 | }*/
307 | .mcd-menu li ul li a {
308 | padding: 10px;
309 | text-align: left;
310 | border: 0;
311 | border-bottom: 1px solid #EEE;
312 | /* == */
313 | height: auto;
314 | /* == */
315 | }
316 |
317 | .mcd-menu li ul li a i {
318 | font-size: 16px;
319 | display: inline-block;
320 | margin: 0 10px 0 0;
321 | }
322 |
323 | .mcd-menu li ul li ul {
324 | left: 230px;
325 | top: 0;
326 | border: 0;
327 | border-left: 4px solid #e67e22;
328 | }
329 |
330 | .mcd-menu li ul li ul:before {
331 | content: "";
332 | position: absolute;
333 | top: 15px;
334 | /*left: -14px;*/
335 | /* == */
336 | left: -9px;
337 | /* == */
338 | border-right: 5px solid #e67e22;
339 | border-bottom: 5px solid transparent;
340 | border-top: 5px solid transparent;
341 | }
342 |
343 | .mcd-menu li ul li:hover>ul {
344 | top: 0px;
345 | left: 200px;
346 | }
347 |
348 | /*.mcd-menu li.float {
349 | float: right;
350 | }*/
351 | .mcd-menu li a.search {
352 | /*padding: 29px 20px 30px 10px;*/
353 | padding: 10px 10px 15px 10px;
354 | clear: both;
355 | }
356 |
357 | .mcd-menu li a.search i {
358 | margin: 0;
359 | display: inline-block;
360 | font-size: 18px;
361 | }
362 |
363 | .mcd-menu li a.search input {
364 | border: 1px solid #EEE;
365 | padding: 10px;
366 | background: #FFF;
367 | outline: none;
368 | color: #777;
369 | /* == */
370 | width: 170px;
371 | float: left;
372 | /* == */
373 | }
374 |
375 | .mcd-menu li a.search button {
376 | border: 1px solid #e67e22;
377 | /*padding: 10px;*/
378 | background: #e67e22;
379 | outline: none;
380 | color: #FFF;
381 | margin-left: -4px;
382 | /* == */
383 | float: left;
384 | padding: 10px 10px 11px 10px;
385 | /* == */
386 | }
387 |
388 | .mcd-menu li a.search input:focus {
389 | border: 1px solid #e67e22;
390 | }
391 |
392 | .search-mobile {
393 | display: none !important;
394 | background: #e67e22;
395 | border-left: 1px solid #e67e22;
396 | border-radius: 0 3px 3px 0;
397 | }
398 |
399 | .search-mobile i {
400 | color: #FFF;
401 | margin: 0 !important;
402 | }
403 |
404 | @media only screen and (min-width: 960px) and (max-width: 1199px) {
405 | .mcd-menu {
406 | margin-left: 10px;
407 | }
408 | }
409 |
410 | @media only screen and (min-width: 768px) and (max-width: 959px) {
411 | .mcd-menu {
412 | width: 200px;
413 | }
414 | .mcd-menu li a {
415 | height: 30px;
416 | }
417 | .mcd-menu li a i {
418 | font-size: 22px;
419 | }
420 | .mcd-menu li a strong {
421 | font-size: 12px;
422 | }
423 | .mcd-menu li a small {
424 | font-size: 10px;
425 | }
426 | .mcd-menu li a.search input {
427 | width: 120px;
428 | font-size: 12px;
429 | }
430 | .mcd-menu li a.search buton {
431 | padding: 8px 10px 9px 10px;
432 | }
433 | .mcd-menu li>ul {
434 | min-width: 180px;
435 | }
436 | .mcd-menu li:hover>ul {
437 | min-width: 180px;
438 | left: 200px;
439 | }
440 | .mcd-menu li ul li>ul,.mcd-menu li ul li ul li>ul {
441 | min-width: 150px;
442 | }
443 | .mcd-menu li ul li:hover>ul {
444 | left: 180px;
445 | min-width: 150px;
446 | }
447 | .mcd-menu li ul li ul li:hover>ul {
448 | left: 150px;
449 | min-width: 150px;
450 | }
451 | .mcd-menu li ul a {
452 | font-size: 12px;
453 | }
454 | .mcd-menu li ul a i {
455 | font-size: 14px;
456 | }
457 | }
458 |
459 | @media only screen and (min-width: 480px) and (max-width: 767px) {
460 | .mcd-menu {
461 | width: 50px;
462 | }
463 | .mcd-menu li a {
464 | position: relative;
465 | padding: 12px 16px;
466 | height: 20px;
467 | }
468 | .mcd-menu li a small {
469 | display: none;
470 | }
471 | .mcd-menu li a strong {
472 | display: none;
473 | }
474 | .mcd-menu li a:hover strong,.mcd-menu li a.active strong {
475 | display: block;
476 | font-size: 10px;
477 | padding: 3px 0;
478 | position: absolute;
479 | bottom: 0px;
480 | left: 0;
481 | background: #e67e22;
482 | color: #FFF;
483 | min-width: 100%;
484 | text-transform: lowercase;
485 | font-weight: normal;
486 | text-align: center;
487 | }
488 | .mcd-menu li .search {
489 | display: none;
490 | }
491 | .mcd-menu li>ul {
492 | min-width: 180px;
493 | left: 70px;
494 | }
495 | .mcd-menu li:hover>ul {
496 | min-width: 180px;
497 | left: 50px;
498 | }
499 | .mcd-menu li ul li>ul,.mcd-menu li ul li ul li>ul {
500 | min-width: 150px;
501 | }
502 | .mcd-menu li ul li:hover>ul {
503 | left: 180px;
504 | min-width: 150px;
505 | }
506 | .mcd-menu li ul li ul li>ul {
507 | left: 35px;
508 | top: 45px;
509 | border: 0;
510 | border-top: 4px solid #e67e22;
511 | }
512 | .mcd-menu li ul li ul li>ul:before {
513 | left: 30px;
514 | top: -9px;
515 | border: 0;
516 | border-bottom: 5px solid #e67e22;
517 | border-left: 5px solid transparent;
518 | border-right: 5px solid transparent;
519 | }
520 | .mcd-menu li ul li ul li:hover>ul {
521 | left: 30px;
522 | min-width: 150px;
523 | top: 35px;
524 | }
525 | .mcd-menu li ul a {
526 | font-size: 12px;
527 | }
528 | .mcd-menu li ul a i {
529 | font-size: 14px;
530 | }
531 | }
532 |
533 | @media only screen and (max-width: 479px) {
534 | .mcd-menu {
535 | width: 50px;
536 | }
537 | .mcd-menu li a {
538 | position: relative;
539 | padding: 12px 16px;
540 | height: 20px;
541 | }
542 | .mcd-menu li a small {
543 | display: none;
544 | }
545 | .mcd-menu li a strong {
546 | display: none;
547 | }
548 | .mcd-menu li a:hover strong,.mcd-menu li a.active strong {
549 | display: block;
550 | font-size: 10px;
551 | padding: 3px 0;
552 | position: absolute;
553 | bottom: 0px;
554 | left: 0;
555 | background: #e67e22;
556 | color: #FFF;
557 | min-width: 100%;
558 | text-transform: lowercase;
559 | font-weight: normal;
560 | text-align: center;
561 | }
562 | .mcd-menu li .search {
563 | display: none;
564 | }
565 | .mcd-menu li>ul {
566 | min-width: 180px;
567 | left: 70px;
568 | }
569 | .mcd-menu li:hover>ul {
570 | min-width: 180px;
571 | left: 50px;
572 | }
573 | .mcd-menu li ul li>ul,.mcd-menu li ul li ul li>ul {
574 | min-width: 150px;
575 | }
576 | .mcd-menu li ul li:hover>ul {
577 | left: 180px;
578 | min-width: 150px;
579 | }
580 | .mcd-menu li ul li ul li>ul {
581 | left: 35px;
582 | top: 45px;
583 | border: 0;
584 | border-top: 4px solid #e67e22;
585 | }
586 | .mcd-menu li ul li ul li>ul:before {
587 | left: 30px;
588 | top: -9px;
589 | border: 0;
590 | border-bottom: 5px solid #e67e22;
591 | border-left: 5px solid transparent;
592 | border-right: 5px solid transparent;
593 | }
594 | .mcd-menu li ul li ul li:hover>ul {
595 | left: 30px;
596 | min-width: 150px;
597 | top: 35px;
598 | }
599 | .mcd-menu li ul a {
600 | font-size: 12px;
601 | }
602 | .mcd-menu li ul a i {
603 | font-size: 14px;
604 | }
605 | }
--------------------------------------------------------------------------------
/Source/WebContent/css/detail.css:
--------------------------------------------------------------------------------
1 | @CHARSET "UTF-8";
2 | .left-1 {
3 | width: 45%;
4 | min-height: 50%;
5 | border: 0px solid #CDCDCD;
6 | float: left;
7 | text-align: center;
8 | margin-top: 20px;
9 | }
10 |
11 | .left-1 img {
12 | margin-left: 10px;
13 | margin-right: 10px;
14 | margin-top: 10px;
15 | }
16 |
17 | .left-2 {
18 | margin-top: 20px;
19 | width: 54.3%;
20 | min-height: 50%;
21 | border: 0px solid #CDCDCD;
22 | float: left;
23 | }
24 |
25 | .left-3 {
26 | min-height: 50px;
27 | clear: both;
28 | border: 0px solid #CDCDCD;
29 | text-align: center;
30 | }
31 |
32 | .left-3 img {
33 | margin-left: 10px;
34 | margin-right: 10px;
35 | margin-top: 10px;
36 | }
37 |
38 | .row1 {
39 | background: Gainsboro;
40 | }
41 |
42 | .row2 {
43 | background: white;
44 | }
45 |
46 | .col1 {
47 | width: 170px;
48 | text-align: left;
49 | padding: 8px;
50 | padding-left: 10px;
51 | }
52 |
53 | .col2 {
54 | width: 350px;
55 | text-align: left;
56 | padding: 8px;
57 | padding-left: 10px;
58 | }
59 |
60 | .detail-1 {
61 | width: 200px;
62 | text-align: left;
63 | padding: 8px;
64 | padding-left: 10px;
65 | color: blue;
66 | font-size: 15px;
67 | }
68 |
69 | .detail-2 {
70 | width: 230px;
71 | text-align: left;
72 | padding: 8px;
73 | padding-left: 10px;
74 | background: Gainsboro;
75 | }
76 |
77 | .detail-3 {
78 | width: 300px;
79 | text-align: left;
80 | padding: 8px;
81 | padding-left: 10px;
82 | }
83 |
84 | article {
85 | margin-bottom: 3rem;
86 | position: relative;
87 | *zoom: 1;
88 | }
89 |
90 | article:before,article:after {
91 | content: "";
92 | display: table;
93 | }
94 |
95 | article:after {
96 | clear: both
97 | }
98 |
99 | article figure {
100 | float: left;
101 | }
102 |
103 | article section:first-of-type {
104 | float: left;
105 | width: 100%;
106 | }
107 |
108 | article section:last-of-type {
109 | display: none;
110 | visibility: hidden;
111 | }
112 |
113 | section {
114 | -webkit-transition: .125s linear;
115 | -moz-transition: .125s linear;
116 | -ms-transition: .125s linear;
117 | -o-transition: .125s linear;
118 | transition: .125s linear;
119 | }
120 |
121 | input[type=checkbox] {
122 | border: 0;
123 | clip: rect(0, 0, 0, 0);
124 | height: 1px;
125 | margin: -1px;
126 | overflow: hidden;
127 | padding: 0;
128 | position: absolute;
129 | width: 500px;
130 | }
131 |
132 | [for="read_more"] {
133 | position: absolute;
134 | bottom: -3rem;
135 | left: 0;
136 | width: 100%;
137 | text-align: center;
138 | padding: .70rem;
139 | box-shadow: inset 1px 1px rgba(0, 0, 0, 0.1), inset -1px -1px
140 | rgba(0, 0, 0, 0.1);
141 | }
142 |
143 | [for="read_more"]:hover {
144 | background: rgba(0, 0, 0, .5);
145 | color: rgb(255, 255, 255);
146 | }
147 |
148 | [for="read_more"] span:last-of-type {
149 | display: none;
150 | visibility: hidden;
151 | }
152 |
153 | input[type=checkbox]:checked ~ section {
154 | display: block;
155 | visibility: visible;
156 | width: 100%;
157 | }
158 |
159 | input[type=checkbox]:checked ~ figure {
160 | width: 100%;
161 | }
162 |
163 | input[type=checkbox]:checked ~ [for="read_more"] span:first-of-type {
164 | display: none;
165 | visibility: hidden;
166 | }
167 |
168 | input[type=checkbox]:checked ~ [for="read_more"] span:last-of-type {
169 | display: block;
170 | visibility: visible;
171 | }
172 |
173 | @font-face {
174 | font-family: 'Open Sans';
175 | font-style: normal;
176 | font-weight: 300;
177 | src: local('Open Sans Light'), local('OpenSans-Light'),
178 | url(http://cdn.tgdd.vn/fonts/opensans/DXI1ORHCpsQm3Vp6mXoaTXwUvq1pQaUIDqPgpae5ItU.woff)
179 | format('woff')
180 | }
181 |
182 | @font-face {
183 | font-family: 'Open Sans';
184 | font-style: normal;
185 | font-weight: 400;
186 | src: local('Open Sans'), local('OpenSans'),
187 | url(http://cdn.tgdd.vn/fonts/opensans/59ZRklaO5bWGqF5A9baEET8E0i7KZn-EPnyo3HZu7kw.woff)
188 | format('woff')
189 | }
190 |
191 | @font-face {
192 | font-family: 'Open Sans';
193 | font-style: normal;
194 | font-weight: 600;
195 | src: local('Open Sans Semibold'), local('OpenSans-Semibold'),
196 | url(http://cdn.tgdd.vn/fonts/opensans/MTP_ySUJH_bn48VBG8sNSnwUvq1pQaUIDqPgpae5ItU.woff)
197 | format('woff')
198 | }
199 |
200 | @font-face {
201 | font-family: 'Open Sans';
202 | font-style: normal;
203 | font-weight: 700;
204 | src: local('Open Sans Bold'), local('OpenSans-Bold'),
205 | url(http://cdn.tgdd.vn/fonts/opensans/k3k702ZOKiLJc3WVjuplzHwUvq1pQaUIDqPgpae5ItU.woff)
206 | format('woff')
207 | }
208 |
209 | @font-face {
210 | font-family: 'Open Sans';
211 | font-style: normal;
212 | font-weight: 800;
213 | src: local('Open Sans Extrabold'), local('OpenSans-Extrabold'),
214 | url(http://cdn.tgdd.vn/fonts/opensans/EInbV5DfGHOiMmvb1Xr-hnwUvq1pQaUIDqPgpae5ItU.woff)
215 | format('woff')
216 | }
217 |
218 | @font-face {
219 | font-family: 'Open Sans';
220 | font-style: italic;
221 | font-weight: 300;
222 | src: local('Open Sans Light Italic'), local('OpenSansLight-Italic'),
223 | url(http://cdn.tgdd.vn/fonts/opensans/PRmiXeptR36kaC0GEAetxsJIfR0j-Hc3mXsqdoe9vx8.woff)
224 | format('woff')
225 | }
226 |
227 | @font-face {
228 | font-family: 'Open Sans';
229 | font-style: italic;
230 | font-weight: 400;
231 | src: local('Open Sans Italic'), local('OpenSans-Italic'),
232 | url(http://cdn.tgdd.vn/fonts/opensans/xjAJXh38I15wypJXxuGMBkbnXQ06sCSpaytluCdpFnY.woff)
233 | format('woff')
234 | }
235 |
236 | @font-face {
237 | font-family: 'Open Sans';
238 | font-style: italic;
239 | font-weight: 600;
240 | src: local('Open Sans Semibold Italic'),
241 | local('OpenSans-SemiboldItalic'),
242 | url(http://cdn.tgdd.vn/fonts/opensans/PRmiXeptR36kaC0GEAetxrkV11xRSeRSsXvODowCrgc.woff)
243 | format('woff')
244 | }
245 |
246 | @font-face {
247 | font-family: 'Open Sans';
248 | font-style: italic;
249 | font-weight: 700;
250 | src: local('Open Sans Bold Italic'), local('OpenSans-BoldItalic'),
251 | url(http://cdn.tgdd.vn/fonts/opensans/PRmiXeptR36kaC0GEAetxttxB2icnUq6NyCcJOfFtRI.woff)
252 | format('woff')
253 | }
254 |
255 | @font-face {
256 | font-family: 'Open Sans';
257 | font-style: italic;
258 | font-weight: 800;
259 | src: local('Open Sans Extrabold Italic'),
260 | local('OpenSans-ExtraboldItalic'),
261 | url(http://cdn.tgdd.vn/fonts/opensans/PRmiXeptR36kaC0GEAetxq6EGkuGQVtC-K3yp5dayWY.woff)
262 | format('woff')
263 | }
--------------------------------------------------------------------------------
/Source/WebContent/css/login.css:
--------------------------------------------------------------------------------
1 | /*--
2 | Author: W3layouts
3 | Author URL: http://w3layouts.com
4 | License: Creative Commons Attribution 3.0 Unported
5 | License URL: http://creativecommons.org/licenses/by/3.0/
6 | --*/
7 | /* reset */
8 | html,body,div,span,applet,object,iframe,h1,h2,h3,h4,h5,h6,p,blockquote,pre,a,abbr,acronym,address,big,cite,code,del,dfn,em,img,ins,kbd,q,s,samp,small,strike,strong,sub,sup,tt,var,b,u,i,dl,dt,dd,ol,nav ul,nav li,fieldset,form,label,legend,table,caption,tbody,tfoot,thead,tr,th,td,article,aside,canvas,details,embed,figure,figcaption,footer,header,hgroup,menu,nav,output,ruby,section,summary,time,mark,audio,video
9 | {
10 | margin: 0;
11 | padding: 0;
12 | border: 0;
13 | font-size: 100%;
14 | font: inherit;
15 | vertical-align: baseline;
16 | }
17 |
18 | article,aside,details,figcaption,figure,footer,header,hgroup,menu,nav,section
19 | {
20 | display: block;
21 | }
22 |
23 | ol,ul {
24 | list-style: none;
25 | margin: 0px;
26 | padding: 0px;
27 | }
28 |
29 | blockquote,q {
30 | quotes: none;
31 | }
32 |
33 | blockquote:before,blockquote:after,q:before,q:after {
34 | content: '';
35 | content: none;
36 | }
37 |
38 | table {
39 | border-collapse: collapse;
40 | border-spacing: 0;
41 | }
42 | /* start editing from here */
43 | a {
44 | text-decoration: none;
45 | }
46 |
47 | .txt-rt {
48 | text-align: right;
49 | } /* text align right */
50 | .txt-lt {
51 | text-align: left;
52 | } /* text align left */
53 | .txt-center {
54 | text-align: center;
55 | } /* text align center */
56 | .float-rt {
57 | float: right;
58 | } /* float right */
59 | .float-lt {
60 | float: left;
61 | } /* float left */
62 | .clear {
63 | clear: both;
64 | } /* clear float */
65 | .pos-relative {
66 | position: relative;
67 | } /* Position Relative */
68 | .pos-absolute {
69 | position: absolute;
70 | } /* Position Absolute */
71 | .vertical-base {
72 | vertical-align: baseline;
73 | } /* vertical align baseline */
74 | .vertical-top {
75 | vertical-align: top;
76 | } /* vertical align top */
77 | nav.vertical ul li {
78 | display: block;
79 | } /* vertical menu */
80 | nav.horizontal ul li {
81 | display: inline-block;
82 | } /* horizontal menu */
83 | img {
84 | max-width: 100%;
85 | }
86 | /*end reset*/
87 | /****-----start-body----****/
88 | body {
89 | background: #3aada9;
90 | font-family: 'Cabin', sans-serif;
91 | }
92 |
93 | .wrap {
94 | margin: 0 auto;
95 | width: 80%;
96 | }
97 |
98 | body a,form li,.submit input[type="submit"] {
99 | transition: 0.1s all;
100 | -webkit-transition: 0.1s all;
101 | -moz-transition: 0.1s all;
102 | -o-transition: 0.1s all;
103 | }
104 |
105 | .one-login-head {
106 | background: #ffc50c;
107 | padding: 1em 1em;
108 | text-align: center;
109 | position: relative;
110 | }
111 |
112 | .one-login-head span {
113 | background: url('../images/tip.png') no-repeat 0px 0px;
114 | width: 30px;
115 | height: 13px;
116 | position: absolute;
117 | bottom: -12px;
118 | left: 203px;
119 | display: inline-block;
120 | }
121 |
122 | .one-login {
123 | width: 28%;
124 | margin: 5% auto;
125 | background: #fff;
126 | text-align: center;
127 | border-bottom: 3px solid #1c817c;
128 | }
129 | /* Float Shadow */
130 | .hvr-float-shadow {
131 | vertical-align: middle;
132 | -webkit-transform: translateZ(0);
133 | transform: translateZ(0);
134 | box-shadow: 0 0 1px rgba(0, 0, 0, 0);
135 | -webkit-backface-visibility: hidden;
136 | backface-visibility: hidden;
137 | -moz-osx-font-smoothing: grayscale;
138 | position: relative;
139 | -webkit-transition-duration: 0.3s;
140 | transition-duration: 0.3s;
141 | -webkit-transition-property: transform;
142 | transition-property: transform;
143 | }
144 |
145 | .hvr-float-shadow:before {
146 | pointer-events: none;
147 | position: absolute;
148 | z-index: -1;
149 | content: '';
150 | top: 105%;
151 | left: 5%;
152 | height: 52px;
153 | width: 95%;
154 | opacity: 0.5;
155 | background: -webkit-radial-gradient(center, ellipse, rgba(0, 0, 0, 0.16)
156 | 0%, rgba(0, 0, 0, 0) 80%);
157 | background: radial-gradient(ellipse at center, rgba(0, 0, 0, 0.18) 0%,
158 | rgba(0, 0, 0, 0) 80%);
159 | -webkit-transition-duration: 0.3s;
160 | transition-duration: 0.3s;
161 | -webkit-transition-property: transform, opacity;
162 | transition-property: transform, opacity;
163 | }
164 |
165 | .hvr-float-shadow:hover,.hvr-float-shadow:focus,.hvr-float-shadow:active
166 | {
167 | -webkit-transform: translateY(-5px);
168 | transform: translateY(-5px);
169 | /* move the element up by 5px */
170 | }
171 |
172 | .hvr-float-shadow:hover:before,.hvr-float-shadow:focus:before,.hvr-float-shadow:active:before
173 | {
174 | opacity: 1;
175 | -webkit-transform: translateY(5px);
176 | transform: translateY(5px);
177 | /* move the element down by 5px (it will stay in place because it's attached to the element that also moves up 5px) */
178 | }
179 |
180 | .one-login-head h1 {
181 | font-size: 2em;
182 | color: #fff;
183 | font-weight: 500;
184 | }
185 |
186 | form {
187 | padding: 12% 9%;
188 | }
189 |
190 | form li {
191 | border: none;
192 | list-style: none;
193 | margin-bottom: 25px;
194 | width: 100%;
195 | background: #dfdfdf;
196 | }
197 |
198 | .icon {
199 | height: 45px;
200 | width: 46px;
201 | display: block;
202 | float: left;
203 | margin: 1px -13px 0px 0px;
204 | }
205 |
206 | .user {
207 | background: url(../images/icon.png) no-repeat 0px -1px #ffc50c;
208 | }
209 |
210 | .lock {
211 | background: url(../images/icon.png) no-repeat -49px 0px #ffc50c;
212 | }
213 |
214 | input[type="text"],input[type="password"],input[type="date"] {
215 | width: 60%;
216 | padding: 0.8em 4em 0.8em 1.7em;
217 | color: #858282;
218 | font-size: 17px;
219 | outline: none;
220 | background: none;
221 | font-weight: 500;
222 | border: none;
223 | }
224 |
225 | .submit {
226 | border-bottom: 1px dashed #999;
227 | padding: 23px 0;
228 | }
229 |
230 | .submit input[type="submit"] {
231 | font-size: 20px;
232 | font-weight: 400;
233 | color: #fff;
234 | cursor: pointer;
235 | outline: none;
236 | padding: 13px 10px;
237 | width: 100%;
238 | border: none;
239 | background: #ffc50c;
240 | }
241 |
242 | input[type="submit"]:hover {
243 | background: #D13E2F;
244 | }
245 |
246 | h6 {
247 | float: right;
248 | }
249 | /*----------*/
250 | .p-container {
251 | margin-top: 1em;
252 | }
253 |
254 | .p-container .checkbox input {
255 | position: absolute;
256 | left: -9999px;
257 | }
258 |
259 | .p-container.checkbox i {
260 | border-color: #fff;
261 | transition: border-color 0.3s;
262 | -o-transition: border-color 0.3s;
263 | -ms-transition: border-color 0.3s;
264 | -moz-transition: border-color 0.3s;
265 | -webkit-transition: border-color 0.3s;
266 | }
267 |
268 | .p-container.checkbox i:hover {
269 | border-color: red;
270 | }
271 |
272 | .p-container i:before {
273 | background-color: #2da5da;
274 | }
275 |
276 | .p-container .rating label {
277 | color: #ccc;
278 | transition: color 0.3s;
279 | -o-transition: color 0.3s;
280 | -ms-transition: color 0.3s;
281 | -moz-transition: color 0.3s;
282 | -webkit-transition: color 0.3s;
283 | }
284 |
285 | .p-container .checkbox input+i:after {
286 | position: absolute;
287 | opacity: 0;
288 | transition: opacity 0.1s;
289 | -o-transition: opacity 0.1s;
290 | -ms-transition: opacity 0.1s;
291 | -moz-transition: opacity 0.1s;
292 | -webkit-transition: opacity 0.1s;
293 | }
294 |
295 | .p-container .checkbox input+i:after {
296 | content: url(../images/tick.png) no-repeat 7px 1px;
297 | top: 5px;
298 | left: 5px;
299 | width: 13px;
300 | height: 12px;
301 | }
302 |
303 | .p-container.checkbox {
304 | float: left;
305 | margin-right: 30px;
306 | }
307 |
308 | .p-container .checkbox {
309 | padding-left: 40px;
310 | font-size: 16px;
311 | line-height: 14px;
312 | color: #858282;
313 | cursor: pointer;
314 | }
315 |
316 | .p-container .checkbox {
317 | position: relative;
318 | display: block;
319 | }
320 |
321 | .p-container h6 a {
322 | float: right;
323 | color: #898989;
324 | }
325 |
326 | .p-container h6 a:hover {
327 | text-decoration: underline;
328 | }
329 |
330 | label.checkbox {
331 | float: left;
332 | margin-top: 3px;
333 | }
334 |
335 | .p-container .checkbox i {
336 | position: absolute;
337 | top: -5px;
338 | left: 5px;
339 | display: block;
340 | width: 22px;
341 | height: 22px;
342 | outline: none;
343 | border: none;
344 | background: #dfdfdf;
345 | }
346 |
347 | .p-container .checkbox input+i:after {
348 | position: absolute;
349 | opacity: 0;
350 | transition: opacity 0.1s;
351 | -o-transition: opacity 0.1s;
352 | -ms-transition: opacity 0.1s;
353 | -moz-transition: opacity 0.1s;
354 | -webkit-transition: opacity 0.1s;
355 | }
356 |
357 | .p-container .checkbox input+i:after {
358 | color: #2da5da;
359 | }
360 |
361 | .p-container .checkbox input:checked+i,.p-container . input:checked+i {
362 | border-color: #2da5da;
363 | }
364 |
365 | .p-container .rating input:checked ~ label {
366 | color: #2da5da;
367 | }
368 |
369 | .p-container .checkbox input:checked+i:after {
370 | opacity: 1;
371 | }
372 |
373 | .social-icons p {
374 | color: #898989;
375 | font-size: 17px;
376 | text-align: center;
377 | padding-top: 20px;
378 | }
379 |
380 | ul.soc_icons2 {
381 | text-align: center;
382 | padding: 12px 0;
383 | }
384 |
385 | ul.soc_icons2 li.pic {
386 | background: none;
387 | display: inline-block;
388 | width: 24%;
389 | margin: 0;
390 | }
391 |
392 | ul.soc_icons2 li.pic i {
393 | width: 68px;
394 | height: 68px;
395 | display: inline-block;
396 | background: url('../images/icon.png') no-repeat 0px 0px;
397 | vertical-align: middle;
398 | -webkit-transition: 0.8s;
399 | -moz-transition: 0.8s;
400 | -o-transition: 0.8s;
401 | transition: 0.8s;
402 | }
403 |
404 | ul.soc_icons2 li.pic i:hover {
405 | border-top-left-radius: 3em;
406 | -o-border-top-left-radius: 3em;
407 | -moz-border-top-left-radius: 3em;
408 | -webkit-border-top-left-radius: 3em;
409 | }
410 |
411 | ul.soc_icons2 li.pic a:hover {
412 | text-decoration: none;
413 | }
414 |
415 | ul.soc_icons2 li.pic a i.icon_4 {
416 | background-position: -106px 4px;
417 | }
418 |
419 | ul.soc_icons2 li.pic a i.icon_5 {
420 | background-position: -204px 4px;
421 | }
422 |
423 | ul.soc_icons2 li.pic a i.icon_6 {
424 | background-position: -302px 4px;
425 | }
426 |
427 | .one-login h5 a,.one-login h5 {
428 | color: #898989;
429 | font-size: 16px;
430 | text-align: center;
431 | padding: 10px 0;
432 | }
433 |
434 | .one-login h5 a:hover {
435 | text-decoration: underline;
436 | }
437 | /*---login-02---------*/
438 | .two-login-head {
439 | background: #702c91;
440 | padding: 1em 1em;
441 | text-align: center;
442 | position: relative;
443 | }
444 |
445 | .two-login-head h2 {
446 | font-size: 2em;
447 | color: #fff;
448 | font-weight: 500;
449 | text-transform: uppercase;
450 | }
451 |
452 | .two-login-head lable {
453 | background: url('../images/tip2.png') no-repeat 0px 0px;
454 | width: 30px;
455 | height: 13px;
456 | position: absolute;
457 | bottom: -11px;
458 | left: 203px;
459 | display: inline-block;
460 | }
461 |
462 | .two-login h5,.two-login h5 a {
463 | color: #848484;
464 | font-size: 16px;
465 | }
466 |
467 | .two-login h5 a {
468 | font-weight: 600;
469 | }
470 |
471 | .two-login h5 a:hover {
472 | text-decoration: underline;
473 | }
474 |
475 | .two-login {
476 | width: 28%;
477 | margin: 5% auto;
478 | background: #fff;
479 | text-align: center;
480 | border-bottom: 3px solid #1c817c;
481 | }
482 |
483 | .two-login-head h1 {
484 | font-size: 2em;
485 | color: #fff;
486 | font-weight: 500;
487 | }
488 |
489 | form.two {
490 | padding: 12% 9%;
491 | }
492 |
493 | form.two li {
494 | border: none;
495 | list-style: none;
496 | margin-bottom: 25px;
497 | width: 100%;
498 | background: #dfdfdf;
499 | }
500 |
501 | .login-02 {
502 | margin-top: 9em;
503 | }
504 |
505 | .icon2 {
506 | height: 45px;
507 | width: 46px;
508 | display: block;
509 | float: left;
510 | margin: 1px -13px 0px 0px;
511 | }
512 |
513 | .user2 {
514 | background: url(../images/icon2.png) no-repeat 0px -1px #702c91;
515 | }
516 |
517 | .lock2 {
518 | background: url(../images/icon2.png) no-repeat -49px 0px #702c91;
519 | }
520 |
521 | .mail {
522 | background: url(../images/icon2.png) no-repeat -99px 0px #702c91;
523 | }
524 |
525 | form.two input[type="text"],form.two input[type="password"] {
526 | width: 60%;
527 | padding: 0.8em 4em 0.8em 1.7em;
528 | color: #858282;
529 | font-size: 17px;
530 | outline: none;
531 | background: none;
532 | font-weight: 500;
533 | border: none;
534 | }
535 |
536 | .submit.two {
537 | border: none;
538 | padding: 41px 0 20px 0;
539 | }
540 |
541 | .submit.two input[type="submit"] {
542 | font-size: 20px;
543 | font-weight: 400;
544 | color: #fff;
545 | cursor: pointer;
546 | outline: none;
547 | padding: 13px 10px;
548 | width: 100%;
549 | border: none;
550 | background: #702c91;
551 | }
552 |
553 | .submit.two input[type="submit"]:hover {
554 | background: #ffc50c;
555 | }
556 |
557 | .p-container a {
558 | color: #702C91;
559 | font-size: 15px;
560 | }
561 |
562 | .p-container a:hover {
563 | text-decoration: underline;
564 | }
565 | /*---login-three----------*/
566 | .three-login-head {
567 | background: #f26122;
568 | padding: 1em 1em;
569 | text-align: center;
570 | position: relative;
571 | }
572 |
573 | .three-login-head h3 {
574 | font-size: 2em;
575 | color: #fff;
576 | font-weight: 500;
577 | text-transform: uppercase;
578 | }
579 |
580 | .three-login-head lable {
581 | background: url('../images/tip3.png') no-repeat 0px 0px;
582 | width: 30px;
583 | height: 13px;
584 | position: absolute;
585 | bottom: -11px;
586 | left: 203px;
587 | display: inline-block;
588 | }
589 |
590 | .three-login h5,.three-login h5 a {
591 | color: #848484;
592 | font-size: 16px;
593 | text-align: left;
594 | }
595 |
596 | .three-login h5 a:hover {
597 | text-decoration: underline;
598 | }
599 |
600 | .three-login p {
601 | color: #848484;
602 | font-size: 16px;
603 | line-height: 20px;
604 | padding: 10px 0 20px 0;
605 | text-align: left;
606 | }
607 |
608 | .three-login {
609 | width: 28%;
610 | margin: 5% auto;
611 | background: #fff;
612 | text-align: center;
613 | border-bottom: 3px solid #1c817c;
614 | }
615 |
616 | .three-login-head h1 {
617 | font-size: 2em;
618 | color: #fff;
619 | font-weight: 500;
620 | }
621 |
622 | form.three {
623 | padding: 12% 9%;
624 | }
625 |
626 | form.three li {
627 | border: none;
628 | list-style: none;
629 | margin-bottom: 25px;
630 | width: 100%;
631 | background: #dfdfdf;
632 | }
633 |
634 | .login-03 {
635 | margin-top: 9em;
636 | }
637 |
638 | .icon3 {
639 | height: 45px;
640 | width: 46px;
641 | display: block;
642 | float: left;
643 | margin: 1px -13px 0px 0px;
644 | }
645 |
646 | .mail2 {
647 | background: url(../images/mail.png) no-repeat -0px 0px #f26122;
648 | }
649 |
650 | form.three input[type="text"],form.three input[type="password"] {
651 | width: 60%;
652 | padding: 0.8em 4em 0.8em 1.7em;
653 | color: #858282;
654 | font-size: 17px;
655 | outline: none;
656 | background: none;
657 | font-weight: 500;
658 | border: none;
659 | }
660 |
661 | .submit.three {
662 | border: none;
663 | padding: 8px 0 13px 0;
664 | }
665 |
666 | .submit.three input[type="submit"] {
667 | font-size: 20px;
668 | font-weight: 400;
669 | color: #fff;
670 | cursor: pointer;
671 | outline: none;
672 | padding: 13px 10px;
673 | width: 100%;
674 | border: none;
675 | background: #f26122;
676 | }
677 |
678 | .submit.three input[type="submit"]:hover {
679 | background: #ffc50c;
680 | }
681 | /****************/
682 | .copy-right {
683 | text-align: center;
684 | margin: 10% 0 2% 0;
685 | }
686 |
687 | .copy-right p {
688 | color: #fff;
689 | font-size: 1.1em;
690 | font-weight: 400;
691 | }
692 |
693 | .copy-right p a {
694 | font-size: 1em;
695 | color: #fff;
696 | }
697 |
698 | .copy-right p a:hover {
699 | text-decoration: underline;
700 | }
701 | /*-----start-responsive-design------*/
702 | @media ( max-width :1440px) {
703 | .three-login,.two-login,.one-login {
704 | width: 31%;
705 | }
706 | }
707 |
708 | @media ( max-width :1366px) {
709 | .three-login,.two-login,.one-login {
710 | width: 32%;
711 | }
712 | }
713 |
714 | @media ( max-width :1280px) {
715 | .three-login,.two-login,.one-login {
716 | width: 35%;
717 | }
718 | .login-02,.login-03 {
719 | margin-top: 7em;
720 | }
721 | }
722 |
723 | @media ( max-width :1024px) {
724 | .three-login,.two-login,.one-login {
725 | width: 43%;
726 | }
727 | .three-login-head h3,.one-login-head h1,.two-login-head h2 {
728 | font-size: 1.7em;
729 | }
730 | }
731 |
732 | @media ( max-width :768px) {
733 | .three-login,.two-login,.one-login {
734 | width: 58%;
735 | }
736 | form {
737 | padding: 12% 6%;
738 | }
739 | }
740 |
741 | @media ( max-width :640px) {
742 | .three-login,.two-login,.one-login {
743 | width: 70%;
744 | }
745 | .three-login-head h3,.one-login-head h1,.two-login-head h2 {
746 | font-size: 1.55em;
747 | }
748 | }
749 |
750 | @media ( max-width :480px) {
751 | .three-login,.two-login,.one-login {
752 | width: 95%;
753 | }
754 | .copy-right p {
755 | font-size: 1em;
756 | }
757 | form {
758 | padding: 12% 5%;
759 | }
760 | .copy-right p {
761 | font-size: 1.05em;
762 | line-height: 1.5em;
763 | }
764 | }
765 |
766 | @media ( max-width :320px) {
767 | .one-login-head img,.two-login-head img,.three-login-head img {
768 | width: 16%;
769 | }
770 | input[type="text"],input[type="password"] {
771 | width: 62%;
772 | padding: 0.9em 1em 0.9em 1.7em;
773 | color: #858282;
774 | font-size: 16px;
775 | }
776 | .social-icons p {
777 | font-size: 15px;
778 | padding-top: 18px;
779 | line-height: 23px;
780 | }
781 | label.checkbox {
782 | float: none;
783 | margin-top: 3px;
784 | }
785 | .p-container .checkbox {
786 | padding-left: 0px;
787 | }
788 | .p-container h6,.p-container h6 a {
789 | float: none;
790 | margin-top: 10px;
791 | }
792 | .p-container {
793 | margin-top: 0;
794 | }
795 | ul.soc_icons2 li.pic {
796 | width: 32%;
797 | }
798 | .one-login h5 a,.one-login h5 {
799 | font-size: 15px;
800 | }
801 | .three-login-head h3,.one-login-head h1,.two-login-head h2 {
802 | font-size: 1.3em;
803 | }
804 | .submit input[type="submit"],.submit.two input[type="submit"],.submit.three input[type="submit"]
805 | {
806 | font-size: 18px;
807 | padding: 13px 10px;
808 | }
809 | .two-login h5,.two-login h5 a {
810 | font-size: 15px;
811 | }
812 | .three-login p {
813 | font-size: 14px;
814 | }
815 | .three-login h5,.three-login h5 a {
816 | font-size: 15px;
817 | }
818 | form {
819 | padding: 12% 4%;
820 | }
821 | .p-container a {
822 | font-size: 14px;
823 | }
824 | .three-login,.two-login,.one-login {
825 | width: 94%;
826 | }
827 | form li {
828 | margin-bottom: 14px;
829 | }
830 | .submit.three {
831 | padding: 1px 0 13px 0;
832 | }
833 | .submit.two {
834 | padding: 22px 0 20px 0;
835 | }
836 | .p-container .checkbox i {
837 | position: absolute;
838 | top: -3px;
839 | left: 39px;
840 | }
841 | .p-container label.checkbox.two i {
842 | position: absolute;
843 | top: -5px;
844 | left: 5px;
845 | }
846 | .one-login-head span,.two-login-head lable,.three-login-head lable {
847 | bottom: -11px;
848 | left: 129px;
849 | }
850 | .login-02,.login-03 {
851 | margin-top: 7em;
852 | }
853 | .login-02,.login-03 {
854 | margin-top: 6em;
855 | }
856 | }
--------------------------------------------------------------------------------
/Source/WebContent/css/main.css:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/manhduydl/Shopping-web-Jsp-Servlet/3db2f59e6ba1b27800babec455f7fad448740e4d/Source/WebContent/css/main.css
--------------------------------------------------------------------------------
/Source/WebContent/css/menu.css:
--------------------------------------------------------------------------------
1 | @CHARSET "UTF-8";
2 | #menungang {
3 | background: #4cb6ea;
4 | margin: 0;
5 | width: 1060px;
6 | height: 50px;
7 | padding: 0;
8 | line-height: 1;
9 | display: block;
10 | position: relative;
11 | font-family: Verdana, sans-serif;
12 | }
13 |
14 | #menungang ul {
15 | list-style: none;
16 | margin: 0;
17 | padding: 0;
18 | display: block;
19 | }
20 |
21 | #menungang ul:after {
22 | content: ' ';
23 | display: block;
24 | font-size: 0;
25 | height: 0;
26 | clear: both;
27 | visibility: hidden;
28 | }
29 |
30 | #menungang ul li {
31 | margin: 0;
32 | padding: 0;
33 | display: block;
34 | position: relative;
35 | }
36 |
37 | #menungang ul li a {
38 | text-decoration: none;
39 | display: block;
40 | margin: 0;
41 | -webkit-transition: color .2s ease;
42 | -moz-transition: color .2s ease;
43 | -ms-transition: color .2s ease;
44 | -o-transition: color .2s ease;
45 | transition: color .2s ease;
46 | }
47 |
48 | #menungang ul li ul {
49 | position: absolute;
50 | left: -9999px;
51 | top: auto;
52 | }
53 |
54 | #menungang ul li ul li {
55 | max-height: 0;
56 | position: absolute;
57 | -webkit-transition: max-height 0.4s ease-out;
58 | -moz-transition: max-height 0.4s ease-out;
59 | -ms-transition: max-height 0.4s ease-out;
60 | -o-transition: max-height 0.4s ease-out;
61 | transition: max-height 0.4s ease-out;
62 | background: #ffffff;
63 | }
64 |
65 | #menungang ul li ul li.has-sub:after {
66 | display: block;
67 | position: absolute;
68 | content: '';
69 | height: 10px;
70 | width: 10px;
71 | border-radius: 5px;
72 | background: #000000;
73 | z-index: 1;
74 | top: 13px;
75 | right: 15px;
76 | }
77 |
78 | #menungang ul li ul li.has-sub:before {
79 | display: block;
80 | position: absolute;
81 | content: '';
82 | height: 0;
83 | width: 0;
84 | border: 3px solid transparent;
85 | border-left-color: #ffffff;
86 | z-index: 2;
87 | top: 15px;
88 | right: 15px;
89 | }
90 |
91 | #menungang ul li ul li a {
92 | font-size: 14px;
93 | font-weight: 400;
94 | text-transform: none;
95 | color: #000000;
96 | letter-spacing: 0;
97 | display: block;
98 | width: 140px;
99 | padding: 11px 10px 11px 20px;
100 | }
101 |
102 | #menungang ul li ul li:hover>a,#menungang ul li ul li.active>a {
103 | color: blue;
104 | }
105 |
106 | #menungang ul li ul li:hover:after,#menungang ul li ul li.active:after {
107 | background: blue;
108 | }
109 |
110 | #menungang ul li ul li:hover>ul {
111 | left: 170px;
112 | top: 0;
113 | }
114 |
115 | #menungang ul li ul li:hover>ul>li {
116 | max-height: 72px;
117 | position: relative;
118 | }
119 |
120 | #menungang>ul>li {
121 | float: left;
122 | }
123 |
124 | #menungang>ul>li:after {
125 | content: '';
126 | display: block;
127 | position: absolute;
128 | width: 100%;
129 | height: 0;
130 | top: 0;
131 | z-index: 0;
132 | background: #ffffff;
133 | -webkit-transition: height .2s;
134 | -moz-transition: height .2s;
135 | -ms-transition: height .2s;
136 | -o-transition: height .2s;
137 | transition: height .2s;
138 | }
139 |
140 | #menungang>ul>li.has-sub>a {
141 | padding-right: 40px;
142 | }
143 |
144 | #menungang>ul>li.has-sub>a:after {
145 | display: block;
146 | content: '';
147 | background: #ffffff;
148 | height: 12px;
149 | width: 12px;
150 | position: absolute;
151 | border-radius: 13px;
152 | right: 14px;
153 | top: 16px;
154 | }
155 |
156 | #menungang>ul>li.has-sub>a:before {
157 | display: block;
158 | content: '';
159 | border: 4px solid transparent;
160 | border-top-color: #4cb6ea;
161 | z-index: 2;
162 | height: 0;
163 | width: 0;
164 | position: absolute;
165 | right: 16px;
166 | top: 21px;
167 | }
168 |
169 | #menungang>ul>li>a {
170 | color: #ffffff;
171 | padding: 15px 20px;
172 | font-weight: 700;
173 | letter-spacing: 1px;
174 | text-transform: uppercase;
175 | font-size: 14px;
176 | z-index: 2;
177 | position: relative;
178 | }
179 |
180 | #menungang>ul>li:hover:after,#menungang>ul>li.active:after {
181 | height: 100%;
182 | }
183 |
184 | #menungang>ul>li:hover>a,#menungang>ul>li.active>a {
185 | color: #000000;
186 | }
187 |
188 | #menungang>ul>li:hover>a:after,#menungang>ul>li.active>a:after {
189 | background: #000000;
190 | }
191 |
192 | #menungang>ul>li:hover>a:before,#menungang>ul>li.active>a:before {
193 | border-top-color: #ffffff;
194 | }
195 |
196 | #menungang>ul>li:hover>ul {
197 | left: 0;
198 | }
199 |
200 | #menungang>ul>li:hover>ul>li {
201 | max-height: 72px;
202 | position: relative;
203 | }
204 |
205 | #menungang #menu-button {
206 | display: none; # menungang > ul { max-height : 0;
207 | overflow: hidden;
208 | -webkit-transition: max-height 0.35s ease-out;
209 | -moz-transition: max-height 0.35s ease-out;
210 | -ms-transition: max-height 0.35s ease-out;
211 | -o-transition: max-height 0.35s ease-out;
212 | transition: max-height 0.35s ease-out;
213 | }
214 |
215 | #menungang>ul.open {
216 | max-height: 1000px;
217 | border-top: 1px solid rgba(110, 110, 110, 0.25);
218 | }
219 |
220 | #menungang ul {
221 | width: 100%;
222 | }
223 |
224 | #menungang ul>li {
225 | float: none;
226 | }
227 |
228 | #menungang ul li a {
229 | -webkit-box-sizing: border-box;
230 | -moz-box-sizing: border-box;
231 | box-sizing: border-box;
232 | width: 100%;
233 | padding: 12px 20px;
234 | }
235 |
236 | #menungang ul>li:after {
237 | display: none;
238 | }
239 |
240 | #menungang ul li.has-sub>a:after,#menungang ul li.has-sub>a:before,#menungang ul li ul li.has-sub:after,#menungang ul li ul li.has-sub:before
241 | {
242 | display: none;
243 | }
244 |
245 | #menungang ul li ul,#menungang ul li ul li ul,#menungang ul li ul li:hover>ul
246 | {
247 | left: 0;
248 | position: relative;
249 | }
250 |
251 | #menungang ul li ul li,#menungang ul li:hover>ul>li {
252 | max-height: 999px;
253 | position: relative;
254 | background: none;
255 | }
256 |
257 | #menungang ul li ul li a {
258 | padding: 8px 20px 8px 35px;
259 | color: #ffffff;
260 | width: auto;
261 | }
262 |
263 | #menungang ul li ul ul li a {
264 | padding: 8px 20px 8px 50px;
265 | }
266 |
267 | #menungang ul li ul li:hover>a {
268 | color: #000000;
269 | }
270 |
271 | #menungang #menu-button {
272 | display: block;
273 | -webkit-box-sizing: border-box;
274 | -moz-box-sizing: border-box;
275 | box-sizing: border-box;
276 | width: 100%;
277 | padding: 15px 20px;
278 | text-transform: uppercase;
279 | font-weight: 700;
280 | font-size: 14px;
281 | letter-spacing: 1px;
282 | color: #ffffff;
283 | cursor: pointer;
284 | }
285 |
286 | #menungang #menu-button:after {
287 | display: block;
288 | content: '';
289 | position: absolute;
290 | height: 3px;
291 | width: 22px;
292 | border-top: 2px solid #ffffff;
293 | border-bottom: 2px solid #ffffff;
294 | right: 20px;
295 | top: 16px;
296 | }
297 |
298 | #menungang #menu-button:before {
299 | display: block;
300 | content: '';
301 | position: absolute;
302 | height: 3px;
303 | width: 22px;
304 | border-top: 2px solid #ffffff;
305 | right: 20px;
306 | top: 26px;
307 | }
--------------------------------------------------------------------------------
/Source/WebContent/css/product.css:
--------------------------------------------------------------------------------
1 | @CHARSET "UTF-8";
2 |
3 | .align-center {
4 | margin: 0 auto
5 | }
6 |
7 | .clearfix:after {
8 | visibility: hidden;
9 | display: block;
10 | font-size: 0;
11 | content: " ";
12 | clear: both;
13 | height: 0
14 | }
15 |
16 | * html .clearfix {
17 | zoom: 1
18 | }
19 |
20 | *:first-child+html .clearfix {
21 | zoom: 1
22 | }
23 |
24 | .products {
25 | overflow: hidden;
26 | float: left;
27 | border-top: 1px solid #ddd;
28 | border-left: 1px solid #ddd;
29 | list-style: none;
30 | margin: 0;
31 | min-width: 1084px;
32 | }
33 |
34 | .products li {
35 | float: left;
36 | position: relative;
37 | width: 215px;
38 | height: 215px;
39 | border-right: 1px solid #ddd;
40 | border-bottom: 1px solid #ddd;
41 | background: #fff;
42 | overflow: hidden;
43 | margin: 0
44 | }
45 |
46 | .products.homepage {
47 | min-width: 600px
48 | }
49 |
50 | .products.homepage li {
51 | width: 199px
52 | }
53 |
54 | .products li h1,.products li h2,.products li h3,.products li h4,.products li h5,.products li h6
55 | {
56 | margin: 0
57 | }
58 |
59 | .products li a {
60 | display: table-cell;
61 | width: 205px;
62 | height: 205px;
63 | padding: 5px;
64 | overflow: hidden;
65 | vertical-align: bottom
66 | }
67 |
68 | .products li a h3 {
69 | font-size: 14px;
70 | font-weight: normal;
71 | color: #333;
72 | line-height: 14px;
73 | -webkit-transition: all 300ms ease 100ms;
74 | -moz-transition: all 300ms ease 100ms;
75 | transition: all 300ms ease 100ms;
76 | display: block
77 | }
78 |
79 | .products li a img {
80 | max-width: 120px;
81 | max-height: 120px;
82 | margin: 5px auto 10px;
83 | display: block;
84 | position: absolute;
85 | top: 0;
86 | left: 0;
87 | right: 0;
88 | bottom: 10px
89 | }
90 |
91 | .products li a h4 {
92 | color: red;
93 | font-size: 14px;
94 | font-weight: bold;
95 | -webkit-transition: all 300ms ease 100ms;
96 | -moz-transition: all 300ms ease 100ms;
97 | transition: all 300ms ease 100ms;
98 | display: table-cell;
99 | line-height: inherit
100 | }
101 |
102 | .products li a h5 {
103 | color: #888;
104 | padding-left: 8px;
105 | font-size: 12px;
106 | font-weight: normal;
107 | text-decoration: line-through;
108 | line-height: 18px;
109 | display: table-cell
110 | }
111 |
112 | .products li .textkm {
113 | display: table-row;
114 | vertical-align: bottom;
115 | font-size: 11px;
116 | color: #999;
117 | height: 10px;
118 | line-height: 10px
119 | }
120 |
121 | .products li .textkm strong {
122 | margin-right: 5px;
123 | color: red;
124 | font-weight: 700
125 | }
126 |
127 | .products li .banonline {
128 | text-transform: uppercase;
129 | font-size: 9px;
130 | font-weight: 700;
131 | color: #0876e6;
132 | display: table-row
133 | }
134 |
135 | .products li .giaohang2-7 {
136 | text-transform: uppercase;
137 | font-size: 9px;
138 | font-weight: 700;
139 | color: #0876e6;
140 | display: table-row
141 | }
142 |
143 | .products li .ngung-kd {
144 | text-transform: uppercase;
145 | font-size: 9px;
146 | font-weight: 700;
147 | color: #b00;
148 | display: table-row
149 | }
150 |
151 | .products li .uudailon {
152 | text-transform: uppercase;
153 | font-size: 9px;
154 | font-weight: 700;
155 | color: #0876e6;
156 | display: table-row
157 | }
158 |
159 | .products li .dattruoc {
160 | text-transform: uppercase;
161 | font-size: 9px;
162 | font-weight: 700;
163 | color: #0876e6;
164 | display: table-row
165 | }
166 |
167 | .products li.double-col .uudailon {
168 | position: absolute;
169 | right: 5px;
170 | bottom: 0
171 | }
172 |
173 | .products li .tagmoi {
174 | position: absolute;
175 | right: 5px;
176 | top: 5px;
177 | z-index: 2;
178 | background: #006dbb;
179 | border-radius: 3px;
180 | padding: 0 5px;
181 | text-align: center;
182 | color: #fff;
183 | text-transform: uppercase;
184 | font-family: 13px;
185 | font-weight: 700;
186 | height: 20px;
187 | line-height: 20px
188 | }
189 |
190 | .products li .tagkmlon {
191 | background: #ff8a00
192 | }
193 |
194 | .products li .taguudailon {
195 | background: #06b70f
196 | }
197 |
198 | .products li .taggiasoc {
199 | background: #b00
200 | }
201 |
202 | .products li .tagdattruoc {
203 | background: #06b70f
204 | }
205 |
206 | .products li .tagimg {
207 | position: absolute;
208 | right: 0;
209 | top: 0;
210 | z-index: 2;
211 | width: 61px;
212 | height: 58px
213 | }
214 |
215 | .products li .tagimg.hot {
216 | background: url(../images/icon-hot.png) no-repeat
217 | }
218 |
219 | .products li .tagimg.downprice {
220 | background: url(../images/icon-downprice.png) no-repeat
221 | }
222 |
223 | .products li .btncompare {
224 | display: block;
225 | cursor: pointer;
226 | background: #8e8e8e;
227 | font-size: 12px;
228 | color: #fff;
229 | text-align: center;
230 | width: 115px;
231 | height: 17px;
232 | padding-bottom: 3px;
233 | position: absolute;
234 | bottom: 85px;
235 | left: 24%;
236 | z-index: 100;
237 | border-radius: 3px 3px 3px 3px;
238 | -webkit-border-radius: 3px 3px 3px 3px;
239 | -moz-border-radius: 3px 3px 3px 3px;
240 | -webkit-transition: all .5s ease;
241 | -moz-transition: all .5s ease;
242 | -o-transition: all .5s ease;
243 | -ms-transition: all .5s ease;
244 | transition: all .5s ease;
245 | -ms-opacity: 0;
246 | opacity: 0;
247 | -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=0)";
248 | filter: alpha(opacity = 0)
249 | }
250 |
251 | .products li:hover .btncompare {
252 | -ms-opacity: 1;
253 | opacity: 1;
254 | -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=100)";
255 | filter: alpha(opacity = 100);
256 | -khtml-opacity: 1
257 | }
258 |
259 | .products li .btncompare2 {
260 | bottom: 60px
261 | }
262 |
263 | .products li .info {
264 | display: block;
265 | overflow: hidden;
266 | -ms-opacity: 0;
267 | opacity: 0;
268 | background: rgba(0, 0, 0, 0);
269 | height: 120px;
270 | width: 91%;
271 | padding: 10px;
272 | font-size: 12px;
273 | color: #fff;
274 | line-height: 16px;
275 | position: absolute;
276 | top: 0;
277 | left: 0;
278 | z-index: 99;
279 | -webkit-transition: all .5s ease;
280 | -moz-transition: all .5s ease;
281 | -o-transition: all .5s ease;
282 | -ms-transition: all .5s ease;
283 | transition: all .5s ease;
284 | -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=0)";
285 | filter: alpha(opacity = 0)
286 | }
287 |
288 | .products li:hover .info {
289 | background: rgba(0, 0, 0, .85);
290 | -ms-opacity: 1;
291 | opacity: 1;
292 | -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=100)";
293 | filter: alpha(opacity = 100);
294 | -khtml-opacity: 1
295 | }
296 |
297 | .products li .info span {
298 | color: #fff;
299 | display: block;
300 | padding: 2px 6px
301 | }
302 |
303 | @media screen and (max-width:1160px) {
304 | .products {
305 | min-width: 904px
306 | }
307 | .products.homepage {
308 | min-width: 604px
309 | }
310 | .products li {
311 | width: 179px
312 | }
313 | .products li .btncompare {
314 | left: 17.5%;
315 | bottom: 92px
316 | }
317 | .products li .btncompare2 {
318 | bottom: 60px
319 | }
320 | .products li a img {
321 | margin-bottom: 0
322 | }
323 | .products li .banonline {
324 | line-height: 12px
325 | }
326 | .products li .giaohang2-7 {
327 | line-height: 12px
328 | }
329 | .products li .ngung-kd {
330 | line-height: 12px
331 | }
332 | .products li .uudailon {
333 | line-height: 12px
334 | }
335 | .products li .dattruoc {
336 | line-height: 12px
337 | }
338 | .products li .info {
339 | height: 128px;
340 | padding: 2px;
341 | width: 98%
342 | }
343 | }
344 |
345 | html,body,p,a,font,ol,ul,li,form,label,th,td {
346 | margin: 0;
347 | padding: 0;
348 | border: 0;
349 | outline: 0;
350 | font-weight: inherit;
351 | font-style: inherit;
352 | font-size: 100%;
353 | font-family: inherit;
354 | vertical-align: baseline
355 | }
356 |
357 | #site-wrapper {
358 | line-height: 1;
359 | color: #000;
360 | background: #fff;
361 | width: 802px;
362 | color: #333;
363 | font-size: 14px;
364 | font-family: 'Open Sans', "HelveticaNeue", "Helvetica Neue", Helvetica,
365 | Arial, sans-serif;
366 | line-height: 18px;
367 |
368 | }
369 |
370 | #site-wrapper-p {
371 | line-height: 1;
372 | color: #000;
373 | background: #fff;
374 | width: 802px;
375 | color: #333;
376 | font-size: 14px;
377 | font-family: 'Open Sans', "HelveticaNeue", "Helvetica Neue", Helvetica,
378 | Arial, sans-serif;
379 | line-height: 18px;
380 | margin 0 auto !important;
381 |
382 | }
383 |
384 | :focus {
385 | outline: 0;
386 | outline-width: 0
387 | }
388 |
389 | ol,ul {
390 | list-style: none
391 | }
392 |
393 | a img {
394 | border: none
395 | }
396 |
397 |
398 | a {
399 | color: #0af;
400 | text-decoration: none
401 | }
402 |
403 | a:hover {
404 | color: #069;
405 | border-bottom: 1px dotted #91b369
406 | }
407 |
408 | h1,h2,h3,h4,h5,h6 {
409 | color: #000;
410 | font-weight: normal;
411 | margin: 0;
412 | margin-bottom: 18px;
413 | text-rendering: optimizelegibility
414 | }
415 |
416 | h1 a,h2 a,h3 a,h4 a,h5 a,h6 a,h1 a:hover,h2 a:hover,h3 a:hover,h4 a:hover,h5 a:hover,h6 a:hover
417 | {
418 | border-bottom: none;
419 | text-decoration: none
420 | }
421 |
422 | h1 {
423 | font-size: 45px;
424 | line-height: 54px
425 | }
426 |
427 | h2 {
428 | font-size: 36px;
429 | line-height: 45px
430 | }
431 |
432 | h3 {
433 | font-size: 27px;
434 | line-height: 36px
435 | }
436 |
437 | h4 {
438 | font-size: 18px;
439 | height: auto;
440 | line-height: 27px
441 | }
442 |
443 | h5 {
444 | font-size: 16px;
445 | line-height: 27px
446 | }
447 |
448 | h6 {
449 | font-size: 14px;
450 | line-height: 18px
451 | }
452 |
453 | ul,ol,p,blockquote {
454 | font-size: 13px;
455 | line-height: 18px;
456 | margin-bottom: 18px
457 | }
458 |
459 | ul,ol {
460 | margin-left: 27px
461 | }
462 |
463 | ul {
464 | list-style: square
465 | }
466 |
467 | ol {
468 | list-style: decimal
469 | }
470 |
471 | ul li,ol li {
472 | margin-bottom: 9px
473 | font-size: 13px
474 | }
475 |
476 |
477 | p a {
478 | font-size: 13px
479 | }
480 |
481 | ul li ol,ul li ul,ol li ol,ol li ul {
482 | margin: 9px 27px 0
483 | }
484 |
485 | ul li ul,ol li ul {
486 | list-style-type: disc
487 | }
488 |
489 | ul,ol {
490 |
491 | }
492 |
493 | ul.paragraph li,ol.paragraph li,ul li p,ol li p {
494 | margin-bottom: 18px
495 | }
496 |
497 | p {
498 | text-indent: 0;
499 | -moz-hyphens: auto;
500 | -ms-hyphens: auto;
501 | -webkit-hyphens: auto;
502 | hyphens: auto;
503 | word-wrap: break-word
504 | }
505 |
506 | strong {
507 | font-weight: bold
508 | }
509 |
510 | @font-face {
511 | font-family: 'Open Sans';
512 | font-style: normal;
513 | font-weight: 300;
514 | src: local('Open Sans Light'), local('OpenSans-Light'),
515 | url(http://cdn.tgdd.vn/fonts/opensans/DXI1ORHCpsQm3Vp6mXoaTXwUvq1pQaUIDqPgpae5ItU.woff)
516 | format('woff')
517 | }
518 |
519 | @font-face {
520 | font-family: 'Open Sans';
521 | font-style: normal;
522 | font-weight: 400;
523 | src: local('Open Sans'), local('OpenSans'),
524 | url(http://cdn.tgdd.vn/fonts/opensans/59ZRklaO5bWGqF5A9baEET8E0i7KZn-EPnyo3HZu7kw.woff)
525 | format('woff')
526 | }
527 |
528 | @font-face {
529 | font-family: 'Open Sans';
530 | font-style: normal;
531 | font-weight: 600;
532 | src: local('Open Sans Semibold'), local('OpenSans-Semibold'),
533 | url(http://cdn.tgdd.vn/fonts/opensans/MTP_ySUJH_bn48VBG8sNSnwUvq1pQaUIDqPgpae5ItU.woff)
534 | format('woff')
535 | }
536 |
537 | @font-face {
538 | font-family: 'Open Sans';
539 | font-style: normal;
540 | font-weight: 700;
541 | src: local('Open Sans Bold'), local('OpenSans-Bold'),
542 | url(http://cdn.tgdd.vn/fonts/opensans/k3k702ZOKiLJc3WVjuplzHwUvq1pQaUIDqPgpae5ItU.woff)
543 | format('woff')
544 | }
545 |
546 | @font-face {
547 | font-family: 'Open Sans';
548 | font-style: normal;
549 | font-weight: 800;
550 | src: local('Open Sans Extrabold'), local('OpenSans-Extrabold'),
551 | url(http://cdn.tgdd.vn/fonts/opensans/EInbV5DfGHOiMmvb1Xr-hnwUvq1pQaUIDqPgpae5ItU.woff)
552 | format('woff')
553 | }
554 |
555 | @font-face {
556 | font-family: 'Open Sans';
557 | font-style: italic;
558 | font-weight: 300;
559 | src: local('Open Sans Light Italic'), local('OpenSansLight-Italic'),
560 | url(http://cdn.tgdd.vn/fonts/opensans/PRmiXeptR36kaC0GEAetxsJIfR0j-Hc3mXsqdoe9vx8.woff)
561 | format('woff')
562 | }
563 |
564 | @font-face {
565 | font-family: 'Open Sans';
566 | font-style: italic;
567 | font-weight: 400;
568 | src: local('Open Sans Italic'), local('OpenSans-Italic'),
569 | url(http://cdn.tgdd.vn/fonts/opensans/xjAJXh38I15wypJXxuGMBkbnXQ06sCSpaytluCdpFnY.woff)
570 | format('woff')
571 | }
572 |
573 | @font-face {
574 | font-family: 'Open Sans';
575 | font-style: italic;
576 | font-weight: 600;
577 | src: local('Open Sans Semibold Italic'),
578 | local('OpenSans-SemiboldItalic'),
579 | url(http://cdn.tgdd.vn/fonts/opensans/PRmiXeptR36kaC0GEAetxrkV11xRSeRSsXvODowCrgc.woff)
580 | format('woff')
581 | }
582 |
583 | @font-face {
584 | font-family: 'Open Sans';
585 | font-style: italic;
586 | font-weight: 700;
587 | src: local('Open Sans Bold Italic'), local('OpenSans-BoldItalic'),
588 | url(http://cdn.tgdd.vn/fonts/opensans/PRmiXeptR36kaC0GEAetxttxB2icnUq6NyCcJOfFtRI.woff)
589 | format('woff')
590 | }
591 |
592 | @font-face {
593 | font-family: 'Open Sans';
594 | font-style: italic;
595 | font-weight: 800;
596 | src: local('Open Sans Extrabold Italic'),
597 | local('OpenSans-ExtraboldItalic'),
598 | url(http://cdn.tgdd.vn/fonts/opensans/PRmiXeptR36kaC0GEAetxq6EGkuGQVtC-K3yp5dayWY.woff)
599 | format('woff')
600 | }
--------------------------------------------------------------------------------
/Source/WebContent/css/style.css:
--------------------------------------------------------------------------------
1 | body {
2 | font-family: Arial, Tahoma;
3 | font-size: 12px;
4 | }
5 |
6 | #main {
7 | width: 1060px;
8 | padding: 0;
9 | margin-left: auto;
10 | margin-right: auto;
11 | }
12 |
13 | #head {
14 | height: 200px;
15 | background-color: #F5F5F5;
16 | border: 1px solid #CDCDCD;
17 | margin-bottom: 5px;
18 | margin-top: 5px;
19 | }
20 |
21 | #head-link {
22 | height: 50px;
23 | line-height: 30px;
24 | border: 1px solid #CDCDCD;
25 | background-color: #F5F5F5;
26 | margin-bottom: 5px;
27 | clear: both;
28 | }
29 |
30 | #content {
31 | min-height: 430px;
32 | border: 0px solid #CDCDCD;
33 | float: left;
34 | margin-bottom: 5px;
35 | clear: both;
36 | }
37 |
38 | #content_center{
39 | width: 1050px;
40 | min-height: 430px;
41 | border: 0px solid #CDCDCD;
42 | float: left;
43 | align: center;
44 | margin-bottom: 5px;
45 | clear: both;
46 | }
47 |
48 | #left {
49 | width: 250px;
50 | min-height: 430px;
51 | border: 1px solid #CDCDCD;
52 | float: left;
53 | }
54 |
55 | #right {
56 | width: 800px;
57 | min-height: 430px;
58 | border: 0px solid #CDCDCD;
59 | float: right;
60 | margin-left: 5px;
61 | }
62 |
63 | #footer {
64 | height: 50px;
65 | clear: both;
66 | border: 1px solid #CDCDCD;
67 | background-color: #F8F8FF;
68 | margin-bottom: 5px;
69 | }
--------------------------------------------------------------------------------
/Source/WebContent/detail.jsp:
--------------------------------------------------------------------------------
1 | <%@page import="dao.ProductDAOImpl"%>
2 | <%@ page language="java" contentType="text/html; charset=UTF-8"
3 | pageEncoding="UTF-8"%>
4 | <%@page import="java.text.NumberFormat"%>
5 |
6 |
7 |
8 |
9 | Chi tiết sản phẩm
10 |
11 |
12 |
54 |
55 |
56 |
57 | <%
58 | // ham nay de lay ma san pham truyen qua tren thanh dia chj
59 | String ma_san_pham = "";
60 | if (request.getParameter("ma_san_pham") != null) {
61 | ma_san_pham = request.getParameter("ma_san_pham");
62 | }
63 |
64 | ProductDAOImpl productDAO = new ProductDAOImpl();
65 | NumberFormat nf = NumberFormat.getInstance();
66 | nf.setMinimumFractionDigits(0);
67 | %>
68 |
69 |
70 |

71 |
72 | <%
73 |
74 | String username = null;
75 | Cookie[] cookies = request.getCookies();
76 | if(cookies !=null)
77 | {
78 | for(Cookie cookie : cookies)
79 | {
80 | if(cookie.getName().equals("username"))
81 | username = cookie.getValue();
82 | }
83 | }
84 |
85 |
86 | if (username != null) {
87 | %>
88 |
89 |
101 |
102 | <%
103 | } else {
104 | %>
105 |
106 |
118 |
119 | <%
120 | }
121 | %>
122 |
123 |
124 |
125 |
)
127 | .getHinh_anh()%>)
129 |
130 |
131 |
132 |
133 | <%=productDAO.getProduct(Integer.parseInt(ma_san_pham))
135 | .getTen_san_pham()%> |
136 |
137 |
138 | Hãng sản xuất: |
139 | <%=productDAO.getProduct(Integer.parseInt(ma_san_pham))
140 | .getHang_san_xuat()%> |
141 |
142 |
143 |
144 | Giá bán: |
145 | <%=nf.format(productDAO.getProduct(Integer.parseInt(ma_san_pham))
146 | .getGia_ban()) %> VNĐ |
147 |
148 |
149 |
150 |
151 | <% if(username != null) { %>
152 |
154 |

157 |
163 |
164 | <%} else { %>
165 |
167 |

170 |
171 | <%} %>
172 |
189 |
190 |
191 |
192 |
193 |
194 |
195 |
--------------------------------------------------------------------------------
/Source/WebContent/footer.jsp:
--------------------------------------------------------------------------------
1 | <%@ page language="java" contentType="text/html; charset=UTF-8"
2 | pageEncoding="UTF-8"%>
3 |
4 |
5 |
6 |
7 | Footer
8 |
9 |
10 | Lập trình ứng dụng Java © 2015 by 1212050
12 |
13 |
--------------------------------------------------------------------------------
/Source/WebContent/history.jsp:
--------------------------------------------------------------------------------
1 | <%@page import="model.History"%>
2 | <%@page import="dao.HistoryDAOImpl"%>
3 | <%@page import="model.Cart"%>
4 | <%@page import="java.util.List"%>
5 | <%@page import="dao.ProductDAOImpl"%>
6 | <%@page import="java.util.ArrayList"%>
7 | <%@page import="java.text.NumberFormat"%>
8 | <%@ page language="java" contentType="text/html; charset=UTF-8"
9 | pageEncoding="UTF-8"%>
10 | <%@page import="dao.UserDAOImpl"%>
11 | <%@page import="model.User"%>
12 | <%@page import="dao.UserDAO"%>
13 |
14 |
15 |
16 |
17 | Giỏ hàng
18 |
19 |
20 |
21 |
22 |
64 |
65 |
66 | <%
67 | String username = null;
68 | Cookie[] cookies = request.getCookies();
69 | if(cookies !=null)
70 | {
71 | for(Cookie cookie : cookies)
72 | {
73 | if(cookie.getName().equals("username"))
74 | username = cookie.getValue();
75 | }
76 | }
77 | %>
78 |
79 |
80 |

81 |
82 |
83 |
95 |
96 |
97 |
98 |
99 |
157 |
158 |
159 |
160 |
161 |
162 |
--------------------------------------------------------------------------------
/Source/WebContent/images/1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/manhduydl/Shopping-web-Jsp-Servlet/3db2f59e6ba1b27800babec455f7fad448740e4d/Source/WebContent/images/1.png
--------------------------------------------------------------------------------
/Source/WebContent/images/2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/manhduydl/Shopping-web-Jsp-Servlet/3db2f59e6ba1b27800babec455f7fad448740e4d/Source/WebContent/images/2.png
--------------------------------------------------------------------------------
/Source/WebContent/images/3.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/manhduydl/Shopping-web-Jsp-Servlet/3db2f59e6ba1b27800babec455f7fad448740e4d/Source/WebContent/images/3.png
--------------------------------------------------------------------------------
/Source/WebContent/images/4.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/manhduydl/Shopping-web-Jsp-Servlet/3db2f59e6ba1b27800babec455f7fad448740e4d/Source/WebContent/images/4.png
--------------------------------------------------------------------------------
/Source/WebContent/images/5.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/manhduydl/Shopping-web-Jsp-Servlet/3db2f59e6ba1b27800babec455f7fad448740e4d/Source/WebContent/images/5.png
--------------------------------------------------------------------------------
/Source/WebContent/images/6.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/manhduydl/Shopping-web-Jsp-Servlet/3db2f59e6ba1b27800babec455f7fad448740e4d/Source/WebContent/images/6.png
--------------------------------------------------------------------------------
/Source/WebContent/images/7.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/manhduydl/Shopping-web-Jsp-Servlet/3db2f59e6ba1b27800babec455f7fad448740e4d/Source/WebContent/images/7.png
--------------------------------------------------------------------------------
/Source/WebContent/images/arrow.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/manhduydl/Shopping-web-Jsp-Servlet/3db2f59e6ba1b27800babec455f7fad448740e4d/Source/WebContent/images/arrow.png
--------------------------------------------------------------------------------
/Source/WebContent/images/banner.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/manhduydl/Shopping-web-Jsp-Servlet/3db2f59e6ba1b27800babec455f7fad448740e4d/Source/WebContent/images/banner.jpg
--------------------------------------------------------------------------------
/Source/WebContent/images/bg.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/manhduydl/Shopping-web-Jsp-Servlet/3db2f59e6ba1b27800babec455f7fad448740e4d/Source/WebContent/images/bg.png
--------------------------------------------------------------------------------
/Source/WebContent/images/blog-icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/manhduydl/Shopping-web-Jsp-Servlet/3db2f59e6ba1b27800babec455f7fad448740e4d/Source/WebContent/images/blog-icon.png
--------------------------------------------------------------------------------
/Source/WebContent/images/contact-icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/manhduydl/Shopping-web-Jsp-Servlet/3db2f59e6ba1b27800babec455f7fad448740e4d/Source/WebContent/images/contact-icon.png
--------------------------------------------------------------------------------
/Source/WebContent/images/delete.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/manhduydl/Shopping-web-Jsp-Servlet/3db2f59e6ba1b27800babec455f7fad448740e4d/Source/WebContent/images/delete.png
--------------------------------------------------------------------------------
/Source/WebContent/images/dot.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/manhduydl/Shopping-web-Jsp-Servlet/3db2f59e6ba1b27800babec455f7fad448740e4d/Source/WebContent/images/dot.png
--------------------------------------------------------------------------------
/Source/WebContent/images/edit.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/manhduydl/Shopping-web-Jsp-Servlet/3db2f59e6ba1b27800babec455f7fad448740e4d/Source/WebContent/images/edit.png
--------------------------------------------------------------------------------
/Source/WebContent/images/giohang.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/manhduydl/Shopping-web-Jsp-Servlet/3db2f59e6ba1b27800babec455f7fad448740e4d/Source/WebContent/images/giohang.png
--------------------------------------------------------------------------------
/Source/WebContent/images/home-icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/manhduydl/Shopping-web-Jsp-Servlet/3db2f59e6ba1b27800babec455f7fad448740e4d/Source/WebContent/images/home-icon.png
--------------------------------------------------------------------------------
/Source/WebContent/images/icon-cart.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/manhduydl/Shopping-web-Jsp-Servlet/3db2f59e6ba1b27800babec455f7fad448740e4d/Source/WebContent/images/icon-cart.png
--------------------------------------------------------------------------------
/Source/WebContent/images/icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/manhduydl/Shopping-web-Jsp-Servlet/3db2f59e6ba1b27800babec455f7fad448740e4d/Source/WebContent/images/icon.png
--------------------------------------------------------------------------------
/Source/WebContent/images/icon2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/manhduydl/Shopping-web-Jsp-Servlet/3db2f59e6ba1b27800babec455f7fad448740e4d/Source/WebContent/images/icon2.png
--------------------------------------------------------------------------------
/Source/WebContent/images/image-icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/manhduydl/Shopping-web-Jsp-Servlet/3db2f59e6ba1b27800babec455f7fad448740e4d/Source/WebContent/images/image-icon.png
--------------------------------------------------------------------------------
/Source/WebContent/images/into.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/manhduydl/Shopping-web-Jsp-Servlet/3db2f59e6ba1b27800babec455f7fad448740e4d/Source/WebContent/images/into.png
--------------------------------------------------------------------------------
/Source/WebContent/images/logout.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/manhduydl/Shopping-web-Jsp-Servlet/3db2f59e6ba1b27800babec455f7fad448740e4d/Source/WebContent/images/logout.png
--------------------------------------------------------------------------------
/Source/WebContent/images/mail.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/manhduydl/Shopping-web-Jsp-Servlet/3db2f59e6ba1b27800babec455f7fad448740e4d/Source/WebContent/images/mail.png
--------------------------------------------------------------------------------
/Source/WebContent/images/notepad-icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/manhduydl/Shopping-web-Jsp-Servlet/3db2f59e6ba1b27800babec455f7fad448740e4d/Source/WebContent/images/notepad-icon.png
--------------------------------------------------------------------------------
/Source/WebContent/images/search-icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/manhduydl/Shopping-web-Jsp-Servlet/3db2f59e6ba1b27800babec455f7fad448740e4d/Source/WebContent/images/search-icon.png
--------------------------------------------------------------------------------
/Source/WebContent/images/settings.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/manhduydl/Shopping-web-Jsp-Servlet/3db2f59e6ba1b27800babec455f7fad448740e4d/Source/WebContent/images/settings.png
--------------------------------------------------------------------------------
/Source/WebContent/images/shirt-icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/manhduydl/Shopping-web-Jsp-Servlet/3db2f59e6ba1b27800babec455f7fad448740e4d/Source/WebContent/images/shirt-icon.png
--------------------------------------------------------------------------------
/Source/WebContent/images/store-icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/manhduydl/Shopping-web-Jsp-Servlet/3db2f59e6ba1b27800babec455f7fad448740e4d/Source/WebContent/images/store-icon.png
--------------------------------------------------------------------------------
/Source/WebContent/images/tick.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/manhduydl/Shopping-web-Jsp-Servlet/3db2f59e6ba1b27800babec455f7fad448740e4d/Source/WebContent/images/tick.png
--------------------------------------------------------------------------------
/Source/WebContent/images/tip.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/manhduydl/Shopping-web-Jsp-Servlet/3db2f59e6ba1b27800babec455f7fad448740e4d/Source/WebContent/images/tip.png
--------------------------------------------------------------------------------
/Source/WebContent/images/tip2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/manhduydl/Shopping-web-Jsp-Servlet/3db2f59e6ba1b27800babec455f7fad448740e4d/Source/WebContent/images/tip2.png
--------------------------------------------------------------------------------
/Source/WebContent/images/tip3.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/manhduydl/Shopping-web-Jsp-Servlet/3db2f59e6ba1b27800babec455f7fad448740e4d/Source/WebContent/images/tip3.png
--------------------------------------------------------------------------------
/Source/WebContent/images/top-key.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/manhduydl/Shopping-web-Jsp-Servlet/3db2f59e6ba1b27800babec455f7fad448740e4d/Source/WebContent/images/top-key.png
--------------------------------------------------------------------------------
/Source/WebContent/images/top-lock.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/manhduydl/Shopping-web-Jsp-Servlet/3db2f59e6ba1b27800babec455f7fad448740e4d/Source/WebContent/images/top-lock.png
--------------------------------------------------------------------------------
/Source/WebContent/images/top-note.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/manhduydl/Shopping-web-Jsp-Servlet/3db2f59e6ba1b27800babec455f7fad448740e4d/Source/WebContent/images/top-note.png
--------------------------------------------------------------------------------
/Source/WebContent/images/trash.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/manhduydl/Shopping-web-Jsp-Servlet/3db2f59e6ba1b27800babec455f7fad448740e4d/Source/WebContent/images/trash.gif
--------------------------------------------------------------------------------
/Source/WebContent/images/update.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/manhduydl/Shopping-web-Jsp-Servlet/3db2f59e6ba1b27800babec455f7fad448740e4d/Source/WebContent/images/update.png
--------------------------------------------------------------------------------
/Source/WebContent/images/user.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/manhduydl/Shopping-web-Jsp-Servlet/3db2f59e6ba1b27800babec455f7fad448740e4d/Source/WebContent/images/user.png
--------------------------------------------------------------------------------
/Source/WebContent/images/web-icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/manhduydl/Shopping-web-Jsp-Servlet/3db2f59e6ba1b27800babec455f7fad448740e4d/Source/WebContent/images/web-icon.png
--------------------------------------------------------------------------------
/Source/WebContent/index.jsp:
--------------------------------------------------------------------------------
1 | <%@page import="java.util.ArrayList"%>
2 | <%@page import="model.Product"%>
3 | <%@page import="java.util.List"%>
4 | <%@page import="dao.ProductDAOImpl"%>
5 | <%@page import="java.text.NumberFormat"%>
6 | <%@ page language="java" contentType="text/html; charset=UTF-8"
7 | pageEncoding="UTF-8"%>
8 |
9 |
10 |
11 |
12 | Trang chủ
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |

22 |
23 |
24 | <%
25 | String username = null;
26 | Cookie[] cookies = request.getCookies();
27 | if(cookies !=null)
28 | {
29 | for(Cookie cookie : cookies)
30 | {
31 | if(cookie.getName().equals("username"))
32 | username = cookie.getValue();
33 | }
34 | }
35 |
36 | if (username != null) {
37 | %>
38 |
39 |
51 |
52 | <%
53 | } else {
54 | %>
55 |
56 |
68 |
69 | <%
70 | }
71 | %>
72 |
73 |
74 |
75 | <%
76 | ProductDAOImpl productDAO = new ProductDAOImpl();
77 | List
list = new ArrayList();
78 | list = productDAO.getList();
79 | String ma_the_loai = null;
80 | if (request.getParameter("ma_the_loai") != null) {
81 | ma_the_loai = request.getParameter("ma_the_loai");
82 | }
83 | NumberFormat nf = NumberFormat.getInstance();
84 | nf.setMinimumFractionDigits(0);
85 | %>
86 |
138 |
139 |
140 |
141 |
142 |
143 |
144 |
--------------------------------------------------------------------------------
/Source/WebContent/login.jsp:
--------------------------------------------------------------------------------
1 | <%@ page language="java" contentType="text/html; charset=UTF-8"
2 | pageEncoding="UTF-8"%>
3 |
4 |
5 |
6 |
7 |
8 | Đăng nhập hệ thống
9 |
10 |
11 | <%
12 | String err = "";
13 | if (request.getAttribute("err") != null) {
14 | err = (String) request.getAttribute("err");
15 | }
16 | %>
17 |
18 |
19 |
20 |
21 |

22 |
LOGIN
23 |
24 |
25 |
26 |
63 |
64 |
65 |
66 |
67 |
--------------------------------------------------------------------------------
/Source/WebContent/product.jsp:
--------------------------------------------------------------------------------
1 | <%@page import="java.util.ArrayList"%>
2 | <%@page import="model.Product"%>
3 | <%@page import="java.util.List"%>
4 | <%@page import="dao.ProductDAOImpl"%>
5 | <%@page import="java.text.NumberFormat"%>
6 | <%@ page language="java" contentType="text/html; charset=UTF-8"
7 | pageEncoding="UTF-8"%>
8 | <%@taglib uri="/WEB-INF/taglib139.tld" prefix="pg"%>
9 |
10 |
11 |
12 |
13 | Sản phẩm
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |

23 |
24 | <%
25 | String username = null;
26 | Cookie[] cookies = request.getCookies();
27 | if(cookies !=null)
28 | {
29 | for(Cookie cookie : cookies)
30 | {
31 | if(cookie.getName().equals("username"))
32 | username = cookie.getValue();
33 | }
34 | }
35 |
36 | if (username != null) {
37 | %>
38 |
39 |
51 |
52 | <%
53 | } else {
54 | %>
55 |
56 |
68 |
69 | <%
70 | }
71 | %>
72 |
73 |
74 |
75 | <%
76 | ProductDAOImpl productDAO = new ProductDAOImpl();
77 |
78 | NumberFormat nf = NumberFormat.getInstance();
79 | nf.setMinimumFractionDigits(0);
80 | %>
81 |
82 |
111 |
112 |
117 |
118 |
119 |
120 |
121 |
--------------------------------------------------------------------------------
/Source/WebContent/register.jsp:
--------------------------------------------------------------------------------
1 | <%@ page language="java" contentType="text/html; charset=UTF-8"
2 | pageEncoding="UTF-8"%>
3 |
4 |
5 |
6 |
7 |
8 |
Đăng kí tài khoản
9 |
10 |
11 | <%
12 | String err = "";
13 | if (request.getAttribute("err") != null) {
14 | err = (String) request.getAttribute("err");
15 | }
16 | %>
17 |
18 |
19 |
20 |
21 |

22 |
Đăng ký
23 |
24 |
25 |
64 |
65 |
66 |
67 |
--------------------------------------------------------------------------------
/Source/WebContent/resetpassword.jsp:
--------------------------------------------------------------------------------
1 | <%@ page language="java" contentType="text/html; charset=UTF-8"
2 | pageEncoding="UTF-8"%>
3 |
4 |
5 |
6 |
7 |
8 |
Khôi phục mật khẩu
9 |
10 |
11 | <%
12 | String err = "";
13 | if (request.getAttribute("err") != null) {
14 | err = (String) request.getAttribute("err");
15 | }
16 | %>
17 |
18 |
19 |
20 |
21 |

22 |
Khôi phục mật khẩu
23 |
24 |
25 |
41 |
42 |
43 |
44 |
45 |
--------------------------------------------------------------------------------
/Source/WebContent/sanpham/dep.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/manhduydl/Shopping-web-Jsp-Servlet/3db2f59e6ba1b27800babec455f7fad448740e4d/Source/WebContent/sanpham/dep.jpg
--------------------------------------------------------------------------------
/Source/WebContent/sanpham/icon-downprice.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/manhduydl/Shopping-web-Jsp-Servlet/3db2f59e6ba1b27800babec455f7fad448740e4d/Source/WebContent/sanpham/icon-downprice.png
--------------------------------------------------------------------------------
/Source/WebContent/sanpham/icon-hot.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/manhduydl/Shopping-web-Jsp-Servlet/3db2f59e6ba1b27800babec455f7fad448740e4d/Source/WebContent/sanpham/icon-hot.png
--------------------------------------------------------------------------------
/Source/WebContent/sanpham/nam.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/manhduydl/Shopping-web-Jsp-Servlet/3db2f59e6ba1b27800babec455f7fad448740e4d/Source/WebContent/sanpham/nam.jpg
--------------------------------------------------------------------------------
/Source/WebContent/sanpham/new.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/manhduydl/Shopping-web-Jsp-Servlet/3db2f59e6ba1b27800babec455f7fad448740e4d/Source/WebContent/sanpham/new.jpg
--------------------------------------------------------------------------------
/Source/WebContent/sanpham/non.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/manhduydl/Shopping-web-Jsp-Servlet/3db2f59e6ba1b27800babec455f7fad448740e4d/Source/WebContent/sanpham/non.jpg
--------------------------------------------------------------------------------
/Source/WebContent/sanpham/nostyle.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/manhduydl/Shopping-web-Jsp-Servlet/3db2f59e6ba1b27800babec455f7fad448740e4d/Source/WebContent/sanpham/nostyle.jpg
--------------------------------------------------------------------------------
/Source/WebContent/sanpham/nu1.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/manhduydl/Shopping-web-Jsp-Servlet/3db2f59e6ba1b27800babec455f7fad448740e4d/Source/WebContent/sanpham/nu1.jpg
--------------------------------------------------------------------------------
/Source/WebContent/sanpham/nu2.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/manhduydl/Shopping-web-Jsp-Servlet/3db2f59e6ba1b27800babec455f7fad448740e4d/Source/WebContent/sanpham/nu2.jpg
--------------------------------------------------------------------------------
/Source/WebContent/sanpham/nu3.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/manhduydl/Shopping-web-Jsp-Servlet/3db2f59e6ba1b27800babec455f7fad448740e4d/Source/WebContent/sanpham/nu3.jpg
--------------------------------------------------------------------------------
/Source/WebContent/sanpham/nu4.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/manhduydl/Shopping-web-Jsp-Servlet/3db2f59e6ba1b27800babec455f7fad448740e4d/Source/WebContent/sanpham/nu4.jpg
--------------------------------------------------------------------------------
/Source/WebContent/search_menu.jsp:
--------------------------------------------------------------------------------
1 | <%@page import="java.util.ArrayList"%>
2 | <%@page import="model.Category"%>
3 | <%@page import="java.util.List"%>
4 | <%@page import="dao.CategoryDAOImpl"%>
5 | <%@ page language="java" contentType="text/html; charset=UTF-8"
6 | pageEncoding="UTF-8"%>
7 |
8 |
9 |
10 |
11 |
Menu dọc
12 |
13 |
14 |
15 | <%
16 | CategoryDAOImpl categoryDAO = new CategoryDAOImpl();
17 | List
list = new ArrayList();
18 | list = categoryDAO.getList();
19 | String err="";
20 | %>
21 |
22 |
50 |
51 |
52 |
--------------------------------------------------------------------------------
/Source/WebContent/search_page.jsp:
--------------------------------------------------------------------------------
1 | <%@page import="java.util.ArrayList"%>
2 | <%@page import="model.Product"%>
3 | <%@page import="java.util.List"%>
4 | <%@page import="dao.ProductDAOImpl"%>
5 | <%@page import="java.text.NumberFormat"%>
6 | <%@ page language="java" contentType="text/html; charset=UTF-8"
7 | pageEncoding="UTF-8"%>
8 |
9 |
10 |
11 |
12 | Trang chủ
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |

22 |
23 |
24 | <%
25 | String username = null;
26 | Cookie[] cookies = request.getCookies();
27 | if(cookies !=null)
28 | {
29 | for(Cookie cookie : cookies)
30 | {
31 | if(cookie.getName().equals("username"))
32 | username = cookie.getValue();
33 | }
34 | }
35 |
36 | if (username != null) {
37 | %>
38 |
39 |
51 |
52 | <%
53 | } else {
54 | %>
55 |
56 |
68 |
69 | <%
70 | }
71 | %>
72 |
73 |
74 |
75 | <%
76 |
77 | ProductDAOImpl productDAO = new ProductDAOImpl();
78 | List
list = new ArrayList();
79 | list = productDAO.getList();
80 | String ten_san_pham = "";
81 | String ten_the_loai = "";
82 | if (request.getParameter("ten_the_loai") != null && request.getParameter("ten_san_pham")!= null) {
83 | ten_the_loai = request.getParameter("ten_the_loai");
84 | ten_san_pham = request.getParameter("ten_san_pham");
85 | }
86 | NumberFormat nf = NumberFormat.getInstance();
87 | nf.setMinimumFractionDigits(0);
88 | %>
89 | <% String err = "";
90 | if (request.getAttribute("err") != null) {
91 | err = (String) request.getAttribute("err");%>
92 | <%=err %>
93 | <% } %>
94 |
95 | <%if(productDAO.searchList(ten_san_pham, ten_the_loai).size()==0 && err=="") {%>
96 | Không tìm thấy sản phẩm nào phù hợp
97 | <%} %>
98 |
131 |
132 |
133 |
134 |
135 |
136 |
137 |
--------------------------------------------------------------------------------
/Source/WebContent/update_user.jsp:
--------------------------------------------------------------------------------
1 | <%@page import="dao.UserDAO"%>
2 | <%@ page language="java" contentType="text/html; charset=UTF-8"
3 | pageEncoding="UTF-8"%>
4 | <%@page import="dao.UserDAOImpl"%>
5 | <%@page import="model.User"%>
6 | <%@page import="dao.UserDAO"%>
7 |
8 |
9 |
10 |
11 |
12 | Đăng kí tài khoản
13 |
14 |
15 | <%
16 | String err = "";
17 | if (request.getAttribute("err") != null) {
18 | err = (String) request.getAttribute("err");
19 | }
20 | String username= request.getParameter("username");
21 | UserDAOImpl userDAO = new UserDAOImpl();
22 | User u= userDAO.getUser(username);
23 | %>
24 |
25 |
26 |
27 |
28 |
29 |

30 |
Cập nhật thông tin
31 |
32 |
33 |
79 |
80 |
81 |
82 |
--------------------------------------------------------------------------------
/Source/src/controller/ConfirmServlet.java:
--------------------------------------------------------------------------------
1 | package controller;
2 |
3 | import java.io.IOException;
4 | import java.sql.Timestamp;
5 | import java.text.NumberFormat;
6 | import java.text.SimpleDateFormat;
7 | import java.util.ArrayList;
8 | import java.util.Calendar;
9 | import java.util.Date;
10 | import java.util.Properties;
11 |
12 | import javax.mail.Message;
13 | import javax.mail.MessagingException;
14 | import javax.mail.PasswordAuthentication;
15 | import javax.mail.Session;
16 | import javax.mail.Transport;
17 | import javax.mail.internet.InternetAddress;
18 | import javax.mail.internet.MimeMessage;
19 | import javax.servlet.ServletException;
20 | import javax.servlet.http.HttpServlet;
21 | import javax.servlet.http.HttpServletRequest;
22 | import javax.servlet.http.HttpServletResponse;
23 | import javax.servlet.http.HttpSession;
24 |
25 | import model.Cart;
26 | import model.History;
27 | import model.User;
28 | import dao.HistoryDAOImpl;
29 | import dao.ProductDAOImpl;
30 | import dao.UserDAO;
31 | import dao.UserDAOImpl;
32 |
33 | /**
34 | * Servlet implementation class ConfirmServlet
35 | */
36 | public class ConfirmServlet extends HttpServlet {
37 | private static final long serialVersionUID = 1L;
38 | private UserDAOImpl userDAO = new UserDAOImpl();
39 | private ProductDAOImpl productDAO = new ProductDAOImpl();
40 | private HistoryDAOImpl historyDAO = new HistoryDAOImpl();
41 | /**
42 | * @see HttpServlet#HttpServlet()
43 | */
44 | public ConfirmServlet() {
45 | super();
46 | // TODO Auto-generated constructor stub
47 | }
48 |
49 | /**
50 | * @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response)
51 | */
52 | protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
53 | String username = request.getParameter("username");
54 | User u = userDAO.getUser(username);
55 | //lấy time lưu csdl
56 | Calendar calendar = Calendar.getInstance();
57 | java.sql.Timestamp tdate = new java.sql.Timestamp(calendar.getTime().getTime());
58 |
59 | double total = 0;
60 | ArrayList cart = (ArrayList) request.getSession().getAttribute("cart");
61 | NumberFormat nf = NumberFormat.getInstance();
62 | nf.setMinimumFractionDigits(0);
63 |
64 | //lay time gửi mail
65 | Date dNow = new Date( );
66 | SimpleDateFormat ft =
67 | new SimpleDateFormat ("dd/MM/yyyy 'at' hh:mm:ss a");
68 |
69 | //xác nhận đơn đặt hàng qua mail
70 | final String username_mail = "webbanhang1212050@gmail.com";
71 | final String password = "matkhauwebbanhang";
72 | String to = u.getEmail();
73 | String subject = "Confirm Cart";
74 | String text ="Đơn Hàng - "+ username +" - "+ ft.format(dNow) +" ";
75 | if(cart!=null){
76 | for(Cart c : cart){
77 | total = total + (c.getQuantity() * productDAO.getProduct(c.getP().getMa_san_pham()).getGia_ban());
78 | text+="- "+ productDAO.getProduct(c.getP().getMa_san_pham()).getTen_san_pham()+": "+ nf.format(productDAO.getProduct(
79 | c.getP().getMa_san_pham()).getGia_ban()) +"VNĐ
";
80 |
81 | History h = new History(0, u.getUser_id(), c.getP().getMa_san_pham(), tdate, c.getQuantity(), (c.getQuantity() * productDAO.getProduct(c.getP().getMa_san_pham()).getGia_ban()));
82 | historyDAO.addHistory(h);
83 | }
84 | }
85 | text+="Tổng thanh toán: "+ nf.format(total) +" VNĐ ";
86 |
87 | Properties props = new Properties();
88 | props.put("mail.smtp.auth", "true");
89 | props.put("mail.smtp.starttls.enable", "true");
90 | props.put("mail.smtp.host", "smtp.gmail.com");
91 | props.put("mail.smtp.port", "587");
92 | Session session_mail = Session.getInstance(props,
93 | new javax.mail.Authenticator() {
94 | protected PasswordAuthentication getPasswordAuthentication() {
95 | return new PasswordAuthentication(username_mail, password);
96 | }
97 | });
98 | try {
99 | Message message = new MimeMessage(session_mail);
100 | message.setHeader("Content-Type", "text/plain; charset=UTF-8");
101 | message.setFrom(new InternetAddress(username_mail));
102 | message.setRecipients(Message.RecipientType.TO,
103 | InternetAddress.parse(to));
104 | message.setSubject(subject);
105 | message.setContent(text, "text/html; charset=utf-8");
106 | Transport.send(message);
107 | } catch (MessagingException e) {
108 | throw new RuntimeException(e);
109 | }
110 | cart.clear();
111 | request.getSession().setAttribute("cart", cart);
112 | response.sendRedirect("/shop/index.jsp");
113 | }
114 |
115 | /**
116 | * @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse response)
117 | */
118 | protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
119 |
120 | }
121 | }
122 |
--------------------------------------------------------------------------------
/Source/src/controller/GioHangServlet.java:
--------------------------------------------------------------------------------
1 | package controller;
2 |
3 | import java.io.IOException;
4 | import java.util.ArrayList;
5 | import java.util.List;
6 |
7 | import javax.servlet.ServletException;
8 | import javax.servlet.http.HttpServlet;
9 | import javax.servlet.http.HttpServletRequest;
10 | import javax.servlet.http.HttpServletResponse;
11 | import javax.servlet.http.HttpSession;
12 |
13 | import model.Cart;
14 | import model.Product;
15 |
16 | /**
17 | * Servlet implementation class GioHangServlet
18 | */
19 | public class GioHangServlet extends HttpServlet {
20 | private static final long serialVersionUID = 1L;
21 | private List cart = new ArrayList();
22 |
23 | /**
24 | * @see HttpServlet#HttpServlet()
25 | */
26 | public GioHangServlet() {
27 | super();
28 | // TODO Auto-generated constructor stub
29 | }
30 |
31 | /**
32 | * @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse
33 | * response)
34 | */
35 | protected void doGet(HttpServletRequest request,
36 | HttpServletResponse response) throws ServletException, IOException {
37 | doPost(request, response);
38 | }
39 |
40 | /**
41 | * @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse
42 | * response)
43 | */
44 | protected void doPost(HttpServletRequest request,
45 | HttpServletResponse response) throws ServletException, IOException {
46 | String command = request.getParameter("command");
47 | String ma_san_pham = request.getParameter("ma_san_pham");
48 | if (command.equals("addCart")) {
49 | Product p = new Product(Integer.parseInt(ma_san_pham), 0, "", "",
50 | 0.0 , "", "");
51 | addToCart(p);
52 | // sau khi them vao gio hang ta se chuyen toi trang gio hang
53 | // can tao session de luu tru gia tri
54 | HttpSession session = request.getSession();
55 |
56 | // ta test xem gio hang co them duoc ko?
57 | System.out.println(cart.size());
58 | session.setAttribute("cart", cart);
59 | response.sendRedirect("/shop/cart.jsp");
60 | } else{
61 | if(command.equals("deleteCart")){
62 | Product p = new Product(Integer.parseInt(ma_san_pham), 0, "", "",
63 | 0.0 , "", "");
64 | deleteFromCart(p);
65 | HttpSession session = request.getSession();
66 |
67 | // ta test xem gio hang co them duoc ko?
68 | System.out.println(cart.size());
69 | session.setAttribute("cart", cart);
70 | response.sendRedirect("/shop/cart.jsp");
71 | } else{
72 | if(command.equals("removeCart")){
73 | Product p = new Product(Integer.parseInt(ma_san_pham), 0, "", "",
74 | 0.0 , "", "");
75 | removeFromCart(p);
76 | HttpSession session = request.getSession();
77 |
78 | //lưu vào session
79 | session.setAttribute("cart", cart);
80 | response.sendRedirect("/shop/cart.jsp");
81 | }else{
82 | if(command.equals("setCart")){
83 | Product p = new Product(Integer.parseInt(ma_san_pham), 0, "", "",
84 | 0.0 , "", "");
85 | setCart(p,Integer.parseInt((String) request.getParameter("soluong")));
86 | HttpSession session = request.getSession();
87 |
88 | session.setAttribute("cart", cart);
89 | response.sendRedirect("/shop/cart.jsp");
90 | }
91 | }
92 | }
93 | }
94 | }
95 |
96 | private String removeFromCart(Product p) {
97 | for (Cart item : cart) {
98 | if (item.getP().getMa_san_pham() == p.getMa_san_pham()) {
99 | cart.remove(item);
100 | return "cart";
101 | }
102 | }
103 | return "cart";
104 | }
105 |
106 | private String setCart(Product p, int s) {
107 | for (Cart item : cart) {
108 | if (item.getP().getMa_san_pham() == p.getMa_san_pham()) {
109 | item.setQuantity(s);
110 | return "cart";
111 | }
112 | }
113 | Cart c = new Cart();
114 | c.setP(p);
115 | c.setQuantity(s);
116 | cart.add(c);
117 | return "cart";
118 | }
119 |
120 | // phuongw thuc them san pham moi vao trong gio hang
121 | public String addToCart(Product p) {
122 | for (Cart item : cart) {
123 | if (item.getP().getMa_san_pham() == p.getMa_san_pham()) {
124 | item.setQuantity(item.getQuantity() + 1);
125 | return "cart";
126 | }
127 | }
128 | Cart c = new Cart();
129 | c.setP(p);
130 | c.setQuantity(1);
131 | cart.add(c);
132 | return "cart";
133 | }
134 |
135 | // phuongw thuc giam bot 1 san pham khoi trong gio hang
136 | public String deleteFromCart(Product p) {
137 | for (Cart item : cart) {
138 | if (item.getP().getMa_san_pham() == p.getMa_san_pham() && item.getQuantity()>1) {
139 | item.setQuantity(item.getQuantity() - 1);
140 | return "cart";
141 | }
142 | }
143 | return "cart";
144 | }
145 |
146 | }
147 |
--------------------------------------------------------------------------------
/Source/src/controller/LoginServlet.java:
--------------------------------------------------------------------------------
1 | package controller;
2 |
3 | import java.io.IOException;
4 | import java.util.ArrayList;
5 | import java.util.List;
6 |
7 | import javax.servlet.RequestDispatcher;
8 | import javax.servlet.ServletException;
9 | import javax.servlet.http.Cookie;
10 | import javax.servlet.http.HttpServlet;
11 | import javax.servlet.http.HttpServletRequest;
12 | import javax.servlet.http.HttpServletResponse;
13 | import javax.servlet.http.HttpSession;
14 |
15 | import model.Cart;
16 | import dao.UserDAOImpl;
17 |
18 | /**
19 | * Servlet implementation class LoginServlet
20 | */
21 | public class LoginServlet extends HttpServlet {
22 | private static final long serialVersionUID = 1L;
23 | private UserDAOImpl userDAO = new UserDAOImpl();
24 | private List cart = new ArrayList();
25 | /**
26 | * @see HttpServlet#HttpServlet()
27 | */
28 | public LoginServlet() {
29 | super();
30 | // TODO Auto-generated constructor stub
31 | }
32 |
33 | /**
34 | * @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse
35 | * response)
36 | */
37 | protected void doGet(HttpServletRequest request,
38 | HttpServletResponse response) throws ServletException, IOException {
39 | // TODO Auto-generated method stub
40 | }
41 |
42 | /**
43 | * @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse
44 | * response)
45 | */
46 | protected void doPost(HttpServletRequest request,
47 | HttpServletResponse response) throws ServletException, IOException {
48 | String username = request.getParameter("username");
49 | String password = request.getParameter("password");
50 |
51 | String err = "";
52 | if (username.equals("") || password.equals("")) {
53 | err += "Phải nhập đầy đủ thông tin!";
54 | } else {
55 | if (userDAO.login(username, password) == false) {
56 | err += "Tên đăng nhập hoặc mật khẩu không chính xác!";
57 | }
58 | }
59 |
60 | if (err.length() > 0) {
61 | request.setAttribute("err", err);
62 | }
63 |
64 | String url = "/login.jsp";
65 | try {
66 | if (err.length() == 0) {
67 | HttpSession session = request.getSession();
68 | session.setAttribute("username", username);
69 | session.setAttribute("cart", cart);
70 | userDAO.login(username, password);
71 | Cookie loginCookie = new Cookie("username",username);
72 | //setting cookie to expiry in 30 mins
73 | loginCookie.setMaxAge(30*60);
74 | response.addCookie(loginCookie);
75 | response.sendRedirect("index.jsp");
76 | url = "/index.jsp";
77 | } else {
78 | url = "/login.jsp";
79 | RequestDispatcher rd = getServletContext()
80 | .getRequestDispatcher(url);
81 | rd.forward(request, response);
82 | }
83 |
84 | } catch (Exception e) {
85 | e.printStackTrace();
86 | response.sendRedirect("/login.jsp");
87 | }
88 | }
89 |
90 | }
91 |
--------------------------------------------------------------------------------
/Source/src/controller/LogoutServlet.java:
--------------------------------------------------------------------------------
1 | package controller;
2 |
3 | import java.io.IOException;
4 |
5 | import javax.servlet.ServletException;
6 | import javax.servlet.http.Cookie;
7 | import javax.servlet.http.HttpServlet;
8 | import javax.servlet.http.HttpServletRequest;
9 | import javax.servlet.http.HttpServletResponse;
10 |
11 | /**
12 | * Servlet implementation class LogoutServlet
13 | */
14 | public class LogoutServlet extends HttpServlet {
15 | private static final long serialVersionUID = 1L;
16 |
17 | /**
18 | * @see HttpServlet#HttpServlet()
19 | */
20 | public LogoutServlet() {
21 | super();
22 | // TODO Auto-generated constructor stub
23 | }
24 |
25 | /**
26 | * @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response)
27 | */
28 | protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
29 | request.getSession().invalidate();
30 | response.setContentType("text/html");
31 | Cookie loginCookie = null;
32 | Cookie[] cookies = request.getCookies();
33 | if(cookies != null){
34 | for(Cookie cookie : cookies){
35 | if(cookie.getName().equals("username")){
36 | loginCookie = cookie;
37 | break;
38 | }
39 | }
40 | }
41 | if(loginCookie != null){
42 | loginCookie.setMaxAge(0);
43 | response.addCookie(loginCookie);
44 | }
45 | response.sendRedirect("index.jsp");
46 | }
47 |
48 | /**
49 | * @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse response)
50 | */
51 | protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
52 | response.setContentType("text/html");
53 | Cookie loginCookie = null;
54 | Cookie[] cookies = request.getCookies();
55 | if(cookies != null){
56 | for(Cookie cookie : cookies){
57 | if(cookie.getName().equals("username")){
58 | loginCookie = cookie;
59 | break;
60 | }
61 | }
62 | }
63 | if(loginCookie != null){
64 | loginCookie.setMaxAge(0);
65 | response.addCookie(loginCookie);
66 | }
67 | response.sendRedirect("index.jsp");
68 | }
69 |
70 | }
71 |
--------------------------------------------------------------------------------
/Source/src/controller/RegisterServlet.java:
--------------------------------------------------------------------------------
1 | package controller;
2 |
3 | import java.io.IOException;
4 | import java.text.ParseException;
5 | import java.text.SimpleDateFormat;
6 | import java.sql.Date;
7 | import java.util.ArrayList;
8 | import java.util.List;
9 | import java.util.regex.Matcher;
10 | import java.util.regex.Pattern;
11 |
12 | import javax.servlet.RequestDispatcher;
13 | import javax.servlet.ServletException;
14 | import javax.servlet.http.Cookie;
15 | import javax.servlet.http.HttpServlet;
16 | import javax.servlet.http.HttpServletRequest;
17 | import javax.servlet.http.HttpServletResponse;
18 | import javax.servlet.http.HttpSession;
19 |
20 | import model.Cart;
21 | import model.User;
22 | import dao.UserDAOImpl;
23 |
24 | /**
25 | * Servlet implementation class RegisterServlet
26 | */
27 | public class RegisterServlet extends HttpServlet {
28 | private static final long serialVersionUID = 1L;
29 | private UserDAOImpl userDAO = new UserDAOImpl();
30 | private List cart = new ArrayList();
31 |
32 | /**
33 | * @see HttpServlet#HttpServlet()
34 | */
35 | public RegisterServlet() {
36 | super();
37 | // TODO Auto-generated constructor stub
38 | }
39 |
40 | /**
41 | * @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse
42 | * response)
43 | */
44 | protected void doGet(HttpServletRequest request,
45 | HttpServletResponse response) throws ServletException, IOException {
46 | // TODO Auto-generated method stub
47 | }
48 |
49 | /**
50 | * @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse
51 | * response)
52 | */
53 | protected void doPost(HttpServletRequest request,
54 | HttpServletResponse response) throws ServletException, IOException {
55 | request.setCharacterEncoding("utf-8");
56 | response.setCharacterEncoding("utf-8");
57 |
58 | String username = request.getParameter("username");
59 | String password = request.getParameter("password");
60 | java.sql.Date ngaysinh= null;
61 |
62 | try {
63 | ngaysinh = new java.sql.Date((new SimpleDateFormat("yyyy-MM-dd").parse(request.getParameter("ngaysinh"))).getTime());
64 | } catch (ParseException e1) {
65 | // TODO Auto-generated catch block
66 | e1.printStackTrace();
67 | }
68 | String gioitinh = request.getParameter("gioitinh");
69 | String email = request.getParameter("email");
70 | String sdt = request.getParameter("sdt");
71 | String diachi = request.getParameter("diachi");
72 | System.out.println(username);
73 |
74 | String err = "";
75 | String url = "/register.jsp";
76 |
77 | if (username.equals("") || password.equals("") || email.equals("") || diachi.equals("") || sdt.equals("")) {
78 | err += "Phải nhập đầy đủ thông tin!";
79 | } else {
80 | if (userDAO.checkUser(username) == true) {
81 | err += "Tài khoản đã tồn tại!";
82 | } else {
83 | Pattern pattenObj = Pattern
84 | .compile("^[_A-Za-z0-9-\\+]+(\\.[_A-Za-z0-9-]+)*@"
85 | + "[A-Za-z0-9-]+(\\.[A-Za-z0-9]+)*(\\.[A-Za-z]{2,})$");
86 | Matcher matcherObj = pattenObj.matcher(email);
87 | if (!matcherObj.matches()) {
88 | err += "Email sai định dạng!";
89 | }
90 | }
91 | }
92 |
93 | if (err.length() > 0) {
94 | request.setAttribute("err", err);
95 | }
96 |
97 | try {
98 | if (err.length() == 0) {
99 | HttpSession session = request.getSession();
100 | session.setAttribute("cart", cart);
101 | userDAO.addUser(new User(0, username, password, ngaysinh, gioitinh, email, sdt, diachi, "2"));
102 | userDAO.login(username, password);
103 | Cookie loginCookie = new Cookie("username",username);
104 | //setting cookie to expiry in 30 mins
105 | loginCookie.setMaxAge(30*60);
106 | response.addCookie(loginCookie);
107 | response.sendRedirect("index.jsp");
108 |
109 | } else {
110 | url = "/register.jsp";
111 | RequestDispatcher rd = getServletContext()
112 | .getRequestDispatcher(url);
113 | rd.forward(request, response);
114 | }
115 |
116 | } catch (Exception e) {
117 | e.printStackTrace();
118 | response.sendRedirect("/register.jsp");
119 | }
120 |
121 | }
122 |
123 | }
124 |
--------------------------------------------------------------------------------
/Source/src/controller/ResetPassword.java:
--------------------------------------------------------------------------------
1 | package controller;
2 |
3 | import java.io.IOException;
4 | import java.util.Properties;
5 |
6 | import javax.mail.Message;
7 | import javax.mail.MessagingException;
8 | import javax.mail.PasswordAuthentication;
9 | import javax.mail.Session;
10 | import javax.mail.Transport;
11 | import javax.mail.internet.InternetAddress;
12 | import javax.mail.internet.MimeMessage;
13 | import javax.servlet.RequestDispatcher;
14 | import javax.servlet.ServletException;
15 | import javax.servlet.http.Cookie;
16 | import javax.servlet.http.HttpServlet;
17 | import javax.servlet.http.HttpServletRequest;
18 | import javax.servlet.http.HttpServletResponse;
19 | import javax.servlet.http.HttpSession;
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 | import model.User;
30 | import dao.UserDAO;
31 | import dao.UserDAOImpl;
32 |
33 | /**
34 | * Servlet implementation class ResetPassword
35 | */
36 | public class ResetPassword extends HttpServlet {
37 | private static final long serialVersionUID = 1L;
38 | private UserDAOImpl userDAO = new UserDAOImpl();
39 |
40 | /**
41 | * @see HttpServlet#HttpServlet()
42 | */
43 | public ResetPassword() {
44 | super();
45 | // TODO Auto-generated constructor stub
46 | }
47 |
48 | /**
49 | * @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response)
50 | */
51 | protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
52 | // TODO Auto-generated method stub
53 | }
54 |
55 | /**
56 | * @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse response)
57 | */
58 | protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
59 | String username = request.getParameter("username");
60 |
61 | String err = "";
62 | if (username.equals("")) {
63 | err += "Phải nhập đầy đủ thông tin!";
64 | } else {
65 | if (userDAO.checkUser(username) == false) {
66 | err += "Tên đăng nhập không tồn tại!";
67 | }
68 | }
69 |
70 | if (err.length() > 0) {
71 | request.setAttribute("err", err);
72 | }
73 |
74 | String url = "/resetpassword.jsp";
75 | try {
76 | if (err.length() == 0) {
77 |
78 | User u = userDAO.getUser(username);
79 | User new_user = new User(u.getUser_id(), username, "passwordreset", u.getNgaysinh(), u.getGioitinh(), u.getEmail(), u.getSdt(), u.getDiachi(), u.getRole());
80 | userDAO.updateUser(new_user);
81 | url = "/login.jsp";
82 | String mess = "Kiểm tra email để nhận mật khẩu mới!";
83 | request.setAttribute("mess", mess);
84 |
85 | //gửi mật khẩu mới qua email.
86 | final String username_mail = "webbanhang1212050@gmail.com";
87 | final String password = "matkhauwebbanhang";
88 | String to = u.getEmail();
89 | String subject = "Reset Password";
90 | String text ="Reset Password
";
91 | text+="User: "; text+=username; text+="
";
92 | text+="New password: passwordreset
";
93 | Properties props = new Properties();
94 | props.put("mail.smtp.auth", "true");
95 | props.put("mail.smtp.starttls.enable", "true");
96 | props.put("mail.smtp.host", "smtp.gmail.com");
97 | props.put("mail.smtp.port", "587");
98 | Session session_mail = Session.getInstance(props,
99 | new javax.mail.Authenticator() {
100 | protected PasswordAuthentication getPasswordAuthentication() {
101 | return new PasswordAuthentication(username_mail, password);
102 | }
103 | });
104 | try {
105 | Message message = new MimeMessage(session_mail);
106 | message.setHeader("Content-Type", "text/plain; charset=UTF-8");
107 | message.setFrom(new InternetAddress(username_mail));
108 | message.setRecipients(Message.RecipientType.TO,
109 | InternetAddress.parse(to));
110 | message.setSubject(subject);
111 | message.setContent(text, "text/html; charset=utf-8");
112 | Transport.send(message);
113 | } catch (MessagingException e) {
114 | throw new RuntimeException(e);
115 | }
116 |
117 | } else {
118 | url = "/resetpassword.jsp";
119 |
120 | }
121 | RequestDispatcher rd = getServletContext()
122 | .getRequestDispatcher(url);
123 | rd.forward(request, response);
124 | } catch (Exception e) {
125 | e.printStackTrace();
126 | response.sendRedirect("/resetpassword.jsp");
127 | }
128 | }
129 |
130 | }
131 |
--------------------------------------------------------------------------------
/Source/src/controller/SearchServlet.java:
--------------------------------------------------------------------------------
1 | package controller;
2 |
3 | import java.io.IOException;
4 |
5 | import javax.servlet.RequestDispatcher;
6 | import javax.servlet.ServletException;
7 | import javax.servlet.http.Cookie;
8 | import javax.servlet.http.HttpServlet;
9 | import javax.servlet.http.HttpServletRequest;
10 | import javax.servlet.http.HttpServletResponse;
11 | import javax.servlet.http.HttpSession;
12 |
13 | /**
14 | * Servlet implementation class SearchServlet
15 | */
16 | public class SearchServlet extends HttpServlet {
17 | private static final long serialVersionUID = 1L;
18 |
19 | /**
20 | * @see HttpServlet#HttpServlet()
21 | */
22 | public SearchServlet() {
23 | super();
24 | // TODO Auto-generated constructor stub
25 | }
26 |
27 | /**
28 | * @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response)
29 | */
30 | protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
31 |
32 |
33 | }
34 |
35 | /**
36 | * @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse response)
37 | */
38 | protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
39 | request.setCharacterEncoding("utf-8");
40 | response.setCharacterEncoding("utf-8");
41 | String ten_san_pham= request.getParameter("ten_san_pham");
42 | String ten_the_loai= request.getParameter("ten_the_loai");
43 | String err="";
44 |
45 | if(ten_san_pham.equals("") && ten_the_loai.equals("")){
46 | err+="Phải nhập ít nhất 1 thông tin tìm kiếm";
47 | }
48 |
49 | if (err.length() > 0) {
50 | request.setAttribute("err", err);
51 | }
52 |
53 | String url = "/search_page.jsp";
54 | try {
55 |
56 | RequestDispatcher rd = getServletContext()
57 | .getRequestDispatcher(url);
58 | rd.forward(request, response);
59 | } catch (Exception e) {
60 | e.printStackTrace();
61 | response.sendRedirect("/login.jsp");
62 | }
63 | }
64 |
65 | }
66 |
--------------------------------------------------------------------------------
/Source/src/controller/UpdateUser.java:
--------------------------------------------------------------------------------
1 | package controller;
2 |
3 | import java.io.IOException;
4 | import java.text.ParseException;
5 | import java.text.SimpleDateFormat;
6 | import java.util.regex.Matcher;
7 | import java.util.regex.Pattern;
8 |
9 | import javax.servlet.RequestDispatcher;
10 | import javax.servlet.ServletException;
11 | import javax.servlet.http.HttpServlet;
12 | import javax.servlet.http.HttpServletRequest;
13 | import javax.servlet.http.HttpServletResponse;
14 |
15 | import dao.UserDAOImpl;
16 | import dao.UserDAO;
17 | import model.User;
18 |
19 | /**
20 | * Servlet implementation class UpdateUser
21 | */
22 | public class UpdateUser extends HttpServlet {
23 | private static final long serialVersionUID = 1L;
24 | private UserDAOImpl userDAO = new UserDAOImpl();
25 | /**
26 | * @see HttpServlet#HttpServlet()
27 | */
28 | public UpdateUser() {
29 | super();
30 | // TODO Auto-generated constructor stub
31 | }
32 |
33 | /**
34 | * @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response)
35 | */
36 | protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
37 | // TODO Auto-generated method stub
38 | }
39 |
40 | /**
41 | * @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse response)
42 | */
43 | protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
44 | request.setCharacterEncoding("utf-8");
45 | response.setCharacterEncoding("utf-8");
46 | String user_id = request.getParameter("id");
47 | String username = request.getParameter("username");
48 | String password = request.getParameter("password");
49 | java.sql.Date ngaysinh= null;
50 |
51 | try {
52 | ngaysinh = new java.sql.Date((new SimpleDateFormat("yyyy-MM-dd").parse(request.getParameter("ngaysinh"))).getTime());
53 | } catch (ParseException e1) {
54 | // TODO Auto-generated catch block
55 | e1.printStackTrace();
56 | }
57 | String gioitinh = request.getParameter("gioitinh");
58 | String email = request.getParameter("email");
59 | String sdt = request.getParameter("sdt");
60 | String diachi = request.getParameter("diachi");
61 |
62 |
63 | String err = "";
64 | String url = "/update_user.jsp";
65 |
66 | if (password.equals("") || email.equals("") || sdt.equals("") || diachi.equals("")) {
67 | err += "Phải nhập đầy đủ thông tin!";
68 | } else {
69 |
70 | Pattern pattenObj = Pattern
71 | .compile("^[_A-Za-z0-9-\\+]+(\\.[_A-Za-z0-9-]+)*@"
72 | + "[A-Za-z0-9-]+(\\.[A-Za-z0-9]+)*(\\.[A-Za-z]{2,})$");
73 | Matcher matcherObj = pattenObj.matcher(email);
74 | if (!matcherObj.matches()) {
75 | err += "Email sai định dạng!";
76 | }else{
77 | Pattern pattenObj2 = Pattern
78 | .compile("(09)\\d{8}|(01)\\d{9}");
79 | Matcher matcherObj2 = pattenObj2.matcher(sdt);
80 | if (!matcherObj2.matches()) {
81 | err += "Sđt sai định dạng!";}
82 | }
83 | }
84 |
85 | if (err.length() > 0) {
86 | request.setAttribute("err", err);
87 | }
88 |
89 | try {
90 | if (err.length() == 0) {
91 | User u= new User(Integer.parseInt(user_id), username, password, ngaysinh, gioitinh, email, sdt, diachi, "2");
92 | userDAO.updateUser(u);
93 | url = "/index.jsp";
94 | } else {
95 | url = "/update_user.jsp";
96 | }
97 | RequestDispatcher rd = getServletContext()
98 | .getRequestDispatcher(url);
99 | rd.forward(request, response);
100 | } catch (Exception e) {
101 | e.printStackTrace();
102 | response.sendRedirect("/register.jsp");
103 | }
104 | }
105 |
106 | }
107 |
--------------------------------------------------------------------------------
/Source/src/dao/CategoryDAO.java:
--------------------------------------------------------------------------------
1 | package dao;
2 |
3 | import java.util.List;
4 |
5 | import model.Category;
6 |
7 | public interface CategoryDAO {
8 |
9 | // thêm danh mục mới
10 | public void addCategory(Category c);
11 |
12 | public void delCategory(int ma_the_loai);
13 |
14 | // danh sach
15 | public List getList();
16 |
17 | public Category getCategory(int ma_the_loai);
18 |
19 | public void updateCategory(Category c);
20 |
21 | }
22 |
--------------------------------------------------------------------------------
/Source/src/dao/CategoryDAOImpl.java:
--------------------------------------------------------------------------------
1 | package dao;
2 |
3 | import java.sql.Connection;
4 | import java.sql.ResultSet;
5 | import java.sql.SQLException;
6 | import java.util.ArrayList;
7 | import java.util.List;
8 | import java.util.regex.Matcher;
9 | import java.util.regex.Pattern;
10 |
11 | import com.mysql.jdbc.PreparedStatement;
12 |
13 | import model.Category;
14 |
15 | public class CategoryDAOImpl implements CategoryDAO {
16 |
17 | @Override
18 | public void addCategory(Category c) {
19 | Connection con = DBConnect.getConnecttion();
20 | String sql = "insert into category value(?,?,?)";
21 | PreparedStatement ps;
22 | try {
23 | ps = (PreparedStatement) con.prepareStatement(sql);
24 | ps.setInt(1, c.getMa_the_loai());
25 | ps.setString(2, c.getTen_the_loai());
26 | ps.setString(3, c.getMo_ta());
27 | ps.executeUpdate();
28 | con.close();
29 | } catch (SQLException e) {
30 | e.printStackTrace();
31 | }
32 | }
33 |
34 | @Override
35 | public List getList() {
36 | Connection con = DBConnect.getConnecttion();
37 | String sql = "select * from category";
38 | List list = new ArrayList();
39 | try {
40 | PreparedStatement ps = (PreparedStatement) con
41 | .prepareStatement(sql);
42 | ResultSet rs = ps.executeQuery();
43 | while (rs.next()) {
44 | int ma_the_loai = rs.getInt("ma_the_loai");
45 | String ten_the_loai = rs.getString("ten_the_loai");
46 | String mo_ta = rs.getString("mo_ta");
47 | list.add(new Category(ma_the_loai, ten_the_loai, mo_ta));
48 | }
49 | con.close();
50 | } catch (SQLException e) {
51 | e.printStackTrace();
52 | }
53 | return list;
54 | }
55 |
56 | public static void main(String[] args) {
57 | CategoryDAOImpl dao = new CategoryDAOImpl();
58 | Category c = new Category(8, "Samsung", "DT");
59 | // dao.addCategory(c);
60 | // System.out.println(dao.getList());
61 | // dao.delCategory(10);
62 | dao.updateCategory(c);
63 | }
64 |
65 | @Override
66 | public void delCategory(int ma_the_loai) {
67 | Connection con = DBConnect.getConnecttion();
68 | String sql = "delete from category where ma_the_loai='" + ma_the_loai
69 | + "'";
70 | try {
71 | PreparedStatement ps = (PreparedStatement) con
72 | .prepareStatement(sql);
73 | ps.executeUpdate();
74 | con.close();
75 | } catch (SQLException e) {
76 | e.printStackTrace();
77 | }
78 |
79 | }
80 |
81 | @Override
82 | public Category getCategory(int id) {
83 | Connection con = DBConnect.getConnecttion();
84 | String sql = "select * from category where ma_the_loai='" + id + "'";
85 | Category c = new Category();
86 | try {
87 | PreparedStatement ps = (PreparedStatement) con
88 | .prepareStatement(sql);
89 | ResultSet rs = ps.executeQuery();
90 | while (rs.next()) {
91 | int ma_the_loai = rs.getInt("ma_the_loai");
92 | String ten_the_loai = rs.getString("ten_the_loai");
93 | String mo_ta = rs.getString("mo_ta");
94 | c = new Category(ma_the_loai, ten_the_loai, mo_ta);
95 | }
96 | con.close();
97 | } catch (SQLException e) {
98 | e.printStackTrace();
99 | }
100 | return c;
101 | }
102 |
103 | @Override
104 | public void updateCategory(Category c) {
105 | Connection con = DBConnect.getConnecttion();
106 | String sql = "update category set ten_the_loai=?, mo_ta=? where ma_the_loai=?";
107 | try {
108 | PreparedStatement ps = (PreparedStatement) con
109 | .prepareStatement(sql);
110 | ps.setString(1, c.getTen_the_loai());
111 | ps.setString(2, c.getMo_ta());
112 | ps.setInt(3, c.getMa_the_loai());
113 | ps.executeUpdate();
114 | con.close();
115 | } catch (SQLException e) {
116 | e.printStackTrace();
117 | }
118 | }
119 |
120 | }
121 |
--------------------------------------------------------------------------------
/Source/src/dao/DBConnect.java:
--------------------------------------------------------------------------------
1 | package dao;
2 |
3 | import java.sql.Connection;
4 | import java.sql.DriverManager;
5 |
6 | public class DBConnect {
7 |
8 | public static Connection getConnecttion() {
9 | Connection cons = null;
10 | try {
11 | Class.forName("com.mysql.jdbc.Driver");
12 | cons = DriverManager.getConnection(
13 | "jdbc:mysql://localhost:3306/shopping", "root", "root");
14 | } catch (Exception e) {
15 | e.printStackTrace();
16 | }
17 | return cons;
18 | }
19 |
20 | public static void main(String[] args) {
21 | System.out.println(getConnecttion());
22 | }
23 |
24 | }
25 |
--------------------------------------------------------------------------------
/Source/src/dao/HistoryDAO.java:
--------------------------------------------------------------------------------
1 | package dao;
2 |
3 | import java.util.List;
4 |
5 | import model.History;
6 |
7 | public interface HistoryDAO {
8 |
9 | //thêm mới một lịch sử mua hàng.
10 | public void addHistory(History h);
11 |
12 | //lọc lịch sử của khách hàng.
13 | public List getList(int user_id);
14 |
15 | }
16 |
--------------------------------------------------------------------------------
/Source/src/dao/HistoryDAOImpl.java:
--------------------------------------------------------------------------------
1 | package dao;
2 |
3 | import java.sql.Connection;
4 | import java.sql.Date;
5 | import java.sql.ResultSet;
6 | import java.sql.SQLException;
7 | import java.sql.Timestamp;
8 | import java.util.ArrayList;
9 | import java.util.Calendar;
10 | import java.util.List;
11 |
12 | import com.mysql.jdbc.PreparedStatement;
13 |
14 | import model.Category;
15 | import model.History;
16 |
17 | public class HistoryDAOImpl implements HistoryDAO {
18 |
19 | @Override
20 | public void addHistory(History h) {
21 | Connection con = DBConnect.getConnecttion();
22 | String sql = "insert into history value(?,?,?,?,?,?)";
23 | PreparedStatement ps;
24 |
25 | try {
26 | ps = (PreparedStatement) con.prepareStatement(sql);
27 | ps.setInt(1, h.getId_history());
28 | ps.setInt(2, h.getUser_id());
29 | ps.setInt(3, h.getMa_san_pham());
30 | ps.setTimestamp(4, h.getNgay_mua());
31 | ps.setInt(5, h.getSo_luong());
32 | ps.setDouble(6, h.getThanh_tien());
33 | ps.executeUpdate();
34 | con.close();
35 | } catch (SQLException e) {
36 | e.printStackTrace();
37 | }
38 |
39 | }
40 |
41 | @Override
42 | public List getList(int id) {
43 | Connection con = DBConnect.getConnecttion();
44 | String sql = "select * from history where user_id='"+ id +"'";
45 | List list = new ArrayList();
46 | try {
47 | PreparedStatement ps = (PreparedStatement) con
48 | .prepareStatement(sql);
49 | ResultSet rs = ps.executeQuery();
50 | while (rs.next()) {
51 | int id_history = rs.getInt("id_history");
52 | int user_id = rs.getInt("user_id");
53 | int ma_san_pham = rs.getInt("ma_san_pham");
54 | Timestamp ngay_mua = rs.getTimestamp("ngay_mua");
55 | int so_luong = rs.getInt("so_luong");
56 | double thanh_tien = rs.getDouble("thanh_tien");
57 | list.add(new History(id_history, user_id, ma_san_pham, ngay_mua, so_luong, thanh_tien));
58 | }
59 | con.close();
60 | } catch (SQLException e) {
61 | e.printStackTrace();
62 | }
63 | return list;
64 | }
65 |
66 |
67 | }
68 |
--------------------------------------------------------------------------------
/Source/src/dao/ProductDAO.java:
--------------------------------------------------------------------------------
1 | package dao;
2 |
3 | import java.util.List;
4 |
5 | import model.Product;
6 |
7 | public interface ProductDAO {
8 |
9 | // thêm sản phẩm mới
10 | public void addProduct(Product p);
11 |
12 | // hiển thị danh sách sản phẩm
13 | public List getList();
14 |
15 | // lấy danh sách sản phẩm dựa vào thể loại
16 | public List getListByCategory(int ma_the_loai);
17 |
18 | public Product getProduct(int ma_san_pham);
19 |
20 | public List searchList(String ten_san_pham, String ten_the_loai);
21 |
22 | }
23 |
--------------------------------------------------------------------------------
/Source/src/dao/ProductDAOImpl.java:
--------------------------------------------------------------------------------
1 | package dao;
2 |
3 | import java.sql.Connection;
4 | import java.sql.ResultSet;
5 | import java.sql.SQLException;
6 | import java.util.ArrayList;
7 | import java.util.List;
8 |
9 | import com.mysql.jdbc.PreparedStatement;
10 |
11 | import model.Product;
12 |
13 | public class ProductDAOImpl implements ProductDAO {
14 |
15 | @Override
16 | public void addProduct(Product p) {
17 | Connection con = DBConnect.getConnecttion();
18 | String sql = "insert into product value(?,?,?,?,?,?)";
19 | PreparedStatement ps;
20 | try {
21 | ps = (PreparedStatement) con.prepareStatement(sql);
22 | ps.setInt(1, p.getMa_san_pham());
23 | ps.setString(2, p.getTen_san_pham());
24 | ps.setString(3, p.getHinh_anh());
25 | ps.setDouble(4, p.getGia_ban());
26 | ps.setString(5, p.getHang_san_xuat());
27 | ps.setString(6, p.getThong_tin());
28 | ps.executeUpdate();
29 | con.close();
30 | } catch (SQLException e) {
31 | e.printStackTrace();
32 | }
33 |
34 | }
35 |
36 | @Override
37 | public List getList() {
38 | Connection con = DBConnect.getConnecttion();
39 | String sql = "select * from product";
40 | List list = new ArrayList();
41 | try {
42 | PreparedStatement ps = (PreparedStatement) con
43 | .prepareStatement(sql);
44 | ResultSet rs = ps.executeQuery();
45 | while (rs.next()) {
46 | int ma_san_pham = rs.getInt("ma_san_pham");
47 | int ma_the_loai = rs.getInt("ma_the_loai");
48 | String ten_san_pham = rs.getString("ten_san_pham");
49 | String hinh_anh = rs.getString("hinh_anh");
50 | Double gia_ban = rs.getDouble("gia_ban");
51 | String hang_san_xuat = rs.getString("hang_san_xuat");
52 | String thong_tin = rs.getString("thong_tin");
53 | list.add(new Product(ma_san_pham, ma_the_loai, ten_san_pham,
54 | hinh_anh, gia_ban, hang_san_xuat, thong_tin));
55 | }
56 | con.close();
57 | } catch (SQLException e) {
58 | e.printStackTrace();
59 | }
60 | return list;
61 | }
62 |
63 | @Override
64 | public List getListByCategory(int id) {
65 | Connection con = DBConnect.getConnecttion();
66 | String sql = "select * from product where ma_the_loai='" + id + "'";
67 | List list = new ArrayList();
68 | try {
69 | PreparedStatement ps = (PreparedStatement) con
70 | .prepareStatement(sql);
71 | ResultSet rs = ps.executeQuery();
72 | while (rs.next()) {
73 | int ma_san_pham = rs.getInt("ma_san_pham");
74 | int ma_the_loai = rs.getInt("ma_the_loai");
75 | String ten_san_pham = rs.getString("ten_san_pham");
76 | String hinh_anh = rs.getString("hinh_anh");
77 | Double gia_ban = rs.getDouble("gia_ban");
78 | String hang_san_xuat = rs.getString("hang_san_xuat");
79 | String thong_tin = rs.getString("thong_tin");
80 | list.add(new Product(ma_san_pham, ma_the_loai, ten_san_pham,
81 | hinh_anh, gia_ban, hang_san_xuat, thong_tin));
82 | }
83 | con.close();
84 | } catch (SQLException e) {
85 | e.printStackTrace();
86 | }
87 | return list;
88 | }
89 |
90 | @Override
91 | public Product getProduct(int id) {
92 | Connection con = DBConnect.getConnecttion();
93 | String sql = "select * from product where ma_san_pham='" + id + "'";
94 | Product p = new Product();
95 | try {
96 | PreparedStatement ps = (PreparedStatement) con
97 | .prepareStatement(sql);
98 | ResultSet rs = ps.executeQuery();
99 | while (rs.next()) {
100 | int ma_san_pham = rs.getInt("ma_san_pham");
101 | int ma_the_loai = rs.getInt("ma_the_loai");
102 | String ten_san_pham = rs.getString("ten_san_pham");
103 | String hinh_anh = rs.getString("hinh_anh");
104 | Double gia_ban = rs.getDouble("gia_ban");
105 | String hang_san_xuat = rs.getString("hang_san_xuat");
106 | String thong_tin = rs.getString("thong_tin");
107 | p = new Product(ma_san_pham, ma_the_loai, ten_san_pham,
108 | hinh_anh, gia_ban, hang_san_xuat, thong_tin);
109 | }
110 | con.close();
111 | } catch (SQLException e) {
112 | e.printStackTrace();
113 | }
114 | return p;
115 | }
116 |
117 | public static void main(String[] args) {
118 | Product p = new Product(0, 1, "S6", "da", 500000.0 ,"","");
119 | ProductDAOImpl productDAO = new ProductDAOImpl();
120 | // productDAO.addProduct(p);
121 | // System.out.println(productDAO.getList());
122 | System.out.println(productDAO.getListByCategory(1));
123 | }
124 |
125 | @Override
126 | public List searchList(String ten_san_pham, String ten_the_loai) {
127 | Connection con = DBConnect.getConnecttion();
128 | String sql=null;
129 | if(!ten_san_pham.equals("") && !ten_the_loai.equals("")){
130 | sql = "SELECT * FROM product, category WHERE ten_san_pham= N'"+ ten_san_pham +"' AND product.ma_the_loai = category.ma_the_loai AND ten_the_loai=N'"+ten_the_loai+"'";
131 | }else{
132 | if(ten_san_pham.equals("")){
133 | sql="SELECT * FROM product, category WHERE product.ma_the_loai = category.ma_the_loai AND ten_the_loai=N'"+ten_the_loai+"'";
134 | }else{
135 | if(ten_the_loai.equals("")){
136 | sql="SELECT * FROM product, category WHERE ten_san_pham= N'"+ten_san_pham+"' AND product.ma_the_loai = category.ma_the_loai";
137 | }
138 | }
139 | }
140 | List list = new ArrayList();
141 | try {
142 | PreparedStatement ps = (PreparedStatement) con
143 | .prepareStatement(sql);
144 | ResultSet rs = ps.executeQuery();
145 | while (rs.next()) {
146 | int ma_san_pham = rs.getInt("ma_san_pham");
147 | int ma_the_loai = rs.getInt("ma_the_loai");
148 | ten_san_pham = rs.getString("ten_san_pham");
149 | String hinh_anh = rs.getString("hinh_anh");
150 | Double gia_ban = rs.getDouble("gia_ban");
151 | String hang_san_xuat = rs.getString("hang_san_xuat");
152 | String thong_tin = rs.getString("thong_tin");
153 | list.add(new Product(ma_san_pham, ma_the_loai, ten_san_pham,
154 | hinh_anh, gia_ban, hang_san_xuat, thong_tin));
155 | }
156 | con.close();
157 | } catch (SQLException e) {
158 | e.printStackTrace();
159 | }
160 | return list;
161 |
162 |
163 | }
164 | }
165 |
--------------------------------------------------------------------------------
/Source/src/dao/UserDAO.java:
--------------------------------------------------------------------------------
1 | package dao;
2 |
3 | import model.User;
4 |
5 | public interface UserDAO {
6 |
7 | public void addUser(User u);
8 |
9 | public boolean checkUser(String username);
10 |
11 | public boolean login(String username, String password);
12 |
13 | public void updateUser(User u);
14 |
15 | public User getUser(String username);
16 |
17 | }
18 |
--------------------------------------------------------------------------------
/Source/src/dao/UserDAOImpl.java:
--------------------------------------------------------------------------------
1 | package dao;
2 |
3 | import java.sql.Connection;
4 | import java.sql.Date;
5 | import java.sql.ResultSet;
6 | import java.sql.SQLException;
7 |
8 | import com.mysql.jdbc.PreparedStatement;
9 |
10 | import model.Category;
11 | import model.User;
12 |
13 | public class UserDAOImpl implements UserDAO {
14 |
15 | @Override
16 | public void addUser(User u) {
17 | Connection con = DBConnect.getConnecttion();
18 | String sql = "insert into user value(?,?,?,?,?,?,?,?,?)";
19 | PreparedStatement ps;
20 | try {
21 | ps = (PreparedStatement) con.prepareStatement(sql);
22 | ps.setInt(1, u.getUser_id());
23 | ps.setString(2, u.getUsername());
24 | ps.setString(3, u.getPassword());
25 | ps.setDate(4, u.getNgaysinh());
26 | ps.setString(5, u.getGioitinh());
27 | ps.setString(6, u.getEmail());
28 | ps.setString(7, u.getSdt());
29 | ps.setString(8, u.getDiachi());
30 | ps.setString(9, u.getRole());
31 | ps.executeUpdate();
32 | con.close();
33 | } catch (SQLException e) {
34 | e.printStackTrace();
35 | }
36 | }
37 |
38 | @Override
39 | public boolean checkUser(String username) {
40 | Connection con = DBConnect.getConnecttion();
41 | String sql = "select * from user where username='" + username + "'";
42 | PreparedStatement ps;
43 | try {
44 | ps = (PreparedStatement) con.prepareStatement(sql);
45 | ResultSet rs = ps.executeQuery();
46 | if (rs.next()) {
47 | con.close();
48 | return true;
49 | }
50 | } catch (SQLException e) {
51 | e.printStackTrace();
52 | }
53 | return false;
54 | }
55 |
56 | public static void main(String[] args) {
57 | UserDAOImpl dao = new UserDAOImpl();
58 | // dao.addUser(new User(0, "admin", "12345", "admin", "1"));
59 | // System.out.println(dao.checkUser("admin"));
60 | System.out.println(dao.login("admin", "12345"));
61 | }
62 |
63 | @Override
64 | public boolean login(String username, String password) {
65 | Connection con = DBConnect.getConnecttion();
66 | String sql = "select * from user where username='" + username
67 | + "' and password='" + password + "'";
68 | PreparedStatement ps;
69 | try {
70 | ps = (PreparedStatement) con.prepareStatement(sql);
71 | ResultSet rs = ps.executeQuery();
72 | if (rs.next()) {
73 | con.close();
74 | return true;
75 | }
76 | } catch (SQLException e) {
77 | e.printStackTrace();
78 | }
79 | return false;
80 | }
81 |
82 | @Override
83 | public void updateUser(User u) {
84 | Connection con = DBConnect.getConnecttion();
85 | String sql = "update user set user_id=?, password=?, ngaysinh=?, gioitinh=?, email=?, sdt=?, diachi=?, role=? where username=?";
86 | try {
87 | PreparedStatement ps = (PreparedStatement) con
88 | .prepareStatement(sql);
89 | ps.setInt(1, u.getUser_id());
90 | ps.setString(2, u.getPassword());
91 | ps.setDate(3, u.getNgaysinh());
92 | ps.setString(4, u.getGioitinh());
93 | ps.setString(5, u.getEmail());
94 | ps.setString(6, u.getSdt());
95 | ps.setString(7, u.getDiachi());
96 | ps.setString(8, u.getRole());
97 | ps.setString(9, u.getUsername());
98 | ps.executeUpdate();
99 | con.close();
100 | } catch (SQLException e) {
101 | e.printStackTrace();
102 | }
103 |
104 | }
105 |
106 | @Override
107 | public User getUser(String name) {
108 | Connection con = DBConnect.getConnecttion();
109 | String sql = "select * from user where username='" + name + "'";
110 | User u = new User();
111 | try {
112 | PreparedStatement ps = (PreparedStatement) con
113 | .prepareStatement(sql);
114 | ResultSet rs = ps.executeQuery();
115 | while (rs.next()) {
116 | int user_id= rs.getInt("user_id");
117 | String username = rs.getString("username");
118 | String password = rs.getString("password");
119 | Date ngaysinh = rs.getDate("ngaysinh");
120 | String gioitinh = rs.getString("gioitinh");
121 | String email = rs.getString("email");
122 | String sdt = rs.getString("sdt");
123 | String diachi = rs.getString("diachi");
124 | String role = rs.getString("role");
125 | u = new User(user_id, username, password, ngaysinh, gioitinh, email, sdt, diachi, role);
126 | }
127 | con.close();
128 | } catch (SQLException e) {
129 | e.printStackTrace();
130 | }
131 | return u;
132 | }
133 |
134 |
135 | }
136 |
--------------------------------------------------------------------------------
/Source/src/model/Cart.java:
--------------------------------------------------------------------------------
1 | package model;
2 |
3 | public class Cart {
4 |
5 | private Product p;
6 | private int quantity;
7 |
8 | public Cart() {
9 | }
10 |
11 | public Cart(Product p, int quantity) {
12 | this.p = p;
13 | this.quantity = quantity;
14 | }
15 |
16 | public Product getP() {
17 | return p;
18 | }
19 |
20 | public void setP(Product p) {
21 | this.p = p;
22 | }
23 |
24 | public int getQuantity() {
25 | return quantity;
26 | }
27 |
28 | public void setQuantity(int quantity) {
29 | this.quantity = quantity;
30 | }
31 |
32 | }
33 |
--------------------------------------------------------------------------------
/Source/src/model/Category.java:
--------------------------------------------------------------------------------
1 | package model;
2 |
3 | public class Category {
4 |
5 | private int ma_the_loai;
6 | private String ten_the_loai;
7 | private String mo_ta;
8 |
9 | public Category() {
10 | }
11 |
12 | public Category(int ma_the_loai, String ten_the_loai, String mo_ta) {
13 | this.ma_the_loai = ma_the_loai;
14 | this.ten_the_loai = ten_the_loai;
15 | this.mo_ta = mo_ta;
16 | }
17 |
18 | public int getMa_the_loai() {
19 | return ma_the_loai;
20 | }
21 |
22 | public void setMa_the_loai(int ma_the_loai) {
23 | this.ma_the_loai = ma_the_loai;
24 | }
25 |
26 | public String getTen_the_loai() {
27 | return ten_the_loai;
28 | }
29 |
30 | public void setTen_the_loai(String ten_the_loai) {
31 | this.ten_the_loai = ten_the_loai;
32 | }
33 |
34 | public String getMo_ta() {
35 | return mo_ta;
36 | }
37 |
38 | public void setMo_ta(String mo_ta) {
39 | this.mo_ta = mo_ta;
40 | }
41 |
42 | }
43 |
--------------------------------------------------------------------------------
/Source/src/model/History.java:
--------------------------------------------------------------------------------
1 | package model;
2 |
3 | import java.sql.Time;
4 | import java.sql.Timestamp;
5 | import java.util.Date;
6 |
7 | public class History {
8 | private int id_history;
9 | private int user_id;
10 | private int ma_san_pham;
11 | private Timestamp ngay_mua;
12 | private int so_luong;
13 | private double thanh_tien;
14 |
15 | public History() {
16 | }
17 |
18 | public History(int id_history, int user_id, int ma_san_pham, Timestamp ngay_mua,
19 | int so_luong, double thanh_tien) {
20 |
21 | this.id_history = id_history;
22 | this.user_id = user_id;
23 | this.ma_san_pham = ma_san_pham;
24 | this.ngay_mua = ngay_mua;
25 | this.so_luong = so_luong;
26 | this.thanh_tien = thanh_tien;
27 | }
28 |
29 | public int getId_history() {
30 | return id_history;
31 | }
32 |
33 | public void setId_history(int id_history) {
34 | this.id_history = id_history;
35 | }
36 |
37 | public int getUser_id() {
38 | return user_id;
39 | }
40 |
41 | public void setUser_id(int user_id) {
42 | this.user_id = user_id;
43 | }
44 |
45 | public int getMa_san_pham() {
46 | return ma_san_pham;
47 | }
48 |
49 | public void setMa_san_pham(int ma_san_pham) {
50 | this.ma_san_pham = ma_san_pham;
51 | }
52 |
53 | public Timestamp getNgay_mua() {
54 | return ngay_mua;
55 | }
56 |
57 | public void setNgay_mua(Timestamp ngay_mua) {
58 | this.ngay_mua = ngay_mua;
59 | }
60 |
61 | public int getSo_luong() {
62 | return so_luong;
63 | }
64 |
65 | public void setSo_luong(int so_luong) {
66 | this.so_luong = so_luong;
67 | }
68 |
69 | public double getThanh_tien() {
70 | return thanh_tien;
71 | }
72 |
73 | public void setThanh_tien(double thanh_tien) {
74 | this.thanh_tien = thanh_tien;
75 | }
76 |
77 |
78 | }
79 |
--------------------------------------------------------------------------------
/Source/src/model/Product.java:
--------------------------------------------------------------------------------
1 | package model;
2 |
3 | public class Product {
4 |
5 | private int ma_san_pham;
6 | private int ma_the_loai;
7 | private String ten_san_pham;
8 | private String hinh_anh;
9 | private Double gia_ban;
10 | private String hang_san_xuat;
11 | private String thong_tin;
12 |
13 | public Product() {
14 | }
15 |
16 | public Product(int ma_san_pham, int ma_the_loai, String ten_san_pham,
17 | String hinh_anh, Double gia_ban, String hang_san_xuat,
18 | String thong_tin) {
19 | this.ma_san_pham = ma_san_pham;
20 | this.ma_the_loai = ma_the_loai;
21 | this.ten_san_pham = ten_san_pham;
22 | this.hinh_anh = hinh_anh;
23 | this.gia_ban = gia_ban;
24 | this.hang_san_xuat = hang_san_xuat;
25 | this.thong_tin = thong_tin;
26 | }
27 |
28 | public int getMa_san_pham() {
29 | return ma_san_pham;
30 | }
31 |
32 | public void setMa_san_pham(int ma_san_pham) {
33 | this.ma_san_pham = ma_san_pham;
34 | }
35 |
36 | public String getTen_san_pham() {
37 | return ten_san_pham;
38 | }
39 |
40 | public void setTen_san_pham(String ten_san_pham) {
41 | this.ten_san_pham = ten_san_pham;
42 | }
43 |
44 | public String getHinh_anh() {
45 | return hinh_anh;
46 | }
47 |
48 | public void setHinh_anh(String hinh_anh) {
49 | this.hinh_anh = hinh_anh;
50 | }
51 |
52 | public Double getGia_ban() {
53 | return gia_ban;
54 | }
55 |
56 | public void setGia_ban(Double gia_ban) {
57 | this.gia_ban = gia_ban;
58 | }
59 |
60 | public String getHang_san_xuat() {
61 | return hang_san_xuat;
62 | }
63 |
64 | public void setHang_san_xuat(String hang_san_xuat) {
65 | this.hang_san_xuat = hang_san_xuat;
66 | }
67 |
68 | public String getThong_tin() {
69 | return thong_tin;
70 | }
71 |
72 | public void getThong_tin(String thong_tin) {
73 | this.thong_tin = thong_tin;
74 | }
75 |
76 |
77 | public int getMa_the_loai() {
78 | return ma_the_loai;
79 | }
80 |
81 | public void setMa_the_loai(int ma_the_loai) {
82 | this.ma_the_loai = ma_the_loai;
83 | }
84 |
85 | }
86 |
--------------------------------------------------------------------------------
/Source/src/model/User.java:
--------------------------------------------------------------------------------
1 | package model;
2 |
3 |
4 | public class User {
5 |
6 | private int user_id;
7 | private String username;
8 | private String password;
9 | private java.sql.Date ngaysinh;
10 | private String gioitinh;
11 | private String email;
12 | private String sdt;
13 | private String diachi;
14 | private String role;
15 |
16 | public User() {
17 | }
18 |
19 | public User(int user_id, String username, String password, java.sql.Date ngaysinh, String gioitinh, String email, String sdt, String diachi,
20 | String role) {
21 | this.user_id = user_id;
22 | this.username = username;
23 | this.password = password;
24 | this.ngaysinh = ngaysinh;
25 | this.gioitinh = gioitinh;
26 | this.email = email;
27 | this.sdt = sdt;
28 | this.diachi = diachi;
29 | this.role = role;
30 | }
31 |
32 | public int getUser_id() {
33 | return user_id;
34 | }
35 |
36 | public void setUser_id(int user_id) {
37 | this.user_id = user_id;
38 | }
39 |
40 | public String getUsername() {
41 | return username;
42 | }
43 |
44 | public void setUsername(String username) {
45 | this.username = username;
46 | }
47 |
48 | public String getPassword() {
49 | return password;
50 | }
51 |
52 | public void setPassword(String password) {
53 | this.password = password;
54 | }
55 |
56 | public java.sql.Date getNgaysinh() {
57 | return ngaysinh;
58 | }
59 |
60 | public void setNgaysinh(java.sql.Date ngaysinh) {
61 | this.ngaysinh = ngaysinh;
62 | }
63 |
64 | public String getGioitinh() {
65 | return gioitinh;
66 | }
67 |
68 | public void setGioitinh(String gioitinh) {
69 | this.gioitinh = gioitinh;
70 | }
71 |
72 | public String getEmail() {
73 | return email;
74 | }
75 |
76 | public void setEmail(String email) {
77 | this.email = email;
78 | }
79 |
80 | public String getSdt() {
81 | return sdt;
82 | }
83 |
84 | public void setSdt(String sdt) {
85 | this.sdt = sdt;
86 | }
87 |
88 | public String getDiachi() {
89 | return diachi;
90 | }
91 |
92 | public void setDiachi(String diachi) {
93 | this.diachi = diachi;
94 | }
95 |
96 | public String getRole() {
97 | return role;
98 | }
99 |
100 | public void setRole(String role) {
101 | this.role = role;
102 | }
103 |
104 | }
105 |
--------------------------------------------------------------------------------