Commit 09be0007 authored by Nguyen Loc's avatar Nguyen Loc

Merge branch 'dinhdam' of https://git.myitsol.com/hieunv/qlns_n01

# Conflicts:
#	src/main/java/com/itsol/quantrivanphong/access/homepage/controller/NewsController.java
#	src/main/resources/public/index.html
parents cc97e6e5 325eb2b8
......@@ -16,6 +16,7 @@
<properties>
<java.version>1.8</java.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<dependencies>
......@@ -81,7 +82,8 @@
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
<finalName>Spring4MVCCRUDRestService</finalName>
</build>
</project>
......@@ -2,17 +2,18 @@ package com.itsol.quantrivanphong.access.homepage.controller;
import com.itsol.quantrivanphong.access.homepage.business.CatalogiBusiness;
import com.itsol.quantrivanphong.access.homepage.business.NewsBusiness;
import com.itsol.quantrivanphong.business.EmployeeBusiness;
import com.itsol.quantrivanphong.exception.ResourceNotFoundException;
import com.itsol.quantrivanphong.manager.employee.business.EmployeeBusiness;
import com.itsol.quantrivanphong.model.Employee;
import com.itsol.quantrivanphong.model.News;
import org.springframework.beans.factory.annotation.Autowired;
<<<<<<< HEAD
<<<<<<< HEAD
=======
>>>>>>> 480f4a721c4ab000d936ea6b072027187579b926
=======
>>>>>>> 325eb2b85c51c2d288ca750be64d8d0657ba397a
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;
......
package com.itsol.quantrivanphong.business;
package com.itsol.quantrivanphong.manager.employee.business;
import com.itsol.quantrivanphong.model.Employee;
import org.springframework.validation.Validator;
......
package com.itsol.quantrivanphong.business.impl;
package com.itsol.quantrivanphong.manager.employee.business.impl;
import com.itsol.quantrivanphong.manager.employee.business.EmployeeBusiness;
import com.itsol.quantrivanphong.manager.employee.repository.EmployeeRepository;
import com.itsol.quantrivanphong.model.Employee;
import com.itsol.quantrivanphong.repository.EmployeeRepository;
import com.itsol.quantrivanphong.business.EmployeeBusiness;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.validation.Errors;
......
package com.itsol.quantrivanphong.controller;
package com.itsol.quantrivanphong.manager.employee.controller;
import com.itsol.quantrivanphong.manager.employee.business.EmployeeBusiness;
import com.itsol.quantrivanphong.model.Employee;
import com.itsol.quantrivanphong.business.EmployeeBusiness;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpHeaders;
import org.springframework.http.HttpStatus;
......@@ -12,6 +12,7 @@ import org.springframework.web.util.UriComponentsBuilder;
import java.util.List;
@RestController
public class EmployeeController {
@Autowired
//Retrieve Employee by id
......
package com.itsol.quantrivanphong.repository;
package com.itsol.quantrivanphong.manager.employee.repository;
import com.itsol.quantrivanphong.model.Employee;
import org.springframework.data.jpa.repository.JpaRepository;
......
package com.itsol.quantrivanphong.manager.employee;
public class test {
}
package com.itsol.quantrivanphong.report.leaveform.business;
import com.itsol.quantrivanphong.report.leaveform.dto.LeaveFormDTO;
import com.itsol.quantrivanphong.report.leaveform.repository.LeaveFormRepository;
import com.itsol.quantrivanphong.report.leaveform.repository.LeaveTypeRepository;
import com.itsol.quantrivanphong.manager.employee.repository.EmployeeRepository;
import com.itsol.quantrivanphong.model.Employee;
import com.itsol.quantrivanphong.model.LeaveForm;
import com.itsol.quantrivanphong.model.LeaveType;
import com.itsol.quantrivanphong.repository.EmployeeRepository;
import com.itsol.quantrivanphong.report.leaveform.dto.LeaveFormDTO;
import com.itsol.quantrivanphong.report.leaveform.repository.LeaveFormRepository;
import com.itsol.quantrivanphong.report.leaveform.repository.LeaveTypeRepository;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
......
package com.itsol.quantrivanphong.report.timesheet.business;
import com.itsol.quantrivanphong.report.timesheet.dto.TimeSheetDTO;
import com.itsol.quantrivanphong.report.timesheet.repository.EProjectRepository;
import com.itsol.quantrivanphong.report.timesheet.repository.TimeSheetRepository;
import com.itsol.quantrivanphong.manager.employee.repository.EmployeeRepository;
import com.itsol.quantrivanphong.model.Employee;
import com.itsol.quantrivanphong.model.Eproject;
import com.itsol.quantrivanphong.model.TimeSheet;
import com.itsol.quantrivanphong.repository.EmployeeRepository;
import com.itsol.quantrivanphong.report.timesheet.dto.TimeSheetDTO;
import com.itsol.quantrivanphong.report.timesheet.repository.EProjectRepository;
import com.itsol.quantrivanphong.report.timesheet.repository.TimeSheetRepository;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
......
......@@ -3,20 +3,25 @@
# DATABASE CONNECTION
# ===============================
spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver
spring.datasource.url=jdbc:mysql://localhost:3306/quantrivanphong
spring.datasource.url=jdbc:mysql://localhost:3308/quantrivanphong
spring.datasource.username=root
spring.datasource.password=ahihi123
spring.datasource.password= 123456
# ===============================
# JPA / HIBERNATE
# ===============================
spring.jpa.show-sql=true
spring.jpa.hibernate.ddl-auto=update
spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.MySQL57Dialect
spring.jpa.properties.hibernate.default_schema=quantrivanphong
spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.MySQL5InnoDBDialect
#spring.jpa.properties.hibernate.default_schema=qlns_itsol
## Fix Postgres JPA Error:
## Method org.postgresql.jdbc.PgConnection.createClob() is not yet implemented.
#spring.jpa.properties.hibernate.temp.use_jdbc_metadata_defaults=false
......@@ -35,4 +40,6 @@ spring.mail.properties.mail.smtp.connectiontimeout=5000
spring.mail.properties.mail.smtp.timeout=5000
spring.mail.properties.mail.smtp.writetimeout=5000
## App Properties
app.jwtSecret= JWTSuperSecretKey
app.jwtExpirationInMs = 604800000
html {
font-family: sans-serif;
-webkit-text-size-adjust: 100%;
-ms-text-size-adjust: 100%;
}
body {
margin: 0;
}
article,
aside,
details,
figcaption,
figure,
footer,
header,
hgroup,
main,
menu,
nav,
section,
summary {
display: block;
}
audio,
canvas,
progress,
video {
display: inline-block;
vertical-align: baseline;
}
audio:not([controls]) {
display: none;
height: 0;
}
[hidden],
template {
display: none;
}
a {
background-color: transparent;
}
a:active,
a:hover {
outline: 0;
}
abbr[title] {
border-bottom: 1px dotted;
}
b,
strong {
font-weight: bold;
}
dfn {
font-style: italic;
}
h1 {
margin: .67em 0;
font-size: 2em;
}
mark {
color: #000;
background: #ff0;
}
small {
font-size: 80%;
}
sub,
sup {
position: relative;
font-size: 75%;
line-height: 0;
vertical-align: baseline;
}
sup {
top: -.5em;
}
sub {
bottom: -.25em;
}
img {
border: 0;
}
svg:not(:root) {
overflow: hidden;
}
figure {
margin: 1em 40px;
}
hr {
height: 0;
-webkit-box-sizing: content-box;
-moz-box-sizing: content-box;
box-sizing: content-box;
}
pre {
overflow: auto;
}
code,
kbd,
pre,
samp {
font-family: monospace, monospace;
font-size: 1em;
}
button,
input,
optgroup,
select,
textarea {
margin: 0;
font: inherit;
color: inherit;
}
button {
overflow: visible;
}
button,
select {
text-transform: none;
}
button,
html input[type="button"],
input[type="reset"],
input[type="submit"] {
-webkit-appearance: button;
cursor: pointer;
}
button[disabled],
html input[disabled] {
cursor: default;
}
button::-moz-focus-inner,
input::-moz-focus-inner {
padding: 0;
border: 0;
}
input {
line-height: normal;
}
input[type="checkbox"],
input[type="radio"] {
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
padding: 0;
}
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
height: auto;
}
input[type="search"] {
-webkit-box-sizing: content-box;
-moz-box-sizing: content-box;
box-sizing: content-box;
-webkit-appearance: textfield;
}
input[type="search"]::-webkit-search-cancel-button,
input[type="search"]::-webkit-search-decoration {
-webkit-appearance: none;
}
fieldset {
padding: .35em .625em .75em;
margin: 0 2px;
border: 1px solid #c0c0c0;
}
legend {
padding: 0;
border: 0;
}
textarea {
overflow: auto;
}
optgroup {
font-weight: bold;
}
table {
border-spacing: 0;
border-collapse: collapse;
}
td,
th {
padding: 0;
}
/*! Source: https://github.com/h5bp/html5-boilerplate/blob/master/src/css/main.css */
@media print {
*,
*:before,
*:after {
color: #000 !important;
text-shadow: none !important;
background: transparent !important;
-webkit-box-shadow: none !important;
box-shadow: none !important;
}
a,
a:visited {
text-decoration: underline;
}
a[href]:after {
content: " (" attr(href) ")";
}
abbr[title]:after {
content: " (" attr(title) ")";
}
a[href^="#"]:after,
a[href^="javascript:"]:after {
content: "";
}
pre,
blockquote {
border: 1px solid #999;
page-break-inside: avoid;
}
thead {
display: table-header-group;
}
tr,
img {
page-break-inside: avoid;
}
img {
max-width: 100% !important;
}
p,
h2,
h3 {
orphans: 3;
widows: 3;
}
h2,
h3 {
page-break-after: avoid;
}
select {
background: #fff !important;
}
.navbar {
display: none;
}
.btn > .caret,
.dropup > .btn > .caret {
border-top-color: #000 !important;
}
.label {
border: 1px solid #000;
}
.table {
border-collapse: collapse !important;
}
.table td,
.table th {
background-color: #fff !important;
}
.table-bordered th,
.table-bordered td {
border: 1px solid #ddd !important;
}
}
.blue-button {
background: #25A6E1;
padding: 3px 5px;
color: #fff;
font-family: 'Helvetica Neue', sans-serif;
font-size: 12px;
border-radius: 2px;
-moz-border-radius: 2px;
-webkit-border-radius: 4px;
border: 1px solid #1A87B9
}
.red-button {
background: #CD5C5C;
padding: 3px 5px;
color: #fff;
font-family: 'Helvetica Neue', sans-serif;
font-size: 12px;
border-radius: 2px;
-moz-border-radius: 2px;
-webkit-border-radius: 4px;
border: 1px solid #CD5C5C
}
table {
font-family: "Helvetica Neue", Helvetica, sans-serif;
width: 70%;
}
caption {
text-align: left;
color: silver;
font-weight: bold;
text-transform: uppercase;
padding: 5px;
}
th {
background: SteelBlue;
color: white;
}
tbody tr:nth-child(even) {
background: WhiteSmoke;
}
tbody tr td:nth-child(2) {
text-align: center;
}
tbody tr td:nth-child(3), tbody tr td:nth-child(4) {
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 td, th {
padding: 5px;
}
table>thead>tr>th{
text-align: center;
}
.table>thead>tr>td{
text-align: center;
padding-bottom: 50px;
}
.container{
background-color: #f1f1f1;
}
\ No newline at end of file
<<<<<<< HEAD
<<<<<<< HEAD
<!DOCTYPE html>
<html>
<head>
......@@ -76,42 +77,42 @@
<!DOCTYPE HTML>
<html>
=======
<!doctype html>
<html lang="en">
>>>>>>> 325eb2b85c51c2d288ca750be64d8d0657ba397a
<head>
<title>Business_Blog a Blogging Category Flat Bootstrap Responsive Website Template | World :: w3layouts</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="keywords" content="Business_Blog Responsive web template, Bootstrap Web Templates, Flat Web Templates, Android Compatible web template,
Smartphone Compatible web template, free webdesigns for Nokia, Samsung, LG, SonyErricsson, Motorola web design" />
<script type="applijewelleryion/x-javascript"> addEventListener("load", function() { setTimeout(hideURLbar, 0); }, false); function hideURLbar(){ window.scrollTo(0,1); } </script>
<link href="css/bootstrap.css" rel='stylesheet' type='text/css' />
<!-- Custom Theme files -->
<link href="https://fonts.googleapis.com/css?family=Roboto+Condensed:400,700" rel='stylesheet' type='text/css'>
<link href="https://fonts.googleapis.com/css?family=Open+Sans" type='text/css'>
<link href="css/style.css" rel='stylesheet' type='text/css' />
<!--Khai báo các thư viện-->
<script src="js/jquery-3.2.1.min.js"></script>
<script src="js/bootstrap.min.js"></script>
<script src="js/angular.js"></script>
<script src="js/angular-ui-router.min.js"></script>
<!--End khai báo thư viện-->
<!--Khai báo các file js-->
<script src="js/app.js"></script>
<!--End khai báo các file js-->
<!-- khai báo các controllers -->
<meta charset="UTF-8">
<meta name="viewport"
content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
<!-- <meta http-equiv="X-UA-Compatible" content="ie=edge">-->
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Document</title>
<link href="css/bootstrap.css" rel='stylesheet' type='text/css'/>
<!-- Custom Theme files -->
<!-- <link href="https://fonts.googleapis.com/css?family=Roboto+Condensed:400,700" rel='stylesheet' type='text/css'>-->
<!-- <link href="https://fonts.googleapis.com/css?family=Open+Sans" type='text/css'>-->
<link href="css/style.css" rel='stylesheet' type='text/css'/>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/css/bootstrap.min.css">
<script src="js/jquery-3.2.1.min.js"></script>
<script src="js/bootstrap.min.js"></script>
<script src="js/angular.js"></script>
<script src="js/angular-ui-router.min.js"></script>
<script src="js/app.js"></script>
<script src="pages/employee/employeeController.js"></script>
<script src="pages/project/projectController.js"></script>
<script src="pages/testlayout/testlayoutController.js"></script>
<!--End khai báo controllers-->
</head>
<body ng-app="myApp">
<!--start-main-->
<div class="container">
<div ui-view="layout">
</div>
</div>
>>>>>>> 480f4a721c4ab000d936ea6b072027187579b926
......
/**
*
*/
angular.module("myApp", ["ui.router"]).config(function($stateProvider, $urlRouterProvider,$locationProvider) {
angular.module("myApp", ["ui.router"]).config(function ($stateProvider, $urlRouterProvider, $locationProvider) {
$locationProvider.hashPrefix('');
$urlRouterProvider.otherwise("/index");
$urlRouterProvider.otherwise("/employees");
$stateProvider
//index layout riêng
.state("index", {
url: "/index",
views:{
"index":{
templateUrl: "pages/index/index.htm",
controller: "indexController"
},
"banner":{
templateUrl: "pages/index/banner.htm"
.state("layout1", {
abstract: true,
views: {
"layout": {
templateUrl: "layout/layout1.html"
}
}
})
// State chứa layout chung cho các trang
.state('app', {
.state("layout2", {
abstract: true,
views: {
'main_layout': {
templateUrl: 'main_layout.html',
"layout": {
templateUrl: "layout/layout2.html"
}
}
})
// Các state bên dưới kế thừa state app
// .state('app', {
// abstract: true,
// views: {
// 'main_layout': {
// templateUrl: 'main_layout.html',
// }
// }
// })
.state("tintuc", { // Khai báo một state
parent: 'app',
url: "/tintuc", // URL hiển thị
views:{
"content":{
templateUrl: "pages/tintuc/tintuc.htm",
controller: "tintucController" // khai báo controller
.state("employees", {
parent: 'layout1',
url: "/employees",
views: {
"content": {
templateUrl: "pages/employee/employee.html",
controller: "employeeController"
}
}
})
.state("tuyendung", {
parent: 'app',
url: "/tuyendung",
views:{
"content":{
templateUrl: "pages/tuyendung/tuyendung.htm",
controller: "tuyendungController"
.state("project", {
parent: 'layout1',
url: "/project",
views: {
"content": {
templateUrl: "pages/project/project.html",
controller: "projectController"
}
}
})
.state("report", {
parent: 'layout1',
url: "/report",
views: {
"content": {
templateUrl: "pages/employee/project.html",
controller: "employeeController"
}
}
})
// .state("lienhe", {
// parent: 'app',
// url: "/lienhe",
// views:{
// "content":{
// templateUrl: "pages/lienhe/lienhe.htm",
// controller: "lienheController"
// }
// }
// })
.state("gioithieu", {
parent: 'app',
url: "/gioithieu",
views:{
"content":{
templateUrl: "pages/gioithieu/gioithieu.htm",
controller: "gioithieuController"
.state("testlayout2", {
parent: 'layout2',
url: "/testttt",
views: {
"content": {
templateUrl: "pages/testlayout/testlayout.html",
controller: "testlayoutController"
}
}
})
});
// myApp.directive('ngConfirmClick', [ function() {
// return {
// link : function(scope, element, attr) {
// var msg = attr.ngConfirmClick || "Are you sure?";
// var clickAction = attr.confirmedClick;
// element.bind('click', function(event) {
// if (window.confirm(msg)) {
// scope.$eval(clickAction)
// }
// });
// }
// };
// } ])
\ No newline at end of file
<div>
layout1
<a ui-sref="employees">Employee</a>
<a ui-sref="report">Report</a>
<a ui-sref="project">Project</a>
<div ui-view="content">
</div>
</div>
\ No newline at end of file
<div>
layout2
Không có menu
<div ui-view="content"></div>
</div>
\ No newline at end of file
<!-- technology -->
<div class="technology-1">
<div class="container">
<div class="col-md-9 technology-left">
<div ui-view="content">
<!-- nội dung các trang -->
</div>
</div>
<!-- technology-right -->
<div class="col-md-3 technology-right-1">
<div class="blo-top">
<div class="tech-btm">
<img src="images/banner1.jpg" class="img-responsive" alt=""/>
</div>
</div>
<div class="blo-top">
<div class="tech-btm">
<h4>Sign up to our newsletter</h4>
<p>Pellentesque dui, non felis. Maecenas male</p>
<div class="name">
<form>
<input type="text" placeholder="Email" required="">
</form>
</div>
<div class="button">
<form>
<input type="submit" value="Subscribe">
</form>
</div>
<div class="clearfix"> </div>
</div>
</div>
<div class="blo-top1">
<div class="tech-btm">
<h4>Tin tức nổi bật </h4>
<div class="blog-grids">
<div class="blog-grid-left">
<a href="singlepage.html"><img src="images/6.jpg" class="img-responsive" alt=""/></a>
</div>
<div class="blog-grid-right">
<h5><a href="singlepage.html">Pellentesque dui, non felis. Maecenas male</a> </h5>
</div>
<div class="clearfix"> </div>
</div>
<div class="blog-grids">
<div class="blog-grid-left">
<a href="singlepage.html"><img src="images/7.jpg" class="img-responsive" alt=""/></a>
</div>
<div class="blog-grid-right">
<h5><a href="singlepage.html">Pellentesque dui, non felis. Maecenas male</a> </h5>
</div>
<div class="clearfix"> </div>
</div>
<div class="blog-grids">
<div class="blog-grid-left">
<a href="singlepage.html"><img src="images/11.jpg" class="img-responsive" alt=""/></a>
</div>
<div class="blog-grid-right">
<h5><a href="singlepage.html">Pellentesque dui, non felis. Maecenas male</a> </h5>
</div>
<div class="clearfix"> </div>
</div>
<div class="blog-grids">
<div class="blog-grid-left">
<a href="singlepage.html"><img src="images/9.jpg" class="img-responsive" alt=""/></a>
</div>
<div class="blog-grid-right">
<h5><a href="singlepage.html">Pellentesque dui, non felis. Maecenas male</a> </h5>
</div>
<div class="clearfix"> </div>
</div>
<div class="blog-grids">
<div class="blog-grid-left">
<a href="singlepage.html"><img src="images/10.jpg" class="img-responsive" alt=""/></a>
</div>
<div class="blog-grid-right">
<h5><a href="singlepage.html">Pellentesque dui, non felis. Maecenas male</a> </h5>
</div>
<div class="clearfix"> </div>
</div>
</div>
</div>
</div>
<div class="clearfix"></div>
<!-- technology-right -->
</div>
</div>
<!-- technology -->
\ No newline at end of file
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
</head>
<body>
<div class="container">
<div class="row">
<div class="col-md-8">
<div>
<legend>Employee Details</legend>
<table>
<tr>
<td><label>User Name</label></td>
<td>
......@@ -30,7 +24,7 @@
</td>
</tr>
<tr>
<td><label id="email" for="email">Email</label> </td>
<td><label id="email" for="email">Email</label></td>
<td>
<input type="email" maxlength="150" ng-model="emp.emailAddress"/>
</td>
......@@ -49,23 +43,28 @@
</td>
</tr>
<tr>
<td><label >home town:</label></td>
<td> <input type="text" ng-model="emp.homeTown"/></td>
<td><label>home town:</label></td>
<td><input type="text" ng-model="emp.homeTown"/></td>
</tr>
<tr>
<td></td>
<td>
<td >
<input type="submit" name="submit" value="submit" ng-click="save();"/>
<input type="submit" name="clear" value="clear" ng-click=" emp = null"/>
</td>
</tr>
</table>
</div>
<br><br>
<div>
<table class="table">
<thead>
<tr>
<tr>
<td colspan="12">Thông tin nhân viên</td>
</tr>
<th>ID</th>
<th>User Name</th>
<th>First Name</th>
......@@ -74,6 +73,10 @@
<th>Phone</th>
<th>Education</th>
<th>Home Town</th>
<th>Department</th>
<th>Position</th>
<th colspan="2">Menu</th>
</tr>
</thead>
<tbody>
......@@ -86,11 +89,12 @@
<td>{{emp.phoneNumber}}</td>
<td>{{emp.education}}</td>
<td>{{emp.homeTown}}</td>
<td>{{emp.department}}</td>
<td>{{emp.position}}</td>
<td><a href="#" ng-click="update(emp);">Edit</a>
<td><a href="#" ng-confirm-click=" Do you want to delete this user?" ng-click="delete(emp);">Delete</a>
</td>
<td><a href="#" ng-click="update(emp);">Update</a>
<td><a href="#" confirmed-click="delete(employee);" ng-confirm-click=" Do you want to delete this user?">Delete</a></td>
</tr>
</tbody>
</table>
......@@ -98,5 +102,3 @@
</div>
</div>
</div>
</body>
</html>
\ No newline at end of file
/**
*
*/
angular.module("myApp",[]).controller("tintucController", function($scope, $http,$window) {
console.log("Tin tức controller");
angular.module("myApp").controller("employeeController", function($scope, $http,$window) {
console.log("Employee controller");
$scope.emp= {
"username": "",
......@@ -12,7 +12,10 @@ angular.module("myApp",[]).controller("tintucController", function($scope, $http
"emailAddress": "",
"phoneNumber": "",
"homeTown": "",
"education": ""
"education": "",
"department": "",
"position" : "",
};
......@@ -23,33 +26,63 @@ angular.module("myApp",[]).controller("tintucController", function($scope, $http
console.log($scope.emp);
$http({
method : 'POST',
url : "http://localhost:8081/list_employee/",
url : "http://localhost:8080/list_employee/",
data: $scope.emp
}).then(function successCallback(response) {
console.log(response);
// $window.location.href ='http://localhost:8081/#/tintuc';
}, function errorCallback(response) {
console.log(response)
});
}
$scope.update = update;
function update(employee){
$scope.employee = employee;
list_employee();
function update(emp){
$scope.emp = emp;
$http({
method : 'PUT',
url : "/employee/" + emp.id,
data: $scope.emp
}).then(function successCallback(response) {
console.log(response);
}, function errorCallback(response) {
console.log(response)
});
}
$scope.deleteEmployee = function (employee) {
// HTTP DELETE- delete employee by Id
// Call: http://localhost:8080/employee/{id}
$scope.delete = function (emp) {
$http({
method : 'DELETE',
url : 'http://localhost:8081/deleteEmployee/' + employee.id
}).then(_success, _error);
}
url : '/employee/' + emp.id
}).then(function successCallback(response) {
console.log(response);
$scope.employess=response.data;
}, function errorCallback(response) {
console.log(response)
});
};
// In case of edit
$scope.edit = function(emp){
$scope.emp.username = emp.username;
$scope.emp.password = emp.password;
$scope.emp.firstName = emp.firstName;
$scope.emp.lastName = emp.lastName;
$scope.emp.emailAddress = emp.emailAddress;
$scope.emp.phoneNumber = emp.phoneNumber;
$scope.emp.homeTown = emp.homeTown;
$scope.emp.education = emp.education;
$scope.emp.department = emp.department;
$scope.emp.position = emp.position;
};
$http({
method : 'GET',
url : "http://localhost:8081/list_employee/",
url : "http://localhost:8080/list_employee/"
}).then(function successCallback(response) {
console.log(response)
console.log(response);
$scope.employess=response.data;
}, function errorCallback(response) {
console.log(response)
......
<div class="container">
Project works
</div>
/**
*
*/
angular.module("myApp").controller("projectController", function($scope, $http,$window) {
console.log("projectController ");
});
\ No newline at end of file
<!--<div class="container">-->
<!-- <div class="row">-->
<!-- <div class="col-md-8">-->
<!-- <div>-->
<!-- <legend>Employee Details</legend>-->
<!-- <table>-->
<!-- <tr>-->
<!-- <td><label>User Name</label></td>-->
<!-- <td>-->
<!-- <input type="text" maxlength="29" ng-model="emp.username"/>-->
<!-- </td>-->
<!-- </tr>-->
<!-- <tr>-->
<!-- <td><label>First Name</label></td>-->
<!-- <td>-->
<!-- <input type="text" maxlength="29" ng-model="emp.firstName"/>-->
<!-- </td>-->
<!-- </tr>-->
<!-- <tr>-->
<!-- <td><label>Last Name</label></td>-->
<!-- <td>-->
<!-- <input type="text" maxlength="29" ng-model="emp.lastName"/>-->
<!-- </td>-->
<!-- </tr>-->
<!-- <tr>-->
<!-- <td><label id="email" for="email">Email</label> </td>-->
<!-- <td>-->
<!-- <input type="email" maxlength="150" ng-model="emp.emailAddress"/>-->
<!-- </td>-->
<!-- </tr>-->
<!-- <tr>-->
<!-- <td><label>Phone</label></td>-->
<!-- <td>-->
<!-- <input type="text" maxlength="10" value="" ng-model="emp.phoneNumber"/>-->
<!-- </td>-->
<!-- </tr>-->
<!-- <tr>-->
<!-- <td><label>education:</label></td>-->
<!-- <td>-->
<!-- <input ng-model="emp.education"/>-->
<!-- </td>-->
<!-- </tr>-->
<!-- <tr>-->
<!-- <td><label >home town:</label></td>-->
<!-- <td> <input type="text" ng-model="emp.homeTown"/></td>-->
<!-- </tr>-->
<!-- <tr>-->
<!-- <td></td>-->
<!-- <td>-->
<!-- <input type="submit" name="submit" value="submit" ng-click="save();"/>-->
<!-- <input type="submit" name="clear" value="clear" ng-click=" emp = null"/>-->
<!-- </td>-->
<!-- </tr>-->
<!-- </table>-->
<!-- </div>-->
<!-- <div>-->
<!-- <table class="table">-->
<!-- <thead>-->
<!-- <tr>-->
<!-- <th>ID</th>-->
<!-- <th>User Name</th>-->
<!-- <th>First Name</th>-->
<!-- <th>Last Name</th>-->
<!-- <th>EmailAddress</th>-->
<!-- <th>Phone</th>-->
<!-- <th>Education</th>-->
<!-- <th>Home Town</th>-->
<!-- </tr>-->
<!-- </thead>-->
<!-- <tbody>-->
<!-- <tr class="vide" ng-repeat="emp in employess">-->
<!-- <td>{{$index + 1}}</td>-->
<!-- <td>{{emp.username}}</td>-->
<!-- <td>{{emp.firstName}}</td>-->
<!-- <td>{{emp.lastName}}</td>-->
<!-- <td>{{emp.emailAddress}}</td>-->
<!-- <td>{{emp.phoneNumber}}</td>-->
<!-- <td>{{emp.education}}</td>-->
<!-- <td>{{emp.homeTown}}</td>-->
<!-- <td><a href="#" ng-click="update(emp);">Update</a>-->
<!-- <td><a href="#" confirmed-click="delete(employee);" ng-confirm-click=" Do you want to delete this user?">Delete</a></td>-->
<!-- </tr>-->
<!-- </tbody>-->
<!-- </table>-->
<!-- </div>-->
<!-- </div>-->
<!-- </div>-->
<!--</div>-->
// /**
// *
// */
// angular.module("myApp").controller("employeeController", function($scope, $http,$window) {
// console.log("Employee controller");
//
// $scope.emp= {
// "username": "",
// "password": "",
// "firstName": "",
// "lastName": "",
// "emailAddress": "",
// "phoneNumber": "",
// "homeTown": "",
// "education": ""
// };
//
//
//
// $scope.save = save;
//
// function save(){
// console.log($scope.emp);
// $http({
// method : 'POST',
// url : "http://localhost:8080/list_employee/",
// data: $scope.emp
// }).then(function successCallback(response) {
// console.log(response);
// $window.location.href ='http://localhost:8080/#/tintuc';
// }, function errorCallback(response) {
// console.log(response)
// });
// }
// $scope.update = update;
// function update(employee){
// $scope.employee = employee;
// list_employee();
// }
// $scope.deleteEmployee = function (employee) {
// $http({
// method : 'DELETE',
// url : 'http://localhost:8080/employee/' + employee.id
// }).then(_success, _error);
// }
//
//
// $http({
// method : 'GET',
// url : "http://localhost:8080/list_employee/",
// }).then(function successCallback(response) {
// console.log(response)
// $scope.employess=response.data;
// }, function errorCallback(response) {
// console.log(response)
// });
// });
\ No newline at end of file
<div class="container">
state con của layout2
</div>
/**
*
*/
angular.module("myApp").controller("testlayoutController", function($scope, $http,$window) {
console.log("testlayoutController");
});
\ No newline at end of file
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Nhóm Dự Án</title>
</head>
<body>
</body>
</html>
\ No newline at end of file
<div class="card-header">
<i class="fas fa-table"></i> Thêm mới dự án
</div>
<div class="card-body" ng-app="insertProjectModule">
<form ng-controller="insertProject">
<div class="form-group">
<div class="form-row">
<div class="col-md-6">
<div class="form-label-group">
<input type="text" ng-model="lstProject.name" id="name" class="form-control"
placeholder="Tên Dự Án"
required="required" autofocus="autofocus">
<label for="name">Tên Dự Án</label>
<span>{{lstProject.name}}</span>
</div>
</div>
<div class="col-md-6">
<div class="form-label-group">
<input type="text" ng-model="lstProject.descriptions" id="descriptions"
class="form-control"
placeholder="Mô tả ngắn"
required="required">
<label for="descriptions">Mô tả ngắn</label>
</div>
</div>
</div>
</div>
<div class="form-group">
<div class="form-row">
<div class="col-md-6">
<div class="form-label-group">
<input type="text" ng-model="lstProject.startDate" id="startDate" class="form-control"
placeholder="Ngày Bắt Đầu" required="required">
<label for="startDate">Ngày Bắt Đầu</label>
</div>
</div>
<div class="col-md-6">
<div class="form-label-group">
<input type="text" ng-model="lstProject.endDate" id="endDate" class="form-control"
placeholder="nick skype" required="required">
<label for="endDate">Ngày Kết Thuc</label>
</div>
</div>
</div>
</div>
<div>
<input ng-click="insert_project()" type="submit" value="Lưu">
<input type="reset" value="Reset">
</div>
</form>
</div>
<script src="components/project/projectAddController.js"></script>
\ No newline at end of file
<div class="card mb-3">
<div class="card-header">
<i class="fas fa-table"></i> Danh Sách Dự Án
</div>
<div class="card-body" ng-app="GetAPI">
<div class="table-responsive" ng-controller="showProject">
<a href="#" class="btn btn-primary btn-circle btn-sm" style="margin-bottom: 10px;"> Thêm </a>
<table class="table table-bordered" id="dataTable" width="100%"
cellspacing="0">
<thead>
<tr>
<th>Tên Dự Án</th>
<th>Mô tả ngắn</th>
<th>Ngày bắt đầu</th>
<th>Hạn giao</th>
<th>Trạng Thái</th>
<th>Thao Tác</th>
</tr>
</thead>
<tbody>
<tr ng-repeat="project in listProject">
<td>{{ project.name }}</td>
<td>{{ project.descriptions }}</td>
<td>{{ project.startDate | date:"dd/MM/yyyy" }}</td>
<td>{{ project.endDate | date:"dd/MM/yyyy" }}</td>
<td>{{ project.statusGet }}</td>
<td><a data-ng-href="#" class="btn btn-info btn-circle btn-sm">
Xem </a> <a data-ng-href="#" class="btn btn-warning btn-circle btn-sm">
Sửa </a> <a data-ng-href="#" class="btn btn-danger btn-circle btn-sm">Xóa</a>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<!--angular js-->
<script src="components/project/projectController.js"></script>
\ 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