فهرست منبع

新建课程 没有存储简介

visuddhinanda 5 سال پیش
والد
کامیت
4c9510f826
2فایلهای تغییر یافته به همراه57 افزوده شده و 1 حذف شده
  1. 1 1
      app/course/my_lesson_new.php
  2. 56 0
      app/uwbw/wbw_analyse.php

+ 1 - 1
app/course/my_lesson_new.php

@@ -50,7 +50,7 @@ echo '</div>';
 
     <div style="display:flex;">
     <div style="flex:2;">简介</div>
-    <div style="flex:8;"><textarea style="height:6em;"></textarea></div>
+    <div style="flex:8;"><textarea name="summary" style="height:6em;"></textarea></div>
     </div>
 
     <div style="display:flex;">

+ 56 - 0
app/uwbw/wbw_analyse.php

@@ -0,0 +1,56 @@
+<?php
+    require_once "../path.php";
+    require_once "../public/_pdo.php";
+    require_once '../public/load_lang.php';
+    require_once '../public/function.php';
+
+    global $PDO;
+    PDO_Connect("sqlite:"._FILE_DB_USER_WBW_);
+
+
+    $query = "SELECT * from wbw where  1";
+						
+    $sth = $PDO->prepare($query);
+    $sth->execute();
+    // owner, word,book,para,wid,type,text
+    $i=0;
+    while($result = $sth->fetch(PDO::FETCH_ASSOC))
+    {
+        try {
+            $xmlString =  "<root>".$result["data"]."</root>";
+            echo  $xmlString."<br>";
+            $xmlWord = simplexml_load_string($xmlString);
+            $wordsList = $xmlWord->xpath('//word');
+            foreach ($wordsList as $word) {
+                $pali = $word->real->__toString();
+                foreach ($word as $key => $value) {
+                    $strValue = $value->__toString();
+                    if($strValue !== "?" && $strValue !== "" && $strValue !== ".ctl."){
+                        switch ($key) {
+                            case 'type':
+                            case 'gramma':
+                            case 'mean':
+                            case 'org':
+                            case 'om':
+                                var_dump( array($result["owner"],$pali,$result["book"],$result["paragraph"],$result["wid"],$key,$strValue));
+                                break;    
+                            
+                        }
+                    }
+                }
+            }
+
+        } catch ( Throwable $e) {
+            echo "Captured Throwable: " . $e->getMessage();
+        }
+
+        
+        if($i>100){
+        break;
+        }
+        else{
+            $i++;
+        }
+    }
+
+?>