001.
<?php
002.
session_start();
003.
include
(
'config/config.php'
);
004.
?>
005.
006.
<!DOCTYPE html>
008.
<head>
009.
<meta charset=
"utf-8"
/>
010.
<meta name=
"viewport"
content=
"width=device-width, initial-scale=1.0"
/>
011.
<title>จัดการวัตถุดิบ</title>
012.
<!-- BOOTSTRAP STYLES-->
013.
<link href=
"assets/css/bootstrap.css"
rel=
"stylesheet"
/>
014.
<!-- FONTAWESOME STYLES-->
015.
<link href=
"assets/css/font-awesome.css"
rel=
"stylesheet"
/>
016.
<!-- CUSTOM STYLES-->
017.
<link href=
"assets/css/custom.css"
rel=
"stylesheet"
/>
018.
<!-- GOOGLE FONTS-->
019.
020.
022.
<link rel=
"stylesheet"
type=
"text/css"
href=
"tool/DataTables-1.10.13/media/css/dataTables.bootstrap.css"
>
023.
<link rel=
"stylesheet"
href=
"tool/datepicker/css/datepicker.css"
>
024.
</head>
025.
<body>
026.
027.
028.
<div id=
"wrapper"
>
029.
<?php
include
(
'menu.php'
); ?>
030.
<div id=
"page-wrapper"
>
031.
<div id=
"page-inner"
>
032.
<div
class
=
"row"
>
033.
<div
class
=
"col-md-12"
>
034.
<div
class
=
"alert alert-success"
role=
"alert"
><h4><a href=
"index.php"
style=
"color: #666666"
>หน้าหลัก</a> / วางแผนการผลิต</h4></div>
035.
</div>
036.
</div>
037.
038.
<form
class
=
"form-horizontal"
name=
"form1"
method=
"post"
role=
"form"
action=
"pages/insert_SC.php"
>
039.
040.
<div
class
=
"alert alert-warning"
role=
"alert"
>
041.
042.
<div
class
=
"form-group"
>
043.
<label
for
=
"inputType"
class
=
"col-md-7 control-label"
>Document No : </label>
044.
<div
class
=
"col-md-4"
>
045.
<input type=
"text"
class
=
"form-control"
name=
"MRP"
placeholder=
"MRP-SC"
OnKeyPrees=
"return chknumber($this)"
>
046.
</div>
047.
</div>
048.
049.
<div
class
=
"form-group"
>
050.
<div
class
=
"col-md-6 col-md-offset-6"
>
051.
<div
class
=
"form-group row"
>
052.
053.
<label
for
=
"inputKey"
class
=
"col-md-2 control-label"
>issue by:</label>
054.
<div
class
=
"col-md-3"
>
055.
<input type=
"text"
name=
"issue_by"
class
=
"form-control"
placeholder=
"issue by"
>
056.
</div>
057.
058.
<label
for
=
"inputKey"
class
=
"col-md-3 control-label"
>issue
Date
:</label>
059.
<div
class
=
"col-md-3"
>
060.
<input type=
"text"
name=
"issue_Date"
class
=
"form-control datepicker"
id=
"datepicker"
placeholder=
"issue Date"
>
061.
</div>
062.
063.
</div>
064.
</div>
065.
</div>
066.
067.
068.
<div
class
=
"form-group"
>
069.
<div
class
=
"col-md-12"
>
070.
<div
class
=
"form-group row"
>
071.
<label
for
=
"inputKey"
class
=
"col-md-1 control-label"
>Department:</label>
072.
<div
class
=
"col-md-2"
>
073.
<input type=
"text"
name=
"Department"
class
=
"form-control"
placeholder=
"Department"
>
074.
</div>
075.
<label
for
=
"inputValue"
class
=
"col-md-1 control-label"
>Category:</label>
076.
<div
class
=
"col-md-2"
>
077.
<input type=
"text"
name=
"Category"
class
=
"form-control"
placeholder=
"Category"
>
078.
</div>
079.
080.
<label
for
=
"inputKey"
class
=
"col-md-1 control-label"
>Code:</label>
081.
<div
class
=
"col-md-2"
>
082.
<input type=
"text"
name=
"Code"
class
=
"form-control"
placeholder=
"Code"
>
083.
</div>
084.
085.
<label
for
=
"inputKey"
class
=
"col-md-1 control-label"
>Customer:</label>
086.
<div
class
=
"col-md-2"
>
087.
<input type=
"text"
name=
"Customer"
class
=
"form-control"
placeholder=
"Customer"
>
088.
</div>
089.
090.
</div>
091.
</div>
092.
</div>
093.
094.
</div>
095.
<div
class
=
"form-group row"
>
096.
<div
class
=
"col-sm-4 col-sm-offset-5 "
>
097.
<button type=
"submit"
class
=
"btn btn-info"
onsubmit=
"JavaScript:return chksubmit();"
><i
class
=
"fa fa-plus-circle"
></i> บันทึก</button>
098.
<button type=
"reset"
class
=
"btn btn-danger"
><i
class
=
"fa fa-refresh"
></i> ยกเลิก</button>
099.
</div>
100.
</div>
101.
</form>
102.
103.
104.
105.
<?php
106.
107.
$strSQL
=
"SELECT * FROM plan_order where sc_id "
;
108.
$objQuery
= mysqli_query(
$conn
,
$strSQL
);
109.
110.
111.
?>
112.
113.
114.
<p></p>
115.
<div id=
"prodata_table"
>
116.
<table id=
"table_id"
class
=
"table table-bordered"
>
117.
<thead>
118.
<th
class
=
"text-center"
width=
"5%"
>SC</th>
119.
120.
<th
class
=
"text-center"
width=
"5%"
>ประเภท</th>
121.
<th
class
=
"text-center"
width=
"5%"
>วันที่รับเรื่อง</th>
122.
<th
class
=
"text-center"
width=
"10%"
>รายละเอียด</th>
123.
124.
</thead>
125.
126.
<tbody>
127.
<?php
128.
while
(
$row
= mysqli_fetch_array(
$objQuery
))
129.
130.
{
131.
?>
132.
<tr>
133.
134.
<td
class
=
"text-center"
><a href=
"add_item.php?sc_id=<?php echo $row["
sc_id
"];'' ?>"
><?php
echo
$row
[
"sc_id"
]; ?></a></td> <------------------------!ส่งค่าตรงนี้ครับ------------------>
135.
<td
class
=
"text-center"
><?php
echo
$row
[
'cat'
] ?></td>
136.
<td
class
=
"text-center"
><?php
echo
date
(
'd-m-Y'
,
strtotime
(
$row
[
"issue_date"
])); ?></td>
137.
138.
<td
class
=
"text-center"
>
139.
<button
class
=
"btn btn-success "
><a style=
"color: #ffffff;"
><i
class
=
"fa fa-desktop"
></i></a></button>
140.
<button
class
=
"btn btn-warning "
><a style=
"color: #ffffff;"
><i
class
=
"fa fa-cog"
></i></a></button>
141.
<a href=
"JavaScript:if(confirm('ต้องการลบข้อมูลหรือไม่ ?')==true){window.location='pages/delete_sc.php?sc_id=<?php echo $row["
sc_id
"]; ?>';}"
style=
"color: #ffffff;"
><button
class
=
"btn btn-danger "
><i
class
=
"fa fa-bitbucket"
></i></button></a>
142.
143.
144.
</td>
145.
146.
147.
</tr>
148.
<?php
149.
}
150.
?>
151.
</tbody>
152.
153.
</table>
154.
155.
156.
</div>
157.
158.
159.
160.
161.
162.
</div>
163.
164.
165.
</div>
166.
167.
</div>
168.
169.
170.
171.
<script src=
"assets/js/jquery-3.1.0.min.js"
></script>
172.
<script src=
"assets/js/bootstrap.min.js"
></script>
173.
<script src=
"tool/datepicker/js/bootstrap-datepicker.js"
></script>
174.
175.
<script type=
"text/javascript"
>
176.
177.
$(
function
(){
178.
$(
'.datepicker'
).datepicker();
179.
});
180.
181.
182.
183.
184.
185.
186.
187.
</script>
188.
189.
<script type=
"text/javascript"
src=
"tool/DataTables-1.10.13/media/js/jquery.dataTables.js"
></script>
190.
<script type=
"text/javascript"
src=
"tool/DataTables-1.10.13/media/js/dataTables.bootstrap.js"
></script>
191.
<script type=
"text/javascript"
>
192.
$(document).ready(
function
(){
193.
$(
'#table_id'
).dataTable( {
194.
195.
"oLanguage"
: {
196.
197.
"sLengthMenu"
:
"แสดง _MENU_ เร็คคอร์ด ต่อหน้า"
,
198.
"sZeroRecords"
:
"ไม่เจอข้อมูลที่ค้นหา"
,
199.
"sInfo"
:
"แสดง _START_ ถึง _END_ ของ _TOTAL_ เร็คคอร์ด"
,
200.
"sInfoEmpty"
:
"แสดง 0 ถึง 0 ของ 0 เร็คคอร์ด"
,
201.
"sInfoFiltered"
:
"(จากเร็คคอร์ดทั้งหมด _MAX_ เร็คคอร์ด)"
,
202.
"sSearch"
:
"ค้นหา :"
203.
204.
}
205.
} );
206.
});
207.
</script>
208.
<script src=
"assets/js/jquery.metisMenu.js"
></script>
209.
<script src=
"assets/js/custom.js"
></script>
210.
</body>
211.
</html>