주문내역출력시 '보내는사람'도 출력하려면 어떻게 해야 하나요?
XLS 나 CSV 로 저장하고 출력하려고 할때 보내는 사람 정보도 필요해서요.
앞에 여러글을 검색해 봐도 어떤 부분을 수정해야 할 지 몰라 질문 올립니다.
XLS 나 CSV 로 저장하고 출력하려고 할때 보내는 사람 정보도 필요해서요.
앞에 여러글을 검색해 봐도 어떤 부분을 수정해야 할 지 몰라 질문 올립니다.
댓글 2개
CSV 출력을 이렇게 수정해 보시기 바랍니다.
adm/shop_admin/orderprintresult.php
$sql = " SELECT od_name, od_tel, od_hp, od_zip1, od_zip2, od_addr1, od_addr2, od_b_zip1, od_b_zip2, od_b_addr1, od_b_addr2, od_b_name, od_b_tel, od_b_hp, it_name, ct_qty, b.it_id, a.od_id, od_memo, od_invoice
FROM $g4[yc4_order_table] a, $g4[yc4_cart_table] b, $g4[yc4_item_table] c
where a.on_uid = b.on_uid
and b.it_id = c.it_id ";
if ($case == 1) // 출력기간
$sql .= " and a.od_time between '$fr_date 00:00:00' and '$to_date 23:59:59' ";
else // 주문번호구간
$sql .= " and a.od_id between '$fr_od_id' and '$to_od_id' ";
if ($ct_status)
$sql .= " and b.ct_status = '$ct_status' ";
$sql .=" order by od_time asc ";
$result = sql_query($sql);
$cnt = @mysql_num_rows($result);
if (!$cnt)
alert("출력할 내역이 없습니다.");
//header('Content-Type: text/x-csv');
header("Content-charset=$g4[charset]");
header('Content-Type: doesn/matter');
header('Expires: ' . gmdate('D, d M Y H:i:s') . ' GMT');
header('Content-Disposition: attachment; filename="' . date("ymd", time()) . '.csv"');
header('Cache-Control: must-revalidate, post-check=0, pre-check=0');
header('Pragma: public');
//echo "우편번호,주소,이름,전화1,전화2,상품명,수량,비고,전하실말씀\n";
echo "우편번호,주소,이름,전화1,전화2,우편번호,주소,이름,전화1,전화2,상품명,수량,상품코드,주문번호,운송장번호,전하실말씀\n";
for ($i=0; $row=mysql_fetch_array($result); $i++)
{
echo '"' . $row[od_zip1] . '-' . $row[od_zip2] . '"' . ',';
echo '"' . $row[od_addr1] . '-' . $row[od_addr2] . '"' . ',';
echo '"' . $row[od_name] . '"' . ',';
echo '"' . conv_telno($row[od_tel]) . '"' . ',';
echo '"' . conv_telno($row[od_hp]) . '"' . ',';
echo '"' . $row[od_b_zip1] . '-' . $row[od_b_zip2] . '"' . ',';
echo '"' . $row[od_b_addr1] . ' ' . $row[od_b_addr2] . '"' . ',';
echo '"' . $row[od_b_name] . '"' . ',';
adm/shop_admin/orderprintresult.php
$sql = " SELECT od_name, od_tel, od_hp, od_zip1, od_zip2, od_addr1, od_addr2, od_b_zip1, od_b_zip2, od_b_addr1, od_b_addr2, od_b_name, od_b_tel, od_b_hp, it_name, ct_qty, b.it_id, a.od_id, od_memo, od_invoice
FROM $g4[yc4_order_table] a, $g4[yc4_cart_table] b, $g4[yc4_item_table] c
where a.on_uid = b.on_uid
and b.it_id = c.it_id ";
if ($case == 1) // 출력기간
$sql .= " and a.od_time between '$fr_date 00:00:00' and '$to_date 23:59:59' ";
else // 주문번호구간
$sql .= " and a.od_id between '$fr_od_id' and '$to_od_id' ";
if ($ct_status)
$sql .= " and b.ct_status = '$ct_status' ";
$sql .=" order by od_time asc ";
$result = sql_query($sql);
$cnt = @mysql_num_rows($result);
if (!$cnt)
alert("출력할 내역이 없습니다.");
//header('Content-Type: text/x-csv');
header("Content-charset=$g4[charset]");
header('Content-Type: doesn/matter');
header('Expires: ' . gmdate('D, d M Y H:i:s') . ' GMT');
header('Content-Disposition: attachment; filename="' . date("ymd", time()) . '.csv"');
header('Cache-Control: must-revalidate, post-check=0, pre-check=0');
header('Pragma: public');
//echo "우편번호,주소,이름,전화1,전화2,상품명,수량,비고,전하실말씀\n";
echo "우편번호,주소,이름,전화1,전화2,우편번호,주소,이름,전화1,전화2,상품명,수량,상품코드,주문번호,운송장번호,전하실말씀\n";
for ($i=0; $row=mysql_fetch_array($result); $i++)
{
echo '"' . $row[od_zip1] . '-' . $row[od_zip2] . '"' . ',';
echo '"' . $row[od_addr1] . '-' . $row[od_addr2] . '"' . ',';
echo '"' . $row[od_name] . '"' . ',';
echo '"' . conv_telno($row[od_tel]) . '"' . ',';
echo '"' . conv_telno($row[od_hp]) . '"' . ',';
echo '"' . $row[od_b_zip1] . '-' . $row[od_b_zip2] . '"' . ',';
echo '"' . $row[od_b_addr1] . ' ' . $row[od_b_addr2] . '"' . ',';
echo '"' . $row[od_b_name] . '"' . ',';
게시글 목록
| 번호 | 제목 |
|---|---|
| 56073 | |
| 56067 | |
| 56065 | |
| 56060 | |
| 56058 | |
| 56055 | |
| 56051 | |
| 56048 | |
| 56044 | |
| 56043 | |
| 56042 | |
| 56039 | |
| 56035 | |
| 56032 | |
| 56030 | |
| 56028 | |
| 56025 | |
| 56018 | |
| 56012 | |
| 56010 |
댓글 작성
댓글을 작성하시려면 로그인이 필요합니다.
로그인하기