excelDownVacancy.php
2.37 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
69
70
71
72
73
74
75
<? 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>