Commit 37fd070b by Chanachai

Edit ภาษาและaddปุ่มค้นหา

parent 51383543
......@@ -75,13 +75,13 @@
<thead>
<tr>
<th scope="col">#</th>
<th scope="col">Catagory</th>
<th scope="col">Type</th>
<th scope="col">Detail</th>
<th scope="col">Name</th>
<th scope="col">Start-Date</th>
<th scope="col">End-Date</th>
<th scope="col">Status</th>
<th scope="col">หมวดหมู่</th>
<th scope="col">ประเภท</th>
<th scope="col">รายละเอียด</th>
<th scope="col">ชื่อ</th>
<th scope="col">วันที่เริ่มต้น</th>
<th scope="col">วันที่สิ้นสุด</th>
<th scope="col">สถานะ</th>
</tr>
</thead>
<tbody>
......@@ -134,14 +134,14 @@
<thead>
<tr>
<th scope="col">#</th>
<th scope="col">Catagory</th>
<th scope="col">Type</th>
<th scope="col">Detail</th>
<th scope="col">Name</th>
<th scope="col">Start-Date</th>
<th scope="col">End-Date</th>
<th scope="col">Quantity</th>
<th scope="col">Status</th>
<th scope="col">หมวดหมู่</th>
<th scope="col">ประเภท</th>
<th scope="col">รายละเอียด</th>
<th scope="col">ชื่อ</th>
<th scope="col">วันที่เริ่มต้น</th>
<th scope="col">วันที่สิ้นสุด</th>
<th scope="col">จำนวน</th>
<th scope="col">สถานะ</th>
</tr>
</thead>
<tbody>
......
......@@ -38,7 +38,7 @@
<div class="text-center">
<div class="d-grid gap-2 a-md-flex justify-content-md-end ">
<button class="btn btn-sm btn-outline-primary"
(click)="open(Room)">ยืม</button>
(click)="open(Room)">จอง</button>
<button class="btn btn-sm btn-primary" type="button">ยกเลิก</button>
</div>
</div>
......@@ -82,7 +82,7 @@
<div class=" row">
<div class=" col-md-12">
<div class=" form-group">
<label> Name </label>
<label> ชื่อ </label>
<input class=" form-control" placeholder="" type="text"
value="" />
</div>
......@@ -91,11 +91,11 @@
<div class=" row">
<div class=" col-md-6 mb-2">
<div class=" form-group">
<label> Category </label>
<label> หมวดหมู่ </label>
<br>
<select class="form-select"
aria-label="Default select example">
<option selected>Open this select type</option>
<option selected>เลือกหมวดหมู่</option>
<option value="4">IT</option>
<option value="5">Company</option>
</select>
......@@ -105,7 +105,7 @@
<div class=" row">
<div class=" col-md-12">
<div class=" form-group">
<label> Details </label>
<label> รายละเอียด</label>
<textarea class="form-control"
id="exampleFormControlTextarea1" rows="3"
placeholder="......"></textarea>
......@@ -145,7 +145,7 @@
<div class="text-center">
<div class="d-grid gap-2 a-md-flex justify-content-md-end">
<button class="btn btn-sm btn-outline-primary"
(click)="open(lend)">ยืม</button>
(click)="open(lend)">เบิก</button>
<button class="btn btn-sm btn-primary" type="button">ยกเลิก</button>
</div>
</div>
......@@ -187,7 +187,7 @@
<div class=" row">
<div class=" col-md-12">
<div class=" form-group">
<label> Name </label>
<label> ชื่อ </label>
<input class=" form-control" placeholder="" type="text" value="" />
</div>
</div>
......@@ -195,12 +195,12 @@
<div class=" row">
<div class=" col-md-6 mb-2">
<div class=" form-group">
<label> Type </label>
<label> ประเภท </label>
<br>
<select class="form-select" aria-label="Default select example">
<option selected>Open this select type</option>
<option value="1">Rooms</option>
<option value="2">Cars</option>
<option selected>เลือกประเภท</option>
<option value="1">ห้อง</option>
<option value="2">รถ</option>
</select>
</div>
</div>
......@@ -208,7 +208,7 @@
<div class=" row">
<div class=" col-md-12">
<div class=" form-group">
<label> Details </label>
<label> รายละเอียด</label>
<textarea class="form-control" id="exampleFormControlTextarea1" rows="3"
placeholder="......"></textarea>
</div>
......@@ -230,7 +230,7 @@
<div class=" col-md-12">
<div class="card">
<div class=" card-header">
<h5 class=" title">Booking</h5>
<h5 class=" title">การจอง</h5>
</div>
<div class=" card-body">
<form>
......@@ -242,6 +242,14 @@
</div>
</div>
</div>
<div class=" row">
<div class=" col-md-12">
<div class=" form-group">
<label> เบอร์โทร </label>
<input class=" form-control" placeholder="" type="text" value="" />
</div>
</div>
</div>
<div class="row">
<div class="col-sm-12 mb-1">
<label for="exampleFormControlSelect1">ชื่อห้อง</label>
......@@ -256,7 +264,7 @@
</div>
<div class="row">
<div class="col-6 mb-1">
<label for="exampleFormControlSelect1">วันที่เริ่มใช้</label>
<label for="exampleFormControlSelect1">วันที่เริ่มต้น</label>
<input type="date" class="form-control" value="">
</div>
<div class="col-6 mb-1">
......@@ -274,6 +282,15 @@
<ngb-timepicker [(ngModel)]="time"></ngb-timepicker>
</div>
</div>
<div class=" row">
<div class=" col-md-12">
<div class=" form-group">
<label> หมายเหตุ </label>
<textarea class="form-control" id="exampleFormControlTextarea1" rows="3"
placeholder="......"></textarea>
</div>
</div>
</div>
</form>
</div>
<div class=" card-footer">
......@@ -300,6 +317,14 @@
</div>
</div>
</div>
<div class=" row">
<div class=" col-md-12">
<div class=" form-group">
<label> เบอร์โทร </label>
<input class=" form-control" placeholder="" type="text" value="" />
</div>
</div>
</div>
<div class="row">
<div class="col-sm-12 mb-1">
<label for="exampleFormControlSelect1">ชื่ออุปกรณ์</label>
......@@ -314,7 +339,7 @@
</div>
<div class="row">
<div class="col-6 mb-1">
<label for="exampleFormControlSelect1">วันที่เริ่มใช้</label>
<label for="exampleFormControlSelect1">วันที่เริ่มต้น</label>
<input type="date" class="form-control" value="">
</div>
<div class="col-6 mb-1">
......@@ -339,6 +364,15 @@
[(ngModel)]="quantity" />
</div>
</div>
<div class=" row">
<div class=" col-md-12">
<div class=" form-group">
<label> หมายเหตุ </label>
<textarea class="form-control" id="exampleFormControlTextarea1" rows="3"
placeholder="......"></textarea>
</div>
</div>
</div>
</form>
</div>
<div class=" card-footer">
......
......@@ -7,13 +7,13 @@
<thead>
<tr>
<th scope="col">#</th>
<th scope="col">Catagory</th>
<th scope="col">Type</th>
<th scope="col">Detail</th>
<th scope="col">Name</th>
<th scope="col">Start-Date</th>
<th scope="col">End-Date</th>
<th scope="col">Quantity</th>
<th scope="col">หมวดหมู่</th>
<th scope="col">ประเภท</th>
<th scope="col">รายละเอียด</th>
<th scope="col">ชื่อ</th>
<th scope="col">วันที่เริ่มต้น</th>
<th scope="col">วันที่สิ้นสุด</th>
<th scope="col">จำนวน</th>
</tr>
</thead>
<tbody>
......@@ -26,7 +26,8 @@
<td>{{ country.sdate | date:'dd-MM-yyyy' }}</td>
<td>{{ country.edate | date:'dd-MM-yyyy' }}</td>
<td>
<button class="btn btn-primary btn-sm" (click)="_increamentQTY(item.productId._id,1)">+</button>
<button class="btn btn-primary btn-sm"
(click)="_increamentQTY(item.productId._id,1)">+</button>
{{ country.quantity }}
<button class="btn btn-primary btn-sm">-</button>
</td>
......
......@@ -76,13 +76,13 @@
<thead>
<tr>
<th scope="col">#</th>
<th scope="col">Catagory</th>
<th scope="col">Type</th>
<th scope="col">Detail</th>
<th scope="col">Name</th>
<th scope="col">Start-Date</th>
<th scope="col">End-Date</th>
<th scope="col">Status</th>
<th scope="col">หมวดหมู่</th>
<th scope="col">ประเภท</th>
<th scope="col">รายละเอียด</th>
<th scope="col">ชื่อ</th>
<th scope="col">วันที่เริ่มต้น</th>
<th scope="col">วันที่สิ้นสุด</th>
<th scope="col">สถานะ</th>
</tr>
</thead>
<tbody>
......@@ -95,6 +95,10 @@
<td>{{ country.sdate | date:'dd-MM-yyyy' }} {{ country.stime }}</td>
<td>{{ country.edate | date:'dd-MM-yyyy' }} {{ country.etime }}</td>
<td>{{ country.status }}</td>
<div class="col-auto align-self-sm-center">
<button type="button" class="btn btn-info btn-sm btn-circle "
style="line-height: 0px" (click)="open(Room)"><i class="fa fa-search"></i> </button>
</div>
</tr>
</tbody>
</table>
......@@ -129,14 +133,14 @@
<thead>
<tr>
<th scope="col">#</th>
<th scope="col">Catagory</th>
<th scope="col">Type</th>
<th scope="col">Detail</th>
<th scope="col">Name</th>
<th scope="col">Start-Date</th>
<th scope="col">End-Date</th>
<th scope="col">Quantity</th>
<th scope="col">Status</th>
<th scope="col">หมวดหมู่</th>
<th scope="col">ประเภท</th>
<th scope="col">รายละเอียด</th>
<th scope="col">ชื่อ</th>
<th scope="col">วันที่เริ่มใช้</th>
<th scope="col">วันที่สิ้นสุด</th>
<th scope="col">จำนวน</th>
<th scope="col">สถานะ</th>
</tr>
</thead>
<tbody>
......@@ -150,6 +154,10 @@
<td>{{ country.edate | date:'dd-MM-yyyy' }} {{ country.etime }}</td>
<td>{{ country.quantity }}</td>
<td>{{ country.status }}</td>
<div class="col-auto align-self-sm-center">
<button type="button" class="btn btn-info btn-sm btn-circle "
style="line-height: 0px" (click)="open(lend)"><i class="fa fa-search"></i> </button>
</div>
</tr>
</tbody>
</table>
......@@ -174,8 +182,163 @@
</li>
</ul>
<div [ngbNavOutlet]="nav"></div>
</div>
<ng-template #Room let-modal style="padding: 0; ">
<div class=" col-md-12">
<div class="card">
<div class=" card-header">
<h5 class=" title">การจอง</h5>
</div>
<div class=" card-body">
<form>
<div class=" row">
<div class=" col-md-12">
<div class=" form-group">
<label> ชื่อผู้จอง </label>
<input readonly class=" form-control" placeholder="" type="text" value="" />
</div>
</div>
</div>
<div class=" row">
<div class=" col-md-12">
<div class=" form-group">
<label> เบอร์โทร </label>
<input readonly class=" form-control" placeholder="" type="text" value="" />
</div>
</div>
</div>
<div class="row">
<div class="col-sm-12 mb-1">
<label for="exampleFormControlSelect1">ชื่อห้อง</label>
<input readonly class="form-control" type="text" value="{{item.rname}}">
</div>
</div>
<div class="row">
<div class="col-sm-12 mb-1">
<label for="exampleFormControlSelect1">รายละเอียด</label>
<input readonly class="form-control" type="text" value="{{item.rdecs}}">
</div>
</div>
<div class="row">
<div class="col-6 mb-1">
<label for="exampleFormControlSelect1">วันที่เริ่มต้น</label>
<input readonly type="date" class="form-control" value="">
</div>
<div class="col-6 mb-1">
<label for="exampleFormControlSelect1">วันที่สิ้นสุด</label>
<input readonly type="date" class="form-control" value="">
</div>
</div>
<div class="row">
<div class="col-6 mb-1">
<label for="exampleFormControlSelect1">เวลาที่เริ่มต้น</label>
<input readonly class="form-control" type="text" value="{{country.stime}}">
</div>
<div class="col-6 mb-1">
<label [readonly] for="exampleFormControlSelect1">เวลาที่สิ้นสุด</label>
<input readonly class="form-control" type="text" value="{{country.etime}}">
</div>
</div>
<div class=" row">
<div class=" col-md-12">
<div class=" form-group">
<label> หมายเหตุ </label>
<textarea readonly class="form-control" id="exampleFormControlTextarea1" rows="3"
placeholder="......"></textarea>
</div>
</div>
</div>
</form>
</div>
<div class=" card-footer">
<button class=" btn btn-fill btn-danger" type="submit">Save</button>
<button class=" btn btn-fill btn-danger" type="close">Cancel</button>
</div>
</div>
</div>
</ng-template>
<ng-template #lend let-modal style="padding: 0; ">
<div class=" col-md-12">
<div class="card">
<div class=" card-header">
<h5 class=" title">Lend Equirment</h5>
</div>
<div class=" card-body">
<form>
<div class=" row">
<div class=" col-sm-12 mb-1">
<div class=" form-group">
<label> ชื่อผู้จอง </label>
<input readonly class=" form-control" placeholder="" type="text" value="" />
</div>
</div>
</div>
<div class=" row">
<div class=" col-md-12">
<div class=" form-group">
<label> เบอร์โทร </label>
<input readonly class=" form-control" placeholder="" type="text" value="" />
</div>
</div>
</div>
<div class="row">
<div class="col-sm-12 mb-1">
<label for="exampleFormControlSelect1">ชื่ออุปกรณ์</label>
<input readonly class="form-control" type="text" value="{{item.rname}}">
</div>
</div>
<div class="row">
<div class="col-sm-12 mb-1">
<label for="exampleFormControlSelect1">รายละเอียดอุปกรณ์</label>
<input readonly class="form-control" type="text" value="{{item.rdecs}}">
</div>
</div>
<div class="row">
<div class="col-6 mb-1">
<label for="exampleFormControlSelect1">วันที่เริ่มต้น</label>
<input readonly type="date" class="form-control" value="">
</div>
<div class="col-6 mb-1">
<label for="exampleFormControlSelect1">วันที่สิ้นสุด</label>
<input readonly type="date" class="form-control" value="">
</div>
</div>
<div class="row">
<div class="col-6 mb-1">
<label for="exampleFormControlSelect1">เวลาที่เริ่มต้น</label>
<input readonly class="form-control" type="text" value="{{country.stime}}">
</div>
<div class="col-6 mb-1">
<label for="exampleFormControlSelect1">เวลาที่สิ้นสุด</label>
<input readonly class="form-control" type="text" value="{{country.etime}}">
</div>
</div>
<div class=" row">
<div class=" col-sm-6 mb-1">
<label for="changequantity">จำนวน</label>
<input readonly id="changequantity" type="number" class="form-control form-control-sm"
[(ngModel)]="quantity" />
</div>
</div>
<div class=" row">
<div class=" col-md-12">
<div class=" form-group">
<label> หมายเหตุ </label>
<textarea readonly class="form-control" id="exampleFormControlTextarea1" rows="3"
placeholder="......"></textarea>
</div>
</div>
</div>
</form>
</div>
<div class=" card-footer">
<button class=" btn btn-fill btn-danger" type="submit">Save</button>
<button class=" btn btn-fill btn-danger" type="close">Cancel</button>
</div>
</div>
</div>
</ng-template>
</div>
\ No newline at end of file
import { Component, OnInit } from '@angular/core';
import { NgbDate, NgbCalendar, NgbDateParserFormatter } from '@ng-bootstrap/ng-bootstrap';
import { NgbModal, ModalDismissReasons } from '@ng-bootstrap/ng-bootstrap';
@Component({
selector: 'app-pending',
......@@ -36,6 +37,8 @@ export class PendingComponent implements OnInit {
page = 1;
pageSize = 10;
closeResult = '';
countries: Country[] = [
{
catagory: 'string',
......@@ -68,7 +71,7 @@ export class PendingComponent implements OnInit {
fromDate: NgbDate | null;
toDate: NgbDate | null;
constructor(private calendar: NgbCalendar, public formatter: NgbDateParserFormatter) {
constructor(private calendar: NgbCalendar, public formatter: NgbDateParserFormatter , private modalService: NgbModal) {
this.fromDate = calendar.getToday();
this.toDate = calendar.getNext(calendar.getToday(), 'd', 10);
this.refreshCountries();
......@@ -91,6 +94,24 @@ export class PendingComponent implements OnInit {
}
}
open(content) {
this.modalService.open(content, { ariaLabelledBy: 'modal-basic-title' }).result.then((result) => {
this.closeResult = `Closed with: ${result}`;
}, (reason) => {
this.closeResult = `Dismissed ${this.getDismissReason(reason)}`;
});
}
private getDismissReason(reason: any): string {
if (reason === ModalDismissReasons.ESC) {
return 'by pressing ESC';
} else if (reason === ModalDismissReasons.BACKDROP_CLICK) {
return 'by clicking on a backdrop';
} else {
return `with: ${reason}`;
}
}
isHovered(date: NgbDate) {
return this.fromDate && !this.toDate && this.hoveredDate && date.after(this.fromDate) && date.before(this.hoveredDate);
}
......
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