-
Notifications
You must be signed in to change notification settings - Fork 3
/
report_in_department_social_opd_mianma_update.php
293 lines (247 loc) · 10.5 KB
/
report_in_department_social_opd_mianma_update.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
<?php
session_start();
include("phpconf.php");
include("func.php");
conDB();
?>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=tis-620">
<title>- - ÃкºÍÔ¹·ÃÒà¹çµ | <?php echo " ".$Hospname." "; ?> | - - ÂÍ´¼ÙéÃѺºÃÔ¡Òà -> ÃÒ§ҹ¾ÁèÒ ·ÕèÁÕ Diag= Z008 - - |</title>
<style type="text/css">
<!--
body { margin: 0px 0px; padding: 0px 0px}
body{font-family:MS Sans Serif;font-size:10pt}
table,td{font-family:MS Sans Serif;font-size:10pt}
form{font-family:MS Sans Serif;font-size:10pt}
-->
</style>
<?php
//set theme
print "<link href='css/$Theme.css' rel='stylesheet' type='text/css'>";
?>
<script language="JavaScript" type="text/JavaScript">
<!--
function MM_reloadPage(init) { //reloads the window if Nav4 resized
if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);
//-->
</script>
</head>
<?php
if (!$_SESSION["ip_Log"] and !Check_Online(get_ip())){ //check ->off line
echo "<META HTTP-EQUIV='REFRESH' CONTENT='1; URL=index.php'>";
}else{ //on line
?>
<body>
<table width="1024" border="0" cellspacing="0" cellpadding="0" align="center">
<tr>
<td width="927" height="276" align="center">
<table width="1010" cellpadding="0" cellspacing="0" align="center">
<tr>
<td colspan="2" valign="top">
<?php if (Check_Online(get_ip()) and $Header=="N") {} else {include("header.inc");} ?>
</td>
</tr>
<tr>
<td width="659" height="24" valign="middle" background="img_mian/bgcolor.gif" bgcolor="#3399CC"><?php include("manu.inc"); ?>
</td>
<td width="139" align="left" valign="bottom" background="img_mian/bgcolor.gif" bgcolor="#3399CC"> </td>
</tr>
<tr>
<td height="177" colspan="2" align="center" valign="top" class="td-left"><br>
<table width="1019" border="0" cellpadding="0" cellspacing="0" class="bd-external">
<tr align="center" bgcolor="#99CCFF">
<td height="24" colspan="2" background="img_mian/bgcolor2.gif" class="headmenu"> Ãкº»ÃѺ»Ãا¢éÍÁÙŵÃǨÊØ¢ÀÒ¾áç§Ò¹µèÒ§´éÒÇ </td>
</tr>
<tr align="center">
<td colspan="2" valign="top">
<form action="<?php $PHP_SELF ?>" method="get" name="f_select_dmy">
<table width="360" border="0" cellspacing="2" cellpadding="1">
<tr align="center">
<td colspan="3"><font color="green"><b><u>àÅ×Í¡ªèǧàÇÅÒ</u></b></font></td>
</tr>
<tr>
<td width="78">
<?php
print"Çѹ·Õè ";
print"<select name='sd1' id='Txt-Field'>";
if($sd1<>""){print"<option value='$sd1'>$sd1</option>";}
for($i=1;$i<=31;$i++){
print"<option value='$i'>$i</option>";
}
print"</select>";
?>
</td>
<td width="129">
<?php
print" à´×͹ ";
print"<select name='sm1' id='Txt-Field'>";
if($sm1<>""){print"<option value='$sm1'>".change_month_isThai($sm1)."</option>";}
for($i=1;$i<=12;$i++){
print"<option value='$i'>".change_month_isThai($i)."</option>";
}
print"</select>";
?>
</td>
<td width="135">
<?php
print" »Õ ";
$sqlSyear="select DISTINCT YEAR(vstdate) as s_year from dtmain group by vstdate desc ";
$result=ResultDB($sqlSyear);//echo mysql_num_rows($result);
print"<select name='sy1' id='Txt-Field'>";
if($sy1<>""){print"<option value='$sy1'>".($sy1+543)."</option>";}
if(mysql_num_rows($result)>0){
for($i=0;$i<mysql_num_rows($result);$i++){
$rs=mysql_fetch_array($result);
print "<option value='".$rs['s_year']."'>".($rs['s_year']+543)."</option>";
}
}
print"</select>";
print"</select> <input type='submit' value='Continue' id='Button'>";
?> </td>
</tr>
<tr>
<td></td>
<td>
<?php
?> </td>
</tr>
</table>
</form>
</td>
</tr>
<tr align="center">
<td colspan="2">
</td>
</tr>
<tr>
<td colspan="2"><!-- end ÊÃéÒ§¡ÃͺµÒÃÒ§ --></td>
</tr>
<tr align="center" valign="top">
<td colspan="2"> </td>
</tr>
<tr align="center">
<td colspan="2">
</td>
</tr>
<tr align="center">
<td colspan="2">
<form method='post' action='print_card_mianma.php' target='_blank' >
<?php
//sql create table show
$d1=$sy1."-".$sm1."-".$sd1;$d2=$sy2."-".$sm2."-".$sd2;//echo $d1."dd".$d2;
$sqlOpd_Socail="select p.hn,p.cid,v.vn,v.hn,v.vstdate,concat(p.pname,p.fname,' ',p.lname) as pt_name,
(
select o.sum_price from opitemrece o where o.vn =v.vn and
o.icode = 3008183
limit 1
) as sum_3008183,
(
select o.qty from opitemrece o where o.vn =v.vn and
o.icode = 3008183
limit 1
) as qty_3008183
from vn_stat v
left outer join patient p on p.hn = v.hn
where v.vstdate = '$d1' and
(
select count(o.icode) from opitemrece o where o.vn = v.vn and o.icode = '3008110'
) = 1 ";
$resultOpd_Socail=ResultDB($sqlOpd_Socail);//echo mysql_num_rows($resultDenService);
if(mysql_num_rows($resultOpd_Socail)>0){
print"<u><font color='green'><b>áÊ´§¢éÍÁÙŢͧÇѹ·Õè <font color='red'>$sd1</font> à´×͹ <font color='red'>".change_month_isThai($sm1)."</font> »Õ <font color='red'>".($sy1+543)."</font> ¶Ö§Çѹ·Õè <font color='red'>$sd2</font> à´×͹ <font color='red'>".change_month_isThai($sm2)."</font> »Õ <font color='red'>".($sy2+543)."</font>";
print"<br>ÁÕ·Ñé§ËÁ´ ".mysql_num_rows($resultOpd_Socail)." ÃÒ¡ÒÃ</b></font></u>";
//create row
?><br><br>
<table width="1000" border="1" cellspacing="0" cellpadding="0" class="bd-external">
<tr>
<td height="44" align="center"><table width="1000" border="0" cellpadding="1" cellspacing="1">
<tr class="headtable">
<td height="21" align="center" background="img_mian/bgcolor2.gif">Ç/´/» ·Õèŧ·ÐàºÕ¹</td>
<td align="center" background="img_mian/bgcolor2.gif">HN</td>
<td align="center" background="img_mian/bgcolor2.gif">ª×èÍ-Ê¡ØÅ</td>
<td align="center" background="img_mian/bgcolor2.gif">àÅ¢ºÑµÃ</td>
<td align="center" background="img_mian/bgcolor2.gif">¡Ã³ÕµÃǨäÁè¼èÒ¹</td>
<td align="center" background="img_mian/bgcolor2.gif">»ÃѺ»Ãا¢éÍÁÙÅ</td>
</tr>
<?php
$i=0;
while($i<mysql_num_rows($resultOpd_Socail)){//while
$rsOpd_Socail=mysql_fetch_array($resultOpd_Socail);
if ($bg=="#FFFFFF") { //color
$bg="#B1C3D9";
//$bgm="";
}else{
$bg="#FFFFFF";
//$bgm="img_mian/bgcolor.gif";
} //color
?>
<tr bgcolor="<?php echo $bg;?>">
<td align="center"><?php echo FormatDateEng($rsOpd_Socail['vstdate']); ?></td>
<td align="center"><?php echo $rsOpd_Socail['hn']; ?></td>
<td align="left"><?php echo $rsOpd_Socail['pt_name']; ?></td>
<td align="center"><?php echo $rsOpd_Socail['cid']; ?></td>
<?php if($rsOpd_Socail['qty_3008183'] != 0) {?>
<td align="left"> <?php echo "<a href='report_in_department_social_opd_mianma_update_zero_success.php?hn=".$rsOpd_Socail['hn']."&vn=".$rsOpd_Socail['vn']."&vstdate=".$rsOpd_Socail['vstdate']."'
target='_blank'>".»ÃѺ¤èÒ»ÃСѹÊØ¢ÀÒ¾à»ç¹ÈÙ¹Âì."</a>"; ?></td>
<?php } else { ?>
<td>
<?php
if($rsOpd_Socail['qty_3008183']==0) {
echo "<a href='report_in_department_social_opd_mianma_update_non_zero_success.php?hn=".$rsOpd_Socail['hn']."&vn=".$rsOpd_Socail['vn']."&vstdate=".$rsOpd_Socail['vstdate']."'
target='_blank'>".'0'."</a>";
}
?>
</td>
<?php } ?>
<td align="left"> <?php echo "<a href='report_in_department_social_opd_mianma_update_success.php?hn=".$rsOpd_Socail['hn']."&vn=".$rsOpd_Socail['vn']."&vstdate=".$rsOpd_Socail['vstdate']."'
target='_blank'>".»ÃѺ»Ãا¢éÍÁÙÅ."</a>"; ?></td>
</tr>
<?php
$i++;
} //while
?>
</table></td>
</tr>
</table>
<?php
}else{
if($sy1<>""){print"<font color='green'><b>äÁèÁÕ¢éÍÁÙŢͧ<br>Çѹ·Õè <font color='red'>$sd1</font> à´×͹ <font color='red'>".change_month_isThai($sm1)."</font> »Õ <font color='red'>".($sy1+543)."</font> ¶Ö§Çѹ·Õè <font color='red'>$sd2</font> à´×͹ <font color='red'>".change_month_isThai($sm2)."</font> »Õ <font color='red'>".($sy2+543)."</font></b></font>";
}else{print"<font color='green'><b>¡ÃسÒàÅ×Í¡ªèǧàÇÅÒ ÊÓËÃѺÃÒ§ҹ</b></font><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br>";}
}
?>
</td>
</tr>
<tr>
<td width="544"> </td>
<td width="475"> </td>
</tr>
</table>
<!-- form -->
<!-- end form --></td>
</tr>
<tr>
<td height="16" colspan="2" align="center" background="img_mian/bgcolor2.gif" bgcolor="#B1C3D9">| <?php echo"<a href=\"javascript:history.back(-1)\">Âé͹¡ÅѺ</a>" ?> |</td>
</tr>
<tr>
<td height="16" valign="top"><img src="img_mian/bn_03_2.gif" width="634" height="36"></td>
<td height="16" valign="top"> </td>
</tr>
</table>
</td>
</tr>
<tr>
<td height="23">
</td>
</tr>
</table>
</form>
<?php
}//ch online
CloseDB(); //close connect db ?>
</body>
</html>