pc_get_pali_text.php 1.2 KB

1234567891011121314151617181920212223242526272829303132333435
  1. <?php
  2. /*
  3. 加载巴利原文
  4. */
  5. include __DIR__."/../config.php";
  6. include __DIR__."/../public/_pdo.php";
  7. $get_book = $_GET["book"];
  8. if (substr($get_book, 0, 1) == "p") {
  9. $get_book = substr($get_book, 1);
  10. }
  11. echo "book:$get_book<br />";
  12. //open database
  13. PDO_Connect(_FILE_DB_PALITEXT_);
  14. $query = "SELECT paragraph,html FROM "._TABLE_PALI_TEXT_." WHERE book = ? order by paragraph asc";
  15. $Fetch = PDO_FetchAll($query, array($get_book));
  16. $iFetch = count($Fetch);
  17. if ($iFetch > 0) {
  18. for ($i = 0; $i < $iFetch; $i++) {
  19. $parNumber = $Fetch[$i]["paragraph"];
  20. echo "<div id=\"wizard_pali_par_$parNumber\" class=\"wizard_par_div\">";
  21. echo "<div class=\"wizard_par_tools\">";
  22. echo "<div class=\"wizard_par_tools_title\">";
  23. echo "<input id='par_enable_$parNumber' onclick='par_enable_change($parNumber,this)' type=\"checkbox\" checked/>";
  24. echo "<a href='../reader/?view=chapter&book={$get_book}&para={$parNumber}' name='pali_text_par_$parNumber' target='_blank'>$parNumber</a><span id='par_level_$parNumber' class='par_level'></span>";
  25. echo "</div>";
  26. echo "</div>";
  27. echo "<div id=\"wizard_pali_par_text_$parNumber\">" . $Fetch[$i]["html"] . "</div>";
  28. echo "</div>";
  29. }
  30. }
  31. /*结束*/