excelDownChargeList.php 1.98 KB
<? include $_SERVER["DOCUMENT_ROOT"] . "/common/classes/AdminRent.php" ?>
<?
	$obj = new AdminRent($_REQUEST) ;
	$list = $obj->getListOfRequestChargeForExcel() ;
	$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 class="datacList">
   	<tr style = 'background-color:#EBF4FF ;'>
	        <td>No</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]["building_name"]?>
                    </td>
                    <td class="center">
                    <?=$list[$i]["room_name"]?>
                    </td>
                    <td class="center">
                    <?=$list[$i]["info"]?>
                    </td>
                    <td class="center">
                    <?php 
					$formattedDate = date('Y-m-d', strtotime($list[$i]["request_date"]));
					if($formattedDate == "1970-01-01") $formattedDate = "";
					?>
					<?=$formattedDate?>
                    </td>
                    <td class="center">
                    <?php 
					$formattedDate = date('Y-m-d', strtotime($list[$i]["handled_date"]));
					if($formattedDate == "1970-01-01") $formattedDate = "";
					?>
					<?=$formattedDate?>
                    </td>
                    <td class="center">
                    <?=$list[$i]["charge"]?>
                    </td>
                </tr>
                <? } ?>
        </table>