PATH:
var
/
www
/
clients
/
client1
/
web1
/
web
/
wp-content
/
plugins
/
vxcash
/
public
<?php class Vxcash_Bas_Host implements JsonSerializable { /** * @var int */ private $id; /** * @var int */ private $durchwahl; /** * @var array */ private $countries = []; /** * @var string */ private $name; /** * @var array */ private $pictures; /** * @var string */ private $state; /** * @var int */ private $age; /** * @var array */ private $preferences; /** * @var int */ private $height; /** * @var string */ private $zip; /** * @var string */ private $breasts; /** * @var string */ private $geschlecht; /** * @var string */ private $sexuality; /** * @var string */ private $weight; /** * @var string */ private $job; /** * @var string */ private $relationship; /** * Vxcash_Bas_Host constructor. * * @param array $data * @param string $state */ public function __construct( $data, $state ) { $sex = [ 'straight' => 'Heterosexuell', 'bixsexual' => 'Bisexuell', 'gay' => 'Homosexuell' ]; $figure = [ 'standard' => 'normal', 'chubby' => 'mollig', 'slim' => 'schlank', 'athletic' => 'atlethisch' ]; $relationShips = [ 'single' => 'Single', 'inRelationship' => 'In einer Beziehung', 'inOpenRelationship' => 'In offener Beziehung', 'married' => 'Verheiratet', 'seeking' => 'Suchend' ]; $this->id = (int) $data['userId']; $this->durchwahl = isset( $data['ddi'] ) ? $data['ddi'] : ''; $this->name = $data['screenName']; $this->age = (int) $data['age']; $this->height = (int) $data['bodySize']; $this->zip = substr($data['zipCode'], 0, 2) . 'XXX'; $this->breasts = $data['breastSize']; $this->geschlecht = $data['gender'] === 'female' ? 'Weiblich' : 'Männlich'; $this->sexuality = isset($sex[$data['sexuality']]) ? $sex[$data['sexuality']] : 'Heterosexuell'; $this->pictures = is_array($data['sedcardPictures']) ? $data['sedcardPictures'] : json_decode($data['sedcardPictures'], true); $this->preferences = is_array($data['sexualPreferences']) ? $data['sexualPreferences'] : json_decode($data['sexualPreferences'], true); $this->weight = isset($figure[$data['figure']]) ? $figure[$data['figure']] : 'normal'; $this->relationship = isset($relationShips[$data['relationshipStatus']]) ? $relationShips[$data['relationshipStatus']] : 'Single'; $this->job = $data['occupation']; switch ($state) { case 'free': $this->state = 'online'; break; case 'offline': case '0900offline': $this->state = 'offline'; break; default: $this->state = $state; } } /** * @return string */ public function getName() { return $this->name; } /** * @return array */ public function getPictures() { return $this->pictures; } /** * @param VXBas_Country $country */ public function addCountry( VXBas_Country $country ) { $this->countries[ $country->getCountry() ] = $country; } /** * @param string $country * * @return string */ public function getInfoFor( $country ) { if ( ! isset( $this->countries[ $country ] ) ) { return ''; } /** @var VXBas_Country $theCountry */ $theCountry = $this->countries[ $country ]; return $theCountry->getPriceInfo(); } /** * Get the number for a country. * Will return an empty string if not valid (i.e. mobile number in AT) * * @param string $country de|at|ch * @param boolean $mobile * * @return string */ public function getNumberFor( $country, $mobile = false ) { if ( ! isset( $this->countries[ $country ] ) ) { return ''; } /** @var VXBas_Country $selectedCountry */ $selectedCountry = $this->countries[ $country ]; if ( $mobile && $selectedCountry->hasMobile() === false ) { return ''; } switch ( $country ) { case 'de': if ( $mobile ) { return '<strong>' . $selectedCountry->getMobileNumber() . '</strong><br>' . $selectedCountry->getMobileExtension() . $this->durchwahl; } return $selectedCountry->getNumber() . ' <span class="ddi">' . $this->durchwahl . '</span>'; case 'ch': return '<strong>' . $selectedCountry->getNumber() . '</strong><br><span class="ddi">' . $selectedCountry->getNumberExtension() . $this->durchwahl . '</span>'; case 'at': return $selectedCountry->getNumber() . ' <span class="ddi">' . $this->durchwahl . '</span>'; } return ''; } /** * @return int */ public function getId() { return $this->id; } /** * @return string */ public function getState() { return $this->state; } /** * @param string $state */ public function setState( $state ) { $this->state = $state; } /** * @return string */ public function toInfo() { return json_encode( [ 'id' => $this->id, 'name' => $this->name, 'ddi' => $this->durchwahl, 'images' => $this->pictures, 'preferences' => $this->preferences, 'state' => $this->state, ] ); } /** * Specify data which should be serialized to JSON * * @link https://php.net/manual/en/jsonserializable.jsonserialize.php * @return mixed data which can be serialized by <b>json_encode</b>, * which is a value of any type other than a resource. * @since 5.4.0 */ public function jsonSerialize() { return [ 'id' => $this->id, 'name' => $this->name, 'age' => $this->age, 'ddi' => $this->durchwahl, 'images' => $this->pictures, 'state' => $this->state, 'height' => $this->height, 'zip' => $this->zip, 'breasts' => 'Körbchengröße ' . $this->breasts, 'sexuality' => $this->sexuality, 'gender' => $this->geschlecht, 'preferences' => $this->preferences, 'weight' => $this->weight, 'job' => $this->job, 'relationship' => $this->relationship ]; } }
[+]
img
[-] class-vxcash-bas-dataprovider.php
[edit]
[-] class-vxcash-bas-country.php
[edit]
[-] class-vxcash-public.php
[edit]
[-] index.php
[edit]
[+]
js
[+]
partials
[-] class-vxcash-bas-host.php
[edit]
[-] class-vxcash-bas.php
[edit]
[+]
..
[+]
css
[-] class-vxcash-crosselling.php
[edit]