<?php
define('CURSCRIPT', 'survey');
require_once './engine/common.inc.php';
$get_id = isset($get_id) && is_numeric($get_id) ? $get_id : 0;

$q = $db->query("SELECT * FROM g_surveys where survey_id = $get_id limit 1");
if(!$survey_thread=$db->fetch_array($q)){
	showmsg("该投票主题不存在");
}
$q = $db->query("SELECT * FROM g_subsurveys where survey_id = $get_id");
$i=0;
while($survey_item=$db->fetch_array($q)){
	$survey_item['sub_survey_img_width']=(int)($survey_item['sub_survey_count']/$survey_thread['survey_total_count']*400);
	$survey_items[$i]=$survey_item;
	$i++;
}
$siteheadtitle=implode(' ',array($survey_thread['survey_title'],$surveyname="投票中心",$sitename,$sitekeywords));
include($templatedir."viewsurvey.tpl.php");