excelDownBillUtil.php 2.29 KB
<? 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>