#*
 * Aipo is a groupware program developed by Aimluck,Inc.
 * Copyright (C) 2004-2008 Aimluck,Inc.
 * http://aipostyle.com/
 * 
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 3 of the License, or
 * (at your option) any later version.
 * 
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 * GNU General Public License for more details.
 * 
 * You should have received a copy of the GNU General Public License
 * along with this program. If not, see <http://www.gnu.org/licenses/>.
 *#
## ---------------------------------------------------------------------------
#set($tabs = [["勤務時間集計", "",""]])
#set($meisaiflag = 1)
## ---------------------------------------------------------------------------
#ALajaxtabheader($tabs "")
#ALspacebothheader()
#ALtableheaderSimpleWide()
#ALtdcaption('表示切替')
#ALtditemheader()
<div>
<select name="target_group_name" onchange="aipo.viewPage(this.options[this.selectedIndex].value, '$!portlet.ID')">
<option value="$!utils.escapeXML($!jslink.getPortletById($!portlet.ID).addQueryData("template","TimecardSummaryListScreen").addQueryData("target_group_name","all").addQueryData("target_user_id","none"))">（グループ全体）</option>
#foreach( $record in $!result.MyGroupList )
<option value="$!utils.escapeXML($!jslink.getPortletById($!portlet.ID).addQueryData("template","TimecardSummaryListScreen").addQueryData("target_group_name",$!{record.Name.toString()}).addQueryData("target_user_id","none"))" #if($!result.TargetGroupName == $!record.Name.toString()) selected="selected" #end>$!record.AliasName</option>
#end
#if(($result.MyGroupList.size() > 0) && ($result.PostMap.size() > 0))
<option value="$!utils.escapeXML($!jslink.getPortletById($!portlet.ID).addQueryData("template","TimecardSummaryListScreen").addQueryData("target_group_name","all").addQueryData("target_user_id", "none"))" #if ($!result.CurrentFilter == $!record.Name.toString()) selected="selected" #end>----------</option>
#end
#foreach( $record in $!result.PostMap )
<option value="$!utils.escapeXML($!jslink.getPortletById($!portlet.ID).addQueryData("template","TimecardSummaryListScreen").addQueryData("target_group_name",$!{record.GroupName.toString()}).addQueryData("target_user_id", "none"))" #if($!result.TargetGroupName == $!record.GroupName.toString()) selected="selected" #end>$!record.PostName</option>
#end
</select>
<select name="target_user_id" onchange="aipo.viewPage(this.options[this.selectedIndex].value, '$!portlet.ID')">
<option value="$!utils.escapeXML($!jslink.getPortletById($!portlet.ID).addQueryData("template","TimecardSummaryListScreen").addQueryData("target_group_name",$!{result.TargetGroupName}).addQueryData("target_user_id","none"))">（ユーザー選択）</option>
#foreach($record in $!result.Users)
<option value="$!utils.escapeXML($!jslink.getPortletById($!portlet.ID).addQueryData("template","TimecardSummaryListScreen").addQueryData("target_group_name",$!{result.TargetGroupName}).addQueryData("target_user_id",$!{record.UserId.toString()}))" #if($!result.TargetUserId != "all") #if($!result.TargetUserId == $!record.UserId.toString()) selected="selected" #end #end>$!record.AliasName</option>
#end
</select>
</div>
<div>
<select name="view_date_year" size="1" onchange="aipo.viewPage(this.options[this.selectedIndex].value, '$!portlet.ID')">
#set($end_year = 2010)
#foreach ( $num in [2006..$!{end_year}] )
<option value="$!utils.escapeXML($!jslink.getPortletById($!portlet.ID).addQueryData("template","TimecardSummaryListScreen").addQueryData("view_date_year","$num").addQueryData("view_date_month","$!result.ViewDate.Month"))" #if ($!result.ViewDate.Year == "$num") selected="selected" #end>$num年</option>
#end
</select>
<select name="view_date_month" size="1" onchange="aipo.viewPage(this.options[this.selectedIndex].value, '$!portlet.ID')">
#foreach ( $num in [1..12] )
<option value="$!utils.escapeXML($!jslink.getPortletById($!portlet.ID).addQueryData("template","TimecardSummaryListScreen").addQueryData("view_date_year","$!result.ViewDate.Year").addQueryData("view_date_month","$num"))" #if ($!result.ViewDate.Month == "$num") selected="selected" #end>$num月</option>
#end
</select>
</div>
#ALtditemfooter()
#ALtablefooter()

#if($result.DateListKeys.size() == 0)
<div class="message">指定された条件に該当するタイムカードはありません。</div>
#else
#ALtableheaderWide()
<tr>
#ALtdheadThin("日付")
#if($meisaiflag == 1)
#ALtdheadThin("状態")
#ALtdheadThin("勤怠時間")
#end
#ALtdheadThin("就業")
#ALtdheadThin("時間内")
#ALtdheadThin("時間内（全）")
#ALtdheadThin("時間内（休憩）")
#ALtdheadThin("残業")
#ALtdheadThin("残業（全）")
#ALtdheadThin("残業（休憩）")
#*
#tdhead2("休出" 'width="2%"')
*#
#ALtdheadThin("遅刻")
#ALtdheadThin("早退")
#*
#tdhead2("欠勤" 'width="2%"')
#tdhead2("慶弔" 'width="2%"')
#tdhead2("有給" 'width="2%"')
#tdhead2("代休" 'width="2%"')
#tdhead2("その他" 'width="2%"')
#tdhead2("未入力" 'width="2%"')
*#
</tr>

#foreach ($key in $result.DateListKeys)
#set($count = 0)
#set($tclistrd = $result.getDateListValue($key))
#set($viewlist = $tclistrd.ViewList)
#set($listsize = $viewlist.size())
<tr>
#ALtdcellAtt("$tclistrd.DateStr" "rowspan='$listsize' nowrap='nowrap'")
#foreach ($record in $viewlist)
#if($count > 0)
<tr>
#end
#if($meisaiflag == 1)
#if ($!record.WorkFlag.toString() == "0") #set($workstr = "退勤") #else #set($workstr = "出勤") #end
#ALtdcellAtt("$workstr" "align='center' nowrap='nowrap'")
#ALtdcellAtt("$!record.WorkDateStr" "align='right' nowrap='nowrap'")
#end

#if($count == 0)
#ALtdcellAtt("${tclistrd.Shugyo}分<br />${tclistrd.ShugyoStr}時間" "rowspan='$listsize' align='right' nowrap='nowrap'")
#ALtdcellAtt("${tclistrd.Jikannai}分<br />${tclistrd.JikannaiStr}時間" "rowspan='$listsize' align='right' nowrap='nowrap'")
#ALtdcellAtt("${tclistrd.Jikannai1}分<br />${tclistrd.Jikannai1Str}時間" "rowspan='$listsize' align='right' nowrap='nowrap'")
#ALtdcellAtt("${tclistrd.Jikannai2}分<br />${tclistrd.Jikannai2Str}時間" "rowspan='$listsize' align='right' nowrap='nowrap'")
#ALtdcellAtt("${tclistrd.Zangyo}分<br />${tclistrd.ZangyoStr}時間" "rowspan='$listsize' align='right' nowrap='nowrap'")
#ALtdcellAtt("${tclistrd.Zangyo1}分<br />${tclistrd.Zangyo1Str}時間" "rowspan='$listsize' align='right' nowrap='nowrap'")
#ALtdcellAtt("${tclistrd.Zangyo2}分<br />${tclistrd.Zangyo2Str}時間" "rowspan='$listsize' align='right' nowrap='nowrap'")
#*
<td class="item" nowrap align="right" rowspan="$listsize">${tclistrd.Kyushutsu}分</td>
<td class="item" nowrap align="right" rowspan="$listsize">${tclistrd.SummayTimes}時間</td>
*#
#ALtdcellAtt("${tclistrd.Chikoku}" "rowspan='$listsize' align='center' nowrap='nowrap'")
#ALtdcellAtt("${tclistrd.Sotai}" "rowspan='$listsize' align='center' nowrap='nowrap'")
#end
</tr>
#set($count = $count + 1)
#end
#end
<tr>
#if($meisaiflag == 1)
#ALtdcellAtt("合計" "colspan='3' align='right' nowrap='nowrap'")
#else
#ALtdcellAtt("合計" "colspan='1' align='right' nowrap='nowrap'")
#end
#ALtdcellAtt("${result.ShugyoNissu}日<br />${result.ShugyoJikan}分<br />${result.ShugyoJikanStr}時間" "rowspan='$listsize' align='right' nowrap='nowrap'")
#ALtdcellAtt("${result.ShugyoJikannaiNissu}日<br />${result.ShugyoJikannaiJikan}分<br />${result.ShugyoJikannaiJikanStr}時間" "rowspan='$listsize' align='right' nowrap='nowrap'")
#ALtdcellAtt("${result.ShugyoJikannai1Nissu}日<br />${result.ShugyoJikannai1Jikan}分<br />${result.ShugyoJikannai1JikanStr}時間" "rowspan='$listsize' align='right' nowrap='nowrap'")
#ALtdcellAtt("${result.ShugyoJikannai2Nissu}日<br />${result.ShugyoJikannai2Jikan}分<br />${result.ShugyoJikannai2JikanStr}時間" "rowspan='$listsize' align='right' nowrap='nowrap'")
#ALtdcellAtt("${result.ZangyoNissu}日<br />${result.ZangyoJikan}分<br />${result.ZangyoJikanStr}時間" "rowspan='$listsize' align='right' nowrap='nowrap'")
#ALtdcellAtt("${result.ZangyoJikannai1Nissu}日<br />${result.ZangyoJikannai1Jikan}分<br />${result.ZangyoJikannai1JikanStr}時間" "rowspan='$listsize' align='right' nowrap='nowrap'")
#ALtdcellAtt("${result.ZangyoJikannai2Nissu}日<br />${result.ZangyoJikannai2Jikan}分<br />${result.ZangyoJikannai2JikanStr}時間" "rowspan='$listsize' align='right' nowrap='nowrap'")
#ALtdcellAtt("${result.Chikoku}日" "rowspan='$listsize' align='right' nowrap='nowrap'")
#ALtdcellAtt("${result.Sotai}日" "rowspan='$listsize' align='right' nowrap='nowrap'")
</tr>
#ALtablefooter()
#end
#ALspacebothfooter()
#ALajaxtabfooter()
