"; echo "book:$get_book
"; echo "par_begin:$get_par_begin
"; echo "par_end:$get_par_end
"; echo "language:$language
"; echo "author:$author
"; echo "editor:$editor
"; $outHtml = ""; if ($author == "templet") { switch ($get_res_type) { case "wbw": $db_file = "../appdata/palicanon/templet/" . $get_book . "_tpl.db3"; break; case "heading": //$db_file = "../appdata/palicanon/templet/toc.db3"; $db_file = "../appdata/palicanon/pali_text/" . $get_book . "_pali.db3"; break; } } else { switch ($get_res_type) { case "heading": $db_file = "../appdata/palicanon/heading/toc.db3"; break; default: $db_file = "../appdata/palicanon/" . $get_res_type . "/" . $get_book . "_" . $get_res_type . ".db3"; break; } } //open database PDO_Connect("$db_file"); switch ($get_res_type) { case "translate": case "note": $query = "SELECT * FROM \"data\" WHERE (\"paragraph\" BETWEEN " . $PDO->quote($get_par_begin) . " AND " . $PDO->quote($get_par_end) . ") AND \"language\" = " . $PDO->quote($language) . " AND \"author\" = " . $PDO->quote($author) . " AND \"editor\" = " . $PDO->quote($editor) . " AND \"edition\" = " . $PDO->quote($edition) . " AND \"subver\" = " . $PDO->quote($subver); $Fetch = PDO_FetchAll($query); $iFetch = count($Fetch); if ($iFetch > 0) { for ($i = 0; $i < $iFetch; $i++) { switch ($get_res_type) { case "translate": $outHtml = "

" . $Fetch[$i]["text"] . "

"; break; case "note": $outHtml = "

" . $Fetch[$i]["text"] . "

"; break; break; } echo $outHtml; } } break; case "heading": if ($author == "templet") { $query = "SELECT * FROM \"data\" WHERE \"book\" = " . $PDO->quote($get_book) . " AND (\"paragraph\" BETWEEN " . $PDO->quote($get_par_begin) . " AND " . $PDO->quote($get_par_end) . ") AND \"level\">'0'"; } else { $query = "SELECT * FROM \"data\" WHERE book=" . $PDO->quote($get_book) . " AND (\"paragraph\" BETWEEN " . $PDO->quote($get_par_begin) . " AND " . $PDO->quote($get_par_end) . ") AND \"language\" = " . $PDO->quote($language) . " AND \"author\" = " . $PDO->quote($author) . " AND \"editor\" = " . $PDO->quote($editor) . " AND \"edition\" = " . $PDO->quote($edition); } $Fetch = PDO_FetchAll($query); $iFetch = count($Fetch); if ($iFetch > 0) { for ($i = 0; $i < $iFetch; $i++) { $level = $Fetch[$i]["level"]; $outHtml = "" . $Fetch[$i]["text"] . ""; echo $outHtml; } } break; case "wbw": for ($iPar = $get_par_begin; $iPar <= $get_par_end; $iPar++) { if ($author == "templet") { $query = "SELECT * FROM \"main\" WHERE (\"paragraph\" = " . $PDO->quote($iPar) . " ) "; } else { $query = "SELECT * FROM \"main\" WHERE (\"paragraph\" = " . $PDO->quote($iPar) . " ) AND \"language\" = " . $PDO->quote($language) . " AND \"author\" = " . $PDO->quote($author) . " AND \"editor\" = " . $PDO->quote($editor) . " AND \"edition\" = " . $PDO->quote($edition) . " AND \"subver\" = " . $PDO->quote($subver); } echo "

$iPar

"; $Fetch = PDO_FetchAll($query); $iFetch = count($Fetch); if ($iFetch > 0) { echo "
"; for ($i = 0; $i < $iFetch; $i++) { $outHtml = "
"; $outHtml .= "

" . $Fetch[$i]["word"] . "

"; $outHtml .= "

" . $Fetch[$i]["mean"] . "

"; $outHtml .= "

" . $Fetch[$i]["part"] . "

"; $outHtml .= "

" . $Fetch[$i]["partmean"] . "

"; $outHtml .= "

" . $Fetch[$i]["type"] . "#" . $Fetch[$i]["gramma"] . "

"; $outHtml .= "
"; echo $outHtml; } echo "
"; echo "
"; } } break; } /*查询结束*/ ?>