📄 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";
echo "<s";
echo "cript Language=\"JavaScript\">\r\nfunction CheckForm()\r\n{\r\n if(document.form1.TO_ID.value==\"\")\r\n { alert(\"请指定发布范围!\");\r\n return (false);\r\n }\r\n\r\n if(document.form1.SUBJECT.value==\"\")\r\n { alert(\"投票的标题不能为空!\");\r\n return (false);\r\n }\r\n\r\n document.form1.submit();\r\n}\r\n\r\nfunction clear_dept()\r\n{\r\n document.form1.TO_NAME.value=\"\";\r\n document.form1.TO_ID.value=\"\";\r\n}\r\n\r\n";
echo "function LoadWindow()\r\n{\r\n URL=\"/module/dept_select\";\r\n loc_x=document.body.scrollLeft+event.clientX-event.offsetX-100;\r\n loc_y=document.body.scrollTop+event.clientY-event.offsetY+170;\r\n window.showModalDialog(URL,self,\"edge:raised;scroll:1;status:0;help:0;resizable:1;dialogWidth:400px;dialogHeight:330px;dialogTop:\"+loc_y+\"px;dialogLeft:\"+loc_x+\"px\");\r\n}\r\n\r\nfunction td_calendar(fieldname)\r\n{\r\n";
echo " 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:205px;dialogTop:\"+mytop+\"px;dialogLeft:\"+myleft+\"px\");\r\n}\r\n</script>\r\n</head>\r\n\r\n<body class=\"bodycolor\" topmargin=\"";
echo "5\" onload=\"javascript:form1.SUBJECT.focus();\">\r\n";
if ( $VOTE_ID != "" )
{
$query = "SELECT * from VOTE_TITLE where VOTE_ID={$VOTE_ID}";
$cursor = exequery( $connection, $query );
if ( $ROW = mysql_fetch_array( $cursor ) )
{
$TO_ID = $ROW['TO_ID'];
$SUBJECT = $ROW['SUBJECT'];
$CONTENT = $ROW['CONTENT'];
$TYPE = $ROW['TYPE'];
$ANONYMITY = $ROW['ANONYMITY'];
$VIEW_PRIV = $ROW['VIEW_PRIV'];
$BEGIN_DATE = $ROW['BEGIN_DATE'];
$END_DATE = $ROW['END_DATE'];
if ( $BEGIN_DATE == "0000-00-00" )
{
$BEGIN_DATE = "";
}
if ( $END_DATE == "0000-00-00" )
{
$END_DATE = "";
}
$query1 = "select * from USER where USER_ID='{$FROM_ID}'";
$cursor1 = exequery( $connection, $query1 );
if ( $ROW = mysql_fetch_array( $cursor1 ) )
{
$FROM_NAME = $ROW['USER_NAME'];
$DEPT_ID = $ROW['DEPT_ID'];
}
$DEPT_NAME = dept_long_name( $DEPT_ID );
if ( $TO_ID == "ALL_DEPT" )
{
$TO_NAME = "全体部门";
}
else
{
$TO_NAME = "";
$TOK = strtok( $TO_ID, "," );
while ( $TOK != "" )
{
$query1 = "select * from DEPARTMENT where DEPT_ID={$TOK}";
$cursor1 = exequery( $connection, $query1 );
if ( $ROW = mysql_fetch_array( $cursor1 ) )
{
$TO_NAME .= $ROW['DEPT_NAME'].",";
}
$TOK = strtok( "," );
}
}
}
}
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\">";
echo "<s";
echo "pan class=\"big3\"> 新建投票</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>\r\n <td nowrap class=\"TableData\">发布范围(部门):</td>\r\n <td class=\"TableData\">\r\n <input type=\"hidden\" name=\"TO_ID\" value=";
echo "\"";
echo $TO_ID;
echo "\">\r\n <textarea cols=40 name=TO_NAME rows=2 class=\"BigStatic\" wrap=\"yes\" readonly>";
echo $TO_NAME;
echo "</textarea>\r\n <input type=\"button\" value=\"添 加\" class=\"SmallButton\" onClick=\"LoadWindow()\" title=\"添加部门\" name=\"button\">\r\n <input type=\"button\" value=\"清 空\" class=\"SmallButton\" onClick=\"clear_dept()\" title=\"清空部门\" name=\"button\">\r\n </td>\r\n </tr>\r\n <tr>\r\n <td nowrap class=\"TableData\"> 标题:</td>\r\n <td class=\"TableData\">\r\n <input type=\"text\" name=\"S";
echo "UBJECT\" size=\"40\" maxlength=\"40\" class=\"BigInput\" value=\"";
echo $SUBJECT;
echo "\">\r\n </td>\r\n </tr>\r\n <tr>\r\n <td nowrap class=\"TableData\">投票描述:</td>\r\n <td class=\"TableData\">\r\n <textarea name=\"CONTENT\" class=\"BigInput\" cols=\"50\" rows=\"3\">";
echo $CONTENT;
echo "</textarea>\r\n </td>\r\n </tr>\r\n <tr>\r\n <td nowrap class=\"TableData\"> 类型:</td>\r\n <td class=\"TableData\">\r\n ";
echo "<s";
echo "elect name=\"TYPE\" class=\"BigSelect\">\r\n <option value=\"0\" ";
if ( $TYPE == "0" )
{
echo "selected";
}
echo ">单选</option>\r\n <option value=\"1\" ";
if ( $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 ";
echo "<s";
echo "elect name=\"VIEW_PRIV\" class=\"BigSelect\">\r\n <option value=\"0\" ";
if ( $VIEW_PRIV == "0" )
{
echo "selected";
}
echo ">投票后允许查看</option>\r\n <option value=\"1\" ";
if ( $VIEW_PRIV == "1" )
{
echo "selected";
}
echo ">投票前允许查看</option>\r\n <option value=\"2\" ";
if ( $VIEW_PRIV == "2" )
{
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 <input type=\"checkbox\" name=\"ANONYMITY\" id=\"ANONYMITY\" ";
if ( $ANONYMITY == "1" )
{
echo "checked";
}
echo "><label for=\"ANONYMITY\">允许匿名投票</label>\r\n </td>\r\n </tr>\r\n <tr>\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 <tr>\r\n <td nowrap class=\"TableData\"> 短消息提醒:</td>\r\n <td class=\"TableData\">\r\n <input type=\"checkbox\" name=\"SMS_REMIND\" id=\"SMS_REMIND\" checked><label for=\"SMS_REMIND\">使用内部短信提醒用户</label>\r\n </td>\r\n </";
echo "tr>\r\n <tr align=\"center\" class=\"TableControl\">\r\n <td colspan=\"2\" nowrap>\r\n <input type=\"hidden\" name=\"VOTE_ID\" value=\"";
echo $VOTE_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 ( $VOTE_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 + -