Commit c1b1b97c by DESKTOP-E0VCCBD\zedan

update

parent 9df7d108
...@@ -14,7 +14,8 @@ exports.createUser = async (req, res) => { ...@@ -14,7 +14,8 @@ exports.createUser = async (req, res) => {
first_name: newUser.first_name, first_name: newUser.first_name,
last_name: newUser.last_name, last_name: newUser.last_name,
email: newUser.email, email: newUser.email,
role: newUser.role role: newUser.role,
phone: newUser.phone
} }
}); });
} catch (error) { } catch (error) {
......
...@@ -9,6 +9,12 @@ const User = sequelize.define('User', { ...@@ -9,6 +9,12 @@ const User = sequelize.define('User', {
defaultValue: DataTypes.UUIDV4, defaultValue: DataTypes.UUIDV4,
primaryKey: true, primaryKey: true,
}, },
profile_picture: {
type: DataTypes.STRING(500),
allowNull: true,
},
first_name: { first_name: {
type: DataTypes.STRING(100), type: DataTypes.STRING(100),
allowNull: false, allowNull: false,
...@@ -17,6 +23,10 @@ const User = sequelize.define('User', { ...@@ -17,6 +23,10 @@ const User = sequelize.define('User', {
type: DataTypes.STRING(100), type: DataTypes.STRING(100),
allowNull: false, allowNull: false,
}, },
phone: {
type: DataTypes.STRING(100),
allowNull: false,
},
email: { email: {
type: DataTypes.STRING(255), type: DataTypes.STRING(255),
allowNull: false, allowNull: false,
......
<app-page-header
<!-- Start::row-1 --> 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]"> <div class="relative sm:max-w-xs max-w-[210px]">
<label for="hs-table-search" class="sr-only">Search</label> <label for="hs-table-search" class="sr-only">Search</label>
<div <div
...@@ -12,123 +22,299 @@ ...@@ -12,123 +22,299 @@
name="hs-table-search" name="hs-table-search"
id="hs-table-search" id="hs-table-search"
class="p-2 ltr:pr-10 rtl:pl-10 ti-form-input" class="p-2 ltr:pr-10 rtl:pl-10 ti-form-input"
placeholder="Search Task" placeholder="Search Contact"
/> />
</div> </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>
<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="box-body">
<div class="table-bordered whitespace-nowrap rounded-sm overflow-auto"> <div
<table class="ti-custom-table ti-custom-table-head edit-table"> class="sm:grid sm:space-y-0 space-y-6 xl:!grid-cols-3 md:grid-cols-2 gap-6"
<thead class="bg-gray-100 dark:bg-black/20"> >
<tr class=""> <div class="box mb-0" *ngFor="let product of productList">
<th scope="col" class="dark:text-white/70">ลำดับ <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="sm:col-span-2 col-span-2">
<div class="hs-tooltip ti-main-tooltip"> <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 <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);" href="javascript:void(0);"
class="ti-btn ti-btn-soft-secondary hs-tooltip-toggle"
(click)="addToCart()"
> >
<i class="ti ti-shopping-cart"></i> <span aria-hidden="true">Prev</span>
<span <span class="sr-only">Previous</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" </a>
role="tooltip" <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 <a
</span> 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> </a>
</nav>
</div> </div>
<div class="hs-tooltip ti-main-tooltip "> </div>
<a [routerLink]="'/ecommerce/edit-product/'" </div>
class="ti-btn ti-btn-soft-secondary hs-tooltip-toggle"> <div class="col-span-12 xxl:col-span-3" *ngIf="selectedProduct">
<i class="ti ti-pencil"></i> <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 <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" 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"
role="tooltip"
> >
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> </span>
</a>
</div> </div>
<div class="hs-tooltip ti-main-tooltip "> <div class="absolute top-[5.5rem] inset-x-0 text-center space-y-3">
<a aria-label="anchor" routerLink="/ecommerce/product-details" <div class="flex justify-center w-full">
class="hs-tooltip-toggle w-8 h-8 ti-btn rounded-full p-0 transition-none focus:outline-none ti-btn-soft-warning "> <div class="relative">
<i class="ti ti-eye"></i> <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 <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" 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"
role="tooltip"
> >
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> </span>
</a>
</div> </div>
<div class="hs-tooltip ti-main-tooltip"> </div>
<!-- <a </div>
href="javascript:void(0);" </div>
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" <div class="mt-14 space-y-5">
(click)="deleteProduct(product.product_id)" <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> <input
<span type="text"
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" class="col-span-9 ti-form-input"
role="tooltip" 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 <input
</span> type="text"
</a> --> 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> </div>
</td>
</tbody>
</table>
</div> </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>
<!-- </div> -->
<!-- End::row-1 --> <!-- End::row-1 -->
</div>
...@@ -15,22 +15,22 @@ export class ProductManagementComponent { ...@@ -15,22 +15,22 @@ export class ProductManagementComponent {
constructor(private EquipmentService: EquipmentService) { } constructor(private EquipmentService: EquipmentService) { }
ngOnInit() { ngOnInit() {
this.getUser() this.getProduct()
} }
getUser() { getProduct() {
this.EquipmentService.getLists().subscribe(result => { this.EquipmentService.getLists().subscribe(result => {
this.productList = result this.productList = result
}) })
} }
getUserId() { getProductId() {
this.EquipmentService.getById("73079f3b-b58a-46e6-a779-20a64911e505").subscribe(result => { this.EquipmentService.getById("73079f3b-b58a-46e6-a779-20a64911e505").subscribe(result => {
console.log(result) console.log(result)
}) })
} }
saveUser() { saveProduct() {
if (this.selectedProduct) { if (this.selectedProduct) {
this.EquipmentService.save(this.selectedProduct).subscribe(result => { this.EquipmentService.save(this.selectedProduct).subscribe(result => {
console.log(result) console.log(result)
...@@ -38,24 +38,35 @@ export class ProductManagementComponent { ...@@ -38,24 +38,35 @@ export class ProductManagementComponent {
} }
} }
deleteUser() {
updateProduct() {
if (this.selectedProduct) { if (this.selectedProduct) {
this.EquipmentService.delete(this.selectedProduct).subscribe(result => { this.EquipmentService.update(this.selectedProduct).subscribe(result => {
console.log(result) console.log(result)
}) })
} }
} }
updateUser() { addToCart() {
}
deleteProduct(product: EquipmentModel) {
this.selectedProduct = new EquipmentModel(product)
if (this.selectedProduct) { if (this.selectedProduct) {
this.EquipmentService.update(this.selectedProduct).subscribe(result => { this.EquipmentService.delete(this.selectedProduct).subscribe(result => {
console.log(result) console.log(result)
}) })
} }
} }
newproduct() {
this.selectedProduct = new EquipmentModel()
}
addToCart(){ detailproduct(pj: EquipmentModel) {
this.selectedProduct = new EquipmentModel(pj)
} }
}
}
<!-- Page Header --> <app-page-header
<div class="block justify-between page-header sm:flex"> title="Project"
<div> title1="Project"
<h3 activeitem="Pages"
class="text-gray-700 hover:text-gray-900 dark:text-white dark:hover:text-white text-2xl font-medium" ></app-page-header>
>
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 -->
<!-- Start::row-1 --> <!-- Start::row-1 -->
<div class="grid grid-cols-12 gap-6"> <div class="grid grid-cols-12 gap-x-5">
<div class="col-span-12"> <div class="col-span-12 xxl:col-span-7">
<div class="box"> <div class="box">
<div class="box-body"> <div class="box-header">
<div class="lg:grid grid-cols-12 gap-6 space-y-6 lg:space-y-0"> <div class="grid grid-cols-12 gap-6">
<div class="col-span-12 lg:col-span-4"> <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> <label for="hs-table-search" class="sr-only">Search</label>
<div <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"
...@@ -48,196 +22,299 @@ ...@@ -48,196 +22,299 @@
name="hs-table-search" name="hs-table-search"
id="hs-table-search" id="hs-table-search"
class="p-2 ltr:pr-10 rtl:pl-10 ti-form-input" class="p-2 ltr:pr-10 rtl:pl-10 ti-form-input"
placeholder="Enter Your Text" placeholder="Search Contact"
/> />
</div> </div>
</div> </div>
<div class="col-span-12 lg:col-span-4"> <div class="col-span-12 lg:sm:col-span-8">
<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 <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 <a
href="javascript:void(0);" (click)="newPj()"
class="team-add-btn m-0 hs-tooltip-toggle ti-btn ti-btn-primary" class="team-add-btn m-0 ti-btn ti-btn-secondary mx-1 whitespace-nowrap mt-1"
routerLink="../addproject"
> >
Add Project <i class="ti ti-circle-plus leading-none"> </i>Add New Contact
<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>
</a> </a>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
</div> <div class="box-body">
</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 <div
class="col-span-12 md:col-span-6 xxl:col-span-3 team-box" class="sm:grid sm:space-y-0 space-y-6 xl:!grid-cols-2 md:grid-cols-2 gap-6"
*ngFor="let pj of projectList"
> >
<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 <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 <img
src="./assets/img/png-images/2.png" class="avatar avatar-lg rounded-sm"
alt="" src="{{
class="w-full h-32" project.picture ? project.picture : './assets/img/users/1.jpg'
}}"
alt="Image Description"
/> />
</div> <div class="space-y-1 my-auto truncate">
<div class="box-body"> <h5 class="font-semibold text-base leading-none">
<div class="justify-center text-center relative"> {{ project.project_name }}
<a </h5>
class="relative inline-block mt-8" <p
routerLink="/profile/home" class="text-gray-500 dark:text-white/70 font-semibold text-xs truncate max-w-[9rem]"
> >
<img {{ project.project_desc }}
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 }}
</p> </p>
</div> <p
<span class="dark:text-dark text-xs font-semibold"
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
> >
<div เริ่มโครงการ:{{ project.start_date }}
class="flex space-x-1 rtl:space-x-reverse justify-center text-center" </p>
></div> <p
class="dark:text-dark text-xs font-semibold"
>
สิ้นสุดโครงการ:{{ project.end_date }}
</p>
</div> </div>
<a </div>
aria-label="anchor" <!-- <div class="ltr:ml-auto rtl:mr-auto">
href="javascript:void(0);" <a aria-label="anchor" href="javascript:void(0);"><i
class="z-40 absolute top-0 ltr:left-0 rtl:right-0 block text-yellow-500 text-base hover:text-yellow-500" class="ri ri-heart-fill text-base text-danger hover:text-danger"></i></a>
></a> </div> -->
</div>
</div>
<div class="box-footer">
<div class="grid grid-cols-12">
<div <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" class="sm:col-span-6 col-span-4"
> (click)="detailPj(project)"
<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
> >
<a <a
class="team-remove ti-dropdown-item"
href="javascript:void(0);" href="javascript:void(0);"
(click)="deleteProject()" 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 ri-delete-bin-6-line text-lg"></i
>Delete</a
> >
<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>
<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"> <a
<div href="javascript:void(0);"
class="col-span-12 ltr:border-r rtl:border-l p-3 border-gray-200 dark:border-white/10" 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 <i class="ti ti-brand-bitbucket text-lg leading-none "></i>
[routerLink]="['/profile/home', user.member_id]" <span class="text-sm leading-none hidden sm:block"(click)="deleteProject(project)"
class="space-x-3" >ลบ</span
><i class="ri-user-line"></i><span>Profile</span></a >
> --> </a>
</div>
</div>
</div> </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> </div>
</div> </div>
</div> </div>
<nav <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 <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);" href="javascript:void(0);"
> >
<span aria-hidden="true">«</span> <span aria-hidden="true">Prev</span>
<span class="sr-only">Previous</span> <span class="sr-only">Previous</span>
</a> </a>
<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);" href="javascript:void(0);"
aria-current="page" aria-current="page"
>1</a >1</a
> >
<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);" href="javascript:void(0);"
>2</a >2</a
> >
<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);" href="javascript:void(0);"
>3</a >3</a
> >
<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);" href="javascript:void(0);"
> >
<span class="sr-only">Next</span> <span class="sr-only">Next</span>
<span aria-hidden="true">»</span> <span aria-hidden="true">Next</span>
</a> </a>
</nav> </nav>
</div> </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> </div>
<!-- End::row-2 -->
...@@ -10,8 +10,7 @@ import { ProjectService } from 'src/app/services/project.service'; ...@@ -10,8 +10,7 @@ import { ProjectService } from 'src/app/services/project.service';
}) })
export class ProjectManagementComponent { export class ProjectManagementComponent {
projectList:any[]=[]; projectList:ProJectModel[]=[];
selectedProject?: ProJectModel selectedProject?: ProJectModel
constructor(private projectService: ProjectService) { } constructor(private projectService: ProjectService) { }
...@@ -39,7 +38,8 @@ export class ProjectManagementComponent { ...@@ -39,7 +38,8 @@ export class ProjectManagementComponent {
} }
} }
deleteProject() { deleteProject(project:ProJectModel) {
this.selectedProject = new ProJectModel(project)
if (this.selectedProject) { if (this.selectedProject) {
this.projectService.delete(this.selectedProject).subscribe(result => { this.projectService.delete(this.selectedProject).subscribe(result => {
console.log(result) console.log(result)
...@@ -55,4 +55,13 @@ export class ProjectManagementComponent { ...@@ -55,4 +55,13 @@ export class ProjectManagementComponent {
} }
} }
newPj() {
this.selectedProject = new ProJectModel()
}
detailPj(pj: ProJectModel) {
this.selectedProject = new ProJectModel(pj)
}
} }
<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 --> <!-- Start::row-1 -->
<div class="grid grid-cols-12 gap-x-5"> <div class="grid grid-cols-12 gap-x-5">
...@@ -10,15 +14,23 @@ ...@@ -10,15 +14,23 @@
<div class="relative sm:max-w-xs max-w-[210px]"> <div class="relative sm:max-w-xs max-w-[210px]">
<label for="hs-table-search" class="sr-only">Search</label> <label for="hs-table-search" class="sr-only">Search</label>
<div <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> <i class="ti ti-search"></i>
</div> </div>
<input type="text" name="hs-table-search" id="hs-table-search" <input
class="p-2 ltr:pr-10 rtl:pl-10 ti-form-input" placeholder="Search Contact" /> 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> </div>
<div class="col-span-12 lg:sm:col-span-8"> <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"> <!-- <div class="hs-dropdown ti-dropdown me-2 mt-1">
<button id="hs-dropdown-custom-icon-trigger2" type="button" <button id="hs-dropdown-custom-icon-trigger2" type="button"
class="hs-dropdown-toggle ti-btn ti-btn-primary m-0"> class="hs-dropdown-toggle ti-btn ti-btn-primary m-0">
...@@ -32,32 +44,46 @@ ...@@ -32,32 +44,46 @@
<a class="ti-dropdown-item" href="javascript:void(0)">All</a> <a class="ti-dropdown-item" href="javascript:void(0)">All</a>
</div> </div>
</div> --> </div> -->
<a (click)="newEmp()" <a
class="team-add-btn m-0 ti-btn ti-btn-secondary mx-1 whitespace-nowrap mt-1"> (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 <i class="ti ti-circle-plus leading-none"> </i>Add New Contact
</a> </a>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
<div class="box-body"> <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 mb-0" *ngFor="let item of memberlist">
<div class="box-body space-y-5"> <div class="box-body space-y-5">
<div class="flex"> <div class="flex">
<div class="sm:flex sm:space-x-3 sm:space-y-0 space-y-4 rtl:space-x-reverse"> <div
<img class="avatar avatar-lg rounded-sm" class="sm:flex sm:space-x-3 sm:space-y-0 space-y-4 rtl:space-x-reverse"
src="{{item.picture ? item.picture : './assets/img/users/1.jpg'}}" alt="Image Description" /> >
<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"> <div class="space-y-1 my-auto truncate">
<h5 class="font-semibold text-base leading-none"> <h5 class="font-semibold text-base leading-none">
{{item.first_name+' '+item.last_name}} {{ item.first_name + " " + item.last_name }}
</h5> </h5>
<p class="text-gray-500 dark:text-white/70 font-semibold text-xs truncate max-w-[9rem]"> <p
{{item.email}} class="text-gray-500 dark:text-white/70 font-semibold text-xs truncate max-w-[9rem]"
>
{{ item.email }}
</p> </p>
<p class="text-primary dark:text-primary text-xs font-semibold"> <p
{{item.phone}} class="text-primary dark:text-primary text-xs font-semibold"
>
{{ item.phone }}
</p> </p>
</div> </div>
</div> </div>
...@@ -69,48 +95,82 @@ ...@@ -69,48 +95,82 @@
</div> </div>
<div class="box-footer"> <div class="box-footer">
<div class="grid grid-cols-12"> <div class="grid grid-cols-12">
<div
<div class="sm:col-span-10 col-span-4" (click)="detailEmp(item)"> class="sm:col-span-6 col-span-4"
<a href="javascript:void(0);" (click)="detailEmp(item)"
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"> >
<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> <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> </a>
</div> </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 <div
class="ri-delete-bin-5-line me-2 align-middle"></i>ลบ</a> class="sm:col-span-5 col-span-4"
</div> (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>
<!-- <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> </div>
</div> </div>
</div> </div>
<nav class="mt-6 flex justify-end items-center space-x-2 rtl:space-x-reverse"> <nav
<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" class="mt-6 flex justify-end items-center space-x-2 rtl:space-x-reverse"
href="javascript:void(0);"> >
<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 aria-hidden="true">Prev</span>
<span class="sr-only">Previous</span> <span class="sr-only">Previous</span>
</a> </a>
<a class="bg-primary text-white py-1 px-2 leading-none inline-flex items-center text-sm font-medium rounded-sm" <a
href="javascript:void(0);" aria-current="page">1</a> class="bg-primary text-white py-1 px-2 leading-none inline-flex items-center text-sm font-medium rounded-sm"
<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);"
href="javascript:void(0);">2</a> aria-current="page"
<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" >1</a
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" <a
href="javascript:void(0);"> 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 class="sr-only">Next</span>
<span aria-hidden="true">Next</span> <span aria-hidden="true">Next</span>
</a> </a>
...@@ -122,24 +182,48 @@ ...@@ -122,24 +182,48 @@
<div class="box"> <div class="box">
<div class="box-body"> <div class="box-body">
<div class="relative"> <div class="relative">
<div class="flex relative before:bg-black/50 before:absolute before:w-full before:h-full before:rounded-sm"> <div
<img [src]="'./assets/img/users/1.jpg'" alt="" class="h-[150px] w-full rounded-sm" id="profile-img2" /> 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 <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> <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> </span>
</div> </div>
<div class="absolute top-[5.5rem] inset-x-0 text-center space-y-3"> <div class="absolute top-[5.5rem] inset-x-0 text-center space-y-3">
<div class="flex justify-center w-full"> <div class="flex justify-center w-full">
<div class="relative"> <div class="relative">
<img [src]="selectedUser.picture ? selectedUser.picture : './assets/img/users/1.jpg'" <img
class="w-24 h-24 rounded-full ring-4 ring-white/10 mx-auto" id="profile-img" alt="pofile-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 <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> <i class="ri ri-pencil-line"></i>
<input type="file" class="absolute inset-0 w-full h-full opacity-0 cursor-pointer" <input
id="profile-change" /> type="file"
class="absolute inset-0 w-full h-full opacity-0 cursor-pointer"
id="profile-change"
/>
</span> </span>
</div> </div>
</div> </div>
...@@ -149,46 +233,108 @@ ...@@ -149,46 +233,108 @@
<div class="mt-5"> <div class="mt-5">
<div class="space-y-4 text-start"> <div class="space-y-4 text-start">
<div class="grid sm:grid-cols-12 gap-x-6"> <div class="grid sm:grid-cols-12 gap-x-6">
<label class="col-span-3 my-auto ti-form-label whitespace-nowrap">ชื่อ:</label> <label
<input type="text" class="col-span-9 ti-form-input" placeholder="Enter Full Name" class="col-span-3 my-auto ti-form-label whitespace-nowrap"
[(ngModel)]="selectedUser.first_name" /> >ชื่อ:</label
>
<input
type="text"
class="col-span-9 ti-form-input"
placeholder="กรุณากรอกชื่อ"
[(ngModel)]="selectedUser.first_name"
/>
</div> </div>
<div class="grid sm:grid-cols-12 gap-x-6"> <div class="grid sm:grid-cols-12 gap-x-6">
<label class="col-span-3 my-auto ti-form-label whitespace-nowrap">นามสกุล:</label> <label
<input type="text" class="col-span-9 ti-form-input" placeholder="Enter Full Name" class="col-span-3 my-auto ti-form-label whitespace-nowrap"
[(ngModel)]="selectedUser.last_name" /> >นามสกุล:</label
>
<input
type="text"
class="col-span-9 ti-form-input"
placeholder="กรุณากรอกนามสกุล"
[(ngModel)]="selectedUser.last_name"
/>
</div> </div>
<div class="grid sm:grid-cols-12 gap-x-6"> <div class="grid sm:grid-cols-12 gap-x-6">
<label class="col-span-3 my-auto ti-form-label whitespace-nowrap">อีเมล:</label> <label
<input type="email" class="col-span-9 ti-form-input" placeholder="Enter Email" class="col-span-3 my-auto ti-form-label whitespace-nowrap"
[(ngModel)]="selectedUser.email" /> >อีเมล:</label
>
<input
type="email"
class="col-span-9 ti-form-input"
placeholder="กรุณากรอกอีเมล"
[(ngModel)]="selectedUser.email"
/>
</div> </div>
<div class="grid sm:grid-cols-12 gap-x-6"> <div class="grid sm:grid-cols-12 gap-x-6">
<label class="col-span-3 my-auto ti-form-label whitespace-nowrap">รหัสผ่าน:</label> <label
<input type="password" class="col-span-9 ti-form-input" placeholder="Enter Email" class="col-span-3 my-auto ti-form-label whitespace-nowrap"
[(ngModel)]="selectedUser.password" /> >รหัสผ่าน:</label
>
<input
type="password"
class="col-span-9 ti-form-input"
placeholder="กรุณากรอกรหัสผ่าน"
[(ngModel)]="selectedUser.password"
/>
</div> </div>
<div class="grid sm:grid-cols-12 gap-x-6"> <div class="grid sm:grid-cols-12 gap-x-6">
<label class="col-span-3 my-auto ti-form-label whitespace-nowrap">เบอร์:</label> <label
<input type="number" class="col-span-9 ti-form-input" placeholder="Enter Phone No" class="col-span-3 my-auto ti-form-label whitespace-nowrap"
[(ngModel)]="selectedUser.phone" /> >เบอร์:</label
>
<input
type="number"
class="col-span-9 ti-form-input"
placeholder="กรุณากรอกเบอร์โทรศัพท์"
[(ngModel)]="selectedUser.phone"
/>
</div> </div>
<div class="grid sm:grid-cols-12 gap-x-6"> <div class="grid sm:grid-cols-12 gap-x-6">
<label class="col-span-3 my-auto ti-form-label whitespace-nowrap">ตำแหน่ง:</label> <label
<input type="number" class="col-span-9 ti-form-input" placeholder="Enter Phone No" class="col-span-3 my-auto ti-form-label whitespace-nowrap"
[(ngModel)]="selectedUser.position" /> >ตำแหน่ง:</label
>
<input
type="number"
class="col-span-9 ti-form-input"
placeholder="กรุณากรอกเลือกตำแหน่ง"
[(ngModel)]="selectedUser.position"
/>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
<div class="box-footer"> <button type="button" class="w-full ti-btn ti-btn-primary" (click)="save()"> <div class="box-footer">
<i class="ti ti-report"></i>บันทึก</button><button type="button" (click)="selectedUser = undefined" <button
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"> 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>ปิด <i class="ti ti-ban"></i>ปิด
</button> </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> </div>
</div> </div>
<!-- End::row-1 -->
</div> </div>
<!-- End::row-1 -->
...@@ -3,6 +3,7 @@ import { BaseModel } from "./base.model"; ...@@ -3,6 +3,7 @@ import { BaseModel } from "./base.model";
export class EquipmentModel extends BaseModel { export class EquipmentModel extends BaseModel {
equipment_id: string; equipment_id: string;
picture: string;
equipment_name: string; equipment_name: string;
description?: string; description?: string;
quantity_total: number; quantity_total: number;
...@@ -13,6 +14,7 @@ export class EquipmentModel extends BaseModel { ...@@ -13,6 +14,7 @@ export class EquipmentModel extends BaseModel {
constructor(data?: Partial<EquipmentModel>, translateService?: TranslateService) { constructor(data?: Partial<EquipmentModel>, translateService?: TranslateService) {
super(data, translateService); super(data, translateService);
this.picture=data?.picture??'';
this.equipment_id = data?.equipment_id ?? ''; this.equipment_id = data?.equipment_id ?? '';
this.equipment_name = data?.equipment_name ?? ''; this.equipment_name = data?.equipment_name ?? '';
this.description = data?.description ?? ''; this.description = data?.description ?? '';
......
import { TranslateService } from "@ngx-translate/core"; import { TranslateService } from "@ngx-translate/core";
import { BaseModel } from "./base.model"; import { BaseModel } from "./base.model";
import { da } from "date-fns/locale";
export class ProJectModel extends BaseModel { export class ProJectModel extends BaseModel {
project_id: string; project_id: string;
picture: string;
project_name: string; project_name: string;
project_desc?: string; project_desc?: string;
start_date: string; start_date: string;
...@@ -12,6 +14,7 @@ export class ProJectModel extends BaseModel { ...@@ -12,6 +14,7 @@ export class ProJectModel extends BaseModel {
constructor(data?: Partial<ProJectModel>, translateService?: TranslateService) { constructor(data?: Partial<ProJectModel>, translateService?: TranslateService) {
super(data, translateService); super(data, translateService);
this.picture = data?.picture??'';
this.project_id = data?.project_id ?? ''; this.project_id = data?.project_id ?? '';
this.project_name = data?.project_name ?? ''; this.project_name = data?.project_name ?? '';
this.project_desc = data?.project_desc ?? ''; this.project_desc = data?.project_desc ?? '';
......
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