public function getStdClass()
 {
     // init
     $result = new \stdClass();
     // action
     $result->id = $this->id;
     $result->person = $this->person->getStdClass();
     //        $result->name = html_entity_decode($this->name, ENT_COMPAT | ENT_HTML401, 'UTF-8');;
     //        $result->address = html_entity_decode($this->address, ENT_COMPAT | ENT_HTML401, 'UTF-8');
     $result->name = $this->name;
     $result->address = $this->address;
     $result->latitude = $this->latitude;
     $result->longitude = $this->longitude;
     $result->level = $this->level->getStdClass();
     $result->interpretationType = $this->interpretationType->getStdClass();
     $result->language = $this->language;
     $result->textCombined = $this->textCombined->getStdClass();
     $result->textHouseX = $this->textHouseX->getStdClass();
     $result->textHouseY = $this->textHouseY->getStdClass();
     $result->zodiacX = $this->zodiacX->getStdClass();
     $result->zodiacY = $this->zodiacY->getStdClass();
     $factorListStdClass = array();
     /** @var Factor $factor */
     foreach ($this->factors as $factor) {
         array_push($factorListStdClass, $factor->getStdClass());
     }
     $result->factors = $factorListStdClass;
     //        $result->code = html_entity_decode($this->code, ENT_COMPAT | ENT_HTML401, 'UTF-8');;
     $result->code = $this->code;
     $result->isPaid = $this->isPaid;
     $result->dateCreated = $this->dateCreated;
     // return
     return $result;
 }
Beispiel #2
0
    public function getContent()
    {
        global $sql;
        // $kio->disableRegion('left');
        if (u1 || LOGGED) {
            // TODO: Zamiast zapytania dla własnego konta dać User::toArray()
            $profile = $sql->query('
				SELECT u.*
				FROM ' . DB_PREFIX . 'users u
				WHERE u.id = ' . (ctype_digit(u1) ? u1 : UID))->fetch();
        }
        if ($profile) {
            Kio::addTitle(t('Users'));
            Kio::addBreadcrumb(t('Users'), 'users');
            Kio::addTitle($profile['nickname']);
            Kio::addBreadcrumb($profile['nickname'], 'profile/' . u1 . '/' . clean_url($profile['nickname']));
            Kio::setDescription(t('%nickname's profile', array('%nickname' => $profile['nickname'])) . ($profile['title'] ? ' - ' . $profile['title'] : ''));
            Kio::addTabs(array(t('Edit profile') => 'edit_profile/' . u1));
            if ($profile['birthdate']) {
                $profile['bd'] = $profile['birthdate'] ? explode('-', $profile['birthdate']) : '';
                // DD Month YYYY (Remaining days to next birthday)
                $profile['birthdate'] = $profile['bd'][2] . ' ' . Kio::$months[$profile['bd'][1]] . ' ' . $profile['bd'][0] . ' (' . day_diff(mktime(0, 0, 0, $profile['bd'][1], $profile['bd'][2] + 1, date('y')), t('%d days remaining')) . ')';
                $profile['age'] = get_age($profile['bd'][2], $profile['bd'][1], $profile['bd'][0]);
                if (Plugin::exists('zodiac')) {
                    require_once ROOT . 'plugins/zodiac/zodiac.plugin.php';
                    $profile['zodiac'] = Zodiac::get($profile['bd'][2], $profile['bd'][1]);
                }
            }
            if ($profile['http_agent'] && Plugin::exists('user_agent')) {
                require_once ROOT . 'plugins/user_agent/user_agent.plugin.php';
                $profile['os'] = User_Agent::getOS($profile['http_agent']);
                $profile['browser'] = User_Agent::getBrowser($profile['http_agent']);
            }
            $group = Kio::getGroup($profile['group_id']);
            $profile['group'] = $group['name'] ? $group['inline'] ? sprintf($group['inline'], $group['name']) : $group['name'] : '';
            if ($profile['gender']) {
                $profile['gender'] = $profile['gender'] == 1 ? t('Male') : t('Female');
            }
            try {
                // TODO: Zrobić modyfikator dla funkcji o wielu parametrach (teraz jest tylko jeden możliwy)
                $tpl = new PHPTAL('modules/profile/profile.tpl.html');
                $tpl->profile = $profile;
                return $tpl->execute();
            } catch (Exception $e) {
                return template_error($e);
            }
        } else {
            return not_found(t('Selected user doesn't exists.'), array(t('This person was deleted from database.'), t('Entered URL is invalid.')));
        }
    }
Beispiel #3
0
 /**
  * Устанавливает состояния полей из массива
  * 
  * @param array $resArray
  */
 private function setData($resArray)
 {
     $this->name = $resArray["name"];
     $this->secondName = $resArray["second_name"];
     $this->burthday = $resArray["burthday"];
     $this->mail = $resArray["mail"];
     $this->photo = $resArray["photo"];
     $this->ip = $resArray["ip"];
     $this->id = $resArray["id"];
     $this->isOnline = $this->isOnline();
     $this->location = new UserLocation(array("countryId" => $resArray["country"], "regionId" => $resArray["region"], "cityId" => $resArray["city"]), $this);
     $arrLoc = $this->location->getLocation();
     $this->zodiac = Zodiac::calculateByDate($this->burthday);
     $this->utc = $resArray["utc_time"];
     $status = new UserStatus($this->id);
     $this->status = $status->getStatus();
     if ($this->other) {
         $this->lastUpdate = $resArray["update_time"];
     }
 }
Beispiel #4
0
 function edit_zodiac()
 {
     $zodiac_obj = new Zodiac();
     $db_functions_obj = new DbFunctions();
     $helper_obj = new Helper();
     global $user;
     $rid = $user['rid'];
     //only super admin can delete hidt
     if ($helper_obj->user_is_logged_in() && $helper_obj->check_role(SUPER_ADMIN_ROLE_ID)) {
         $db_functions_obj->edit_zodiac($_POST['zodiac_id'], $_POST['body']);
         $zodiac_info = $db_functions_obj->get_zodiac_by_id($_POST['zodiac_id']);
         echo $zodiac_obj->build_zodiac_row($_POST['zodiac_id']) . "***#***" . $_POST['zodiac_id'];
     } else {
         $this->set_access_denied(1);
     }
     exit;
 }