示例#1
0
 public function searchTranscriptionAction()
 {
     $model = new WordsModel();
     $model->validate('word', $_POST['word']);
     if (count($model->errors) > 0) {
         echo $model->helper['MainHelper']->getError('0x00001');
     } else {
         echo $model->searchTranscription();
     }
 }
示例#2
0
 public function makeSql($sql)
 {
     $wordsModel = new WordsModel();
     if ($this->category !== 'all' && $this->type === 'all') {
         $sql .= " WHERE a.category_id = '" . $wordsModel->getCategoryId($this->category) . "'";
     } else {
         if ($this->category === 'all' && $this->type !== 'all') {
             $sql .= " WHERE a.type_id = '" . $wordsModel->getTypeId($this->type) . "'";
         } else {
             if ($this->category !== 'all' && $this->type !== 'all') {
                 $sql .= " WHERE a.category_id = '" . $wordsModel->getCategoryId($this->category) . "'";
                 $sql .= " AND a.type_id = '" . $wordsModel->getTypeId($this->type) . "'";
             }
         }
     }
     $sql .= " ORDER BY a.word_id";
     return $sql;
 }
示例#3
0
 public function checkWordAction()
 {
     $model = new WordsModel();
     $model->validate('word', $_POST['word']);
     if (count($model->errors) > 0) {
         echo $model->helper['MainHelper']->getError('0x00001');
     } else {
         echo $model->checkWordExist();
     }
 }