<!DOCTYPE html>
<!--[if IE 6 ]> <html class="ie6 lte_ie6 lte_ie7 lte_ie8 lte_ie9"> <![endif]--> 
<!--[if lte IE 6 ]> <html class="lte_ie6 lte_ie7 lte_ie8 lte_ie9"> <![endif]--> 
<!--[if lte IE 7 ]> <html class="lte_ie7 lte_ie8 lte_ie9"> <![endif]--> 
<!--[if lte IE 8 ]> <html class="lte_ie8 lte_ie9"> <![endif]--> 
<!--[if lte IE 9 ]> <html class="lte_ie9"> <![endif]--> 
<!--[if (gte IE 10)|!(IE)]><!--><html><!--<![endif]-->
 <head>
    <title><?php echo $_CONFIG->config_data('name')?></title>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=10,chrome=1" />
<link rel="stylesheet" type="text/css" href="template/default/content/css/style2014.css">
<script type="text/javascript" src="template/default/js/jquery-1.4.2.min.js"></script>
<script type="text/javascript" src="template/default/content/js/lockTableTitle.js"></script>
<script language="javascript" type="text/javascript" src="template/default/content/js/common.js"></script>
<script language="javascript" type="text/javascript" src="DatePicker/WdatePicker.js"></script>
<script type="text/javascript">
    
    var locktb;
    $(function(){
        locktb=new Kkctf.table.lockTableSingle({
            tMain:$('#lockTable'),            //table的层
            padWidth:15,                        //单元格左右的padding的值总和数值
            borWidth:2,                        //表格左右边框宽度总和值
            subtHeig:150,                    //表格高度减去多少
            dinamicDiv:$('#dynamicDiv'),      //动态层的高度.表格会根据动态层的显示或隐藏进行表格大小的动态调整(可选)
            autoHeight:true                 //表格窗口是否随着窗口的高度改变自动调整高度(可选)
        });
    });

    function formview(){
    
        if($('#dynamicDiv').is(':visible')){
            $('#dynamicDiv').hide();
        }else{
            $('#dynamicDiv').show();
        }
        
        locktb.autoHeightFn();
    }
    function sendForm(){
	   document.save.submit();
	}
	function updateform(type){
		if(type==1){
			document.getElementById("uptype").value='1';
		}
		document.update.submit();
	}
</script>
</head>
<body class="body-wrap">
<div class="tabbable work-nav"> <!-- Only required for left/right tabs -->
				<ul id="myTab" class="nav nav-tabs">
					<li><a href="admin.php?ac=<?php echo $ac?>&fileurl=<?php echo $fileurl?>" data-toggle="tab">我的考勤</a></li>
					<li  class="active"><a href="admin.php?ac=<?php echo $ac?>&do=charts&fileurl=<?php echo $fileurl?>" data-toggle="tab">考勤统计</a></li>
					
					
				</ul>
			</div>
<div class="search_area">
        <div class="form-search form-search-top" style="text-align:left;padding-left:10px;">  
     
            <div class="adv-select-label"><?php echo get_date('Y',PHP_TIME)?>年考勤统计</div>
         
        </div>

</div>


<div class="data-wrap">
	<div class="data-operation">
		
</div>		
</div>
<form name="update" method="post" action="admin.php?ac=<?php echo $ac?>&fileurl=<?php echo $fileurl?>">
		<input type="hidden" name="do" value="update" />

<div class="data-list" >
<div  id="lockTable">
<table  class="table table-bordered table-hover" width="100%">
      <tr class="editThead" align="center">
      <td width="40"><input type="checkbox" value="1" name="chkall" onClick="check_all(this)" /></td>
      <td width="100">月份</td>
      <td width="100">出勤天数</td>
	  <td width="140">早退时长</td>
	  <td width="140">迟到时长</td>
	  <td width="100">早退次数</td>
	  <td width="100">迟到次数</td>
   </tr>
<?php
for($i=1;$i<=get_date('m',PHP_TIME);$i++){
if($i<10){
	$m='0'.$i;
}else{
	$m=$i;
}
?>
    <tr >
      <td width="40">
	  <?php
	  echo '<input type="checkbox" name="id[]" class="checkbox" disabled="disabled" />';
	  
	  ?>
    	</td>
      <td><?php echo $i;?>月
</td>
<td>

<?php
$num = $db->result("SELECT COUNT(*) AS num FROM ".DB_TABLEPRE.DB_JT."attendance WHERE uid='".$_USER->id."' and month(date)= ".$m."");
echo $num;
?></td>
<td>
<?php
$ledates = $db->result("SELECT sum(ledate) AS ledates FROM ".DB_TABLEPRE.DB_JT."attendance WHERE uid='".$_USER->id."' and month(date)= ".$m."");
echo attendance_date($ledates);
?></td>
<td>
<?php
$latedates = $db->result("SELECT sum(latedate) AS latedates FROM ".DB_TABLEPRE.DB_JT."attendance WHERE uid='".$_USER->id."' and month(date)= ".$m."");
echo attendance_date($latedates);
?>
</td>
<td>
<?php
$edate = $db->result("SELECT COUNT(*) AS edate FROM ".DB_TABLEPRE.DB_JT."attendance WHERE uid='".$_USER->id."' and ledate!='0' and month(date)= ".$m."");
echo $edate;
?>
</td>
<td>
<?php
$latedate = $db->result("SELECT COUNT(*) AS latedate FROM ".DB_TABLEPRE.DB_JT."attendance WHERE uid='".$_USER->id."' and latedate!='0' and month(date)= ".$m."");
echo $latedate;
?>
</td>

    </tr>
<?php } ?>	       
    </table>
</div>
</div>
</form>

<form name="excel" method="post" action="admin.php?ac=<?php echo $ac?>&fileurl=<?php echo $fileurl?>">
	<input type="hidden" name="name" value="<?php echo $name?>" />
	<input type="hidden" name="vstartdate" value="<?php echo $vstartdate?>" />
	<input type="hidden" name="venddate" value="<?php echo $venddate?>" />
	<input type="hidden" name="do" value="excel" />
	</form>
</body>
</html>