Commit b6a6c8fd by Your Name

Enter

parent 42d08acf
...@@ -44,8 +44,6 @@ export class EquipmentComponent implements OnInit { ...@@ -44,8 +44,6 @@ export class EquipmentComponent implements OnInit {
myFormRoom: FormGroup; myFormRoom: FormGroup;
myFormEquir: FormGroup; myFormEquir: FormGroup;
ctrl = new FormControl(null, Validators.required);
constructor(private modalService: NgbModal, private equirmentService: EquirmentService, private roomService: RoomService, private ItemDetailService : ItemDetailService, private RoomDetailService : RoomDetailService constructor(private modalService: NgbModal, private equirmentService: EquirmentService, private roomService: RoomService, private ItemDetailService : ItemDetailService, private RoomDetailService : RoomDetailService
,private fb: FormBuilder) { ,private fb: FormBuilder) {
...@@ -231,8 +229,6 @@ export class EquipmentComponent implements OnInit { ...@@ -231,8 +229,6 @@ export class EquipmentComponent implements OnInit {
this.RoomDetailService.addRoomDetail(this.modelRoomDetail); this.RoomDetailService.addRoomDetail(this.modelRoomDetail);
this.modalService.dismissAll(); this.modalService.dismissAll();
this.ngOnInit(); this.ngOnInit();
} }
} }
\ No newline at end of file
<div class="modal-header"> <div class="modal-content">
<div class="modal-header">
<h4 class="modal-title">รายละเอียดการจอง</h4> <h4 class="modal-title">รายละเอียดการจอง</h4>
<button type="button" class="close" aria-label="Close" (click)="activeModal.dismiss('Cross click')"> <button type="button" class="close" aria-label="Close" (click)="activeModal.dismiss('Cross click')">
<span aria-hidden="true">&times;</span> <span aria-hidden="true">&times;</span>
</button> </button>
</div> </div>
<div class=" modal-body"> <div class=" modal-body">
<div class=" row"> <div class=" row">
<div class=" col-md-12"> <div class=" col-md-12">
<div class=" form-group"> <div class=" form-group">
<label> ชื่อผู้จอง </label> <label> ชื่อผู้จอง </label>
<input readonly class=" form-control" type="text" value={{name}} style="color: aliceblue;" /> <input readonly class=" form-control" type="text" [value]="roomSelect.userName"
style="color: aliceblue;" />
</div> </div>
</div> </div>
</div> </div>
...@@ -17,24 +19,49 @@ ...@@ -17,24 +19,49 @@
<div class=" col-md-12"> <div class=" col-md-12">
<div class=" form-group"> <div class=" form-group">
<label> เบอร์โทร </label> <label> เบอร์โทร </label>
<input readonly class=" form-control" type="text" value={{telephone}} style="color: aliceblue;" /> <input readonly class=" form-control" type="text" value={{roomSelect.rTelephone}}
style="color: aliceblue;" />
</div> </div>
</div> </div>
</div> </div>
<div class="row"> <div class="row">
<div class="col-sm-12 mb-1"> <div class="col-sm-12 mb-1">
<label for="exampleFormControlSelect1">ชื่อห้อง</label> <label for="exampleFormControlSelect1">ชื่อห้อง</label>
<input readonly class="form-control" type="text" value={{rName}} style="color: aliceblue;"> <input readonly class="form-control" type="text" value={{roomSelect.room.rName}}
style="color: aliceblue;">
</div>
</div>
<div class="row">
<div class="col-6 mb-1">
<label for="exampleFormControlSelect1">วันที่เริ่มต้น</label>
<input readonly class="form-control" type="date" value={{roomSelect.sDate}} style="color: aliceblue;">
</div>
<div class="col-6 mb-1">
<label readonly for="exampleFormControlSelect1">วันที่สิ้นสุด</label>
<input readonly class="form-control" type="date" value={{roomSelect.eDate}} style="color: aliceblue;">
</div> </div>
</div> </div>
<div class="row"> <div class="row">
<div class="col-12 mb-1">
<div class=" form-check">
<label class=" form-check-label">
<input class=" form-check" type="checkbox" [checked]='roomSelect.allDay' />
<span class=" form-check-sign">
<span class="check">ทั้งวัน</span>
</span>
</label>
</div>
</div>
</div>
<div class="row" disabled='roomSelect.allDay.valid'>
<div class="col-6 mb-1"> <div class="col-6 mb-1">
<label for="exampleFormControlSelect1">เวลาที่เริ่มต้น</label> <label for="exampleFormControlSelect1">เวลาที่เริ่มต้น</label>
<input readonly class="form-control" type="time" value={{sTime}} style="color: aliceblue;"> <input readonly class="form-control" type="time" value={{roomSelect.sTime}} style="color: aliceblue;">
</div> </div>
<div class="col-6 mb-1"> <div class="col-6 mb-1">
<label readonly for="exampleFormControlSelect1">เวลาที่สิ้นสุด</label> <label readonly for="exampleFormControlSelect1">เวลาที่สิ้นสุด</label>
<input readonly class="form-control" type="time" value={{eTime}} style="color: aliceblue;"> <input readonly class="form-control" type="time" value={{roomSelect.eTime}} style="color: aliceblue;">
</div>
</div> </div>
</div> </div>
</div> </div>
\ No newline at end of file
import { Component, Input, OnInit, ViewChild } from '@angular/core'; import { Component, Input, OnInit, SimpleChanges, ViewChild } from '@angular/core';
import { FullCalendarComponent, CalendarOptions } from '@fullcalendar/angular'; import { FullCalendarComponent, CalendarOptions } from '@fullcalendar/angular';
import { NgbDate, NgbCalendar, NgbDateParserFormatter, NgbNavChangeEvent, NgbModal, ModalDismissReasons, NgbActiveModal } from '@ng-bootstrap/ng-bootstrap'; import { NgbDate, NgbCalendar, NgbDateParserFormatter, NgbNavChangeEvent, NgbModal, ModalDismissReasons, NgbActiveModal } from '@ng-bootstrap/ng-bootstrap';
import { Equirment } from 'src/app/models/equirment.model'; import { Equirment } from 'src/app/models/equirment.model';
...@@ -9,7 +9,6 @@ import { MyRoom } from 'src/app/models/rooms.model'; ...@@ -9,7 +9,6 @@ import { MyRoom } from 'src/app/models/rooms.model';
import { EquirmentService } from 'src/app/service/equirment.service'; import { EquirmentService } from 'src/app/service/equirment.service';
import { RoomService } from 'src/app/service/room.service'; import { RoomService } from 'src/app/service/room.service';
import { RoomDetail } from 'src/app/models/RoomDetail.model'; import { RoomDetail } from 'src/app/models/RoomDetail.model';
import { FormControl, FormGroup } from '@angular/forms';
@Component({ @Component({
selector: 'ngbd-modal-content', selector: 'ngbd-modal-content',
...@@ -17,13 +16,26 @@ import { FormControl, FormGroup } from '@angular/forms'; ...@@ -17,13 +16,26 @@ import { FormControl, FormGroup } from '@angular/forms';
}) })
export class NgbdModalContent { export class NgbdModalContent {
@Input() name; @Input() roomSelect: RoomDetail;
telephone; telephone;
rName; rName;
sTime; sTime;
eTime; eTime;
sDate;
eDate;
allDay;
modelItemDetail = new ItemDetail();
modelRoomDetail = new RoomDetail();
constructor(public activeModal: NgbActiveModal) {
console.log("name", this.roomSelect)
}
ngOnChanges(changes: SimpleChanges) {
console.log("sssssssssss", this.roomSelect)
}
constructor(public activeModal: NgbActiveModal) { }
} }
@Component({ @Component({
...@@ -36,8 +48,11 @@ export class NgbdModalLendContent { ...@@ -36,8 +48,11 @@ export class NgbdModalLendContent {
telephone; telephone;
eqName; eqName;
quantity; quantity;
sDate;
constructor(public activeModal: NgbActiveModal) { } constructor(public activeModal: NgbActiveModal) {
}
} }
@Component({ @Component({
...@@ -105,10 +120,6 @@ export class HomePageComponent implements OnInit { ...@@ -105,10 +120,6 @@ export class HomePageComponent implements OnInit {
closeResult = ''; closeResult = '';
myFormRoom: FormGroup;
myFormEquir: FormGroup;
calendarRoom: CalendarOptions = { calendarRoom: CalendarOptions = {
initialView: 'dayGridMonth', initialView: 'dayGridMonth',
dateClick: this.handleDateClick.bind(this), // bind is important! dateClick: this.handleDateClick.bind(this), // bind is important!
...@@ -235,16 +246,16 @@ export class HomePageComponent implements OnInit { ...@@ -235,16 +246,16 @@ export class HomePageComponent implements OnInit {
locale: "th", locale: "th",
events: this.eventRoom, events: this.eventRoom,
eventClick: this.handleDateClick.bind(this), eventClick: this.handleDateClick.bind(this),
// this.selectedRoomDetail = info.event.extendedProps; // this.selectedRoomDetail = info.event.extendedProps;
// console.log(this.selectedRoomDetail) // console.log(this.selectedRoomDetail)
// this.test(); // this.test();
// // alert('Coordinates: ' + info.jsEvent.pageX + ',' + info.jsEvent.pageY); // // alert('Coordinates: ' + info.jsEvent.pageX + ',' + info.jsEvent.pageY);
// // alert('View: ' + info.view.type); // // alert('View: ' + info.view.type);
// // // change the border color just for fun // // // change the border color just for fun
// // info.el.style.borderColor = 'red'; // // info.el.style.borderColor = 'red';
// } // }
}; };
this.calendarEquirment = { this.calendarEquirment = {
...@@ -257,7 +268,7 @@ export class HomePageComponent implements OnInit { ...@@ -257,7 +268,7 @@ export class HomePageComponent implements OnInit {
}; };
} }
test(){ test() {
alert("sssssssss"); alert("sssssssss");
} }
...@@ -269,25 +280,23 @@ export class HomePageComponent implements OnInit { ...@@ -269,25 +280,23 @@ export class HomePageComponent implements OnInit {
} }
eventShow() { eventShow() {
this.listRoomDetail = this.RoomDetailService.getListRoomDetail();
const modalRef = this.modalService.open(NgbdModalContent); const modalRef = this.modalService.open(NgbdModalContent);
modalRef.componentInstance.name = this.selectedRoomDetail.userName; modalRef.componentInstance.roomSelect = this.selectedRoomDetail;
modalRef.componentInstance.telephone = this.selectedRoomDetail.rTelephone; // modalRef.componentInstance.telephone = this.selectedRoomDetail.rTelephone;
modalRef.componentInstance.rName = this.selectedRoomDetail.room.rName; // modalRef.componentInstance.rName = this.selectedRoomDetail.room.rName;
modalRef.componentInstance.sTime = this.selectedRoomDetail.sTime; // modalRef.componentInstance.sTime = this.selectedRoomDetail.sTime;
modalRef.componentInstance.eTime = this.selectedRoomDetail.eTime; // modalRef.componentInstance.eTime = this.selectedRoomDetail.eTime;
// modalRef.componentInstance.sDate = this.selectedRoomDetail.sDate;
// modalRef.componentInstance.eDate = this.selectedRoomDetail.eDate;
// modalRef.componentInstance.allDay = this.selectedRoomDetail.allDay;
} }
eventLendShow() { eventLendShow() {
this.listItemDetail = this.ItemDetailService.getListItemDetail();
const modalRef = this.modalService.open(NgbdModalLendContent); const modalRef = this.modalService.open(NgbdModalLendContent);
modalRef.componentInstance.name = this.selectedItemDetail.userName; modalRef.componentInstance.name = this.selectedItemDetail.userName;
modalRef.componentInstance.telephone = this.selectedItemDetail.eTelephone; modalRef.componentInstance.telephone = this.selectedItemDetail.eTelephone;
modalRef.componentInstance.eqName = this.selectedItemDetail.equirment.eqName; modalRef.componentInstance.eqName = this.selectedItemDetail.equirment.eqName;
modalRef.componentInstance.quantity = this.selectedItemDetail.Quantity; modalRef.componentInstance.quantity = this.selectedItemDetail.Quantity;
modalRef.componentInstance.sDate = this.selectedRoomDetail.sDate;
} }
} }
\ No newline at end of file
function content(content: any, arg1: { ariaLabelledBy: string; }) {
throw new Error('Function not implemented.');
}
...@@ -20,19 +20,40 @@ export class RoomDetailService { ...@@ -20,19 +20,40 @@ export class RoomDetailService {
rDesc: "จำนวนคน 25 คน", rDesc: "จำนวนคน 25 คน",
}, },
userName: 'เกม', userName: 'เกม',
sDate: '2021-12-15', sDate: '2021-12-16',
eDate: '2021-12-15', eDate: '2021-12-16',
sTime: '22:30', sTime: '22:30',
eTime: '22:30', eTime: '22:30',
rStatus: 0, rStatus: 0,
rTelephone: '0123456789', rTelephone: '0123456789',
email: 'qwerty@qwerty', email: 'qwerty@qwerty',
remark: 'test', remark: 'test',
allDay: false allDay: true
}, },
{ {
id: 2, id: 2,
room: { room: {
rId: 1,
rName: "ห้องเดียว",
rType: "ห้อง",
rPic: "assets/img/room.jpg",
roomLimit: 25,
rDesc: "จำนวนคน 25 คน",
},
userName: 'ริว',
sDate: '2021-12-16',
eDate: '2021-12-16',
sTime: '22:30',
eTime: '22:30',
rStatus: 0,
rTelephone: '0123456789',
email: 'qwerty@qwerty',
remark: 'test',
allDay: false
},
{
id: 3,
room: {
rId: 2, rId: 2,
rName: "ห้องคู่", rName: "ห้องคู่",
rType: "ห้อง", rType: "ห้อง",
......
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