91fc6616e2d2a32cdc67b3273f1494f8f1276c9b.svn-base 2.37 KB
<? include $_SERVER["DOCUMENT_ROOT"] . "/common/classes/AdminRent.php" ?>
<?
	$obj = new AdminRent($_REQUEST, "") ;
	
	$list = $obj->getListOfVacancyForExcel(null, null) ;
	//$list = array();

	$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" );

?>
<?
	$search_text=$_REQUEST["search_text"];
	$manage_type=$_REQUEST["manage_type"];
	
	if($search_text!="" || $manage_type!=""){
		$list=$obj->getListOfVacancyForExcel($search_text, $manage_type);
	}
?>
 <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>
	</tr>
            
                <? for($i=0; $i<sizeof($list); $i++){?>
                
                <tr>
                    <td class="no center">
                        <?=$vnum--?>
                    </td>
					<td style="text-align:center;">
					<?=$list[$i]["name"] ?>
                    </td>
                    <td class="center">
                    <?
                    switch($list[$i]["manage_type"]):
						case 'LC': echo '장기위탁'; break;
						case 'SC': echo '단기위탁'; break;
						case 'LS': echo '장기자기'; break;
						case 'SS': echo '단기자기'; break;
                    endswitch;
                    ?>
                    </td>
                    <td class="center">
                    <?=$list[$i]["manager_name"] ?>
                    </td>
                    <td class="center">
                    <?=$list[$i]["address"] ?>
                    </td>
                    <td class="center">
                    <?=$list[$i]["room_cnt"] ?>/<?=$list[$i]["empty_cnt"] ?>/
                    <?
                    if($list[$i]["room_cnt"]==0) echo "0.00%";
                    else 
                    	printf("%.2f%%", (($list[$i]["empty_cnt"])/$list[$i]["room_cnt"]) * floatval(100.0)) 
                    ?>
                    </td>
                </tr>
                <? } ?>
               
         
  </table>