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
ff6ce725
Commit
ff6ce725
authored
Jun 14, 2019
by
Phạm Duy Phi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
no message
parent
4b917cbf
Changes
8
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
532 additions
and
517 deletions
+532
-517
src/main/resources/public/css/style.css
src/main/resources/public/css/style.css
+205
-77
src/main/resources/public/index.html
src/main/resources/public/index.html
+14
-2
src/main/resources/public/pages/leaveform/leaveForm.html
src/main/resources/public/pages/leaveform/leaveForm.html
+97
-93
src/main/resources/public/pages/leaveform/leaveFormController.js
...n/resources/public/pages/leaveform/leaveFormController.js
+1
-1
src/main/resources/public/pages/timesheet/timeSheet.html
src/main/resources/public/pages/timesheet/timeSheet.html
+107
-100
src/main/resources/public/pages/timesheet/timeSheetController.js
...n/resources/public/pages/timesheet/timeSheetController.js
+1
-1
src/main/resources/public/pages/timesheet/timesheet.html
src/main/resources/public/pages/timesheet/timesheet.html
+107
-100
src/main/resources/public/pages/timesheet/timesheetController.js
...n/resources/public/pages/timesheet/timesheetController.js
+0
-143
No files found.
src/main/resources/public/css/style.css
View file @
ff6ce725
.blue-button
{
body
{
background
:
#25A6E1
;
color
:
#566787
;
padding
:
3px
5px
;
background
:
#f5f5f5
;
font-family
:
'Varela Round'
,
sans-serif
;
font-size
:
13px
;
}
.table-wrapper
{
background
:
#fff
;
padding
:
20px
25px
;
margin
:
30px
0
;
border-radius
:
3px
;
box-shadow
:
0
1px
1px
rgba
(
0
,
0
,
0
,
.05
);
}
.table-title
{
padding-bottom
:
15px
;
background
:
#435d7d
;
color
:
#fff
;
color
:
#fff
;
font-family
:
'Helvetica Neue'
,
sans-serif
;
padding
:
16px
30px
;
font-size
:
12px
;
margin
:
-20px
-25px
10px
;
border-radius
:
2px
;
border-radius
:
3px
3px
0
0
;
-moz-border-radius
:
2px
;
}
-webkit-border-radius
:
4px
;
.table-title
h2
{
border
:
1px
solid
#1A87B9
margin
:
5px
0
0
;
}
font-size
:
24px
;
}
.red-button
{
.table-title
.btn-group
{
background
:
#CD5C5C
;
float
:
right
;
padding
:
3px
5px
;
}
.table-title
.btn
{
color
:
#fff
;
color
:
#fff
;
font-family
:
'Helvetica Neue'
,
sans-serif
;
float
:
right
;
font-size
:
12px
;
font-size
:
13px
;
border
:
none
;
min-width
:
50px
;
border-radius
:
2px
;
border-radius
:
2px
;
-moz-border-radius
:
2px
;
border
:
none
;
-webkit-border-radius
:
4px
;
outline
:
none
!important
;
border
:
1px
solid
#CD5C5C
margin-left
:
10px
;
}
table
{
font-family
:
"Helvetica Neue"
,
Helvetica
,
sans-serif
;
width
:
70%
;
}
caption
{
text-align
:
left
;
color
:
silver
;
font-weight
:
bold
;
text-transform
:
uppercase
;
padding
:
5px
;
}
}
.table-title
.btn
i
{
th
{
float
:
left
;
background
:
SteelBlue
;
font-size
:
21px
;
color
:
white
;
margin-right
:
5px
;
}
}
.table-title
.btn
span
{
tbody
tr
:nth-child
(
even
)
{
float
:
left
;
background
:
WhiteSmoke
;
margin-top
:
2px
;
}
}
table
.table
tr
th
,
table
.table
tr
td
{
tbody
tr
td
:nth-child
(
2
)
{
border-color
:
#e9e9e9
;
text-align
:
center
;
padding
:
12px
15px
;
vertical-align
:
middle
;
}
}
table
.table
tr
th
:first-child
{
tbody
tr
td
:nth-child
(
3
),
tbody
tr
td
:nth-child
(
4
)
{
width
:
60px
;
text-align
:
center
;
font-family
:
monospace
;
}
tfoot
{
background
:
SeaGreen
;
color
:
white
;
text-align
:
right
;
}
tfoot
tr
th
:last-child
{
font-family
:
monospace
;
}
td
,
th
{
border
:
1px
solid
gray
;
width
:
25%
;
text-align
:
left
;
padding
:
5px
10px
;
}
table
{
border-collapse
:
collapse
;
padding-bottom
:
20%
;
text-align
:
center
;
}
}
table
.table
tr
th
:last-child
{
table
td
,
th
{
width
:
100px
;
padding
:
5px
;
}
}
table
>
thead
>
tr
>
th
{
table
.table-striped
tbody
tr
:nth-of-type
(
odd
)
{
text-align
:
center
;
background-color
:
#fcfcfc
;
}
}
.table
>
thead
>
tr
>
td
{
table
.table-striped.table-hover
tbody
tr
:hover
{
background
:
#f5f5f5
;
}
table
.table
th
i
{
font-size
:
13px
;
margin
:
0
5px
;
cursor
:
pointer
;
}
table
.table
td
:last-child
i
{
opacity
:
0.9
;
font-size
:
22px
;
margin
:
0
5px
;
}
table
.table
td
a
{
font-weight
:
bold
;
color
:
#566787
;
display
:
inline-block
;
text-decoration
:
none
;
outline
:
none
!important
;
}
table
.table
td
a
:hover
{
color
:
#2196F3
;
}
table
.table
td
a
.edit
{
color
:
#FFC107
;
}
table
.table
td
a
.delete
{
color
:
#F44336
;
}
table
.table
td
i
{
font-size
:
19px
;
}
table
.table
.avatar
{
border-radius
:
50%
;
vertical-align
:
middle
;
margin-right
:
10px
;
}
.pagination
{
float
:
right
;
margin
:
0
0
5px
;
}
.pagination
li
a
{
border
:
none
;
font-size
:
13px
;
min-width
:
30px
;
min-height
:
30px
;
color
:
#999
;
margin
:
0
2px
;
line-height
:
30px
;
border-radius
:
2px
!important
;
text-align
:
center
;
text-align
:
center
;
padding-bottom
:
50px
;
padding
:
0
6px
;
}
.pagination
li
a
:hover
{
color
:
#666
;
}
.pagination
li
.active
a
,
.pagination
li
.active
a
.page-link
{
background
:
#03A9F4
;
}
.pagination
li
.active
a
:hover
{
background
:
#0397d6
;
}
.pagination
li
.disabled
i
{
color
:
#ccc
;
}
.pagination
li
i
{
font-size
:
16px
;
padding-top
:
6px
}
.hint-text
{
float
:
left
;
margin-top
:
10px
;
font-size
:
13px
;
}
/* Custom checkbox */
.custom-checkbox
{
position
:
relative
;
}
.custom-checkbox
input
[
type
=
"checkbox"
]
{
opacity
:
0
;
position
:
absolute
;
margin
:
5px
0
0
3px
;
z-index
:
9
;
}
.custom-checkbox
label
:before
{
width
:
18px
;
height
:
18px
;
}
.custom-checkbox
label
:before
{
content
:
''
;
margin-right
:
10px
;
display
:
inline-block
;
vertical-align
:
text-top
;
background
:
white
;
border
:
1px
solid
#bbb
;
border-radius
:
2px
;
box-sizing
:
border-box
;
z-index
:
2
;
}
.custom-checkbox
input
[
type
=
"checkbox"
]
:checked
+
label
:after
{
content
:
''
;
position
:
absolute
;
left
:
6px
;
top
:
3px
;
width
:
6px
;
height
:
11px
;
border
:
solid
#000
;
border-width
:
0
3px
3px
0
;
transform
:
inherit
;
z-index
:
3
;
transform
:
rotateZ
(
45deg
);
}
.custom-checkbox
input
[
type
=
"checkbox"
]
:checked
+
label
:before
{
border-color
:
#03A9F4
;
background
:
#03A9F4
;
}
.custom-checkbox
input
[
type
=
"checkbox"
]
:checked
+
label
:after
{
border-color
:
#fff
;
}
.custom-checkbox
input
[
type
=
"checkbox"
]
:disabled
+
label
:before
{
color
:
#b8b8b8
;
cursor
:
auto
;
box-shadow
:
none
;
background
:
#ddd
;
}
/* Modal styles */
.modal
.modal-dialog
{
max-width
:
400px
;
}
.modal
.modal-header
,
.modal
.modal-body
,
.modal
.modal-footer
{
padding
:
20px
30px
;
}
.modal
.modal-content
{
border-radius
:
3px
;
}
.modal
.modal-footer
{
background
:
#ecf0f1
;
border-radius
:
0
0
3px
3px
;
}
.modal
.modal-title
{
display
:
inline-block
;
}
.modal
.form-control
{
border-radius
:
2px
;
box-shadow
:
none
;
border-color
:
#dddddd
;
}
.modal
textarea
.form-control
{
resize
:
vertical
;
}
.modal
.btn
{
border-radius
:
2px
;
min-width
:
100px
;
}
}
.container
{
.modal
form
label
{
background-color
:
#f1f1f1
;
font-weight
:
normal
;
}
}
\ No newline at end of file
src/main/resources/public/index.html
View file @
ff6ce725
...
@@ -8,6 +8,12 @@
...
@@ -8,6 +8,12 @@
<meta
http-equiv=
"Content-Type"
content=
"text/html; charset=utf-8"
>
<meta
http-equiv=
"Content-Type"
content=
"text/html; charset=utf-8"
>
<title>
Document
</title>
<title>
Document
</title>
<link
href=
"css/bootstrap.css"
rel=
'stylesheet'
type=
'text/css'
/>
<link
href=
"css/bootstrap.css"
rel=
'stylesheet'
type=
'text/css'
/>
<meta
http-equiv=
"X-UA-Compatible"
content=
"IE=edge"
>
<meta
name=
"viewport"
content=
"width=device-width, initial-scale=1"
>
<title>
Bootstrap CRUD Data Table for Database with Modal Form
</title>
<link
rel=
"stylesheet"
href=
"https://fonts.googleapis.com/css?family=Roboto|Varela+Round"
>
<link
rel=
"stylesheet"
href=
"https://fonts.googleapis.com/icon?family=Material+Icons"
>
<link
rel=
"stylesheet"
href=
"https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css"
>
<!-- Custom Theme files -->
<!-- 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=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=Open+Sans" type='text/css'>-->
...
@@ -26,7 +32,7 @@
...
@@ -26,7 +32,7 @@
<script
src=
"pages/project/projectController.js"
></script>
<script
src=
"pages/project/projectController.js"
></script>
<script
src=
"pages/testlayout/testlayoutController.js"
></script>
<script
src=
"pages/testlayout/testlayoutController.js"
></script>
<script
src=
"pages/timesheet/time
s
heetController.js"
></script>
<script
src=
"pages/timesheet/time
S
heetController.js"
></script>
<script
src=
"pages/leaveform/leaveFormController.js"
></script>
<script
src=
"pages/leaveform/leaveFormController.js"
></script>
<script
src=
"pages/leaveform/leaveFormDetailController.js"
></script>
<script
src=
"pages/leaveform/leaveFormDetailController.js"
></script>
<script
src=
"pages/timesheet/timeSheetDetailController.js"
></script>
<script
src=
"pages/timesheet/timeSheetDetailController.js"
></script>
...
@@ -53,8 +59,14 @@
...
@@ -53,8 +59,14 @@
n
.
value
=
"
Close
"
;
n
.
value
=
"
Close
"
;
}
else
{
}
else
{
x
.
style
.
display
=
"
none
"
;
x
.
style
.
display
=
"
none
"
;
n
.
value
=
"
Add
"
;
n
.
value
=
"
Add Leave Form
"
;
}
}
}
</script>
<script>
if
(
document
.
getElementById
(
"
checkStatus
"
)
===
true
)
{
document
.
getElementById
(
"
approved
"
).
style
.
display
=
"
none
"
;
}
}
</script>
</script>
</head>
</head>
...
...
src/main/resources/public/pages/leaveform/leaveForm.html
View file @
ff6ce725
...
@@ -19,80 +19,83 @@
...
@@ -19,80 +19,83 @@
<!--</body>-->
<!--</body>-->
<!--</html>-->
<!--</html>-->
<div
class=
"container"
>
<div
class=
"container"
>
<div
class=
"table-wrapper"
>
<div
class=
"table-title"
>
<div
class=
"row"
>
<div
class=
"row"
>
<div
class=
"col-sm-12"
>
<div
class=
"col-sm-6"
>
<br><br>
<h2><b>
Leave Form
</b></h2>
<input
id=
"addLeaveForm"
type=
"submit"
name=
"addTS"
value=
"Add"
onclick=
"showAddLeaveFormFunction()"
/>
</div>
<div
class=
"col-sm-6"
>
<input
id=
"addLeaveForm"
class=
"btn btn-success"
type=
"submit"
name=
"addTS"
value=
"Add Leave Form"
data-toggle=
"modal"
onclick=
"showAddLeaveFormFunction()"
/>
</div>
</div>
</div>
<div
class=
"row"
>
<div
class=
"col-md-12"
>
<div
id=
"addDivLF"
style=
"display: none"
>
<div
id=
"addDivLF"
style=
"display: none"
>
<legend>
Leave Form
</legend>
<h2><b>
Add Leave Form
</b></h2>
<table>
<table
class=
"table table-striped table-hover"
>
<tr>
<tr>
<td><label>
Title
</label></td>
<td><label>
Title
</label></td>
<td>
<td>
<input
type=
"text"
maxlength=
"300"
ng-model=
"lfdto.title
"
/>
<input
type=
"text"
maxlength=
"300"
ng-model=
"lfdto.title"
style=
"width: 100%;
"
/>
</td>
</td>
</tr>
</tr>
<tr>
<tr>
<td><label>
Content
</label></td>
<td><label>
Content
</label></td>
<td>
<td>
<input
type=
"text"
maxlength=
"10000"
ng-model=
"lfdto.content
"
/>
<input
type=
"text"
maxlength=
"10000"
ng-model=
"lfdto.content"
style=
"width: 100%;
"
/>
</td>
</td>
</tr>
</tr>
<tr>
<tr>
<td><label>
Employee Id
</label></td>
<td><label>
Employee Id
</label></td>
<td>
<td>
<input
type=
"text"
maxlength=
"10"
value=
""
ng-model=
"lfdto.employeeId
"
/>
<input
type=
"text"
maxlength=
"10"
value=
""
ng-model=
"lfdto.employeeId"
style=
"width: 100%;
"
/>
</td>
</td>
</tr>
</tr>
<tr>
<tr>
<td><label>
Leave Type Id
</label></td>
<td><label>
Leave Type Id
</label></td>
<td>
<td>
<input
type=
"text"
maxlength=
"10"
value=
""
ng-model=
"lfdto.leaveTypeId
"
/>
<input
type=
"text"
maxlength=
"10"
value=
""
ng-model=
"lfdto.leaveTypeId"
style=
"width: 100%;
"
/>
</td>
</td>
</tr>
</tr>
<tr>
<tr>
<td></td>
<td></td>
<td
>
<td
>
<input
type=
"submit"
name=
"submit"
class=
"btn-primary"
data-toggle=
"modal"
value=
"Confirm"
ng-click=
"save();"
/>
<input
type=
"submit"
name=
"submit"
value=
"Confirm"
ng-click=
"save();"
/>
<input
type=
"submit"
name=
"clear"
class=
"btn-danger"
data-toggle=
"modal"
value=
"Clear"
ng-click=
"lfdto = null"
/>
<input
type=
"submit"
name=
"clear"
value=
"Clear"
ng-click=
"lfdto = null"
/>
</td>
</td>
</tr>
</tr>
</table>
</table>
</div>
</div>
<br><br>
<div
id=
"updateDivLF"
style=
"display: none"
>
<div
id=
"updateDivLF"
style=
"display: none"
>
<!-- <legend>Leave Form</legend>-->
<h2><b>
Edit Leave Form
</b></h2>
<table>
<table
class=
"table table-striped table-hover"
>
<tr>
<tr>
<td><label>
Title
</label></td>
<td><label>
Title
</label></td>
<td>
<td>
<input
type=
"text"
maxlength=
"300"
ng-model=
"lfdto.title
"
/>
<input
type=
"text"
maxlength=
"300"
ng-model=
"lfdto.title"
style=
"width: 100%;
"
/>
</td>
</td>
</tr>
</tr>
<tr>
<tr>
<td><label>
Content
</label></td>
<td><label>
Content
</label></td>
<td>
<td>
<input
type=
"text"
maxlength=
"10000"
ng-model=
"lfdto.content
"
/>
<input
type=
"text"
maxlength=
"10000"
ng-model=
"lfdto.content"
style=
"width: 100%;
"
/>
</td>
</td>
</tr>
</tr>
<tr>
<tr>
<td></td>
<td></td>
<td
>
<td
>
<input
type=
"submit"
class=
"btn-primary"
data-toggle=
"modal"
name=
"submit"
value=
"Confirm"
ng-click=
"update();"
/>
<input
type=
"submit"
name=
"submit"
value=
"Confirm"
ng-click=
"update();"
/>
<!-- <input type="submit" class="btn-danger" data-toggle="modal" name="clear" value="Clear" ng-click="lfdto = null"/>-->
<input
type=
"submit"
name=
"clear"
value=
"Clear"
ng-click=
"lfdto = null"
/>
<input
type=
"submit"
class=
"btn-dark"
data-toggle=
"modal"
name=
"close"
value=
"Close"
onclick=
"document.getElementById('updateDivLF').style.display = 'none'"
/>
<input
type=
"submit"
name=
"close"
value=
"Close"
onclick=
"document.getElementById('updateDivLF').style.display = 'none'"
/>
</td>
</td>
</tr>
</tr>
</table>
</table>
</div>
</div>
<br><br>
<div>
<div>
<table
class=
"table
"
>
<table
class=
"table table-striped table-hover
"
>
<thead>
<thead>
<tr>
<tr>
<th>
ID
</th>
<th>
ID
</th>
...
@@ -112,17 +115,18 @@
...
@@ -112,17 +115,18 @@
<td>
{{lf.content}}
</td>
<td>
{{lf.content}}
</td>
<td>
{{lf.employee.lastName}}
</td>
<td>
{{lf.employee.lastName}}
</td>
<td>
{{lf.leaveType.name}}
</td>
<td>
{{lf.leaveType.name}}
</td>
<td>
{{lf.
cre
atedAt}}
</td>
<td>
{{lf.
upd
atedAt}}
</td>
<td>
{{lf.status}}
</td>
<td
id=
"checkStatus"
>
{{lf.status}}
</td>
<td><a
ui-sref=
"leaveFormDetail({id: lf.id})"
>
Xem
</a></td>
<td><a
ui-sref=
"leaveFormDetail({id: lf.id})"
data-toggle=
"modal"
><i
class=
"fa fa-eye"
data-toggle=
"tooltip"
title=
"View"
></i>
</a></td>
<td><a
href=
"#"
ng-click=
"getLf(lf);"
onclick=
"document.getElementById('updateDivLF').style.display = 'block'"
>
Sửa
</a></td>
<td><a
ui-sref=
"leaveForm"
ng-click=
"getLf(lf);"
onclick=
"document.getElementById('updateDivLF').style.display = 'block'"
class=
"edit"
data-toggle=
"modal"
><i
class=
"material-icons"
data-toggle=
"tooltip"
title=
"Edit"
>

</i>
</a></td>
<td><a
ui-sref=
"leaveForm"
ng-click=
"delete(lf);
leaveFormController.reloadDataTable();"
>
Xoá
</a></td>
<td><a
ui-sref=
"leaveForm"
ng-click=
"delete(lf);
"
class=
"delete"
data-toggle=
"modal"
><i
class=
"material-icons"
data-toggle=
"tooltip"
title=
"Delete"
>

</i>
</a></td>
<td><a
href=
"#"
ng-click=
"updateStatus(lf)"
>
Duyệt
</a></td>
<td><a
id=
"approved"
ui-sref=
"leaveForm"
ng-click=
"updateStatus(lf)"
data-toggle=
"modal"
><i
class=
"fa fa-check"
data-toggle=
"tooltip"
title=
"Approved"
></i>
</a></td>
</tr>
</tr>
</tbody>
</tbody>
</table>
</table>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
\ No newline at end of file
src/main/resources/public/pages/leaveform/leaveFormController.js
View file @
ff6ce725
...
@@ -11,7 +11,7 @@ angular.module("myApp").controller("leaveFormController", function($scope, $http
...
@@ -11,7 +11,7 @@ angular.module("myApp").controller("leaveFormController", function($scope, $http
"
content
"
:
""
,
"
content
"
:
""
,
"
employee
"
:
""
,
"
employee
"
:
""
,
"
leaveType
"
:
""
,
"
leaveType
"
:
""
,
"
cre
atedAt
"
:
""
,
"
upd
atedAt
"
:
""
,
"
status
"
:
""
"
status
"
:
""
};
};
...
...
src/main/resources/public/pages/timesheet/timeSheet.html
View file @
ff6ce725
...
@@ -19,92 +19,98 @@
...
@@ -19,92 +19,98 @@
<!--</body>-->
<!--</body>-->
<!--</html>-->
<!--</html>-->
<div
class=
"container"
>
<div
class=
"container"
>
<div
class=
"table-wrapper"
>
<div
class=
"table-title"
>
<div
class=
"row"
>
<div
class=
"col-sm-6"
>
<h2><b>
TimeSheet
</b></h2>
</div>
<div
class=
"col-sm-6"
>
<input
id=
"addTimeSheet"
class=
"btn btn-success"
data-toggle=
"modal"
type=
"submit"
name=
"addTS"
value=
"Add"
onclick=
"showAddTimeSheetFunction()"
/>
</div>
</div>
</div>
<div
class=
"row"
>
<div
class=
"row"
>
<div
class=
"col-md-12"
>
<div
class=
"col-md-12"
>
<br><br>
<input
id=
"addTimeSheet"
type=
"submit"
name=
"addTS"
value=
"Add"
onclick=
"showAddTimeSheetFunction()"
/>
<div
id=
"addDivTS"
style=
"display: none"
>
<div
id=
"addDivTS"
style=
"display: none"
>
<legend>
Time Sheet
</legend
>
<h2><b>
Add TimeSheet
</b></h2
>
<table
>
<table
class=
"table table-striped table-hover"
>
<tr>
<tr>
<td><label>
Title
</label></td>
<td><label>
Title
</label></td>
<td>
<td>
<input
type=
"text"
maxlength=
"300"
ng-model=
"tsdto.title
"
/>
<input
type=
"text"
maxlength=
"300"
ng-model=
"tsdto.title"
style=
"width: 100%;
"
/>
</td>
</td>
</tr>
</tr>
<tr>
<tr>
<td><label>
Content
</label></td>
<td><label>
Content
</label></td>
<td>
<td>
<input
type=
"text"
maxlength=
"10000"
ng-model=
"tsdto.content
"
/>
<input
type=
"text"
maxlength=
"10000"
ng-model=
"tsdto.content"
style=
"width: 100%;
"
/>
</td>
</td>
</tr>
</tr>
<tr>
<tr>
<td><label>
Note
</label></td>
<td><label>
Note
</label></td>
<td>
<td>
<input
type=
"text"
maxlength=
"10000"
ng-model=
"tsdto.note
"
/>
<input
type=
"text"
maxlength=
"10000"
ng-model=
"tsdto.note"
style=
"width: 100%;
"
/>
</td>
</td>
</tr>
</tr>
<tr>
<tr>
<td><label>
Employee Project Id
</label></td>
<td><label>
Employee Project Id
</label></td>
<td>
<td>
<input
type=
"text"
maxlength=
"10"
value=
""
ng-model=
"tsdto.eprojectId
"
/>
<input
type=
"text"
maxlength=
"10"
value=
""
ng-model=
"tsdto.eprojectId"
style=
"width: 100%;
"
/>
</td>
</td>
</tr>
</tr>
<tr>
<tr>
<td><label>
Employee Id
</label></td>
<td><label>
Employee Id
</label></td>
<td>
<td>
<input
type=
"text"
maxlength=
"10"
value=
""
ng-model=
"tsdto.employeeId
"
/>
<input
type=
"text"
maxlength=
"10"
value=
""
ng-model=
"tsdto.employeeId"
style=
"width: 100%;
"
/>
</td>
</td>
</tr>
</tr>
<tr>
<tr>
<td></td>
<td></td>
<td
>
<td
>
<input
type=
"submit"
name=
"submit
"
value=
"Confirm"
ng-click=
"save();"
/>
<input
type=
"submit"
name=
"submit"
class=
"btn-primary"
data-toggle=
"modal
"
value=
"Confirm"
ng-click=
"save();"
/>
<input
type=
"submit"
name=
"clear
"
value=
"Clear"
ng-click=
"tsdto = null"
/>
<input
type=
"submit"
name=
"clear"
class=
"btn-dark"
data-toggle=
"modal
"
value=
"Clear"
ng-click=
"tsdto = null"
/>
</td>
</td>
</tr>
</tr>
</table>
</table>
</div>
</div>
<br><br>
<div
id=
"updateDivTS"
style=
"display: none"
>
<div
id=
"updateDivTS"
style=
"display: none"
>
<!-- <legend>Time Sheet</legend>--
>
<h2><b>
Edit TimeSheet
</b></h2
>
<table
>
<table
class=
"table table-striped table-hover"
>
<tr>
<tr>
<td><label>
Title
</label></td>
<td><label>
Title
</label></td>
<td>
<td>
<input
type=
"text"
maxlength=
"300"
ng-model=
"tsdto.title
"
/>
<input
type=
"text"
maxlength=
"300"
ng-model=
"tsdto.title"
style=
"width: 100%;
"
/>
</td>
</td>
</tr>
</tr>
<tr>
<tr>
<td><label>
Content
</label></td>
<td><label>
Content
</label></td>
<td>
<td>
<input
type=
"text"
maxlength=
"10000"
ng-model=
"tsdto.content
"
/>
<input
type=
"text"
maxlength=
"10000"
ng-model=
"tsdto.content"
style=
"width: 100%;
"
/>
</td>
</td>
</tr>
</tr>
<tr>
<tr>
<td><label>
Note
</label></td>
<td><label>
Note
</label></td>
<td>
<td>
<input
type=
"text"
maxlength=
"10000"
ng-model=
"tsdto.note
"
/>
<input
type=
"text"
maxlength=
"10000"
ng-model=
"tsdto.note"
style=
"width: 100%;
"
/>
</td>
</td>
</tr>
</tr>
<tr>
<tr>
<td></td>
<td></td>
<td
>
<td
>
<input
type=
"submit
"
name=
"submit"
value=
"Confirm"
ng-click=
"update();"
/>
<input
type=
"submit"
class=
"btn-primary"
data-toggle=
"modal
"
name=
"submit"
value=
"Confirm"
ng-click=
"update();"
/>
<input
type=
"submit"
name=
"clear"
value=
"Clear"
ng-click=
"tsdto = null"
/
>
<!-- <input type="submit" class="btn-primary" data-toggle="modal" name="clear" value="Clear" ng-click="tsdto = null"/>--
>
<input
type=
"submit
"
name=
"close"
value=
"Close"
onclick=
"document.getElementById('updateDivTS').style.display = 'none'"
/>
<input
type=
"submit"
class=
"btn-dark"
data-toggle=
"modal
"
name=
"close"
value=
"Close"
onclick=
"document.getElementById('updateDivTS').style.display = 'none'"
/>
</td>
</td>
</tr>
</tr>
</table>
</table>
</div>
</div>
<br><br>
<div>
<div>
<table
class=
"table
"
>
<table
class=
"table table-striped table-hover
"
>
<thead>
<thead>
<tr>
<tr>
<th>
ID
</th>
<th>
ID
</th>
...
@@ -123,11 +129,11 @@
...
@@ -123,11 +129,11 @@
<td>
{{ts.content}}
</td>
<td>
{{ts.content}}
</td>
<td>
{{ts.note}}
</td>
<td>
{{ts.note}}
</td>
<td>
{{ts.eproject.project.name}}
</td>
<td>
{{ts.eproject.project.name}}
</td>
<td>
{{ts.
cre
atedAt}}
</td>
<td>
{{ts.
upd
atedAt}}
</td>
<td><a
ui-sref=
"timeSheetDetail({id: ts.id})"
>
Xem
</a></td>
<td><a
ui-sref=
"timeSheetDetail({id: ts.id})"
data-toggle=
"modal"
><i
class=
"fa fa-eye"
data-toggle=
"tooltip"
title=
"View"
></i>
</a></td>
<td><a
href=
"#timesheet"
ng-click=
"getTs(ts);"
onclick=
"document.getElementById('updateDivTS').style.display = 'block'"
>
Sửa
</a></td>
<td><a
ui-sref=
"timeSheet"
ng-click=
"getTs(ts);"
onclick=
"document.getElementById('updateDivTS').style.display = 'block'"
class=
"edit"
data-toggle=
"modal"
><i
class=
"material-icons"
data-toggle=
"tooltip"
title=
"Edit"
>

</i>
</a></td>
<td><a
href=
"#timesheet"
ng-click=
"delete(ts);"
>
Xoá
</a></td>
<td><a
ui-sref=
"timeSheet"
ng-click=
"delete(ts);"
class=
"delete"
data-toggle=
"modal"
><i
class=
"material-icons"
data-toggle=
"tooltip"
title=
"Delete"
>

</i>
</a></td>
</tr>
</tr>
<tr>
<tr>
<td
colspan=
"9"
style=
'text-align: center'
><span>
Page# {{currentPage}} of {{pages}}
</span>
<td
colspan=
"9"
style=
'text-align: center'
><span>
Page# {{currentPage}} of {{pages}}
</span>
...
@@ -139,4 +145,5 @@
...
@@ -139,4 +145,5 @@
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
\ No newline at end of file
src/main/resources/public/pages/timesheet/timeSheetController.js
View file @
ff6ce725
...
@@ -10,7 +10,7 @@ angular.module("myApp").controller("timeSheetController", function($scope, $http
...
@@ -10,7 +10,7 @@ angular.module("myApp").controller("timeSheetController", function($scope, $http
"
content
"
:
""
,
"
content
"
:
""
,
"
note
"
:
""
,
"
note
"
:
""
,
"
eproject
"
:
""
,
"
eproject
"
:
""
,
"
cre
atedAt
"
:
""
"
upd
atedAt
"
:
""
};
};
$scope
.
tsdto
=
{
$scope
.
tsdto
=
{
...
...
src/main/resources/public/pages/timesheet/timesheet.html
View file @
ff6ce725
...
@@ -19,92 +19,98 @@
...
@@ -19,92 +19,98 @@
<!--</body>-->
<!--</body>-->
<!--</html>-->
<!--</html>-->
<div
class=
"container"
>
<div
class=
"container"
>
<div
class=
"table-wrapper"
>
<div
class=
"table-title"
>
<div
class=
"row"
>
<div
class=
"col-sm-6"
>
<h2><b>
TimeSheet
</b></h2>
</div>
<div
class=
"col-sm-6"
>
<input
id=
"addTimeSheet"
class=
"btn btn-success"
data-toggle=
"modal"
type=
"submit"
name=
"addTS"
value=
"Add"
onclick=
"showAddTimeSheetFunction()"
/>
</div>
</div>
</div>
<div
class=
"row"
>
<div
class=
"row"
>
<div
class=
"col-md-12"
>
<div
class=
"col-md-12"
>
<br><br>
<input
id=
"addTimeSheet"
type=
"submit"
name=
"addTS"
value=
"Add"
onclick=
"showAddTimeSheetFunction()"
/>
<div
id=
"addDivTS"
style=
"display: none"
>
<div
id=
"addDivTS"
style=
"display: none"
>
<legend>
Time Sheet
</legend
>
<h2><b>
Add TimeSheet
</b></h2
>
<table
>
<table
class=
"table table-striped table-hover"
>
<tr>
<tr>
<td><label>
Title
</label></td>
<td><label>
Title
</label></td>
<td>
<td>
<input
type=
"text"
maxlength=
"300"
ng-model=
"tsdto.title
"
/>
<input
type=
"text"
maxlength=
"300"
ng-model=
"tsdto.title"
style=
"width: 100%;
"
/>
</td>
</td>
</tr>
</tr>
<tr>
<tr>
<td><label>
Content
</label></td>
<td><label>
Content
</label></td>
<td>
<td>
<input
type=
"text"
maxlength=
"10000"
ng-model=
"tsdto.content
"
/>
<input
type=
"text"
maxlength=
"10000"
ng-model=
"tsdto.content"
style=
"width: 100%;
"
/>
</td>
</td>
</tr>
</tr>
<tr>
<tr>
<td><label>
Note
</label></td>
<td><label>
Note
</label></td>
<td>
<td>
<input
type=
"text"
maxlength=
"10000"
ng-model=
"tsdto.note
"
/>
<input
type=
"text"
maxlength=
"10000"
ng-model=
"tsdto.note"
style=
"width: 100%;
"
/>
</td>
</td>
</tr>
</tr>
<tr>
<tr>
<td><label>
Employee Project Id
</label></td>
<td><label>
Employee Project Id
</label></td>
<td>
<td>
<input
type=
"text"
maxlength=
"10"
value=
""
ng-model=
"tsdto.eprojectId
"
/>
<input
type=
"text"
maxlength=
"10"
value=
""
ng-model=
"tsdto.eprojectId"
style=
"width: 100%;
"
/>
</td>
</td>
</tr>
</tr>
<tr>
<tr>
<td><label>
Employee Id
</label></td>
<td><label>
Employee Id
</label></td>
<td>
<td>
<input
type=
"text"
maxlength=
"10"
value=
""
ng-model=
"tsdto.employeeId
"
/>
<input
type=
"text"
maxlength=
"10"
value=
""
ng-model=
"tsdto.employeeId"
style=
"width: 100%;
"
/>
</td>
</td>
</tr>
</tr>
<tr>
<tr>
<td></td>
<td></td>
<td
>
<td
>
<input
type=
"submit"
name=
"submit
"
value=
"Confirm"
ng-click=
"save();"
/>
<input
type=
"submit"
name=
"submit"
class=
"btn-primary"
data-toggle=
"modal
"
value=
"Confirm"
ng-click=
"save();"
/>
<input
type=
"submit"
name=
"clear
"
value=
"Clear"
ng-click=
"tsdto = null"
/>
<input
type=
"submit"
name=
"clear"
class=
"btn-dark"
data-toggle=
"modal
"
value=
"Clear"
ng-click=
"tsdto = null"
/>
</td>
</td>
</tr>
</tr>
</table>
</table>
</div>
</div>
<br><br>
<div
id=
"updateDivTS"
style=
"display: none"
>
<div
id=
"updateDivTS"
style=
"display: none"
>
<!-- <legend>Time Sheet</legend>--
>
<h2><b>
Edit TimeSheet
</b></h2
>
<table
>
<table
class=
"table table-striped table-hover"
>
<tr>
<tr>
<td><label>
Title
</label></td>
<td><label>
Title
</label></td>
<td>
<td>
<input
type=
"text"
maxlength=
"300"
ng-model=
"tsdto.title
"
/>
<input
type=
"text"
maxlength=
"300"
ng-model=
"tsdto.title"
style=
"width: 100%;
"
/>
</td>
</td>
</tr>
</tr>
<tr>
<tr>
<td><label>
Content
</label></td>
<td><label>
Content
</label></td>
<td>
<td>
<input
type=
"text"
maxlength=
"10000"
ng-model=
"tsdto.content
"
/>
<input
type=
"text"
maxlength=
"10000"
ng-model=
"tsdto.content"
style=
"width: 100%;
"
/>
</td>
</td>
</tr>
</tr>
<tr>
<tr>
<td><label>
Note
</label></td>
<td><label>
Note
</label></td>
<td>
<td>
<input
type=
"text"
maxlength=
"10000"
ng-model=
"tsdto.note
"
/>
<input
type=
"text"
maxlength=
"10000"
ng-model=
"tsdto.note"
style=
"width: 100%;
"
/>
</td>
</td>
</tr>
</tr>
<tr>
<tr>
<td></td>
<td></td>
<td
>
<td
>
<input
type=
"submit
"
name=
"submit"
value=
"Confirm"
ng-click=
"update();"
/>
<input
type=
"submit"
class=
"btn-primary"
data-toggle=
"modal
"
name=
"submit"
value=
"Confirm"
ng-click=
"update();"
/>
<input
type=
"submit"
name=
"clear"
value=
"Clear"
ng-click=
"tsdto = null"
/
>
<!-- <input type="submit" class="btn-primary" data-toggle="modal" name="clear" value="Clear" ng-click="tsdto = null"/>--
>
<input
type=
"submit
"
name=
"close"
value=
"Close"
onclick=
"document.getElementById('updateDivTS').style.display = 'none'"
/>
<input
type=
"submit"
class=
"btn-dark"
data-toggle=
"modal
"
name=
"close"
value=
"Close"
onclick=
"document.getElementById('updateDivTS').style.display = 'none'"
/>
</td>
</td>
</tr>
</tr>
</table>
</table>
</div>
</div>
<br><br>
<div>
<div>
<table
class=
"table
"
>
<table
class=
"table table-striped table-hover
"
>
<thead>
<thead>
<tr>
<tr>
<th>
ID
</th>
<th>
ID
</th>
...
@@ -123,11 +129,11 @@
...
@@ -123,11 +129,11 @@
<td>
{{ts.content}}
</td>
<td>
{{ts.content}}
</td>
<td>
{{ts.note}}
</td>
<td>
{{ts.note}}
</td>
<td>
{{ts.eproject.project.name}}
</td>
<td>
{{ts.eproject.project.name}}
</td>
<td>
{{ts.
cre
atedAt}}
</td>
<td>
{{ts.
upd
atedAt}}
</td>
<td><a
ui-sref=
"timeSheetDetail({id: ts.id})"
>
Xem
</a></td>
<td><a
ui-sref=
"timeSheetDetail({id: ts.id})"
data-toggle=
"modal"
><i
class=
"fa fa-eye"
data-toggle=
"tooltip"
title=
"View"
></i>
</a></td>
<td><a
href=
"#timesheet"
ng-click=
"getTs(ts);"
onclick=
"document.getElementById('updateDivTS').style.display = 'block'"
>
Sửa
</a></td>
<td><a
ui-sref=
"timeSheet"
ng-click=
"getTs(ts);"
onclick=
"document.getElementById('updateDivTS').style.display = 'block'"
class=
"edit"
data-toggle=
"modal"
><i
class=
"material-icons"
data-toggle=
"tooltip"
title=
"Edit"
>

</i>
</a></td>
<td><a
href=
"#timesheet"
ng-click=
"delete(ts);"
>
Xoá
</a></td>
<td><a
ui-sref=
"timeSheet"
ng-click=
"delete(ts);"
class=
"delete"
data-toggle=
"modal"
><i
class=
"material-icons"
data-toggle=
"tooltip"
title=
"Delete"
>

</i>
</a></td>
</tr>
</tr>
<tr>
<tr>
<td
colspan=
"9"
style=
'text-align: center'
><span>
Page# {{currentPage}} of {{pages}}
</span>
<td
colspan=
"9"
style=
'text-align: center'
><span>
Page# {{currentPage}} of {{pages}}
</span>
...
@@ -139,4 +145,5 @@
...
@@ -139,4 +145,5 @@
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
\ No newline at end of file
src/main/resources/public/pages/timesheet/timesheetController.js
deleted
100644 → 0
View file @
4b917cbf
/*
*/
angular
.
module
(
"
myApp
"
).
controller
(
"
timeSheetController
"
,
function
(
$scope
,
$http
,
$state
)
{
console
.
log
(
"
Time Sheet controller
"
);
$scope
.
ts
=
{
"
id
"
:
""
,
"
title
"
:
""
,
"
content
"
:
""
,
"
note
"
:
""
,
"
eproject
"
:
""
,
"
createdAt
"
:
""
};
$scope
.
tsdto
=
{
"
id
"
:
""
,
"
title
"
:
""
,
"
content
"
:
""
,
"
note
"
:
""
,
"
eprojectId
"
:
""
,
"
employeeId
"
:
""
};
//get all time sheet
$http
({
method
:
'
GET
'
,
url
:
"
http://localhost:8080/eproject/timesheet/show
"
}).
then
(
function
successCallback
(
response
)
{
console
.
log
(
response
);
$scope
.
myTimeSheets
=
response
.
data
;
},
function
errorCallback
(
response
)
{
console
.
log
(
response
)
});
//delete time sheet
$scope
.
delete
=
function
(
ts
)
{
$http
({
method
:
'
DELETE
'
,
url
:
"
http://localhost:8080/eproject/timesheet/delete/
"
+
ts
.
id
}).
then
(
function
successCallback
(
response
)
{
console
.
log
(
response
);
$state
.
reload
();
},
function
errorCallback
(
response
)
{
console
.
log
(
response
);
$state
.
reload
();
});
};
$scope
.
save
=
save
;
function
save
(){
console
.
log
(
$scope
.
tsdto
);
$http
({
method
:
'
POST
'
,
url
:
"
http://localhost:8080/eproject/timesheet/add
"
,
data
:
$scope
.
tsdto
}).
then
(
function
successCallback
(
response
)
{
console
.
log
(
response
);
$state
.
reload
();
},
function
errorCallback
(
response
)
{
console
.
log
(
response
);
$state
.
reload
();
});
}
$scope
.
getTs
=
getTs
;
function
getTs
(
ts
)
{
$scope
.
tsdto
.
id
=
ts
.
id
;
$scope
.
tsdto
.
title
=
ts
.
title
;
$scope
.
tsdto
.
content
=
ts
.
content
;
$scope
.
tsdto
.
note
=
ts
.
note
;
$scope
.
tsdto
.
employeeId
=
ts
.
eproject
.
employee
.
id
;
}
$scope
.
update
=
update
;
function
update
(){
$http
({
headers
:
"
content-type: application/json
"
,
method
:
'
POST
'
,
url
:
"
http://localhost:8080/eproject/timesheet/update
"
,
data
:
$scope
.
tsdto
}).
then
(
function
successCallback
(
response
)
{
console
.
log
(
response
);
$state
.
reload
();
},
function
errorCallback
(
response
)
{
console
.
log
(
response
);
$state
.
reload
();
});
}
}).
directive
(
'
pgnTable
'
,
[
'
$compile
'
,
function
(
$compile
)
{
return
{
restrict
:
'
EA
'
,
templateUrl
:
'
pages/timesheet/timeSheet.html
'
,
replace
:
true
,
scope
:
{
pages
:
"
=pgnTable
"
},
controller
:
function
(
$scope
)
{
$scope
.
currentPage
=
1
;
$scope
.
numLimit
=
5
;
$scope
.
start
=
0
;
$scope
.
$watch
(
"
pages
"
,
function
(
newVal
){
if
(
newVal
){
$scope
.
pages
=
Math
.
ceil
(
$scope
.
pages
.
length
/
$scope
.
numLimit
);
}
});
$scope
.
hideNext
=
function
(){
if
((
$scope
.
start
+
$scope
.
numLimit
)
<
$scope
.
pages
.
length
){
return
false
;
}
else
return
true
;
};
$scope
.
hidePrev
=
function
(){
if
(
$scope
.
start
===
0
){
return
true
;
}
else
return
false
;
};
$scope
.
nextPage
=
function
(){
console
.
log
(
"
next pages
"
);
$scope
.
currentPage
++
;
$scope
.
start
=
$scope
.
start
+
$scope
.
numLimit
;
console
.
log
(
$scope
.
start
)
};
$scope
.
PrevPage
=
function
(){
if
(
$scope
.
currentPage
>
1
){
$scope
.
currentPage
--
;
}
console
.
log
(
"
next pages
"
);
$scope
.
start
=
$scope
.
start
-
$scope
.
numLimit
;
console
.
log
(
$scope
.
start
)
};
},
compile
:
function
(
elem
)
{
return
function
(
ielem
,
$scope
)
{
$compile
(
ielem
)(
$scope
);
};
}
};
}]);
\ 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