⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 poll_set.php

📁 学校网站源码http://您的网址/admin/admin_login.asp 默认登录用户:admin 默认登录密码:admin
💻 PHP
📖 第 1 页 / 共 2 页
字号:
		while ( $msql->next_record( ) )
		{
			$poll_id = $msql->f( "poll_id" );
			$question = $msql->f( "question" );
			$timestamp = $msql->f( "timestamp" );
			$status = $msql->f( "status" );
			$exp_time = $msql->f( "exp_time" );
			$expire = $msql->f( "expire" );
			$etime = $exp_time - $timestamp;
			$etime = date( "d", $etime ) - 1;
			$timestamp = date( "Y-n-j", $timestamp );
			$exp_time = date( "Y-n-j", $exp_time );
			$plus = "{#Vote[".$poll_id."]#}";
			$lis_string .= "<tr>\r\n\t\t\t   \r\n\t\t\t   <td class=\"con\"><div align=\"center\">{$poll_id}</div></td><td height=\"23\" class=\"con\"><div align=\"center\">{$question}</div></td>\r\n\t\t\t   \r\n\t\t\t   \r\n\t\t\t   <td class=\"con\"><div align=\"center\">{$timestamp}</div></td>\r\n\t\t\t   <td class=\"con\"><div align=\"center\">{$etime}</div></td>\r\n\t\t\t   <td class=\"con\"><div align=\"center\">{$exp_time}</div></td>\r\n\t\t\t   <td class=\"con\"><div align=\"center\">{$plus}</div></td>\r\n\t\t\t   <td class=\"con\"><div align=\"center\"><a href=poll_set.php?action=modify&pollid={$poll_id}><img src=images/toolbar_edit_up.gif  border=0></a></div></td>\r\n\t\t\t   <td class=\"con\"><div align=\"center\"><a href=\"javascript:del_entry({$poll_id})\"><img src=images/toolbar_delete_up.gif  border=0></a></div></td>\r\n\t\t\t   </tr>";
		}
		return $lis_string;
	}
	echo listpoll( );
	echo " \r\n</table>\r\n      \r\n";
}
else if ( $action == "option" )
{
	echo " \r\n\r\n";
	if ( $cc == $strVoteModiSet )
	{
		$img_height = $_POST['img_height'];
		$img_length = $_POST['img_length'];
		$vodinfo = $_POST['vodinfo'];
		$def_options = $_POST['def_options'];
		$msql->query( " UPDATE {$tbl_poll_config} SET \r\n\t\t\t\t\t\timg_height = '{$img_height}',\r\n\t\t\t\t\t\timg_length = '{$img_length}',\r\n\t\t\t\t\t\tvodinfo = '{$vodinfo}',\r\n\t\t\t\t\t\tdef_options = '{$def_options}'\r\n\t\t\t\t\t" );
		sayok( $strVoteModiSetOk, "", "" );
	}
	echo "<table width=\"625\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\" align=\"center\" height=\"22\">\r\n  <tr> \r\n    <td class=title align=\"left\" height=\"22\" valign=\"top\" width=\"3\"><img src=\"images/menubg16.gif\" width=\"3\" height=\"30\"></td>\r\n    <td class=title align=\"center\" height=\"22\" colspan=\"2\">";
	echo $strVoteSet;
	echo "</td>\r\n    <td class=title align=\"right\" height=\"22\" width=\"3\" valign=\"top\"><img src=\"images/menubg17.gif\" width=\"3\" height=\"30\"></td>\r\n  </tr>\r\n</table>\r\n<table width=\"625\" border=\"0\" cellpadding=\"3\" cellspacing=\"1\" align=\"center\">\r\n  \r\n        <form action=\"\" method=\"post\" name=\"poll\">\r\n          ";
	$msql->query( " SELECT * from {$tbl_poll_config} " );
	if ( $msql->next_record( ) )
	{
		$img_height = $msql->f( "img_height" );
		$img_length = $msql->f( "img_length" );
		$vodinfo = $msql->f( "vodinfo" );
		$def_options = $msql->f( "def_options" );
	}
	echo "          <tr> \r\n            <td width=\"27%\" class=\"title\">\r\n        <div align=\"right\">";
	echo $strVoteHeight;
	echo "</div>\r\n      </td>\r\n            <td width=\"73%\" class=\"con\"><input name=\"img_height\" type=\"text\" id=\"img_height\" value=\"";
	echo $img_height;
	echo "\" size=\"30\"></td>\r\n          </tr>\r\n          <tr> \r\n            <td class=\"title\">\r\n        <div align=\"right\">";
	echo $strVoteLen;
	echo "</div>\r\n      </td>\r\n            <td class=\"con\"><input name=\"img_length\" type=\"text\" id=\"img_length\" value=\"";
	echo $img_length;
	echo "\" size=\"30\"></td>\r\n          </tr>\r\n          <tr> \r\n            <td class=\"title\"><div align=\"right\">";
	echo $strVoteAl;
	echo "</div></td>\r\n            <td class=\"con\"><input name=\"vodinfo\" type=\"text\" id=\"vodinfo\" value=\"";
	echo $vodinfo;
	echo "\" size=\"30\"></td>\r\n          </tr>\r\n          <tr> \r\n            <td class=\"title\">\r\n        <div align=\"right\">";
	echo $strVoteNum;
	echo "</div>\r\n      </td>\r\n            <td class=\"con\"><input name=\"def_options\" type=\"text\" id=\"def_options\" value=\"";
	echo $def_options;
	echo "\" size=\"5\"></td>\r\n          </tr>\r\n          <tr>\r\n            <td class=\"title\">&nbsp;</td>\r\n            <td class=\"con\"><input name=\"cc\" type=\"submit\" id=\"cc\" value=\"";
	echo $strVoteModiSet;
	echo "\"></td>\r\n          </tr>\r\n        </form>\r\n      </table>\r\n      \r\n";
}
else if ( $action == "modify" )
{
	$pollid = $_REQUEST['pollid'];
	echo " \r\n<table width=\"625\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\" align=\"center\" height=\"22\">\r\n  <tr> \r\n    <td class=title align=\"left\" height=\"22\" valign=\"top\" width=\"3\"><img src=\"images/menubg16.gif\" width=\"3\" height=\"30\"></td>\r\n    <td class=title align=\"center\" height=\"22\" colspan=\"2\">";
	echo $strVoteModi;
	echo "</td>\r\n    <td class=title align=\"right\" height=\"22\" width=\"3\" valign=\"top\"><img src=\"images/menubg17.gif\" width=\"3\" height=\"30\"></td>\r\n  </tr>\r\n</table>\r\n\r\n<table width=\"625\" border=\"0\" align=\"center\" cellpadding=\"3\" cellspacing=\"1\">\r\n        \r\n        <form action=\"\" method=\"post\" name=\"poll\">\r\n          ";
	function modify_poll( $poll_id )
	{
		$question = $_POST['question'];
		$cc = $_POST['cc'];
		$option_id = $_POST['option_id'];
		$votes = $_POST['votes'];
		$status = $_POST['status'];
		$color = $_POST['color'];
		global $msql;
		global $tbl_poll_index;
		global $tbl_poll_data;
		global $tbl_poll_config;
		global $strVoteSel;
		global $strModifyOk;
		global $strVoteSave;
		global $strClose;
		global $strOpen;
		global $strHidden;
		global $strVoteTitle;
		global $strVoteColor1;
		global $strVoteColor2;
		global $strVoteColor3;
		global $strVoteColor4;
		global $strVoteColor5;
		global $strVoteColor6;
		global $strVoteColor7;
		global $strVoteColor8;
		global $strVoteColor9;
		global $strVoteColor10;
		global $strVoteColor11;
		global $strVoteColor12;
		if ( $cc == $strVoteSave )
		{
			$msql->query( " UPDATE {$tbl_poll_index} SET\r\n\t\t\t\t\t\tquestion = '{$question}',\r\n\t\t\t\t\t\tstatus = '{$status}'\r\n\t\t\t\t\t where poll_id = '{$poll_id}' " );
			$i = 1;
			for ( ;	$i <= sizeof( $option_id );	$i++	)
			{
				$option_id[$i] = trim( $option_id[$i] );
				if ( !empty( $option_id[$i] ) )
				{
					if ( !get_magic_quotes_gpc( ) )
					{
						$option_id[$i] = addslashes( $option_id[$i] );
					}
					$msql->query( " UPDATE {$tbl_poll_data} SET  \r\n\t\t\t\t\t\t\t\toption_text = '{$option_id[$i]}',\r\n\t\t\t\t\t\t\t\tcolor = '{$color[$i]}',\r\n\t\t\t\t\t\t\t\tvotes = '{$votes[$i]}'\r\n\t\t\t\t\t\t\t\twhere option_id = '{$i}' and poll_id = '{$poll_id}' " );
				}
			}
			sayok( $strModifyOk, "", "" );
		}
		$msql->query( " SELECT * FROM {$tbl_poll_index} WHERE poll_id = '{$poll_id}' " );
		if ( $msql->next_record( ) )
		{
			$question = $msql->f( "question" );
			$status = $msql->f( "status" );
			$modify_string = "<tr><td width=\"27%\" class=\"title\"><div align=\"right\">".$strVoteTitle."</div></td><td width=\"73%\" class=\"con\"><input type=\"text\" name=\"question\" value=\"{$question}\" size=29><select name=\"status\" id=\"status\">\r\n                  <option value=\"0\" ".seld( $status, 0 ).">".$strClose."</option><option value=\"1\"  ".seld( $status, 1 ).">".$strOpen."</option><option value=\"2\"  ".seld( $status, 2 ).">".$strHidden."</option></select></td></tr>";
		}
		$msql->query( " SELECT * FROM {$tbl_poll_data} WHERE poll_id = '{$poll_id}' ORDER BY option_id ASC" );
		while ( $msql->next_record( ) )
		{
			$option_id = $msql->f( "option_id" );
			$option_text = $msql->f( "option_text" );
			$color = $msql->f( "color" );
			$votes = $msql->f( "votes" );
			$seloption_id = $modify_string .= "<tr><td class=\"title\"><div align=\"right\">".$strVoteSel."({$option_id})</div></td><td class=\"con\"><input name=\"option_id[{$option_id}]\" type=\"text\" value=\"{$option_text}\"><input name=\"votes[{$option_id}]\" type=\"text\" id=\"vote\" value=\"{$votes}\" size=\"5\"><select class=\"select\" name=\"color[{$option_id}]\" onChange=\"javascript:ChangeBar(options[selectedIndex].value,{$option_id})\">\r\n              <option value=\"blank\" ".seld( $color, "blank" ).">---</option>\r\n              <option value=\"aqua\" ".seld( $color, "aqua" ).">".$strVoteColor1."</option>\r\n              <option value=\"blue\" ".seld( $color, "blue" ).">".$strVoteColor2."</option>\r\n              <option value=\"brown\" ".seld( $color, "brown" ).">".$strVoteColor3."</option>\r\n              <option value=\"darkgreen\" ".seld( $color, "darkgreen" ).">".$strVoteColor4."</option>\r\n              <option value=\"gold\" ".seld( $color, "gold" ).">".$strVoteColor5."</option>\r\n              <option value=\"green\" ".seld( $color, "green" ).">".$strVoteColor6."</option>\r\n              <option value=\"grey\" ".seld( $color, "grey" ).">".$strVoteColor7."</option>\r\n              <option value=\"orange\" ".seld( $color, "orange" ).">".$strVoteColor8."</option>\r\n              <option value=\"pink\" ".seld( $color, "pink" ).">".$strVoteColor9."</option>\r\n              <option value=\"purple\" ".seld( $color, "purple" ).">".$strVoteColor10."</option>\r\n              <option value=\"red\" ".seld( $color, "red" ).">".$strVoteColor11."</option>\r\n              <option value=\"yellow\" ".seld( $color, "yellow" ).">".$strVoteColor12."</option>\r\n\r\n              </select><img src=\"images/".$color.".gif\" name=\"bar{$option_id}\" width=\"8\" height=\"8\" align=\"absmiddle\"></td></tr>";
		}
		$modify_string .= "<tr><td class=\"title\"><div align=\"right\"></div></td><td class=\"con\"><input type=\"submit\" name=\"cc\" value=\"".$strVoteSave."\"></td></tr>";
		return $modify_string;
	}
	echo modify_poll( $pollid );
	echo "        </form>\r\n      </table>\r\n";
}
echo " \r\n<table width=\"623\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\" align=\"center\" height=\"10\" background=\"images/mu1.jpg\">\r\n  <tr> \r\n    <td  align=\"center\" height=\"2\" colspan=\"2\"></td>\r\n  </tr>\r\n</table>\r\n</body>\r\n</html>";
?>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -