01.
<form id=
"approve"
name=
"approve"
action=
"shpaypackagesave.php?Req_id=<?=$_GET["
Req_id
"];?>"
method=
"post"
>
02.
<h3>อนุมัติการจ่ายวัสดุจาก<?=
$_SESSION
[
"row_level"
];?></h3>
03.
04.
<div
class
=
"row"
>
05.
<div
class
=
"col-md-4"
><h4>เลขที่คำสั่ง : <?php
echo
$objResult
[
"preface_no"
];?> / <?php
echo
$objResult
[
"preface_year"
];?></h4></div>
06.
<div
class
=
"col-md-6"
><h4>วันที่เริ่มปฏิบัติงาน : <?php
echo
Datetimeth(
$objResult
[
"event_datestart"
]);?></h4></div>
07.
</div>
08.
<div
class
=
"row"
>
09.
<div
class
=
"col-md-12"
><h4>ชื่อคำสั่ง : <?php
echo
$objResult
[
"preface_subject"
];?></h4></div>
10.
</div>
11.
<div
class
=
"row"
>
12.
<div
class
=
"col-md-3"
><h4>เลขที่ใบเบิก : <?=
$_GET
[
"Req_id"
];?></h4></div>
13.
<div
class
=
"col-md-5"
><h4>ผู้เบิก : <?php
echo
$objResult
[
"prefix_name"
].
$objResult
[
"staf_name"
].
" "
.
$objResult
[
"staf_last"
]; ?></h4></div>
14.
<div
class
=
"col-md-4"
><h4>วันที่เบิก : <?=Datetimeth(
$objResult
[
"Req_date"
]);?></h4></div>
15.
</div>
16.
<table id=
"approve"
class
=
"table table-bordered"
>
17.
<thead>
18.
<th
class
=
"info"
><center><input name=
"CheckAll"
type=
"checkbox"
id=
"CheckAll"
value=
"Y"
onClick=
"ClickCheckAll(this);"
></center></th>
19.
<th
class
=
"info"
><center>ชื่อวัสดุ</center></th>
20.
<th
class
=
"info"
><center>จำนวน</center></th>
21.
<th
class
=
"info"
><center>หน่วยนับ</center></th>
22.
<th
class
=
"info"
><center>สถานะวัสดุที่เบิก</center></th>
23.
</thead>
24.
<?
$i
=0;
do
{
$i
++ ?>
25.
<tr align=
"center"
>
26.
<td><center>
27.
<?php
28.
if
(
$objResult
[
"status_id"
] ==
'05'
)
29.
{?>
30.
<input name=
"checksave[]"
id=
"checksave<?php echo $i;?>"
type=
"checkbox"
value=
"<?=$objResult["
Rqdetail_id
"];?>"
onClick=
"check(this);"
>
31.
<? }
32.
else
if
(
$objResult
[
"status_id"
] ==
'12'
)
33.
{
34.
echo
"<font color=\"green\">อนุมัติการจ่ายวัสดุแล้ว</font>"
;
35.
}
36.
else
if
(
$objResult
[
"status_id"
] ==
'13'
)
37.
{
38.
echo
"<font color=\"red\">ไม่อนุมัติการจ่ายวัสดุ</font>"
;
39.
} ?> </center></td>
40.
<td>
41.
<input type=
"hidden"
id=
"Req_id"
name=
"Req_id"
value=
"<?=$_GET["
Req_id
"];?>"
>
42.
<input type=
"hidden"
value=
"<?=$objResult["
Eq_id
"];?>"
name=
"txt_id<?=$objResult["
Rqdetail_id
"];?>"
id=
"txt_id"
>
43.
<?php
echo
$objResult
[
"Eq_name"
]; ?>
44.
</td>
45.
<td>
46.
<input type=
"hidden"
value=
"<?=$objResult["
Eq_total
"];?>"
name=
"txt_total<?=$objResult["
Rqdetail_id
"];?>"
id=
"txt_total"
>
47.
<?php
echo
$objResult
[
"Rq_quantity1"
]; ?>
48.
<input type=
"hidden"
value=
"<?=$objResult["
Rq_quantity1
"];?>"
name=
"txt_numreq<?=$objResult["
Rqdetail_id
"];?>"
id=
"txt_numreq"
>
49.
</td>
50.
<td>
51.
<input type=
"hidden"
value=
"<?=$objResult["
Unit_name
"];?>"
name=
"txt_unit<?=$objResult["
Rqdetail_id
"];?>"
>
52.
<?php
echo
$objResult
[
"Unit_name"
]; ?>
53.
</td>
54.
<td>
55.
<input type=
"hidden"
value=
"<?=$objResult["
status_idmain
"];?>"
name=
"txt_idmain<?=$objResult["
Rqdetail_id
"];?>"
>
56.
<?php
57.
if
(
$objResult
[
"status_idmain"
] == 1){
58.
echo
"<font color=\"green\">เบิกได้</font>"
;
59.
}
else
if
(
$objResult
[
"status_idmain"
] == 2){
60.
echo
"<font color=\"red\">แจ้งความต้องการใช้</font>"
;
61.
}
62.
?>
63.
</td>
64.
<td hidden=
"true"
align=
"center"
><?
if
(
$objResult
[
"status_id"
] ==
'04'
){ ?>
65.
<input type=
"text"
name=
"txt_note<?=$objResult["
Rqdetail_id
"];?>"
class
=
"form-control"
style=
"width:160px; height:30px;"
placeholder=
"ไม่อนุมัติเพราะ..."
>
66.
<? } ?>
67.
</td>
68.
</tr>
69.
<?php }
while
(
$objResult
= mysql_fetch_array(
$objQuery
)); ?>
70.
</table>
71.
<?
if
(
$num_row
!= 0){ ?>
72.
<center>
73.
<input type=
"submit"
id=
"Submit"
name=
"Submit"
class
=
"btn btn-info btn-sm"
value=
"อนุมัติ"
onClick=
"return onSave(this);"
disabled />
74.
<input type=
"submit"
id=
"unSubmit"
name=
"unSubmit"
class
=
"btn btn-info btn-sm"
value=
"ไม่อนุมัติ"
onClick=
"return dontSave(this);"
disabled /> |
75.
<a href=
"shpaypackage.php"
><button type=
"button"
class
=
"btn btn-warning btn-sm"
>ย้อนกลับ</button></a><br><br><br><br></center>
76.
<? }
else
{
77.
$statusid
= 12;
78.
$date
=
date
(
"Y-m-d H:i:s"
);
79.
$Req_id
=
$_GET
[
"Req_id"
];
80.
81.
$strSQL
=
"UPDATE tb_request SET "
;
82.
$strSQL
.=
"Stokout_date = '"
.
$date
.
"',status_id = '"
.
$statusid
.
"' WHERE Req_id = '"
.
$Req_id
.
"'"
;
83.
$objQuery
= mysql_query(
$strSQL
)
or
die
(
"Error Query ["
.
$strSQL
.
"]"
);
84.
85.
if
(
$objQuery
)
86.
{
87.
header(
"location:shpaypackage.php"
);
88.
}
89.
}
90.
?>
91.
<input type=
"hidden"
name=
"hdnCount"
value=
"<?php echo $i;?>"
>
92.
</form>