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
6b82e1aa
Commit
6b82e1aa
authored
Mar 11, 2025
by
DESKTOP-E0VCCBD\zedan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update
parent
f40cbcd3
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
251 additions
and
15 deletions
+251
-15
User.js
API/src/models/User.js
+7
-7
login-page.component.ts
...src/app/authentication/login-page/login-page.component.ts
+4
-4
borrow-product-emp.component.html
...oyee/borrow-product-emp/borrow-product-emp.component.html
+37
-1
borrow-product-emp.component.ts
...ployee/borrow-product-emp/borrow-product-emp.component.ts
+21
-0
emp-information.component.html
...p/employee/emp-information/emp-information.component.html
+51
-1
emp-information.component.ts
...app/employee/emp-information/emp-information.component.ts
+17
-0
history-emp.component.html
...r/src/app/employee/history-emp/history-emp.component.html
+37
-1
history-emp.component.ts
...lar/src/app/employee/history-emp/history-emp.component.ts
+20
-0
return-product-emp.component.html
...oyee/return-product-emp/return-product-emp.component.html
+37
-1
return-product-emp.component.ts
...ployee/return-product-emp/return-product-emp.component.ts
+20
-0
No files found.
API/src/models/User.js
View file @
6b82e1aa
...
...
@@ -68,13 +68,13 @@ User.beforeUpdate(async (user, options) => {
// console.log("Table(s) created successfully!");
// // ตัวอย่างการทดสอบสร้าง User ทันที (ถ้าต้องการ)
//
const newUser = await User.create({
//
first_name: "Jane",
//
last_name: "Doe",
//
email: "jane@example.com",
//
password: "123456", // จะถูก hash จาก hook ใน model
//
role: "employee",
//
});
//
const newUser = await User.create({
//
first_name: "Jane",
//
last_name: "Doe",
//
email: "jane@example.com",
//
password: "123456", // จะถูก hash จาก hook ใน model
//
role: "employee",
//
});
// console.log("New user created:", newUser.user_id);
// } catch (error) {
...
...
Synto-Angular/src/app/authentication/login-page/login-page.component.ts
View file @
6b82e1aa
...
...
@@ -27,14 +27,14 @@ export class LoginPageComponent {
}
ngOnInit
():
void
{
this
.
loginForm
=
this
.
formBuilder
.
group
({
username
:
[
'
spruko@admin
.com'
,
[
Validators
.
required
]],
password
:
[
'
sprukoadmin
'
,
Validators
.
required
],
username
:
[
'
emp@example
.com'
,
[
Validators
.
required
]],
password
:
[
'
1234
'
,
Validators
.
required
],
});
}
// firebase
email
=
'
spruko@admin
.com'
;
password
=
'
sprukoadmin
'
;
email
=
'
emp@example
.com'
;
password
=
'
1234
'
;
errorMessage
=
''
;
// validation _error handle
_error
:
{
name
:
string
;
message
:
string
}
=
{
name
:
''
,
message
:
''
};
// for firbase _error handle
...
...
Synto-Angular/src/app/employee/borrow-product-emp/borrow-product-emp.component.html
View file @
6b82e1aa
<p>
borrow-product-emp works!
</p>
<div
class=
"grid grid-cols-12 gap-6"
>
<div
class=
"col-span-12"
>
<div
class=
"box"
>
<div
class=
"box-header flex justify-between"
>
<h2
class=
"text-lg font-semibold"
>
ข้อมูลการเบิก
</h2>
</div>
<div
class=
"box-body"
>
<table
class=
"ti-custom-table ti-custom-table-head w-full"
>
<thead
class=
"bg-gray-100"
>
<tr>
<th>
Name
</th>
<th>
Order ID
</th>
<th>
Project
</th>
<th>
Status
</th>
<th
class=
"text-end"
>
Action
</th>
</tr>
</thead>
<tbody>
<tr
*
ngFor=
"let item of transactions"
>
<td>
{{ item.name }}
</td>
<td>
{{ item.id }}
</td>
<td>
{{ item.project }}
</td>
<td>
<span
class=
"badge px-3 py-1 rounded-md"
[
ngClass
]="
getStatusClass
(
item
.
status
)"
>
{{ item.status }}
</span>
</td>
<td
class=
"text-end"
>
<a
routerLink=
"/page/ecommerce/borrow"
class=
"text-primary hover:text-primary"
>
Details
</a>
</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</div>
Synto-Angular/src/app/employee/borrow-product-emp/borrow-product-emp.component.ts
View file @
6b82e1aa
...
...
@@ -7,4 +7,25 @@ import { Component } from '@angular/core';
})
export
class
BorrowProductEmpComponent
{
activeTab
:
string
=
'borrow'
;
// กำหนดแท็บเริ่มต้น
itemtype
:
any
=
[];
transactions
=
[
{
id
:
'#52225'
,
name
:
'John Brown'
,
project
:
'Project1'
,
status
:
'Pending'
,
type
:
'borrow'
},
{
id
:
'#52400'
,
name
:
'Jim Green'
,
project
:
'Project2'
,
status
:
'Approved'
,
type
:
'return'
},
{
id
:
'#52100'
,
name
:
'Joe Black'
,
project
:
'Project3'
,
status
:
'Not Approved'
,
type
:
'history'
}
];
setActiveTab
(
tab
:
string
)
{
this
.
activeTab
=
tab
;
}
getStatusClass
(
status
:
string
)
{
return
{
'bg-yellow-100 text-yellow-800'
:
status
===
'Pending'
,
'bg-green-100 text-green-800'
:
status
===
'Approved'
,
'bg-red-100 text-red-800'
:
status
===
'Not Approved'
};
}
}
Synto-Angular/src/app/employee/emp-information/emp-information.component.html
View file @
6b82e1aa
<p>
emp-information works!
</p>
<div
class=
"relative"
>
<!-- Start::main-content -->
<div
class=
"main-content m-12"
>
<!-- Profile Section -->
<div
class=
"grid grid-cols-12 gap-6"
>
<!-- Profile Card -->
<div
class=
"col-span-12 lg:col-span-4"
>
<div
class=
"box p-6 text-center"
>
<img
[
src
]="
member
?.
profile_picture
||
'
assets
/
default-profile
.
png
'"
alt=
"Profile Picture"
class=
"w-32 h-32 mx-auto rounded-full shadow-md"
>
<h3
class=
"text-xl font-semibold mt-4"
>
{{ member?.member_firstname }} {{ member?.member_lastname }}
</h3>
<p
class=
"text-gray-500"
>
{{ member?.member_position }}
</p>
<button
class=
"mt-4 ti-btn ti-btn-primary"
>
Edit Profile
</button>
</div>
</div>
<!-- General Info -->
<div
class=
"col-span-12 lg:col-span-8"
>
<div
class=
"box"
>
<div
class=
"box-header flex justify-between"
>
<h5
class=
"box-title"
>
ข้อมูลพนักงาน
</h5>
</div>
<div
class=
"box-body"
>
<div
class=
"grid grid-cols-1 md:grid-cols-2 gap-4"
>
<div><strong>
วันเกิด:
</strong>
{{ member?.member_date | date:'dd MMMM yyyy' }}
</div>
<div><strong>
เพศ:
</strong>
{{ member?.member_gender }}
</div>
<div><strong>
เบอร์โทร:
</strong>
{{ member?.member_phone }}
</div>
<div><strong>
ตำแหน่ง:
</strong>
{{ member?.member_position }}
</div>
<div
class=
"md:col-span-2"
><strong>
ที่อยู่:
</strong>
{{ member?.member_address }}
</div>
</div>
</div>
</div>
</div>
</div>
<!-- Bio Section -->
<div
class=
"box mt-6"
>
<div
class=
"box-header flex justify-between"
>
<h5
class=
"box-title"
>
เกี่ยวกับพนักงาน
</h5>
</div>
<div
class=
"box-body"
>
<p
class=
"text-gray-700"
>
{{ member?.bio || 'ไม่มีข้อมูล' }}
</p>
</div>
</div>
</div>
<!-- End::main-content -->
</div>
Synto-Angular/src/app/employee/emp-information/emp-information.component.ts
View file @
6b82e1aa
...
...
@@ -7,4 +7,21 @@ import { Component } from '@angular/core';
})
export
class
EmpInformationComponent
{
member
:
any
;
constructor
()
{}
ngOnInit
():
void
{
// ✅ ข้อมูลจำลองของสมาชิก
this
.
member
=
{
member_firstname
:
'John'
,
member_lastname
:
'Doe'
,
member_date
:
new
Date
(
1990
,
4
,
15
),
// 15 พฤษภาคม 1990
member_phone
:
'081-234-5678'
,
member_address
:
'123 หมู่ 4 ถนนหลัก ตำบลกลาง อำเภอเมือง จังหวัดกรุงเทพ 10100'
,
member_gender
:
'Male'
,
member_position
:
'Software Engineer'
};
}
}
Synto-Angular/src/app/employee/history-emp/history-emp.component.html
View file @
6b82e1aa
<p>
history-emp works!
</p>
<div
class=
"grid grid-cols-12 gap-6"
>
<div
class=
"col-span-12"
>
<div
class=
"box"
>
<div
class=
"box-header flex justify-between"
>
<h2
class=
"text-lg font-semibold"
>
ประวัติการทำรายการ
</h2>
</div>
<div
class=
"box-body"
>
<table
class=
"ti-custom-table ti-custom-table-head w-full"
>
<thead
class=
"bg-gray-100"
>
<tr>
<th>
Name
</th>
<th>
Order ID
</th>
<th>
Project
</th>
<th>
Status
</th>
<th
class=
"text-end"
>
Action
</th>
</tr>
</thead>
<tbody>
<tr
*
ngFor=
"let item of transactions"
>
<td>
{{ item.name }}
</td>
<td>
{{ item.id }}
</td>
<td>
{{ item.project }}
</td>
<td>
<span
class=
"badge px-3 py-1 rounded-md"
[
ngClass
]="
getStatusClass
(
item
.
status
)"
>
{{ item.status }}
</span>
</td>
<td
class=
"text-end"
>
<a
routerLink=
"/page/ecommerce/borrow"
class=
"text-primary hover:text-primary"
>
Details
</a>
</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</div>
Synto-Angular/src/app/employee/history-emp/history-emp.component.ts
View file @
6b82e1aa
...
...
@@ -6,5 +6,25 @@ import { Component } from '@angular/core';
styleUrls
:
[
'./history-emp.component.scss'
]
})
export
class
HistoryEmpComponent
{
activeTab
:
string
=
'borrow'
;
// กำหนดแท็บเริ่มต้น
itemtype
:
any
=
[];
transactions
=
[
{
id
:
'#52225'
,
name
:
'John Brown'
,
project
:
'Project1'
,
status
:
'Pending'
,
type
:
'borrow'
},
{
id
:
'#52400'
,
name
:
'Jim Green'
,
project
:
'Project2'
,
status
:
'Approved'
,
type
:
'return'
},
{
id
:
'#52100'
,
name
:
'Joe Black'
,
project
:
'Project3'
,
status
:
'Not Approved'
,
type
:
'history'
}
];
setActiveTab
(
tab
:
string
)
{
this
.
activeTab
=
tab
;
}
getStatusClass
(
status
:
string
)
{
return
{
'bg-yellow-100 text-yellow-800'
:
status
===
'Pending'
,
'bg-green-100 text-green-800'
:
status
===
'Approved'
,
'bg-red-100 text-red-800'
:
status
===
'Not Approved'
};
}
}
Synto-Angular/src/app/employee/return-product-emp/return-product-emp.component.html
View file @
6b82e1aa
<p>
return-product-emp works!
</p>
<div
class=
"grid grid-cols-12 gap-6"
>
<div
class=
"col-span-12"
>
<div
class=
"box"
>
<div
class=
"box-header flex justify-between"
>
<h2
class=
"text-lg font-semibold"
>
ข้อมูลการคืน
</h2>
</div>
<div
class=
"box-body"
>
<table
class=
"ti-custom-table ti-custom-table-head w-full"
>
<thead
class=
"bg-gray-100"
>
<tr>
<th>
Name
</th>
<th>
Order ID
</th>
<th>
Project
</th>
<th>
Status
</th>
<th
class=
"text-end"
>
Action
</th>
</tr>
</thead>
<tbody>
<tr
*
ngFor=
"let item of transactions"
>
<td>
{{ item.name }}
</td>
<td>
{{ item.id }}
</td>
<td>
{{ item.project }}
</td>
<td>
<span
class=
"badge px-3 py-1 rounded-md"
[
ngClass
]="
getStatusClass
(
item
.
status
)"
>
{{ item.status }}
</span>
</td>
<td
class=
"text-end"
>
<a
routerLink=
"/page/ecommerce/borrow"
class=
"text-primary hover:text-primary"
>
Details
</a>
</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</div>
Synto-Angular/src/app/employee/return-product-emp/return-product-emp.component.ts
View file @
6b82e1aa
...
...
@@ -6,5 +6,25 @@ import { Component } from '@angular/core';
styleUrls
:
[
'./return-product-emp.component.scss'
]
})
export
class
ReturnProductEmpComponent
{
activeTab
:
string
=
'borrow'
;
// กำหนดแท็บเริ่มต้น
itemtype
:
any
=
[];
transactions
=
[
{
id
:
'#52225'
,
name
:
'John Brown'
,
project
:
'Project1'
,
status
:
'Pending'
,
type
:
'borrow'
},
{
id
:
'#52400'
,
name
:
'Jim Green'
,
project
:
'Project2'
,
status
:
'Approved'
,
type
:
'return'
},
{
id
:
'#52100'
,
name
:
'Joe Black'
,
project
:
'Project3'
,
status
:
'Not Approved'
,
type
:
'history'
}
];
setActiveTab
(
tab
:
string
)
{
this
.
activeTab
=
tab
;
}
getStatusClass
(
status
:
string
)
{
return
{
'bg-yellow-100 text-yellow-800'
:
status
===
'Pending'
,
'bg-green-100 text-green-800'
:
status
===
'Approved'
,
'bg-red-100 text-red-800'
:
status
===
'Not Approved'
};
}
}
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