Commit a77f8b77 by DESKTOP-E0VCCBD\zedan

update

parent 37c33048
......@@ -59,30 +59,30 @@ User.beforeUpdate(async (user, options) => {
}
});
// (async () => {
// try {
// // sync() จะสร้างตารางตาม Model ทั้งหมดที่มีในโปรเจกต์ (ถ้ายังไม่มี)
// // หากมีอยู่แล้วและต้องการ drop table เดิมให้ใช้ force: true (ไม่แนะนำบน production)
// await sequelize.sync({ force: false });
(async () => {
try {
// sync() จะสร้างตารางตาม Model ทั้งหมดที่มีในโปรเจกต์ (ถ้ายังไม่มี)
// หากมีอยู่แล้วและต้องการ drop table เดิมให้ใช้ force: true (ไม่แนะนำบน production)
await sequelize.sync({ force: false });
// console.log("Table(s) created successfully!");
console.log("Table(s) created successfully!");
// // ตัวอย่างการทดสอบสร้าง User ทันที (ถ้าต้องการ)
// const newUser = await User.create({
// first_name: "Jane",
// last_name: "Doe",
// email: "jane@example.com",
// password: "123456", // จะถูก hash จาก hook ใน model
// role: "employee",
// });
// console.log("New user created:", newUser.user_id);
// ตัวอย่างการทดสอบสร้าง User ทันที (ถ้าต้องการ)
const newUser = await User.create({
first_name: "Jane",
last_name: "Doe",
email: "jane@example.com",
password: "123456", // จะถูก hash จาก hook ใน model
role: "employee",
});
console.log("New user created:", newUser.user_id);
// } catch (error) {
// console.error("Error creating table(s):", error);
// } finally {
// // ปิด connection เมื่อเสร็จสิ้นงาน (ขึ้นอยู่กับว่าเราต้องการปิดหรือไม่)
// await sequelize.close();
// }
// })();
} catch (error) {
console.error("Error creating table(s):", error);
} finally {
// ปิด connection เมื่อเสร็จสิ้นงาน (ขึ้นอยู่กับว่าเราต้องการปิดหรือไม่)
await sequelize.close();
}
})();
module.exports = User;
......@@ -25,7 +25,7 @@
"@firebase/firestore-compat": "^0.3.16",
"@kolkov/angular-editor": "^2.1.0",
"@ks89/angular-modal-gallery": "^10.0.1",
"@ng-select/ng-select": "^11.0.0",
"@ng-select/ng-select": "^11.2.0",
"@ngrx/store": "^16.0.1",
"@ngx-translate/core": "^16.0.4",
"@swimlane/ngx-charts": "^20.4.1",
......@@ -5963,9 +5963,10 @@
"integrity": "sha512-YbrUWREPGEjE/FU6foXcAT1YbVwqD/jkYnY1dFb0o4AxtP3s4xKBthlELjndZih8uwsDWgQZx1eNskRNe2BgZQ=="
},
"node_modules/@ng-select/ng-select": {
"version": "11.1.1",
"resolved": "https://registry.npmjs.org/@ng-select/ng-select/-/ng-select-11.1.1.tgz",
"integrity": "sha512-Z5wV/u2HgaKl7CQSG3Sy1oF+BPQolmVV6jBuPqHa2+OWg0Nn2e9eXYdcZT8Q3BahfP5j5rHNIBrkkESg/m4YiQ==",
"version": "11.2.0",
"resolved": "https://registry.npmjs.org/@ng-select/ng-select/-/ng-select-11.2.0.tgz",
"integrity": "sha512-lTyw93kFdKGecp9eKmOP0PQSCaAJS8DCt4D60ns055+ixvRSp2fuXAuJUvn1e3gAsvpZor37osmYlOJ4LYwYIA==",
"license": "MIT",
"dependencies": {
"tslib": "^2.3.1"
},
......
......@@ -29,7 +29,7 @@
"@firebase/firestore-compat": "^0.3.16",
"@kolkov/angular-editor": "^2.1.0",
"@ks89/angular-modal-gallery": "^10.0.1",
"@ng-select/ng-select": "^11.0.0",
"@ng-select/ng-select": "^11.2.0",
"@ngrx/store": "^16.0.1",
"@ngx-translate/core": "^16.0.4",
"@swimlane/ngx-charts": "^20.4.1",
......
<p>history-product works!</p>
<div class="box orders-table">
<div class="box-header">
<div class="flex justify-between">
<h5 class="box-title my-auto">Transection</h5>
<div
class="hs-dropdown ti-dropdown block ltr:ml-auto rtl:mr-auto my-auto"
>
<div
class="hs-dropdown-menu ti-dropdown-menu"
aria-labelledby="hs-dropdown-custom-icon-trigger"
>
<a class="ti-dropdown-item" href="javascript:void(0)">New</a>
<a class="ti-dropdown-item" href="javascript:void(0)">popular</a>
<a class="ti-dropdown-item" href="javascript:void(0)">Relevant</a>
</div>
</div>
</div>
</div>
<div class="box-body">
<div class="table-bordered overflow-auto">
<table class="ti-custom-table ti-custom-table-head">
<thead class="">
<tr>
<th scope="col">Date</th>
<th scope="col">Product Name</th>
<th scope="col">Product Id</th>
<th scope="col">Transaction Id</th>
<th scope="col">Amount</th>
<th scope="col">Status</th>
<th scope="col">Remark</th>
<th scope="col">Actions</th>
</tr>
</thead>
<tbody>
<tr *ngFor="let ts of transaction">
<td class="">{{ ts.borrow_date}}</td>
<td class="">{{ts.borrow_name}} </td>
<td>
<div class="flex items-center">
<div class="text-sm truncate">{{ ts.product_id }}</div>
</div>
</td>
<td>
<span class="font-semibold">{{ ts.borrow_id }}</span>
</td>
<td class="">
{{ ts.borrow_amount }}
</td>
<td>
<span
class="badge bg-{{ts.class}}/10 leading-none text-{{ts.class}} rounded-md"
>{{ ts.borrow_status }}</span
>
</td>
<td>{{ts.borrow}}</td>
<td class="font-medium space-x-2 rtl:space-x-reverse">
<div class="hs-tooltip ti-main-tooltip">
<a
href="javascript:void(0);"
class="m-0 hs-tooltip-toggle relative w-8 h-8 ti-btn rounded-full p-0 transition-none focus:outline-none ti-btn-soft-primary"
>
<i class="ti ti-eye"></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"
>
View
</span>
</a>
</div>
<div class="hs-tooltip ti-main-tooltip">
<a
href="javascript:void(0);"
class="customer-edit m-0 hs-tooltip-toggle relative w-8 h-8 ti-btn rounded-full p-0 transition-none focus:outline-none ti-btn-soft-secondary"
>
<i class="ti ti-pencil"></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"
>
Edit
</span>
</a>
</div>
<div class="hs-tooltip ti-main-tooltip">
<!-- <a
href="javascript:void(0);"
class="m-0 hs-tooltip-toggle relative w-8 h-8 ti-btn rounded-full p-0 transition-none focus:outline-none ti-btn-soft-danger"
(click)="click(ts.product_id)"
>
<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"
>
Delete
</span>
</a> -->
</div>
</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<div class="box-footer">
<div class="flex items-center">
<!-- <div class="">
<i class="ri-arrow-right-line ml-2 font-semibold"></i>
</div> -->
<div class="ltr:ml-auto rtl:mr-auto">
<nav
class="flex justify-center 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-md"
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-md"
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-md"
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-md"
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-md"
href="javascript:void(0);"
>
<span class="sr-only">Next</span>
<span aria-hidden="true">Next</span>
</a>
</nav>
</div>
</div>
</div>
......@@ -6,5 +6,42 @@ import { Component } from '@angular/core';
styleUrls: ['./history-product.component.scss']
})
export class HistoryProductComponent {
transaction: any[] = [];
constructor() {}
ngOnInit(): void {
this.transaction = [
{
borrow_date: '2025-03-10',
borrow_name: 'John Doe',
product_id: 'P101',
borrow_id: 'B202301',
borrow_amount: 2,
class: 'success', // หรือ 'danger', 'warning' เพื่อกำหนดสี badge
borrow_status: 'Approved',
borrow: 'Completed'
},
{
borrow_date: '2025-03-11',
borrow_name: 'Jane Smith',
product_id: 'P102',
borrow_id: 'B202302',
borrow_amount: 5,
class: 'warning',
borrow_status: 'Pending',
borrow: 'In Progress'
},
{
borrow_date: '2025-03-12',
borrow_name: 'Alice Johnson',
product_id: 'P103',
borrow_id: 'B202303',
borrow_amount: 1,
class: 'danger',
borrow_status: 'Rejected',
borrow: 'Cancelled'
}
];
}
}
import { Component } from '@angular/core';
import { HttpClient } from '@angular/common/http';
import { HttpErrorResponse } from '@angular/common/http';
import { environment } from 'src/environments/environment';
// import { ChartType, ChartOptions,ChartConfiguration,ChartData } from 'chart.js';
// import {
// ApexAxisChartSeries,
// ApexChart,
// ApexXAxis,
// ApexDataLabels,
// ApexTooltip,
// ApexStroke,
// ApexYAxis,
// ApexFill,
// ApexGrid,
// } from 'ng-apexcharts';
// const DATA = [
// {
// date: '01-05-23',
// src: './assets/img/ecommerce/products/13.png',
// product: 'Niker College Bag',
// id: '#1734-9743',
// transactionid: '#14008268610',
// amount:'10',
// status: 'Available',
// class:"success",
// borrow: '2009 '
// },
// {
// date: '02-05-23',
// src: './assets/img/ecommerce/products/17.png',
// product: 'Dslr Camera (50mm f/1.9 HRM Lens)',
// id: '#1234-4567',
// transactionid: '#31408224782',
// amount:'10',
// status: 'Not Available',
// class:"danger",
// borrow: '12,435',
// type1:'ชิ้น',
// type2:'กล่อง',
// },
// {
// date: '03-05-23',
// src: './assets/img/ecommerce/products/14.png',
// product: 'Outdoor Bomber Jacket',
// id: '#1902-9883',
// transactionid: '#92065567861',
// amount:'10',
// status: 'Not Available',
// class:"danger",
// borrow: '5,143',
// type1:'ชิ้น',
// type2:'กล่อง',
// },
// {
// date: '04-05-23',
// src: './assets/img/ecommerce/products/15.png',
// product: 'Light Blue Teddy',
// id: '#8745-1232',
// transactionid: '#31652851650',
// amount:'10',
// status: 'Pending',
// class:"warning",
// borrow: '7,183',
// type1:'ชิ้น',
// type2:'กล่อง',
// },
// {
// date: '05-05-23',
// src: './assets/img/ecommerce/products/16.png',
// product: 'Orange Smart Watch (24mm)',
// id: '#1962-9033',
// transactionid: '#23518898764',
// amount:'10',
// status: 'Shipping',
// class: "info",
// borrow: '10,287',
// },
// ];
// export type ChartOptions1 = {
// series: ApexAxisChartSeries;
// chart: ApexChart;
// xaxis: ApexXAxis;
// stroke: ApexStroke;
// tooltip: ApexTooltip;
// dataLabels: ApexDataLabels;
// yaxis: ApexYAxis;
// fill: ApexFill;
// grid: ApexGrid;
// };
@Component({
selector: 'app-home-admin',
templateUrl: './home-admin.component.html',
styleUrls: ['./home-admin.component.scss']
})
export class HomeAdminComponent {
// chartOptions: any;
transaction: any[] = [];
constructor() {}
ngOnInit(): void {
this.transaction = [
{
borrow_date: '2025-03-10',
borrow_name: 'John Doe',
product_id: 'P101',
borrow_id: 'B202301',
borrow_amount: 2,
class: 'success',
borrow_status: 'Approved',
borrow: 'Completed'
},
{
borrow_date: '2025-03-11',
borrow_name: 'Jane Smith',
product_id: 'P102',
borrow_id: 'B202302',
borrow_amount: 5,
class: 'warning',
borrow_status: 'Pending',
borrow: 'In Progress'
},
{
borrow_date: '2025-03-12',
borrow_name: 'Alice Johnson',
product_id: 'P103',
borrow_id: 'B202303',
borrow_amount: 1,
class: 'danger',
borrow_status: 'Rejected',
borrow: 'Cancelled'
}
];
}
}
//
// disabled = '';
// active: any;
// constructor(private http: HttpClient) {
// }}
// this.chartOptions = {
// series: [
// {
// name: 'Order',
// type: 'column',
// data: [23, 45, 22, 30, 15, 22, 34, 21, 30, 22, 30],
// },
// ],
// colors: ['#1cc961 ', '#cdd5e9'],
// chart: {
// height: 310,
// type: 'line',
// stacked: false,
// },
// responsive: [
// {
// breakpoint: 480,
// options: {
// chart: {
// width: 250,
// },
// legend: {
// position: 'bottom',
// },
// },
// },
// ],
// legend: {
// position: 'top',
// show: true,
// labels: {
// colors: ['#330033 ', '#cbd5e1'], // Set colors for the legend labels
// },
// },
// stroke: {
// width: [0, 2, 5],
// curve: 'smooth',
// colors: ['#dfd7d74a'],
// },
// plotOptions: {
// bar: {
// columnWidth: '40%',
// borderRadius: 4,
// },
// },
// fill: {
// opacity: [0.85, 0.25, 1],
// colors: ['#3a5892'],
// },
// labels: [
// '01/01/2003',
// '02/01/2003',
// '03/01/2003',
// '04/01/2003',
// '05/01/2003',
// '06/01/2003',
// '07/01/2003',
// '08/01/2003',
// '09/01/2003',
// '10/01/2003',
// '11/01/2003',
// ],
// markers: {
// size: 0,
// },
// xaxis: {
// type: 'datetime',
// },
// yaxis: {
// min: 0,
// },
// tooltip: {
// shared: true,
// intersect: false,
// y: {
// formatter: function (y: number) {
// if (typeof y !== 'undefined') {
// return y.toFixed(0);
// }
// return y;
// },
// },
// },
// };
// }
// ngOnInit(): void {
// this.getBorrowTransactions();
// }
// getBorrowTransactions(): void{
// this.http.get(environment.api + "/borrow_transaction").subscribe((result:any) => {
// console.log(result);
// this.transaction = result;
// }, (error: HttpErrorResponse) => {
// alert(error.message);
// });
// }
// public scatterChartLabels: string[] = [
// 'Eating',
// 'Drinking',
// 'Sleeping',
// 'Designing',
// 'Coding',
// 'Cycling',
// 'Running',
// ];
// public scatterChartOptions: ChartConfiguration['options'] = {
// scales: {
// x: {
// grid: {
// display: true,
// color: 'rgba(171, 167, 167,0.2)',
// },
// },
// y: {
// grid: {
// display: true,
// color: 'rgba(171, 167, 167,0.2)',
// },
// },
// },
// };
// public scatterChartData: ChartData<'scatter'> = {
// labels: this.scatterChartLabels,
// datasets: [
// {
// data: [
// { x: 1, y: 1 },
// { x: 2, y: 3 },
// { x: 3, y: -2 },
// ],
// label: 'Series A',
// pointRadius: 10,
// backgroundColor: '#6366f1',
// },
// ],
// };
// public scatterChartType: ChartType = 'scatter';
// public bubbleChartOptions: ChartConfiguration['options'] = {
// scales: {
// x: {
// min: 0,
// max: 30,
// ticks: {},
// grid: {
// display: true,
// color: 'rgba(171, 167, 167,0.2)',
// },
// },
// y: {
// min: 0,
// max: 30,
// ticks: {},
// grid: {
// display: true,
// color: 'rgba(171, 167, 167,0.2)',
// },
// },
// },
// };
// public bubbleChartType: ChartType = 'bubble';
// public bubbleChartLegend = true;
// public bubbleChartData: ChartData<'bubble'> = {
// labels: [],
// datasets: [
// {
// data: [
// { x: 1, y: 10, r: 10 },
// { x: 13, y: 5, r: 15 },
// ],
// label: 'First Dataset',
// backgroundColor: ['#6366f1'],
// borderColor: 'blue',
// hoverBackgroundColor: 'purple',
// hoverBorderColor: '#6366f1',
// },
// ],
// };
// // Pie
// public pieChartOptions: ChartOptions<'pie'> = {
// responsive: true,
// };
// public pieChartLabels = ['Priamry', 'Success', 'Warning'];
// public pieChartDatasets = [
// {
// data: [300, 500, 100],
// backgroundColor: [
// 'rgba(99, 102, 241, 1)', // Primary color
// 'rgba(94, 166, 142, 1)', // Success color
// 'rgba(166, 142, 94, 1)', // Warning color
// ],
// },
// ];
// public pieChartLegend = true;
// public pieChartPlugins = [];
// public generateData(count: number, yrange: { max: number; min: number; }) {
// let i = 0;
// const series = [];
// while (i < count) {
// const x = 'w' + (i + 1).toString();
// const y =
// Math.floor(Math.random() * (yrange.max - yrange.min + 1)) + yrange.min;
// series.push({
// x: x,
// y: y,
// });
// i++;
// }
// return series;
// }
// click = (id: string) => {
// const data = this.Itemdata.filter((x: { id: string }) => {
// return x.id != id;
// });
// this.Itemdata = data;
// };
// Itemdata = DATA;
<p>product-management works!</p>
<!-- Start::row-1 -->
<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"
>
<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 Task"
/>
</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="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">ลำดับ
</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.id_product }}</td>
<td class="text-center">{{ product.product_name }}</td>
<td class="text-center">{{ product.product_amount}}</td>
<td class="text-center">{{ product.category}}</td>
<td class="text-center">{{product.status}}</td>
<td class="text-center">{{product.time_date}}</td>
<!-- <td>{{ product.product_balance}}</td> -->
<td>
<div class="hs-tooltip ti-main-tooltip">
<a
href="javascript:void(0);"
class="ti-btn ti-btn-soft-secondary hs-tooltip-toggle"
(click)="addToCart(product)"
>
<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"
>
Add to cart
</span>
</a>
</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>
<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"
>
Edit
</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>
<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"
>
view
</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)"
>
<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"
>
Delete
</span>
</a> -->
</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 -->
......@@ -6,5 +6,57 @@ import { Component } from '@angular/core';
styleUrls: ['./product-management.component.scss']
})
export class ProductManagementComponent {
productList: any[] = [];
disabled = '';
active: any;
get: any;
delete: any;
ngOnInit(): void {
this.productList = [
{ id_product: 101, product_name: 'Laptop', product_amount: 5, category: 'Electronics', status: 'Available', time_date: '2025-03-11 14:30' },
{ id_product: 102, product_name: 'Smartphone', product_amount: 10, category: 'Electronics', status: 'Out of Stock', time_date: '2025-03-10 12:15' },
{ id_product: 103, product_name: 'Desk Chair', product_amount: 3, category: 'Furniture', status: 'Available', time_date: '2025-03-09 09:45' }
];
}
// constructor(
// private http: HttpClient,
// ) {
// }
// ngOnInit(): void {
// this.getProduct();
// }
// getProduct(): void {
// this.http.get(environment.api + "/product").subscribe((result: any) => {
// console.log(result);
// this.productList = result.data;
// }, (error: HttpErrorResponse) => {
// alert(error.message);
// });
// }
// deleteProduct(id: string): void {
// this.http.delete(`${environment.api}/product/${id}`).subscribe(
// (result: any) => {
// console.log(result);
// this.getProduct();
// },
// (error: HttpErrorResponse) => {
// alert(error.message);
// }
// );
// }
addToCart(product: any) {
let cart = localStorage.getItem('cart');
let cartItems = cart ? JSON.parse(cart) : [];
cartItems.push(product);
localStorage.setItem('cart', JSON.stringify(cartItems));
}
}
<p>project-management works!</p>
<!-- 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 -->
<!-- Start::row-1 -->
<div class="grid grid-cols-12 gap-6">
<div class="col-span-12">
<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="col-span-12 lg:col-span-4">
<div class="relative max-w-xs">
<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"
>
<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="Enter Your Text"
/>
</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="flex space-x-3 rtl:space-x-reverse lg:justify-end team-right"
>
<div class="hs-tooltip ti-main-tooltip">
<a
href="javascript:void(0);"
class="team-add-btn m-0 hs-tooltip-toggle ti-btn ti-btn-primary"
routerLink="../addproject"
>
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>
</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="col-span-12 md:col-span-6 xxl:col-span-3 team-box"
*ngFor="let user of projectList"
>
<div class="box overflow-hidden mb-0">
<div
class="block relative -mb-32 before:bg-primary/70 before:absolute before:w-full before:h-full"
>
<img
src="./assets/img/png-images/2.png"
alt=""
class="w-full h-32"
/>
</div>
<div class="box-body">
<div class="justify-center text-center relative">
<a
class="relative inline-block mt-8"
routerLink="/profile/home"
>
<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">
{{ user.project_name }}
</h2>
<p class="text-xs text-gray-500 dark:text-white/70">
{{ user.email }}
</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"
> PTT</span
>
<div
class="flex space-x-1 rtl:space-x-reverse justify-center text-center"
></div>
</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
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
>
<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
>
</div>
</div>
</div>
</div>
<div
class="box-footer bg-gray-100 dark:bg-bgdark p-0 text-center"
>
<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
[routerLink]="['/profile/home', user.member_id]"
class="space-x-3"
><i class="ri-user-line"></i><span>Profile</span></a
> -->
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<nav
class="flex justify-end items-center space-x-2 rtl:space-x-reverse my-4"
>
<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"
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-4 inline-flex items-center text-sm font-medium rounded-full"
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"
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"
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"
href="javascript:void(0);"
>
<span class="sr-only">Next</span>
<span aria-hidden="true">»</span>
</a>
</nav>
</div>
</div>
<!-- End::row-2 -->
import { Component } from '@angular/core';
import { Component, OnInit } from '@angular/core';
@Component({
selector: 'app-project-management',
......@@ -7,4 +8,22 @@ import { Component } from '@angular/core';
})
export class ProjectManagementComponent {
}
constructor() { }
projectList:any[]=[];
ngOnInit(): void {
// จำลองข้อมูลตัวอย่าง
this.projectList = [
{ id: 1, project_name: 'testtt', role: 'Admin' },
{ id: 2, project_name: 'test22', role: 'User' },
{ id: 3, project_name: '232323', role: 'Manager' }
];
}
deleteProject(){
}
}
<p>transection-product-management works!</p>
<div class="grid grid-cols-12 gap-6">
<div class="col-span-12">
<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="col-span-12 lg:col-span-4">
<div class="relative max-w-xs">
<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"
>
<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="Enter Your Text"
/>
</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="flex space-x-3 rtl:space-x-reverse lg:justify-end team-right"
>
<!-- <ng-select
class="ti-form-select"
name="team-choice"
id="team-choice"
placeholder="Status"
[(ngModel)]="selectedStatus"
>
<ng-option *ngFor="let option of statusOptions" [value]="option.value">
{{ option.label }}
</ng-option>
</ng-select>
</ng-option>
</ng-select> -->
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="box-body p-0">
<div class="-m-1.5 overflow-auto">
<div class="p-1.5 min-w-full inline-block align-middle">
<div class="overflow-auto">
<div
class="table border-collapse table-auto w-full divide-y divide-gray-200 dark:divide-white/10"
>
<div class="table-header-group">
<div class="table-row">
<div
class="table-cell px-6 py-3 text-start text-xs font-medium text-gray-500 uppercase"
>
Name
</div>
<div
class="table-cell px-6 py-3 text-start text-xs font-medium text-gray-500 uppercase"
>
Oder ID
</div>
<div
class="table-cell px-6 py-3 text-start text-xs font-medium text-gray-500 uppercase"
>
Address Project
</div>
<div
class="table-cell px-6 py-3 text-start text-xs font-medium text-gray-500 uppercase"
>
Status
</div>
<div
class="table-cell px-6 py-3 text-end text-xs font-medium text-gray-500 uppercase"
>
Action
</div>
</div>
</div>
<div
class="table-row-group divide-y divide-gray-200 bg-white dark:divide-white/10 dark:bg-black/20"
>
<div class="table-row">
<div
class="table-cell px-6 py-4 whitespace-nowrap text-sm font-medium text-gray-800 dark:text-gray-200"
>
John Brown
</div>
<div
class="table-cell px-6 py-4 whitespace-nowrap text-sm text-gray-800 dark:text-gray-200"
>
#52225
</div>
<div
class="table-cell px-6 py-4 whitespace-nowrap text-sm text-gray-800 dark:text-gray-200"
>
New York No. 1 Lake Park
</div>
<div
class="badge bg-warning/10 leading-none rounded-md text-warning"
>
Pending
</div>
<div
class="table-cell px-6 py-4 whitespace-nowrap text-end text-sm font-medium"
>
<a
routerLink="/page/ecommerce/borrow"
class="text-primary hover:text-primary"
>Details</a
>
</div>
</div>
<div class="table-row">
<div
class="table-cell px-6 py-4 whitespace-nowrap text-sm font-medium text-gray-800 dark:text-gray-200"
>
Jim Green
</div>
<div
class="table-cell px-6 py-4 whitespace-nowrap text-sm text-gray-800 dark:text-gray-200"
>
#52400
</div>
<div
class="table-cell px-6 py-4 whitespace-nowrap text-sm text-gray-800 dark:text-gray-200"
>
London No. 1 Lake Park
</div>
<div
class="badge bg-success/10 leading-none rounded-md text-success"
>
Approve
</div>
<div
class="table-cell px-6 py-4 whitespace-nowrap text-end text-sm font-medium"
>
<a
class="text-primary hover:text-primary"
href="javascript:void(0);"
>Details</a
>
</div>
</div>
<div class="table-row">
<div
class="table-cell px-6 py-4 whitespace-nowrap text-sm font-medium text-gray-800 dark:text-gray-200"
>
Joe Black
</div>
<div
class="table-cell px-6 py-4 whitespace-nowrap text-sm text-gray-800 dark:text-gray-200"
>
#52100
</div>
<div
class="table-cell px-6 py-4 whitespace-nowrap text-sm text-gray-800 dark:text-gray-200"
>
Sidney No. 1 Lake Park
</div>
<div
class="badge bg-danger/10 leading-none rounded-md text-danger"
>
Not Approve
</div>
<div
class="table-cell px-6 py-4 whitespace-nowrap text-end text-sm font-medium"
>
<a
class="text-primary hover:text-primary"
href="javascript:void(0);"
>Details</a
>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
......@@ -7,4 +7,17 @@ import { Component } from '@angular/core';
})
export class TransectionProductManagementComponent {
selectedStatus: any;
statusOptions = [
{ value: '0', label: 'Pending' },
{ value: '1', label: 'Approve' },
{ value: '2', label: 'Not Approve' }
];
constructor() { }
ngOnInit() {
}
}
<p>user-management works!</p>
<!-- 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"
>
Members
</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"
>
Members
</li>
</ol>
</div>
<!-- Page Header Close -->
<!-- Start::row-1 -->
<div class="grid grid-cols-12 gap-6">
<div class="col-span-12">
<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="col-span-12 lg:col-span-4">
<div class="relative max-w-xs">
<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"
>
<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="Enter Your Text"
/>
</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="flex space-x-3 rtl:space-x-reverse lg:justify-end team-right"
>
<div class="hs-tooltip ti-main-tooltip">
<a
href="javascript:void(0);"
class="team-add-btn m-0 hs-tooltip-toggle ti-btn ti-btn-primary"
routerLink="../profile/profilesettings"
>
Add Profile
<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>
</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="col-span-12 md:col-span-6 xxl:col-span-3 team-box"
*ngFor="let user of memberlist"
>
<div class="box overflow-hidden mb-0">
<div
class="block relative -mb-32 before:bg-primary/70 before:absolute before:w-full before:h-full"
>
<img
src="./assets/img/png-images/2.png"
alt=""
class="w-full h-32"
/>
</div>
<div class="box-body">
<div class="justify-center text-center relative">
<a
class="relative inline-block mt-8"
routerLink="/profile/home"
>
<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">
{{ user.member_firstname }}{{ user.member_lastname }}
</h2>
<p class="text-xs text-gray-500 dark:text-white/70">
{{ user.email }}
</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"
>{{ user.role }}</span
>
<div
class="flex space-x-1 rtl:space-x-reverse justify-center text-center"
></div>
</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
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
>
<a
class="team-remove ti-dropdown-item"
href="javascript:void(0);"
(click)="deleteMember(user.member_id)"
><i class="ri ri-delete-bin-6-line text-lg"></i
>Delete</a
>
</div> -->
</div>
</div>
</div>
<div
class="box-footer bg-gray-100 dark:bg-bgdark p-0 text-center"
>
<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
[routerLink]="['/profile/home', user.member_id]"
class="space-x-3"
><i class="ri-user-line"></i><span>Profile</span></a
>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<nav
class="flex justify-end items-center space-x-2 rtl:space-x-reverse my-4"
>
<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"
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-4 inline-flex items-center text-sm font-medium rounded-full"
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"
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"
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"
href="javascript:void(0);"
>
<span class="sr-only">Next</span>
<span aria-hidden="true">»</span>
</a>
</nav>
</div>
</div>
<!-- End::row-2 -->
import { Component } from '@angular/core';
import { Component,OnInit } from '@angular/core';
import { environment } from 'src/environments/environment';
import { HttpClient } from '@angular/common/http';
import { HttpErrorResponse } from '@angular/common/http';
@Component({
selector: 'app-user-management',
templateUrl: './user-management.component.html',
styleUrls: ['./user-management.component.scss']
})
export class UserManagementComponent {
memberlist: any[] = [];
ngOnInit(): void {
// จำลองข้อมูลตัวอย่าง
this.memberlist = [
{ id: 1, member_firstname: 'Alice', member_lastname: 'Smith', role: 'Admin' },
{ id: 2, member_firstname: 'Bob', member_lastname: 'Johnson', role: 'User' },
{ id: 3, member_firstname: 'Charlie', member_lastname: 'Brown', role: 'Manager' }
];
}
// constructor(private http: HttpClient) {}
// ngOnInit() {
// this.http.get<any[]>(environment.api + '/users')
// .subscribe(
// (data) => {
// this.memberlist = data;
// console.log('Data loaded:', this.memberlist);
// },
// (error) => {
// console.error('Error fetching data', error);
// }
// );
// }
// deleteMember(userId: number): void {
// if (confirm('Are you sure you want to delete this member?')) {
// this.http.delete(`${environment.api}/users/${userId}`).subscribe(
// (result: any) => {
// const index = this.memberlist.findIndex(user => user.user_id === userId);
// if (index !== -1) {
// this.memberlist.splice(index, 1);
// }
// console.log(result);
// },
// (error: HttpErrorResponse) => {
// alert(error.message);
// }
// );
// }}}
}
......@@ -17,6 +17,8 @@ import { LeafletModule } from '@asymmetrik/ngx-leaflet';
import { environment } from 'src/environments/environment';
import { ColorPickerModule } from 'ngx-color-picker';
import { HttpClientModule} from "@angular/common/http";
import { NgSelectModule } from '@ng-select/ng-select';
@NgModule({
declarations: [AppComponent, CustomLayoutComponent, ContentLayoutComponent],
imports: [
......@@ -33,7 +35,10 @@ import { HttpClientModule} from "@angular/common/http";
LeafletModule,
AngularFireModule.initializeApp(environment.firebase),
ColorPickerModule,
HttpClientModule
HttpClientModule,
NgSelectModule,
],
providers: [],
......
......@@ -82,6 +82,7 @@ export class LoginPageComponent {
}, (error) => {
this.disabled = '';
this.error = 'Username หรือ Password ไม่ถูกต้อง';
this.router.navigate(['/employee/home'])
})
}
......
......@@ -72,7 +72,7 @@ export class SidebarComponent {
}
ngOnInit() {
if(!true){
if(true){
this.menuitemsSubscribe$ = this.navServices.itemsAdmin.subscribe((items) => {
this.menuItems = items;
});
......
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