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
8aee3779
Commit
8aee3779
authored
Jun 15, 2019
by
Phạm Duy Phi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
no message
parent
ed09ed47
Changes
11
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
520 additions
and
34120 deletions
+520
-34120
src/main/java/com/itsol/quantrivanphong/report/timesheet/business/TimeSheetBusiness.java
...vanphong/report/timesheet/business/TimeSheetBusiness.java
+4
-0
src/main/java/com/itsol/quantrivanphong/report/timesheet/controller/TimeSheetController.java
...hong/report/timesheet/controller/TimeSheetController.java
+7
-0
src/main/java/com/itsol/quantrivanphong/report/timesheet/repository/EProjectRepository.java
...phong/report/timesheet/repository/EProjectRepository.java
+0
-3
src/main/resources/public/index.html
src/main/resources/public/index.html
+6
-55
src/main/resources/public/js/angular.js
src/main/resources/public/js/angular.js
+348
-33887
src/main/resources/public/js/app.js
src/main/resources/public/js/app.js
+1
-56
src/main/resources/public/pages/leaveform/leaveForm.html
src/main/resources/public/pages/leaveform/leaveForm.html
+18
-22
src/main/resources/public/pages/leaveform/leaveFormController.js
...n/resources/public/pages/leaveform/leaveFormController.js
+1
-2
src/main/resources/public/pages/leaveform/leaveFormDetail.html
...ain/resources/public/pages/leaveform/leaveFormDetail.html
+1
-1
src/main/resources/public/pages/timesheet/timeSheetController.js
...n/resources/public/pages/timesheet/timeSheetController.js
+108
-65
src/main/resources/public/pages/timesheet/timesheet.html
src/main/resources/public/pages/timesheet/timesheet.html
+26
-29
No files found.
src/main/java/com/itsol/quantrivanphong/report/timesheet/business/TimeSheetBusiness.java
View file @
8aee3779
...
@@ -137,4 +137,8 @@ public class TimeSheetBusiness {
...
@@ -137,4 +137,8 @@ public class TimeSheetBusiness {
public
TimeSheet
findTimeSheetById
(
int
id
)
{
public
TimeSheet
findTimeSheetById
(
int
id
)
{
return
timeSheetRepository
.
findTimeSheetById
(
id
);
return
timeSheetRepository
.
findTimeSheetById
(
id
);
}
}
public
List
<
Eproject
>
getEprojectList
()
{
return
eProjectRepository
.
findAll
();
}
}
}
src/main/java/com/itsol/quantrivanphong/report/timesheet/controller/TimeSheetController.java
View file @
8aee3779
package
com.itsol.quantrivanphong.report.timesheet.controller
;
package
com.itsol.quantrivanphong.report.timesheet.controller
;
import
com.itsol.quantrivanphong.exception.InputException
;
import
com.itsol.quantrivanphong.exception.InputException
;
import
com.itsol.quantrivanphong.model.Eproject
;
import
com.itsol.quantrivanphong.model.TimeSheet
;
import
com.itsol.quantrivanphong.model.TimeSheet
;
import
com.itsol.quantrivanphong.report.leaveform.controller.Notification
;
import
com.itsol.quantrivanphong.report.leaveform.controller.Notification
;
import
com.itsol.quantrivanphong.report.timesheet.business.TimeSheetBusiness
;
import
com.itsol.quantrivanphong.report.timesheet.business.TimeSheetBusiness
;
...
@@ -90,4 +91,10 @@ public class TimeSheetController {
...
@@ -90,4 +91,10 @@ public class TimeSheetController {
public
ResponseEntity
<
String
>
updateCheck
(
@RequestBody
TimeSheetDTO
timeSheetDTO
)
{
public
ResponseEntity
<
String
>
updateCheck
(
@RequestBody
TimeSheetDTO
timeSheetDTO
)
{
return
ResponseEntity
.
ok
(
timeSheetBusiness
.
updateCheck
(
timeSheetDTO
));
return
ResponseEntity
.
ok
(
timeSheetBusiness
.
updateCheck
(
timeSheetDTO
));
}
}
@GetMapping
(
path
=
"/getAll"
)
public
List
<
Eproject
>
getAllEproject
()
{
return
timeSheetBusiness
.
getEprojectList
();
}
}
}
\ No newline at end of file
src/main/java/com/itsol/quantrivanphong/report/timesheet/repository/EProjectRepository.java
View file @
8aee3779
...
@@ -15,9 +15,6 @@ public interface EProjectRepository extends JpaRepository<Eproject, Integer> {
...
@@ -15,9 +15,6 @@ public interface EProjectRepository extends JpaRepository<Eproject, Integer> {
//======================================================================================================
//======================================================================================================
// Hieunv
// Hieunv
...
...
src/main/resources/public/index.html
View file @
8aee3779
...
@@ -15,103 +15,54 @@
...
@@ -15,103 +15,54 @@
<link
rel=
"stylesheet"
href=
"https://fonts.googleapis.com/icon?family=Material+Icons"
>
<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"
>
<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=Open+Sans" type='text/css'>-->
<link
href=
"css/style.css"
rel=
'stylesheet'
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">-->
<link
data-require=
"bootstrap-css@*"
data-semver=
"4.3.1"
rel=
"stylesheet"
href=
"//maxcdn.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css"
/>
<link
data-require=
"bootstrap-css@*"
data-semver=
"4.3.1"
rel=
"stylesheet"
href=
"//maxcdn.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css"
/>
<script
src=
"js/jquery-3.2.1.min.js"
></script>
<script
src=
"js/jquery-3.2.1.min.js"
></script>
<script
src=
"js/bootstrap.min.js"
></script>
<script
src=
"js/bootstrap.min.js"
></script>
<!-- Custom fonts for this template-->
<!-- Custom fonts for this template-->
<link
href=
"https://use.fontawesome.com/releases/v5.6.3/css/all.css"
<link
href=
"https://use.fontawesome.com/releases/v5.6.3/css/all.css"
rel=
"stylesheet"
type=
"text/css"
>
rel=
"stylesheet"
type=
"text/css"
>
<link
href=
"common/css/all.min.css"
rel=
"stylesheet"
<link
href=
"common/css/all.min.css"
rel=
"stylesheet"
type=
"text/css"
>
type=
"text/css"
>
<!-- Page level plugin CSS-->
<!-- Page level plugin CSS-->
<link
href=
"common/css/dataTables.bootstrap4.css"
<link
href=
"common/css/dataTables.bootstrap4.css"
rel=
"stylesheet"
>
rel=
"stylesheet"
>
<!-- Custom styles for this template-->
<!-- Custom styles for this template-->
<link
href=
"common/css/sb-admin.css"
rel=
"stylesheet"
>
<link
href=
"common/css/sb-admin.css"
rel=
"stylesheet"
>
<!-- angular -->
<!-- angular -->
<script
src=
"js/angular.js"
></script>
<script
src=
"js/angular.js"
></script>
<script
src=
"js/angular-route.js"
></script>
<script
src=
"js/angular-route.js"
></script>
<script
src=
"js/angular-ui-router.min.js"
></script>
<script
src=
"js/angular-ui-router.min.js"
></script>
<script
src=
"js/app.js"
></script>
<script
src=
"js/app.js"
></script>
<script
src=
"pages/project/groupproject/groupProjectController.js"
></script>
<script
src=
"pages/project/groupproject/groupProjectController.js"
></script>
<script
src=
"pages/timesheet/timeSheetController.js"
></script>
<script
src=
"pages/timesheet/timeSheetController.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>
<!-- <script src="js/angular-resource.js"></script>-->
<script>
function
showAddTimeSheetFunction
()
{
const
x
=
document
.
getElementById
(
"
addDivTS
"
);
const
n
=
document
.
getElementById
(
"
addTimeSheet
"
);
if
(
x
.
style
.
display
===
"
none
"
)
{
x
.
style
.
display
=
"
block
"
;
n
.
value
=
"
Close
"
;
}
else
{
x
.
style
.
display
=
"
none
"
;
n
.
value
=
"
Add
"
;
}
}
</script>
<script>
function
showAddLeaveFormFunction
()
{
const
x
=
document
.
getElementById
(
"
addDivLF
"
);
const
n
=
document
.
getElementById
(
"
addLeaveForm
"
);
if
(
x
.
style
.
display
===
"
none
"
)
{
x
.
style
.
display
=
"
block
"
;
n
.
value
=
"
Close
"
;
}
else
{
x
.
style
.
display
=
"
none
"
;
n
.
value
=
"
Add Leave Form
"
;
}
}
</script>
<script>
if
(
document
.
getElementById
(
"
checkStatus
"
)
===
true
)
{
document
.
getElementById
(
"
approved
"
).
style
.
display
=
"
none
"
;
}
</script>
<!-- Js -->
<!-- Js -->
<!-- Bootstrap core JavaScript-->
<!-- Bootstrap core JavaScript-->
<script
src=
"pages/employee/employeeController.js"
></script>
<script
src=
"pages/employee/employeeController.js"
></script>
<script
src=
"pages/project/project/projectController.js"
></script>
<script
src=
"pages/project/project/projectController.js"
></script>
<script
src=
"pages/login/loginsController.js"
></script>
<script
src=
"pages/login/loginsController.js"
></script>
<script
src=
"pages/adminhome/admin.js"
></script>
<script
src=
"pages/adminhome/admin.js"
></script>
<script
src=
"common/js/jquery.min.js"
></script>
<script
src=
"common/js/jquery.min.js"
></script>
<script
src=
"common/js/bootstrap.bundle.min.js"
></script>
<script
src=
"common/js/bootstrap.bundle.min.js"
></script>
<!-- Core plugin JavaScript-->
<!-- Core plugin JavaScript-->
<script
src=
"common/js/jquery.easing.min.js"
></script>
<script
src=
"common/js/jquery.easing.min.js"
></script>
<!-- Page level plugin JavaScript-->
<!-- Page level plugin JavaScript-->
<script
src=
"common/js/Chart.min.js"
></script>
<script
src=
"common/js/Chart.min.js"
></script>
<script
src=
"common/js/jquery.dataTables.js"
></script>
<script
src=
"common/js/jquery.dataTables.js"
></script>
<script
src=
"common/js/dataTables.bootstrap4.js"
></script>
<script
src=
"common/js/dataTables.bootstrap4.js"
></script>
<!-- Custom scripts for all pages-->
<!-- Custom scripts for all pages-->
<script
src=
"common/js/sb-admin.min.js"
></script>
<script
src=
"common/js/sb-admin.min.js"
></script>
\
<script
src=
"//ajax.googleapis.com/ajax/libs/angularjs/1.6.1/angular-animate.js"
></script>
<script
src=
"//ajax.googleapis.com/ajax/libs/angularjs/1.6.1/angular-sanitize.js"
></script>
<script
src=
"//angular-ui.github.io/bootstrap/ui-bootstrap-tpls-1.3.3.js"
></script>
</head>
</head>
<body
ng-app=
"myApp"
>
<body
ng-app=
"myApp"
>
<div
ui-view=
"layout"
>
<div
ui-view=
"layout"
></div>
<!-- <div style="margin-left:5px;margin-top:10px" ng-controller="timeSheetController">-->
<!-- <span pgn-table="myTimeSheets"></span>-->
<!-- </div>-->
</div>
</body>
</body>
</html>
</html>
\ No newline at end of file
src/main/resources/public/js/angular.js
View file @
8aee3779
This source diff could not be displayed because it is too large. You can
view the blob
instead.
src/main/resources/public/js/app.js
View file @
8aee3779
/**
/**
*
*
*/
*/
angular
.
module
(
"
myApp
"
,
[
"
ui.router
"
,
'
ngRoute
'
]).
config
(
function
(
$stateProvider
,
$urlRouterProvider
,
$locationProvider
)
{
angular
.
module
(
"
myApp
"
,
[
"
ui.router
"
,
"
ui.bootstrap
"
]).
config
(
function
(
$stateProvider
,
$urlRouterProvider
,
$locationProvider
)
{
$locationProvider
.
hashPrefix
(
''
);
$locationProvider
.
hashPrefix
(
''
);
//trở về trang mặc định
//trở về trang mặc định
...
@@ -16,14 +16,6 @@ angular.module("myApp", ["ui.router", 'ngRoute']).config(function ($stateProvide
...
@@ -16,14 +16,6 @@ angular.module("myApp", ["ui.router", 'ngRoute']).config(function ($stateProvide
}
}
}
}
})
})
// .state("layout4", {
// abstract: true,
// views: {
// "layout": {
// templateUrl: "layout/layout4.html"
// }
// }
// })
.
state
(
"
admin
"
,
{
.
state
(
"
admin
"
,
{
parent
:
'
layout3
'
,
parent
:
'
layout3
'
,
url
:
"
/admin
"
,
url
:
"
/admin
"
,
...
@@ -64,16 +56,6 @@ angular.module("myApp", ["ui.router", 'ngRoute']).config(function ($stateProvide
...
@@ -64,16 +56,6 @@ angular.module("myApp", ["ui.router", 'ngRoute']).config(function ($stateProvide
}
}
}
}
})
})
// .state('app', {
// abstract: true,
// views: {
// 'main_layout': {
// templateUrl: 'main_layout.html',
// }
// }
// })
.
state
(
"
employees
"
,
{
.
state
(
"
employees
"
,
{
parent
:
'
layout3
'
,
parent
:
'
layout3
'
,
url
:
"
/employees
"
,
url
:
"
/employees
"
,
...
@@ -145,17 +127,6 @@ angular.module("myApp", ["ui.router", 'ngRoute']).config(function ($stateProvide
...
@@ -145,17 +127,6 @@ angular.module("myApp", ["ui.router", 'ngRoute']).config(function ($stateProvide
}
}
}
}
})
})
// .state("testlayout2", {
// parent: 'layout2',
// url: "/testttt",
// views: {
// "content": {
// templateUrl: "/pages/testlayout/testlayout.html",
// controller: "testlayoutController"
// }
// }
// })
.
state
(
"
gioithieu
"
,
{
.
state
(
"
gioithieu
"
,
{
parent
:
'
app
'
,
parent
:
'
app
'
,
url
:
"
/gioithieu
"
,
url
:
"
/gioithieu
"
,
...
@@ -198,29 +169,3 @@ angular.module("myApp", ["ui.router", 'ngRoute']).config(function ($stateProvide
...
@@ -198,29 +169,3 @@ angular.module("myApp", ["ui.router", 'ngRoute']).config(function ($stateProvide
}
}
})
})
});
});
// .state("lienhe", {
// parent: 'app',
// url: "/lienhe",
// views:{
// "content":{
// templateUrl: "pages/lienhe/lienhe.htm",
// controller: "lienheController"
// }
// }
// })
// 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/leaveform/leaveForm.html
View file @
8aee3779
<!--<!DOCTYPE html>-->
<script>
<!--<html lang="en" ng-app="myApp" ng-controller="timesheetController">-->
function
showAddLeaveFormFunction
()
{
<!--<head>-->
const
x
=
document
.
getElementById
(
"
addDivLF
"
);
<!-- <meta charset="UTF-8">-->
const
n
=
document
.
getElementById
(
"
addLeaveForm
"
);
<!-- <title>Time Sheet</title>-->
if
(
x
.
style
.
display
===
"
none
"
)
{
<!-- <meta name="viewport" content="width=device-width, initial-scale=1">-->
x
.
style
.
display
=
"
block
"
;
<!-- <script src="//unpkg.com/@uirouter/angularjs/release/angular-ui-router.min.js"></script>-->
n
.
value
=
"
Close
"
;
<!-- <script src="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js"-->
}
else
{
<!-- integrity="sha384-JjSmVgyd0p3pXB1rRibZUAYoIIy6OrQ6VrjIEaFf/nJGzIxFDsf4x0xIM+B07jRM"-->
x
.
style
.
display
=
"
none
"
;
<!-- crossorigin="anonymous"></script>-->
n
.
value
=
"
Add Leave Form
"
;
<!-- <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css"-->
}
<!-- integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous">-->
}
<!-- <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.6.9/angular.min.js"></script>-->
</script>
<!-- <script src="timeSheetController.js"></script>-->
<!--</head>-->
<!--<body>-->
<!--</body>-->
<!--</html>-->
<div
class=
"container"
>
<div
class=
"container"
>
<div
class=
"table-wrapper"
>
<div
class=
"table-wrapper"
>
<div
class=
"table-title"
>
<div
class=
"table-title"
>
<div
class=
"row"
>
<div
class=
"row"
>
<div
class=
"col-sm-6"
>
<div
class=
"col-sm-6"
>
<h2><b>
Leave Form
</b></h2>
<h2><b>
Leave Form
</b></h2>
<label>
Search:
<input
type=
"text"
ng-model=
"search"
placeholder=
"Search"
style=
"color: black; margin: 10px"
/>
</label>
</div>
</div>
<div
class=
"col-sm-6"
>
<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()"
/>
<input
id=
"addLeaveForm"
class=
"btn btn-success"
type=
"submit"
name=
"addTS"
value=
"Add Leave Form"
data-toggle=
"modal"
onclick=
"showAddLeaveFormFunction()"
/>
...
@@ -109,7 +105,7 @@
...
@@ -109,7 +105,7 @@
</tr>
</tr>
</thead>
</thead>
<tbody>
<tbody>
<tr
class=
"lff"
ng-repeat=
"lf in leaveForms"
>
<tr
class=
"lff"
ng-repeat=
"lf in leaveForms
| filter: search
"
>
<td>
{{$index + 1}}
</td>
<td>
{{$index + 1}}
</td>
<td>
{{lf.title}}
</td>
<td>
{{lf.title}}
</td>
<td>
{{lf.content}}
</td>
<td>
{{lf.content}}
</td>
...
@@ -121,7 +117,7 @@
...
@@ -121,7 +117,7 @@
<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
ui-sref=
"leaveFormDetail({id: lf.id})"
data-toggle=
"modal"
><i
class=
"fa fa-eye"
data-toggle=
"tooltip"
title=
"View"
></i></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=
"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);"
class=
"delete"
data-toggle=
"modal"
><i
class=
"material-icons"
data-toggle=
"tooltip"
title=
"Delete"
>

</i></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
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
>
<!-- <td><a ui-sref="leaveForm" ng-click="updateStatus(lf)" data-toggle="modal"><i id="approved" class="fa fa-check" data-toggle="tooltip" title="Approved"></i></a></td>--
>
</tr>
</tr>
</tbody>
</tbody>
</table>
</table>
...
...
src/main/resources/public/pages/leaveform/leaveFormController.js
View file @
8aee3779
/*
/*
*/
*/
angular
.
module
(
"
myApp
"
).
controller
(
"
leaveFormController
"
,
function
(
$scope
,
$http
,
$state
)
{
angular
.
module
(
"
myApp
"
).
controller
(
"
leaveFormController
"
,
function
(
$scope
,
$http
,
$route
,
$state
)
{
console
.
log
(
"
Leave Form controller
"
);
console
.
log
(
"
Leave Form controller
"
);
$scope
.
lf
=
{
$scope
.
lf
=
{
...
...
src/main/resources/public/pages/leaveform/leaveFormDetail.html
View file @
8aee3779
...
@@ -13,7 +13,7 @@
...
@@ -13,7 +13,7 @@
<br><br>
<br><br>
<div>
<div>
<tr>
<tr>
<input
type=
"submit"
name=
"submit"
value=
"Duyệt"
ui-sref=
"leaveForm"
ng-click=
"updateStatus(leaveFormDetail.id)"
/
>
<!-- <input type="submit" name="submit" value="Duyệt" ui-sref="leaveForm" ng-click="updateStatus(leaveFormDetail.id)"/>--
>
<input
type=
"submit"
name=
"submit"
value=
"Quay lại"
ui-sref=
"leaveForm"
/>
<input
type=
"submit"
name=
"submit"
value=
"Quay lại"
ui-sref=
"leaveForm"
/>
</tr>
</tr>
</div>
</div>
...
...
src/main/resources/public/pages/timesheet/timeSheetController.js
View file @
8aee3779
...
@@ -23,21 +23,33 @@ angular.module("myApp").controller("timeSheetController", function($scope, $http
...
@@ -23,21 +23,33 @@ angular.module("myApp").controller("timeSheetController", function($scope, $http
};
};
//get all time sheet
//get all time sheet
//function getAllTimesheet(){
$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
)
});
//}
//get all eproject
$http
({
$http
({
method
:
'
GET
'
,
method
:
'
GET
'
,
url
:
"
http://localhost:8080/eproject/timesheet/show
"
url
:
"
http://localhost:8080/eproject/getAll
"
}).
then
(
function
successCallback
(
response
)
{
}).
then
(
function
successCallback
(
response
)
{
console
.
log
(
response
);
console
.
log
(
response
);
$scope
.
myTimeSheets
=
response
.
data
;
$scope
.
eProjectList
=
response
.
data
;
},
function
errorCallback
(
response
)
{
},
function
errorCallback
(
response
)
{
console
.
log
(
response
)
console
.
log
(
response
)
});
});
//delete time sheet
//delete time sheet
$scope
.
delete
=
function
(
ts
)
{
$scope
.
delete
=
function
(
ts
)
{
$http
({
$http
({
method
:
'
DELETE
'
,
method
:
'
DELETE
'
,
url
:
"
http://localhost:8080/eproject/timesheet/delete/
"
+
ts
.
id
url
:
"
http://localhost:8080/eproject/timesheet/delete/
"
+
ts
.
id
}).
then
(
function
successCallback
(
response
)
{
}).
then
(
function
successCallback
(
response
)
{
console
.
log
(
response
);
console
.
log
(
response
);
$state
.
reload
();
$state
.
reload
();
...
@@ -49,11 +61,12 @@ angular.module("myApp").controller("timeSheetController", function($scope, $http
...
@@ -49,11 +61,12 @@ angular.module("myApp").controller("timeSheetController", function($scope, $http
$scope
.
save
=
save
;
$scope
.
save
=
save
;
function
save
(){
function
save
()
{
console
.
log
(
$scope
.
tsdto
);
console
.
log
(
$scope
.
tsdto
);
$http
({
$http
({
method
:
'
POST
'
,
method
:
'
POST
'
,
url
:
"
http://localhost:8080/eproject/timesheet/add
"
,
url
:
"
http://localhost:8080/eproject/timesheet/add
"
,
data
:
$scope
.
tsdto
data
:
$scope
.
tsdto
}).
then
(
function
successCallback
(
response
)
{
}).
then
(
function
successCallback
(
response
)
{
console
.
log
(
response
);
console
.
log
(
response
);
...
@@ -65,6 +78,7 @@ angular.module("myApp").controller("timeSheetController", function($scope, $http
...
@@ -65,6 +78,7 @@ angular.module("myApp").controller("timeSheetController", function($scope, $http
}
}
$scope
.
getTs
=
getTs
;
$scope
.
getTs
=
getTs
;
function
getTs
(
ts
)
{
function
getTs
(
ts
)
{
$scope
.
tsdto
.
id
=
ts
.
id
;
$scope
.
tsdto
.
id
=
ts
.
id
;
$scope
.
tsdto
.
title
=
ts
.
title
;
$scope
.
tsdto
.
title
=
ts
.
title
;
...
@@ -74,11 +88,12 @@ angular.module("myApp").controller("timeSheetController", function($scope, $http
...
@@ -74,11 +88,12 @@ angular.module("myApp").controller("timeSheetController", function($scope, $http
}
}
$scope
.
update
=
update
;
$scope
.
update
=
update
;
function
update
(){
function
update
()
{
$http
({
$http
({
headers
:
"
content-type: application/json
"
,
headers
:
"
content-type: application/json
"
,
method
:
'
POST
'
,
method
:
'
POST
'
,
url
:
"
http://localhost:8080/eproject/timesheet/update
"
,
url
:
"
http://localhost:8080/eproject/timesheet/update
"
,
data
:
$scope
.
tsdto
data
:
$scope
.
tsdto
}).
then
(
function
successCallback
(
response
)
{
}).
then
(
function
successCallback
(
response
)
{
console
.
log
(
response
);
console
.
log
(
response
);
...
@@ -88,56 +103,84 @@ angular.module("myApp").controller("timeSheetController", function($scope, $http
...
@@ -88,56 +103,84 @@ angular.module("myApp").controller("timeSheetController", function($scope, $http
$state
.
reload
();
$state
.
reload
();
});
});
}
}
}).
directive
(
'
pgnTable
'
,
[
'
$compile
'
,
function
(
$compile
)
{
return
{
// $scope.myTimeSheets = [];
restrict
:
'
EA
'
,
// $scope.save = save;
templateUrl
:
'
pages/timesheet/timeSheet.html
'
,
// $scope.currentPage = 1;
replace
:
true
,
// $scope.timesheetPerPage = 3;
scope
:
{
// $scope.maxSize = 5;
pages
:
"
=pgnTable
"
// this.myTimeSheets = $scope.myTimeSheets;
},
// $scope.numOfPage = numOfPage;
controller
:
function
(
$scope
)
{
// $scope.dataHasLoaded = false;
$scope
.
currentPage
=
1
;
// $scope.makeTimesheet = function () {
$scope
.
numLimit
=
5
;
// $scope.myTimeSheets = [];
$scope
.
start
=
0
;
// for (let i = 1; i <=50 ; i++) {
$scope
.
$watch
(
"
pages
"
,
function
(
newVal
){
// $scope.myTimeSheets.push( {text : 'ts'+ i , done:false});
if
(
newVal
){
// }
$scope
.
pages
=
Math
.
ceil
(
$scope
.
pages
.
length
/
$scope
.
numLimit
);
//
}
// };
});
// $scope.makeTimesheet();
$scope
.
hideNext
=
function
(){
// $scope.getAllTimesheet = getAllTimesheet;
if
((
$scope
.
start
+
$scope
.
numLimit
)
<
$scope
.
pages
.
length
){
// //$scope.getTotalTimesheet = getTotalTimesheet;
return
false
;
// getAllTimesheet();
}
// $scope.pageChangedIndex = pageChangedIndex;
else
// function pageChangedIndex() {
return
true
;
// console.log($scope.currentPage);
};
// }
$scope
.
hidePrev
=
function
(){
// function numOfPage() {
if
(
$scope
.
start
===
0
){
// return Math.ceil($scope.myTimeSheets.length/ $scope.timesheetPerPage);
return
true
;
//
}
// }
else
});
return
false
;
// }).directive('pgnTable', ['$compile', function ($compile) {
};
// return {
$scope
.
nextPage
=
function
(){
// restrict: 'EA',
console
.
log
(
"
next pages
"
);
// templateUrl: 'pages/timesheet/timeSheet.html',
$scope
.
currentPage
++
;
// replace: true,
$scope
.
start
=
$scope
.
start
+
$scope
.
numLimit
;
// scope: {
console
.
log
(
$scope
.
start
)
// pages: "=pgnTable"
};
// },
$scope
.
PrevPage
=
function
(){
// controller: function ($scope) {
if
(
$scope
.
currentPage
>
1
){
// $scope.currentPage=1;
$scope
.
currentPage
--
;
// $scope.numLimit=5;
}
// $scope.start = 0;
console
.
log
(
"
next pages
"
);
// $scope.$watch("pages",function(newVal){
$scope
.
start
=
$scope
.
start
-
$scope
.
numLimit
;
// if(newVal){
console
.
log
(
$scope
.
start
)
// $scope.pages=Math.ceil($scope.pages.length/$scope.numLimit);
};
// }
},
// });
compile
:
function
(
elem
)
{
// $scope.hideNext=function(){
return
function
(
ielem
,
$scope
)
{
// if(($scope.start + $scope.numLimit) < $scope.pages.length){
$compile
(
ielem
)(
$scope
);
// return false;
};
// }
}
// else
};
// return true;
}]);
// };
\ No newline at end of file
// $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);
// };
// }
// };
src/main/resources/public/pages/timesheet/timesheet.html
View file @
8aee3779
<!--<!DOCTYPE html>-->
<script>
<!--<html lang="en" ng-app="myApp" ng-controller="timesheetController">-->
function
showAddTimeSheetFunction
()
{
<!--<head>-->
const
x
=
document
.
getElementById
(
"
addDivTS
"
);
<!-- <meta charset="UTF-8">-->
const
n
=
document
.
getElementById
(
"
addTimeSheet
"
);
<!-- <title>Time Sheet</title>-->
if
(
x
.
style
.
display
===
"
none
"
)
{
<!-- <meta name="viewport" content="width=device-width, initial-scale=1">-->
x
.
style
.
display
=
"
block
"
;
<!-- <script src="//unpkg.com/@uirouter/angularjs/release/angular-ui-router.min.js"></script>-->
n
.
value
=
"
Close
"
;
<!-- <script src="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js"-->
}
else
{
<!-- integrity="sha384-JjSmVgyd0p3pXB1rRibZUAYoIIy6OrQ6VrjIEaFf/nJGzIxFDsf4x0xIM+B07jRM"-->
x
.
style
.
display
=
"
none
"
;
<!-- crossorigin="anonymous"></script>-->
n
.
value
=
"
Add TimeSheet
"
;
<!-- <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css"-->
}
<!-- integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous">-->
}
<!-- <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.6.9/angular.min.js"></script>-->
</script>
<!-- <script src="timeSheetController.js"></script>-->
<!--</head>-->
<!--<body>-->
<!--</body>-->
<!--</html>-->
<div
class=
"container"
>
<div
class=
"container"
>
<div
class=
"table-wrapper"
>
<div
class=
"table-wrapper"
>
<div
class=
"table-title"
>
<div
class=
"table-title"
>
...
@@ -25,11 +18,11 @@
...
@@ -25,11 +18,11 @@
<div
class=
"col-sm-6"
>
<div
class=
"col-sm-6"
>
<h2><b>
TimeSheet
</b></h2>
<h2><b>
TimeSheet
</b></h2>
<label>
<label>
<input
type=
"text"
ng-model=
"search"
placeholder=
"Search"
style=
"color: black
"
/>
Search:
<input
type=
"text"
ng-model=
"search"
placeholder=
"Search"
style=
"color: black; margin: 10px
"
/>
</label>
</label>
</div>
</div>
<div
class=
"col-sm-6"
>
<div
class=
"col-sm-6"
>
<input
id=
"addTimeSheet"
class=
"btn btn-success"
data-toggle=
"modal"
type=
"submit"
name=
"addTS"
value=
"Add"
onclick=
"showAddTimeSheetFunction()"
/>
<input
id=
"addTimeSheet"
class=
"btn btn-success"
data-toggle=
"modal"
type=
"submit"
name=
"addTS"
value=
"Add
TimeSheet
"
onclick=
"showAddTimeSheetFunction()"
/>
</div>
</div>
</div>
</div>
</div>
</div>
...
@@ -59,8 +52,13 @@
...
@@ -59,8 +52,13 @@
</tr>
</tr>
<tr>
<tr>
<td><label>
Employee Project Id
</label></td>
<td><label>
Employee Project Id
</label></td>
<!-- <td>-->
<!-- <input type="text" maxlength="10" value="" ng-model="tsdto.eprojectId" style="width: 100%;"/>-->
<!-- </td>-->
<td>
<td>
<input
type=
"text"
maxlength=
"10"
value=
""
ng-model=
"tsdto.eprojectId"
style=
"width: 100%;"
/>
<select
ng-repeat=
"ep in eProjectList"
>
<option
value=
"ahihi"
>
{{ep.project.name}}
</option>
</select>
</td>
</td>
</tr>
</tr>
...
@@ -126,7 +124,7 @@
...
@@ -126,7 +124,7 @@
</tr>
</tr>
</thead>
</thead>
<tbody>
<tbody>
<tr
class=
"tss"
ng-repeat=
"ts in myTimeSheets | limitTo:numLimit:start"
>
<tr
class=
"tss"
ng-repeat=
"ts in myTimeSheets | limitTo:numLimit:start
| filter: search
"
>
<td>
{{$index + 1}}
</td>
<td>
{{$index + 1}}
</td>
<td>
{{ts.title}}
</td>
<td>
{{ts.title}}
</td>
<td>
{{ts.content}}
</td>
<td>
{{ts.content}}
</td>
...
@@ -138,11 +136,10 @@
...
@@ -138,11 +136,10 @@
<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
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
ui-sref=
"timeSheet"
ng-click=
"delete(ts);"
class=
"delete"
data-toggle=
"modal"
><i
class=
"material-icons"
data-toggle=
"tooltip"
title=
"Delete"
>

</i></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>
<!-- <h6><code>rotate</code> defaulted to <code>true</code> and <code>force-ellipses</code> set to <code>true</code>:</h6>-->
<span
style=
"float:left;padding:5px"
><a
ng-hide=
"hidePrev()"
href=
""
ng-click=
"PrevPage()"
>
Prev
</a></span>
<!-- <ul uib-pagination total-items="getAllTimesheet()" ng-model="currentPage" max-size="maxSize" class="pagination-sm" boundary-link-number="true" ng-change ="pageChangedIndex()" items-per-page = "timesheetPerPage" ></ul>-->
<span
style=
"float:right;padding:5px"
><a
ng-hide=
"hideNext()"
href=
""
ng-click=
"nextPage()"
>
Next
</a></span></td>
<!-- </tr>-->
</tr>
</tbody>
</tbody>
</table>
</table>
</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