|
From: mdw c. <myd...@li...> - 2003-03-05 18:41:27
|
MyDynaWeb CVS committal
Author : sukria
Project : mydynaweb
Module : htdocs
Dir : mydynaweb/htdocs/include
Modified Files:
gui.inc.php
Log Message:
enregistre les votes (un seul par IP)
===================================================================
RCS file: /cvsroot/mydynaweb/mydynaweb/htdocs/include/gui.inc.php,v
retrieving revision 1.59
retrieving revision 1.60
diff -u -3 -r1.59 -r1.60
--- gui.inc.php 5 Mar 2003 16:54:00 -0000 1.59
+++ gui.inc.php 5 Mar 2003 18:41:25 -0000 1.60
@@ -388,13 +388,7 @@
$rqt->query($DBH, $sql) or send_sql_error($PHP_SELF, $sql, $rqt->error());
$row2 = $rqt->getrow();
- if ($row2['pol_id'] == $row['pol_id'] and $row["pol_id"] != "") {
- // already vote for that poll
- return ("results");
- }
-
- $VALUES['TITLE'] = translate("POLL",$DBH);
$VALUES['TITLE'] .= "<br><b>" . $row["pol_title"] . "</b>";
$form = get_hash_template($BOX_HASH_TEMPLATE["HEAD"], $VALUES);
@@ -413,6 +407,32 @@
$votes[4] = $row["pol_question_5_num"];
$votes[5] = $row["pol_question_6_num"];
$votes[6] = $row["pol_question_7_num"];
+
+
+ // already vote for that poll
+ if ($row2['pol_id'] == $row['pol_id'] and $row["pol_id"] != "") {
+
+ $VALUES['TITLE'] = "<b>" . $row["pol_title"] . "</b>";
+ $form = get_hash_template($BOX_HASH_TEMPLATE["HEAD"], $VALUES);
+
+ for ($i=0; $i<7; $i++) {
+ if (strlen($questions[$i])) {
+ $size = $votes[$i] * 2 + 5;
+
+ $VALUES["CONTENT"] = $questions[$i] . " : ";
+ $VALUES["CONTENT"] .= "<table cellspacing='0' border='0' cellpadding='0' height='10' width='$size' bgcolor='#000000'>
+ <tr><td background='images/bar.png' height='10' width='$size'></td></tr></table> (".$votes[$i].")<br>\n";
+ $form .= get_hash_template($BOX_HASH_TEMPLATE["LINE"], $VALUES);
+ }
+ else {
+ break;
+ }
+ }
+
+ $form .= get_hash_template($BOX_HASH_TEMPLATE["FOOT"], $VALUES);
+ return ($form);
+ }
+
$form .= "<FORM name='poll' action='poll.php' method='GET'>\n";
$form .= "<INPUT type='hidden' name='pol_id' value='".$row["pol_id"]."'>\n";
|