|
|
@ -13,9 +13,6 @@ class index extends publicBase { |
|
|
|
$data = $m_case->getCaseInfo($id); |
|
|
|
|
|
|
|
$this->view['data'] = $data; |
|
|
|
|
|
|
|
$this->setViewFormat('html'); |
|
|
|
$this->setViewTpl('index/home.html'); |
|
|
|
} |
|
|
|
|
|
|
|
public function ajax_save_case() { |
|
|
@ -77,11 +74,11 @@ class index extends publicBase { |
|
|
|
$uid = $this->post('uid'); |
|
|
|
$token = $this->post('token'); |
|
|
|
$case_id = $this->post('case_id')+0; |
|
|
|
if(empty($uid) || empty($token) || empty($case_id))$this->ajax_json(false, '非法请求'); |
|
|
|
if(empty($uid) || empty($token) || empty($case_id)) $this->ajax_json(false, '非法请求'); |
|
|
|
|
|
|
|
$m_user = new mUser(); |
|
|
|
$is_login = $m_user->validateToken($uid,$token); |
|
|
|
if(!$is_login)$this->ajax_json(false, '请登录后操作'); |
|
|
|
if(!$is_login) $this->ajax_json(false, '请登录后操作'); |
|
|
|
|
|
|
|
$data = array( |
|
|
|
'name' => trim($this->post('name')), |
|
|
@ -97,7 +94,7 @@ class index extends publicBase { |
|
|
|
|
|
|
|
$m_user_case = new mUserCase(); |
|
|
|
$id = $m_user_case->createUserCase($uid, $case_id, $data); |
|
|
|
if(!$id)$this->ajax_json(false, $m_user_case->getError()); |
|
|
|
if(!$id) $this->ajax_json(false, $m_user_case->getError()); |
|
|
|
|
|
|
|
$this->ajax_json(true, '保存成功',array('id' => $id)); |
|
|
|
} |
|
|
@ -155,15 +152,15 @@ class index extends publicBase { |
|
|
|
$uid = $this->post('uid'); |
|
|
|
$token = $this->post('token'); |
|
|
|
$id = $this->post('id')+0; |
|
|
|
if(empty($uid) || empty($token) || empty($id))$this->ajax_json(false, '非法请求'); |
|
|
|
if(empty($uid) || empty($token) || empty($id)) $this->ajax_json(false, '非法请求'); |
|
|
|
|
|
|
|
$m_user = new mUser(); |
|
|
|
$is_login = $m_user->validateToken($uid,$token); |
|
|
|
if(!$is_login)$this->ajax_json(false, '请登录后操作'); |
|
|
|
if(!$is_login) $this->ajax_json(false, '请登录后操作'); |
|
|
|
|
|
|
|
$m_user_case = new mUserCase(); |
|
|
|
$data = $m_user_case->getUserCaseInfo($uid, $id); |
|
|
|
if(!$data)$this->ajax_json(false, $m_user_case->getError()); |
|
|
|
if(!$data) $this->ajax_json(false, $m_user_case->getError()); |
|
|
|
|
|
|
|
$this->ajax_json(true, '获取成功', $data); |
|
|
|
} |
|
|
@ -212,18 +209,18 @@ class index extends publicBase { |
|
|
|
public function export_user_case_list(){ |
|
|
|
$uid = $this->post('uid'); |
|
|
|
$token = $this->post('token'); |
|
|
|
if(empty($uid) || empty($token))$this->ajax_json(false, '非法请求'); |
|
|
|
if(empty($uid) || empty($token)) $this->ajax_json(false, '非法请求'); |
|
|
|
|
|
|
|
$m_user = new mUser(); |
|
|
|
$is_login = $m_user->validateToken($uid,$token); |
|
|
|
if(!$is_login)$this->ajax_json(false, '请登录后操作'); |
|
|
|
if(!$is_login) $this->ajax_json(false, '请登录后操作'); |
|
|
|
|
|
|
|
$page_num = $this->post('page_num') ? $this->post('page_num') : 1; |
|
|
|
$page_size = $this->post('page_size') ? $this->post('page_size') : 100; |
|
|
|
|
|
|
|
$m_user_case = new mUserCase(); |
|
|
|
$data = $m_user_case->getUserCaseList($uid, array(), $page_num, $page_size, true, true); |
|
|
|
if(!$data)$this->ajax_json(false, $m_user_case->getError()); |
|
|
|
if(!$data) $this->ajax_json(false, $m_user_case->getError()); |
|
|
|
$total = $m_user_case->getUserCaseListCount($uid); |
|
|
|
|
|
|
|
$data_key = sprintf(RQ_USER_CASE_DATA, $uid, 0); |
|
|
@ -239,15 +236,15 @@ class index extends publicBase { |
|
|
|
$uid = $this->post('uid'); |
|
|
|
$token = $this->post('token'); |
|
|
|
$id = $this->post('id')+0; |
|
|
|
if(empty($uid) || empty($token) || empty($id))$this->ajax_json(false, '非法请求'); |
|
|
|
if(empty($uid) || empty($token) || empty($id)) $this->ajax_json(false, '非法请求'); |
|
|
|
|
|
|
|
$m_user = new mUser(); |
|
|
|
$is_login = $m_user->validateToken($uid,$token); |
|
|
|
if(!$is_login)$this->ajax_json(false, '请登录后操作'); |
|
|
|
if(!$is_login) $this->ajax_json(false, '请登录后操作'); |
|
|
|
|
|
|
|
$m_user_case = new mUserCase(); |
|
|
|
$data = $m_user_case->getUserCaseInfo($uid, $id, true); |
|
|
|
if(!$data)$this->ajax_json(false, $m_user_case->getError()); |
|
|
|
if(!$data) $this->ajax_json(false, $m_user_case->getError()); |
|
|
|
|
|
|
|
$data_key = sprintf(RQ_USER_CASE_DATA, $uid, $id); |
|
|
|
|
|
|
@ -267,33 +264,31 @@ class index extends publicBase { |
|
|
|
$data = $robj->get($key); |
|
|
|
|
|
|
|
$this->view['data'] = json_decode($data,true); |
|
|
|
$this->setViewFormat('html'); |
|
|
|
$this->setViewTpl('index/user_case.html'); |
|
|
|
} |
|
|
|
|
|
|
|
public function ajax_mail(){ |
|
|
|
$uid = $this->post('uid'); |
|
|
|
$token = $this->post('token'); |
|
|
|
if(empty($uid) || empty($token))$this->ajax_json(false, '非法请求'); |
|
|
|
if(empty($uid) || empty($token)) $this->ajax_json(false, '非法请求'); |
|
|
|
|
|
|
|
$mUser = new mUser(); |
|
|
|
$is_login = $mUser->validateToken($uid,$token); |
|
|
|
if(!$is_login)$this->ajax_json(false, '请登录后操作'); |
|
|
|
if(!$is_login) $this->ajax_json(false, '请登录后操作'); |
|
|
|
|
|
|
|
$email = $this->post('email'); |
|
|
|
if(empty($email))$this->ajax_json(false, '邮箱地址不能为空'); |
|
|
|
if(!filter_var($email, FILTER_VALIDATE_EMAIL))$this->ajax_json(false, '邮箱地址无效'); |
|
|
|
if(empty($email)) $this->ajax_json(false, '邮箱地址不能为空'); |
|
|
|
if(!filter_var($email, FILTER_VALIDATE_EMAIL)) $this->ajax_json(false, '邮箱地址无效'); |
|
|
|
|
|
|
|
$pdf_url = $this->post('pdf_url'); |
|
|
|
if(empty($pdf_url))$this->ajax_json(false, 'pdf地址不能为空'); |
|
|
|
if(!filter_var($pdf_url, FILTER_VALIDATE_URL))$this->ajax_json(false, 'pdf地址无效'); |
|
|
|
if(empty($pdf_url)) $this->ajax_json(false, 'pdf地址不能为空'); |
|
|
|
if(!filter_var($pdf_url, FILTER_VALIDATE_URL)) $this->ajax_json(false, 'pdf地址无效'); |
|
|
|
|
|
|
|
$directory_name = basename(dirname($pdf_url)); |
|
|
|
if($directory_name != $uid)$this->ajax_json(false, '非法请求'); |
|
|
|
if($directory_name != $uid) $this->ajax_json(false, '非法请求'); |
|
|
|
|
|
|
|
$mUserCase = new mUserCase(); |
|
|
|
$res = $mUserCase->sendMail(array($email),date('Y年m月d日',time()).'-医案导出','',sprintf(USER_CASE_PDF_PATH, $uid) . basename($pdf_url)); |
|
|
|
if(!$res)$this->ajax_json(true, '发送失败'); |
|
|
|
if(!$res) $this->ajax_json(true, '发送失败'); |
|
|
|
|
|
|
|
$this->ajax_json(true, '发送成功'); |
|
|
|
} |
|
|
|