📄 index.php
字号:
<?php
include_once( "inc/auth.php" );
include_once( "inc/common.inc" );
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>\r\nwindow.setTimeout('this.location.reload();',60000);\r\n</script>\r\n</head>\r\n\r\n<body class=\"bodycolor\" topmargin=\"5\">\r\n<table border=\"0\" width=\"100%\" cellspacing=\"1\" cellpadding=\"0\">\r\n <tr class=\"tablehead1\"> \r\n <td ><img src=\"/images/menu/attendance.gif\" align=\"absmiddle\">请假登记\r\n </td>\r\n </tr>\r\n <tr class=\"TableLine2\"><td>\r\n <input type=\"image\" src=\"/images/button/setleav";
echo "e.gif\" onClick=\"location='new';\" title=\"新建请假登记\">\r\n <input type=\"image\" src=\"/images/button/leavelist.gif\" onClick=\"location='history.php';\" title=\"查看过往的请假记录\"></td>\r\n </tr>\r\n</table>\r\n\r\n<br>\r\n\r\n<table border=\"0\" cellspacing=\"1\" width=\"100%\" class=\"small\" cellpadding=\"5\">\r\n";
$connection = openconnection( );
$LEAVE_COUNT = 0;
$query = "SELECT * from ATTEND_LEAVE where USER_ID='{$LOGIN_USER_ID}' and STATUS='1'";
$cursor = exequery( $connection, $query );
while ( $ROW = mysql_fetch_array( $cursor ) )
{
++$LEAVE_COUNT;
$LEAVE_ID = $ROW['LEAVE_ID'];
$LEADER_ID = $ROW['LEADER_ID'];
$LEAVE_DATE1 = $ROW['LEAVE_DATE1'];
$LEAVE_DATE2 = $ROW['LEAVE_DATE2'];
$LEAVE_TYPE = $ROW['LEAVE_TYPE'];
$LEAVE_TYPE = str_replace( "<", "<", $LEAVE_TYPE );
$LEAVE_TYPE = str_replace( ">", ">", $LEAVE_TYPE );
$LEAVE_TYPE = stripslashes( $LEAVE_TYPE );
$ALLOW = $ROW['ALLOW'];
if ( $ALLOW == "0" )
{
$ALLOW_DESC = "领导尚未批示";
}
else if ( $ALLOW == "1" )
{
$ALLOW_DESC = "领导已批准";
}
else if ( $ALLOW == "2" )
{
$ALLOW_DESC = "领导不批准";
}
else if ( $ALLOW == "3" )
{
$ALLOW_DESC = "申请销假";
}
$query1 = "SELECT * from USER where USER_ID='{$LEADER_ID}'";
$cursor1 = exequery( $connection, $query1 );
if ( $ROW = mysql_fetch_array( $cursor1 ) )
{
$LEADER_NAME = $ROW['USER_NAME'];
}
echo " \r\n\t";
if ( $LEAVE_COUNT % 2 == 1 )
{
$TableLine = "TableLine1";
}
else
{
$TableLine = "TableLine2";
}
echo " <tr class=\"";
echo $TableLine;
echo "\">\r\n <td nowrap ><a href=\"#\" onClick=\"javascript:window.open('leaveinfo.php?LEAVE_ID=";
echo $LEAVE_ID;
echo "','','topbar=no,width=200,height=200')\">";
echo showshort( $LEAVE_TYPE, 20 );
echo "</a></td>\r\n <td nowrap >";
echo $LEADER_NAME;
echo "</td>\r\n <td nowrap >";
echo $LEAVE_DATE1;
echo "</td>\r\n <td nowrap >";
echo $LEAVE_DATE2;
echo "</td>\r\n <td nowrap >";
echo $ALLOW_DESC;
echo "</td>\r\n";
if ( $ALLOW == "0" || $ALLOW == "2" )
{
echo " <td nowrap><a href=\"delete.php?LEAVE_ID=";
echo $LEAVE_ID;
echo "\">删除</a></td>\r\n";
}
else if ( $ALLOW == "1" )
{
echo " <td nowrap ><a href=\"cancel.php?LEAVE_ID=";
echo $LEAVE_ID;
echo "\">申请销假</a></td>\r\n";
}
else if ( $ALLOW == "3" )
{
echo " <td nowrap >无</td>\r\n";
}
echo " </tr>\r\n";
}
if ( 0 < $LEAVE_COUNT )
{
echo " <thead 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 </thead>\r\n";
}
else
{
echo "\r\n</table>\r\n<div align=\"center\">\r\n";
message( "", "没有请假记录!" );
}
echo "</div>\r\n\r\n</body>\r\n</html>";
?>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -