/** * 更新自己资料 * @param int $user_id */ public function update_info() { if (!$this->input->is_post()) { $companyUser = $this->_user->toArray(); return $this->displayHtml($companyUser); } if (empty($_POST)) { $this->_redirect('listuser'); } $postData = $this->input->post(NULL, TRUE); $errMsg = ''; //去掉html标签 foreach ($postData as $k => &$v) { $v = trim(strip_tags($v)); } $errMsg = ''; if (empty($postData['name'])) { $errMsg .= $this->wrapErrorMsg("姓名必须填写"); } if (empty($postData['mobile'])) { $errMsg .= $this->wrapErrorMsg("手机号码必须填写"); } if (empty($postData['email'])) { $errMsg .= $this->wrapErrorMsg("邮箱必须填写"); } if (empty($postData['company_name'])) { $errMsg .= $this->wrapErrorMsg("企业名称必须填写"); } if (!empty($errMsg)) { $companyUser = $this->_user->toArray(); $errMsg = "填写不完整:<br />{$errMsg}"; return $this->displayHtml(array_merge($companyUser, array('errMsg' => $errMsg))); } $loginMsg = CmpAdminManage::getInstance()->updateSelfInfo($postData); if ($loginMsg === TRUE) { CmpAdminManage::getInstance()->reloadUserInfo(); $this->_redirect('update_info_success'); } else { $companyUser = $this->_user->toArray(); return $this->displayHtml(array_merge($companyUser, array('errMsg' => "修改失败,{$loginMsg}"))); } }
/** * 企业管理员登录 */ private function cmpAdminLogin() { $cmpManage = CmpAdminManage::getInstance(); $postData = $this->input->post(NULL, true); $loginMsg = $cmpManage->login($postData); if ($loginMsg === true) { //保存用户名到cookies中 if ($this->input->post('keepme') == '1') { $cookie_username = $this->encrypt->encode($postData['username']); $this->input->set_cookie(self::COOKIE_USER_NAME_TAG, $cookie_username, 86400 * 365); } redirect('/company', 'location'); } else { $this->displayLoginHtml(array('errMsg' => "登录失败,{$loginMsg}")); } }
public function do_edit_company_reservation() { $postData = $this->input->post(NULL, TRUE); $meet_id = $postData['meet_id']; if (empty($postData) || empty($meet_id)) { $this->_redirect('company_meeting'); } $errMsg = ''; if (empty($postData['meet_id'])) { $errMsg .= '参数错误 '; } if (empty($postData['title'])) { $errMsg .= '会议主题必须填写 '; } if (empty($postData['start_time'])) { $errMsg .= "会议开始时间必须填写"; } if (!empty($errMsg)) { $postData['errMsg'] = $errMsg; $this->displayHtml($postData, 'edit_company_reservation'); } else { $rs = MeetingManage::getInstance()->changeMeeting($postData); if (is_numeric($rs) || $rs > 0) { $_SESSION['company_meeting_success'] = $rs; $this->_redirect('company_reservation_success'); } else { $meeting = MeetingManage::getInstance()->getMeetingInfo($meet_id); $meeting['all_user_list'] = CmpAdminManage::getInstance()->listAllUser('name,username,id', 0); $meeting['errMsg'] = $rs; $this->displayHtml($meeting, 'edit_company_reservation'); } } }