function update() { $idu = isset($_SESSION['idu']) ? $_SESSION['idu'] : 0; $this->stat->saveStat($idu, "profile/update"); $nick = $_POST['nick']; $sex = $_POST['my_sex']; $bday = $_POST['bday']; $bmonth = $_POST['bmonth']; $byear = $_POST['byear']; $idcity = $_POST['idcity']; $desc = $_POST['description']; $birthday = date($byear . '-' . $bmonth . '-' . $bday); $model = new Model_Profile(); $profiles = $model->getProfile($idu); if (count($profiles) > 0) { $profile = $profiles[0]; $profile['nickname'] = $nick; $profile['sex'] = $sex; $profile['birthday'] = $birthday; $profile['idcity'] = $idcity; $profile['description'] = $desc; $model->updateProfile($profile); } header('Location:' . WEB_APP . '/profile/'); }