|
|
@ -17,6 +17,7 @@ class index extends publicBase { |
|
|
|
$this->setViewFormat('html'); |
|
|
|
$this->setViewTpl('index/home.html'); |
|
|
|
} |
|
|
|
|
|
|
|
public function ajax_save_case() { |
|
|
|
$name = $this->post('name'); |
|
|
|
$source = $this->post('source'); |
|
|
@ -25,9 +26,9 @@ class index extends publicBase { |
|
|
|
$herbs = $this->post('herbs'); |
|
|
|
|
|
|
|
//新增药方 |
|
|
|
$mCase = new mCase(); |
|
|
|
$id = $mCase->createCase($name, $source, $original, $method, $herbs); |
|
|
|
if (!$id) $this->ajax_json(false, $mCase->getError()); |
|
|
|
$m_case = new mCase(); |
|
|
|
$id = $m_case->createCase($name, $source, $original, $method, $herbs); |
|
|
|
if (!$id) $this->ajax_json(false, $m_case->getError()); |
|
|
|
|
|
|
|
$this->ajax_json(true, '添加成功'); |
|
|
|
} |
|
|
@ -40,9 +41,9 @@ class index extends publicBase { |
|
|
|
$method = $this->post('method'); |
|
|
|
$herbs = $this->post('herbs'); |
|
|
|
|
|
|
|
$mCase = new mCase(); |
|
|
|
$res = $mCase->updateCase($id, $name, $source, $original, $method, $herbs); |
|
|
|
if (!$res) $this->ajax_json(false, $mCase->getError()); |
|
|
|
$m_case = new mCase(); |
|
|
|
$res = $m_case->updateCase($id, $name, $source, $original, $method, $herbs); |
|
|
|
if (!$res) $this->ajax_json(false, $m_case->getError()); |
|
|
|
|
|
|
|
$this->ajax_json(true, '保存成功'); |
|
|
|
} |
|
|
|