엑셀 배송일괄처리시 엑셀 다운로드가 되지 않을때
엑셀 배송일괄처리시 엑셀 다운로드가 되지 않을때
/adm/shop_admin/orderdelivery.php 파일을 아래의 소스코드로 교체합니다.
<?php
/* orderdelivery.php */
$sub_menu = '400400';
include_once('./_common.php');
auth_check($auth[$sub_menu], "w");
// 주문정보
$sql = " select *
from {$g5['g5_shop_order_table']}
where od_misu = '0'
and od_status = '준비'
order by od_id desc ";
$result = sql_query($sql);
if(!@sql_num_rows($result))
alert_close('배송처리할 주문 내역이 없습니다.');
/*================================================================================
php_writeexcel http://www.bettina-attack.de/jonny/view.php/projects/php_writeexcel/
=================================================================================*/
include_once(G5_LIB_PATH.'/Excel/php_writeexcel/class.writeexcel_workbook.inc.php');
include_once(G5_LIB_PATH.'/Excel/php_writeexcel/class.writeexcel_worksheet.inc.php');
$fname = tempnam(G5_DATA_PATH, "tmp-deliverylist.xls");
$workbook = new writeexcel_workbook($fname);
$worksheet = $workbook->addworksheet();
// Put Excel data
$data = array('주문번호', '주문자명', '주문자전화1', '주문자전화2', '배송자명', '배송지전화1', '배송지전화2', '배송지주소', '배송회사', '운송장번호');
$data = array_map('iconv_euckr', $data);
$col = 0;
foreach($data as $cell) {
$worksheet->write(0, $col++, $cell);
}
for($i=1; $row=sql_fetch_array($result); $i++) {
$row = array_map('iconv_euckr', $row);
$worksheet->write($i, 0, ' '.$row['od_id']);
$worksheet->write($i, 1, $row['od_name']);
$worksheet->write($i, 2, ' '.$row['od_tel']);
$worksheet->write($i, 3, ' '.$row['od_hp']);
$worksheet->write($i, 4, $row['od_b_name']);
$worksheet->write($i, 5, ' '.$row['od_b_tel']);
$worksheet->write($i, 6, ' '.$row['od_b_hp']);
$worksheet->write($i, 7, print_address($row['od_b_addr1'], $row['od_b_addr2'], $row['od_b_addr3'], $row['od_b_addr_jibeon']));
$worksheet->write($i, 8, $row['od_delivery_company']);
$worksheet->write($i, 9, $row['od_invoice']);
}
$workbook->close();
header("Content-Type: application/x-msexcel; name=\"deliverylist-".date("ymd", time()).".xls\"");
header("Content-Disposition: inline; filename=\"deliverylist-".date("ymd", time()).".xls\"");
$fh=fopen($fname, "rb");
fpassthru($fh);
unlink($fname);
?>
/adm/shop_admin/orderdelivery.php 파일을 아래의 소스코드로 교체합니다.
<?php
/* orderdelivery.php */
$sub_menu = '400400';
include_once('./_common.php');
auth_check($auth[$sub_menu], "w");
// 주문정보
$sql = " select *
from {$g5['g5_shop_order_table']}
where od_misu = '0'
and od_status = '준비'
order by od_id desc ";
$result = sql_query($sql);
if(!@sql_num_rows($result))
alert_close('배송처리할 주문 내역이 없습니다.');
/*================================================================================
php_writeexcel http://www.bettina-attack.de/jonny/view.php/projects/php_writeexcel/
=================================================================================*/
include_once(G5_LIB_PATH.'/Excel/php_writeexcel/class.writeexcel_workbook.inc.php');
include_once(G5_LIB_PATH.'/Excel/php_writeexcel/class.writeexcel_worksheet.inc.php');
$fname = tempnam(G5_DATA_PATH, "tmp-deliverylist.xls");
$workbook = new writeexcel_workbook($fname);
$worksheet = $workbook->addworksheet();
// Put Excel data
$data = array('주문번호', '주문자명', '주문자전화1', '주문자전화2', '배송자명', '배송지전화1', '배송지전화2', '배송지주소', '배송회사', '운송장번호');
$data = array_map('iconv_euckr', $data);
$col = 0;
foreach($data as $cell) {
$worksheet->write(0, $col++, $cell);
}
for($i=1; $row=sql_fetch_array($result); $i++) {
$row = array_map('iconv_euckr', $row);
$worksheet->write($i, 0, ' '.$row['od_id']);
$worksheet->write($i, 1, $row['od_name']);
$worksheet->write($i, 2, ' '.$row['od_tel']);
$worksheet->write($i, 3, ' '.$row['od_hp']);
$worksheet->write($i, 4, $row['od_b_name']);
$worksheet->write($i, 5, ' '.$row['od_b_tel']);
$worksheet->write($i, 6, ' '.$row['od_b_hp']);
$worksheet->write($i, 7, print_address($row['od_b_addr1'], $row['od_b_addr2'], $row['od_b_addr3'], $row['od_b_addr_jibeon']));
$worksheet->write($i, 8, $row['od_delivery_company']);
$worksheet->write($i, 9, $row['od_invoice']);
}
$workbook->close();
header("Content-Type: application/x-msexcel; name=\"deliverylist-".date("ymd", time()).".xls\"");
header("Content-Disposition: inline; filename=\"deliverylist-".date("ymd", time()).".xls\"");
$fh=fopen($fname, "rb");
fpassthru($fh);
unlink($fname);
?>
댓글 2개
adsdsf
5년 전
123412341234
5년 전
필요했던 정보인데 감사합니다ㅠ
게시판 목록
영카트5 팁자료실
| 번호 | 제목 | 글쓴이 | 날짜 | 조회 |
|---|---|---|---|---|
| 311 |
투명한열정
|
5년 전 | 2848 | |
| 310 |
|
5년 전 | 6388 | |
| 309 |
|
5년 전 | 3349 | |
| 308 |
|
5년 전 | 3782 | |
| 307 |
|
5년 전 | 3203 | |
| 306 |
|
5년 전 | 2880 | |
| 305 | 5년 전 | 4506 | ||
| 304 | 5년 전 | 5988 | ||
| 303 | 5년 전 | 5188 | ||
| 302 | 5년 전 | 2313 | ||
| 301 | 5년 전 | 3604 | ||
| 300 | 5년 전 | 2493 | ||
| 299 | 5년 전 | 2150 | ||
| 298 |
|
5년 전 | 1978 | |
| 297 |
sozet
|
5년 전 | 2279 | |
| 296 |
sozet
|
5년 전 | 2439 | |
| 295 |
sozet
|
5년 전 | 4635 | |
| 294 |
sozet
|
5년 전 | 2651 | |
| 293 |
|
5년 전 | 2823 | |
| 292 | 5년 전 | 2030 | ||
| 291 | 5년 전 | 6672 | ||
| 290 | 5년 전 | 2639 | ||
| 289 |
퍼스트가든
|
5년 전 | 2669 | |
| 288 | 5년 전 | 3003 | ||
| 287 | 5년 전 | 2673 | ||
| 286 |
사노라가노라
|
6년 전 | 2699 | |
| 285 |
사노라가노라
|
6년 전 | 2074 | |
| 284 | 6년 전 | 4793 | ||
| 283 |
v푸른하늘v
|
6년 전 | 3871 | |
| 282 |
|
6년 전 | 4164 |
댓글 작성
댓글을 작성하시려면 로그인이 필요합니다.
로그인하기