0){
$bookid='p'.$data[2];
$toc_book[$bookid]=$data[1];
}
}
}
echo "Word Analysis
";
if(!isset($_GET["col"])){
?>
返回
";
echo "您选择的是:";
$boolList=array();
for($i=1;$i<218;$i++){
if(isset($_GET["p$i"])){
if($_GET["p$i"]=="on"){
array_push($boolList,"p$i");
echo $toc_book["p$i"]."; ";
}
}
}
echo "";
$countInsert=0;
$wordlist=array();
$db_file = _FILE_DB_STATISTICS_;
$bookstring="";
for($i=0;$i'') group by parent )";/*查總數,并分類匯總*/
$count_parent=PDO_FetchOne($query);
$query = "SELECT sum(count) FROM \"word\" WHERE (bookid in (".$bookstring.") and parent<>'') ";/*查總數,并分類匯總*/
$sum_parent=PDO_FetchOne($query);
echo "单词个数: $count_word
总词数: $sum_word
parent个数: $count_parent
有parent的单词总数:$sum_parent
";
$query = "select * from (SELECT parent,sum(count) as wordsum FROM \"word\" WHERE (bookid in (".$bookstring.") and parent<>'') group by parent) order by wordsum DESC limit 0 ,2000";/*查總數,并分類匯總*/
$Fetch = PDO_FetchAll($query);
$iFetch=count($Fetch);
echo "";
echo "| 序号 | parent | 数量 | 百分比 | 累计百分比 | ";
$sum_prsent=0;
if($iFetch>0){
$sum=$Fetch[0]["wordsum"];
$first=$sum*100/$sum_word;
for($i=0;$i<$iFetch;$i++){
$sum=$Fetch[$i]["wordsum"];
$prsent=$sum*100/$sum_word;
$prsent1=$prsent*100/$first;
$sum_prsent+=$prsent;
echo "";
echo "| ".($i+1)." | ".$Fetch[$i]["parent"]." | ".$sum." | ".$prsent." | ".$sum_prsent." | ";
echo "
";
}
}
echo "
";
}
else{
}
/*查询结束*/
?>