<?php
include_once("inc/auth.inc.php");
include_once("inc/utility_all.php");
include_once("inc/utility_file.php");
?>
<script src="My97DatePicker/WdatePicker.js"></script>
<p style="color:red;">注意:本功能不是直接查询考勤机数据,而是查询考勤机自带软件的access数据库,并非OA数据库;</p>
<form id="form1" name="form1" method="post" action="zhicha.php">
开始时间:
<label for="kaishi"></label>
<input type="text" name="kaishi" id="kaishi" value="<?=$_REQUEST["kaishi"]?>" onclick="WdatePicker({dateFmt:'yyyy-MM-dd'});" />
结束时间:
<label for="jieshu"></label>
<input type="text" name="jieshu" id="jieshu" value="<?=$_REQUEST["jieshu"]?>" onclick="WdatePicker({dateFmt:'yyyy-MM-dd'});" />
姓名:
<label for="xingming"></label>
<input type="text" name="xingming" id="xingming" value="<?=$_REQUEST["xingming"]?>" />
<input type="submit" name="button" id="button" value="提交" />
</form>
<table width="500" border="1" cellpadding="0" cellspacing="0">
<tr style="background-color:#66bff5; font-size:12px;">
<td style="line-height:30px;" align="center">序号</td>
<td align="center">打卡记录</td>
<td align="center">加班审批流程</td>
</tr>
<?PHP
$weekarray=array("日","一","二","三","四","五","六");
$ACCESS_PATH = "C:\\Program Files\\Att\\att2000.MDB";
//echo $ACCESS_PATH;
$conn = @new COM("ADODB.Connection") or die ("ADO连接失败!");
$connstr = "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" . realpath($ACCESS_PATH);
$conn->Open($connstr);
//echo $ACCESS_PATH;
//查询是否有加班流程 13 14
//$query2 = "select * from flow_data_203 ,flow_run where flow_run.RUN_ID = flow_data_203.run_id and flow_run.END_TIME is NOT NULL and data_1 = '".$_REQUEST["xingming"]."' and UNIX_TIMESTAMP(DATE_FORMAT( data_13, '%Y-%m-%d')) <= UNIX_TIMESTAMP('".date('Y-'.$yue.'-'.$i.' 00:00:00')."') and UNIX_TIMESTAMP(DATE_FORMAT( data_14, '%Y-%m-%d')) >= UNIX_TIMESTAMP('".date('Y-'.$yue.'-'.$i.' 00:00:00')."')";//查询这个人当天的这次打卡记录
$query2 = "select * from flow_data_203 ,flow_run where flow_run.RUN_ID = flow_data_203.run_id and data_1 ='".$_REQUEST["xingming"]."' and data_13 >= '".date('Y-m-d 00:00:00',(strtotime($_REQUEST["kaishi"])))."' and data_14 <= '".date('Y-m-d 23:59:59',(strtotime($_REQUEST["jieshu"])))."'";
//echo $query2;
$cursor2= exequery(TD::conn(),$query2);
if($ROW2=mysql_fetch_array($cursor2))
{
//print_r($ROW2);
//$jiabanliucheng++;
$run_id2 = $ROW2["run_id"];
}
else
{
}
//创建记录集查询
$rs = @new COM("ADODB.RecordSet");
$sql = "SELECT USERINFO.USERID, USERINFO.Name,checktime
FROM USERINFO INNER JOIN CHECKINOUT ON USERINFO.USERID = CHECKINOUT.USERID where name = '".$_REQUEST["xingming"]."' and checktime >= #".date('Y-m-d 00:00:00',(strtotime($_REQUEST["kaishi"])))."# and checktime <= #".date('Y-m-d 23:59:59',(strtotime($_REQUEST["jieshu"])))."# order by checktime desc";
//echo $sql;
$rs->Open($sql,$conn,1,3);
//print_r($rs);
$i=1;
while(!$rs->eof)
{
?>
<tr>
<td align="center"><?=$i?></td>
<td align="left" style="padding-left:10px;"><? echo $rs->Fields["CHECKTIME"]->Value; ?> 星期<?=$weekarray[date('w', strtotime($rs->Fields["CHECKTIME"]->Value))]?></td>
<td align="center">
<?php
if($run_id2 !="" and $run_id2 !=0)
{
?>
<a href='/general/workflow/list/print/index.php?actionType=view&MENU_FLAG=&RUN_ID=<?=$run_id2?>&PRCS_KEY_ID=&FLOW_ID=203' target='_blank'>加班审批表</a>
<?php
}else{
?>
<a style="color:#F00">未提交加班审批表</a>
<?php
}
?>
</td>
</tr>
<?
$rs->Movenext(); //将记录集指针下移
$i++;
}
$rs->close();
?>
</table>