Exemplo n.º 1
0
 public function add($complaint, $lang, $parent = null)
 {
     $model = new complaintModel();
     $model->parent_id = $parent;
     $model->save();
     $dict = new dictModel();
     $dict->table_name = $this->_table;
     $dict->table_id = $model->id;
     $dict->lang = $lang;
     $dict->body = $complaint;
     return $dict->save();
 }
Exemplo n.º 2
0
 public function add($desc, $lang, $book, $remedium)
 {
     $model = new descModel();
     $model->remedium_id = $remedium;
     $model->book_id = $book;
     $model->save();
     $dict = new dictModel();
     $dict->table_name = $this->_table;
     $dict->table_id = $model->id;
     $dict->lang = $lang;
     $dict->body = $desc;
     return $dict->save();
 }
Exemplo n.º 3
0
 public function add($modality, $betterORworse, $lang, $book, $remedium = null, $complaint = null)
 {
     $model = new modalityModel();
     $model->remedium_id = $remedium;
     $model->complaint_id = $complaint;
     $model->book_id = $book;
     $model->modality = $betterORworse;
     $model->save();
     $dict = new dictModel();
     $dict->table_name = $this->_table;
     $dict->table_id = $model->id;
     $dict->lang = $lang;
     $dict->body = $modality;
     return $dict->save();
 }
Exemplo n.º 4
0
 private function welcome()
 {
     $article = new articleModel();
     $articleNum = $article->getArticleNum();
     $user = new userModel();
     $dict = new dictModel();
     $feedback = new feedbackModel();
     $entryNum = $dict->getAllEntryTotal2();
     //echo ($articleNum);
     $userNum = $user->getAllUserTotal();
     $examination = new examinationModel();
     $examNum = $examination->getExamNum();
     $this->smarty->assign("aaa", $dict->getAllEntryTotal2());
     $this->smarty->assign("rrr", $dict->getAllReportWordsTotal2());
     //Tools::dump($feedback->getAllNewFeedbackTotal());
     $this->smarty->assign("fff", $feedback->getAllNewFeedbackTotal());
     $this->smarty->assign("examNum", $examNum);
     $this->smarty->assign("userNum", $userNum);
     $this->smarty->assign("articleNum", $articleNum);
     $this->smarty->display("admin/welcome.html");
     exit;
 }
 }
 $html = url_get($url2);
 $html = iconv('iso8859-2', 'utf-8', $html);
 $html = str_replace(['ć', 'Ć', 'œ'], ['e', 'AE', 'e'], $html);
 $b = [];
 if (preg_match_all('~<p align="justify">(.+?)</p>~si', $html, $b)) {
     foreach ($b[1] as $h) {
         $h = unhtml($h);
         $h = explode('.--', $h);
         if (count($h) == 1) {
             $desc = new descModel();
             $d = $desc->find('en', $book->id, $remedium->id);
             if (!$d) {
                 $desc->add($h[0], 'en', $book->id, $remedium->id);
             } else {
                 $dict = new dictModel($d);
                 $dict->body = $h[0];
                 $dict->save();
             }
         }
         if (count($h) == 2) {
             $complaint = new complaintModel();
             $complaint_name = strtolower($h[0]);
             if (strlen($complaint_name) > 25) {
                 mydie($complaint_name);
             }
             switch ($complaint_name) {
                 case 'relationship':
                     break;
                 case 'dose':
                     break;