Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
B
BookingMyHrManagement
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Registry
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Chanachai
BookingMyHrManagement
Commits
cac967b5
Commit
cac967b5
authored
Mar 14, 2025
by
Ooh-Ao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
หน้าข้อมูลพนักงาน
parent
3adaa773
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
37 additions
and
41 deletions
+37
-41
admin.module.ts
Synto-Angular/src/app/admin/admin.module.ts
+3
-1
user-management.component.html
.../app/admin/user-management/user-management.component.html
+0
-0
user-management.component.ts
...rc/app/admin/user-management/user-management.component.ts
+28
-40
user.model.ts
Synto-Angular/src/app/models/user.model.ts
+6
-0
No files found.
Synto-Angular/src/app/admin/admin.module.ts
View file @
cac967b5
...
...
@@ -10,11 +10,13 @@ import { HomeAdminComponent } from './home-admin/home-admin.component';
import
{
TransectionProductManagementComponent
}
from
'./transection-product-management/transection-product-management.component'
;
import
{
HistoryProductComponent
}
from
'./history-product/history-product.component'
;
import
{
AdminRoutingModule
}
from
'./admin.routing'
;
import
{
SharedModule
}
from
'../shared/sharedmodule'
;
@
NgModule
({
imports
:
[
CommonModule
,
AdminRoutingModule
AdminRoutingModule
,
SharedModule
],
declarations
:
[
AdminComponent
,
UserManagementComponent
,
ProjectManagementComponent
,
ProductManagementComponent
,
ProjectEmployeeManagementComponent
,
ProjectProductManagementComponent
,
HomeAdminComponent
,
TransectionProductManagementComponent
,
HistoryProductComponent
]
})
...
...
Synto-Angular/src/app/admin/user-management/user-management.component.html
View file @
cac967b5
This diff is collapsed.
Click to expand it.
Synto-Angular/src/app/admin/user-management/user-management.component.ts
View file @
cac967b5
import
{
Component
,
OnInit
}
from
'@angular/core'
;
import
{
environment
}
from
'src/environments/environment'
;
import
{
HttpClient
}
from
'@angular/common/http'
;
import
{
HttpErrorResponse
}
from
'@angular/common/http'
;
import
{
UserService
}
from
'src/app/services/user.service'
;
import
{
UserProfileModel
}
from
'src/app/models/user.model'
;
...
...
@@ -56,45 +53,36 @@ export class UserManagementComponent {
}
}
// memberlist: any[] = [];
detailEmp
(
emp
:
UserProfileModel
)
{
this
.
selectedUser
=
emp
}
// url = '';
// onSelectFile(event: any) {
// if (event.target && event.target.files && event.target.files[0]) {
// const reader = new FileReader();
//
ngOnInit(): void {
// // จำลองข้อมูลตัวอย่าง
//
this.memberlist = [
//
{ id: 1, member_firstname: 'Alice', member_lastname: 'Smith', role: 'Admin' },
//
{ id: 2, member_firstname: 'Bob', member_lastname: 'Johnson', role: 'User' },
//
{ id: 3, member_firstname: 'Charlie', member_lastname: 'Brown', role: 'Manager' }
//
];
//
reader.readAsDataURL(event.target.files[0]); // read file as data URL
//
reader.onload = (event: any) => {
//
// called once readAsDataURL is completed
//
this.url1 = event.target.result;
//
};
//
}
// }
// constructor(private http: HttpClient) {}
// ngOnInit() {
// this.http.get<any[]>(environment.api + '/users')
// .subscribe(
// (data) => {
// this.memberlist = data;
// console.log('Data loaded:', this.memberlist);
// },
// (error) => {
// console.error('Error fetching data', error);
// }
// );
// url1 = '';
// onSelectFile2(event: any) {
// if (event.target && event.target.files && event.target.files[0]) {
// const reader = new FileReader();
// reader.readAsDataURL(event.target.files[0]); // read file as data URL
// reader.onload = (event: any) => {
// // called once readAsDataURL is completed
// this.url = event.target.result;
// };
// }
// deleteMember(userId: number): void {
// if (confirm('Are you sure you want to delete this member?')) {
// this.http.delete(`${environment.api}/users/${userId}`).subscribe(
// (result: any) => {
// const index = this.memberlist.findIndex(user => user.user_id === userId);
// if (index !== -1) {
// this.memberlist.splice(index, 1);
// }
// console.log(result);
// },
// (error: HttpErrorResponse) => {
// alert(error.message);
// }
// );
// }}}
// }
}
Synto-Angular/src/app/models/user.model.ts
View file @
cac967b5
...
...
@@ -5,6 +5,9 @@ export class UserProfileModel extends BaseModel {
user_id
:
string
;
first_name
:
string
;
last_name
:
string
;
picture
:
string
;
phone
:
string
=
"-"
;
position
:
string
=
"-"
;
email
:
string
;
role
:
string
;
constructor
(
...
...
@@ -15,7 +18,10 @@ export class UserProfileModel extends BaseModel {
this
.
user_id
=
data
?.
user_id
!
;
this
.
first_name
=
data
?.
first_name
!
this
.
last_name
=
data
?.
last_name
!
this
.
picture
=
data
?.
picture
!
this
.
phone
=
data
?.
phone
?
data
.
phone
:
this
.
phone
this
.
email
=
data
?.
email
!
this
.
position
=
data
?.
position
?
data
.
position
:
this
.
position
this
.
role
=
data
?.
role
!
}
}
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