01.
<form
class
=
"form-horizontal"
method=
"post"
action=
"insert_deli.php"
>
02.
<div
class
=
"box-body"
>
03.
<div
class
=
"form-group"
>
04.
<label
for
=
"deli_name"
class
=
"col-sm-2 control-label"
>พนักงาน</label>
05.
<div
class
=
"col-sm-10"
>
06.
<select name=
"deli_name"
id=
"deli_name"
class
=
"form-control"
>
07.
<option value=
""
>--กรุณาเลือก--</option>
08.
<option value=
"วิชัย"
>วิชัย</option>
09.
<option value=
"ประยูร"
>ประยูร"</option>
10.
<option value=
"วีรพล"
>วีรพล</option>
11.
<option value=
"สมหมาย"
>สมหมาย</option>
12.
</select>
13.
</div>
14.
</div>
15.
<div
class
=
"form-group"
>
16.
<label
for
=
"deli_detail"
class
=
"col-sm-2 control-label"
>งาน</label>
17.
<div
class
=
"col-sm-10"
>
18.
<input type=
"text"
class
=
"form-control"
name=
"deli_detail"
id=
"deli_detail"
placeholder=
""
>
19.
</div>
20.
</div>
21.
<div
class
=
"form-group"
>
22.
<label
for
=
"deli_wan"
class
=
"col-sm-2 control-label"
>วัน</label>
23.
<div
class
=
"col-sm-10"
>
24.
<select name=
"deli_wan"
id=
"deli_wan"
class
=
"form-control"
>
25.
<option value=
""
>--กรุณาเลือก--</option>
26.
<option value=
"วันจันทร์"
>วันจันทร์</option>
27.
<option value=
"วันอังคาร"
>วันอังคาร</option>
28.
<option value=
"วันพุธ"
>วันพุธ</option>
29.
<option value=
"วันพฤหัส"
>วันพฤหัส</option>
30.
<option value=
"วันศุกร์"
>วันศุกร์</option>
31.
<option value=
"วันเสาร์"
>วันเสาร์</option>
32.
<option value=
"วันอาทิตย์"
>วันอาทิตย์</option>
33.
</select>
34.
</div>
35.
</div>
36.
<div
class
=
"form-group"
>
37.
<label
for
=
"deli_datejob"
class
=
"col-sm-2 control-label"
>วันที่</label>
38.
<div
class
=
"col-sm-3"
>
39.
<input type=
"date"
value=
"2017-06-01"
class
=
"form-control"
name=
"deli_datejob"
id=
"deli_datejob"
placeholder=
"อ้างอิง"
>
40.
</div>
41.
</div>
42.
</div><!-- /.box-body -->
43.
<center>
44.
<button type=
"submit"
name=
"submit"
class
=
"btn btn-info"
>บันทึก</button>
45.
<input name=
"reset"
type=
"reset"
id=
"reset"
value=
"ยกเลิก"
onClick=
"window.deli_datejob.href='index2.php';"
class
=
"btn btn-warning"
>
46.
</center>
47.
</form>
48.
<?php
49.
if
(isset(
$_POST
[
'submit'
]))
50.
{
51.
$deli_name
=
$_POST
[
'deli_name'
];
52.
$deli_detail
=
$_POST
[
'deli_detail'
];
53.
$deli_wan
=
$_POST
[
'deli_wan'
];
54.
$deli_datejob
=
$_POST
[
'deli_datejob'
];
55.
$deli_datein
=
date
(
'Y-m-d H:i:s'
);
56.
{
57.
$sql
=
" insert into tb_delivery(deli_name,deli_detail,deli_wan,deli_datejob,deli_datein)"
;
58.
59.
$sql
.=
" values ('$deli_name','$deli_detail','$deli_wan','$deli_datejob','$deli_datein')"
;
60.
61.
if
(
$cls_con
->write_base(
$sql
))
62.
{
63.
echo
$cls_con
->show_message(
'บันทึกข้อมูลสำเร็จ'
);
64.
65.
echo
$cls_con
->goto_page(1,
'index2.php'
);
66.
67.
}
68.
else
{
69.
echo
$cls_con
->show_message(
'บันทึกข้อมูลไม่สำเร็จ'
);
70.
71.
}
72.
73.
}
74.
}
75.
76.
?>