2006-07-11 03:44:14 +00:00
|
|
|
<?php
|
2006-07-11 19:24:12 +00:00
|
|
|
require_once("docutil.php");
|
2006-07-11 03:44:14 +00:00
|
|
|
require_once("poll.inc");
|
2009-01-26 23:52:27 +00:00
|
|
|
require_once("../html/inc/translation.inc");
|
2006-07-11 19:24:12 +00:00
|
|
|
require_once("poll_data.inc");
|
|
|
|
|
2008-11-18 17:33:13 +00:00
|
|
|
error_page("The poll is closed");
|
2006-07-11 19:24:12 +00:00
|
|
|
function error() {
|
2009-01-26 23:52:27 +00:00
|
|
|
page_head(tra("Error - results not recorded"));
|
|
|
|
echo tra("An internal error has prevented us from recording your survey response. Please try again later.");
|
2006-07-11 19:24:12 +00:00
|
|
|
page_tail();
|
|
|
|
exit();
|
|
|
|
}
|
2006-07-11 03:44:14 +00:00
|
|
|
|
|
|
|
mysql_pconnect("localhost", "boincadm", null);
|
|
|
|
mysql_select_db("poll");
|
|
|
|
|
2006-07-11 21:56:53 +00:00
|
|
|
session_set_cookie_params(86400*365);
|
2006-07-11 03:44:14 +00:00
|
|
|
session_start();
|
|
|
|
$uid = session_id();
|
|
|
|
|
2006-07-11 19:24:12 +00:00
|
|
|
$x = parse_form();
|
|
|
|
$xml = generate_xml($x);
|
2006-07-11 03:44:14 +00:00
|
|
|
|
2006-07-11 19:24:12 +00:00
|
|
|
$response = select_response($uid);
|
|
|
|
if ($response) {
|
|
|
|
$result = update_response($uid, $xml);
|
|
|
|
} else {
|
|
|
|
$result = new_response($uid, $xml);
|
2006-07-11 03:44:14 +00:00
|
|
|
}
|
2006-07-11 19:24:12 +00:00
|
|
|
if ($result) {
|
2009-01-26 23:52:27 +00:00
|
|
|
page_head(tra("Survey response recorded"));
|
|
|
|
echo tra("Thank you for completing the BOINC user survey.");
|
2006-07-11 19:24:12 +00:00
|
|
|
page_tail();
|
|
|
|
} else {
|
|
|
|
error();
|
2006-07-11 03:44:14 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
?>
|