📄 search2.php
字号:
<?php
include_once( "inc/auth.php" );
include_once( "inc/utility_all.php" );
include_once( "inc/check_type.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</head>\r\n\r\n<body class=\"bodycolor\" topmargin=\"5\">\r\n";
$CUR_DATE = date( "Y-m-d", time( ) );
if ( $APPLY_TIME_B != "" )
{
$TIME_OK = is_date( $APPLY_TIME_B );
if ( !$TIME_OK )
{
message( "错误", "\"开始时间\"的格式不对,应形如 ".$CUR_DATE );
button_back( );
exit( );
}
}
if ( $APPLY_TIME_E != "" )
{
$TIME_OK = is_date( $APPLY_TIME_E );
if ( !$TIME_OK )
{
message( "错误", "\"开始时间\"的格式不对,应形如 ".$CUR_DATE );
button_back( );
exit( );
}
}
if ( $APPLY_TIME_B != "" )
{
$APPLY_TIME_B .= " 00:00:00";
}
else
{
$APPLY_TIME_B = "";
}
if ( $APPLY_TIME_E != "" )
{
$APPLY_TIME_E .= " 23:59:59";
}
else
{
$APPLY_TIME_E = "";
}
$CONDITION_STR = "";
if ( $TRAIN_ID != "" )
{
$query = "SELECT * from TRAIN_NEWCOURSE where TRAIN_ID like '%".$TRAIN_ID."%'";
$cursor = exequery( $connection, $query );
$NUMROWS = mysql_num_rows( $cursor );
$COUNT1 = "";
while ( $ROW = mysql_fetch_array( $cursor ) )
{
++$COUNT1;
$TRAINING_ID = $ROW['TRAINING_ID'];
if ( $NUMROWS != $COUNT1 )
{
$CONDITION_STR .= "(APPLY_TID='".$TRAINING_ID."') or ";
}
else
{
$CONDITION_STR .= "(APPLY_TID='".$TRAINING_ID."')";
}
}
if ( $CONDITION_STR != "" )
{
$CONDITION_STR = " and (".$CONDITION_STR.")";
}
else
{
$CONDITION_STR = " and APPLY_TID='hhhggghhhggg'";
}
}
if ( $COURSE_NAME != "" )
{
$CONDITION_STR .= " and APPLY_COURSE_NAEM like '%".$COURSE_NAME."%'";
}
if ( $APPLY_STATUS != "" )
{
$CONDITION_STR .= " and APPLY_STATUS='".$APPLY_STATUS."'";
}
if ( $APPLY_TIME_B != "" )
{
$CONDITION_STR .= " and APPLY_TIME>='".$APPLY_TIME_B."'";
}
if ( $APPLY_TIME_E != "" )
{
$CONDITION_STR .= " and APPLY_TIME<='".$APPLY_TIME_E."'";
}
if ( $TO_ID != "" )
{
$CONDITION_STR .= " and APPLYER='".$TO_ID."'";
}
echo "\r\n<table border=\"0\" width=\"100%\" cellspacing=\"0\" cellpadding=\"3\" class=\"small\">\r\n <tr>\r\n <td class=\"Big\"><img src=\"/images/menu/infofind.gif\" align=\"absMiddle\"><span class=\"big3\"> 查询结果</span><br>\r\n </td>\r\n </tr>\r\n</table>\r\n<br>\r\n";
if ( $LOGIN_USER_PRIV != "1" )
{
$query = "SELECT * from TRAIN_APPLY where APPLY_MANAGER='".$LOGIN_USER_ID."'";
}
else
{
$query = "SELECT * from TRAIN_APPLY where 1=1";
}
$query .= $CONDITION_STR." order by APPLY_ID desc";
$cursor = exequery( $connection, $query );
$APPLY_COUNT = 0;
while ( $ROW = mysql_fetch_array( $cursor ) )
{
++$APPLY_COUNT;
if ( $APPLY_COUNT == 1 )
{
echo "<table class=\"TableList\" width=\"95%\" align=\"center\">\r\n <tr class=\"TableHeader\">\r\n <td nowrap align=\"center\">培训课程编号</td>\r\n <td nowrap align=\"center\">培训课程名称</td>\r\n <td nowrap align=\"center\">报名人</td>\r\n <td nowrap align=\"center\">原因</td> \r\n <td nowrap align=\"center\">状态</td>\r\n <td nowrap align=\"center\">报名/限额</td>\r\n <td nowrap align=\"center\">报名时间</td>\r\n <td nowrap align=\"center\">操作</td>\r\n </tr>\r\n";
}
$APPLY_ID = $ROW['APPLY_ID'];
$APPLY_TID = $ROW['APPLY_TID'];
$APPLY_MANAGER = $ROW['APPLY_MANAGER'];
$APPLYER = $ROW['APPLYER'];
$APPLY_TYPE = $ROW['APPLY_TYPE'];
$APPLY_TIME = $ROW['APPLY_TIME'];
$COURSE_NAME = $ROW['APPLY_COURSE_NAEM'];
$APPLY_MANAGER = $ROW['APPLY_MANAGER'];
$EXEMPT_FLAG = $ROW['EXEMPT_FLAG'];
$APPLY_STATUS = $ROW['APPLY_STATUS'];
$APPLY_REASON = $ROW['APPLY_REASON'];
if ( $APPLY_MANAGER == "" )
{
$APPLY_STATUS_DESC = "已报名";
}
else if ( $APPLY_STATUS == 0 )
{
$APPLY_STATUS_DESC = "待批";
}
else if ( $APPLY_STATUS == 1 )
{
$APPLY_STATUS_DESC = "已准";
}
else if ( $APPLY_STATUS == 2 )
{
$APPLY_STATUS_DESC = "进行中";
}
else if ( $APPLY_STATUS == 3 )
{
$APPLY_STATUS_DESC = "未批准";
}
else if ( $APPLY_STATUS == 4 )
{
$APPLY_STATUS_DESC = "结束";
}
else if ( $APPLY_STATUS == 5 )
{
$APPLY_STATUS_DESC = "非审批课程";
}
$query1 = "SELECT * from TRAIN_NEWCOURSE where TRAINING_ID='".$APPLY_TID."'";
$cursor1 = exequery( $connection, $query1 );
if ( $ROW1 = mysql_fetch_array( $cursor1 ) )
{
$TRAIN_ID = $ROW1['TRAIN_ID'];
$TCOURSE_ID = $ROW1['TCOURSE_ID'];
$YORN = $ROW1['YORN'];
$NUMBER = $ROW1['NUMBER'];
}
$query1 = "SELECT count(*) from TRAIN_APPLY where APPLY_TID='".$APPLY_TID."' and APPLY_STATUS!='3' and (APPLY_STATUS!='0'or APPLY_MANAGER='') and (EXEMPT_FLAG='0' or EXEMPT_FLAG='2')";
$cursor1 = exequery( $connection, $query1 );
$COUNT = 0;
if ( $ROW1 = mysql_fetch_array( $cursor1 ) )
{
$COUNT = $ROW1[0];
}
$query1 = "SELECT USER_NAME from USER where USER_ID='".$APPLYER."'";
$cursor1 = exequery( $connection, $query1 );
$USER_NAME1 = "";
if ( $ROW1 = mysql_fetch_array( $cursor1 ) )
{
$USER_NAME1 = $ROW1['USER_NAME'];
}
if ( $APPLY_COUNT % 2 == 1 )
{
$TableLine = "TableLine1";
}
else
{
$TableLine = "TableLine2";
}
if ( $YORN == 1 )
{
$FONT_COLOR = "red";
}
else
{
$FONT_COLOR = "green";
}
echo "\r\n <tr class=\"";
echo $TableLine;
echo "\">\r\n <td nowrap align=\"center\"><a href=\"javascript:;\" onClick=\"window.open('../../manage/show/train_detail.php?TRAINING_ID=";
echo $APPLY_TID;
echo "','','height=500,width=700,status=1,toolbar=no,menubar=no,location=no,scrollbars=yes,left=150,top=60,resizable=yes');\">";
echo $TRAIN_ID;
echo "</a> \r\n <td nowrap align=\"center\"><a href=\"javascript:;\" onClick=\"window.open('../../manage/show/course_detail.php?TCOURSE_ID=";
echo $TCOURSE_ID;
echo "','','height=500,width=600,status=1,toolbar=no,menubar=no,location=no,scrollbars=yes,left=190,top=60,resizable=yes');\"><font color=";
echo $FONT_COLOR;
echo ">";
echo $COURSE_NAME;
echo "</font></a> \r\n <td nowrap align=\"center\">";
echo $USER_NAME1;
echo "</td>\r\n <td nowrap align=\"center\" title=\"";
echo $APPLY_REASON;
echo "\">";
echo csubstr( $APPLY_REASON, 0, 8 );
echo "</td>\r\n <td nowrap align=\"center\">";
echo $APPLY_STATUS_DESC;
echo "</td>\r\n <td nowrap align=\"center\">";
if ( $EXEMPT_FLAG == 0 || $EXEMPT_FLAG == 2 )
{
echo $COUNT."/".$NUMBER;
}
else
{
echo "免修申请";
}
echo "</td> \r\n <td nowrap align=\"center\">";
echo $APPLY_TIME;
echo "</td>\r\n <td align=\"center\">\r\n";
if ( $EXEMPT_FLAG == 1 )
{
$MYAPPLY_TYPE = 1;
}
if ( ( $APPLY_STATUS == 0 || $APPLY_STATUS == 3 ) && $APPLY_MANAGER != "" )
{
if ( $COUNT < $NUMBER )
{
echo " <a href=\"dispose.php?APPLY_ID=";
echo $APPLY_ID;
echo "&APPLYER=";
echo $APPLYER;
echo "&APPLY_TID=";
echo $APPLY_TID;
echo "&OP=1&MYAPPLY_TYPE=";
echo $MYAPPLY_TYPE;
echo "\">批准</a> \r\n";
}
else
{
echo " <span title=\"报名满额,不能再批准\" style=\"cursor:hand\">批准</span> \r\n";
}
echo " <a href=\"dispose.php?APPLY_TID=";
echo $APPLY_TID;
echo "&APPLYER=";
echo $APPLYER;
echo "&APPLY_ID=";
echo $APPLY_ID;
echo "&OP=2&MYAPPLY_TYPE=";
echo $MYAPPLY_TYPE;
echo "\">不准</a> \r\n";
}
else if ( $APPLY_STATUS == 1 )
{
if ( $APPLY_TYPE == 1 || $EXEMPT_FLAG == 1 )
{
echo " <a href=\"dispose.php?APPLY_ID=";
echo $APPLY_ID;
echo "&APPLYER=";
echo $APPLYER;
echo "&APPLY_TID=";
echo $APPLY_TID;
echo "&OP=3&MYAPPLY_TYPE=";
echo $MYAPPLY_TYPE;
echo "\">撤销批准</a> \r\n";
}
else
{
echo " <a href=\"delete.php?APPLYER=";
echo $APPLYER;
echo "&APPLY_TID=";
echo $APPLY_TID;
echo "\">删除指定</a> \r\n";
}
}
else
{
echo " <span title=\"不能撤销\" style=\"cursor:hand\"> - </span>\r\n";
}
echo " \r\n </td>\r\n </tr>\r\n";
}
if ( $APPLY_COUNT == 0 )
{
message( "", "无符合条件的记录" );
button_back( );
exit( );
}
echo "</table>\r\n";
button_back( );
echo "</body>\r\n</html>";
?>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -