Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
B
BookingMyHrManagement
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Registry
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Chanachai
BookingMyHrManagement
Commits
b6a6c8fd
Commit
b6a6c8fd
authored
Dec 23, 2021
by
Your Name
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Enter
parent
42d08acf
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
125 additions
and
69 deletions
+125
-69
equipment.component.ts
src/app/pages/equipment/equipment.component.ts
+2
-5
home-page-calendar.component.html
src/app/pages/home-page/home-page-calendar.component.html
+59
-31
home-page.component.ts
src/app/pages/home-page/home-page.component.ts
+40
-30
room-detail.service.ts
src/app/service/room-detail.service.ts
+24
-3
No files found.
src/app/pages/equipment/equipment.component.ts
View file @
b6a6c8fd
...
@@ -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
src/app/pages/home-page/home-page-calendar.component.html
View file @
b6a6c8fd
<div
class=
"modal-header"
>
<div
class=
"modal-content"
>
<h4
class=
"modal-title"
>
รายละเอียดการจอง
</h4>
<div
class=
"modal-header"
>
<button
type=
"button"
class=
"close"
aria-label=
"Close"
(
click
)="
activeModal
.
dismiss
('
Cross
click
')"
>
<h4
class=
"modal-title"
>
รายละเอียดการจอง
</h4>
<span
aria-hidden=
"true"
>
×
</span>
<button
type=
"button"
class=
"close"
aria-label=
"Close"
(
click
)="
activeModal
.
dismiss
('
Cross
click
')"
>
</button>
<span
aria-hidden=
"true"
>
×
</span>
</div>
</button>
<div
class=
" modal-body"
>
</div>
<div
class=
" row"
>
<div
class=
" modal-body"
>
<div
class=
" col-md-12"
>
<div
class=
" row"
>
<div
class=
" form-group"
>
<div
class=
" col-md-12"
>
<label>
ชื่อผู้จอง
</label>
<div
class=
" form-group"
>
<input
readonly
class=
" form-control"
type=
"text"
value=
{{name}}
style=
"color: aliceblue;"
/>
<label>
ชื่อผู้จอง
</label>
<input
readonly
class=
" form-control"
type=
"text"
[
value
]="
roomSelect
.
userName
"
style=
"color: aliceblue;"
/>
</div>
</div>
</div>
</div>
</div>
</div>
<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=
{{roomSelect.rTelephone}}
<input
readonly
class=
" form-control"
type=
"text"
value=
{{telephone}}
style=
"color: aliceblue;"
/>
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=
{{roomSelect.room.rName}}
<input
readonly
class=
"form-control"
type=
"text"
value=
{{rName}}
style=
"color: aliceblue;"
>
style=
"color: aliceblue;"
>
</div>
</div>
</div>
</div>
<div
class=
"row"
>
<div
class=
"row"
>
<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=
"date"
value=
{{roomSelect.sDate}}
style=
"color: aliceblue;"
>
<input
readonly
class=
"form-control"
type=
"time"
value=
{{sTime}}
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
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>
<div
class=
"col-6 mb-1"
>
<div
class=
"row"
disabled=
'roomSelect.allDay.valid'
>
<label
readonly
for=
"exampleFormControlSelect1"
>
เวลาที่สิ้นสุด
</label>
<div
class=
"col-6 mb-1"
>
<input
readonly
class=
"form-control"
type=
"time"
value=
{{eTime}}
style=
"color: aliceblue;"
>
<label
for=
"exampleFormControlSelect1"
>
เวลาที่เริ่มต้น
</label>
<input
readonly
class=
"form-control"
type=
"time"
value=
{{roomSelect.sTime}}
style=
"color: aliceblue;"
>
</div>
<div
class=
"col-6 mb-1"
>
<label
readonly
for=
"exampleFormControlSelect1"
>
เวลาที่สิ้นสุด
</label>
<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
src/app/pages/home-page/home-page.component.ts
View file @
b6a6c8fd
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.'
);
}
src/app/service/room-detail.service.ts
View file @
b6a6c8fd
...
@@ -20,19 +20,40 @@ export class RoomDetailService {
...
@@ -20,19 +20,40 @@ export class RoomDetailService {
rDesc
:
"จำนวนคน 25 คน"
,
rDesc
:
"จำนวนคน 25 คน"
,
},
},
userName
:
'เกม'
,
userName
:
'เกม'
,
sDate
:
'2021-12-1
5
'
,
sDate
:
'2021-12-1
6
'
,
eDate
:
'2021-12-1
5
'
,
eDate
:
'2021-12-1
6
'
,
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
:
fals
e
allDay
:
tru
e
},
},
{
{
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
:
"ห้อง"
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment