📄 search.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<script>\r\nfunction delete_teacher(COURSE_ID)\r\n{\r\n msg='确认要删除该条记录么?';\r\n if(window.confirm(msg))\r\n {\r\n URL=\"delete.php?TEACHER_ID=\" + COURSE_ID;\r\n window.location=URL;\r\n }\r\n}\r\n</script>\r\n</head>\r\n\r\n<body class=\"bodycolor\" topmargin=\"5\">\r\n";
$CUR_DATE = date( "Y-m-d", time( ) );
$CONDITION_STR = "";
if ( $TEACHER_NO != "" )
{
$CONDITION_STR .= " and TEACHER_NO='".$TEACHER_NO."'";
}
if ( $TEACHER_NAME != "" )
{
$CONDITION_STR .= " and TEACHER_NAME='".$TEACHER_NAME."'";
}
if ( $TCOURSE_ID != "" )
{
$CONDITION_STR .= " and TCOURSE_ID='".$TCOURSE_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";
$query = "SELECT * from TRAIN_TEACHERS where 1=1";
$query .= $CONDITION_STR." order by TEACHER_ID desc";
$cursor = exequery( $connection, $query );
$TEACHER_COUNT = 0;
while ( $ROW = mysql_fetch_array( $cursor ) )
{
++$TEACHER_COUNT;
if ( $TEACHER_COUNT == 1 )
{
echo "<table class=\"TableList\" width=\"90%\" 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 </tr>\r\n";
}
$TEACHER_ID = $ROW['TEACHER_ID'];
$TEACHER_NO = $ROW['TEACHER_NO'];
$TEACHER_NAME = $ROW['TEACHER_NAME'];
$TEACHEER_SEX = $ROW['TEACHEER_SEX'];
$TCOURSE_ID = $ROW['TCOURSE_ID'];
$COURSE_NAME = "";
$query1 = "SELECT * from TRAIN_COURSES where COURSE_ID='".$TCOURSE_ID."'";
$cursor1 = exequery( $connection, $query1 );
if ( $ROW1 = mysql_fetch_array( $cursor1 ) )
{
$COURSE_NAME = $ROW1['COURSE_NAME'];
}
if ( $TEACHER_COUNT % 2 == 1 )
{
$TableLine = "TableLine1";
}
else
{
$TableLine = "TableLine2";
}
echo "\r\n <tr class=\"";
echo $TableLine;
echo "\">\r\n <td nowrap align=\"center\">";
echo $TEACHER_NO;
echo "</td>\r\n <td nowrap align=\"center\">";
echo $TEACHER_NAME;
echo "</td>\r\n <td nowrap align=\"center\">";
if ( $TEACHEER_SEX == 0 )
{
echo "男";
}
else
{
echo "女";
}
echo "</td>\r\n <td nowrap align=\"center\">";
echo $COURSE_NAME;
echo "</td>\r\n <td nowrap align=\"center\">\r\n <a href=\"javascript:;\" onClick=\"window.open('detail.php?TEACHER_ID=";
echo $TEACHER_ID;
echo "','','height=360,width=500,status=1,toolbar=no,menubar=no,location=no,scrollbars=yes,left=250,left=280,top=160,resizable=yes');\">详细信息</a>\r\n <a href=\"new.php?TEACHER_ID=";
echo $TEACHER_ID;
echo "\">修改</a>\r\n <a href=javascript:delete_teacher('";
echo $TEACHER_ID;
echo "');>删除</a>\r\n </td>\r\n </tr>\r\n";
}
if ( $TEACHER_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 + -