002.
<html xmlns=
"http://www.w3.org/1999/xhtml"
><!-- InstanceBegin template=
"/Templates/water_template2.dwt.php"
codeOutsideHTMLIsLocked=
"false"
-->
003.
<head>
004.
<meta http-equiv=
"Content-Type"
content=
"text/html; charset=utf-8"
/>
005.
<!-- InstanceBeginEditable name=
"doctitle"
-->
006.
<title>Untitled Document</title>
007.
<!-- InstanceEndEditable -->
008.
<!-- InstanceBeginEditable name=
"head"
-->
009.
<style type=
"text/css"
>
010.
<!--
011.
.style25 {font-family: AngsanaUPC; font-size: 20px; }
012.
.style26 {
013.
font-family: AngsanaUPC;
014.
font-size: 20px;
015.
font-weight: bold;
016.
color: #0000FF;
017.
}
018.
.style23 {font-family: AngsanaUPC;
019.
font-size: 22px;
020.
font-weight: bold;
021.
}
022.
.style33 {font-size: 20px}
023.
-->
024.
</style>
025.
<!-- InstanceEndEditable -->
026.
<style type=
"text/css"
>
027.
<!--
028.
a:link {
029.
color: #0000FF;
030.
text-decoration: none;
031.
}
032.
a:visited {
033.
color: #0000FF;
034.
text-decoration: none;
035.
}
036.
a:hover {
037.
color: #FF00FF;
038.
text-decoration: none;
039.
}
040.
a:active {
041.
color: #FF00FF;
042.
text-decoration: none;
043.
}
044.
.style3 {
045.
color: #FFFFFF;
046.
font-weight: bold;
047.
font-family: AngsanaUPC;
048.
font-size: 22px;
049.
}
050.
.style22 {font-family: AngsanaUPC; font-size: 20px; color: #FFFFFF;}
051.
-->
052.
</style>
053.
</head>
054.
055.
<body>
056.
057.
<table width=
"798"
height=
"460"
border=
"0"
align=
"center"
cellpadding=
"0"
cellspacing=
"0"
bordercolor=
"#C8E2F9"
>
058.
<tr>
059.
<td height=
"140"
><img src=
"header3.png"
width=
"798"
height=
"140"
/></td>
060.
</tr>
061.
<tr>
062.
<td height=
"239"
valign=
"top"
bgcolor=
"#E2F2F5"
><!-- InstanceBeginEditable name=
"EditRegion1"
-->
063.
064.
<form id=
"form1"
name=
"form1"
method=
"post"
action=
""
>
065.
066.
<table width=
"584"
border=
"0"
align=
"center"
>
067.
<tr>
068.
<td width=
"578"
height=
"105"
><fieldset>
069.
<legend><span
class
=
"style23"
>ค้นหาใบเสร็จ</span></legend>
070.
<br />
071.
<table width=
"450"
border=
"0"
align=
"center"
>
072.
<tr>
073.
<td width=
"148"
><div align=
"right"
><span
class
=
"style25"
>ใบเสร็จประจำเดือน : </span></div></td>
074.
<td width=
"99"
><select name=
"month"
id=
"month"
style=
"width:80px;"
>
075.
<option value=
""
selected=
"selected"
>เลือกเดือน</option>
076.
<option value=
"01"
<?php
if
(
$_POST
[
'month'
]==
"01"
){
echo
"selected"
; } ?>>มกราคม</option>
077.
<option value=
"02"
<?php
if
(
$_POST
[
'month'
]==
"02"
){
echo
"selected"
; } ?>>กุมภาพันธ์</option>
078.
<option value=
"03"
<?php
if
(
$_POST
[
'month'
]==
"03"
){
echo
"selected"
; } ?>>มีนาคม</option>
079.
<option value=
"04"
<?php
if
(
$_POST
[
'month'
]==
"04"
){
echo
"selected"
; } ?>>เมษายน</option>
080.
<option value=
"05"
<?php
if
(
$_POST
[
'month'
]==
"05"
){
echo
"selected"
; } ?>>พฤษภาคม</option>
081.
<option value=
"06"
<?php
if
(
$_POST
[
'month'
]==
"06"
){
echo
"selected"
; } ?>>มิถุนายน</option>
082.
<option value=
"07"
<?php
if
(
$_POST
[
'month'
]==
"07"
){
echo
"selected"
; } ?> >กรกฎาคม</option>
083.
<option value=
"08"
<?php
if
(
$_POST
[
'month'
]==
"08"
){
echo
"selected"
; } ?>>สิงหาคม</option>
084.
<option value=
"09"
<?php
if
(
$_POST
[
'month'
]==
"09"
){
echo
"selected"
; } ?>>กันยายน</option>
085.
<option value=
"10"
<?php
if
(
$_POST
[
'month'
]==
"10"
){
echo
"selected"
; } ?>>ตุลาคม</option>
086.
<option value=
"11"
<?php
if
(
$_POST
[
'month'
]==
"11"
){
echo
"selected"
; } ?>>พฤศจิกายน</option>
087.
<option value=
"12"
<?php
if
(
$_POST
[
'month'
]==
"12"
){
echo
"selected"
; } ?>>ธันวาคม</option>
088.
</select></td>
089.
<td width=
"32"
><div align=
"right"
><span
class
=
"style25"
>ปี : </span></div></td>
090.
<td width=
"71"
><select name=
"year"
>
091.
<option value=
""
>เลือกปี</option>
092.
<?php
for
(
$i
=
date
(
"Y"
);
$i
>=
date
(
"Y"
)-20;
$i
--){?>
093.
<option value=
"<?php echo ($i)?>"
<?php
if
(
$_POST
[
'year'
]==(
$i
)){
echo
"selected"
; } ?>> <?php
echo
(
$i
+543)?> </option>
094.
<?php } ?>
095.
</select></td>
096.
<td width=
"78"
><input name=
"Submit"
type=
"submit"
value=
"แสดงข้อมูล"
/></td>
097.
</tr>
098.
</table>
099.
<p> </p>
100.
</fieldset>
101.
</td>
102.
</tr>
103.
</table>
104.
<p>
105.
<?php
106.
$Condition
=
array
();
107.
$Con
=
array
();
108.
if
(
$_POST
[
'year'
]!=
""
){
109.
$year
=
$_POST
[
'year'
];
110.
$Con
[] =
$year
;
111.
112.
}
113.
if
(
$_POST
[
'month'
]!=
""
){
114.
$month
=
$_POST
[
'month'
];
115.
$Con
[] =
$month
;
116.
117.
}
118.
119.
if
(
count
(
$Con
)>0) {
120.
$strCond1
= implode(
'-'
,
$Con
);
121.
$Condition
[] =
"date_after LIKE '$strCond1%'"
;
122.
}
123.
124.
if
(
count
(
$Condition
)==0)
$Condition
[] =
'1'
;
125.
$strCond
= implode(
' AND '
,
$Condition
);
126.
$condition
=
" where "
.
$strCond
;
127.
$objConnect
= mysql_connect(
"localhost"
,
"root"
,
"123"
)
or
die
(
"ไม่สามารถติดต่อกับฐานข้อมูลได้"
);
128.
$objDB
= mysql_select_db(
"water"
);
129.
$strSQL
=
"SELECT * FROM receipt WHERE date_after = '$date_after'"
;
130.
$strSQL
.=
$condition
;
131.
mysql_query(
"SET NAMES UTF8"
);
132.
$objQuery
= mysql_query(
$strSQL
)
or
die
(
"Error Query ["
.
$strSQL
.
"]"
);
133.
$Num_Rows
= mysql_num_rows(
$objQuery
);
134.
$Per_Page
= 20;
135.
$Page
=
$_GET
[
"Page"
];
136.
if
(!
$_GET
[
"Page"
])
137.
{
138.
$Page
=1;
139.
}
140.
141.
$Prev_Page
=
$Page
-1;
142.
$Next_Page
=
$Page
+1;
143.
144.
$Page_Start
= ((
$Per_Page
*
$Page
)-
$Per_Page
);
145.
if
(
$Num_Rows
<=
$Per_Page
)
146.
{
147.
$Num_Pages
=1;
148.
}
149.
else
if
((
$Num_Rows
%
$Per_Page
)==0)
150.
{
151.
$Num_Pages
=(
$Num_Rows
/
$Per_Page
) ;
152.
}
153.
else
154.
{
155.
$Num_Pages
=(
$Num_Rows
/
$Per_Page
)+1;
156.
$Num_Pages
= (int)
$Num_Pages
;
157.
}
158.
159.
$strSQL
.=
" order by cus_id ASC LIMIT $Page_Start , $Per_Page"
;
160.
$objQuery
= mysql_query(
$strSQL
);
161.
162.
?>
163.
</p>
164.
<table width=
"626"
border=
"1"
align=
"center"
cellpadding=
"1"
cellspacing=
"0"
bordercolor=
"#000000"
>
165.
<tr>
166.
<td colspan=
"6"
><div align=
"center"
><strong><span
class
=
"style25"
>ใบเสร็จประจำเดือน ปี</span></strong></div></td>
167.
</tr>
168.
<tr>
169.
<td width=
"85"
bgcolor=
"#A9D2F3"
><div align=
"center"
><strong><span
class
=
"style25"
>เลขที่ใบเสร็จ</span></strong></div></td>
170.
<td width=
"70"
bgcolor=
"#A9D2F3"
><div align=
"center"
><strong><span
class
=
"style25"
>รหัสผู้ใช้น้ำ</span></strong></div></td>
171.
<td width=
"101"
bgcolor=
"#A9D2F3"
><div align=
"center"
><strong><span
class
=
"style25"
>ชื่อ-นามสกุล</span></strong></div></td>
172.
<td width=
"160"
bgcolor=
"#A9D2F3"
><div align=
"center"
><strong><span
class
=
"style25"
>รายละเอียดการใช้น้ำ</span></strong></div></td>
173.
<td width=
"76"
bgcolor=
"#A9D2F3"
><div align=
"center"
><strong><span
class
=
"style25"
>พิมพ์ใบเสร็จ</span></strong></div></td>
174.
<td bgcolor=
"#A9D2F3"
><div align=
"center"
><strong><span
class
=
"style25"
>สถานะใบเสร็จ</span></strong></div></td>
175.
</tr> <?
176.
$i
= 0;
177.
while
(
$dbarr
= mysql_fetch_array(
$objQuery
))
178.
{
179.
$i
++;
180.
?>
181.
<tr>
182.
<td><div align=
"center"
><span
class
=
"style25"
><?php
echo
$dbarr
[
'receipt_id'
] ?></span></div></td>
183.
<td><div align=
"center"
><span
class
=
"style25"
><?php
echo
$dbarr
[
'cus_id'
] ?></span></div></td>
184.
<td><div align=
"center"
><span
class
=
"style25"
><?php
echo
$dbarr
[
'cus_name'
] ?><?php
echo
$dbarr
[
'cus_lastname'
] ?></span></div></td>
185.
<td><div align=
"center"
class
=
"style25"
><a href=
"receipt_detai1.php?receipt_id=<?=$dbarr['receipt_id'];?>"
>ดูรายละเอียด</a></div></td>
186.
187.
<td><div align=
"center"
><a href=
"receipt_new.php"
target=
"_blank"
><img src=
"icon/printer.png"
width=
"25"
height=
"25"
border=
"0"
/></a></div></td>
188.
<td><div align=
"center"
class
=
"style25"
>ยังไม่จ่าย</div></td>
189.
<?php
190.
}
191.
?>
192.
</tr>
193.
</table>
194.
<p> </p>
195.
<p align=
"center"
class
=
"style26"
><a href=
"search_receipt.php"
>< ค้นหาใบเสร็จ ></a> <a href=
"index11.php"
> < กลับหน้าแรก ></a></p>
196.
</form> <?
197.
if
(
$Prev_Page
)
198.
{
199.
echo
" <a href='$_SERVER[SCRIPT_NAME]?Page=$Prev_Page'><< ก่อนหน้า</a> "
;
200.
}
201.
202.
for
(
$i
=1;
$i
<=
$Num_Pages
;
$i
++){
203.
if
(
$i
!=
$Page
)
204.
{
205.
echo
"[ <a href='$_SERVER[SCRIPT_NAME]?Page=$i'>$i</a> ]"
;
206.
}
207.
else
208.
{
209.
echo
"<b> $i </b>"
;
210.
}
211.
}
212.
if
(
$Page
!=
$Num_Pages
)
213.
{
214.
echo
" <a href ='$_SERVER[SCRIPT_NAME]?Page=$Next_Page'>ถัดไป>></a> "
;
215.
}
216.
mysql_close(
$objConnect
);
217.
?>
218.
<p> </p>
219.
<p> </p>
220.
<!-- InstanceEndEditable --></td>
221.
</tr>
222.
<tr>
223.
<td height=
"30"
bgcolor=
"#3F94E9"
><div align=
"center"
class
=
"style22"
>การประปาหมู่บ้านปากทาง<br />
224.
24 ม.13 ต.ตลิ่งชัน อ.บันนังสตา จ.ยะลา 95130<br />
225.
โทรศัพท์ : 081-7983950 </div></td>
226.
</tr>
227.
</table>
228.
229.
</body>
230.
<!-- InstanceEnd --></html>