コード例 #1
0
 public function asyncajaxAction()
 {
     $this->getResponse()->setHeader('Content-Type', 'application/json');
     $this->_helper->viewRenderer->setNoRender(true);
     $this->_helper->layout()->disableLayout();
     $params = $this->_getAllParams();
     $article = new Application_Model_O_Article();
     $validate = new Yy_Validate_Value();
     if ($validate->isValid($params['id'])) {
         $article->setId($params['id']);
     } else {
         $article->setCtime(date('Y-m-d H:i:s'));
     }
     if ($validate->isValid($params['title'])) {
         $article->setTitle($params['title']);
     }
     if ($validate->isValid($params['content'])) {
         $article->setContent($params['content']);
     }
     if ($validate->isValid($params['sort'])) {
         $article->setSort($params['sort']);
     }
     if ($validate->isValid($params['type'])) {
         $article->setType($params['type']);
     }
     if ($validate->isValid($params['status'])) {
         $article->setStatus($params['status']);
     }
     try {
         $article->save();
         $id = $article->getId();
         //保存广告图片
         $adapter = new Zend_File_Transfer_Adapter_Http();
         $wrdir = Yy_Utils::getWriteDir();
         $adapter->setDestination($wrdir);
         if (!$adapter->receive()) {
             $messages = $adapter->getMessages();
             //echo implode("\n", $messages);
         }
         $filename = $adapter->getFileName();
         if (is_string($filename)) {
             $handle = fopen($filename, 'rb');
             $img = addslashes(fread($handle, filesize($filename)));
             fclose($handle);
             Application_Model_M_Article::updateImage($id, $img);
         }
         $url = '/article/view?id=' . $id;
         $this->redirect($url);
     } catch (Zend_Db_Exception $e) {
         //$this->redirect('/error');
         $this->redirect('/error?message=' . $e->getMessage());
     }
 }
コード例 #2
0
 public function asyncajaxAction()
 {
     $this->getResponse()->setHeader('Content-Type', 'application/json');
     $this->_helper->viewRenderer->setNoRender(true);
     $this->_helper->layout()->disableLayout();
     $params = $this->_getAllParams();
     //echo "<pre>";var_dump($params);exit;
     $package = new Application_Model_O_PackageMgt();
     $validate = new Yy_Validate_Value();
     if ($validate->isValid($params['id'])) {
         $package->setId($params['id']);
     } else {
         $package->setCtime(date('Y-m-d H:i:s'));
     }
     if ($validate->isValid($params['name'])) {
         $package->setName($params['name']);
     }
     if ($validate->isValid($params['description'])) {
         $package->setDescription($params['description']);
     }
     if ($validate->isValid($params['version'])) {
         $package->setVersion($params['version']);
     }
     if ($validate->isValid($params['platform'])) {
         $package->setPlatform($params['platform']);
     }
     if ($validate->isValid($params['url'])) {
         $package->setUrl($params['url']);
     }
     if ($validate->isValid($params['status'])) {
         $package->setStatus($params['status']);
     }
     try {
         $package->save();
         $id = $package->getId();
         $url = '/package/view?id=' . $id;
         $this->redirect($url);
     } catch (Zend_Db_Exception $e) {
         $this->redirect('/error?message=' . $e->getMessage());
     }
 }
コード例 #3
0
 public function asyncajaxAction()
 {
     $this->getResponse()->setHeader('Content-Type', 'application/json');
     $this->_helper->viewRenderer->setNoRender(true);
     $this->_helper->layout()->disableLayout();
     $params = $this->_getAllParams();
     //echo "<pre>";var_dump($params);exit;
     $card = new Application_Model_O_MemberCard();
     $validate = new Yy_Validate_Value();
     if ($validate->isValid($params['id'])) {
         $card->setId($params['id']);
     } else {
         $card->setCtime(date('Y-m-d H:i:s'));
     }
     if ($validate->isValid($params['name'])) {
         $card->setName($params['name']);
     }
     if ($validate->isValid($params['oprice'])) {
         $card->setOprice($params['oprice']);
     }
     if ($validate->isValid($params['dprice'])) {
         $card->setDprice($params['dprice']);
     }
     if ($validate->isValid($params['points'])) {
         $card->setPoints($params['points']);
     }
     if ($validate->isValid($params['status'])) {
         $card->setStatus($params['status']);
     }
     try {
         $card->save();
         $id = $card->getId();
         $url = '/card/view?id=' . $id;
         $this->redirect($url);
     } catch (Zend_Db_Exception $e) {
         //$this->redirect('/error');
         $this->redirect('/error?message=' . $e->getMessage());
     }
 }
コード例 #4
0
 public function asyncajaxAction()
 {
     $this->getResponse()->setHeader('Content-Type', 'application/json');
     $this->_helper->viewRenderer->setNoRender(true);
     $this->_helper->layout()->disableLayout();
     $params = $this->_getAllParams();
     $hospital = new Application_Model_O_Hospital();
     $validate = new Yy_Validate_Value();
     if ($validate->isValid($params['id'])) {
         $hospital->setId($params['id']);
     } else {
         $hospital->setCtime(date('Y-m-d H:i:s'));
     }
     if ($validate->isValid($params['name'])) {
         $hospital->setName($params['name']);
     }
     if ($validate->isValid($params['email'])) {
         $hospital->setEmail($params['email']);
     }
     if ($validate->isValid($params['departments'])) {
         $hospital->setDepartments($params['departments']);
     }
     if ($validate->isValid($params['passwd'])) {
         $hospital->setPasswd(md5($params['passwd']));
     }
     if ($validate->isValid($params['type'])) {
         $hospital->setType($params['type']);
     }
     if ($validate->isValid($params['certified'])) {
         $hospital->setCertified($params['certified']);
     }
     if ($validate->isValid($params['city'])) {
         $hospital->setCity($params['city']);
     }
     if ($validate->isValid($params['label'])) {
         $hospital->setLabel($params['label']);
     }
     if ($validate->isValid($params['country'])) {
         $hospital->setCountry($params['country']);
     }
     if ($validate->isValid($params['point'])) {
         $hospital->setPoint($params['point']);
     }
     if ($validate->isValid($params['area'])) {
         $hospital->setArea($params['area']);
     }
     if ($validate->isValid($params['introduction'])) {
         $hospital->setIntroduction($params['introduction']);
     }
     if ($validate->isValid($params['longitude'])) {
         $hospital->setLongitude($params['longitude']);
     }
     if ($validate->isValid($params['latitude'])) {
         $hospital->setLatitude($params['latitude']);
     }
     if ($validate->isValid($params['status'])) {
         $hospital->setStatus($params['status']);
     }
     try {
         $hospital->save();
         $id = $hospital->getId();
         //保存医院头像
         $adapter = new Zend_File_Transfer_Adapter_Http();
         $wrdir = Yy_Utils::getWriteDir();
         $adapter->setDestination($wrdir);
         if (!$adapter->receive()) {
             $messages = $adapter->getMessages();
             //echo implode("\n", $messages);
         }
         $filename = $adapter->getFileName();
         if (is_string($filename)) {
             $handle = fopen($filename, 'rb');
             $avatar = addslashes(fread($handle, filesize($filename)));
             fclose($handle);
             Application_Model_M_Hospital::updateAvatar($id, $avatar);
         }
         $url = '/hospital/view?id=' . $id . '&from=update';
         $this->redirect($url);
     } catch (Zend_Db_Exception $e) {
         //$this->redirect('/error');
         $this->redirect('/error?message=' . $e->getMessage());
     }
 }
コード例 #5
0
 public function updateajaxAction()
 {
     $this->getResponse()->setHeader('Content-Type', 'application/json');
     $this->_helper->viewRenderer->setNoRender(true);
     $this->_helper->layout()->disableLayout();
     $params = $this->_getAllParams();
     //     	unset($params['controller']);
     //     	unset($params['action']);
     //     	unset($params['module']);
     //$id = $params['id'];
     $doctor = new Application_Model_O_Doctor();
     $validate = new Yy_Validate_Value();
     if ($validate->isValid($params['id'])) {
         $doctor->setId($params['id']);
     } else {
         $doctor->setCtime(date('Y-m-d H:i:s'));
     }
     if ($validate->isValid($params['name'])) {
         $doctor->setName($params['name']);
     }
     if ($validate->isValid($params['sex'])) {
         $doctor->setSex($params['sex']);
     }
     if ($validate->isValid($params['birthday'])) {
         $doctor->setBirthday($params['birthday']);
     }
     if ($validate->isValid($params['email'])) {
         $doctor->setEmail($params['email']);
     }
     if ($validate->isValid($params['passwd'])) {
         $doctor->setPasswd(md5($params['passwd']));
     }
     if ($validate->isValid($params['department'])) {
         $doctor->setDepartment($params['department']);
     }
     if ($validate->isValid($params['point'])) {
         $doctor->setPoint($params['point']);
     }
     if ($validate->isValid($params['city'])) {
         $doctor->setCity($params['city']);
     }
     if ($validate->isValid($params['certified'])) {
         $doctor->setCertified($params['certified']);
     }
     if ($validate->isValid($params['special'])) {
         $doctor->setSpecial($params['special']);
     }
     if ($validate->isValid($params['country'])) {
         $doctor->setCountry($params['country']);
     }
     if ($validate->isValid($params['introduction'])) {
         $doctor->setIntroduction($params['introduction']);
     }
     if ($validate->isValid($params['hospital'])) {
         $doctor->setHospital($params['hospital']);
     }
     if ($validate->isValid($params['area'])) {
         $doctor->setArea($params['area']);
     }
     if ($validate->isValid($params['qualification'])) {
         $doctor->setQualification($params['qualification']);
     }
     if ($validate->isValid($params['reservation_fee'])) {
         $doctor->setReservation_fee($params['reservation_fee']);
     }
     if ($validate->isValid($params['reservation_number'])) {
         $doctor->setReservation_number($params['reservation_number']);
     }
     if ($validate->isValid($params['status'])) {
         $doctor->setStatus($params['status']);
     }
     try {
         $doctor->save();
         $id = $doctor->getId();
         //保存医生头像
         $adapter = new Zend_File_Transfer_Adapter_Http();
         $wrdir = Yy_Utils::getWriteDir();
         $adapter->setDestination($wrdir);
         if (!$adapter->receive()) {
             $messages = $adapter->getMessages();
             //echo implode("\n", $messages);
         }
         $filename = $adapter->getFileName();
         if (is_string($filename)) {
             $handle = fopen($filename, 'rb');
             $avatar = addslashes(fread($handle, filesize($filename)));
             fclose($handle);
             Application_Model_M_Doctor::updateAvatar($id, $avatar);
         }
         $url = '/doctor/view?id=' . $id;
         $this->redirect($url);
     } catch (Zend_Db_Exception $e) {
         //$this->redirect('/error');
         $this->redirect('/error?message=' . $e->getMessage());
     }
 }
コード例 #6
0
 public function updateajaxAction()
 {
     $this->getResponse()->setHeader('Content-Type', 'application/json');
     $this->_helper->viewRenderer->setNoRender(true);
     $this->_helper->layout()->disableLayout();
     $params = $this->_getAllParams();
     //$id = $params['id'];
     //$nuser = Application_Model_M_Nuser::find($id);
     $nuser = new Application_Model_O_Nuser();
     $validate = new Yy_Validate_Value();
     if ($validate->isValid($params['id'])) {
         $nuser->setId($params['id']);
     } else {
         $nuser->setCtime(date('Y-m-d H:i:s'));
     }
     if ($validate->isValid($params['mobile'])) {
         $nuser->setMobile($params['mobile']);
     }
     if ($validate->isValid($params['email'])) {
         $nuser->setEmail($params['email']);
     }
     if ($validate->isValid($params['phone'])) {
         $nuser->setPhone($params['phone']);
     }
     if ($validate->isValid($params['passwd'])) {
         $nuser->setPasswd(md5($params['passwd']));
     }
     if ($validate->isValid($params['name'])) {
         $nuser->setName($params['name']);
     }
     if ($validate->isValid($params['sex'])) {
         $nuser->setSex($params['sex']);
     }
     if ($validate->isValid($params['job'])) {
         $nuser->setJob($params['job']);
     }
     if ($validate->isValid($params['postcode'])) {
         $nuser->setPostcode($params['postcode']);
     }
     if ($validate->isValid($params['idcard'])) {
         $nuser->setIdcard($params['idcard']);
     }
     if ($validate->isValid($params['point'])) {
         $nuser->setPoint($params['point']);
     }
     if ($validate->isValid($params['country'])) {
         $nuser->setCountry($params['country']);
     }
     if ($validate->isValid($params['address'])) {
         $nuser->setAddress($params['address']);
     }
     if ($validate->isValid($params['birthday'])) {
         $nuser->setBirthday($params['birthday']);
     }
     if ($validate->isValid($params['status'])) {
         $nuser->setStatus($params['status']);
     }
     try {
         $nuser->save();
         $id = $nuser->getId();
         //保存用户头像
         $adapter = new Zend_File_Transfer_Adapter_Http();
         $wrdir = Yy_Utils::getWriteDir();
         $adapter->setDestination($wrdir);
         if (!$adapter->receive()) {
             $messages = $adapter->getMessages();
             //echo implode("\n", $messages);
         }
         $filename = $adapter->getFileName();
         if (is_string($filename)) {
             $handle = fopen($filename, 'rb');
             $avatar = addslashes(fread($handle, filesize($filename)));
             fclose($handle);
             Application_Model_M_Nuser::updateAvatar($id, $avatar);
         }
         $url = '/nuser/view?id=' . $id . '&from=update';
         $this->redirect($url);
     } catch (Zend_Db_Exception $e) {
         //echo $e->getMessage();exit;
         $this->redirect('/error?message=' . $e->getMessage());
         //$this->redirect('/error');
     }
 }
コード例 #7
0
 public function addiasyncajaxAction()
 {
     $this->getResponse()->setHeader('Content-Type', 'application/json');
     $this->_helper->viewRenderer->setNoRender(true);
     $this->_helper->layout()->disableLayout();
     $params = $this->_getAllParams();
     $hmsg = $this->_getParam('hmsg');
     //    	echo "<pre>";var_dump($params);exit;
     //     	unset($params['controller']);
     //     	unset($params['action']);
     //     	unset($params['module']);
     $addi = new Application_Model_O_DestinationAdditional();
     $validate = new Yy_Validate_Value();
     if ($validate->isValid($params['id'])) {
         $addi->setId($params['id']);
     } else {
         $addi->setCtime(date('Y-m-d H:i:s'));
     }
     if ($validate->isValid($params['did'])) {
         $addi->setDestination_id($params['did']);
     }
     if ($validate->isValid($params['title'])) {
         $addi->setTitle($params['title']);
     }
     if ($validate->isValid($params['content'])) {
         $addi->setContent($params['content']);
     }
     if ($validate->isValid($params['sort'])) {
         $addi->setSort($params['sort']);
     }
     if ($validate->isValid($params['type'])) {
         $addi->setType($params['type']);
     }
     if ($validate->isValid($params['status'])) {
         $addi->setStatus($params['status']);
     }
     try {
         $addi->save();
         $id = $addi->getId();
         //保存行程附件信息图片
         $adapter = new Zend_File_Transfer_Adapter_Http();
         $wrdir = Yy_Utils::getWriteDir();
         $adapter->setDestination($wrdir);
         if (!$adapter->receive()) {
             $messages = $adapter->getMessages();
             //echo implode("\n", $messages);
         }
         $filename = $adapter->getFileName();
         if (is_string($filename)) {
             $handle = fopen($filename, 'rb');
             $img = addslashes(fread($handle, filesize($filename)));
             fclose($handle);
             Application_Model_M_DestinationAdditional::updateImage($id, $img);
         }
         $url = '/destination/addiview?id=' . $id . '&from=add&did=' . $params['did'] . '&hmsg=' . $hmsg;
         $this->redirect($url);
     } catch (Zend_Db_Exception $e) {
         $this->redirect('/error?message=' . $e->getMessage());
     }
 }
コード例 #8
0
 public function departcateasyncajaxAction()
 {
     $this->getResponse()->setHeader('Content-Type', 'application/json');
     $this->_helper->viewRenderer->setNoRender(true);
     $this->_helper->layout()->disableLayout();
     $params = $this->_getAllParams();
     //echo "<pre>";var_dump($params);exit;
     $cate = new Application_Model_O_ConsultationDepartmentsCategory();
     $validate = new Yy_Validate_Value();
     if ($validate->isValid($params['id'])) {
         $cate->setId($params['id']);
     } else {
         $cate->setCtime(date('Y-m-d H:i:s'));
     }
     if ($validate->isValid($params['name'])) {
         $cate->setName($params['name']);
     }
     if ($validate->isValid($params['sort'])) {
         $cate->setSort($params['sort']);
     }
     if ($validate->isValid($params['status'])) {
         $cate->setStatus($params['status']);
     }
     try {
         $cate->save();
         $id = $cate->getId();
         $url = '/diagnosis/departcateview?id=' . $id;
         if ($validate->isValid($params['from'])) {
             $url = $url . '&from=' . $params['from'];
         }
         if ($validate->isValid($params['did'])) {
             $url = $url . '&did=' . $params['did'];
         }
         $this->redirect($url);
     } catch (Zend_Db_Exception $e) {
         echo $e->getMessage();
         $this->redirect('/error?message=' . $e->getMessage());
     }
 }