excelDownChargeList.php
1.98 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
<? 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>