📄 new.php
字号:
<?php
include_once( "inc/auth.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\r\n<script Language=\"JavaScript\">\r\nfunction CheckForm()\r\n{\r\n if(document.form1.PAPER_DESC.value==\"\")\r\n { alert(\"试卷说明不能为空!\");\r\n return (false);\r\n }\r\n document.form1.submit();\r\n}\r\n\r\n\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\r\n window.showModalDialog(\"/inc/calendar.php?FIELDNAME=\"+fieldname,self,\"edge:raised;scroll:0;status:0;help:0;resizable:1;dialogWidth:280px;dialogHeight:215px;dialogTop:\"+mytop+\"px;dialogLeft:\"+myleft+\"px\");\r\n}\r\n\r\n</script>\r\n</head>\r\n\r\n<body class=\"bodycolor\" topmargin=\"5\">\r\n";
if ( $PAPER_ID != "" )
{
$query = "SELECT * from TRAIN_TEST_PAPER where PAPER_ID=".$PAPER_ID;
$cursor = exequery( $connection, $query );
if ( $ROW = mysql_fetch_array( $cursor ) )
{
$PAPER_DESC = $ROW['PAPER_DESC'];
$PAPER_GRADE = $ROW['PAPER_GRADE'];
$QUESTIONS_COUNT = $ROW['QUESTIONS_COUNT'];
$PAPER_TIMES = $ROW['PAPER_TIMES'];
$BEGIN_DATE = $ROW['BEGIN_DATE'];
$END_DATE = $ROW['END_DATE'];
$ROOM_ID = $ROW['ROOM_ID'];
$QUESTIONS_TYPE = $ROW['QUESTIONS_TYPE'];
$QUESTIONS_RANK = $ROW['QUESTIONS_RANK'];
if ( $BEGIN_DATE == "0000-00-00" )
{
$BEGIN_DATE = "";
}
if ( $END_DATE == "0000-00-00" )
{
$END_DATE = "";
}
}
if ( $ROOM_ID != 0 )
{
$str = " and ROOM_ID=".$ROOM_ID;
}
if ( $QUESTIONS_TYPE != "" )
{
$str .= " and QUESTIONS_TYPE=".$QUESTIONS_TYPE;
}
if ( $QUESTIONS_RANK != "" )
{
$str .= " and QUESTIONS_RANK=".$QUESTIONS_RANK;
}
$query = "SELECT count(*) from TRAIN_TEST_QUESTIONS where 1=1 ".$str;
$cursor = exequery( $connection, $query );
if ( $ROW = mysql_fetch_array( $cursor ) )
{
$QUESTIONS_COUNT0 = $ROW[0];
}
}
echo "<table border=\"0\" width=\"90%\" cellspacing=\"0\" cellpadding=\"3\" class=\"small\">\r\n <tr>\r\n <td class=\"Big\"><img src=\"/images/notify_new.gif\" align=\"absmiddle\"><span class=\"big3\"> ";
if ( $PAPER_ID != "" )
{
echo "修改";
}
else
{
echo "新建";
}
echo "试卷</span>\r\n </td>\r\n </tr>\r\n</table>\r\n\r\n<table border=\"0\" width=\"70%\" cellpadding=\"2\" cellspacing=\"1\" align=\"center\" bgcolor=\"#000000\" class=\"small\">\r\n <form enctype=\"multipart/form-data\" action=\"add.php\" method=\"post\" name=\"form1\">\r\n <tr class=\"TableHeader\">\r\n <td colspan=\"4\" nowrap>\r\n\t 基本信息\r\n </td>\r\n\t</tr>\r\n\t<tr>\r\n <td nowrap class=\"TableData\">总分:</td>\r\n <td class=\"TableData\">\r\n <input type=text name=\"PAPER_GRADE\" class=\"BigInput\" size=10 maxlength=\"100\" value=";
echo $PAPER_GRADE;
echo ">\r\n </td>\r\n <td nowrap class=\"TableData\">试题数量:</td>\r\n <td class=\"TableData\">\r\n <input type=text name=\"QUESTIONS_COUNT\" class=\"BigInput\" size=10 maxlength=\"100\" value=";
echo $QUESTIONS_COUNT;
echo ">\r\n </td>\r\n </tr>\r\n\t<tr>\r\n <td nowrap class=\"TableData\">考试时长:</td>\r\n <td class=\"TableData\">\r\n <input type=text name=\"PAPER_TIMES\" class=\"BigInput\" size=10 maxlength=\"100\" value=";
echo $PAPER_TIMES;
echo "> 分钟\r\n </td>\r\n <td nowrap class=\"TableData\">有效期:</td>\r\n <td class=\"TableData\">\r\n 生效日期:<input type=\"text\" name=\"BEGIN_DATE\" size=\"10\" maxlength=\"10\" class=\"BigInput\" value=\"";
echo $BEGIN_DATE;
echo "\">\r\n <img src=\"/images/menu/calendar.gif\" border=\"0\" style=\"cursor:hand\" onclick=\"td_calendar('form1.BEGIN_DATE');\">\r\n 为空为立即生效<br>\r\n 终止日期:<input type=\"text\" name=\"END_DATE\" size=\"10\" maxlength=\"10\" class=\"BigInput\" value=\"";
echo $END_DATE;
echo "\">\r\n <img src=\"/images/menu/calendar.gif\" border=\"0\" style=\"cursor:hand\" onclick=\"td_calendar('form1.END_DATE');\">\r\n 为空为手动终止\r\n </td>\r\n </tr>\r\n\t<tr>\r\n <td nowrap class=\"TableData\">试卷说明:</td>\r\n <td class=\"TableData\" colspan=\"3\">\r\n <textarea name=\"PAPER_DESC\" class=\"BigInput\" cols=\"50\" rows=\"3\">";
echo $PAPER_DESC;
echo "</textarea>\r\n </td>\r\n </tr>\r\n <tr class=\"TableHeader\">\r\n <td colspan=\"4\" nowrap>\r\n\t 题目筛选\r\n </td>\r\n\t</tr>\r\n <tr>\r\n <td nowrap class=\"TableData\"> 所属题库:</td>\r\n <td class=\"TableData\">\r\n <select name=\"ROOM_ID\" class=\"BigSelect\">\r\n\t<option value=\"0\" ";
if ( 0 == $ROOM_ID )
{
echo "selected";
}
echo ">全部</option>\r\n";
$query1 = "SELECT * from TRAIN_TEST_ROOM";
$cursor1 = exequery( $connection, $query1 );
while ( $ROW = mysql_fetch_array( $cursor1 ) )
{
$ROOM_ID1 = $ROW['ROOM_ID'];
$ROOM_NAME = $ROW['ROOM_NAME'];
echo "\t<option value=\"";
echo $ROOM_ID1;
echo "\" ";
if ( $ROOM_ID1 == $ROOM_ID )
{
echo "selected";
}
echo ">";
echo $ROOM_NAME;
echo "</option>\r\n";
}
echo " </select>\r\n </td>\r\n <td nowrap class=\"TableData\"> 题型:</td>\r\n <td class=\"TableData\">\r\n <select name=\"QUESTIONS_TYPE\" class=\"BigSelect\">\r\n\t<option value=\"\" ";
if ( "" == $QUESTIONS_TYPE )
{
echo "selected";
}
echo ">全部</option>\r\n\t<option value=\"0\" ";
if ( $QUESTIONS_TYPE == "0" )
{
echo "selected";
}
echo ">单选</option>\r\n\t<option value=\"1\" ";
if ( $QUESTIONS_TYPE == "1" )
{
echo "selected";
}
echo ">多选</option>\r\n </select>\r\n </td>\r\n </tr>\r\n <tr>\r\n <td nowrap class=\"TableData\"> 难度:</td>\r\n <td class=\"TableData\">\r\n <select name=\"QUESTIONS_RANK\" class=\"BigSelect\">\r\n\t<option value=\"\" ";
if ( "" == $QUESTIONS_RANK )
{
echo "selected";
}
echo ">全部</option>\r\n\t<option value=\"0\" ";
if ( $QUESTIONS_RANK == "0" )
{
echo "selected";
}
echo ">低</option>\r\n\t<option value=\"1\" ";
if ( $QUESTIONS_RANK == "1" )
{
echo "selected";
}
echo ">中</option>\r\n\t<option value=\"2\" ";
if ( $QUESTIONS_RANK == "2" )
{
echo "selected";
}
echo ">高</option>\r\n </select>\r\n </td>\r\n <td nowrap class=\"TableData\"> 题数:</td>\r\n <td class=\"TableData\">\r\n";
echo $QUESTIONS_COUNT0;
echo "</td>\r\n </tr>\r\n <tr align=\"center\" class=\"TableControl\">\r\n <td colspan=\"4\" nowrap>\r\n <input type=\"hidden\" name=\"PAPER_ID\" value=\"";
echo $PAPER_ID;
echo "\">\r\n <input type=\"hidden\" name=\"CUR_PAGE\" value=\"";
echo $CUR_PAGE;
echo "\">\r\n <input type=\"button\" value=\"保存\" class=\"BigButton\" onclick=\"CheckForm();\"> \r\n <input type=\"reset\" value=\"重填\" class=\"BigButton\"> \r\n";
if ( $PAPER_ID != "" )
{
echo " <input type=\"button\" value=\"返回\" class=\"BigButton\" onclick=\"location='index1.php?CUR_PAGE=\$CUR_PAGE'\">\r\n";
}
echo " </td>\r\n </tr>\r\n </table>\r\n</form>\r\n\r\n</body>\r\n</html>";
?>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -