home *** CD-ROM | disk | FTP | other *** search
/ ftp.ee.pdx.edu / 2014.02.ftp.ee.pdx.edu.tar / ftp.ee.pdx.edu / oss / cvs-2004 / bahasa / web / reference.php,v < prev    next >
Text File  |  2003-10-26  |  9KB  |  530 lines

  1. head    1.10;
  2. access;
  3. symbols
  4.     Initial:1.1.1.1 bule:1.1.1;
  5. locks; strict;
  6. comment    @# @;
  7.  
  8.  
  9. 1.10
  10. date    2003.10.26.01.53.10;    author bule;    state Exp;
  11. branches;
  12. next    1.9;
  13.  
  14. 1.9
  15. date    2003.10.20.00.21.46;    author bule;    state Exp;
  16. branches;
  17. next    1.8;
  18.  
  19. 1.8
  20. date    2003.10.18.00.33.42;    author bule;    state Exp;
  21. branches;
  22. next    1.7;
  23.  
  24. 1.7
  25. date    2003.10.17.00.39.36;    author bule;    state Exp;
  26. branches;
  27. next    1.6;
  28.  
  29. 1.6
  30. date    2003.10.06.00.39.27;    author bule;    state Exp;
  31. branches;
  32. next    1.5;
  33.  
  34. 1.5
  35. date    2003.09.11.05.28.22;    author bule;    state Exp;
  36. branches;
  37. next    1.4;
  38.  
  39. 1.4
  40. date    2003.09.05.06.42.30;    author bule;    state Exp;
  41. branches;
  42. next    1.3;
  43.  
  44. 1.3
  45. date    2003.09.04.07.27.00;    author bule;    state Exp;
  46. branches;
  47. next    1.2;
  48.  
  49. 1.2
  50. date    2003.08.19.19.24.21;    author bule;    state Exp;
  51. branches;
  52. next    1.1;
  53.  
  54. 1.1
  55. date    2003.08.12.19.18.23;    author bule;    state Exp;
  56. branches
  57.     1.1.1.1;
  58. next    ;
  59.  
  60. 1.1.1.1
  61. date    2003.08.12.19.18.23;    author bule;    state Exp;
  62. branches;
  63. next    ;
  64.  
  65.  
  66. desc
  67. @@
  68.  
  69.  
  70. 1.10
  71. log
  72. @*** empty log message ***
  73. @
  74. text
  75. @<?
  76. session_start();
  77. require_once("../php/Indonesia.php");
  78. require_once("../php/Web.php");
  79. //////////////////////////////////////////////////////////////////////////////
  80. //////////////////////////////////////////////////////////////////////////////
  81. // Project Name: Bahasa Indonesia Dictionary
  82. // Directory:    bahasa/web
  83. // File Name:    reference.php
  84. // Author(s):    John L. Whiteman
  85. // Created:      June 23, 2003  
  86. // Modified:     October 20, 2003
  87. // Description:  The purpose of this unrestricted access PHP web 
  88. //               client page is to provide a reference for the 
  89. //               the Indonesian language. 
  90. // 
  91. // Copyright (c) 2003 John L. Whiteman
  92. //
  93. // Permission is herby granted, free of charge, to any person obtaining a 
  94. // copy of this software, data, and associated documentation files 
  95. // (the "Software"), to deal in the Software without restriction, 
  96. // including without limitation the rights to use, copy, modify, merge, 
  97. // publish, distribute, sublicense, and/or sell copies of Software, and to
  98. // permit persons to whom the Software is furnished to do so, subject to 
  99. // the following conditions:
  100. //
  101. // The above copyright notice and this permission notice shall be 
  102. // included in all copies or substantial portions of the Software.
  103. //
  104. // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 
  105. // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 
  106. // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
  107. // IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR 
  108. // ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHERE IN AN ACTION OF CONTRACT,
  109. // TORT OR OTHERWISE, ARISING IN THE SOFTWARE.  
  110. //////////////////////////////////////////////////////////////////////////////
  111. //////////////////////////////////////////////////////////////////////////////
  112. $web = new Web();
  113.  
  114. $indonesia = new Indonesia();
  115.  
  116. $status = $indonesia->get_dictionary_status();
  117.  
  118. if (
  119. ($status["status"] == 1) ||
  120. ($status["status"] == 2) ||
  121. ($status["status"] == 3)) {
  122.  
  123.     $web->redirect("offline.php");
  124.  
  125.     exit;
  126. }
  127. ?>
  128. <html>
  129. <head>
  130. <title>Bahasa Indonesia Dictionary: Reference</title>
  131.  
  132. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  133.  
  134. <link href="bahasa.css" rel="stylesheet" type="text/css">
  135.  
  136. </head>
  137. <body>
  138. <?
  139. $web->show_logo("Reference");
  140. ?>
  141.  
  142. <a class="menu" href="search.php">Search Dictionary</a>
  143.  | 
  144. <a class="menu" href="email.php">Send Us E-mail</a>
  145.  | 
  146. <a class="menu" href="request.php">Request a New Word</a>
  147.  | 
  148. <a class="menu" href="admin.php">Administration</a>
  149. <br><br>
  150. <?
  151. show_alphabet($web, $indonesia);
  152.  
  153. show_pronunciation($web, $indonesia);
  154.  
  155. show_parts_of_speech($web, $indonesia);
  156.  
  157. $web->show_footer();
  158. ?>
  159. </body>
  160. </html>
  161.  
  162. <?
  163. //////////////////////////////////////////////////////////////////////////////
  164. function show_alphabet($web, $indonesia) {
  165.  
  166.     $alphabet = array();
  167.  
  168.     $errstr = $indonesia->get_alphabet($alphabet);
  169.  
  170.     if ($errstr != "") {
  171.  
  172.         print "<br><hr><b>${errstr}</b><hr><br>\n";
  173.  
  174.         return;
  175.     } 
  176.  
  177.     if (count($alphabet) == 0) {
  178.  
  179.         return;
  180.     }
  181.  
  182.     $new_form = "<td>Old (Before 1972):</b></td>";
  183.  
  184.     $old_form = "<td>New:</td>";
  185.  
  186.     foreach($alphabet as $letter) {
  187.  
  188.         $new_letter = $web->tohtml($letter->new);
  189.  
  190.         $old_letter = $web->tohtml($letter->old);
  191.  
  192.         if ($old_letter != $new_letter) {
  193.  
  194.             $new_form .= "<td><b>${new_letter}</b></td>\n";
  195.  
  196.             $old_form .= "<td><b>${old_letter}</b></td>\n";
  197.  
  198.         } else {
  199.  
  200.             $new_form .= "<td>${new_letter}</td>\n";
  201.  
  202.             $old_form .= "<td>${old_letter}</td>\n";
  203.         }
  204.     }
  205.  
  206.     print <<<EOFSA
  207. <h3><u>The Indonesian Alphabet</u></h3>
  208. <table cellspacing="4" cellpadding="4" border="0">
  209. <tr>
  210. $new_form
  211. </tr><tr>
  212. $old_form
  213. </tr>
  214. </table>
  215. EOFSA;
  216.     return;
  217. }
  218. //////////////////////////////////////////////////////////////////////////////
  219. function show_parts_of_speech($web, $indonesia) {
  220.  
  221.     $parts_of_speech = array();
  222.  
  223.     $errstr = $indonesia->get_parts_of_speech($parts_of_speech); 
  224.  
  225.     if ($errstr != "") {
  226.  
  227.         print "<br><hr><b>${errstr}</b><hr><br>\n";
  228.  
  229.         return;
  230.     }
  231.  
  232.     if (count($parts_of_speech) == 0) {
  233.  
  234.         return;
  235.     }
  236.  
  237.     $pos_html =
  238.     "<table cellpadding=\"3\" cellspacing=\"3\" border=\"0\">\n" .
  239.     "<tr>\n" .
  240.     "<th>Part of Speech</th>\n" .
  241.     "<th>Description</th>\n" .
  242.     "</tr>\n";
  243.  
  244.     $total_pos = count($parts_of_speech);
  245.  
  246.     for($i = 0; $i < $total_pos; $i++) {
  247.  
  248.         $part_of_speech = 
  249.         $web->tohtml($parts_of_speech[$i]["part_of_speech"]);
  250.  
  251.         $description = 
  252.         $web->tohtml($parts_of_speech[$i]["description"]);
  253.  
  254.         $pos_html .= 
  255.         "<tr>\n" .
  256.         "<td>${part_of_speech}:</td>\n" .
  257.         "<td>${description}</td>\n" .
  258.         "</tr>\n";
  259.     }
  260.  
  261.     $pos_html .= "</table>\n";
  262.  
  263.     print <<<EOFSPOS
  264. <br>
  265. <hr>
  266. <h3><u>Parts of Speech</u></h3>
  267. $pos_html
  268. EOFSPOS;
  269.     return;
  270. }
  271. //////////////////////////////////////////////////////////////////////////////
  272. function show_pronunciation($web, $indonesia) {
  273.  
  274.     $pronunciations = array();
  275.  
  276.     $errstr = $indonesia->get_pronunciations($pronunciations); 
  277.  
  278.     if ($errstr != "") {
  279.  
  280.         print "<br><hr><b>${errstr}</b><hr><br>\n";
  281.  
  282.         return;
  283.     }
  284.  
  285.     if (count($pronunciations) == 0) {
  286.  
  287.         return;
  288.     }
  289.  
  290.     $pronunciation_html =
  291.     "<table cellpadding=\"3\" cellspacing=\"3\" border=\"0\">\n" .
  292.     "<tr>\n" .
  293.     "<th>Symbol</th>\n" .
  294.     "<th>Category</th>\n" .
  295.     "<th>Pronunciation</th>\n" .
  296.     "<th>IPA Pronunciation</th>\n" .
  297.     "<th>Description</th>\n" .
  298.     "</tr>\n";
  299.  
  300.     $total_pronunciations = count($pronunciations);
  301.  
  302.     for($i = 0; $i < $total_pronunciations; $i++) { 
  303.  
  304.         $symbol = $web->tohtml($pronunciations[$i]["symbol"]);
  305.  
  306.         $category = $web->tohtml($pronunciations[$i]["category"]);
  307.  
  308.         $pronunciation = 
  309.         $web->tohtml($pronunciations[$i]["pronunciation"]);
  310.  
  311.         $ipa = $web->tohtml($pronunciations[$i]["ipa"]);
  312.  
  313.         $description = $web->tohtml($pronunciations[$i]["description"]);
  314.  
  315.         $pronunciation_html .= 
  316.         "<tr>\n" .
  317.         "<td>${symbol} </td>\n" .
  318.         "<td>${category} </td>\n" .
  319.         "<td>${pronunciation} </td>\n" .
  320.         "<td>&#${ipa};</td>\n" .
  321.         "<td>${description} </td>\n" .
  322.         "</tr>\n";
  323.     }
  324.  
  325.     $pronunciation_html .= "</table>\n";
  326.  
  327.     print <<<EOFSP
  328. <br>
  329. <hr>
  330. <h3><u>Pronunciation</u></h3>
  331. $pronunciation_html
  332. EOFSP;
  333.  
  334.  
  335.     return;
  336. }
  337. //////////////////////////////////////////////////////////////////////////////
  338. //////////////////////////////////////////////////////////////////////////////
  339. ?>
  340. @
  341.  
  342.  
  343. 1.9
  344. log
  345. @*** empty log message ***
  346. @
  347. text
  348. @d12 1
  349. a12 1
  350. // Modified:     October 19, 2003
  351. d68 1
  352. a68 1
  353. <a href="search.php">Search Dictionary</a>
  354. d70 1
  355. a70 1
  356. <a href="email.php">Send Us E-mail</a>
  357. d72 1
  358. a72 1
  359. <a href="request.php">Request a New Word</a>
  360. d74 1
  361. a74 1
  362. <a href="admin.php">Administration</a>
  363. @
  364.  
  365.  
  366. 1.8
  367. log
  368. @*** empty log message ***
  369. @
  370. text
  371. @d12 1
  372. a12 1
  373. // Modified:     October 17, 2003
  374. d57 1
  375. d59 3
  376. @
  377.  
  378.  
  379. 1.7
  380. log
  381. @*** empty log message ***
  382. @
  383. text
  384. @d12 1
  385. a12 1
  386. // Modified:     October 15, 2003
  387. d56 1
  388. a56 3
  389. <title>
  390. Bahasa Indonesia Dictionary: Reference 
  391. </title>
  392. @
  393.  
  394.  
  395. 1.6
  396. log
  397. @*** empty log message ***
  398. @
  399. text
  400. @d12 1
  401. a12 1
  402. // Modified:     October 05, 2003
  403. d80 2
  404. @
  405.  
  406.  
  407. 1.5
  408. log
  409. @*** empty log message ***
  410. @
  411. text
  412. @d12 1
  413. a12 1
  414. // Modified:     September 05, 2003
  415. d62 3
  416. a64 2
  417.  
  418. <h2>Bahasa Indonesia Dictionary: Reference</h2>
  419. d104 1
  420. a104 1
  421.     $new_form = "<td>New:</b></td>";
  422. d106 1
  423. a106 1
  424.     $old_form = "<td>Old:<br>(Before 1972)</td>";
  425. @
  426.  
  427.  
  428. 1.4
  429. log
  430. @*** empty log message ***
  431. @
  432. text
  433. @d12 1
  434. a12 1
  435. // Modified:     September 04, 2003
  436. d66 7
  437. d218 1
  438. a218 1
  439.     "<th>Comments</th>\n" .
  440. d234 1
  441. a234 1
  442.         $comments = $web->tohtml($pronunciations[$i]["comments"]);
  443. d242 1
  444. a242 1
  445.         "<td>${comments} </td>\n" .
  446. @
  447.  
  448.  
  449. 1.3
  450. log
  451. @*** empty log message ***
  452. @
  453. text
  454. @d12 1
  455. a12 1
  456. // Modified:     September 03, 2003
  457. d188 1
  458. a188 1
  459.     $pronunciation = array();
  460. d190 1
  461. a190 1
  462.     $errstr = $indonesia->get_pronunciation($pronunciation); 
  463. d199 1
  464. a199 1
  465.     if (count($pronunciation) == 0) {
  466. d214 1
  467. a214 1
  468.     foreach($pronunciation as $p) {
  469. d216 1
  470. a216 1
  471.         $symbol = $web->tohtml($p->symbol);
  472. d218 1
  473. a218 1
  474.         $category = $web->tohtml($p->category);
  475. d220 1
  476. a220 1
  477.         $non_ipa = $web->tohtml($p->non_ipa);
  478. d222 2
  479. a223 1
  480.         $ipa = $web->tohtml($p->ipa);
  481. d225 3
  482. a227 1
  483.         $comments = $web->tohtml($p->comments);
  484. d233 1
  485. a233 1
  486.         "<td>${non-ipa} </td>\n" .
  487. @
  488.  
  489.  
  490. 1.2
  491. log
  492. @*** empty log message ***
  493. @
  494. text
  495. @d12 1
  496. a12 1
  497. // Modified:     August 19, 2003
  498. d65 1
  499. a65 1
  500. <a href="search.php">Search</a>
  501. d158 1
  502. a158 1
  503.     foreach($parts_of_speech as $pos) {
  504. d160 1
  505. a160 1
  506.         $part_of_speech = $web->tohtml($pos->part_of_speech);
  507. d162 5
  508. a166 1
  509.         $description = $web->tohtml($pos->description);
  510. @
  511.  
  512.  
  513. 1.1
  514. log
  515. @Initial revision
  516. @
  517. text
  518. @d5 33
  519. a37 1
  520.  
  521. @
  522.  
  523.  
  524. 1.1.1.1
  525. log
  526. @Bahasa Indonesia Dictionary
  527. @
  528. text
  529. @@
  530.