📄 att_stat_che_total.php
字号:
<?php
include_once( "inc/auth.php" );
include_once( "inc/check_type.php" );
include_once( "inc/utility_all.php" );
echo "\r\n<html>\r\n<head>\r\n<title>上下班记录查询</title>\r\n<meta http-equiv=\"Content-Type\" content=\"text/html; charset=gb2312\">\r\n";
echo "<S";
echo "CRIPT language=javascript src=\"/inc/calendar/calendar.js\"></SCRIPT>\r\n";
echo "<s";
echo "cript>\r\nfunction td_calendar(fieldname)\r\n{\r\n myleft=document.body.scrollLeft+event.clientX-event.offsetX-80;\r\n mytop=document.body.scrollTop+event.clientY-event.offsetY+140;\r\n window.showModalDialog(\"/inc/calendar.php?FIELDNAME=\"+fieldname,self,\"edge:raised;scroll:0;status:0;help:0;resizable:1;dialogWidth:280px;dialogHeight:205px;dialogTop:\"+mytop+\"px;dialogLeft:\"+myleft+\"px\");\r\n}\r\n\r\nfunction C";
echo "heckDate(pFMT,pDate,pShowMsg) \r\n{ \r\n\tvar ResultOK = null \r\n\t\r\n\t\r\n\tvar RegDateDot = /\\d{4}\\.{1}\\d{1,2}\\.{1}\\d{1,2}/ \r\n\tvar RegDateLine = /\\d{4}-{1}\\d{1,2}-{1}\\d{1,2}/ \r\n\t\r\n\tswitch (pFMT) \r\n\t{ \r\n\t\tcase 1: //. \r\n\t\t\tResultOK = RegDateDot.test(pDate) \r\n\t\t\tbreak \r\n\t\tcase 2: //- \r\n\t\t\tResultOK = RegDateLine.test(pDate) \r\n\t\t\tbreak \r\n\t\tdefault: //. \r\n\t\t\tResultOK = RegDateDot.test(pDate) \r\n\t\t\tbreak \r\n\t}\r\n\t\r\n";
echo "\tif(!ResultOK) \r\n\t{ \r\n\t if(pShowMsg) alert(\"无效日期:日期格式错误!\") \r\n\t return false \r\n\t} \r\n\t\r\n\t\r\n\tvar mYear = 0,mMonth = 0,mDay = 0 \r\n\tvar iPos1 = 0,iPos2 = 0 \r\n\tvar sDate = pDate.toString() \r\n\tvar mSepChar = ((pFMT == 1) ? \".\":\"-\") \r\n\t\r\n\t\r\n\tvar MonthDays = new Array(31,28,31,30,31,30,31,31,30,31,30,31) \r\n\t\r\n\t\r\n\tiPos1 = sDate.indexOf(mSepChar) \r\n\tiPos2 = sDate.indexOf(mSepChar,iPos1+1) \r\n\t";
echo "\r\n\tmYear = sDate.substring(0,iPos1) \r\n\tmMonth = sDate.substring(iPos1+1,iPos2) \r\n\tmDay = sDate.substr(iPos2+1) \r\n\t\r\n\t\r\n\tif(mYear <= 0 || mYear > 9999) \r\n\t{ \r\n\t\tif(pShowMsg) alert(\"无效日期:年份过小或者过大,超出限制 (1-9999)!\") \r\n\t\treturn false \r\n\t} \r\n\tmMonth = parseInt(mMonth,10);\r\n\t\r\n\tif(mMonth <= 0 || mMonth > 12) \r\n\t{ \r\n\t\tif(pShowMsg) alert(\"无效日期:没有这个月份!\") \r\n\t\treturn false \r\n\t} \r\n\t";
echo "\r\n\t\r\n\tvar RightDay = 0 \r\n\tif(mMonth == 2) \r\n\t\tRightDay = (((mYear%4 == 0) && (mYear%100 != 0) || (mYear%400 == 0))? 29: 28) \r\n\telse {\r\n\t\tRightDay = MonthDays[mMonth-1];\r\n\t}\r\n\t\r\n\tif(mDay <= 0 || mDay > RightDay) \r\n\t{ \r\n\t\tif(pShowMsg) alert(\"无效日期:该月没有这天!\") \r\n\t\treturn false \r\n\t} \r\n\t\r\n\t\r\n\treturn true \r\n} \r\n\r\n\r\nfunction CheckForm(){\r\n \r\n if (!CheckDate(2,document.formstat.date_start.va";
echo "lue,true) ){\r\n\t alert('起始日期不正确!');\r\n\t return false;\r\n\t}\r\n if (!CheckDate(2,document.formstat.date_end.value,true) ){\r\n\t alert('截止日期不正确!');\r\n\t\treturn false;\r\n\t}\r\n\tif (document.formstat.date_end.value < formstat.date_start.value){\r\n\t alert('起始日期大于截止日期,请重新选择日期!');\r\n\t\treturn false;\r\n\t}\r\n\treturn true;\t\r\n \r\n}\r\nfunction submitForm(){\r\n\tif(CheckForm())\r\n\t\tfo";
echo "rmstat.submit();\r\n}\r\n</script>\r\n</head>\r\n\r\n<body class=\"bodycolor\" topmargin=\"5\">\r\n\r\n";
if ( $date_start != "" )
{
$TIME_OK = is_date( $date_start );
if ( !$TIME_OK )
{
message( "错误", "起始日期格式不对,应形如 1999-1-2" );
button_back( );
exit( );
}
}
if ( $date_end != "" )
{
$TIME_OK = is_date( $date_end );
if ( !$TIME_OK )
{
message( "错误", "截止日期格式不对,应形如 1999-1-2" );
button_back( );
exit( );
}
}
if ( compare_date( $date_start, $date_end ) == 1 )
{
message( "错误", "查询的起始日期不能晚于截止日期" );
button_back( );
exit( );
}
$connection = openconnection( );
$query = "SELECT to_days('{$date_end}')-to_days('{$date_start}') from ATTEND_CONFIG";
$cursor = exequery( $connection, $query );
if ( $ROW = mysql_fetch_array( $cursor ) )
{
$DAY_TOTAL = $ROW[0] + 1;
}
$query = "SELECT * from USER where USER_ID='{$user_id}'";
$cursor = exequery( $connection, $query );
if ( $ROW = mysql_fetch_array( $cursor ) )
{
$DUTY_TYPE = $ROW['DUTY_TYPE'];
$USER_NAME = $ROW['USER_NAME'];
}
echo "\r\n<table border=\"0\" width=\"100%\" cellspacing=\"1\" cellpadding=\"0\">\r\n <tr class=\"tablehead1\">\r\n <td ><img src=\"/images/manage/hrms.gif\" align=\"absmiddle\">考勤统计 - 请假 </td>\r\n </tr>\r\n <tr class=\"tablehead2\">\r\n <td > ";
echo "<s";
echo "pan style=\"font-weight:normal\">";
echo $USER_NAME;
echo " - 起始日期:\r\n";
echo format_date( $date_start );
echo " 截止日期:\r\n";
echo format_date( $date_end );
echo "</span></td>\r\n </tr>\r\n</table>\r\n<table width=\"100%\" border=\"0\" cellspacing=\"1\" cellpadding=\"5\">\r\n <form name=\"formstat\" action=\"";
echo $_SERVER['PHP_SELF'];
echo "\" method=\"post\" onSubmit=\"return submitForm();\">\r\n <tr class=\"TableLine2\">\r\n <td colspan=\"4\"> 起始日期:\r\n\t <input class='Wdate' type=\"text\" name=\"date_start\" id=\"date_start\" value=\"";
echo $date_start;
echo "\" size=\"12\" maxlength=\"10\" onclick=\"popUpCalendar(document.formstat,document.formstat.date_start,'yyyy-mm-dd')\"/>\r\n\t\t 截止日期:\r\n\t\t<input class='Wdate' type=\"text\" name=\"date_end\" id=\"date_end\" value=\"";
echo $date_end;
echo "\" size=\"12\" maxlength=\"10\" onclick=\"popUpCalendar(document.formstat,document.formstat.date_end,'yyyy-mm-dd')\"/>\r\n <input type=\"submit\" name=\"Submit\" value=\"搜索\" class=\"smallInput\">\r\n <input type=\"hidden\" name=\"user_id\" value=\"";
echo $user_id;
echo "\"></td>\r\n </tr>\r\n </form>\r\n</table>\r\n<br>\r\n<table border=\"0\" cellspacing=\"1\" width=\"100%\" class=\"small\" cellpadding=\"3\">\r\n <tr class=\"TableHeader\">\r\n <td nowrap >部门</td>\r\n <td nowrap >姓名</td>\r\n <td nowrap >出差地点</td>\r\n <td nowrap >开始日期</td>\r\n <td nowrap >结束日期</td>\r\n <td nowrap >状态</td>\r\n <td nowrap >操作</td>\r\n </tr>\r\n";
$query = "SELECT * from ATTEND_EVECTION,USER,DEPARTMENT where DEPARTMENT.DEPT_ID=USER.DEPT_ID and ATTEND_EVECTION.USER_ID=USER.USER_ID and ((to_days(EVECTION_DATE1)>=to_days('{$date_start}') and to_days(EVECTION_DATE1)<=to_days('{$date_end}')) or (to_days(EVECTION_DATE2)>=to_days('{$date_start}') and to_days(EVECTION_DATE2)<=to_days('{$date_end}')) or (to_days(EVECTION_DATE1)<=to_days('{$date_start}') and to_days(EVECTION_DATE2)>=to_days('{$date_end}'))) order by DEPT_NO,USER.USER_ID";
$cursor = exequery( $connection, $query );
$EVECTION_COUNT = 0;
$LINE_COUNT = 0;
while ( $ROW = mysql_fetch_array( $cursor ) )
{
++$LINE_COUNT;
++$EVECTION_COUNT;
$USER_ID = $ROW['USER_ID'];
$DEPT_ID = $ROW['DEPT_ID'];
$USER_NAME = $ROW['USER_NAME'];
$EVECTION_ID = $ROW['EVECTION_ID'];
$EVECTION_DATE1 = $ROW['EVECTION_DATE1'];
$EVECTION_DATE1 = strtok( $EVECTION_DATE1, " " );
$EVECTION_DATE2 = $ROW['EVECTION_DATE2'];
$EVECTION_DATE2 = strtok( $EVECTION_DATE2, " " );
$EVECTION_DEST = $ROW['EVECTION_DEST'];
$STATUS = $ROW['STATUS'];
if ( $STATUS == "1" )
{
$STATUS = "在外";
}
else
{
$STATUS = "归来";
}
$query1 = "select * from DEPARTMENT where DEPT_ID={$DEPT_ID}";
$cursor1 = exequery( $connection, $query1 );
if ( $ROW = mysql_fetch_array( $cursor1 ) )
{
$USER_DEPT_NAME = $ROW['DEPT_NAME'];
}
if ( $LINE_COUNT % 2 == 1 )
{
$TableLine = "TableLine1";
}
else
{
$TableLine = "TableLine2";
}
echo " <tr class=\"";
echo $TableLine;
echo "\">\r\n <td nowrap >";
echo $USER_DEPT_NAME;
echo "</td>\r\n <td nowrap >";
echo $USER_NAME;
echo "</td>\r\n <td nowrap >";
echo $EVECTION_DEST;
echo "</td>\r\n <td nowrap >";
echo $EVECTION_DATE1;
echo "</td>\r\n <td nowrap >";
echo $EVECTION_DATE2;
echo "</td>\r\n <td nowrap >";
echo $STATUS;
echo "</td>\r\n <td nowrap ><a href=\"delete_evection.php?EVECTION_ID=";
echo $EVECTION_ID;
echo "&user_id=";
echo $user_id;
echo "&date_start=";
echo $date_start;
echo "&date_end=";
echo $date_end;
echo "\">删除</a></td>\r\n </tr>\r\n ";
}
echo "\r\n</table>\r\n\r\n</body>\r\n</html>";
?>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -