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
f75d21a0
Commit
f75d21a0
authored
Jun 17, 2019
by
đinh thị đầm
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update new
parent
5a3250a9
Changes
17
Show whitespace changes
Inline
Side-by-side
Showing
17 changed files
with
294 additions
and
114 deletions
+294
-114
src/main/resources/public/css/style.css
src/main/resources/public/css/style.css
+15
-0
src/main/resources/public/pages/employee/createEmployee.html
src/main/resources/public/pages/employee/createEmployee.html
+3
-1
src/main/resources/public/pages/issue/IssueController.js
src/main/resources/public/pages/issue/IssueController.js
+44
-18
src/main/resources/public/pages/issue/IssueDetailViews.html
src/main/resources/public/pages/issue/IssueDetailViews.html
+1
-1
src/main/resources/public/pages/issue/IssueView.html
src/main/resources/public/pages/issue/IssueView.html
+7
-9
src/main/resources/public/pages/issue/IssuesDetailController.js
...in/resources/public/pages/issue/IssuesDetailController.js
+1
-6
src/main/resources/public/pages/leaveform/leaveForm.html
src/main/resources/public/pages/leaveform/leaveForm.html
+23
-1
src/main/resources/public/pages/leaveform/leaveFormController.js
...n/resources/public/pages/leaveform/leaveFormController.js
+31
-2
src/main/resources/public/pages/project/groupproject/groupProjectAddView.html
...ublic/pages/project/groupproject/groupProjectAddView.html
+4
-1
src/main/resources/public/pages/project/groupproject/groupProjectEditView.html
...blic/pages/project/groupproject/groupProjectEditView.html
+2
-1
src/main/resources/public/pages/project/groupproject/groupProjectView.html
...s/public/pages/project/groupproject/groupProjectView.html
+10
-5
src/main/resources/public/pages/project/groupproject/groupProjectViewController.js
.../pages/project/groupproject/groupProjectViewController.js
+36
-21
src/main/resources/public/pages/project/project/projectEditViews.html
...ources/public/pages/project/project/projectEditViews.html
+3
-1
src/main/resources/public/pages/project/project/projectListViews.html
...ources/public/pages/project/project/projectListViews.html
+17
-19
src/main/resources/public/pages/project/project/projectViewController.js
...ces/public/pages/project/project/projectViewController.js
+43
-23
src/main/resources/public/pages/timesheet/timeSheetController.js
...n/resources/public/pages/timesheet/timeSheetController.js
+31
-4
src/main/resources/public/pages/timesheet/timesheet.html
src/main/resources/public/pages/timesheet/timesheet.html
+23
-1
No files found.
src/main/resources/public/css/style.css
View file @
f75d21a0
...
...
@@ -8592,3 +8592,18 @@ tr:nth-child(n+3) td:nth-child(odd):not(:first-child){
.topnav
.search-container
button
:hover
{
background
:
#ccc
;
}
@media
screen
and
(
max-width
:
992px
){
.row
{
width
:
25%
;
}
}
@media
screen
and
(
max-width
:
768px
){
.row
{
width
:
50%
;
}
}
@media
screen
and
(
max-width
:
576px
){
.row
{
width
:
100%
;
}
}
\ No newline at end of file
src/main/resources/public/pages/employee/createEmployee.html
View file @
f75d21a0
...
...
@@ -3,7 +3,7 @@
<table
class=
"table"
>
<form>
<div
class=
"form-row"
>
<div
class=
"
col
"
>
<div
class=
"
row
"
>
<tr>
<td><label>
User Name
</label></td>
<td>
...
...
@@ -69,5 +69,7 @@
</td>
</tr>
</table>
</div>
</div>
\ No newline at end of file
src/main/resources/public/pages/issue/IssueController.js
View file @
f75d21a0
angular
.
module
(
"
myApp
"
).
controller
(
'
IssuesShowController
'
,
function
(
$scope
,
$stateParams
,
$http
,
$state
)
{
$scope
.
currentPage
=
1
,
$scope
.
numPerPage
=
5
,
$scope
.
maxSize
=
5
;
angular
.
module
(
"
myApp
"
).
controller
(
'
IssuesShowController
'
,
function
(
$scope
,
$stateParams
,
$http
,
$state
,
$filter
)
{
//lấy danh sách +phân trang+tìm kiếm
$scope
.
ListIssues
=
[];
$scope
.
currentPage
=
1
;
$scope
.
numPerPage
=
3
;
$scope
.
maxSize
=
5
;
$scope
.
numberOfPage
=
numberOfPage
;
$scope
.
dataHasLoaded
=
false
;
//mới thêm
$scope
.
makeEmployee
=
function
()
{
$scope
.
ListIssues
=
[];
for
(
i
=
1
;
i
<=
100
;
i
++
)
{
$scope
.
ListIssues
.
push
({
text
:
'
issue
'
+
i
,
done
:
false
});
}
};
$scope
.
keyword
=
""
;
$scope
.
getAll
=
getAll
;
$scope
.
getTotalItems
=
getTotalItems
;
getAll
();
function
getTotalItems
()
{
return
$filter
(
'
filter
'
)(
$scope
.
ListIssues
,
{
'
title
'
:
$scope
.
keyword
}).
length
;
}
$scope
.
pageChangedIndex
=
function
(){
console
.
log
(
$scope
.
currentPage
);
}
function
numberOfPage
()
{
return
Math
.
ceil
(
$scope
.
ListIssues
.
length
/
$scope
.
numPerPage
);
};
function
getAll
()
{
$http
.
get
(
'
http://localhost:8081/danh-sach-issues
'
).
then
(
successCallback
,
errorCallback
);
function
successCallback
(
response
)
{
console
.
log
(
response
.
data
);
{
$scope
.
ListIssues
=
response
.
data
;
$scope
.
numPages
=
function
()
{
return
Math
.
ceil
(
$scope
.
ListIssues
.
length
/
$scope
.
numPerPage
);
};
$scope
.
$watch
(
'
currentPage + numPerPage
'
,
function
()
{
var
begin
=
((
$scope
.
currentPage
-
1
)
*
$scope
.
numPerPage
)
,
end
=
begin
+
$scope
.
numPerPage
;
$scope
.
pageListIssues
=
$scope
.
ListIssues
.
slice
(
begin
,
end
);
});
}
}
}
function
errorCallback
(
error
)
{
//error code
console
.
log
(
"
can't get data!!
"
);
}
//end
//update
$scope
.
updateIssues
=
function
(
issue
)
{
if
(
confirm
(
"
Bạn có muốn thay đổi trạng thái không ?
"
))
{
$http
({
...
...
src/main/resources/public/pages/issue/IssueDetailViews.html
View file @
f75d21a0
...
...
@@ -25,7 +25,7 @@
</div>
<!-- Single Comment -->
<div
class=
"media mb-4"
>
<div
class=
"media mb-4"
ng-controller=
"showComment()"
ng-repeat=
"comment in CommentIssues"
>
<div
class=
"media-body"
>
<h5
class=
"mt-0"
>
UserName
</h5><p>
Thời gian đăng
</p>
-
<p>
Nội dung comment
</p>
-
...
...
src/main/resources/public/pages/issue/IssueView.html
View file @
f75d21a0
...
...
@@ -3,12 +3,12 @@
<div
class=
"col-md-8"
>
<tr>
<td><a
ui-sref=
"addIssues"
class=
"btn btn-success"
data-toggle=
"modal"
>
<i
class=
"fa fa-file-pdf-o"
aria-hidden=
"true
"
></i>
<span>
Thêm Dự Án Mới
</span></a></a></td>
<td><a
ui-sref=
"addIssues"
class=
"btn btn-success"
data-toggle=
"modal"
>
<i
class=
"fa fa-user-plus
"
></i>
<span>
Thêm Dự Án Mới
</span></a></a></td>
</tr>
<h4></h4>
<tr></tr>
<input
type=
"text"
ng-model=
"search"
placeholder=
"Search"
style=
"margin-bottom: 10px;
"
>
<input
class=
"search"
ng-model=
"keyword"
type=
"text"
placeholder=
"Search"
ng-change=
"currentPage =1
"
>
<tr></tr>
<h2>
Danh Sách Issue
</h2>
...
...
@@ -25,7 +25,7 @@
</tr>
</thead>
<tbody>
<tr
ng-repeat=
"issue in
pageListIssues|filter:search
"
>
<tr
ng-repeat=
"issue in
ListIssues| filter:{title:keyword} |lmto:3:3*(currentPage-1) track by $index
"
>
<td>
{{ issue.project.name }}
</td>
<td>
{{ issue.title }}
</td>
<td>
{{ issue.startDate | date:"dd/MM/yyyy" }}
</td>
...
...
@@ -56,12 +56,10 @@
</tbody>
</table>
<div
data-pagination=
""
data-num-pages=
"numPages()"
data-current-page=
"currentPage"
data-max-size=
"maxSize"
data-boundary-links=
"true"
>
</div>
<uib-pagination
total-items=
"getTotalItems()"
boundary-link-numbers=
"true"
ng-model=
"currentPage"
ng-change=
"pageChangedIndex()"
rotate=
"true"
items-per-page=
"numPerPage"
></uib-pagination>
</div>
</div>
</div>
src/main/resources/public/pages/issue/IssuesDetailController.js
View file @
f75d21a0
...
...
@@ -44,12 +44,7 @@ var app = angular.module("myApp").controller('loadIssuesDetail', function ($scop
});
app
.
controller
(
'
showComment
'
,
showComment
)
function
showComment
(
$scope
,
$http
)
{
//trang đang đứng trên font-end
$scope
.
currentPage
=
1
//số item hiển thị trong 1 page
,
$scope
.
numPerPage
=
4
//tổng số page hiển thị trên thanh chọn
,
$scope
.
maxSize
=
5
;
$http
.
get
(
'
http://localhost:8081/Comment/
'
+
$scope
.
loadIssues
.
id
).
then
(
successCallback
,
errorCallback
);
function
successCallback
(
response
)
{
...
...
src/main/resources/public/pages/leaveform/leaveForm.html
View file @
f75d21a0
...
...
@@ -23,6 +23,15 @@
</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
class=
"col-sm-4 pull-right"
>
<label>
PageSize:
</label>
<select
ng-value=
"leaveFormPerPage"
ng-model=
"leaveFormPerPage"
class=
"form-control"
>
<option>
3
</option>
<option>
5
</option>
<option>
50
</option>
<option>
100
</option>
</select>
</div>
</div>
</div>
</div>
...
...
@@ -109,7 +118,7 @@
</tr>
</thead>
<tbody>
<tr
class=
"lff"
ng-repeat=
"lf in
leaveForms | filter: search
"
>
<tr
class=
"lff"
ng-repeat=
"lf in
searched = (leaveFormList | filter:search | orderBy : base :reverse) | beginningLeaveForm:(currentPage-1)*leaveFormPerPage | limitTo:leaveFormPerPage
"
>
<td>
{{$index + 1}}
</td>
<td>
{{lf.title}}
</td>
<td>
{{lf.content}}
</td>
...
...
@@ -126,6 +135,19 @@
</tbody>
</table>
</div>
<div
class=
"col-md-12"
ng-show=
"filterLeaveForm == 0"
>
<div
class=
"col-md-12"
>
<h4>
No records found..
</h4>
</div>
</div>
<div
class=
"col-md-12"
>
<div
class=
"col-md-6 pull-left"
>
<h5>
Showing {{ searched.length }} of {{ entireLeaveForm}} entries
</h5>
</div>
<uib-pagination
total-items=
"filterLeaveForm"
boundary-link-numbers=
"true"
ng-model=
"currentPage"
ng-change=
"pagePosition(currentPage)"
rotate=
"true"
items-per-page=
"leaveFormPerPage"
></uib-pagination>
</div>
</div>
</div>
</div>
...
...
src/main/resources/public/pages/leaveform/leaveFormController.js
View file @
f75d21a0
/*
*/
angular
.
module
(
"
myApp
"
).
controller
(
"
leaveFormController
"
,
function
(
$scope
,
$http
,
$state
)
{
angular
.
module
(
"
myApp
"
)
.
filter
(
'
beginningLeaveForm
'
,
function
()
{
return
function
(
input
,
begin
)
{
if
(
input
)
{
begin
=
+
begin
;
return
input
.
slice
(
begin
);
}
return
[];
}
})
.
controller
(
"
leaveFormController
"
,
function
(
$scope
,
$http
,
$state
)
{
console
.
log
(
"
Leave Form controller
"
);
$scope
.
lf
=
{
...
...
@@ -28,11 +38,30 @@ angular.module("myApp").controller("leaveFormController", function($scope, $http
url
:
"
http://localhost:8081/employee/leaveform/show
"
}).
then
(
function
successCallback
(
response
)
{
console
.
log
(
response
);
$scope
.
leaveForms
=
response
.
data
;
$scope
.
leaveFormList
=
response
.
data
;
$scope
.
currentPage
=
1
;
$scope
.
leaveFormPerPage
=
3
;
$scope
.
filterLeaveForm
=
$scope
.
leaveFormList
.
length
;
$scope
.
entireLeaveForm
=
$scope
.
leaveFormList
.
length
;
},
function
errorCallback
(
response
)
{
console
.
log
(
response
)
});
$scope
.
pagePosition
=
function
(
pageNumber
)
{
$scope
.
currentPage
=
pageNumber
;
};
$scope
.
filter
=
function
()
{
$timeout
(
function
()
{
$scope
.
filterLeaveForm
=
$scope
.
searched
.
length
;
},
20
);
};
$scope
.
sortWith
=
function
(
base
)
{
$scope
.
base
=
base
;
$scope
.
reverse
=
!
$scope
.
reverse
;
};
//get all leave type
$http
({
method
:
'
GET
'
,
...
...
src/main/resources/public/pages/project/groupproject/groupProjectAddView.html
View file @
f75d21a0
<div
class=
"container"
>
<div
class=
"row"
>
<div
class=
"row"
>
<form
ng-controller=
"insertEmployeeProject"
ng-submit=
"insert_employeeproject(employeeProject)"
name=
"eproject"
>
<h1
style=
"text-align: center"
>
Thành thành viên mới của dự án
</h1>
<div
class=
"form-row"
>
...
...
@@ -30,5 +32,6 @@
<button
type=
"button"
ui-sref=
"project"
>
Back
</button>
</div>
</form>
</div>
</div>
</div>
\ No newline at end of file
src/main/resources/public/pages/project/groupproject/groupProjectEditView.html
View file @
f75d21a0
<div
class=
"container"
>
<div
class=
"row"
>
<form
ng-controller=
"updateGroutpProject"
ng-submit=
"updatePositionProject(gruopProject)"
name=
"formProject"
>
<input
type=
"hidden"
ng-model=
"gruopProject.id"
id=
"id"
><br/>
<input
type=
"hidden"
ng-model=
"gruopProject.projectDTO.id"
id=
"idProject"
><br/>
...
...
@@ -20,5 +21,5 @@
<button
type=
"button"
ui-sref=
"groupProjectByProjectId({ID: gruopProject.projectDTO.id})"
>
Back
</button>
</div>
</form>
</div>
</div>
\ No newline at end of file
src/main/resources/public/pages/project/groupproject/groupProjectView.html
View file @
f75d21a0
...
...
@@ -7,6 +7,10 @@
<td><a
ui-sref=
"addEmployeeProject"
class=
"btn btn-success"
data-toggle=
"modal"
><i
class=
"fa fa-user-plus"
></i>
<span>
Thêm Dự Án Mới
</span></a></a></td>
</tr>
<h4></h4>
<tr></tr>
<input
type=
"text"
ng-model=
"search"
placeholder=
"Search"
style=
"margin-bottom: 10px;"
>
<tr></tr>
<h2
style=
"text-align: center"
>
Thành Viên Trong Nhóm Dự Án
</h2>
<table
class=
"table"
>
...
...
@@ -24,7 +28,7 @@
</tr>
</thead>
<tbody>
<tr
ng-repeat=
"gruopProject in
pageGroupListProject
"
>
<tr
ng-repeat=
"gruopProject in
listGruopProject |filter:search| lmto:3:3*(currentPage-1) track by $index
"
>
<td>
{{ gruopProject.employeeDTO.username }}
</td>
<td>
{{ gruopProject.employeeDTO.lastName }}
</td>
<td>
{{ gruopProject.employeeDTO.email}}
</td>
...
...
@@ -50,11 +54,12 @@
</tbody>
</table>
<div
data-pagination=
""
data-num-pages=
"numPages()"
data-current-page=
"currentPage"
data-max-size=
"maxSiz
e"
data-boundary-links=
"true"
>
</div
>
<uib-pagination
total-items=
"getTotalItems()"
boundary-link-numbers=
"true"
ng-model=
"currentPag
e"
ng-change=
"pageChangedIndex()"
rotate=
"true"
items-per-page=
"numPerPage"
></uib-pagination
>
</div>
<button
type=
"button"
ui-sref=
"project"
>
Back
</button>
</div>
</div>
\ No newline at end of file
src/main/resources/public/pages/project/groupproject/groupProjectViewController.js
View file @
f75d21a0
angular
.
module
(
"
myApp
"
).
controller
(
'
groupProjectShowController
'
,
function
(
$scope
,
$stateParams
,
$http
)
{
$scope
.
currentPage
=
1
,
$scope
.
numPerPage
=
2
,
$scope
.
maxSize
=
5
;
$http
.
get
(
'
http://localhost:8081/thong-tin-du-an/
'
+
$stateParams
.
ID
).
then
(
successCallback
,
errorCallback
);
angular
.
module
(
"
myApp
"
).
controller
(
'
groupProjectShowController
'
,
function
(
$scope
,
$stateParams
,
$http
,
$filter
)
{
$scope
.
listGruopProject
=
[];
$scope
.
currentPage
=
1
;
$scope
.
numPerPage
=
3
;
$scope
.
maxSize
=
5
;
$scope
.
numberOfPage
=
numberOfPage
;
$scope
.
dataHasLoaded
=
false
;
$scope
.
getAll
=
getAll
;
$scope
.
getTotalItems
=
getTotalItems
;
getAll
();
function
getTotalItems
()
{
return
$filter
(
'
filter
'
)(
$scope
.
listGruopProject
).
length
;
}
$scope
.
pageChangedIndex
=
function
(){
console
.
log
(
$scope
.
currentPage
);
}
function
numberOfPage
()
{
return
Math
.
ceil
(
$scope
.
listGruopProject
.
length
/
$scope
.
numPerPage
);
};
function
getAll
()
{
$http
.
get
(
'
http://localhost:8081/thong-tin-du-an/
'
+
$stateParams
.
ID
).
then
(
successCallback
,
errorCallback
);
function
successCallback
(
response
)
{
console
.
log
(
response
.
data
);
{
$scope
.
listGruopProject
=
response
.
data
;
$scope
.
numPages
=
function
()
{
return
Math
.
ceil
(
$scope
.
listGruopProject
.
length
/
$scope
.
numPerPage
);
};
$scope
.
$watch
(
'
currentPage + numPerPage
'
,
function
()
{
var
begin
=
((
$scope
.
currentPage
-
1
)
*
$scope
.
numPerPage
)
,
end
=
begin
+
$scope
.
numPerPage
;
$scope
.
pageGroupListProject
=
$scope
.
listGruopProject
.
slice
(
begin
,
end
);
});
}
}
function
errorCallback
(
error
)
{
//error code
console
.
log
(
"
can't get data!!
"
);
}
}
});
\ No newline at end of file
src/main/resources/public/pages/project/project/projectEditViews.html
View file @
f75d21a0
<div
class=
"container"
>
<div
class=
"row"
>
<form
ng-controller=
"updateProject"
ng-submit=
"updateProject(project)"
name=
"formProject"
>
<
H1
style=
"text-align: center"
>
Cập nhật dự án dự án
<
h1>
<
h1
style=
"text-align: center"
>
Cập nhật dự án dự án
</
h1>
<div
class=
"form-row"
>
<div
class=
"col"
>
<label>
Tên Dự Án
</label>
...
...
@@ -28,5 +29,6 @@
<button
type=
"button"
ui-sref=
"project"
>
Back
</button>
</div>
</form>
</div>
</div>
src/main/resources/public/pages/project/project/projectListViews.html
View file @
f75d21a0
...
...
@@ -4,14 +4,15 @@
<div
class=
"col-md-8"
>
<tr>
<td><a
ui-sref=
"addproject"
class=
"btn btn-success"
data-toggle=
"modal"
>
<i
class=
"fa fa-file-pdf-o"
aria-hidden=
"true"
></i>
<span>
Thêm Dự Án Mới
</span></a></a></td>
<td><a
ui-sref=
"addproject"
class=
"btn btn-success"
data-toggle=
"modal"
>
<i
class=
"fa fa-user-plus"
></i>
<span>
Thêm Dự Án Mới
</span></a></a></td>
</tr>
<h4></h4>
<tr></tr>
<input
type=
"text"
ng-model=
"search"
placeholder=
"Search"
>
<!-- <input type="text" ng-model="search" placeholder="Search">-->
<input
class=
"search"
ng-model=
"keyword"
type=
"text"
placeholder=
"Search"
ng-change=
"currentPage =1"
>
<tr></tr>
<h2>
Thông tin dự án
</h2>
<h2
style=
"text-align: center"
>
Thông tin dự án
</h2>
<table
class=
"table"
>
...
...
@@ -23,12 +24,12 @@
<th>
Ngày bắt đầu
</th>
<th>
Hạn giao
</th>
<th>
Trạng Thái
</th>
<th
style=
"width: 2
0
0px"
>
Thao Tác
</th>
<th
style=
"width: 2
5
0px"
>
Thao Tác
</th>
</tr>
</thead>
<tbody>
<tr
class=
"vide"
ng-repeat=
"project in
pageListProject|filter:search
"
>
ng-repeat=
"project in
listProject| filter:{name:keyword} | lmto:3:3*(currentPage-1) track by $index
"
>
<td>
{{ project.name }}
</td>
<td>
{{ project.descriptions }}
</td>
<td>
{{ project.startDate | date:"dd/MM/yyyy" }}
</td>
...
...
@@ -39,9 +40,9 @@
<span
ng-if=
"project.status == 2"
style=
"color: #b21f2d"
>
Hoàn Thành
</span>
</td>
<!-- thao tác-->
<td
style=
"width: 2
0
0px"
>
<td
style=
"width: 2
5
0px"
>
<a
ui-sref=
"groupProjectByProjectId({ID: project.id})"
class=
"btn btn-info btn-circle btn-sm"
>
Xem
</a>
Chi Tiết Nhóm
</a>
<a
ui-sref=
"editproject({ID: project.id})"
>
<button
class=
"btn btn-primary btn-xs"
data-title=
"Edit"
data-toggle=
"modal"
...
...
@@ -59,13 +60,10 @@
</tbody>
</table>
<div
data-pagination=
""
data-num-pages=
"numPages()"
data-current-page=
"currentPage"
data-max-size=
"maxSize"
data-boundary-links=
"true"
>
</div>
<uib-pagination
total-items=
"getTotalItems()"
boundary-link-numbers=
"true"
ng-model=
"currentPage"
ng-change=
"pageChangedIndex()"
rotate=
"true"
items-per-page=
"numPerPage"
></uib-pagination>
</div>
</div>
</div>
src/main/resources/public/pages/project/project/projectViewController.js
View file @
f75d21a0
angular
.
module
(
"
myApp
"
).
controller
(
'
projectViewsController
'
,
function
(
$scope
,
$http
)
{
//trang đang đứng trên font-end
$scope
.
currentPage
=
1
//số item hiển thị trong 1 page
,
$scope
.
numPerPage
=
4
//tổng số page hiển thị trên thanh chọn
,
$scope
.
maxSize
=
5
;
angular
.
module
(
"
myApp
"
).
controller
(
'
projectViewsController
'
,
function
(
$scope
,
$http
,
$filter
)
{
$scope
.
listProject
=
[];
$scope
.
currentPage
=
1
;
$scope
.
numPerPage
=
3
;
$scope
.
maxSize
=
5
;
$scope
.
numberOfPage
=
numberOfPage
;
$scope
.
dataHasLoaded
=
false
;
//mới thêm
$scope
.
makeEmployee
=
function
()
{
$scope
.
listProject
=
[];
for
(
i
=
1
;
i
<=
100
;
i
++
)
{
$scope
.
listProject
.
push
({
text
:
'
project
'
+
i
,
done
:
false
});
}
};
$scope
.
keyword
=
""
;
//mới thêm
$scope
.
getAll
=
getAll
;
$scope
.
getTotalItems
=
getTotalItems
;
getAll
();
function
getTotalItems
()
{
return
$filter
(
'
filter
'
)(
$scope
.
listProject
,
{
'
name
'
:
$scope
.
keyword
}).
length
;
}
$scope
.
pageChangedIndex
=
function
(){
console
.
log
(
$scope
.
currentPage
);
}
function
numberOfPage
()
{
return
Math
.
ceil
(
$scope
.
listProject
.
length
/
$scope
.
numPerPage
);
};
function
getAll
()
{
$http
.
get
(
"
http://localhost:8081/quan-tri/danh-sach-du-an
"
).
then
(
successCallback
,
errorCallback
);
function
successCallback
(
response
)
{
console
.
log
(
response
.
data
);
{
$scope
.
listProject
=
response
.
data
;
$scope
.
numPages
=
function
()
{
return
Math
.
ceil
(
$scope
.
listProject
.
length
/
$scope
.
numPerPage
);
};
$scope
.
$watch
(
'
currentPage + numPerPage
'
,
function
()
{
var
begin
=
((
$scope
.
currentPage
-
1
)
*
$scope
.
numPerPage
)
,
end
=
begin
+
$scope
.
numPerPage
;
$scope
.
pageListProject
=
$scope
.
listProject
.
slice
(
begin
,
end
);
});
}
}
function
errorCallback
(
error
)
{
console
.
log
(
"
can't get data!!
"
);
}
}
});
\ No newline at end of file
src/main/resources/public/pages/timesheet/timeSheetController.js
View file @
f75d21a0
/*
*/
angular
.
module
(
"
myApp
"
).
controller
(
"
timeSheetController
"
,
function
(
$scope
,
$http
,
$state
)
{
angular
.
module
(
"
myApp
"
)
.
filter
(
'
beginningTimeSheet
'
,
function
()
{
return
function
(
input
,
begin
)
{
if
(
input
)
{
begin
=
+
begin
;
return
input
.
slice
(
begin
);
}
return
[];
}
})
.
controller
(
"
timeSheetController
"
,
function
(
$scope
,
$http
,
$state
)
{
console
.
log
(
"
Time Sheet controller
"
);
$scope
.
ts
=
{
...
...
@@ -19,17 +29,34 @@ angular.module("myApp").controller("timeSheetController", function($scope, $http
};
//get all time sheet
//function getAllTimesheet(){
$http
({
method
:
'
GET
'
,
url
:
"
http://localhost:8081/eproject/timesheet/show
"
}).
then
(
function
successCallback
(
response
)
{
console
.
log
(
response
);
$scope
.
myTimeSheets
=
response
.
data
;
$scope
.
timeSheetList
=
response
.
data
;
$scope
.
currentPage
=
1
;
$scope
.
timeSheetPerPage
=
3
;
$scope
.
filterTimeSheet
=
$scope
.
timeSheetList
.
length
;
$scope
.
entireTimeSheet
=
$scope
.
timeSheetList
.
length
;
},
function
errorCallback
(
response
)
{
console
.
log
(
response
)
});
//}
$scope
.
pagePosition
=
function
(
pageNumber
)
{
$scope
.
currentPage
=
pageNumber
;
};
$scope
.
filter
=
function
()
{
$timeout
(
function
()
{
$scope
.
filterTimeSheet
=
$scope
.
searched
.
length
;
},
20
);
};
$scope
.
sortWith
=
function
(
base
)
{
$scope
.
base
=
base
;
$scope
.
reverse
=
!
$scope
.
reverse
;
};
//get all eproject
$http
({
...
...
src/main/resources/public/pages/timesheet/timesheet.html
View file @
f75d21a0
...
...
@@ -23,6 +23,15 @@
</div>
<div
class=
"col-sm-6"
>
<input
id=
"addTimeSheet"
class=
"btn btn-success"
data-toggle=
"modal"
type=
"submit"
name=
"addTS"
value=
"Add TimeSheet"
onclick=
"showAddTimeSheetFunction()"
/>
<div
class=
"col-sm-4 pull-right"
>
<label>
PageSize:
</label>
<select
ng-value=
"timeSheetPerPage"
ng-model=
"timeSheetPerPage"
class=
"form-control"
>
<option>
3
</option>
<option>
5
</option>
<option>
50
</option>
<option>
100
</option>
</select>
</div>
</div>
</div>
</div>
...
...
@@ -125,7 +134,7 @@
</tr>
</thead>
<tbody>
<tr
class=
"tss"
ng-repeat=
"ts in
myTimeSheets | limitTo:numLimit:start | filter: search
"
>
<tr
class=
"tss"
ng-repeat=
"ts in
searched = (timeSheetList | filter:search | orderBy : base :reverse) | beginningTimeSheet:(currentPage-1)*timeSheetPerPage | limitTo:timeSheetPerPage
"
>
<td>
{{$index + 1}}
</td>
<td>
{{ts.title}}
</td>
<td>
{{ts.content}}
</td>
...
...
@@ -144,6 +153,19 @@
</tbody>
</table>
</div>
<div
class=
"col-md-12"
ng-show=
"filterTimeSheet == 0"
>
<div
class=
"col-md-12"
>
<h4>
No records found..
</h4>
</div>
</div>
<div
class=
"col-md-12"
>
<div
class=
"col-md-6 pull-left"
ng-show=
"filterTimeSheet > 0"
>
<h5>
Showing {{ searched.length }} of {{ entireTimeSheet}} entries
</h5>
</div>
<uib-pagination
total-items=
"filterTimeSheet"
boundary-link-numbers=
"true"
ng-model=
"currentPage"
ng-change=
"pagePosition(currentPage)"
rotate=
"true"
items-per-page=
"timeSheetPerPage"
></uib-pagination>
</div>
</div>
</div>
</div>
...
...
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