66 lines
2.3 KiB
PHP
66 lines
2.3 KiB
PHP
<?php
|
|
include_once('./_common.php');
|
|
|
|
$file_name = "orderlist_".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 = " SELECT a.*,
|
|
(a.od_cart_coupon + a.od_coupon + a.od_send_coupon) as couponprice,
|
|
b.it_name,
|
|
b.ct_qty,
|
|
b.ct_price,
|
|
b.ct_option,
|
|
c.ca_id
|
|
$sql_common
|
|
ORDER BY $sort1 $sort2
|
|
";
|
|
$sql= stripslashes($sql);
|
|
$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>
|
|
<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="no-text"><?php echo $row['od_id']; ?> </td>
|
|
<td class="no-text"><?php echo $row['od_app_no']?> </td>
|
|
<td style="text-align:center"> <?php echo $row['od_name']?> </td>
|
|
<td class="no-text"><?php echo get_text($row['od_tel']); ?></td>
|
|
<td style="text-align:center"> <?php echo $row['od_status']?> </td>
|
|
<td style="text-align:center"> <?php echo $row['it_name'];?> </td>
|
|
<td style="text-align:center"> <?php echo $row['ct_qty'];?> </td>
|
|
<td style="text-align:center"> <?php echo number_format($row['ct_price']);?> </td>
|
|
<td style="text-align:center"> <?php echo number_format($row['ct_price'] * $row['ct_qty']);?> </td>
|
|
<td style="text-align:center"><?php echo number_format($row['od_cart_price'] + $row['od_send_cost'] + $row['od_send_cost2']); ?></td>
|
|
</tr>
|
|
<?php } // 반복문 종료 ?>
|
|
|
|
</tbody>
|
|
</table>
|