{action->getTitle        assign=title}
{action->getMode         assign=mode}
{action->getPage         assign=page}
{action->getLink assign=link}
{include file="header.html"}

{auth->checkAuth assign=check}
{if $check}
{auth->getAuthData name=membercd assign=membercd}
{header->getHeaderData membercd=$membercd assign=headerdata}
{else}
{header->getHeaderData assign=headerdata}
{/if}

<div id="contents">

<div id="pankuzu">
  <ul>
    <li><a href="{$dirName}/index.php">トップ</a></li>
    <li>&nbsp;&gt;&nbsp;<a href="{$smarty.const.URL_ROOT}{$dirName}/?action=customer_mypage">マイページ</a></li>
    <li class="last">&nbsp;&gt;&nbsp;{$title}</li>
  </ul>
</div>
<!--End of pankuzu-->

<div id="etc">
  <h3>{$title}</h3>

{if $mode ne "estimate"}
  <p>
    <form action="{$scriptName}" method="GET">
    <input type="hidden" name="action" value="customer_itembuy_order_list">
    <select name="mode">
      <option value="news" {if $mode == "news"}selected{/if}>最近の利用明細一覧
      <option value="past" {if $mode == "past"}selected{/if}>過去半年の利用明細一覧
      <option value="year2007" {if $mode == "year2007"}selected{/if}>2007年の利用明細
      <option value="year2006" {if $mode == "year2006"}selected{/if}>2006年の利用明細
    </select>
    &nbsp;&nbsp;&nbsp;
    <input class="go" type="submit" value="表示">
    </form>
  </p>
{/if}

  <p>{$link}&nbsp;{if $action.cnt>0}{$action.cnt}件のデータ{/if}</p>

  <table border="0" cellspacing="0" cellpadding="0" class="entryform">
{foreach from=$action.orderlist item=list}
    <tr>
      <th colspan="3">
        注文番号：{$list.orderno}　注文日：{$list.orderdate|nl2br|date_format:"%Y/%m/%d"}
      </th>
    </tr>

{foreach from=$list.orderdetail item=item}
    <tr>
      <td rowspan="3" width="160">
        <img src="img.php?c={$item.itemcd}&s=S&d=1" width="147" border="0" alt="{$item.itemnm|escape}">
      </td>
      <td class="caution" width="100">出品者：</td>
      <td>{if $list.sellernm=="onedepo"}{$headerdata.systeminfo.shopnm}{else}{$list.sellernm}{/if}</td>
    </tr>
    <tr>
      <td class="caution" width="100">タイトル：</td>
      <td>{$item.itemnm|escape}</td>
    </tr>

    <tr>
      <td colspan="2">
{if $action.mode =="estimate"}
        <p><button class="estimate" onclick="JavaScript:location.href='{$scriptName}?action=customer_itembuy_valuation_form&mode={$mode}&page={$page}&no={$list.orderno}';return false;">評価</button></p>
{/if}
{if $action.mode <>"estimate"}
{if $item.download}

{if !empty($item.download_url)}
        <p><button onclick="window.open('{$item.download_url}', '_blank'); return false;">ダウンロード</button></p>
{/if}

{elseif $item.sellercd == ""}

{if $item.forwardstate == 1 || $item.forwardstate == 2 || $item.forwardstate == NULL}
        <p><button class="cancel2" onclick="JavaScript:location.href='{$scriptName}?action=customer_itembuy_order_cancel_check&mode={$mode}&page={$page}&no={$list.orderno}&row={$item.rowno}';return false;">キャンセルする</button></p>
{else}

{if !$item.past_return_day}
        <p><button class="return2" onclick="JavaScript:location.href='{$scriptName}?action=customer_itembuy_return_form&mode={$mode}&page={$page}&no={$list.orderno}&row={$item.rowno}';return false;">返品する</button></p>
{/if}

{/if}

{/if}
{/if}
      </td>
    </tr>

{/foreach}

{foreachelse}
    <tr>
      <th colspan="3">選択された項目に該当する明細はありません</td>
    </tr>
{/foreach}
  </table>

  <p>{$link}&nbsp;{if $action.cnt>0}{$action.cnt}件のデータ{/if}</p>

  <p align="center"><a href="{$scriptName}?action=customer_mypage"><img src="img/back_btn.gif" alt="戻る" border="0"></a></p>

</div>

</div>

{include file="footer.html"}
