/**
  * 提交信息
  */
 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);
 }
Пример #2
0
 /**
  * 提交信息
  */
 public function actionModified()
 {
     $data = WaveCommon::getFilter($_POST);
     $id = (int) $data['mid'];
     unset($data['mid']);
     $GhMenu = new GhMenu();
     if ($id == 0) {
         $GhMenu->insert($data);
     } else {
         $GhMenu->update($data, array('mid' => $id));
     }
     $this->jumpBox('成功!', Wave::app()->homeUrl . 'wxmenu', 1);
 }
 /**
  * 添加、修改分类结果
  */
 public function actionModified()
 {
     $Category = new Category();
     $data = WaveCommon::getFilter($_POST);
     $cid = (int) $data['cid'];
     unset($data['cid']);
     if ($cid == 0) {
         $Category->insert($data);
     } else {
         $Category->update($data, array('cid' => $cid));
     }
     $this->jumpBox('成功!', Wave::app()->homeUrl . 'categories', 1);
 }
 /**
  * 提交信息
  */
 public function actionModified()
 {
     $Substance = new Substance();
     $data = WaveCommon::getFilter($_POST);
     $sid = (int) $data['sid'];
     unset($data['sid']);
     if ($sid == 0) {
         $Substance->insert($data);
     } else {
         $Substance->update($data, array('sid' => $sid));
     }
     $this->jumpBox('成功!', Wave::app()->homeUrl . 'substance', 1);
 }
Пример #5
0
 /**
  * 设置密码
  */
 public function actionSetpwd()
 {
     $Users = new Users();
     $data = WaveCommon::getFilter($_POST);
     if (empty($data['pwd']) || empty($data['newpwd']) || empty($data['confirmpwd'])) {
         $this->jumpBox('参数错误!', Wave::app()->homeUrl . 'member', 1);
     }
     if ($data['newpwd'] != $data['confirmpwd']) {
         $this->jumpBox('两次密码不一样!', Wave::app()->homeUrl . 'member', 1);
     }
     $updateData = array('password' => md5($data['newpwd']));
     $Users->update($updateData, array('userid' => $this->userinfo['userid']));
     $this->jumpBox('修改成功!', Wave::app()->homeUrl . 'member', 1);
 }
Пример #6
0
 /**
  * 提交信息
  */
 public function actionModified()
 {
     $data = WaveCommon::getFilter($_POST);
     $id = (int) $data['gid'];
     unset($data['gid']);
     $md5 = md5($data['gh_id']);
     $data['gh_key'] = substr($md5, 16);
     $data['gh_token'] = substr($md5, 8, 8);
     $data['gh_enaeskey'] = $md5 . substr($md5, 21);
     $GhManage = new GhManage();
     if ($id == 0) {
         $data['userid'] = $this->userinfo['userid'];
         $GhManage->insert('gh_manage', $data);
     } else {
         $GhManage->update($data, array('gid' => $id));
     }
     $this->jumpBox('成功!', Wave::app()->homeUrl . 'wx', 1);
 }
Пример #7
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, '注册失败!');
     }
 }
 /**
  * 登录
  */
 public function actionLoging()
 {
     $data = WaveCommon::getFilter($_POST);
     $Users = new Users();
     $array = $Users->getOne('*', array('email' => $data['user_login']));
     $Log = new Log();
     if (!empty($array)) {
         if ($array['password'] == md5($data['user_pass'])) {
             Wave::app()->session->setState('userinfo', $array);
             $Log->saveLogs('用户登录', 1, $data);
             $this->jumpBox('登录成功!', Wave::app()->homeUrl, 1);
         } else {
             $Log->saveLogs('用户登录', 0, $data);
             $this->jumpBox('用户名或密码错误!', Wave::app()->homeUrl, 1);
         }
     } else {
         $Log->saveLogs('用户登录', 0, $data);
         $this->jumpBox('没有该用户!', Wave::app()->homeUrl, 1);
     }
 }
Пример #9
0
 /**
  * 默认函数
  */
 public function actionIndex()
 {
     $data = WaveCommon::getFilter($_GET);
     $GhManage = new GhManage();
     $WxModel = new WxModel();
     $array = $GhManage->getOne('*', array('gh_key' => $data['key']));
     if ($array) {
         $this->token = $array['gh_token'];
         $this->enaeskey = $array['gh_enaeskey'];
         $this->appid = $array['gh_appid'];
         $this->appsecret = $array['gh_appsecret'];
     }
     $echoStr = isset($_GET["echostr"]) ? $_GET["echostr"] : 'no echoStr';
     $WxModel->recordLog($echoStr);
     if ($this->checkSignature()) {
         $WxModel->recordLog($echoStr);
         echo $echoStr;
         die;
     }
     die;
     $this->responseMsg();
 }
Пример #10
0
 /**
  * 默认函数
  */
 public function actionIndex($cid)
 {
     $this->data = WaveCommon::getFilter($_GET);
     $this->cid = (int) $cid;
     $where = array();
     $this->category = array();
     $Category = new Category();
     if ($cid != 0) {
         $where['a.cid'] = $cid;
         $this->category = $Category->from('category a')->getOne('*', $where);
     }
     $page = isset($_GET['page']) ? (int) $_GET['page'] : 1;
     $pagesize = 15;
     $start = ($page - 1) * $pagesize;
     $Articles = new Articles();
     $this->list = $Articles->select('a.aid,a.title,a.add_date,c.c_name')->from('articles a')->join('category c', 'a.cid=c.cid')->where($where)->limit($start, $pagesize)->order('a.aid', 'desc')->getAll();
     $count = $Articles->from('articles a')->getCount('*', $where);
     $url = 'http://' . Wave::app()->request->hostInfo . $_SERVER['REQUEST_URI'];
     if (empty($data['page'])) {
         $url .= '?page=1';
     }
     $Common = new Common();
     $this->pagebar = $Common->getPageBar($url, $count, $pagesize, $page);
 }
Пример #11
0
 /**
  * 提交信息
  */
 public function actionModified()
 {
     $data = WaveCommon::getFilter($_POST);
     $userid = (int) $data['userid'];
     unset($data['userid']);
     $Users = new Users();
     if ($userid == 0) {
         unset($data['oldemail']);
         $count = $Users->getCount('*', array('email' => $data['email']));
         if ($count > 0) {
             $this->jumpBox('邮箱不能重复!', Wave::app()->homeUrl . 'users', 1);
         }
         $data['password'] = md5($data['password']);
         $data['add_date'] = date('Y-m-d H:i:s');
         $userid = $Users->insert($data);
         $data['userid'] = $userid;
         $this->Log->saveLogs('添加用户', 1, $data);
     } else {
         if ($data['oldemail'] != $data['email']) {
             $count = $Users->getCount('*', array('email' => $data['email']));
             if ($count > 0) {
                 $this->jumpBox('邮箱不能重复!', Wave::app()->homeUrl . 'users', 1);
             }
         }
         unset($data['oldemail']);
         if (!empty($data['password'])) {
             $data['password'] = md5($data['password']);
         } else {
             unset($data['password']);
         }
         $Users->update($data, array('userid' => $userid));
         $data['userid'] = $userid;
         $this->Log->saveLogs('更新用户', 1, $data);
     }
     $this->jumpBox('成功!', Wave::app()->homeUrl . 'users', 1);
 }