Ejemplo n.º 1
0
 /**
  * 提交信息
  */
 public function actionModified()
 {
     $data = WaveCommon::getFilter($_POST);
     $aid = (int) $data['aid'];
     $article = $data['aritcle'];
     $content = $data['a_content'];
     $Articles = new Articles();
     $ArticlesContent = new ArticlesContent();
     if ($aid == 0) {
         $article['add_date'] = WaveCommon::getDate();
         $content['aid'] = $Articles->insert($article);
         $ArticlesContent->insert($content);
         $article['aid'] = $content['aid'];
     } else {
         $where = array('aid' => $aid);
         $Articles->update($article, $where);
         $count = $ArticlesContent->getCount('*', $where);
         if ($count > 0) {
             $ArticlesContent->update($content, $where);
         } else {
             $content['aid'] = $aid;
             $ArticlesContent->insert($content);
         }
     }
     $this->jumpBox('成功!', Wave::app()->homeUrl . 'articles', 1);
 }
Ejemplo n.º 2
0
 public function actionRegisting()
 {
     $Users = new Users();
     $data = WaveCommon::getFilter($_POST);
     if (empty($data['email'])) {
         WaveCommon::exportResult(false, '请输入邮箱!');
     }
     if (empty($data['password'])) {
         WaveCommon::exportResult(false, '请输入密码!');
     }
     $data['add_date'] = WaveCommon::getDate();
     $data['password'] = md5($data['password']);
     if ($Users->insert($data)) {
         WaveCommon::exportResult(true, '注册成功!');
     } else {
         WaveCommon::exportResult(false, '注册失败!');
     }
 }