Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added poll functionality, uses phpPolls
git-svn-id: http://mantisbt.svn.sourceforge.net/svnroot/mantisbt/trunk@362 f5dc347c-c33d-0410-90a0-b07cc1902cb9
- Loading branch information
prescience
committed
Aug 15, 2001
1 parent
b8f36f9
commit 68e342f
Showing
2 changed files
with
137 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
<html> | ||
<head> | ||
<? include( "css.php3" ) ?> | ||
<title>Mantis</title> | ||
</head> | ||
<body> | ||
|
||
<p> | ||
<div align=center> | ||
<h2>Mantis</h2> | ||
Last modified: <? echo date( "M d, Y - H:m", getlastmod() )?> | ||
</div> | ||
|
||
<p> | ||
<div align=center> | ||
|
||
<table width=100%> | ||
<tr valign=top> | ||
<? include("side_menu.php3") ?> | ||
<td width=100%> | ||
<p> | ||
<b><font size=+1>Polls</font></b> | ||
|
||
<p> | ||
Please fill out some of the polls and surveys on this page. This will provide feedback and help chart the direction Mantis goes in. | ||
<p> | ||
<? | ||
function db_connect($p_hostname="localhost", $p_username="root", | ||
$p_password="", $p_database="mantis", | ||
$p_port=3306 ) { | ||
|
||
$t_result = mysql_connect( $p_hostname.":".$p_port, | ||
$p_username, $p_password ); | ||
$t_result = mysql_select_db( $p_database ); | ||
} | ||
|
||
function sql_to_unix_time( $p_timeString ) { | ||
return mktime( substr( $p_timeString, 8, 2 ), | ||
substr( $p_timeString, 10, 2 ), | ||
substr( $p_timeString, 12, 2 ), | ||
substr( $p_timeString, 4, 2 ), | ||
substr( $p_timeString, 6, 2 ), | ||
substr( $p_timeString, 0, 4 ) ); | ||
} | ||
|
||
include("mantis/config_inc.php"); | ||
|
||
db_connect( $g_hostname, $g_db_username, $g_db_password, $g_database_name ); | ||
$query = "SELECT *, UNIX_TIMESTAMP(timeStamp) as timeStamp | ||
FROM vbooth_desc | ||
ORDER BY pollID DESC"; | ||
$result = mysql_query( $query ); | ||
$poll_count = mysql_num_rows( $result ); | ||
for ($i=0;$i<$poll_count;$i++) { | ||
$row = mysql_fetch_array( $result ); | ||
$t_poll_id = $row["pollID"]; | ||
$t_poll_title = $row["pollTitle"]; | ||
$t_poll_timeStamp = $row["timeStamp"]; | ||
|
||
$t_poll_timeStamp = date( "m-d-Y", $t_poll_timeStamp ); | ||
|
||
PRINT "<li>[ $t_poll_timeStamp ] <a href=\"view_poll.php3?f_poll_id=$t_poll_id\">$t_poll_title</a>"; | ||
PRINT " [ <a href=\"http://mantisbt.sourceforge.net/view_poll.php3?f_done=1&f_poll_id=$t_poll_id\"><font size=-1>view results</font></a> ]<br>"; | ||
} | ||
?> | ||
|
||
</td> | ||
</tr> | ||
</table> | ||
|
||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
<html> | ||
<head> | ||
<? include( "css.php3" ) ?> | ||
<title>Mantis</title> | ||
</head> | ||
<body> | ||
|
||
<p> | ||
<div align=center> | ||
<h2>Mantis</h2> | ||
Last modified: <? echo date( "M d, Y - H:m", getlastmod() )?> | ||
</div> | ||
|
||
<p> | ||
<div align=center> | ||
|
||
<table width=100%> | ||
<tr valign=top> | ||
<? include("side_menu.php3") ?> | ||
<td width=100%> | ||
<p> | ||
<b><font size=+1>Polls</font></b> | ||
|
||
<p> | ||
|
||
<? | ||
function db_connect($p_hostname="localhost", $p_username="root", | ||
$p_password="", $p_database="mantis", | ||
$p_port=3306 ) { | ||
|
||
$t_result = mysql_connect( $p_hostname.":".$p_port, | ||
$p_username, $p_password ); | ||
$t_result = mysql_select_db( $p_database ); | ||
} | ||
|
||
include("mantis/config_inc.php"); | ||
require('phpPolls/phpPollConfig.php3'); | ||
require('phpPolls/phpPollUI.php3'); | ||
|
||
db_connect( $g_hostname, $g_db_username, $g_db_password, $g_database_name ); | ||
$query = "SELECT pollTitle | ||
FROM vbooth_desc | ||
WHERE pollID='$f_poll_id'"; | ||
$result = mysql_query( $query ); | ||
$t_project_name = mysql_result( $result, 0, 0 ); | ||
|
||
PRINT "<p>$t_project_name<p>"; | ||
|
||
if ( !isset( $f_done ) ) { | ||
poll_generateUI( $f_poll_id, "http://mantisbt.sourceforge.net/view_poll.php3?f_done=1&f_poll_id=$f_poll_id" ); | ||
|
||
PRINT "<p><a href=\"http://mantisbt.sourceforge.net$PHP_SELF?f_done=1&f_poll_id=$f_poll_id\">See Results</a>"; | ||
} else { | ||
poll_viewResults( $f_poll_id ); | ||
} | ||
?> | ||
<p> | ||
<b><a href="polls.php3">Go back to the Polls</a></b> | ||
|
||
</td> | ||
</tr> | ||
</table> | ||
|
||
</body> | ||
</html> |