include "lib.php";
include "func.php";
$connect = dbConn();
increaseRefresh($connect, "설문조사", 1);
$query = "select no,userlevel,vote from general where user_id='$_SESSION[p_id]'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$me = MYDB_fetch_array($result);
$query = "select develcost,voteopen,vote,votecomment from game where no='1'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$admin = MYDB_fetch_array($result);
$vote = explode("|", $admin[vote]);
if($vote[0] == "") {
$vote[0] = "-";
}
?>
설문조사
require('analytics.php'); ?>
설 문 조 사 closeButton(); ?> |
|
전 체 통 계
if($me[userlevel] >= 4) {
echo "
";
}
echo "
|
";
if($admin[voteopen] >= 1 || $me[userlevel] >= 4) {
echo "
| 전 체 |
{$voteCount} / {$allCount} ({$percentage} %) |
";
$query = "select no from general where npc<2";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$memCount = MYDB_num_rows($result);
$query = "select nation,vote from general where npc<2";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$count = MYDB_num_rows($result);
for($i=0; $i < $count; $i++) {
$vote = MYDB_fetch_array($result);
$totalVote[$vote[vote]]++;
if($vote[vote] > 0) { $nationVoteCount[$vote[nation]]++; }
$nationVote[$vote[nation]][$vote[vote]]++;
}
for($i=0; $i < $voteTypeCount; $i++) {
$per = @round($totalVote[$i] / $memCount * 100, 1);
// if($per < 5) { $vote[cnt] = " "; }
echo "
| {$totalVote[$i]} |
";
}
echo "
|
";
}
if($admin[voteopen] >= 2 || $me[userlevel] >= 4) {
$query = "select no from general where nation=0 and npc<2";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$memCount = MYDB_num_rows($result);
if(!$nationVoteCount[0]) { $nationVoteCount[0] = 0; }
$percentage = @round($nationVoteCount[0] / $memCount * 100, 1);
echo "
| 재 야 |
{$nationVoteCount[0]} / {$memCount} ({$percentage} %) |
";
for($i=0; $i < $voteTypeCount; $i++) {
$per = @round($nationVote[0][$i] / $memCount * 100, 1);
// if($per < 5) { $vote[cnt] = " "; }
echo "
| {$nationVote[0][$i]} |
";
}
echo "
|
";
$query = "select nation,color,name,gennum from nation order by gennum desc";
$nationResult = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$nationcount = MYDB_num_rows($nationResult);
for($i=0; $i < $nationcount; $i++) {
$nation = MYDB_fetch_array($nationResult);
$query = "select no from general where nation='{$nation[nation]}' and npc<2";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$memCount = MYDB_num_rows($result);
if(!$nationVoteCount[$nation[nation]]) { $nationVoteCount[$nation[nation]] = 0; }
$percentage = @round($nationVoteCount[$nation[nation]] / $memCount * 100, 1);
echo "
| {$nation[name]} |
{$nationVoteCount[$nation[nation]]} / {$memCount} ({$percentage} %) |
";
for($k=0; $k < $voteTypeCount; $k++) {
$per = @round($nationVote[$nation[nation]][$k] / $memCount * 100, 1);
// if($per < 5) { $vote[cnt] = " "; }
echo "
| {$nationVote[$nation[nation]][$k]} |
";
}
echo "
|
";
}
}
?>
| closeButton(); ?> |
| banner(); ?> |
PrintElapsedTime(); ?>
function getColor($type) {
if($type > 0) {
$type = (($type - 1) % 7) + 1;
}
switch($type) {
case 0: $color = "black"; break;
case 1: $color = "red"; break;
case 2: $color = "orange"; break;
case 3: $color = "yellow"; break;
case 4: $color = "green"; break;
case 5: $color = "blue"; break;
case 6: $color = "navy"; break;
case 7: $color = "purple"; break;
}
return $color;
}
function getNewColor($type) {
if($type > 0) {
$type = (($type - 1) % 7) + 1;
}
switch($type) {
case 2: $color = "black"; break;
case 3: $color = "black"; break;
default:$color = "white"; break;
}
return $color;
}
?>