002.
<html>
003.
<head>
004.
<META HTTP-EQUIV=
"Content-Type"
CONTENT=
"text/html; charset=UTF-8"
>
005.
<link href=
"../fontTahoma.css"
rel=
"stylesheet"
type=
"text/css"
>
006.
<title>ข้อมูลการรับ - จ่ายยาราคาแพง</title>
007.
<table border=
"0"
>
008.
<tr>
009.
<td rowspan=
"4"
><img src=
"../images/Logo/PCK.jpg"
width=60px; height=80px;></td>
010.
<td
class
=
"FontSize13B"
></td>
011.
</tr>
012.
<tr>
013.
<td
class
=
"FontSize11B"
>การจ่ายยาราคาแพง</td>
014.
<td> </td>
015.
</tr>
016.
</table>
017.
<?php
018.
require_once
(
'../_connections/conHomc.php'
);
019.
require_once
(
'../_connections/conPG.php'
);
020.
include
(
'../_function/phpFunction.php'
);
021.
022.
$ward_id
=
''
;
023.
if
(isset(
$_GET
[
'inv_code'
])){
$inv_code
=trim(
$_GET
[
'inv_code'
]);}
024.
$qry
=
"SELECT code,gen_name,unit "
;
025.
$qry
.=
"FROM Med_inv "
;
026.
$qry
.=
"WHERE code='$inv_code' and site='1' "
;
027.
028.
$rsHomc
=mssql_query(
$qry
,
$conHomc
);
029.
while
(
$rowHomc
= mssql_fetch_array(
$rsHomc
)) {
030.
$gen_name
=
$rowHomc
[
'gen_name'
];
031.
$unit
=
$rowHomc
[
'unit'
];
032.
$newunit
=iconv(
'TIS-620'
,
'UTF-8'
,
$unit
);
033.
$newname
=iconv(
'TIS-620'
,
'UTF-8'
,
$gen_name
);
034.
}
035.
036.
$original
=
date
(
"Ymd"
);
037.
$timm
=
date
(
"His"
);
038.
039.
$qrysm
=
"select * from receive "
;
040.
$qrysm
.=
"where inv_code='$inv_code' and status='A' "
;
041.
042.
$rssm
=
$conPG
->Execute(
$qrysm
)
or
die
(
$conPG
->ErrorMSG());
043.
$re_sm
=pg_query(
$qrysm
);
044.
$num
=pg_num_rows(
$re_sm
);
045.
if
(
$num
!=0){
046.
while
(!
$rssm
->EOF){
047.
$date_receive
=
$rssm
->Fields(
'date_receive'
);
048.
$time_receive
=
$rssm
->Fields(
'time_receive'
);
049.
$total_amt
=
$rssm
->Fields(
'total_amt'
);
050.
$rssm
->MoveNext();
051.
}
052.
}
053.
?>
054.
<form name=
"pay"
method=
"POST"
action=
"save_pay.php"
>
055.
<table border=
"1"
>
056.
<tr>
057.
<td
class
=
"FontSize11B"
>รหัสยา</td>
058.
<td colspan=
"3"
class
=
"FontSize10"
><?php
echo
$inv_code
?></td>
059.
</tr>
060.
<tr>
061.
<td
class
=
"FontSize11B"
>ชื่อยา</td>
062.
<td colspan=
"3"
class
=
"FontSize10"
><?php
echo
$newname
?></td>
063.
</tr>
064.
<tr>
065.
<td
class
=
"FontSize11B"
>หน่วย</td>
066.
<td colspan=
"3"
class
=
"FontSize10"
><?php
echo
$newunit
?></td>
067.
</tr>
068.
<tr>
069.
<td
class
=
"FontSize11B"
>TEST</td>
070.
<td colspan=
"3"
class
=
"FontSize10"
><input type=
"text"
name=
"aaa"
></td>
071.
</tr>
072.
<tr>
073.
<td
class
=
"FontSize11B"
width=
"160px"
>เลือกวอร์ดที่จ่ายยา</td>
074.
<td>
075.
<select name=
"ward_id"
id=
"ward_id"
style=
"width :205px"
>
076.
<option value=
"000"
selected>---เลือกหอผู้ป่วย---</option>
077.
<?php
078.
$sqll
=
"SELECT ward_id,ward_name, ward_id + ' ' + ward_name "
;
079.
$sqll
.=
" AS fullward FROM Ward ORDER BY ward_id"
;
080.
$rsPGG
= mssql_query(
$sqll
,
$conHomc
);
081.
$numc
=mssql_num_rows(
$rsPGG
);
082.
083.
for
(
$i
=1;
$i
<=
$numc
;
$i
++)
084.
{
085.
$roww
=mssql_fetch_array(
$rsPGG
);
086.
$n_fullward
=iconv(
'TIS-620'
,
'UTF-8'
,
$roww
[
'fullward'
]);
087.
?>
088.
<option value=
"<?php echo $roww['ward_id']?>"
<?php
089.
if
(trim(
$ward_id
)==trim(
$roww
[
'ward_id'
]))
echo
" selected"
; ?>><?php
090.
echo
$n_fullward
?></option>
091.
<?php
092.
}
093.
?>
094.
</select></td>
095.
<td
class
=
"FontSize11B"
>จำนวนที่่จ่าย</td>
096.
<td
class
=
"FontSize10"
><input type=
"text"
name=
"pay_ward"
onchange=
"chkamt('sVal')"
></td>
097.
</tr>
098.
<tr>
099.
<td
class
=
"FontSize11B"
>จ่ายยาผู้ป่วยในจำนวน</td>
100.
<td colspan=
"3"
class
=
"FontSize10"
><input type=
"text"
name=
"pay_ipd"
></td>
101.
</tr>
102.
<tr>
103.
<td
class
=
"FontSize11B"
>จ่ายยาผู้ป่วยนอกจำนวน</td>
104.
<td colspan=
"3"
class
=
"FontSize10"
><input type=
"text"
name=
"pay_opd"
></td>
105.
</tr>
106.
<tr>
107.
<td
class
=
"FontSize11B"
>ยอดทั้งหมด</td>
108.
<td colspan=
"3"
class
=
"FontSize10"
><input type=
"text"
name=
"total_amt"
value=
"<?php echo $total_amt; ?>"
readonly></td>
109.
</tr>
110.
<tr>
111.
<td
class
=
"FontSize11B"
>หมายเหตุ</td>
112.
<td colspan=
"3"
><input type=
"text"
name=
"remark_receive"
></td>
113.
</tr>
114.
<tr>
115.
<td
class
=
"FontSize11B"
>วันที่ปรับปรุง</td>
116.
<td colspan=
"3"
class
=
"FontSize10"
><?php
echo
iconv(
'TIS-620'
,
'UTF-8'
,thaidate(
$original
)).
" เวลา "
.
date
(
"Hi"
).
" น."
?></td>
117.
</tr>
118.
119.
</table>
120.
<table>
121.
<tr>
122.
<td><input type=
"button"
onclick=
"chkData();"
value=
"บันทึก"
><td>
123.
<td><input type=
"button"
onclick=
"window.history.go(-1);"
value=
"ย้อนกลับ"
><td>
124.
</tr>
125.
</table>
126.
</form>
127.
128.
129.
<script language=
"javascript"
>
130.
var
dForm=self.document.pay;
131.
132.
function
chkamt(sVal){
133.
var
a1=parseFloat(dForm.pay_ward.value);
134.
var
a2=parseFloat(dForm.total_amt.value);
135.
if
(a1>a2){
136.
alert(
'ยอดในสต๊อกไม่พอที่จะจ่าย!!!!'
);
137.
dForm.pay_ward.value=0;
138.
document.pay.pay_ward.focus();
139.
return
false;
140.
}
141.
}
142.
143.
function
chkData(){
144.
var
myMSG=
""
;
145.
}
146.
147.
</script>