<%@ page contentType="text/html; charset=utf-8"%>
<%@ taglib prefix="s" uri="/struts-tags" %>
<%@ taglib prefix="cm" uri="/commons-tags" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>打卡管理</title>
<link href="../resources/style/base.css" rel="stylesheet" type="text/css"/>
<s:include value="../common/head.jsp" />
<script language="javascript" src="../resources/js/calendar/calendar.js"></script>
<script type="text/javascript">
function typeAdd(){
	iframeWindow("<s:url action='attBrushCardLogAdd'/>",500,350,"人工补卡",refreshWindow);
}

function typeUpload(){
	openUrl("<s:url action='attBrushCardLogUpload'/>","导入打卡数据");
}

function typeEdit(){
	if(getCheckedCount("sid")<1){
		msgAlert("请至少一条您要修改的记录。");
		return;
	}
	iframeWindow("<s:url action='attBrushCardLogChange'/>?ids="+getCheckedValues("sid"),
		400,200,"修改隔日打卡属性",refreshWindow);
}
function typeDel(){
	if(getCheckedCount("sid")<1){
		msgAlert("请至少选择一条您要删除的记录。");
		return;
	}
	msgConfirm("确定要删除您选择的"+getCheckedCount("sid")+"条打卡记录吗？",function(){
		iframeWindow("<s:url action='attBrushCardLogDelete'/>?ids="+getCheckedValues("sid"),400,200,"删除打卡记录",refreshWindow);
	});
}

function typeClear(){
	iframeWindow("<s:url action='attBrushCardLogClear'/>",550,400,"打卡数据清理",refreshWindow);
}


</script>
</head>

<body>
<div class="body_list">
  <s:include value="../common/body.jsp" />
  <s:form action="attBrushCardLogList" id="queryForm" onsubmit="return checkForm(this)">
    <table width="100%" border="0" align="center" cellpadding="0" cellspacing="0" class="table_line">
      <tr class="form_title">
        <td colspan="5">查询条件</td>
      </tr>
      <tr class="form_item">
        <td>工号：
          <s:textfield name="brushLog.emplNo" title="工号必须为数字。" cssStyle="width:100px;"/></td>
        <td>类型：
          <s:select cssStyle="width:100px;" name="brushLog.brushType.id" list='#request.SysCodeFinder.find("ATT_BRUSH_CARD_TYPE")' headerKey="" headerValue="" listKey="id" listValue="codeName"/></td>
        <td>考勤日期：
          <s:textfield name="date1" readonly="true" onClick="showDate(this)" cssClass="date_input" cssStyle="width:85px;">
            <s:param name="value">
              <s:date name="date1" format="yyyy-MM-dd"/>
            </s:param>
          </s:textfield>
          至
          <s:textfield name="date2" readonly="true" onClick="showDate(this)" cssClass="date_input" cssStyle="width:85px;">
            <s:param name="value">
              <s:date name="date2" format="yyyy-MM-dd"/>
            </s:param>
          </s:textfield></td>
        <td>考勤机号：
          <s:textfield name="brushLog.machNo" cssStyle="width:100px;"/></td>
      </tr>
      <tr class="form_item1">
        <td width="22%">姓名：
          <s:textfield name="brushLog.emplInfo.name" cssStyle="width:100px;"/></td>
        <td width="23%">备注：
          <s:textfield name="brushLog.descr" cssStyle="width:100px;"/></td>
        <td width="33%">隔日打卡：
          <s:select cssStyle="width:100px;" name="brushLog.crossDay.id" list='#request.SysCodeFinder.find("YES_NO")' headerKey="" headerValue="" listKey="id" listValue="codeName"/></td>
        <td width="22%" class="center"><input name="q" value="查 询" onclick="query()" type="button" /></td>
      </tr>
    </table>
    <table width="100%" border="0" align="center" cellpadding="0" cellspacing="0"  style="margin:15px 0 5px 0;" >
      <tr>
        <td><input type="button" name="add" onclick="typeAdd()" value="人工补卡"/>
          <input type="button" name="add" onclick="typeDel()" value="删除打卡记录"/>
          <input type="button" name="edit" onclick="typeEdit()" value="修改隔日打卡属性"/>
          <input type="button" name="edit" onclick="typeUpload()" value="导入打卡数据"/>
		   <input type="button" name="edit" onclick="typeClear()" value="打卡数据清理"/>   
          </td>
      </tr>
    </table>
    <table width="100%" border="0" align="center" cellpadding="0" cellspacing="0" class="table_line">
      <tr class="list_title">
        <td width="3%" align="center"><input type="checkbox" name="array" onclick="checkedAll(this)" value="checkbox" /></td>
        <td width="9%">工号</td>
        <td width="8%">姓名</td>
        <td width="9%">考勤日期</td>
        <td width="13%">是否隔日打卡</td>
        <td width="10%">打卡时间</td>
        <td width="10%">考勤机号</td>
        <td width="7%">类型</td>
        <td width="31%">备注</td>
      </tr>
      <s:iterator value="burshLogList" status="st">
        <s:set name="row_cls" value=""/>
        <s:if test="#st.Even">
          <s:set name="row_cls" value="%{'row_a'}"/>
        </s:if>
        <tr class="list_data <s:property value='#row_cls'/>">
          <td align="center"><input type="checkbox" name="array" value="<s:property value='id'/>" lang="sid"/></td>
          <td class="center"><s:property value="emplNo"/></td>
          <td class="center"><s:property value="emplInfo.name"/></td>
          <td class="center"><s:date name="attDate" format="yyyy-MM-dd"/></td>
          <td class="center"><s:property value="crossDay.codeName"/></td>
          <td class="center"><s:date name="brushTime" format="yyyy-MM-dd HH:mm"/></td>
          <td class="center"><s:property value="machNo"/></td>
          <td class="center"><s:property value="brushType.codeName"/></td>
          <td class="center"><s:property value="descr"/></td>
        </tr>
      </s:iterator>
    </table>
    <table width="100%" border="0" align="center" cellpadding="0" cellspacing="0" class="list_page">
      <tr>
        <td width="69%" style="text-align:left;">
        	<span class="info">
            	提示：隔日打卡属性，用于控制考勤日期是否为打卡日期的前一天。
            </span>
        </td>
        <td width="31%"><cm:pager/></td>
      </tr>
    </table>
  </s:form>
</div>
</body>
</html>