<[include file="common/group_list.tpl"]>
<div id="contents">
<[include file="common/group_menu.tpl"]>
  <br />
  <div id="site-info">
    <h3><img src="<[$TEMPLATE_DIR]>/img/icon_large/user.jpg" align="absmiddle" style="margin-right:8px;">ユーザ遷移</h3>
    <br />
    <fieldset style="width:500px;padding-left:30px;">
    <legend>表示したい形式を指定して下さい。</legend>
    <table width="100%" border="0">
      <tr>
        <td>
        <form method="post" action="./index.php?mode=52&group_code=<[$current_group.group_code]>">
          ユーザー数:
          <select name="view_user" onchange="submit();">
            <option value="10"<[if $view_user == "10"]> selected<[/if]>>10</option>
            <option value="20"<[if $view_user == "20"]> selected<[/if]>>20</option>
            <option value="40"<[if $view_user == "40"]> selected<[/if]>>40</option>
            <option value="50"<[if $view_user == "50"]> selected<[/if]>>50</option>
            <option value="100"<[if $view_user == "100"]> selected<[/if]>>100</option>
          </select>
          &nbsp;
          1ユーザーあたりの表示件数:
          <select name="per_page" onchange="submit();">
            <option value="10"<[if $per_page == "10"]> selected<[/if]>>10</option>
            <option value="20"<[if $per_page == "20"]> selected<[/if]>>20</option>
            <option value="40"<[if $per_page == "40"]> selected<[/if]>>40</option>
            <option value="50"<[if $per_page == "50"]> selected<[/if]>>50</option>
            <option value="100"<[if $per_page == "100"]> selected<[/if]>>100</option>
          </select>
        </form>
        </td>
      </tr>
    </table>
    </fieldset>
  <[if $view_user]>
  <[section name=user_count start=0 loop=$user_array max=$view_user]>
    <[assign var="username" value=$user_array[user_count]]>
    <fieldset style="width:98%;">
    <legend>ユーザーID：<[$username|escape]></legend>
    <table id="view-table" cellpadding="2" cellspacing="0" width="95%" style="margin-top:15px;margin-bottom:15px;">
      <tr>
        <th style="width:200px;" nowrap>日付</th>
        <th>タイトル</th>
        <th style="width:80px;" nowrap>滞在時間</th>
      </tr>
    <[section name=count start=0 loop=$log_array.$username max=$per_page]>
      <[math equation="e - a" a=$log_array.$username[count].0 e=$access_time assign=stay]>
      <tr class="<[cycle values="odd,even"]>">
        <td class="ac_date"><[$log_array.$username[count].0|date_format:"%Y年%m月%d日 %H:%M:%S"]></td>
        <td class="ac_graph"><a href="<[$log_array.$username[count].1]>" target="_blank"><[$log_array.$username[count].2|default:"タイトルなし"|escape]></a></td>
        <td class="ac_count"><[if (!$smarty.section.count.first) && ($stay < 3600)]><[$stay|sectohour:"%d時間":"%d分":"%d秒"|default:"0秒"]><[else]>不明<[/if]></td>
      </tr>
      <[assign var="access_time" value=$log_array.$username[count].0]>
    <[sectionelse]>
      <tr class="odd">
        <td colspan="3">ログデータがありません。</td>
      </tr>
    <[/section]>
    </table>
    </fieldset>
  <[/section]>
  <[/if]>
  </div>
</div>