<?php
include_once('./_common.php');

$xls_name = date("YmdHis", $_conf['server_time'])."_coupon.xls";

    header("Pragma: public");
    header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
    header("Expires: 0");
    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 *,
            (od_cart_coupon + od_coupon + od_send_coupon) as couponprice
           $sql_common
           order by $sort1 $sort2
           limit $from_record, $rows ";
		   $sql= stripslashes($sql);
//echo $sql_common;
//echo $sql;
$result = sql_query($sql);

?>
 <meta http-equiv="Content-Type" content="application/vnd.ms-excel;charset=utf-8">
<table>

<?php
    for ($i=0; $row=sql_fetch_array($result); $i++)
    {
?>
<tr>
	<td><?php echo $row['od_b_name']?></td>
</tr>

<?php
	}
?>

</table>