Example #1
0
<center>
<form action="<?php 
            echo $_SERVER["PHP_SELF"] . "?svid=" . $vote[svid] . "&sv=sv";
            ?>
" method="post">
<table cellspacing=0 cellpadding=5 width=700 class=t1>
	<tr><td class=t2>[投票] <?php 
            echo $vote[subject];
            ?>
</td></tr>
	<tr><td class=t5><?php 
            echo $vote[desc];
            ?>
</td></tr>
	<tr><td class=t7><?php 
            echo sysvote_display_probs($vote[probs]);
            ?>
</td></tr>
	<tr><td class=t2>
		<input type=submit value="投票" class=b9>
		<input type=button value="返回" class=b9 onclick="window.location.href='/<?php 
            echo MAINPAGE_FILE;
            ?>
';">	
	</td></tr>
</table></form>
</center>
<?php 
        }
    }
} else {
Example #2
0
    function svCreateVoteStepFive($link)
    {
        global $currentuser, $sysVoteConfig;
        $this->user = $currentuser;
        $svInfor = array("subject" => $_POST["svsubject"], "desc" => $_POST["svdesc"], "annouce" => (int) $_POST["svannouce"], "timelong" => (int) $_POST["svtimelong"], "anonymous" => (int) $_POST["svanonymous"], "votesperip" => (int) $_POST["svvotesperip"], "probnum" => (int) $_POST["svprobnum"], "created" => time());
        $etems = "";
        for ($i = 0; $i < (int) $_POST["svprobnum"]; $i++) {
            if ($etems != "") {
                $etems .= "|";
            }
            $etems .= base64_encode($_POST["svprob" . ($i + 1)]) . "&" . (int) $_POST["svprobtype" . ($i + 1)] . "&" . base64_encode($_POST["svprobetem" . ($i + 1)]);
        }
        $svInfor[etems] = $etems;
        $svInfor[logs] = addslashes("管理员 " . $this->user["userid"] . " 于 " . date("Y-m-d H:i:s") . " 自 " . $_SERVER["REMOTE_ADDR"] . " 创建本次投票;");
        $query = "INSERT INTO `sysvote_votes` ( `svid` , `active` , `subject` , `description` , `changed` , `created` , `annouce` , `probs` , `timelong` , `anonymousvote` , `votesperip` , `votecount` , `logs` , `results` ) " . "VALUES ('', '1', '" . addslashes($svInfor[subject]) . "', '" . addslashes($svInfor[desc]) . "', '" . date("YmdHis") . "' , '" . date("YmdHis") . "', '" . $svInfor[annouce] . "', '" . addslashes($svInfor[etems]) . "', '" . $svInfor[timelong] . "', '" . $svInfor[anonymous] . "', '" . $svInfor[votesperip] . "', '0', '" . $svInfor[logs] . "', '');";
        mysql_query($query, $link);
        if ($svInfor[annouce] == 2) {
            svPostAnnouce($sysVoteConfig["BOARD"], $svInfor);
        }
        if ($svInfor[annouce] == 1) {
            svPostAnnouce("vote", $svInfor);
        }
        //生成html文档供mainpage使用
        $query = "SELECT svid FROM sysvote_votes WHERE subject = '" . addslashes($svInfor[subject]) . "' AND probs = '" . addslashes($svInfor[etems]) . "' ORDER BY svid DESC LIMIT 0,1";
        $result = mysql_query($query, $link);
        $rows = mysql_fetch_array($result);
        $newSvid = $rows[svid];
        $htmlFile = "<form action=\"/bbssysvote.php?svid=" . $newSvid . "&sv=sv\" method=\"post\"><table width=\"100%\" height=\"18\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\" class=\"helpert\">" . "<tr><td width=\"16\" background=\"images/lt.gif\">&nbsp;</td><td width=\"66\" bgcolor=\"#0066CC\">系统投票</td><td width=\"16\" background=\"images/rt.gif\"></td>" . "<td>&nbsp;</td></tr></table><table width=\"100%\" border=\"0\" cellpadding=\"5\" cellspacing=\"0\" class=\"helper\">" . "<tr><td width=\"100%\" class=\"MainContentText\">" . sysvote_display_probs(sysvote_get_probs($svInfor[etems])) . "<p align=center><input type=submit class=button value=\"投票\">" . "<input type=button class=button value=\"查看\" onclick=\"window.location.href='/bbssysvote.php';\">" . "</p></td></tr></table></form>";
        $fp = fopen(BBS_HOME . "/vote/sysvote.html", "w");
        fputs($fp, $htmlFile, strlen($htmlFile));
        fclose($fp);
        ?>
<br /><br /><br />
<p align=center><strong>系统投票创建成功!</strong></p>
<p align=center>[<a href="/bbssysvote.php">点击返回</a>]</p>
<?php 
    }