001.
<?php
002.
003.
$hostname
=
'localhost'
;
004.
$username
=
'root'
;
005.
$password
=
'root'
;
006.
$databaseName
=
'booking_room'
;
007.
008.
$connect
= mysqli_connect(
$hostname
,
$username
,
$password
,
$databaseName
);
009.
010.
$query1
=
'SELECT * FROM tb_room'
;
011.
$query2
=
'SELECT * FROM tb_group'
;
012.
013.
$result1
= mysqli_query(
$connect
,
$query1
);
014.
$result2
= mysqli_query(
$connect
,
$query2
);
015.
016.
$roomname
=
''
;
017.
while
(
$row2
= mysqli_fetch_array(
$result1
)) {
018.
$roomid
=
$roomid
.
"<option>$row2[0]</option>"
;
019.
$roomname
=
$roomname
.
"<option>$row2[1]</option>"
;
020.
}
021.
022.
$groupwork
=
''
;
023.
while
(
$row2
= mysqli_fetch_array(
$result2
)) {
024.
$grouid
=
$groupid
.
"<option>$row2[0]</option>"
;
025.
$groupwork
=
$groupwork
.
"<option>$row2[1]</option>"
;
026.
}
027.
028.
?>
029.
<!doctype html>
030.
<html>
031.
<head>
032.
<meta name=
"viewport"
content=
"width=device-width, initial-scale=1"
>
033.
<style>
034.
body {
035.
font-family: Arial, Helvetica, sans-serif;
036.
background-color: black;
037.
}
038.
039.
* {
040.
box-sizing: border-box;
041.
}
042.
043.
044.
.container {
045.
padding: 16px;
046.
background-color: white;
047.
}
048.
049.
050.
input[type=text], input[type=password] {
051.
width: 100%;
052.
padding: 15px;
053.
margin: 5px 0 22px 0;
054.
display: inline-block;
055.
border: none;
056.
background: #f1f1f1;
057.
}
058.
059.
input[type=text]:focus, input[type=password]:focus {
060.
background-color: #ddd;
061.
outline: none;
062.
}
063.
064.
065.
hr {
066.
border: 1px solid #f1f1f1;
067.
margin-bottom: 25px;
068.
}
069.
070.
071.
.registerbtn {
072.
background-color: #4CAF50;
073.
color: white;
074.
padding: 16px 20px;
075.
margin: 8px 0;
076.
border: none;
077.
cursor: pointer;
078.
width: 100%;
079.
opacity: 0.9;
080.
}
081.
082.
.registerbtn:hover {
083.
opacity: 1;
084.
}
085.
086.
087.
a {
088.
color: dodgerblue;
089.
}
090.
091.
092.
.signin {
093.
background-color: #f1f1f1;
094.
text-align: center;
095.
}
096.
</style>
097.
<meta charset=
"UTF-8"
>
098.
<title>Booking Rooming - เพิ่มการจองข้อมูลห้อง</title>
099.
</head>
100.
101.
<body>
102.
<div
class
=
"container"
>
103.
<form action=
"booking_save.php"
name=
"frmAdd"
method=
"post"
>
104.
<table width=
"552"
border=
"0"
align=
"center"
>
105.
<tbody>
106.
<tr>
107.
<th colspan=
"2"
scope=
"col"
>รายละเอียดการจอง</th>
108.
</tr>
109.
<tr>
110.
<th width=
"162"
scope=
"row"
>ชื่อห้องที่จอง</th>
111.
<td width=
"374"
>
112.
113.
<select>
114.
<?php
echo
$roomname
; ?>
115.
</select>
116.
117.
</td>
118.
</tr>
119.
<tr>
120.
<th scope=
"row"
>วันที่จอง</th>
121.
<td><input name=
"date"
type=
"date"
id=
"date"
autocomplete=
"on"
></td>
122.
</tr>
123.
<tr>
124.
<th scope=
"row"
>เริ่ม</th>
125.
<td>
126.
<select name=
"ddlstart"
id=
"time_start"
>
127.
<option value=
"07:00"
>07:00</option>
128.
<option value=
"07:30"
>07:30</option>
129.
<option value=
"08:00"
>08:00</option>
130.
<option value=
"08:30"
>08:30</option>
131.
<option value=
"09:00"
>09:00</option>
132.
<option value=
"09:30"
>09:30</option>
133.
<option value=
"10:00"
>10:00</option>
134.
<option value=
"10:30"
>10:30</option>
135.
<option value=
"11:00"
>11:00</option>
136.
<option value=
"11:30"
>11:30</option>
137.
<option value=
"12:00"
>12:00</option>
138.
<option value=
"12:30"
>12:30</option>
139.
<option value=
"13:00"
>13:00</option>
140.
<option value=
"13:30"
>13:30</option>
141.
<option value=
"14:00"
>14:00</option>
142.
<option value=
"14:30"
>14:30</option>
143.
<option value=
"15:00"
>15:00</option>
144.
<option value=
"15:30"
>15:30</option>
145.
<option value=
"16:00"
>16:00</option>
146.
<option value=
"16:30"
>16:30</option>
147.
<option value=
"17:00"
>17:00</option>
148.
</select>
149.
</td>
150.
</tr>
151.
<tr>
152.
<th scope=
"row"
>สิ้นสุด</th>
153.
<td>
154.
<select name=
"ddlend"
id=
"time_end"
>
155.
<option value=
"08:00"
>08:00</option>
156.
<option value=
"08:30"
>08:30</option>
157.
<option value=
"09:00"
>09:00</option>
158.
<option value=
"09:30"
>09:30</option>
159.
<option value=
"10:00"
>10:00</option>
160.
<option value=
"10:30"
>10:30</option>
161.
<option value=
"11:00"
>11:00</option>
162.
<option value=
"11:30"
>11:30</option>
163.
<option value=
"12:00"
>12:00</option>
164.
<option value=
"12:30"
>12:30</option>
165.
<option value=
"13:00"
>13:00</option>
166.
<option value=
"13:30"
>13:30</option>
167.
<option value=
"14:00"
>14:00</option>
168.
<option value=
"14:30"
>14:30</option>
169.
<option value=
"15:00"
>15:00</option>
170.
<option value=
"15:30"
>15:30</option>
171.
<option value=
"16:00"
>16:00</option>
172.
<option value=
"16:30"
>16:30</option>
173.
<option value=
"17:00"
>17:00</option>
174.
</select>
175.
</td>
176.
</tr>
177.
<tr>
178.
<th scope=
"row"
>หัวข้อการประชุม</th>
179.
<td><input type=
"text"
name=
"title"
id=
"title"
placeholder=
"หัวข้อการประชุม"
></td>
180.
</tr>
181.
<tr>
182.
<th scope=
"row"
>กลุ่มงาน</th>
183.
<td>
184.
<select >
185.
<?php
echo
$groupwork
; ?>
186.
</select>
187.
</td>
188.
</tr>
189.
<tr>
190.
<th scope=
"row"
>ชื่อผู้จอง</th>
191.
<td><input type=
"text"
name=
"namelast"
id=
"namelast"
placeholder=
"กรุณาใส่ชื่อผู้จอง"
></td>
192.
</tr>
193.
<tr>
194.
<th scope=
"row"
>จำนวนคนเข้าร่วม</th>
195.
<td><input type=
"text"
name=
"people"
id=
"people"
placeholder=
"จำนวนบุคคลที่เข้าร่วม"
></td>
196.
</tr>
197.
<tr>
198.
<th colspan=
"2"
scope=
"row"
>อุปกรณ์อำนวยความสะดวก</th>
199.
</tr>
200.
<tr>
201.
<th scope=
"row"
>เครื่องเสียง</th>
202.
<td color=
"red"
><input type=
"checkbox"
name=
"checksound"
id=
"checksound"
value=
"1"
> *ติ๊กเพื่อใช้อุปกรณ์</td>
203.
</tr>
204.
<tr>
205.
<th scope=
"row"
>คอมพิวเตอร์</th>
206.
<td><input type=
"checkbox"
name=
"checkcomputer"
id=
"checkcomputer"
value=
"1"
> *ติ๊กเพื่อใช้อุปกรณ์</td>
207.
</tr>
208.
<tr>
209.
<th scope=
"row"
>โปรเจคเตอร์</th>
210.
<td><input type=
"checkbox"
name=
"checkpro"
id=
"checkpro"
value=
"1"
> *ติ๊กเพื่อใช้อุปกรณ์</td>
211.
</tr>
212.
<tr>
213.
<th scope=
"row"
>เครื่องฉายสามมิติ</th>
214.
<td><input type=
"checkbox"
name=
"check3d"
id=
"check3d"
value=
"1"
> *ติ๊กเพื่อใช้อุปกรณ์</td>
215.
</tr>
216.
<tr>
217.
<th scope=
"row"
>โต๊ะ</th>
218.
<td><input type=
"text"
name=
"txttable"
id=
"txttable"
placeholder=
"โปรดระบุจำนวน"
></td>
219.
</tr>
220.
<tr>
221.
<th scope=
"row"
>เก้าอี้</th>
222.
<td><input type=
"text"
name=
"txtchiar"
id=
"txtchiar"
placeholder=
"โปรดระบุจำนวน"
></td>
223.
</tr>
224.
<tr>
225.
<th scope=
"row"
>จำนวนอาหารว่าง</th>
226.
<td><input type=
"text"
name=
"txtfood"
id=
"txtfood"
placeholder=
"ถ้ามีโปรดระบุ"
></td>
227.
</tr>
228.
<tr>
229.
<th scope=
"row"
>อื่นๆ</th>
230.
<td><input type=
"text"
name=
"txtorther"
id=
"txtorther"
placeholder=
"*ถ้ามีโปรดระบุ"
> </td>
231.
</tr>
232.
<tr>
233.
<th colspan=
"2"
scope=
"row"
><input type=
"submit"
name=
"submit"
value=
"submit"
class
=
"registerbtn"
></th>
234.
</tr>
235.
</tbody>
236.
</table>
237.
</div>
238.
</form>
239.
</body>
240.
</html>
241.
<? mysqli_close(
$sqli
); ?>