Example #1
0
 public function listAction()
 {
     if (Request::isAjax() && Request::isPost()) {
         $user = UsersPDO::get(AuthModel::getUserName());
         $receiverId = $_POST['receiverId'];
         $model = new ChatModel($user['Id']);
         $result = $model->getChat($receiverId);
         $this->renderJSON($result);
     }
 }
Example #2
0
 public function infoAction()
 {
     $model = new UserModel(AuthModel::getUserName());
     if (Request::isPost()) {
         $firstName = $_POST['firstName'];
         $lastName = $_POST['lastName'];
         $birthDate = $_POST['birthDate'];
         try {
             $model->setPersonalInfo($firstName, $lastName, $birthDate);
         } catch (SiteException $ex) {
             $this->errors = $ex->getErrors();
         }
     }
     $this->personalInfo = $model->getPersonalInfo();
     $this->view('personal_info');
 }