Commit ff6ce725 authored by Phạm Duy Phi's avatar Phạm Duy Phi

no message

parent 4b917cbf
.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-title .btn i {
table { float: left;
font-family: "Helvetica Neue", Helvetica, sans-serif; font-size: 21px;
width: 70%; margin-right: 5px;
} }
.table-title .btn span {
caption { float: left;
text-align: left; margin-top: 2px;
color: silver; }
table.table tr th, table.table tr td {
border-color: #e9e9e9;
padding: 12px 15px;
vertical-align: middle;
}
table.table tr th:first-child {
width: 60px;
}
table.table tr th:last-child {
width: 100px;
}
table.table-striped tbody tr:nth-of-type(odd) {
background-color: #fcfcfc;
}
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; font-weight: bold;
text-transform: uppercase; color: #566787;
padding: 5px; display: inline-block;
text-decoration: none;
outline: none !important;
} }
table.table td a:hover {
th { color: #2196F3;
background: SteelBlue;
color: white;
} }
table.table td a.edit {
tbody tr:nth-child(even) { color: #FFC107;
background: WhiteSmoke;
} }
table.table td a.delete {
tbody tr td:nth-child(2) { color: #F44336;
text-align: center;
} }
table.table td i {
tbody tr td:nth-child(3), tbody tr td:nth-child(4) { font-size: 19px;
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 .avatar {
table td, th { border-radius: 50%;
padding: 5px; vertical-align: middle;
margin-right: 10px;
} }
table>thead>tr>th{ .pagination {
text-align: center; float: right;
margin: 0 0 5px;
} }
.table>thead>tr>td{ .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
...@@ -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/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>
...@@ -53,10 +59,16 @@ ...@@ -53,10 +59,16 @@
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>
<script>
if (document.getElementById("checkStatus") === true) {
document.getElementById("approved").style.display = "none";
}
</script>
</head> </head>
<body ng-app="myApp"> <body ng-app="myApp">
......
...@@ -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": "",
"createdAt": "", "updatedAt": "",
"status": "" "status": ""
}; };
......
...@@ -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": "",
"createdAt": "" "updatedAt": ""
}; };
$scope.tsdto = { $scope.tsdto = {
......
/*
*/
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
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment