Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Q
QLNS_N01
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Nguyễn Văn Hiếu
QLNS_N01
Commits
0d763ee9
Commit
0d763ee9
authored
Jun 06, 2019
by
đinh thị đầm
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
commit
parent
e7b14bbb
Changes
18
Hide whitespace changes
Inline
Side-by-side
Showing
18 changed files
with
699 additions
and
238 deletions
+699
-238
pom.xml
pom.xml
+3
-1
src/main/java/com/itsol/quantrivanphong/manager/employee/controller/EmployeeController.java
...phong/manager/employee/controller/EmployeeController.java
+1
-0
src/main/resources/public/css/bootstrap.css
src/main/resources/public/css/bootstrap.css
+259
-0
src/main/resources/public/css/style.css
src/main/resources/public/css/style.css
+20
-0
src/main/resources/public/index.html
src/main/resources/public/index.html
+20
-11
src/main/resources/public/js/app.js
src/main/resources/public/js/app.js
+90
-75
src/main/resources/public/layout/layout1.html
src/main/resources/public/layout/layout1.html
+9
-0
src/main/resources/public/layout/layout2.html
src/main/resources/public/layout/layout2.html
+5
-0
src/main/resources/public/main_layout.html
src/main/resources/public/main_layout.html
+0
-94
src/main/resources/public/pages/employee/employee.html
src/main/resources/public/pages/employee/employee.html
+32
-29
src/main/resources/public/pages/employee/employeeController.js
...ain/resources/public/pages/employee/employeeController.js
+90
-0
src/main/resources/public/pages/employee/js/app.js
src/main/resources/public/pages/employee/js/app.js
+0
-28
src/main/resources/public/pages/project/project.html
src/main/resources/public/pages/project/project.html
+4
-0
src/main/resources/public/pages/project/projectController.js
src/main/resources/public/pages/project/projectController.js
+6
-0
src/main/resources/public/pages/report/employee.html
src/main/resources/public/pages/report/employee.html
+91
-0
src/main/resources/public/pages/report/employeeController.js
src/main/resources/public/pages/report/employeeController.js
+57
-0
src/main/resources/public/pages/testlayout/testlayout.html
src/main/resources/public/pages/testlayout/testlayout.html
+4
-0
src/main/resources/public/pages/testlayout/testlayoutController.js
...resources/public/pages/testlayout/testlayoutController.js
+8
-0
No files found.
pom.xml
View file @
0d763ee9
...
...
@@ -16,6 +16,7 @@
<properties>
<java.version>
1.8
</java.version>
<project.build.sourceEncoding>
UTF-8
</project.build.sourceEncoding>
</properties>
<dependencies>
...
...
@@ -61,7 +62,8 @@
<artifactId>
spring-boot-maven-plugin
</artifactId>
</plugin>
</plugins>
<finalName>
Spring4MVCCRUDRestService
</finalName>
</build>
</project>
src/main/java/com/itsol/quantrivanphong/manager/employee/controller/EmployeeController.java
View file @
0d763ee9
...
...
@@ -12,6 +12,7 @@ import org.springframework.web.util.UriComponentsBuilder;
import
java.util.List
;
@RestController
public
class
EmployeeController
{
@Autowired
//Retrieve Employee by id
...
...
src/main/resources/public/css/bootstrap.css
View file @
0d763ee9
html
{
font-family
:
sans-serif
;
-webkit-text-size-adjust
:
100%
;
-ms-text-size-adjust
:
100%
;
}
body
{
margin
:
0
;
}
article
,
aside
,
details
,
figcaption
,
figure
,
footer
,
header
,
hgroup
,
main
,
menu
,
nav
,
section
,
summary
{
display
:
block
;
}
audio
,
canvas
,
progress
,
video
{
display
:
inline-block
;
vertical-align
:
baseline
;
}
audio
:not
([
controls
])
{
display
:
none
;
height
:
0
;
}
[
hidden
],
template
{
display
:
none
;
}
a
{
background-color
:
transparent
;
}
a
:active
,
a
:hover
{
outline
:
0
;
}
abbr
[
title
]
{
border-bottom
:
1px
dotted
;
}
b
,
strong
{
font-weight
:
bold
;
}
dfn
{
font-style
:
italic
;
}
h1
{
margin
:
.67em
0
;
font-size
:
2em
;
}
mark
{
color
:
#000
;
background
:
#ff0
;
}
small
{
font-size
:
80%
;
}
sub
,
sup
{
position
:
relative
;
font-size
:
75%
;
line-height
:
0
;
vertical-align
:
baseline
;
}
sup
{
top
:
-.5em
;
}
sub
{
bottom
:
-.25em
;
}
img
{
border
:
0
;
}
svg
:not
(
:root
)
{
overflow
:
hidden
;
}
figure
{
margin
:
1em
40px
;
}
hr
{
height
:
0
;
-webkit-box-sizing
:
content-box
;
-moz-box-sizing
:
content-box
;
box-sizing
:
content-box
;
}
pre
{
overflow
:
auto
;
}
code
,
kbd
,
pre
,
samp
{
font-family
:
monospace
,
monospace
;
font-size
:
1em
;
}
button
,
input
,
optgroup
,
select
,
textarea
{
margin
:
0
;
font
:
inherit
;
color
:
inherit
;
}
button
{
overflow
:
visible
;
}
button
,
select
{
text-transform
:
none
;
}
button
,
html
input
[
type
=
"button"
],
input
[
type
=
"reset"
],
input
[
type
=
"submit"
]
{
-webkit-appearance
:
button
;
cursor
:
pointer
;
}
button
[
disabled
],
html
input
[
disabled
]
{
cursor
:
default
;
}
button
::-moz-focus-inner
,
input
::-moz-focus-inner
{
padding
:
0
;
border
:
0
;
}
input
{
line-height
:
normal
;
}
input
[
type
=
"checkbox"
],
input
[
type
=
"radio"
]
{
-webkit-box-sizing
:
border-box
;
-moz-box-sizing
:
border-box
;
box-sizing
:
border-box
;
padding
:
0
;
}
input
[
type
=
"number"
]
::-webkit-inner-spin-button
,
input
[
type
=
"number"
]
::-webkit-outer-spin-button
{
height
:
auto
;
}
input
[
type
=
"search"
]
{
-webkit-box-sizing
:
content-box
;
-moz-box-sizing
:
content-box
;
box-sizing
:
content-box
;
-webkit-appearance
:
textfield
;
}
input
[
type
=
"search"
]
::-webkit-search-cancel-button
,
input
[
type
=
"search"
]
::-webkit-search-decoration
{
-webkit-appearance
:
none
;
}
fieldset
{
padding
:
.35em
.625em
.75em
;
margin
:
0
2px
;
border
:
1px
solid
#c0c0c0
;
}
legend
{
padding
:
0
;
border
:
0
;
}
textarea
{
overflow
:
auto
;
}
optgroup
{
font-weight
:
bold
;
}
table
{
border-spacing
:
0
;
border-collapse
:
collapse
;
}
td
,
th
{
padding
:
0
;
}
/*! Source: https://github.com/h5bp/html5-boilerplate/blob/master/src/css/main.css */
@media
print
{
*,
*
:before
,
*
:after
{
color
:
#000
!important
;
text-shadow
:
none
!important
;
background
:
transparent
!important
;
-webkit-box-shadow
:
none
!important
;
box-shadow
:
none
!important
;
}
a
,
a
:visited
{
text-decoration
:
underline
;
}
a
[
href
]
:after
{
content
:
" ("
attr
(
href
)
")"
;
}
abbr
[
title
]
:after
{
content
:
" ("
attr
(
title
)
")"
;
}
a
[
href
^=
"#"
]
:after
,
a
[
href
^=
"javascript:"
]
:after
{
content
:
""
;
}
pre
,
blockquote
{
border
:
1px
solid
#999
;
page-break-inside
:
avoid
;
}
thead
{
display
:
table-header-group
;
}
tr
,
img
{
page-break-inside
:
avoid
;
}
img
{
max-width
:
100%
!important
;
}
p
,
h2
,
h3
{
orphans
:
3
;
widows
:
3
;
}
h2
,
h3
{
page-break-after
:
avoid
;
}
select
{
background
:
#fff
!important
;
}
.navbar
{
display
:
none
;
}
.btn
>
.caret
,
.dropup
>
.btn
>
.caret
{
border-top-color
:
#000
!important
;
}
.label
{
border
:
1px
solid
#000
;
}
.table
{
border-collapse
:
collapse
!important
;
}
.table
td
,
.table
th
{
background-color
:
#fff
!important
;
}
.table-bordered
th
,
.table-bordered
td
{
border
:
1px
solid
#ddd
!important
;
}
}
src/main/resources/public/css/style.css
View file @
0d763ee9
...
...
@@ -68,4 +68,24 @@ td, th {
width
:
25%
;
text-align
:
left
;
padding
:
5px
10px
;
}
table
{
border-collapse
:
collapse
;
padding-bottom
:
20%
;
text-align
:
center
;
}
table
td
,
th
{
padding
:
5px
;
}
table
>
thead
>
tr
>
th
{
text-align
:
center
;
}
.table
>
thead
>
tr
>
td
{
text-align
:
center
;
padding-bottom
:
50px
;
}
.container
{
background-color
:
#f1f1f1
;
}
\ No newline at end of file
src/main/resources/public/index.html
View file @
0d763ee9
<!
DOCTYPE HTML
>
<html>
<!
doctype html
>
<html
lang=
"en"
>
<head>
<meta
charset=
"UTF-8"
>
<meta
name=
"viewport"
content=
"width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0"
>
<!-- <meta http-equiv="X-UA-Compatible" content="ie=edge">-->
<meta
http-equiv=
"Content-Type"
content=
"text/html; charset=utf-8"
>
<title>
Document
</title>
<link
href=
"css/bootstrap.css"
rel=
'stylesheet'
type=
'text/css'
/>
<!-- Custom Theme files -->
<link
href=
"https://fonts.googleapis.com/css?family=Roboto+Condensed:400,700"
rel=
'stylesheet'
type=
'text/css'
>
<link
href=
"https://fonts.googleapis.com/css?family=Open+Sans"
type=
'text/css'
>
<!-- <link href="https://fonts.googleapis.com/css?family=Roboto+Condensed:400,700" rel='stylesheet' type='text/css'>--
>
<!-- <link href="https://fonts.googleapis.com/css?family=Open+Sans" type='text/css'>--
>
<link
href=
"css/style.css"
rel=
'stylesheet'
type=
'text/css'
/>
<link
rel=
"stylesheet"
href=
"https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/css/bootstrap.min.css"
>
<script
src=
"js/jquery-3.2.1.min.js"
></script>
<script
src=
"js/bootstrap.min.js"
></script>
<script
src=
"js/angular.js"
></script>
<script
src=
"js/angular-ui-router.min.js"
></script>
<link
rel=
"stylesheet"
href=
"https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/css/bootstrap.min.css"
>
<script
src=
"pages/employee/js/app.js"
></script>
<script
src=
"pages/employee/js/employeeController.js"
></script>
<script
src=
"js/app.js"
></script>
<script
src=
"pages/employee/employeeController.js"
></script>
<script
src=
"pages/project/projectController.js"
></script>
<script
src=
"pages/testlayout/testlayoutController.js"
></script>
</head>
<body
ng-app=
"myApp"
>
<div
ui-view
></div>
<div
ui-view=
"layout"
>
</div>
</body>
...
...
src/main/resources/public/js/app.js
View file @
0d763ee9
/**
*
*
*/
angular
.
module
(
"
myApp
"
,
[
"
ui.router
"
]).
config
(
function
(
$stateProvider
,
$urlRouterProvider
,
$locationProvider
)
{
angular
.
module
(
"
myApp
"
,
[
"
ui.router
"
]).
config
(
function
(
$stateProvider
,
$urlRouterProvider
,
$locationProvider
)
{
$locationProvider
.
hashPrefix
(
''
);
$urlRouterProvider
.
otherwise
(
"
/index
"
);
$stateProvider
//index layout riêng
.
state
(
"
index
"
,
{
url
:
"
/index
"
,
views
:{
"
index
"
:{
templateUrl
:
"
pages/index/index.htm
"
,
controller
:
"
indexController
"
},
"
banner
"
:{
templateUrl
:
"
pages/index/banner.htm
"
}
}
})
// State chứa layout chung cho các trang
.
state
(
'
app
'
,
{
abstract
:
true
,
views
:
{
'
main_layout
'
:
{
templateUrl
:
'
main_layout.html
'
,
$locationProvider
.
hashPrefix
(
''
);
$urlRouterProvider
.
otherwise
(
"
/employees
"
);
$stateProvider
.
state
(
"
layout1
"
,
{
abstract
:
true
,
views
:
{
"
layout
"
:
{
templateUrl
:
"
layout/layout1.html
"
}
}
})
.
state
(
"
layout2
"
,
{
abstract
:
true
,
views
:
{
"
layout
"
:
{
templateUrl
:
"
layout/layout2.html
"
}
}
}
})
// Các state bên dưới kế thừa state app
.
state
(
"
tintuc
"
,
{
// Khai báo một state
parent
:
'
app
'
,
url
:
"
/tintuc
"
,
// URL hiển thị
views
:{
"
content
"
:{
templateUrl
:
"
pages/tintuc/tintuc.htm
"
,
controller
:
"
tintucController
"
// khai báo controller
}
}
})
})
// .state('app', {
// abstract: true,
// views: {
// 'main_layout': {
// templateUrl: 'main_layout.html',
// }
// }
// })
.
state
(
"
employees
"
,
{
parent
:
'
layout1
'
,
url
:
"
/employees
"
,
views
:
{
"
content
"
:
{
templateUrl
:
"
pages/employee/employee.html
"
,
controller
:
"
employeeController
"
}
}
})
.
state
(
"
project
"
,
{
parent
:
'
layout1
'
,
url
:
"
/project
"
,
views
:
{
"
content
"
:
{
templateUrl
:
"
pages/project/project.html
"
,
controller
:
"
projectController
"
}
}
})
.
state
(
"
report
"
,
{
parent
:
'
layout1
'
,
url
:
"
/report
"
,
views
:
{
"
content
"
:
{
templateUrl
:
"
pages/employee/project.html
"
,
controller
:
"
employeeController
"
}
}
})
.
state
(
"
testlayout2
"
,
{
parent
:
'
layout2
'
,
url
:
"
/testttt
"
,
views
:
{
"
content
"
:
{
templateUrl
:
"
pages/testlayout/testlayout.html
"
,
controller
:
"
testlayoutController
"
}
}
})
});
.
state
(
"
tuyendung
"
,
{
parent
:
'
app
'
,
url
:
"
/tuyendung
"
,
views
:{
"
content
"
:{
templateUrl
:
"
pages/tuyendung/tuyendung.htm
"
,
controller
:
"
tuyendungController
"
}
}
})
// .state("lienhe", {
// parent: 'app',
// url: "/lienhe",
// views:{
// "content":{
// templateUrl: "pages/lienhe/lienhe.htm",
// controller: "lienheController"
// }
// }
// })
.
state
(
"
gioithieu
"
,
{
parent
:
'
app
'
,
url
:
"
/gioithieu
"
,
views
:{
"
content
"
:{
templateUrl
:
"
pages/gioithieu/gioithieu.htm
"
,
controller
:
"
gioithieuController
"
}
}
})
});
\ No newline at end of file
// myApp.directive('ngConfirmClick', [ function() {
// return {
// link : function(scope, element, attr) {
// var msg = attr.ngConfirmClick || "Are you sure?";
// var clickAction = attr.confirmedClick;
// element.bind('click', function(event) {
// if (window.confirm(msg)) {
// scope.$eval(clickAction)
// }
// });
// }
// };
// } ])
\ No newline at end of file
src/main/resources/public/layout/layout1.html
0 → 100644
View file @
0d763ee9
<div>
layout1
<a
ui-sref=
"employees"
>
Employee
</a>
<a
ui-sref=
"report"
>
Report
</a>
<a
ui-sref=
"project"
>
Project
</a>
<div
ui-view=
"content"
>
</div>
</div>
\ No newline at end of file
src/main/resources/public/layout/layout2.html
0 → 100644
View file @
0d763ee9
<div>
layout2
Không có menu
<div
ui-view=
"content"
></div>
</div>
\ No newline at end of file
src/main/resources/public/main_layout.html
deleted
100644 → 0
View file @
e7b14bbb
<!-- technology -->
<div
class=
"technology-1"
>
<div
class=
"container"
>
<div
class=
"col-md-9 technology-left"
>
<div
ui-view=
"content"
>
<!-- nội dung các trang -->
</div>
</div>
<!-- technology-right -->
<div
class=
"col-md-3 technology-right-1"
>
<div
class=
"blo-top"
>
<div
class=
"tech-btm"
>
<img
src=
"images/banner1.jpg"
class=
"img-responsive"
alt=
""
/>
</div>
</div>
<div
class=
"blo-top"
>
<div
class=
"tech-btm"
>
<h4>
Sign up to our newsletter
</h4>
<p>
Pellentesque dui, non felis. Maecenas male
</p>
<div
class=
"name"
>
<form>
<input
type=
"text"
placeholder=
"Email"
required=
""
>
</form>
</div>
<div
class=
"button"
>
<form>
<input
type=
"submit"
value=
"Subscribe"
>
</form>
</div>
<div
class=
"clearfix"
>
</div>
</div>
</div>
<div
class=
"blo-top1"
>
<div
class=
"tech-btm"
>
<h4>
Tin tức nổi bật
</h4>
<div
class=
"blog-grids"
>
<div
class=
"blog-grid-left"
>
<a
href=
"singlepage.html"
><img
src=
"images/6.jpg"
class=
"img-responsive"
alt=
""
/></a>
</div>
<div
class=
"blog-grid-right"
>
<h5><a
href=
"singlepage.html"
>
Pellentesque dui, non felis. Maecenas male
</a>
</h5>
</div>
<div
class=
"clearfix"
>
</div>
</div>
<div
class=
"blog-grids"
>
<div
class=
"blog-grid-left"
>
<a
href=
"singlepage.html"
><img
src=
"images/7.jpg"
class=
"img-responsive"
alt=
""
/></a>
</div>
<div
class=
"blog-grid-right"
>
<h5><a
href=
"singlepage.html"
>
Pellentesque dui, non felis. Maecenas male
</a>
</h5>
</div>
<div
class=
"clearfix"
>
</div>
</div>
<div
class=
"blog-grids"
>
<div
class=
"blog-grid-left"
>
<a
href=
"singlepage.html"
><img
src=
"images/11.jpg"
class=
"img-responsive"
alt=
""
/></a>
</div>
<div
class=
"blog-grid-right"
>
<h5><a
href=
"singlepage.html"
>
Pellentesque dui, non felis. Maecenas male
</a>
</h5>
</div>
<div
class=
"clearfix"
>
</div>
</div>
<div
class=
"blog-grids"
>
<div
class=
"blog-grid-left"
>
<a
href=
"singlepage.html"
><img
src=
"images/9.jpg"
class=
"img-responsive"
alt=
""
/></a>
</div>
<div
class=
"blog-grid-right"
>
<h5><a
href=
"singlepage.html"
>
Pellentesque dui, non felis. Maecenas male
</a>
</h5>
</div>
<div
class=
"clearfix"
>
</div>
</div>
<div
class=
"blog-grids"
>
<div
class=
"blog-grid-left"
>
<a
href=
"singlepage.html"
><img
src=
"images/10.jpg"
class=
"img-responsive"
alt=
""
/></a>
</div>
<div
class=
"blog-grid-right"
>
<h5><a
href=
"singlepage.html"
>
Pellentesque dui, non felis. Maecenas male
</a>
</h5>
</div>
<div
class=
"clearfix"
>
</div>
</div>
</div>
</div>
</div>
<div
class=
"clearfix"
></div>
<!-- technology-right -->
</div>
</div>
<!-- technology -->
\ No newline at end of file
src/main/resources/public/pages/employee/
html/welcom
e.html
→
src/main/resources/public/pages/employee/
employe
e.html
View file @
0d763ee9
<!DOCTYPE html>
<html
lang=
"en"
>
<head>
<meta
charset=
"UTF-8"
>
<title>
Title
</title>
</head>
<body
ng-app=
"myApp"
ng-controller=
"employeeController"
>
<div
class=
"container"
>
<div
class=
"row"
>
<div
class=
"col-md-8"
>
<div>
<legend>
Employee Details
</legend>
<table>
<tr>
<td><label>
User Name
</label></td>
<td>
<input
type=
"text"
maxlength=
"29"
ng-model=
"emp.username"
/>
<input
type=
"text"
maxlength=
"29"
ng-model=
"emp.username"
/>
</td>
</tr>
<tr>
<td><label>
First Name
</label></td>
<td>
<input
type=
"text"
maxlength=
"29"
ng-model=
"emp.firstName"
/>
<input
type=
"text"
maxlength=
"29"
ng-model=
"emp.firstName"
/>
</td>
</tr>
<tr>
<td><label>
Last Name
</label></td>
<td>
<input
type=
"text"
maxlength=
"29"
ng-model=
"emp.lastName"
/>
<input
type=
"text"
maxlength=
"29"
ng-model=
"emp.lastName"
/>
</td>
</tr>
<tr>
<td><label
id=
"email"
for=
"email"
>
Email
</label>
</td>
<td><label
id=
"email"
for=
"email"
>
Email
</label>
</td>
<td>
<input
type=
"email"
maxlength=
"150"
ng-model=
"emp.emailAddress"
/>
</td>
...
...
@@ -51,31 +43,40 @@
</td>
</tr>
<tr>
<td><label
>
home town:
</label></td>
<td>
<input
type=
"text"
ng-model=
"emp.homeTown"
/></td>
<td><label>
home town:
</label></td>
<td><input
type=
"text"
ng-model=
"emp.homeTown"
/></td>
</tr>
<tr>
<td></td>
<td>
<td
>
<input
type=
"submit"
name=
"submit"
value=
"submit"
ng-click=
"save();"
/>
<input
type=
"submit"
name=
"clear"
value=
"clear"
ng-click=
" emp = null"
/>
</td>
</tr>
</table>
</div>
<br><br>
<div>
<table
class=
"table"
>
<thead>
<tr>
<th>
ID
</th>
<th>
User Name
</th>
<th>
First Name
</th>
<th>
Last Name
</th>
<th>
EmailAddress
</th>
<th>
Phone
</th>
<th>
Education
</th>
<th>
Home Town
</th>
<tr>
<td
colspan=
"12"
>
Thông tin nhân viên
</td>
</tr>
<th>
ID
</th>
<th>
User Name
</th>
<th>
First Name
</th>
<th>
Last Name
</th>
<th>
EmailAddress
</th>
<th>
Phone
</th>
<th>
Education
</th>
<th>
Home Town
</th>
<th>
Department
</th>
<th>
Position
</th>
<th
colspan=
"2"
>
Menu
</th>
</tr>
</thead>
<tbody>
...
...
@@ -88,8 +89,12 @@
<td>
{{emp.phoneNumber}}
</td>
<td>
{{emp.education}}
</td>
<td>
{{emp.homeTown}}
</td>
<td><a
href=
"#"
ng-click=
"update(emp);"
>
Update
</a>
<td><a
href=
"#"
confirmed-click=
"delete(employee);"
ng-confirm-click=
" Do you want to delete this user?"
>
Delete
</a></td>
<td>
{{emp.department}}
</td>
<td>
{{emp.position}}
</td>
<td><a
href=
"#"
ng-click=
"update(emp);"
>
Edit
</a>
<td><a
href=
"#"
ng-confirm-click=
" Do you want to delete this user?"
ng-click=
"delete(emp);"
>
Delete
</a>
</td>
</tr>
</tbody>
</table>
...
...
@@ -97,5 +102,3 @@
</div>
</div>
</div>
</body>
</html>
\ No newline at end of file
src/main/resources/public/pages/employee/
js/
employeeController.js
→
src/main/resources/public/pages/employee/employeeController.js
View file @
0d763ee9
/**
*
*/
angular
.
module
(
"
myApp
"
,[]
).
controller
(
"
employeeController
"
,
function
(
$scope
,
$http
,
$window
)
{
angular
.
module
(
"
myApp
"
).
controller
(
"
employeeController
"
,
function
(
$scope
,
$http
,
$window
)
{
console
.
log
(
"
Employee controller
"
);
$scope
.
emp
=
{
...
...
@@ -12,7 +12,10 @@ angular.module("myApp",[]).controller("employeeController", function($scope, $ht
"
emailAddress
"
:
""
,
"
phoneNumber
"
:
""
,
"
homeTown
"
:
""
,
"
education
"
:
""
"
education
"
:
""
,
"
department
"
:
""
,
"
position
"
:
""
,
};
...
...
@@ -27,29 +30,59 @@ angular.module("myApp",[]).controller("employeeController", function($scope, $ht
data
:
$scope
.
emp
}).
then
(
function
successCallback
(
response
)
{
console
.
log
(
response
);
$window
.
location
.
href
=
'
http://localhost:8080/#/tintuc
'
;
},
function
errorCallback
(
response
)
{
console
.
log
(
response
)
});
}
$scope
.
update
=
update
;
function
update
(
employee
){
$scope
.
employee
=
employee
;
list_employee
();
function
update
(
emp
){
$scope
.
emp
=
emp
;
$http
({
method
:
'
PUT
'
,
url
:
"
/employee/
"
+
emp
.
id
,
data
:
$scope
.
emp
}).
then
(
function
successCallback
(
response
)
{
console
.
log
(
response
);
},
function
errorCallback
(
response
)
{
console
.
log
(
response
)
});
}
$scope
.
deleteEmployee
=
function
(
employee
)
{
// HTTP DELETE- delete employee by Id
// Call: http://localhost:8080/employee/{id}
$scope
.
delete
=
function
(
emp
)
{
$http
({
method
:
'
DELETE
'
,
url
:
'
http://localhost:8080/deleteEmployee/
'
+
employee
.
id
}).
then
(
_success
,
_error
);
}
url
:
'
/employee/
'
+
emp
.
id
}).
then
(
function
successCallback
(
response
)
{
console
.
log
(
response
);
$scope
.
employess
=
response
.
data
;
},
function
errorCallback
(
response
)
{
console
.
log
(
response
)
});
};
// In case of edit
$scope
.
edit
=
function
(
emp
){
$scope
.
emp
.
username
=
emp
.
username
;
$scope
.
emp
.
password
=
emp
.
password
;
$scope
.
emp
.
firstName
=
emp
.
firstName
;
$scope
.
emp
.
lastName
=
emp
.
lastName
;
$scope
.
emp
.
emailAddress
=
emp
.
emailAddress
;
$scope
.
emp
.
phoneNumber
=
emp
.
phoneNumber
;
$scope
.
emp
.
homeTown
=
emp
.
homeTown
;
$scope
.
emp
.
education
=
emp
.
education
;
$scope
.
emp
.
department
=
emp
.
department
;
$scope
.
emp
.
position
=
emp
.
position
;
};
$http
({
method
:
'
GET
'
,
url
:
"
http://localhost:8080/list_employee/
"
,
url
:
"
http://localhost:8080/list_employee/
"
}).
then
(
function
successCallback
(
response
)
{
console
.
log
(
response
)
console
.
log
(
response
);
$scope
.
employess
=
response
.
data
;
},
function
errorCallback
(
response
)
{
console
.
log
(
response
)
...
...
src/main/resources/public/pages/employee/js/app.js
deleted
100644 → 0
View file @
e7b14bbb
var
myApp
=
angular
.
module
(
'
myApp
'
,[
'
ui.router
'
]);
myApp
.
config
(
function
(
$stateProvider
,
$urlRouterProvider
)
{
$urlRouterProvider
.
otherwise
(
'
/home
'
);
$stateProvider
.
state
(
'
home
'
,
{
url
:
'
/home
'
,
templateUrl
:
'
pages/employee/html/welcome.html
'
,
controller
:
'
employeeController
'
});
});
myApp
.
directive
(
'
ngConfirmClick
'
,
[
function
()
{
return
{
link
:
function
(
scope
,
element
,
attr
)
{
var
msg
=
attr
.
ngConfirmClick
||
"
Are you sure?
"
;
var
clickAction
=
attr
.
confirmedClick
;
element
.
bind
(
'
click
'
,
function
(
event
)
{
if
(
window
.
confirm
(
msg
))
{
scope
.
$eval
(
clickAction
)
}
});
}
};
}
])
src/main/resources/public/pages/project/project.html
0 → 100644
View file @
0d763ee9
<div
class=
"container"
>
Project works
</div>
src/main/resources/public/pages/project/projectController.js
0 → 100644
View file @
0d763ee9
/**
*
*/
angular
.
module
(
"
myApp
"
).
controller
(
"
projectController
"
,
function
(
$scope
,
$http
,
$window
)
{
console
.
log
(
"
projectController
"
);
});
\ No newline at end of file
src/main/resources/public/pages/report/employee.html
0 → 100644
View file @
0d763ee9
<!--<div class="container">-->
<!-- <div class="row">-->
<!-- <div class="col-md-8">-->
<!-- <div>-->
<!-- <legend>Employee Details</legend>-->
<!-- <table>-->
<!-- <tr>-->
<!-- <td><label>User Name</label></td>-->
<!-- <td>-->
<!-- <input type="text" maxlength="29" ng-model="emp.username"/>-->
<!-- </td>-->
<!-- </tr>-->
<!-- <tr>-->
<!-- <td><label>First Name</label></td>-->
<!-- <td>-->
<!-- <input type="text" maxlength="29" ng-model="emp.firstName"/>-->
<!-- </td>-->
<!-- </tr>-->
<!-- <tr>-->
<!-- <td><label>Last Name</label></td>-->
<!-- <td>-->
<!-- <input type="text" maxlength="29" ng-model="emp.lastName"/>-->
<!-- </td>-->
<!-- </tr>-->
<!-- <tr>-->
<!-- <td><label id="email" for="email">Email</label> </td>-->
<!-- <td>-->
<!-- <input type="email" maxlength="150" ng-model="emp.emailAddress"/>-->
<!-- </td>-->
<!-- </tr>-->
<!-- <tr>-->
<!-- <td><label>Phone</label></td>-->
<!-- <td>-->
<!-- <input type="text" maxlength="10" value="" ng-model="emp.phoneNumber"/>-->
<!-- </td>-->
<!-- </tr>-->
<!-- <tr>-->
<!-- <td><label>education:</label></td>-->
<!-- <td>-->
<!-- <input ng-model="emp.education"/>-->
<!-- </td>-->
<!-- </tr>-->
<!-- <tr>-->
<!-- <td><label >home town:</label></td>-->
<!-- <td> <input type="text" ng-model="emp.homeTown"/></td>-->
<!-- </tr>-->
<!-- <tr>-->
<!-- <td></td>-->
<!-- <td>-->
<!-- <input type="submit" name="submit" value="submit" ng-click="save();"/>-->
<!-- <input type="submit" name="clear" value="clear" ng-click=" emp = null"/>-->
<!-- </td>-->
<!-- </tr>-->
<!-- </table>-->
<!-- </div>-->
<!-- <div>-->
<!-- <table class="table">-->
<!-- <thead>-->
<!-- <tr>-->
<!-- <th>ID</th>-->
<!-- <th>User Name</th>-->
<!-- <th>First Name</th>-->
<!-- <th>Last Name</th>-->
<!-- <th>EmailAddress</th>-->
<!-- <th>Phone</th>-->
<!-- <th>Education</th>-->
<!-- <th>Home Town</th>-->
<!-- </tr>-->
<!-- </thead>-->
<!-- <tbody>-->
<!-- <tr class="vide" ng-repeat="emp in employess">-->
<!-- <td>{{$index + 1}}</td>-->
<!-- <td>{{emp.username}}</td>-->
<!-- <td>{{emp.firstName}}</td>-->
<!-- <td>{{emp.lastName}}</td>-->
<!-- <td>{{emp.emailAddress}}</td>-->
<!-- <td>{{emp.phoneNumber}}</td>-->
<!-- <td>{{emp.education}}</td>-->
<!-- <td>{{emp.homeTown}}</td>-->
<!-- <td><a href="#" ng-click="update(emp);">Update</a>-->
<!-- <td><a href="#" confirmed-click="delete(employee);" ng-confirm-click=" Do you want to delete this user?">Delete</a></td>-->
<!-- </tr>-->
<!-- </tbody>-->
<!-- </table>-->
<!-- </div>-->
<!-- </div>-->
<!-- </div>-->
<!--</div>-->
src/main/resources/public/pages/report/employeeController.js
0 → 100644
View file @
0d763ee9
// /**
// *
// */
// angular.module("myApp").controller("employeeController", function($scope, $http,$window) {
// console.log("Employee controller");
//
// $scope.emp= {
// "username": "",
// "password": "",
// "firstName": "",
// "lastName": "",
// "emailAddress": "",
// "phoneNumber": "",
// "homeTown": "",
// "education": ""
// };
//
//
//
// $scope.save = save;
//
// function save(){
// console.log($scope.emp);
// $http({
// method : 'POST',
// url : "http://localhost:8080/list_employee/",
// data: $scope.emp
// }).then(function successCallback(response) {
// console.log(response);
// $window.location.href ='http://localhost:8080/#/tintuc';
// }, function errorCallback(response) {
// console.log(response)
// });
// }
// $scope.update = update;
// function update(employee){
// $scope.employee = employee;
// list_employee();
// }
// $scope.deleteEmployee = function (employee) {
// $http({
// method : 'DELETE',
// url : 'http://localhost:8080/employee/' + employee.id
// }).then(_success, _error);
// }
//
//
// $http({
// method : 'GET',
// url : "http://localhost:8080/list_employee/",
// }).then(function successCallback(response) {
// console.log(response)
// $scope.employess=response.data;
// }, function errorCallback(response) {
// console.log(response)
// });
// });
\ No newline at end of file
src/main/resources/public/pages/testlayout/testlayout.html
0 → 100644
View file @
0d763ee9
<div
class=
"container"
>
state con của layout2
</div>
src/main/resources/public/pages/testlayout/testlayoutController.js
0 → 100644
View file @
0d763ee9
/**
*
*/
angular
.
module
(
"
myApp
"
).
controller
(
"
testlayoutController
"
,
function
(
$scope
,
$http
,
$window
)
{
console
.
log
(
"
testlayoutController
"
);
});
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment