excelDownBillUtil.php
2.29 KB
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
<? include $_SERVER["DOCUMENT_ROOT"] . "/common/classes/AdminOperate.php" ?>
<?
$obj = new AdminOperate($_REQUEST, "") ;
$list = $obj->getListOfBillHistoryForExcel() ;
$vnum = $obj->virtualNum ;
?>
<?
$fileName = "공과금 리스트_".date("YmdHis",time());
header( "Content-type: application/vnd.ms-excel; charset=utf-8");
header( "Content-Disposition: attachment; filename=$fileName.xls" );
header( "Content-Description: PHP4 Generated Data" );
?>
<meta http-equiv="Content-Type" content="application/vnd.ms-excel; charset=utf-8">
<table border = '1'>
<tr style = 'background-color:#EBF4FF ;'>
<td>No</td>
<td>년/월</td>
<td>입주자</td>
<td>공과급입금일</td>
<td>가스료</td>
<td>전기료</td>
<td>수도료</td>
<td>공용전기료</td>
<td>공용수도료</td>
<td>상태</td>
</tr>
<? for($i=0; $i<sizeof($list); $i++){ ?>
<tr>
<td class="no center">
<?=$vnum--?>
</td>
<td class="center">
<?=$list[$i]["month"]?>
</td>
<td class="center">
<?=$list[$i]["contractor_name"]?>
</td>
<td class="center">
<?=$list[$i]["billing_date"]?>
</td>
<td class="center">
<?=$list[$i]["gas_charge"]?>
</td>
<td class="center">
<?=$list[$i]["electricity_charge"]?>
</td>
<td class="center">
<?=$list[$i]["water_charge"]?>
</td>
<td class="center">
<?=$list[$i]["community_electricity_charge"]?>
</td>
<td class="center">
<?=$list[$i]["community_water_charge"]?>
</td>
<td>
<?
if($list[$i]["is_paid"]==0) echo "연체";
else if($list[$i]["is_paid"]==1) echo "납입";
else echo "청구중";
?>
</td>
</tr>
<? } ?>
</table>