테스트 사이트 - 개발 중인 베타 버전입니다

주문내역만 출력하기...

· 12년 전 · 242 · 4
001.jpg

/shop/orderinquiry.php 파일에
 
<button onclick="window.open('<?="./orderinquiry_print.php"?>', 'orderinquiryprint', 'width=700,height=1000');">프린트</button>
 
 
<?
include_once("./_common.php");

$od_pwd = sql_password($od_pwd);
// 회원인 경우
if ($is_member)
{
    $sql_common = " from $g4[yc4_order_table] where mb_id = '$member[mb_id]' ";
}
else if ($od_id && $od_pwd) // 비회원인 경우 주문서번호와 비밀번호가 넘어왔다면
{
    $sql_common = " from $g4[yc4_order_table] where od_id = '$od_id' and od_pwd = '$od_pwd' ";
}
else // 그렇지 않다면 로그인으로 가기
{
    goto_url("$g4[bbs_path]/login.php?url=".urlencode("$g4[shop_path]/orderinquiry.php"));
}
// 테이블의 전체 레코드수만 얻음
$sql = " select count(*) as cnt " . $sql_common;
$row = sql_fetch($sql);
$total_count = $row[cnt];
// 비회원 주문확인시 비회원의 모든 주문이 다 출력되는 오류 수정
// 조건에 맞는 주문서가 없다면
if ($total_count == 0)
{
    if ($is_member) // 회원일 경우는 메인으로 이동
        alert("주문이 존재하지 않습니다.", $g4[path]);
    else // 비회원일 경우는 이전 페이지로 이동
        alert("주문이 존재하지 않습니다.");
}
 

// 비회원 주문확인의 경우 바로 주문서 상세조회로 이동
if (!$is_member)
{
    $sql = " select od_id, on_uid from $g4[yc4_order_table] where od_id = '$od_id' and od_pwd = '$od_pwd' ";
    $row = sql_fetch($sql);
    if ($row[od_id]) {
        set_session("ss_on_uid_inquiry", $row[on_uid]);
        goto_url("$g4[shop_path]/orderinquiryview.php?od_id=$row[od_id]&on_uid=$row[on_uid]");
    }
}
$g4[title] = "주문내역";
include_once("../head.sub.php");
?>
<img src="<?=$g4[shop_img_path]?>/top_orderinquiry.gif" border=0><p>
<table width=100% cellpadding=0 cellspacing=0 border=0>
<tr>
    <td>
 
<table width=98% align=center cellpadding=0 cellspacing=0 border=0>
<colgroup width=100>
<colgroup width=''>
<colgroup width=80>
<colgroup width=120>
<colgroup width=120>
<colgroup width=120>
<? if (!$limit) { echo "<tr><td colspan=6 align=right>총 {$cnt} 건</td></tr>"; } ?>
<tr><td height=2 colspan=6 class=c1></td></tr>
<tr align=center height=28 class=c2>
    <td>주문서번호</td>
    <td>주문일시</td>
    <td>상품수</td>
    <td>주문금액</td>
    <td>입금액</td>
    <td>미입금액</td>
</tr>
<tr><td height=1 colspan=6 class=c1></td></tr>
<?
$sql = " select a.od_id,
                a.*, "._MISU_QUERY_."
           from $g4[yc4_order_table] a
           left join $g4[yc4_cart_table] b on (b.on_uid=a.on_uid)
          where mb_id = '$member[mb_id]'
          group by a.od_id
          order by a.od_id desc
           ";
$result = sql_query($sql);
for ($i=0; $row=sql_fetch_array($result); $i++)
{
    if ($i > 0)
        echo "<tr><td colspan=6 height=1 background='$g4[shop_img_path]/dot_line.gif'></td></tr>\n";
    echo "<tr height=28>\n";
    echo "<td align=center>";
    echo "<input type=hidden name='ct_id[$i]' value='$row[ct_id]'>\n";
    echo "<U>$row[od_id]</U></td>\n";
    echo "<td align=center>".substr($row[od_time],0,16)." (".get_yoil($row[od_time]).")</td>\n";
    echo "<td align=center>$row[itemcount]</td>\n";
    echo "<td align=right>".display_amount($row[orderamount])."&nbsp;&nbsp;</td>\n";
    echo "<td align=right>".display_amount($row[receiptamount])."&nbsp;&nbsp;</td>\n";
    echo "<td align=right>".display_amount($row[misu])."&nbsp;&nbsp;</td>\n";
    echo "</tr>\n";
}
if ($i == 0)
    echo "<tr><td colspan=20 height=100 align=center><span class=point>주문 내역이 없습니다.</span></td></tr>";
?>
<tr><td colspan=20 height=1 bgcolor=#94D7E7></td></tr>
</table><br>
    </td>
</tr>
</table>
<script>
window.print();
</script>
<?
include_once("$g4[path]/tail.sub.php");
?>
 
 
버그나 문제점은 관리자님한테... 질문답변이용 바람~

댓글 작성

댓글을 작성하시려면 로그인이 필요합니다.

로그인하기

댓글 4개

11년 전
<button onclick="window.open('<?="./orderinquiry_print.php?>', 'orderinquiryprint', 'width=700,height=1000');">프린트</button>
에서 에러문구가 계속 뜨네요.. ㅠㅠ
에러 문구가 모죠???
11년 전
Parse error: syntax error, unexpected '<' in /home/hosting_users/nher/www/shop/orderinquiry_print.php on line 12

이렇게 오류가 뜹니다.. 라인 12는 orderinquiry_print.php 를 다 지워보고
<button onclick="window.open('<?="./orderinquiry_print.php?>', 'orderinquiryprint', 'width=700,height=1000');">프린트</button>
만 넣어보았는데 역시나 같은 에러문구가 뜨더라구요..

답변해 주셔서 고맙습니다^^
<button onclick="window.open('<?="./orderinquiry_print.php"?>', 'orderinquiryprint', 'width=700,height=1000');">프린트</button>

오타네요 orderinquiry_print.php => orderinquiry_print.php"

게시글 목록

번호 제목
1790
1788
1786
1782
1780
1778
1767
1762
1754
1748
1739
1736
1735
1731
1717
1712
1704
1700
1696
1682