$sql = " SELECT * from {$g5['g5_shop_item_table']} order by it_order desc";
$result = sql_query($sql);
$file_alias ="itemlist_".date('Ymd').".xls";
header('Content-Type: application/vnd.ms-excel; charset=utf-8');
Header('Content-Disposition: attachment; filename=' . $file_alias);
header('Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0');
header( 'Content-Description: PHP4 Generated Data');
Header('Pragma: no-cache');
Header('Expires: 0');
/* ================================= */
$tableHeader = array(
"상품코드","기본분류","분류2","분류3","상품명","기본설명","재고수량","제조사","원산지","모델","판매가격","과세유형","판매가능","견적문의","히트","추천","신상","베스트","파격세일",/*"상품설명",*/"이미지1","이미지2","이미지3","이미지4","이미지5","이미지6","이미지7","이미지8","이미지9","이미지10"
);
echo "<table>";
echo "<thead>";
echo "<tr>";
foreach ($tableHeader as $v) {
echo "<th>{$v}</th>";
}
echo "</tr>";
echo "</thead>";
echo "<tbody>";
while ($row = sql_fetch_array($result)) {
echo "<tr>";
echo "<td>{$row['it_id']}</td>";
echo "<td>{$row['ca_id']}</td>";
echo "<td>{$row['ca_id2']}</td>";
echo "<td>{$row['ca_id3']}</td>";
echo "<td>{$row['it_name']}</td>";
echo "<td>{$row['it_basic']}</td>";
echo "<td>{$row['it_stock_qty']}</td>";
echo "<td>{$row['it_maker']}</td>";
echo "<td>{$row['it_origin']}</td>";
echo "<td>{$row['it_model']}</td>";
echo "<td>{$row['it_price']}</td>";
echo "<td>{$row['it_notax']}</td>";
echo "<td>{$row['it_use']}</td>";
echo "<td>{$row['it_tel_inq']}</td>";
echo "<td>{$row['it_type1']}</td>";
echo "<td>{$row['it_type2']}</td>";
echo "<td>{$row['it_type3']}</td>";
echo "<td>{$row['it_type4']}</td>";
echo "<td>{$row['it_type5']}</td>";
//echo "<td>{$row['it_explan']}</td>";
echo "<td>{$row['it_img1']}</td>";
echo "<td>{$row['it_img2']}</td>";
echo "<td>{$row['it_img3']}</td>";
echo "<td>{$row['it_img4']}</td>";
echo "<td>{$row['it_img5']}</td>";
echo "<td>{$row['it_img6']}</td>";
echo "<td>{$row['it_img7']}</td>";
echo "<td>{$row['it_img8']}</td>";
echo "<td>{$row['it_img9']}</td>";
echo "<td>{$row['it_img10']}</td>";
echo "</tr>";
}
echo "</tbody>";
echo "</table>";