Files
firstgarden-web-gnu/manager/adm/adm_log.excel.php

48 lines
1.4 KiB
PHP

<?php
include_once('_common.php');
if (!defined('_GNUBOARD_')) exit; // 개별 페이지 접근 불가
$file_name = "viplist_".date("ymd")."_".date("His").".xls"; // 파일명지정
header("Content-Type: application/vnd.ms-excel");
header('Content-Type: application/vnd.ms-excel; charset=utf-8');
header("Content-Disposition: attachment; filename=$file_name");
header("Content-Description: PHP5 Generated Data");
$sql = stripslashes($sql_common);
$result = sql_query($sql);
?>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8">
<style type="text/css">
.tit {background-color:#C0C0C0; height:30px; }
.no-text {mso-number-format:'\@'; text-align:center;}
</style>
<table cellspacing="0" cellpadding="0" border="1">
<thead>
<tr>
<th class="tit">번호</th>
<th class="tit">작업구분</th>
<th class="tit">작업내용</th>
<th class="tit">작업자</th>
<th class="tit">작업일시</th>
</tr>
</thead>
<tbody>
<?php
for ($i=0; $row=sql_fetch_array($result); $i++) { // 반복문 시작
?>
<tr>
<td class="text-align:center"><?php echo $row['idx']?> </td>
<td class="text-align:center"><?php echo $row['work']?> </td>
<td style="no-text"> <?php echo $row['work_detail']?> </td>
<td class="text-align:center"><?php echo $row['id']?> </td>
<td style="text-align:center"> <?php echo date('Y-m-d H:i',strtotime($row['date']));?> </td>
</tr>
<?php } // 반복문 종료 ?>
</tbody>
</table>