<?php
/*
  www.oscGold.com (C) Kamelia-Net Jacek Krysiak
  modul oscGold wer 4.0
*/

function screenForm($field_value){
	$stripped = strip_tags($field_value);
	if($field_value!=$stripped) { // something in the field value was HTML
	return false;
	}
	else return true;
} 

require('includes/application_top.php');
require(DIR_WS_LANGUAGES . $language . '/pollbooth.php');

$breadcrumb->add(HEADING_TITLE_POLL, tep_href_link('pollbooth.php'));
$content = 'pollbooth';

if (($HTTP_GET_VARS['action']=='do_comment')&& (screenForm($HTTP_POST_VARS['comment']))) {
   if (tep_not_null($HTTP_POST_VARS['comment'])) {
    $comment_query_raw = "insert into phesis_comments (pollid, customer_id, name, date, host_name, comment,language_id) values ('" . $HTTP_GET_VARS['pollid'] . "', '" . $customer_id . "', '" . addslashes($HTTP_POST_VARS['comment_name']) . "', now(),'" . $REMOTE_ADDR . "','" . addslashes($HTTP_POST_VARS['comment']) . "','" . $languages_id . "')";
    $comment_query = tep_db_query($comment_query_raw);
   }
   $HTTP_GET_VARS['action'] = '';
   $HTTP_GET_VARS['op'] = 'results';
}

if (!isset($HTTP_GET_VARS['op'])) {
    $HTTP_GET_VARS['op']="list";
}

include (bts_select('main', $content_template)); // BTSv1.5
require(DIR_WS_INCLUDES . 'application_bottom.php');
?>