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");
|
2006-07-24 16:25:23 +00:00
|
|
|
require_once("../html/inc/translation.inc");
|
2006-07-11 19:24:12 +00:00
|
|
|
require_once("poll_data.inc");
|
|
|
|
|
|
|
|
function error() {
|
2006-07-22 18:45:21 +00:00
|
|
|
page_head(tr(POLL_ERROR_TITLE));
|
|
|
|
echo tr(POLL_ERROR_TEXT);
|
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) {
|
2006-07-22 18:45:21 +00:00
|
|
|
page_head(tr(POLL_RECORDED));
|
|
|
|
echo tr(POLL_THANKS);
|
2006-07-11 19:24:12 +00:00
|
|
|
page_tail();
|
|
|
|
} else {
|
|
|
|
error();
|
2006-07-11 03:44:14 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
?>
|