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(); } }
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; }
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(); } }