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
c1b1b97c
Commit
c1b1b97c
authored
Mar 15, 2025
by
DESKTOP-E0VCCBD\zedan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update
parent
9df7d108
Show whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
796 additions
and
351 deletions
+796
-351
userController.js
API/src/controllers/userController.js
+2
-1
User.js
API/src/models/User.js
+10
-0
product-management.component.html
...dmin/product-management/product-management.component.html
+282
-96
product-management.component.ts
.../admin/product-management/product-management.component.ts
+21
-10
project-management.component.html
...dmin/project-management/project-management.component.html
+241
-164
project-management.component.ts
.../admin/project-management/project-management.component.ts
+12
-3
user-management.component.html
.../app/admin/user-management/user-management.component.html
+223
-77
equipments.model.ts
Synto-Angular/src/app/models/equipments.model.ts
+2
-0
project.model.ts
Synto-Angular/src/app/models/project.model.ts
+3
-0
No files found.
API/src/controllers/userController.js
View file @
c1b1b97c
...
...
@@ -14,7 +14,8 @@ exports.createUser = async (req, res) => {
first_name
:
newUser
.
first_name
,
last_name
:
newUser
.
last_name
,
email
:
newUser
.
email
,
role
:
newUser
.
role
role
:
newUser
.
role
,
phone
:
newUser
.
phone
}
});
}
catch
(
error
)
{
...
...
API/src/models/User.js
View file @
c1b1b97c
...
...
@@ -9,6 +9,12 @@ const User = sequelize.define('User', {
defaultValue
:
DataTypes
.
UUIDV4
,
primaryKey
:
true
,
},
profile_picture
:
{
type
:
DataTypes
.
STRING
(
500
),
allowNull
:
true
,
},
first_name
:
{
type
:
DataTypes
.
STRING
(
100
),
allowNull
:
false
,
...
...
@@ -17,6 +23,10 @@ const User = sequelize.define('User', {
type
:
DataTypes
.
STRING
(
100
),
allowNull
:
false
,
},
phone
:
{
type
:
DataTypes
.
STRING
(
100
),
allowNull
:
false
,
},
email
:
{
type
:
DataTypes
.
STRING
(
255
),
allowNull
:
false
,
...
...
Synto-Angular/src/app/admin/product-management/product-management.component.html
View file @
c1b1b97c
<!-- Start::row-1 -->
<app-page-header
title=
"Product"
title1=
"Product"
activeitem=
"Pages"
></app-page-header>
<!-- Start::row-1 -->
<div
class=
"grid grid-cols-12 gap-x-5"
>
<div
class=
"col-span-12 xxl:col-span-9"
>
<div
class=
"box"
>
<div
class=
"box-header"
>
<div
class=
"grid grid-cols-12 gap-6"
>
<div
class=
"col-span-12 lg:col-span-4"
>
<div
class=
"relative sm:max-w-xs max-w-[210px]"
>
<label
for=
"hs-table-search"
class=
"sr-only"
>
Search
</label>
<div
...
...
@@ -12,123 +22,299 @@
name=
"hs-table-search"
id=
"hs-table-search"
class=
"p-2 ltr:pr-10 rtl:pl-10 ti-form-input"
placeholder=
"Search Task
"
placeholder=
"Search Contact
"
/>
</div>
<div
class=
"box"
>
<div
class=
"box-header lg:flex lg:justify-between space-y-2 lg:space-y-0"
>
<h5
class=
"box-title my-auto"
>
รายชื่ออุปกรณ์
</h5>
<a
routerLink=
"/ecommerce/add-product"
class=
"ti-btn ti-btn-primary m-0 py-2"
><i
class=
"ri ri-add-line"
></i>
เพื่มอุปกรณ์
</a>
</div>
<div
class=
"col-span-12 lg:sm:col-span-8"
>
<div
class=
"flex items-center flex-wrap lg:justify-end team-right rtl:space-x-reverse"
>
<!-- <div class="hs-dropdown ti-dropdown me-2 mt-1">
<button id="hs-dropdown-custom-icon-trigger2" type="button"
class="hs-dropdown-toggle ti-btn ti-btn-primary m-0">
Sort By<i class="ri-arrow-down-s-line align-middle"></i>
</button>
<div class="hs-dropdown-menu ti-dropdown-menu hidden"
aria-labelledby="hs-dropdown-custom-icon-trigger2">
<a class="ti-dropdown-item" href="javascript:void(0)">A To Z</a>
<a class="ti-dropdown-item" href="javascript:void(0)">Z To A</a>
<a class="ti-dropdown-item" href="javascript:void(0)">Favorites</a>
<a class="ti-dropdown-item" href="javascript:void(0)">All</a>
</div>
</div> -->
<a
(
click
)="
newproduct
()"
class=
"team-add-btn m-0 ti-btn ti-btn-secondary mx-1 whitespace-nowrap mt-1"
>
<i
class=
"ti ti-circle-plus leading-none"
>
</i>
Add New Contact
</a>
</div>
</div>
</div>
</div>
<div
class=
"box-body"
>
<div
class=
"table-bordered whitespace-nowrap rounded-sm overflow-auto"
>
<table
class=
"ti-custom-table ti-custom-table-head edit-table"
>
<thead
class=
"bg-gray-100 dark:bg-black/20"
>
<tr
class=
""
>
<th
scope=
"col"
class=
"dark:text-white/70"
>
ลำดับ
<div
class=
"sm:grid sm:space-y-0 space-y-6 xl:!grid-cols-3 md:grid-cols-2 gap-6"
>
<div
class=
"box mb-0"
*
ngFor=
"let product of productList"
>
<div
class=
"box-body space-y-5"
>
<div
class=
"flex"
>
<div
class=
"sm:flex sm:space-x-3 sm:space-y-0 space-y-4 rtl:space-x-reverse"
>
<img
class=
"avatar avatar-lg rounded-sm"
src=
"{{
product.picture ? product.picture : './assets/img/users/1.jpg'
}}"
alt=
"Image Description"
/>
<div
class=
"space-y-1 my-auto truncate"
>
<h5
class=
"font-semibold text-base leading-none"
>
{{ product.equipment_name }}
</h5>
<p
class=
"text-gray-500 dark:text-white/70 font-semibold text-xs truncate max-w-[9rem]"
>
{{ product.description }}
</p>
<p
class=
"dark:text-dark text-xs font-semibold"
>
{{ product.quantity_total }}
</p>
<p
class=
"dark:text-dark text-xs font-semibold"
>
{{ product.location }}
</p>
</div>
</div>
<!-- <div class="ltr:ml-auto rtl:mr-auto">
<a aria-label="anchor" href="javascript:void(0);"><i
class="ri ri-heart-fill text-base text-danger hover:text-danger"></i></a>
</div> -->
</div>
</div>
<div
class=
"box-footer"
>
<div
class=
"grid grid-cols-12"
>
<div
class=
"sm:col-span-6 col-span-4"
(
click
)="
detailproduct
(
product
)"
>
<a
href=
"javascript:void(0);"
class=
"ti-btn ti-btn-soft-light inline-flex !p-1 flex-shrink-0 justify-center items-center gap-2 w-full rounded-sm border font-medium bg-white text-gray-500 shadow-sm align-middle focus:outline-none focus:ring-0 focus:ring-offset-0 focus:ring-offset-white focus:ring-primary transition-all text-xs dark:bg-bgdark dark:border-white/10 dark:text-white/70 dark:focus:ring-offset-white/10"
>
<i
class=
"ri-chat-2-line text-lg leading-none"
></i>
<span
class=
"text-sm leading-none hidden sm:block"
>
ข้อมูล
</span
>
</a>
</div>
<div
class=
"sm:col-span-5 col-span-4"
(
click
)="
detailproduct
(
product
)"
>
<a
href=
"javascript:void(0);"
class=
"ti-btn ti-btn-soft-danger inline-flex !p-1 flex-shrink-0 justify-center items-center gap-2 w-full rounded-sm border font-medium bg-white text-gray-500 shadow-sm align-middle focus:outline-none focus:ring-0 focus:ring-offset-0 focus:ring-offset-white focus:ring-primary transition-all text-xs dark:bg-bgdark dark:border-white/10 dark:text-white/70 dark:focus:ring-offset-white/10"
>
<i
class=
"ti ti-brand-bitbucket text-lg leading-none "
></i>
<span
class=
"text-sm leading-none hidden sm:block"
(
click
)="
deleteProduct
(
product
)"
>
ลบ
</span
>
</a>
</div>
</th>
<th
scope=
"col"
class=
"text-center dark:text-white/70"
>
รหัสอุปกรณ์
</th>
<th
scope=
"col"
class=
"text-center dark:text-white/70"
>
ชื่ออุปกณ์
</th>
<th
scope=
"col"
class=
"text-center dark:text-white/70"
>
จำนวนสต็อก
</th>
<th
scope=
"col"
class=
"text-center dark:text-white/70"
>
ประเภท
</th>
<th
scope=
"col"
class=
"text-center dark:text-white/70"
>
สถานะ
</th>
<th
scope=
"col"
class=
"text-center dark:text-white/70"
>
วันที่
</th>
<th
scope=
"col"
class=
"text-center dark:text-white/70"
>
แก้ไข
</th>
</thead>
<tbody>
<!-- <tr *ngFor="let product of productList"> -->
<tr
*
ngFor=
"let product of productList; let i = index"
>
<td
class=
"text-center"
>
{{ i + 1 }}
</td>
<!-- </tr> -->
<td
class=
"text-center"
>
{{ product.equipment_id }}
</td>
<td
class=
"text-center"
>
{{ product.equipment_name }}
</td>
<td
class=
"text-center"
>
{{ product.quantity_total}}
</td>
<td
class=
"text-center"
>
{{ product.description}}
</td>
<td
class=
"text-center"
>
{{product.location}}
</td>
<td
class=
"text-center"
>
{{product.created_at}}
</td>
<!-- <td>{{ product.product_balance}}</td> -->
<td>
<div
class=
"hs-tooltip ti-main-tooltip"
>
<!-- <div class="sm:col-span-2 col-span-2">
<div class="hs-dropdown ti-dropdown flex justify-end">
<button
type="button"
class="ti-btn ti-btn-primary mb-1 py-1"
(click)="deleteUser(item)"
>
<i></i>ลบ
</button>
</div>
</div> -->
</div>
</div>
</div>
</div>
<nav
class=
"mt-6 flex justify-end items-center space-x-2 rtl:space-x-reverse"
>
<a
class=
"text-gray-500 dark:text-white/70 hover:text-primary e py-1 px-2 leading-none inline-flex items-center gap-2 rounded-sm"
href=
"javascript:void(0);"
class=
"ti-btn ti-btn-soft-secondary hs-tooltip-toggle"
(
click
)="
addToCart
()"
>
<i
class=
"ti ti-shopping-cart"
></i>
<span
class=
"hs-tooltip-content ti-main-tooltip-content py-1 px-2 bg-gray-900 text-xs font-medium text-white shadow-sm dark:bg-slate-700"
role=
"tooltip"
<span
aria-hidden=
"true"
>
Prev
</span>
<span
class=
"sr-only"
>
Previous
</span>
</a>
<a
class=
"bg-primary text-white py-1 px-2 leading-none inline-flex items-center text-sm font-medium rounded-sm"
href=
"javascript:void(0);"
aria-current=
"page"
>
1
</a
>
Add to cart
</span>
<a
class=
"text-gray-500 dark:text-white/70 hover:text-primary e py-1 px-2 leading-none inline-flex items-center text-sm font-medium rounded-sm"
href=
"javascript:void(0);"
>
2
</a
>
<a
class=
"text-gray-500 dark:text-white/70 hover:text-primary e py-1 px-2 leading-none inline-flex items-center text-sm font-medium rounded-sm"
href=
"javascript:void(0);"
>
3
</a
>
<a
class=
"text-gray-500 dark:text-white/70 hover:text-primary e py-1 px-2 leading-none inline-flex items-center gap-2 rounded-sm"
href=
"javascript:void(0);"
>
<span
class=
"sr-only"
>
Next
</span>
<span
aria-hidden=
"true"
>
Next
</span>
</a>
</nav>
</div>
<div
class=
"hs-tooltip ti-main-tooltip "
>
<a
[
routerLink
]="'/
ecommerce
/
edit-product
/'"
class=
"ti-btn ti-btn-soft-secondary hs-tooltip-toggle"
>
<i
class=
"ti ti-pencil"
></i>
</div>
</div>
<div
class=
"col-span-12 xxl:col-span-3"
*
ngIf=
"selectedProduct"
>
<div
class=
"box"
>
<div
class=
"box-body"
>
<div
class=
"relative"
>
<div
class=
"flex relative before:bg-black/50 before:absolute before:w-full before:h-full before:rounded-sm"
>
<img
[
src
]="'./
assets
/
img
/
users
/
1
.
jpg
'"
alt=
""
class=
"h-[150px] w-full rounded-sm"
id=
"profile-img2"
/>
<span
class=
"hs-tooltip-content ti-main-tooltip-content py-1 px-2 bg-gray-900 text-xs font-medium text-white shadow-sm dark:bg-slate-700"
role=
"tooltip"
class=
"absolute top-5 ltr:right-5 rtl:left-5 flex p-2 rounded-sm ring-1 ring-black/10 text-white bg-black/10 leading-none"
>
Edit
<i
class=
"ri ri-pencil-line"
></i>
<input
type=
"file"
class=
"absolute inset-0 w-full h-full opacity-0 cursor-pointer"
id=
"profile-change2"
/>
</span>
</a>
</div>
<div
class=
"hs-tooltip ti-main-tooltip "
>
<a
aria-label=
"anchor"
routerLink=
"/ecommerce/product-details"
class=
"hs-tooltip-toggle w-8 h-8 ti-btn rounded-full p-0 transition-none focus:outline-none ti-btn-soft-warning "
>
<i
class=
"ti ti-eye"
></i>
<div
class=
"absolute top-[5.5rem] inset-x-0 text-center space-y-3"
>
<div
class=
"flex justify-center w-full"
>
<div
class=
"relative"
>
<img
[
src
]="
selectedProduct
.
picture
?
selectedProduct
.
picture
:
'./
assets
/
img
/
users
/
1
.
jpg
'
"
class=
"w-24 h-24 rounded-full ring-4 ring-white/10 mx-auto"
id=
"profile-img"
alt=
"pofile-img"
/>
<span
class=
"hs-tooltip-content ti-main-tooltip-content py-1 px-2 bg-gray-900 text-xs font-medium text-white shadow-sm dark:bg-slate-700"
role=
"tooltip"
class=
"absolute top-0 ltr:right-0 rtl:left-0 block p-1 rounded-full ring-2 ring-white/10 text-white bg-white/10 dark:bg-bgdark leading-none"
>
view
<i
class=
"ri ri-pencil-line"
></i>
<input
type=
"file"
class=
"absolute inset-0 w-full h-full opacity-0 cursor-pointer"
id=
"profile-change"
/>
</span>
</a>
</div>
<div
class=
"hs-tooltip ti-main-tooltip"
>
<!-- <a
href="javascript:void(0);"
class="cart-btn hs-tooltip-toggle w-10 h-10 ti-btn rounded-full p-0 transition-none focus:outline-none ti-btn-soft-danger"
(click)="deleteProduct(product.product_id)"
</div>
</div>
</div>
<div
class=
"mt-14 space-y-5"
>
<div
class=
"mt-5"
>
<div
class=
"space-y-4 text-start"
>
<div
class=
"grid sm:grid-cols-12 gap-x-6"
>
<label
class=
"col-span-3 my-auto ti-form-label whitespace-nowrap"
>
ชื่อ:
</label
>
<i class="ti ti-trash"></i>
<span
class="hs-tooltip-content ti-main-tooltip-content py-1 px-2 bg-gray-900 text-xs font-medium text-white shadow-sm dark:bg-slate-700"
role="tooltip"
<input
type=
"text"
class=
"col-span-9 ti-form-input"
placeholder=
"กรุณากรอกชื่ออุปกรณ์"
[(
ngModel
)]="
selectedProduct
.
equipment_name
"
/>
</div>
<div
class=
"grid sm:grid-cols-12 gap-x-6"
>
<label
class=
"col-span-3 my-auto ti-form-label whitespace-nowrap"
>
รายละเอียด:
</label
>
Delete
</span>
</a> -->
<input
type=
"text"
class=
"col-span-9 ti-form-input"
placeholder=
"กรุณากรอกรายละเอียด"
[(
ngModel
)]="
selectedProduct
.
description
"
/>
</div>
<div
class=
"grid sm:grid-cols-12 gap-x-6"
>
<label
class=
"col-span-3 my-auto ti-form-label whitespace-nowrap"
>
จำนวน:
</label
>
<input
type=
"number"
class=
"col-span-9 ti-form-input"
placeholder=
"กรุณากรอกจำนวน"
[(
ngModel
)]="
selectedProduct
.
quantity_total
"
/>
</div>
<div
class=
"grid sm:grid-cols-12 gap-x-6"
>
<label
class=
"col-span-3 my-auto ti-form-label whitespace-nowrap"
>
สถานที่:
</label
>
<input
type=
"text"
class=
"col-span-9 ti-form-input"
placeholder=
"กรุณากรอกสถานที่"
[(
ngModel
)]="
selectedProduct
.
location
"
/>
</div>
</div>
</div>
</div>
</div>
<div
class=
"box-footer"
>
<button
type=
"button"
class=
"w-full ti-btn ti-btn-success"
(
click
)="
saveProduct
()"
>
<i
class=
"ti ti-report"
></i>
บันทึก
</button
><button
type=
"button"
(
click
)="
selectedProduct =
undefined"
class=
"w-full ti-btn font-medium border-gray-200 bg-white text-gray-700 shadow-sm align-middle hover:bg-gray-50 focus:ring-offset-white focus:ring-primary dark:bg-bgdark dark:hover:bg-black/20 dark:border-white/10 dark:text-white/70 dark:hover:text-white dark:focus:ring-offset-white/10"
>
<i
class=
"ti ti-ban"
></i>
ปิด
</button>
<div
class=
"sm:col-span-2 col-span-2"
>
<div
class=
"hs-dropdown ti-dropdown flex justify-end"
>
<button
type=
"button"
class=
"w-full ti-btn w-full ti-btn ti-btn-danger"
(
click
)="
deleteProduct
(
selectedProduct
)"
>
<i
class=
"ti c-1-color"
></i>
ลบ
</button>
</div>
</div>
</div>
</td>
</tbody>
</table>
</div>
<div>
<nav
class=
"flex justify-end items-center space-x-2 rtl:space-x-reverse mt-5"
>
<a
class=
"w-10 h-10 bg-transparent text-gray-500 hover:bg-primary hover:text-white p-2 inline-flex justify-center text-sm font-medium items-center gap-2 rounded-full"
href=
"javascript:void(0);"
>
<span
aria-hidden=
"true"
>
«
</span>
<span
class=
"sr-only"
>
Previous
</span>
</a>
<a
class=
"w-10 h-10 bg-primary text-white p-2 inline-flex items-center justify-center text-sm font-medium rounded-full"
href=
"javascript:void(0);"
aria-current=
"page"
>
1
</a>
<a
class=
"w-10 h-10 bg-transparent text-gray-500 hover:bg-primary hover:text-white p-2 inline-flex justify-center items-center text-sm font-medium rounded-full"
href=
"javascript:void(0);"
>
2
</a>
<a
class=
"w-10 h-10 bg-transparent text-gray-500 hover:bg-primary hover:text-white p-2 inline-flex justify-center items-center text-sm font-medium rounded-full"
href=
"javascript:void(0);"
>
3
</a>
<a
class=
"w-10 h-10 bg-transparent text-gray-500 hover:bg-primary hover:text-white p-2 inline-flex justify-center text-sm font-medium items-center gap-2 rounded-full"
href=
"javascript:void(0);"
>
<span
class=
"sr-only"
>
Next
</span>
<span
aria-hidden=
"true"
>
»
</span>
</a>
</nav>
</div>
<!-- </div> -->
<!-- End::row-1 -->
</div>
Synto-Angular/src/app/admin/product-management/product-management.component.ts
View file @
c1b1b97c
...
...
@@ -15,22 +15,22 @@ export class ProductManagementComponent {
constructor
(
private
EquipmentService
:
EquipmentService
)
{
}
ngOnInit
()
{
this
.
getUser
()
this
.
getProduct
()
}
getUser
()
{
getProduct
()
{
this
.
EquipmentService
.
getLists
().
subscribe
(
result
=>
{
this
.
productList
=
result
})
}
getUser
Id
()
{
getProduct
Id
()
{
this
.
EquipmentService
.
getById
(
"73079f3b-b58a-46e6-a779-20a64911e505"
).
subscribe
(
result
=>
{
console
.
log
(
result
)
})
}
saveUser
()
{
saveProduct
()
{
if
(
this
.
selectedProduct
)
{
this
.
EquipmentService
.
save
(
this
.
selectedProduct
).
subscribe
(
result
=>
{
console
.
log
(
result
)
...
...
@@ -38,24 +38,35 @@ export class ProductManagementComponent {
}
}
deleteUser
()
{
updateProduct
()
{
if
(
this
.
selectedProduct
)
{
this
.
EquipmentService
.
dele
te
(
this
.
selectedProduct
).
subscribe
(
result
=>
{
this
.
EquipmentService
.
upda
te
(
this
.
selectedProduct
).
subscribe
(
result
=>
{
console
.
log
(
result
)
})
}
}
updateUser
()
{
addToCart
()
{
}
deleteProduct
(
product
:
EquipmentModel
)
{
this
.
selectedProduct
=
new
EquipmentModel
(
product
)
if
(
this
.
selectedProduct
)
{
this
.
EquipmentService
.
upda
te
(
this
.
selectedProduct
).
subscribe
(
result
=>
{
this
.
EquipmentService
.
dele
te
(
this
.
selectedProduct
).
subscribe
(
result
=>
{
console
.
log
(
result
)
})
}
}
newproduct
()
{
this
.
selectedProduct
=
new
EquipmentModel
()
}
addToCart
(){
detailproduct
(
pj
:
EquipmentModel
)
{
this
.
selectedProduct
=
new
EquipmentModel
(
pj
)
}
}
}
Synto-Angular/src/app/admin/project-management/project-management.component.html
View file @
c1b1b97c
<!-- Page Header -->
<div
class=
"block justify-between page-header sm:flex"
>
<div>
<h3
class=
"text-gray-700 hover:text-gray-900 dark:text-white dark:hover:text-white text-2xl font-medium"
>
ProjectList
</h3>
</div>
<ol
class=
"flex items-center whitespace-nowrap min-w-0"
>
<li
class=
"text-sm"
>
<a
class=
"flex items-center font-semibold text-primary hover:text-primary dark:text-primary truncate"
href=
"javascript:void(0);"
>
Pages
<i
class=
"ti ti-chevrons-right flex-shrink-0 mx-3 overflow-visible text-gray-300 dark:text-gray-300 rtl:rotate-180"
></i>
</a>
</li>
<li
class=
"text-sm text-gray-500 hover:text-primary dark:text-white/70"
aria-current=
"page"
>
Project
</li>
</ol>
</div>
<!-- Page Header Close -->
<app-page-header
title=
"Project"
title1=
"Project"
activeitem=
"Pages"
></app-page-header>
<!-- Start::row-1 -->
<div
class=
"grid grid-cols-12 gap-
6
"
>
<div
class=
"col-span-12"
>
<div
class=
"grid grid-cols-12 gap-
x-5
"
>
<div
class=
"col-span-12
xxl:col-span-7
"
>
<div
class=
"box"
>
<div
class=
"box-
body
"
>
<div
class=
"
lg:grid grid-cols-12 gap-6 space-y-6 lg:space-y-0
"
>
<div
class=
"box-
header
"
>
<div
class=
"
grid grid-cols-12 gap-6
"
>
<div
class=
"col-span-12 lg:col-span-4"
>
<div
class=
"relative
max-w-xs
"
>
<div
class=
"relative
sm:max-w-xs max-w-[210px]
"
>
<label
for=
"hs-table-search"
class=
"sr-only"
>
Search
</label>
<div
class=
"absolute inset-y-0 ltr:right-0 rtl:left-0 flex items-center pointer-events-none ltr:pr-4 rtl:pl-4"
...
...
@@ -48,196 +22,299 @@
name=
"hs-table-search"
id=
"hs-table-search"
class=
"p-2 ltr:pr-10 rtl:pl-10 ti-form-input"
placeholder=
"
Enter Your Tex
t"
placeholder=
"
Search Contac
t"
/>
</div>
</div>
<div
class=
"col-span-12 lg:col-span-4"
>
<div
class=
"text-center max-w-xs lg:mx-auto"
>
<nav
class=
"flex justify-center space-x-3 rtl:space-x-reverse"
aria-label=
"Tabs"
role=
"tablist"
></nav>
</div>
</div>
<div
class=
"col-span-12 lg:col-span-4"
>
<div
class=
"col-span-12 lg:sm:col-span-8"
>
<div
class=
"flex
space-x-3 rtl:space-x-reverse lg:justify-end team-right
"
class=
"flex
items-center flex-wrap lg:justify-end team-right rtl:space-x-reverse
"
>
<div
class=
"hs-tooltip ti-main-tooltip"
>
<!-- <div class="hs-dropdown ti-dropdown me-2 mt-1">
<button id="hs-dropdown-custom-icon-trigger2" type="button"
class="hs-dropdown-toggle ti-btn ti-btn-primary m-0">
Sort By<i class="ri-arrow-down-s-line align-middle"></i>
</button>
<div class="hs-dropdown-menu ti-dropdown-menu hidden"
aria-labelledby="hs-dropdown-custom-icon-trigger2">
<a class="ti-dropdown-item" href="javascript:void(0)">A To Z</a>
<a class="ti-dropdown-item" href="javascript:void(0)">Z To A</a>
<a class="ti-dropdown-item" href="javascript:void(0)">Favorites</a>
<a class="ti-dropdown-item" href="javascript:void(0)">All</a>
</div>
</div> -->
<a
href=
"javascript:void(0);"
class=
"team-add-btn m-0 hs-tooltip-toggle ti-btn ti-btn-primary"
routerLink=
"../addproject"
(
click
)="
newPj
()"
class=
"team-add-btn m-0 ti-btn ti-btn-secondary mx-1 whitespace-nowrap mt-1"
>
Add Project
<i
class=
"ti ti-circle-plus text-xl leading-none"
></i>
<span
class=
"hs-tooltip-content ti-main-tooltip-content py-1 px-2 bg-gray-900 text-xs font-medium text-white shadow-sm dark:bg-slate-700"
role=
"tooltip"
>
Add member
</span>
<i
class=
"ti ti-circle-plus leading-none"
>
</i>
Add New Contact
</a>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<!-- End::row-1 -->
<!-- Start::row-2 -->
<div
class=
"grid grid-cols-12 gap-6"
>
<div
class=
"col-span-12"
>
<div
class=
"ti-tab-content"
>
<div
id=
"tab-style-1"
role=
"tabpanel"
aria-labelledby=
"tab-1"
>
<section
class=
"mb-6"
>
<div
class=
"flex flex-wrap"
>
<div
class=
"w-full px-4"
>
<div
class=
"mx-auto max-w-lg text-center"
></div>
</div>
</div>
</section>
<div
class=
"grid grid-cols-12 gap-6"
>
<div
class=
"box-body"
>
<div
class=
"col-span-12 md:col-span-6 xxl:col-span-3 team-box"
*
ngFor=
"let pj of projectList"
class=
"sm:grid sm:space-y-0 space-y-6 xl:!grid-cols-2 md:grid-cols-2 gap-6"
>
<div
class=
"box overflow-hidden mb-0"
>
<div
class=
"box mb-0"
*
ngFor=
"let project of projectList"
>
<div
class=
"box-body space-y-5"
>
<div
class=
"flex"
>
<div
class=
"block relative -mb-32 before:bg-primary/70 before:absolute before:w-full before:h-full
"
class=
"sm:flex sm:space-x-3 sm:space-y-0 space-y-4 rtl:space-x-reverse
"
>
<img
src=
"./assets/img/png-images/2.png"
alt=
""
class=
"w-full h-32"
class=
"avatar avatar-lg rounded-sm"
src=
"{{
project.picture ? project.picture : './assets/img/users/1.jpg'
}}"
alt=
"Image Description"
/>
</div
>
<div
class=
"box-body
"
>
<div
class=
"justify-center text-center relative"
>
<a
class=
"relative inline-block mt-8"
routerLink=
"/profile/home
"
<div
class=
"space-y-1 my-auto truncate"
>
<h5
class=
"font-semibold text-base leading-none
"
>
{{ project.project_name }}
</h5>
<p
class=
"text-gray-500 dark:text-white/70 font-semibold text-xs truncate max-w-[9rem]
"
>
<img
src=
"./assets/img/users/5.jpg"
class=
"w-24 h-24 rounded-full ring-4 ring-gray-100 mx-auto dark:ring-white/10"
alt=
"user-img"
/>
<span
class=
"absolute bottom-0 ltr:right-0 rtl:left-0 block p-1 rounded-full ring-2 ring-white dark:ring-white/10 text-gray-500 dark:text-white/70 bg-gray-100 dark:bg-bgdark leading-none"
><i
class=
"ri ri-pencil-line"
></i
></span>
</a>
<div
class=
"space-y-2"
>
<div
class=
"mt-4"
>
<h2
class=
"text-base font-semibold"
>
{{ pj.project_name }}
</h2>
<p
class=
"text-xs text-base text-gray-500 dark:text-white/70"
>
เริ่ม {{ pj.start_date }} สินสุด {{ pj.end_date }}
{{ project.project_desc }}
</p>
</div>
<span
class=
"max-w-[10rem] truncate whitespace-nowrap inline-block py-1.5 px-3 rounded-sm text-xs font-medium bg-primary/20 text-primary"
>
{{pj.project_desc}}
</span
<p
class=
"dark:text-dark text-xs font-semibold"
>
<div
class=
"flex space-x-1 rtl:space-x-reverse justify-center text-center"
></div>
เริ่มโครงการ:{{ project.start_date }}
</p>
<p
class=
"dark:text-dark text-xs font-semibold"
>
สิ้นสุดโครงการ:{{ project.end_date }}
</p>
</div>
<a
aria-label=
"anchor"
href=
"javascript:void(0);"
class=
"z-40 absolute top-0 ltr:left-0 rtl:right-0 block text-yellow-500 text-base hover:text-yellow-500"
></a>
</div>
<!-- <div class="ltr:ml-auto rtl:mr-auto">
<a aria-label="anchor" href="javascript:void(0);"><i
class="ri ri-heart-fill text-base text-danger hover:text-danger"></i></a>
</div> -->
</div>
</div>
<div
class=
"box-footer"
>
<div
class=
"grid grid-cols-12"
>
<div
class=
"hs-dropdown ti-dropdown z-40 absolute top-0 ltr:right-0 rtl:left-0 block text-gray-100 dark:text-white/70 text-base"
>
<button
aria-label=
"button"
type=
"button"
class=
"hs-dropdown-toggle p-0 !bg-transparent border-0 shadow-none focus:ring-0 focus:ring-offset-0 ti-dropdown-toggle"
>
<i
class=
"ri-more-2-line leading-none text-base text-gray-100"
></i>
</button>
<div
class=
"hs-dropdown-menu ti-dropdown-menu"
>
<a
class=
"ti-dropdown-item"
routerLink=
"/profile/editprofile"
><i
class=
"ri ri-edit-2-line text-lg"
></i>
Edit
</a
class=
"sm:col-span-6 col-span-4"
(
click
)="
detailPj
(
project
)"
>
<a
class=
"team-remove ti-dropdown-item"
href=
"javascript:void(0);"
(
click
)="
deleteProject
()"
><i
class=
"ri ri-delete-bin-6-line text-lg"
></i
>
Delete
</a
class=
"ti-btn ti-btn-soft-light inline-flex !p-1 flex-shrink-0 justify-center items-center gap-2 w-full rounded-sm border font-medium bg-white text-gray-500 shadow-sm align-middle focus:outline-none focus:ring-0 focus:ring-offset-0 focus:ring-offset-white focus:ring-primary transition-all text-xs dark:bg-bgdark dark:border-white/10 dark:text-white/70 dark:focus:ring-offset-white/10"
>
<i
class=
"ri-chat-2-line text-lg leading-none"
></i>
<span
class=
"text-sm leading-none hidden sm:block"
>
ข้อมูล
</span
>
</a>
</div>
</div>
</div>
</div>
<div
class=
"box-footer bg-gray-100 dark:bg-bgdark p-0 text-center"
class=
"sm:col-span-5 col-span-4"
(
click
)="
detailPj
(
project
)"
>
<
div
class=
"grid grid-cols-12 gap-6"
>
<div
class=
"col-span-12 ltr:border-r rtl:border-l p-3 border-gray-200 dark:border
-white/10"
<
a
href=
"javascript:void(0);"
class=
"ti-btn ti-btn-soft-danger inline-flex !p-1 flex-shrink-0 justify-center items-center gap-2 w-full rounded-sm border font-medium bg-white text-gray-500 shadow-sm align-middle focus:outline-none focus:ring-0 focus:ring-offset-0 focus:ring-offset-white focus:ring-primary transition-all text-xs dark:bg-bgdark dark:border-white/10 dark:text-white/70 dark:focus:ring-offset
-white/10"
>
<!-- <a
[routerLink]="['/profile/home', user.member_id]"
class="space-x-3"
><i class="ri-user-line"></i><span>Profile</span></a
> -->
</div>
</div>
<i
class=
"ti ti-brand-bitbucket text-lg leading-none "
></i>
<span
class=
"text-sm leading-none hidden sm:block"
(
click
)="
deleteProject
(
project
)"
>
ลบ
</span
>
</a>
</div>
<!-- <div class="sm:col-span-2 col-span-2">
<div class="hs-dropdown ti-dropdown flex justify-end">
<button
type="button"
class="ti-btn ti-btn-primary mb-1 py-1"
(click)="deleteUser(item)"
>
<i></i>ลบ
</button>
</div>
</div> -->
</div>
</div>
</div>
</div>
<nav
class=
"flex justify-end items-center space-x-2 rtl:space-x-reverse my-4
"
class=
"mt-6 flex justify-end items-center space-x-2 rtl:space-x-reverse
"
>
<a
class=
"w-10 h-10 text-gray-500 dark:text-white/70 bg-gray-200 dark:bg-bgdark hover:text-primary p-4 inline-flex items-center gap-2 rounded-full
"
class=
"text-gray-500 dark:text-white/70 hover:text-primary e py-1 px-2 leading-none inline-flex items-center gap-2 rounded-sm
"
href=
"javascript:void(0);"
>
<span
aria-hidden=
"true"
>
«
</span>
<span
aria-hidden=
"true"
>
Prev
</span>
<span
class=
"sr-only"
>
Previous
</span>
</a>
<a
class=
"w-10 h-10 bg-primary text-white p-4 inline-flex items-center text-sm font-medium rounded-full
"
class=
"bg-primary text-white py-1 px-2 leading-none inline-flex items-center text-sm font-medium rounded-sm
"
href=
"javascript:void(0);"
aria-current=
"page"
>
1
</a
>
<a
class=
"w-10 h-10 bg-gray-200 dark:bg-bgdark text-gray-500 dark:text-white/70 hover:text-primary p-4 inline-flex items-center text-sm font-medium rounded-full
"
class=
"text-gray-500 dark:text-white/70 hover:text-primary e py-1 px-2 leading-none inline-flex items-center text-sm font-medium rounded-sm
"
href=
"javascript:void(0);"
>
2
</a
>
<a
class=
"w-10 h-10 bg-gray-200 dark:bg-bgdark text-gray-500 dark:text-white/70 hover:text-primary p-4 inline-flex items-center text-sm font-medium rounded-full
"
class=
"text-gray-500 dark:text-white/70 hover:text-primary e py-1 px-2 leading-none inline-flex items-center text-sm font-medium rounded-sm
"
href=
"javascript:void(0);"
>
3
</a
>
<a
class=
"w-10 h-10 text-gray-500 dark:text-white/70 bg-gray-200 dark:bg-bgdark hover:text-primary p-4 inline-flex items-center gap-2 rounded-full
"
class=
"text-gray-500 dark:text-white/70 hover:text-primary e py-1 px-2 leading-none inline-flex items-center gap-2 rounded-sm
"
href=
"javascript:void(0);"
>
<span
class=
"sr-only"
>
Next
</span>
<span
aria-hidden=
"true"
>
»
</span>
<span
aria-hidden=
"true"
>
Next
</span>
</a>
</nav>
</div>
</div>
</div>
<div
class=
"col-span-12 xxl:col-span-5"
*
ngIf=
"selectedProject"
>
<div
class=
"box"
>
<div
class=
"box-body"
>
<div
class=
"relative"
>
<div
class=
"flex relative before:bg-black/50 before:absolute before:w-full before:h-full before:rounded-sm"
>
<img
[
src
]="'./
assets
/
img
/
users
/
1
.
jpg
'"
alt=
""
class=
"h-[150px] w-full rounded-sm"
id=
"profile-img2"
/>
<span
class=
"absolute top-5 ltr:right-5 rtl:left-5 flex p-2 rounded-sm ring-1 ring-black/10 text-white bg-black/10 leading-none"
>
<i
class=
"ri ri-pencil-line"
></i>
<input
type=
"file"
class=
"absolute inset-0 w-full h-full opacity-0 cursor-pointer"
id=
"profile-change2"
/>
</span>
</div>
<div
class=
"absolute top-[5.5rem] inset-x-0 text-center space-y-3"
>
<div
class=
"flex justify-center w-full"
>
<div
class=
"relative"
>
<img
[
src
]="
selectedProject
.
picture
?
selectedProject
.
picture
:
'./
assets
/
img
/
users
/
1
.
jpg
'
"
class=
"w-24 h-24 rounded-full ring-4 ring-white/10 mx-auto"
id=
"profile-img"
alt=
"pofile-img"
/>
<span
class=
"absolute top-0 ltr:right-0 rtl:left-0 block p-1 rounded-full ring-2 ring-white/10 text-white bg-white/10 dark:bg-bgdark leading-none"
>
<i
class=
"ri ri-pencil-line"
></i>
<input
type=
"file"
class=
"absolute inset-0 w-full h-full opacity-0 cursor-pointer"
id=
"profile-change"
/>
</span>
</div>
</div>
</div>
</div>
<div
class=
"mt-14 space-y-5"
>
<div
class=
"mt-5"
>
<div
class=
"space-y-4 text-start"
>
<div
class=
"grid sm:grid-cols-12 gap-x-6"
>
<label
class=
"col-span-3 my-auto ti-form-label whitespace-nowrap"
>
ชื่อโครงการ:
</label
>
<input
type=
"text"
class=
"col-span-9 ti-form-input"
placeholder=
"กรุณากรอกชื่อ"
[(
ngModel
)]="
selectedProject
.
project_name
"
/>
</div>
<div
class=
"grid sm:grid-cols-12 gap-x-6"
>
<label
class=
"col-span-3 my-auto ti-form-label whitespace-nowrap"
>
รายละเอียดโครงการ:
</label
>
<input
type=
"text"
class=
"col-span-9 ti-form-input"
placeholder=
"กรุณากรอกรายละเอียด"
[(
ngModel
)]="
selectedProject
.
project_desc
"
/>
</div>
<div
class=
"grid sm:grid-cols-12 gap-x-6"
>
<label
class=
"col-span-3 my-auto ti-form-label whitespace-nowrap"
>
วันที่เริ่มโครงการ:
</label
>
<input
type=
"date"
class=
"col-span-9 ti-form-input"
placeholder=
"เริ่ม"
[(
ngModel
)]="
selectedProject
.
start_date
"
/>
</div>
<div
class=
"grid sm:grid-cols-12 gap-x-6"
>
<label
class=
"col-span-3 my-auto ti-form-label whitespace-nowrap"
>
วันที่สิ้นสุดโครงการ:
</label
>
<input
type=
"date"
class=
"col-span-9 ti-form-input"
placeholder=
"สิ้นสุด"
[(
ngModel
)]="
selectedProject
.
end_date
"
/>
</div>
</div>
</div>
</div>
</div>
<div
class=
"box-footer"
>
<button
type=
"button"
class=
"w-full ti-btn ti-btn-success"
(
click
)="
saveProject
()"
>
<i
class=
"ti ti-report"
></i>
บันทึก
</button
><button
type=
"button"
(
click
)="
selectedProject =
undefined"
class=
"w-full ti-btn font-medium border-gray-200 bg-white text-gray-700 shadow-sm align-middle hover:bg-gray-50 focus:ring-offset-white focus:ring-primary dark:bg-bgdark dark:hover:bg-black/20 dark:border-white/10 dark:text-white/70 dark:hover:text-white dark:focus:ring-offset-white/10"
>
<i
class=
"ti ti-ban"
></i>
ปิด
</button>
<div
class=
"sm:col-span-2 col-span-2"
>
<div
class=
"hs-dropdown ti-dropdown flex justify-end"
>
<button
type=
"button"
class=
"w-full ti-btn w-full ti-btn ti-btn-danger"
(
click
)="
deleteProject
(
selectedProject
)"
>
<i
class=
"ti c-1-color"
></i>
ลบ
</button>
</div>
</div>
</div>
</div>
</div>
<!-- End::row-1 -->
</div>
<!-- End::row-2 -->
Synto-Angular/src/app/admin/project-management/project-management.component.ts
View file @
c1b1b97c
...
...
@@ -10,8 +10,7 @@ import { ProjectService } from 'src/app/services/project.service';
})
export
class
ProjectManagementComponent
{
projectList
:
any
[]
=
[];
projectList
:
ProJectModel
[]
=
[];
selectedProject
?:
ProJectModel
constructor
(
private
projectService
:
ProjectService
)
{
}
...
...
@@ -39,7 +38,8 @@ export class ProjectManagementComponent {
}
}
deleteProject
()
{
deleteProject
(
project
:
ProJectModel
)
{
this
.
selectedProject
=
new
ProJectModel
(
project
)
if
(
this
.
selectedProject
)
{
this
.
projectService
.
delete
(
this
.
selectedProject
).
subscribe
(
result
=>
{
console
.
log
(
result
)
...
...
@@ -55,4 +55,13 @@ export class ProjectManagementComponent {
}
}
newPj
()
{
this
.
selectedProject
=
new
ProJectModel
()
}
detailPj
(
pj
:
ProJectModel
)
{
this
.
selectedProject
=
new
ProJectModel
(
pj
)
}
}
Synto-Angular/src/app/admin/user-management/user-management.component.html
View file @
c1b1b97c
<app-page-header
title=
"Contacts"
title1=
"Contacts"
activeitem=
"Pages"
></app-page-header>
<app-page-header
title=
"Contacts"
title1=
"Contacts"
activeitem=
"Pages"
></app-page-header>
<!-- Start::row-1 -->
<div
class=
"grid grid-cols-12 gap-x-5"
>
...
...
@@ -10,15 +14,23 @@
<div
class=
"relative sm:max-w-xs max-w-[210px]"
>
<label
for=
"hs-table-search"
class=
"sr-only"
>
Search
</label>
<div
class=
"absolute inset-y-0 ltr:right-0 rtl:left-0 flex items-center pointer-events-none ltr:pr-4 rtl:pl-4"
>
class=
"absolute inset-y-0 ltr:right-0 rtl:left-0 flex items-center pointer-events-none ltr:pr-4 rtl:pl-4"
>
<i
class=
"ti ti-search"
></i>
</div>
<input
type=
"text"
name=
"hs-table-search"
id=
"hs-table-search"
class=
"p-2 ltr:pr-10 rtl:pl-10 ti-form-input"
placeholder=
"Search Contact"
/>
<input
type=
"text"
name=
"hs-table-search"
id=
"hs-table-search"
class=
"p-2 ltr:pr-10 rtl:pl-10 ti-form-input"
placeholder=
"Search Contact"
/>
</div>
</div>
<div
class=
"col-span-12 lg:sm:col-span-8"
>
<div
class=
"flex items-center flex-wrap lg:justify-end team-right rtl:space-x-reverse"
>
<div
class=
"flex items-center flex-wrap lg:justify-end team-right rtl:space-x-reverse"
>
<!-- <div class="hs-dropdown ti-dropdown me-2 mt-1">
<button id="hs-dropdown-custom-icon-trigger2" type="button"
class="hs-dropdown-toggle ti-btn ti-btn-primary m-0">
...
...
@@ -32,32 +44,46 @@
<a class="ti-dropdown-item" href="javascript:void(0)">All</a>
</div>
</div> -->
<a
(
click
)="
newEmp
()"
class=
"team-add-btn m-0 ti-btn ti-btn-secondary mx-1 whitespace-nowrap mt-1"
>
<a
(
click
)="
newEmp
()"
class=
"team-add-btn m-0 ti-btn ti-btn-secondary mx-1 whitespace-nowrap mt-1"
>
<i
class=
"ti ti-circle-plus leading-none"
>
</i>
Add New Contact
</a>
</div>
</div>
</div>
</div>
<div
class=
"box-body"
>
<div
class=
"sm:grid sm:space-y-0 space-y-6 xl:!grid-cols-3 md:grid-cols-2 gap-6"
>
<div
class=
"sm:grid sm:space-y-0 space-y-6 xl:!grid-cols-3 md:grid-cols-2 gap-6"
>
<div
class=
"box mb-0"
*
ngFor=
"let item of memberlist"
>
<div
class=
"box-body space-y-5"
>
<div
class=
"flex"
>
<div
class=
"sm:flex sm:space-x-3 sm:space-y-0 space-y-4 rtl:space-x-reverse"
>
<img
class=
"avatar avatar-lg rounded-sm"
src=
"{{item.picture ? item.picture : './assets/img/users/1.jpg'}}"
alt=
"Image Description"
/>
<div
class=
"sm:flex sm:space-x-3 sm:space-y-0 space-y-4 rtl:space-x-reverse"
>
<img
class=
"avatar avatar-lg rounded-sm"
src=
"{{
item.picture ? item.picture : './assets/img/users/1.jpg'
}}"
alt=
"Image Description"
/>
<div
class=
"space-y-1 my-auto truncate"
>
<h5
class=
"font-semibold text-base leading-none"
>
{{
item.first_name+' '+item.last_name
}}
{{
item.first_name + " " + item.last_name
}}
</h5>
<p
class=
"text-gray-500 dark:text-white/70 font-semibold text-xs truncate max-w-[9rem]"
>
{{item.email}}
<p
class=
"text-gray-500 dark:text-white/70 font-semibold text-xs truncate max-w-[9rem]"
>
{{ item.email }}
</p>
<p
class=
"text-primary dark:text-primary text-xs font-semibold"
>
{{item.phone}}
<p
class=
"text-primary dark:text-primary text-xs font-semibold"
>
{{ item.phone }}
</p>
</div>
</div>
...
...
@@ -69,48 +95,82 @@
</div>
<div
class=
"box-footer"
>
<div
class=
"grid grid-cols-12"
>
<div
class=
"sm:col-span-10 col-span-4"
(
click
)="
detailEmp
(
item
)"
>
<a
href=
"javascript:void(0);"
class=
"inline-flex !p-1 flex-shrink-0 justify-center items-center gap-2 w-full rounded-sm border font-medium bg-white text-gray-500 shadow-sm align-middle focus:outline-none focus:ring-0 focus:ring-offset-0 focus:ring-offset-white focus:ring-primary transition-all text-xs dark:bg-bgdark dark:border-white/10 dark:text-white/70 dark:focus:ring-offset-white/10"
>
<div
class=
"sm:col-span-6 col-span-4"
(
click
)="
detailEmp
(
item
)"
>
<a
href=
"javascript:void(0);"
class=
"ti-btn ti-btn-soft-light inline-flex !p-1 flex-shrink-0 justify-center items-center gap-2 w-full rounded-sm border font-medium bg-white text-gray-500 shadow-sm align-middle focus:outline-none focus:ring-0 focus:ring-offset-0 focus:ring-offset-white focus:ring-primary transition-all text-xs dark:bg-bgdark dark:border-white/10 dark:text-white/70 dark:focus:ring-offset-white/10"
>
<i
class=
"ri-chat-2-line text-lg leading-none"
></i>
<span
class=
"text-sm leading-none hidden sm:block"
>
ข้อมูล
</span>
<span
class=
"text-sm leading-none hidden sm:block"
>
ข้อมูล
</span
>
</a>
</div>
<div
class=
"sm:col-span-2 col-span-4"
>
<div
class=
"hs-dropdown ti-dropdown flex justify-end"
>
<a
aria-label=
"anchor"
href=
"javascript:void(0);"
class=
"hs-dropdown-toggle ti-dropdown-toggle inline-flex !p-1 flex-shrink-0 justify-center items-center gap-2 rounded-sm border font-medium bg-white text-gray-500 shadow-sm align-middle focus:outline-none focus:ring-0 focus:ring-offset-0 focus:ring-offset-white focus:ring-primary transition-all text-xs dark:bg-bgdark dark:border-white/10 dark:text-white/70 dark:focus:ring-offset-white/10"
>
<i
class=
"ri ri-more-2-line text-lg leading-none"
></i>
</a>
<div
class=
"hs-dropdown-menu ti-dropdown-menu"
>
<!-- <a class="ti-dropdown-item" href="javascript:void(0);"><i
class="ri-share-line me-2 align-middle"></i>แก้ไข</a> -->
<a
class=
"ti-dropdown-item"
(
click
)="
deleteUser
(
item
)"
><i
class=
"ri-delete-bin-5-line me-2 align-middle"
></i>
ลบ
</a>
</div>
<div
class=
"sm:col-span-5 col-span-4"
(
click
)="
detailEmp
(
item
)"
>
<a
href=
"javascript:void(0);"
class=
"ti-btn ti-btn-soft-danger inline-flex !p-1 flex-shrink-0 justify-center items-center gap-2 w-full rounded-sm border font-medium bg-white text-gray-500 shadow-sm align-middle focus:outline-none focus:ring-0 focus:ring-offset-0 focus:ring-offset-white focus:ring-primary transition-all text-xs dark:bg-bgdark dark:border-white/10 dark:text-white/70 dark:focus:ring-offset-white/10"
>
<i
class=
"ti ti-brand-bitbucket text-lg leading-none "
></i>
<span
class=
"text-sm leading-none hidden sm:block"
(
click
)="
deleteUser
(
item
)"
>
ลบ
</span
>
</a>
</div>
<!-- <div class="sm:col-span-2 col-span-2">
<div class="hs-dropdown ti-dropdown flex justify-end">
<button
type="button"
class="ti-btn ti-btn-primary mb-1 py-1"
(click)="deleteUser(item)"
>
<i></i>ลบ
</button>
</div>
</div> -->
</div>
</div>
</div>
</div>
<nav
class=
"mt-6 flex justify-end items-center space-x-2 rtl:space-x-reverse"
>
<a
class=
"text-gray-500 dark:text-white/70 hover:text-primary e py-1 px-2 leading-none inline-flex items-center gap-2 rounded-sm"
href=
"javascript:void(0);"
>
<nav
class=
"mt-6 flex justify-end items-center space-x-2 rtl:space-x-reverse"
>
<a
class=
"text-gray-500 dark:text-white/70 hover:text-primary e py-1 px-2 leading-none inline-flex items-center gap-2 rounded-sm"
href=
"javascript:void(0);"
>
<span
aria-hidden=
"true"
>
Prev
</span>
<span
class=
"sr-only"
>
Previous
</span>
</a>
<a
class=
"bg-primary text-white py-1 px-2 leading-none inline-flex items-center text-sm font-medium rounded-sm"
href=
"javascript:void(0);"
aria-current=
"page"
>
1
</a>
<a
class=
"text-gray-500 dark:text-white/70 hover:text-primary e py-1 px-2 leading-none inline-flex items-center text-sm font-medium rounded-sm"
href=
"javascript:void(0);"
>
2
</a>
<a
class=
"text-gray-500 dark:text-white/70 hover:text-primary e py-1 px-2 leading-none inline-flex items-center text-sm font-medium rounded-sm"
href=
"javascript:void(0);"
>
3
</a>
<a
class=
"text-gray-500 dark:text-white/70 hover:text-primary e py-1 px-2 leading-none inline-flex items-center gap-2 rounded-sm"
href=
"javascript:void(0);"
>
<a
class=
"bg-primary text-white py-1 px-2 leading-none inline-flex items-center text-sm font-medium rounded-sm"
href=
"javascript:void(0);"
aria-current=
"page"
>
1
</a
>
<a
class=
"text-gray-500 dark:text-white/70 hover:text-primary e py-1 px-2 leading-none inline-flex items-center text-sm font-medium rounded-sm"
href=
"javascript:void(0);"
>
2
</a
>
<a
class=
"text-gray-500 dark:text-white/70 hover:text-primary e py-1 px-2 leading-none inline-flex items-center text-sm font-medium rounded-sm"
href=
"javascript:void(0);"
>
3
</a
>
<a
class=
"text-gray-500 dark:text-white/70 hover:text-primary e py-1 px-2 leading-none inline-flex items-center gap-2 rounded-sm"
href=
"javascript:void(0);"
>
<span
class=
"sr-only"
>
Next
</span>
<span
aria-hidden=
"true"
>
Next
</span>
</a>
...
...
@@ -122,24 +182,48 @@
<div
class=
"box"
>
<div
class=
"box-body"
>
<div
class=
"relative"
>
<div
class=
"flex relative before:bg-black/50 before:absolute before:w-full before:h-full before:rounded-sm"
>
<img
[
src
]="'./
assets
/
img
/
users
/
1
.
jpg
'"
alt=
""
class=
"h-[150px] w-full rounded-sm"
id=
"profile-img2"
/>
<div
class=
"flex relative before:bg-black/50 before:absolute before:w-full before:h-full before:rounded-sm"
>
<img
[
src
]="'./
assets
/
img
/
users
/
1
.
jpg
'"
alt=
""
class=
"h-[150px] w-full rounded-sm"
id=
"profile-img2"
/>
<span
class=
"absolute top-5 ltr:right-5 rtl:left-5 flex p-2 rounded-sm ring-1 ring-black/10 text-white bg-black/10 leading-none"
>
class=
"absolute top-5 ltr:right-5 rtl:left-5 flex p-2 rounded-sm ring-1 ring-black/10 text-white bg-black/10 leading-none"
>
<i
class=
"ri ri-pencil-line"
></i>
<input
type=
"file"
class=
"absolute inset-0 w-full h-full opacity-0 cursor-pointer"
id=
"profile-change2"
/>
<input
type=
"file"
class=
"absolute inset-0 w-full h-full opacity-0 cursor-pointer"
id=
"profile-change2"
/>
</span>
</div>
<div
class=
"absolute top-[5.5rem] inset-x-0 text-center space-y-3"
>
<div
class=
"flex justify-center w-full"
>
<div
class=
"relative"
>
<img
[
src
]="
selectedUser
.
picture
?
selectedUser
.
picture
:
'./
assets
/
img
/
users
/
1
.
jpg
'"
class=
"w-24 h-24 rounded-full ring-4 ring-white/10 mx-auto"
id=
"profile-img"
alt=
"pofile-img"
/>
<img
[
src
]="
selectedUser
.
picture
?
selectedUser
.
picture
:
'./
assets
/
img
/
users
/
1
.
jpg
'
"
class=
"w-24 h-24 rounded-full ring-4 ring-white/10 mx-auto"
id=
"profile-img"
alt=
"pofile-img"
/>
<span
class=
"absolute top-0 ltr:right-0 rtl:left-0 block p-1 rounded-full ring-2 ring-white/10 text-white bg-white/10 dark:bg-bgdark leading-none"
>
class=
"absolute top-0 ltr:right-0 rtl:left-0 block p-1 rounded-full ring-2 ring-white/10 text-white bg-white/10 dark:bg-bgdark leading-none"
>
<i
class=
"ri ri-pencil-line"
></i>
<input
type=
"file"
class=
"absolute inset-0 w-full h-full opacity-0 cursor-pointer"
id=
"profile-change"
/>
<input
type=
"file"
class=
"absolute inset-0 w-full h-full opacity-0 cursor-pointer"
id=
"profile-change"
/>
</span>
</div>
</div>
...
...
@@ -149,46 +233,108 @@
<div
class=
"mt-5"
>
<div
class=
"space-y-4 text-start"
>
<div
class=
"grid sm:grid-cols-12 gap-x-6"
>
<label
class=
"col-span-3 my-auto ti-form-label whitespace-nowrap"
>
ชื่อ:
</label>
<input
type=
"text"
class=
"col-span-9 ti-form-input"
placeholder=
"Enter Full Name"
[(
ngModel
)]="
selectedUser
.
first_name
"
/>
<label
class=
"col-span-3 my-auto ti-form-label whitespace-nowrap"
>
ชื่อ:
</label
>
<input
type=
"text"
class=
"col-span-9 ti-form-input"
placeholder=
"กรุณากรอกชื่อ"
[(
ngModel
)]="
selectedUser
.
first_name
"
/>
</div>
<div
class=
"grid sm:grid-cols-12 gap-x-6"
>
<label
class=
"col-span-3 my-auto ti-form-label whitespace-nowrap"
>
นามสกุล:
</label>
<input
type=
"text"
class=
"col-span-9 ti-form-input"
placeholder=
"Enter Full Name"
[(
ngModel
)]="
selectedUser
.
last_name
"
/>
<label
class=
"col-span-3 my-auto ti-form-label whitespace-nowrap"
>
นามสกุล:
</label
>
<input
type=
"text"
class=
"col-span-9 ti-form-input"
placeholder=
"กรุณากรอกนามสกุล"
[(
ngModel
)]="
selectedUser
.
last_name
"
/>
</div>
<div
class=
"grid sm:grid-cols-12 gap-x-6"
>
<label
class=
"col-span-3 my-auto ti-form-label whitespace-nowrap"
>
อีเมล:
</label>
<input
type=
"email"
class=
"col-span-9 ti-form-input"
placeholder=
"Enter Email"
[(
ngModel
)]="
selectedUser
.
email
"
/>
<label
class=
"col-span-3 my-auto ti-form-label whitespace-nowrap"
>
อีเมล:
</label
>
<input
type=
"email"
class=
"col-span-9 ti-form-input"
placeholder=
"กรุณากรอกอีเมล"
[(
ngModel
)]="
selectedUser
.
email
"
/>
</div>
<div
class=
"grid sm:grid-cols-12 gap-x-6"
>
<label
class=
"col-span-3 my-auto ti-form-label whitespace-nowrap"
>
รหัสผ่าน:
</label>
<input
type=
"password"
class=
"col-span-9 ti-form-input"
placeholder=
"Enter Email"
[(
ngModel
)]="
selectedUser
.
password
"
/>
<label
class=
"col-span-3 my-auto ti-form-label whitespace-nowrap"
>
รหัสผ่าน:
</label
>
<input
type=
"password"
class=
"col-span-9 ti-form-input"
placeholder=
"กรุณากรอกรหัสผ่าน"
[(
ngModel
)]="
selectedUser
.
password
"
/>
</div>
<div
class=
"grid sm:grid-cols-12 gap-x-6"
>
<label
class=
"col-span-3 my-auto ti-form-label whitespace-nowrap"
>
เบอร์:
</label>
<input
type=
"number"
class=
"col-span-9 ti-form-input"
placeholder=
"Enter Phone No"
[(
ngModel
)]="
selectedUser
.
phone
"
/>
<label
class=
"col-span-3 my-auto ti-form-label whitespace-nowrap"
>
เบอร์:
</label
>
<input
type=
"number"
class=
"col-span-9 ti-form-input"
placeholder=
"กรุณากรอกเบอร์โทรศัพท์"
[(
ngModel
)]="
selectedUser
.
phone
"
/>
</div>
<div
class=
"grid sm:grid-cols-12 gap-x-6"
>
<label
class=
"col-span-3 my-auto ti-form-label whitespace-nowrap"
>
ตำแหน่ง:
</label>
<input
type=
"number"
class=
"col-span-9 ti-form-input"
placeholder=
"Enter Phone No"
[(
ngModel
)]="
selectedUser
.
position
"
/>
<label
class=
"col-span-3 my-auto ti-form-label whitespace-nowrap"
>
ตำแหน่ง:
</label
>
<input
type=
"number"
class=
"col-span-9 ti-form-input"
placeholder=
"กรุณากรอกเลือกตำแหน่ง"
[(
ngModel
)]="
selectedUser
.
position
"
/>
</div>
</div>
</div>
</div>
</div>
<div
class=
"box-footer"
>
<button
type=
"button"
class=
"w-full ti-btn ti-btn-primary"
(
click
)="
save
()"
>
<i
class=
"ti ti-report"
></i>
บันทึก
</button><button
type=
"button"
(
click
)="
selectedUser =
undefined"
class=
"w-full ti-btn font-medium border-gray-200 bg-white text-gray-700 shadow-sm align-middle hover:bg-gray-50 focus:ring-offset-white focus:ring-primary dark:bg-bgdark dark:hover:bg-black/20 dark:border-white/10 dark:text-white/70 dark:hover:text-white dark:focus:ring-offset-white/10"
>
<div
class=
"box-footer"
>
<button
type=
"button"
class=
"w-full ti-btn ti-btn-success"
(
click
)="
save
()"
>
<i
class=
"ti ti-report"
></i>
บันทึก
</button
><button
type=
"button"
(
click
)="
selectedUser =
undefined"
class=
"w-full ti-btn font-medium border-gray-200 bg-white text-gray-700 shadow-sm align-middle hover:bg-gray-50 focus:ring-offset-white focus:ring-primary dark:bg-bgdark dark:hover:bg-black/20 dark:border-white/10 dark:text-white/70 dark:hover:text-white dark:focus:ring-offset-white/10"
>
<i
class=
"ti ti-ban"
></i>
ปิด
</button>
<div
class=
"sm:col-span-2 col-span-2"
>
<div
class=
"hs-dropdown ti-dropdown flex justify-end"
>
<button
type=
"button"
class=
"w-full ti-btn w-full ti-btn ti-btn-danger"
(
click
)="
deleteUser
(
selectedUser
)"
>
<i
class=
"ti c-1-color"
></i>
ลบ
</button>
</div>
</div>
</div>
</div>
</div>
<!-- End::row-1 -->
</div>
<!-- End::row-1 -->
Synto-Angular/src/app/models/equipments.model.ts
View file @
c1b1b97c
...
...
@@ -3,6 +3,7 @@ import { BaseModel } from "./base.model";
export
class
EquipmentModel
extends
BaseModel
{
equipment_id
:
string
;
picture
:
string
;
equipment_name
:
string
;
description
?:
string
;
quantity_total
:
number
;
...
...
@@ -13,6 +14,7 @@ export class EquipmentModel extends BaseModel {
constructor
(
data
?:
Partial
<
EquipmentModel
>
,
translateService
?:
TranslateService
)
{
super
(
data
,
translateService
);
this
.
picture
=
data
?.
picture
??
''
;
this
.
equipment_id
=
data
?.
equipment_id
??
''
;
this
.
equipment_name
=
data
?.
equipment_name
??
''
;
this
.
description
=
data
?.
description
??
''
;
...
...
Synto-Angular/src/app/models/project.model.ts
View file @
c1b1b97c
import
{
TranslateService
}
from
"@ngx-translate/core"
;
import
{
BaseModel
}
from
"./base.model"
;
import
{
da
}
from
"date-fns/locale"
;
export
class
ProJectModel
extends
BaseModel
{
project_id
:
string
;
picture
:
string
;
project_name
:
string
;
project_desc
?:
string
;
start_date
:
string
;
...
...
@@ -12,6 +14,7 @@ export class ProJectModel extends BaseModel {
constructor
(
data
?:
Partial
<
ProJectModel
>
,
translateService
?:
TranslateService
)
{
super
(
data
,
translateService
);
this
.
picture
=
data
?.
picture
??
''
;
this
.
project_id
=
data
?.
project_id
??
''
;
this
.
project_name
=
data
?.
project_name
??
''
;
this
.
project_desc
=
data
?.
project_desc
??
''
;
...
...
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