query
stringlengths
9
43.3k
document
stringlengths
17
1.17M
metadata
dict
negatives
sequencelengths
0
30
negative_scores
sequencelengths
0
30
document_score
stringlengths
5
10
document_rank
stringclasses
2 values
Sets the oauth2PermissionGrants property value. The oauth2PermissionGrants property
public function setOauth2PermissionGrants(?array $value): void { $this->getBackingStore()->set('oauth2PermissionGrants', $value); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function setPermissionGrants(?array $value): void {\n $this->getBackingStore()->set('permissionGrants', $value);\n }", "public function setPermissionGrants(?array $value): void {\n $this->getBackingStore()->set('permissionGrants', $value);\n }", "public function getOauth2PermissionGrants(): ?array {\n $val = $this->getBackingStore()->get('oauth2PermissionGrants');\n if (is_array($val) || is_null($val)) {\n TypeUtils::validateCollectionValues($val, OAuth2PermissionGrant::class);\n /** @var array<OAuth2PermissionGrant>|null $val */\n return $val;\n }\n throw new \\UnexpectedValueException(\"Invalid type found in backing store for 'oauth2PermissionGrants'\");\n }", "public function limitClientsToGrants($limit = false)\r\n {\r\n $this->limitClientsToGrants = $limit;\r\n }", "public function getAuthorizationGrants()\n {\n return $this->authorizationGrants;\n }", "public function getGrants(): array\n {\n return $this->grants;\n }", "public function update_api_permission_settings() {\n \n (new MidrubBaseAdminCollectionSettingsHelpers\\Oauth)->update_api_permission_settings();\n \n }", "function setPermissions($permissionArray)\n {\n $this->Permissions =& $permissionArray;\n }", "public function areClientsLimitedToGrants()\r\n {\r\n return $this->limitClientsToGrants;\r\n }", "public function getPermissionGrants(): ?array {\n $val = $this->getBackingStore()->get('permissionGrants');\n if (is_array($val) || is_null($val)) {\n TypeUtils::validateCollectionValues($val, ResourceSpecificPermissionGrant::class);\n /** @var array<ResourceSpecificPermissionGrant>|null $val */\n return $val;\n }\n throw new \\UnexpectedValueException(\"Invalid type found in backing store for 'permissionGrants'\");\n }", "public function getPermissionGrants(): ?array {\n $val = $this->getBackingStore()->get('permissionGrants');\n if (is_array($val) || is_null($val)) {\n TypeUtils::validateCollectionValues($val, ResourceSpecificPermissionGrant::class);\n /** @var array<ResourceSpecificPermissionGrant>|null $val */\n return $val;\n }\n throw new \\UnexpectedValueException(\"Invalid type found in backing store for 'permissionGrants'\");\n }", "public function setPermissions( $permissions );", "function setSiteLevelAccess( ) \n {\n $sitePriv = RowManager_AccountAdminAccessManager::PRIVILEDGE_SITE;\n $this->setValueByFieldName( 'accountadminaccess_privilege', $sitePriv );\n }", "public function setPermissionsAttribute($value)\n {\n return $this->attributes['permissions'] = json_encode($value);\n }", "public function setOauth2($var)\n {\n GPBUtil::checkMessage($var, \\Eolymp\\Resolver\\Authorization_OAuth2::class);\n $this->writeOneof(20, $var);\n\n return $this;\n }", "public function setPermissionsAttribute($value)\n {\n $value = array_value_replace($value, ['true' => true, 'false' => false]);\n $permissions = array_multidimensional_diff($value, $this->getRoleAbilities());\n\n return $this->attributes['permissions'] = json_encode($permissions);\n }", "public function setOauth()\n {\n if(!empty($_POST))\n {\n $provider = $this->post->provider;\n $oauth = array($provider => helper::jsonEncode($_POST));\n $result = $this->loadModel('setting')->setItems('system.common.oauth', $oauth);\n if($result) $this->send(array('result' => 'success', 'message' => $this->lang->setSuccess));\n $this->send(array('result' => 'fail', 'message' => $this->lang->fail));\n }\n $this->view->setting = array();\n\n if(!empty($this->config->site->yangcong))\n {\n $this->view->setting = json_decode($this->config->site->yangcong);\n }\n\n $this->view->title = $this->lang->site->setOauth;\n $this->display();\n }", "public function setRights($value)\n {\n $this->setProperty(\"Rights\", $value, true);\n }", "public function setUsageRights(?array $value): void {\n $this->getBackingStore()->set('usageRights', $value);\n }", "public function permission($base){\n\t\t\t$setting = new SSetting();\n\t\t\t$groupList = $setting->groupList();\n\n\t\t\t$base->set('groupList',$groupList);\n\t\t\tTemplate::getInstance()->render('setting/permissionlist.htm');\n\t\t}", "private function set_settings_capability_user() {\n\t\t// Can subsites overwrite?.\n\t\t$can_overwrite = Permission::can_overwrite( 'settings' );\n\n\t\t// Get enabled and disabled users.\n\t\t$included_users = (array) shush_toolkit()->settings->get( 'settings_include_users', 'permissions', ! $can_overwrite, array() );\n\t\t$excluded_users = (array) shush_toolkit()->settings->get( 'settings_exclude_users', 'permissions', ! $can_overwrite, array() );\n\n\t\t// Loop through all allowed users.\n\t\tforeach ( $included_users as $user_id ) {\n\t\t\t$user = get_userdata( $user_id );\n\n\t\t\t// Grant settings capability to the user.\n\t\t\tif ( $user instanceof WP_User ) {\n\t\t\t\t$user->add_cap( self::SETTINGS_CAP, true );\n\t\t\t}\n\t\t}\n\n\t\t// Loop through all denied users.\n\t\tforeach ( $excluded_users as $user_id ) {\n\t\t\t$user = get_userdata( $user_id );\n\n\t\t\t// Deny settings capability to the user.\n\t\t\tif ( $user instanceof WP_User ) {\n\t\t\t\t$user->add_cap( self::SETTINGS_CAP, false );\n\t\t\t}\n\t\t}\n\t}", "function get_enforce_group_permissions()\n {\n clearos_profile(__METHOD__, __LINE__);\n\n try {\n $option = $this->_get_global_parameter('FlexshareSecurityPermissions');\n } catch (Flexshare_Parameter_Not_Found_Exception $e) {\n // Ignore\n } catch (Engine_Exception $e) {\n // Ignore\n }\n\n if (empty($option))\n $option = 'on';\n\n return $option;\n }", "public function setPermissionAttribute($value)\n {\n $this->attributes[\"permission\"] = ($value[0] != \"_\") ? \"_{$value}\" : $value;\n }", "public function setPermissions($permissions);", "public function setMemberOf ($memberOf)\n {\n if (is_array($memberOf))\n $this->memberOf = $memberOf;\n else\n $this->memberOf = array($memberOf);\n }", "public function setAccessToken($tokens = []);", "public function setAllowedOutboundDataTransferDestinations($val)\n {\n $this->_propDict[\"allowedOutboundDataTransferDestinations\"] = $val;\n return $this;\n }", "public function setPerm($var)\n {\n GPBUtil::checkBool($var);\n $this->perm = $var;\n\n return $this;\n }", "public function setGrantTypes($var)\n {\n $arr = GPBUtil::checkRepeatedField($var, \\Google\\Protobuf\\Internal\\GPBType::STRING);\n $this->grant_types = $arr;\n\n return $this;\n }", "function local_tcapi_set_role_permission_overrides() {\n\tglobal $CFG,$DB;\n\t$role = $DB->get_record('role', array('archetype'=>'user'), 'id', MUST_EXIST);\n\tif (isset($role->id)) {\n\t\trequire_once $CFG->dirroot.'/lib/accesslib.php';\n\t\trole_change_permission($role->id, context_system::instance(), 'moodle/webservice:createtoken', CAP_ALLOW);\n\t\trole_change_permission($role->id, context_system::instance(), 'webservice/rest:use', CAP_ALLOW);\n\t\trole_change_permission($role->id, context_system::instance(), 'local/tcapi:use', CAP_ALLOW);\n\t}\n}" ]
[ "0.65249157", "0.65249157", "0.5753618", "0.53544676", "0.52615523", "0.5166255", "0.51355666", "0.49036115", "0.4849687", "0.47591823", "0.47591823", "0.47482723", "0.47427467", "0.47398472", "0.47325522", "0.4676459", "0.46192735", "0.4615655", "0.4590851", "0.45906895", "0.45562238", "0.45277062", "0.4519586", "0.44909385", "0.44766325", "0.44743955", "0.44596595", "0.44485438", "0.44351268", "0.44337046" ]
0.76489264
0
Sets the officeLocation property value. The office location in the user's place of business. Maximum length is 128 characters. Supports $filter (eq, ne, not, ge, le, in, startsWith, and eq on null values).
public function setOfficeLocation(?string $value): void { $this->getBackingStore()->set('officeLocation', $value); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function setLocationFilter(?LoyaltyEventLocationFilter $locationFilter): void\n {\n $this->locationFilter = $locationFilter;\n }", "public function setOfficePhone($office_phone)\n {\n $this->office_phone = preg_replace('/\\D/', '', $office_phone);\n\n return $this;\n }", "public function setOfficeID($office=1)\n {\n if (is_numeric($office) && ($office>0))\n {\n $this->db_row['office_id']=$office;\n return true;\n }\n else\n {\n return false;\n }\n }", "public function setServiceLocation($val)\n {\n $this->_propDict[\"serviceLocation\"] = $val;\n return $this;\n }", "public function setLocation(LocationCollection $location)\n {\n $this->location = $location;\n\n return $this;\n }", "public function setLocation($newLocation)\n\t{\n\t\t//zeroth, allow the location to be null if a new object\n\t\tif($newLocation === null) {\n\t\t\t$this->location = null;\n\t\t\treturn;\n\t\t}\n\n\t\t//first, sanitize string from tags\n\t\tif(filter_var($newLocation, FILTER_SANITIZE_STRING) === false) {\n\t\t\tthrow(new UnexpectedValueException(\"location $newLocation doesn't appear to be string\"));\n\t\t}\n\n\t\t//Ensure that location doesn't exceed 256\n\t\tif(strlen($newLocation) > 256) {\n\t\t\tthrow(new RangeException(\"location $newLocation exceeds 256 character limit\"));\n\t\t}\n\n\t\t// assign variable\n\t\t$this->location = $newLocation;\n\n\t}", "public function getOfficeLocation(): ?string {\n $val = $this->getBackingStore()->get('officeLocation');\n if (is_null($val) || is_string($val)) {\n return $val;\n }\n throw new \\UnexpectedValueException(\"Invalid type found in backing store for 'officeLocation'\");\n }", "protected function set_user_geolocation()\n\t{\r\n\t\tif(Configure::read(\"environment\") == \"DEV\")\r\n\t\t{\r\n\t\t\t//My local ip\r\n\t\t\t$this->userIP = \"173.66.97.113\";\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\t$this->userIP = $this->RequestHandler->getClientIP();\r\n\t\t}\n\t\t$conditions= array('ip' => $this->userIP);\r\n\t\t$this->userGeolocation = $this->Geolocation->find('all', compact(\"conditions\"));\r\n\t\t$currentCity = $this->userGeolocation['Geolocation']['city'];\r\n\t\t$this->loadModel('Country');\r\n\t\t$this->Country->recursive=-1;\r\n\t\t$tld = $this->userGeolocation['Geolocation']['country_iso3166'];\r\n\t\t$locatedCountry = $this->Country->findByTld($tld);\r\n\t\t$country_iso3 = $locatedCountry['Country']['iso3'];\r\n\t\t$this->Session->write(\"country_iso\", $country_iso3);\n\t}", "public function setLocationAttribute($value)\n {\n $location_lat = round(object_get($value, 'latitude'), 7);\n $location_lng = round(object_get($value, 'longitude'), 7);\n $this->attributes['location_lat'] = $location_lat;\n $this->attributes['location_lng'] = $location_lng;\n }", "public function setJobLocation($value)\n {\n $this->jobLocation = $value;\n }", "public function action_put() {\n\t $allowed_fields = array(\n 'name', 'address', 'city', 'st', 'country_id', 'zip', 'contact', \n\t 'email', 'phone', 'web', 'hours', 'timezone', 'logo', 'landing_screen_img', \n\t 'social', 'use_instagram', 'user_instagram_id', 'default_social', \n );\n $properties = array_keys(Model_Location::properties());\n\t\n\t $location_id = $this->param('id', 0);\n\t $location = Model_Location::find($location_id);\n\t\n\t if (!$location) {\n\t $this->_error_response(Code::ERROR_INVALID_LOCATION_ID);\n\t return;\n\t }\n\n if (!in_array($location_id, array_keys($this->user_login->user->get_assigned_companies()))) {\n $this->_error_response(Code::ERROR_INVALID_LOCATION_ID);\n return;\n }\n \n if ($location->type == Model_Location::TYPE_MERCHANT && is_null($location->mall_id)) {\n // It's a stand alone merchant, so I'll allow them to update their coordinates\n $allowed_fields[] = 'latitude';\n $allowed_fields[] = 'longitude';\n }\n\n $category_ids = Input::put('category_ids', array());\n $category_ids_to_add = array_diff($category_ids, array_keys($location->categories));\n $category_ids_to_remove = array_diff(array_keys($location->categories), $category_ids);\n foreach ($category_ids_to_remove as $category_id) {\n unset($location->categories[$category_id]);\n }\n foreach ($category_ids_to_add as $category_id) {\n $location->categories[] = Model_Category::find($category_id);\n }\n \n // Only allowed properties can be set\n\t foreach($properties as $property) {\n\t if (! in_array($property, $allowed_fields)) { continue; }\n\t \n\t $value = Input::put($property, NULL);\n\t if (is_null($value)) { continue; }\n\t \n\t $location->$property = Input::put($property);\n\t }\n\t\n\t $location->edited_by = $this->user_login->user_id;\n\n\t $phone = Input::put('phone', '');\n\t $valid = preg_match('/^([\\+][0-9]{1,3}[ \\.\\-])?([\\(]{1}[0-9]{2,6}[\\)])?([0-9 \\.\\-\\/]{3,20})((x|ext|extension)[ ]?[0-9]{1,4})?$/', $phone);\n\t if (!empty($phone) && !$valid) {\n\t return $this->_error_response(Code::ERROR_WRONG_PHONE_FORMAT);\n\t }\n\t\n\t $website = Input::put('web', '');\n\t $valid = filter_var($website, FILTER_VALIDATE_URL);\n\t if (!empty($website) && !$valid) {\n // let's see if adding 'http://', the website is now valid\n $valid = filter_var('http://' . $website, FILTER_VALIDATE_URL);\n if ($valid) {\n $location->web = 'http://' . $website;\n } else {\n return $this->_error_response(Code::ERROR_INVALID_WEBSITE_URL);\n }\n\t }\n\n\t $phone = Input::put('email', '');\n\t $valid = filter_var($phone, FILTER_VALIDATE_EMAIL);\n\t if (!empty($phone) && !$valid) {\n\t return $this->_error_response(Code::ERROR_INVALID_LOCATION_EMAIL);\n\t }\n\n\t // FIXME: This should not happen until the second step is completed\n\t $location->setup_complete = TRUE;\n\t $location->manually_updated = TRUE;\n\t \n\t if ($location->save()) {\n\t $output = array('data' => array(), 'meta' => array('error' => null, 'status' => 1));\n\t } else {\n\t $output = array('data' => Input::put(), 'meta' => array('error' => 'Unable to save location', 'status' => 0));\n\t }\n\n\t $this->response($output);\n\t}", "public function setUseLocation($v)\n\t{\n\t\tif ($v !== null) {\n\t\t\t$v = (string) $v;\n\t\t}\n\n\t\tif ($this->use_location !== $v) {\n\t\t\t$this->use_location = $v;\n\t\t\t$this->modifiedColumns[] = UsersPeer::USE_LOCATION;\n\t\t}\n\n\t\treturn $this;\n\t}", "public function testReturnsLocationSearchingIpInRange()\n {\n $longIp = 12345678;\n\n $this->assertEquals(\n $this->expected('location')->getData()[0],\n $this->_collection->getLocationInIpRange($longIp)->getData()[0]\n );\n }", "public function set_location($value)\n {\n $this->set_default_property(self::PROPERTY_LOCATION, $value);\n }", "public function setPatentOffice($var)\n {\n GPBUtil::checkString($var, True);\n $this->patent_office = $var;\n\n return $this;\n }", "public function setLocation($location)\n {\n $this->_location = trim($location);\n return $this;\n }", "public function setLocation($location) {\r\n\t$this->location = $location;\r\n }", "public function setLocation($location=null) {\n\t\tif($location == null) return;\n\t\tif(!($location instanceOf Intra_Object_Gis_Point)) {\n\t\t\t$location = Intra_Object_Gis::fromWKB($location);\n\t\t}\n\t\t$this->_set('c_location', $location);\n\t}", "public function setLocation($var)\n {\n GPBUtil::checkString($var, True);\n $this->location = $var;\n\n return $this;\n }", "public function setLocation($var)\n {\n GPBUtil::checkString($var, True);\n $this->location = $var;\n\n return $this;\n }", "public function setLocation($var)\n {\n GPBUtil::checkString($var, True);\n $this->location = $var;\n\n return $this;\n }", "public function set_location($location)\n {\n $this->location = $location;\n }", "public function setLocation($location){\n\t\t$this->location = $location;\n\t}", "public function setLocation($location){\n\t\t$this->location = $location;\n\t}", "public function setLocationData()\n\t{\n\t\t$location = Locations::where('id', '=', $this->location_id)->first();\n\t\t$this->location = $location;\n\t}", "public function setEventLocationAttribute($event_location)\n {\n $this->attributes['event_location'] = strip_tags($event_location);\n }", "public function setLatLong()\n {\n $state = model('state');\n $state_id = (int)user()->preference('state_id') ?? user()->city ?? null;\n if (in_array($state_id, $state->pluck('id')->toArray())) {\n $state = $state->where('id', $state_id)->first();\n $this->latitude = $state->latitude;\n $this->longitude = $state->longitude;\n $this->state_id = $state_id;\n } else {\n $state = model('state')->where('id', 81)->first();\n $this->latitude = $state->latitude;\n $this->longitude = $state->longitude;\n $this->state_id = $state->id;\n user()->setPreference('state_id', $state->id);\n }\n }", "public function setAllowedDataIngestionLocations($val)\n {\n $this->_propDict[\"allowedDataIngestionLocations\"] = $val;\n return $this;\n }", "public function setLocation($value)\n {\n $this->setProperty(\"Location\", $value, true);\n }", "public function setLocation($location) {\n\t\t$this->location = $location;\n\t}" ]
[ "0.54546094", "0.54338676", "0.48249203", "0.4799989", "0.47798005", "0.47647262", "0.47572988", "0.47157225", "0.46194872", "0.4617256", "0.45661277", "0.4542252", "0.45350513", "0.45066687", "0.4474247", "0.44729722", "0.44386974", "0.44289735", "0.44059223", "0.44059223", "0.44059223", "0.4404725", "0.43822575", "0.43822575", "0.43599176", "0.43532243", "0.43531895", "0.43035457", "0.42995375", "0.4291142" ]
0.59428936
0
Sets the onenote property value. The onenote property
public function setOnenote(?Onenote $value): void { $this->getBackingStore()->set('onenote', $value); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function setAnnote($annote)\n {\n $this->annote = $annote;\n return $this;\n }", "public function setOverwrite($on = true)\n\t{\n\t\t$this->overwriteValue = (bool) $on;\n\t}", "function setNote($value) {\n return $this->setFieldValue('note', $value);\n }", "public function set_notes($value)\n {\n\n // Sanitize and validate value\n $value = $this->sanitize_notes($value);\n\n // Set property\n $this->set_property('notes', $value);\n }", "public function setNote(?string $value): void {\n $this->getBackingStore()->set('note', $value);\n }", "public function getOnenote(): ?Onenote {\n $val = $this->getBackingStore()->get('onenote');\n if (is_null($val) || $val instanceof Onenote) {\n return $val;\n }\n throw new \\UnexpectedValueException(\"Invalid type found in backing store for 'onenote'\");\n }", "public function setShowValueOn($value) {\n if ($value !== 'slide' && $value !== 'change')\n throw new CException(Yii::t('EJqueryUiWidget', 'showValueOn must be one of: \"slide\", \"change\"'));\n $this->showValueOn = $value;\n }", "public function setFootnote($value = true){\n $this->showFootnote = $value;\n }", "public function setNote($note) {\n\n $this->note = $note;\n }", "public function turnOn() \n {\n $this->on = true;\n }", "function setNotes($value)\n {\n $this->data['notes'] = $value;\n }", "public function setIndicator(bool $on): SpeakerInterface\n {\n $this->soap(\"DeviceProperties\", \"SetLEDState\", [\n \"DesiredLEDState\" => $on ? \"On\" : \"Off\",\n ]);\n\n return $this;\n }", "public function setTotalPropertyOnShow($value){\n\t\t$this->no_property_onshow = $value;\n\t}", "public function setOnSale( $onSale )\n {\n $this->onSale = $onSale;\n }", "public function setAncho($ancho)\n\t{\n\t\t$this->_ancho = $ancho;\n\t}", "public function setMark()\n {\n $this->mark = true;\n }", "public function setHidden($on = true)\n\t{\n\t\t$this->hidden = (bool) $on;\n\t}", "public function setUserProperty($v)\n {\n $this->userProperty = (boolean) $v;\n }", "public function setObfuscate($value)\n {\n $this->ionOptionsXS['obfuscate'] = $value;\n }", "public function set($value)\n {\n $this->_progess_indicator = $value;\n return $this;\n }", "public function setLote($sLote) {\n $this->sLote = $sLote;\n }", "public function _setEia($eia) {\n\t\t$this->_eia = $eia;\n\t}", "public function getAnnote()\n {\n return $this->annote;\n }", "public function __set($property, $value) {\n if('position' == $property){ //si on veux changer la position\n $this->_icone->position=$value; //on lui affecte une valeur\n }\n elseif ('image' == $property) { //si on veux changer l'image\n $this->_icone->image=$value; //on lui affecte une valeur\n }\n elseif ('id' == $property) { //si on veux changer l'id\n $this->$id_VoiturePolice=$value; //on lui affecte une valeur\n }\n else {\n throw new Exception('Paramètre invalide !'); //sinon on retourne une erreur\n }\n }", "public function setPerezoso($val){\n \t\t$this->_perezoso = $val;\n \t}", "public function setMousse(bool $mousse): void\n {\n $this->mousse = $mousse;\n }", "public function setMark();", "public function setEditorial($p_editorial){\r\n\t$this->editorial=$p_editorial;\r\n}", "public function setFavorite($favorite)\n {\n $this->favorite = $favorite;\n }", "public function setOffLine($off_line)\n {\n $this->offLine = (boolean) $off_line;\n }" ]
[ "0.5909392", "0.58969975", "0.56727606", "0.5486001", "0.5483623", "0.5472115", "0.5241595", "0.5233365", "0.50859594", "0.50822306", "0.50805175", "0.50658464", "0.50480825", "0.5015266", "0.5014151", "0.5009501", "0.50050765", "0.49889597", "0.4966328", "0.49306208", "0.49297002", "0.4889832", "0.4883921", "0.4832812", "0.48293692", "0.48236495", "0.48221406", "0.48155105", "0.479242", "0.47880155" ]
0.8284543
0
Sets the onlineMeetings property value. Information about a meeting, including the URL used to join a meeting, the attendees' list, and the description.
public function setOnlineMeetings(?array $value): void { $this->getBackingStore()->set('onlineMeetings', $value); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function setMeetings($val)\n {\n $this->_propDict[\"meetings\"] = intval($val);\n return $this;\n }", "public function getMeetings()\n {\n if (array_key_exists(\"meetings\", $this->_propDict)) {\n return $this->_propDict[\"meetings\"];\n } else {\n return null;\n }\n }", "public function getOnlineMeetings(): ?array {\n $val = $this->getBackingStore()->get('onlineMeetings');\n if (is_array($val) || is_null($val)) {\n TypeUtils::validateCollectionValues($val, OnlineMeeting::class);\n /** @var array<OnlineMeeting>|null $val */\n return $val;\n }\n throw new \\UnexpectedValueException(\"Invalid type found in backing store for 'onlineMeetings'\");\n }", "public function getMeetings()\n {\n return $this->hasMany(Meeting::className(), ['house_id' => 'id']);\n }", "public function meetings()\n\t{\n\t\treturn $this->belongsToMany(\n\t\t\tconfig('core.acl.meeting_model'),\n\t\t\tconfig('core.acl.meeting_members')\n\t\t);\n\t}", "public function dashboardMeetings($from, $to, $type = 'live', $page_size = '30', $next_page_token = null)\n {\n list($response) = $this->dashboardMeetingsWithHttpInfo($from, $to, $type, $page_size, $next_page_token);\n return $response;\n }", "function tsml_get_meetings($arguments=array(), $from_cache=true) {\n\tglobal $tsml_cache;\n\n\t//start by grabbing all meetings\n\tif (false && $from_cache && file_exists(WP_CONTENT_DIR . $tsml_cache) && $meetings = file_get_contents(WP_CONTENT_DIR . $tsml_cache)) {\n\t\t$meetings = json_decode($meetings, true);\n\t} else {\n\t\t//from database\n\t\t$meetings = array();\n\n\t\t//can specify post_status (for PR #33)\n\t\tif (empty($arguments['post_status'])) {\n\t\t\t$arguments['post_status'] = 'publish';\n\t\t} elseif (is_array($arguments['post_status'])) {\n\t\t\t$arguments['post_status'] = array_map('sanitize_title', $arguments['post_status']);\n\t\t} else {\n\t\t\t$arguments['post_status'] = sanitize_title($arguments['post_status']);\n\t\t}\n\n\t\t$posts = get_posts(array(\n\t\t\t'post_type'\t\t\t=> 'tsml_meeting',\n\t\t\t'numberposts'\t\t=> -1,\n\t\t\t'post_status'\t\t=> $arguments['post_status'],\n\t\t));\n\n\t\t$meeting_meta = tsml_get_meta('tsml_meeting');\n\t\t$groups = tsml_get_groups();\n\t\t$locations = tsml_get_locations();\n\t\t$users = tsml_get_users();\n\n\t\t//make an array of the meetings\n\t\tforeach ($posts as $post) {\n\t\t\t//shouldn't ever happen, but just in case\n\t\t\tif (empty($locations[$post->post_parent])) continue;\n\n\t\t\t//append to array\n\t\t\t$meeting = array_merge(array(\n\t\t\t\t'id'\t\t\t\t=> $post->ID,\n\t\t\t\t'name'\t\t\t\t=> $post->post_title,\n\t\t\t\t'slug'\t\t\t\t=> $post->post_name,\n\t\t\t\t'notes'\t\t\t\t=> $post->post_content,\n\t\t\t\t'updated'\t\t\t=> $post->post_modified_gmt,\n\t\t\t\t'location_id'\t\t=> $post->post_parent,\n\t\t\t\t'url'\t\t\t\t=> get_permalink($post->ID),\n\t\t\t\t'day'\t\t\t\t=> @$meeting_meta[$post->ID]['day'],\n\t\t\t\t'time'\t\t\t\t=> @$meeting_meta[$post->ID]['time'],\n\t\t\t\t'end_time'\t\t\t=> @$meeting_meta[$post->ID]['end_time'],\n\t\t\t\t'time_formatted'\t=> tsml_format_time(@$meeting_meta[$post->ID]['time']),\n\t\t\t\t'email'\t\t\t\t=> @$meeting_meta[$post->ID]['email'],\n\t\t\t\t'website'\t\t\t=> @$meeting_meta[$post->ID]['website'],\n\t\t\t\t'website_2'\t\t\t=> @$meeting_meta[$post->ID]['website_2'],\n\t\t\t\t'phone'\t\t\t\t=> @$meeting_meta[$post->ID]['phone'],\n\t\t\t\t'conference_url'\t=> @$meeting_meta[$post->ID]['conference_url'],\n\t\t\t\t'conference_phone'\t=> @$meeting_meta[$post->ID]['conference_phone'],\n\t\t\t\t'types'\t\t\t\t=> empty($meeting_meta[$post->ID]['types']) ? array() : array_values(unserialize($meeting_meta[$post->ID]['types'])),\n\t\t\t), $locations[$post->post_parent]);\n\n\t\t\t//append group info to meeting\n\t\t\tif (!empty($meeting_meta[$post->ID]['group_id']) && array_key_exists($meeting_meta[$post->ID]['group_id'], $groups)) {\n\t\t\t\t$meeting = array_merge($meeting, $groups[$meeting_meta[$post->ID]['group_id']]);\n\t\t\t}\n\n\t\t\t$meetings[] = $meeting;\n\t\t}\n\t}\n\n\t//check if we are filtering\n\t$allowed = array('mode', 'day', 'time', 'region', 'district', 'type', 'query', 'group_id', 'location_id', 'latitude', 'longitude', 'distance_units', 'distance');\n\tif ($arguments = array_intersect_key($arguments, array_flip($allowed))) {\n\t\t$filter = new tsml_filter_meetings($arguments);\n\t\t$meetings = $filter->apply($meetings);\n\t}\n\n\tusort($meetings, 'tsml_sort_meetings');\n\n\t//dd($meetings);\n\treturn $meetings;\n\n}", "public function setOnline(): void\n {\n $this->offline = false;\n }", "function tsml_count_meetings() {\n\treturn count(tsml_get_all_meetings('publish'));\n}", "public function setOnlineOffers($onlineOffers)\n {\n $this->onlineOffers = $onlineOffers;\n return $this;\n }", "public function __construct(\n Meeting $meeting\n ) {\n $this->meeting = $meeting;\n }", "public function getOnlineOffers()\n {\n return $this->onlineOffers;\n }", "public function dashboardMeetingsWithHttpInfo($from, $to, $type = 'live', $page_size = '30', $next_page_token = null)\n {\n $returnType = '\\Swagger\\Client\\Model\\InlineResponse20026';\n $request = $this->dashboardMeetingsRequest($from, $to, $type, $page_size, $next_page_token);\n\n try {\n $options = $this->createHttpClientOption();\n try {\n $response = $this->client->send($request, $options);\n } catch (RequestException $e) {\n throw new ApiException(\n \"[{$e->getCode()}] {$e->getMessage()}\",\n $e->getCode(),\n $e->getResponse() ? $e->getResponse()->getHeaders() : null,\n $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null\n );\n }\n\n $statusCode = $response->getStatusCode();\n\n if ($statusCode < 200 || $statusCode > 299) {\n throw new ApiException(\n sprintf(\n '[%d] Error connecting to the API (%s)',\n $statusCode,\n $request->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n $response->getBody()\n );\n }\n\n $responseBody = $response->getBody();\n if ($returnType === '\\SplFileObject') {\n $content = $responseBody; //stream goes to serializer\n } else {\n $content = $responseBody->getContents();\n if ($returnType !== 'string') {\n $content = json_decode($content);\n }\n }\n\n return [\n ObjectSerializer::deserialize($content, $returnType, []),\n $response->getStatusCode(),\n $response->getHeaders()\n ];\n\n } catch (ApiException $e) {\n switch ($e->getCode()) {\n case 200:\n $data = ObjectSerializer::deserialize(\n $e->getResponseBody(),\n '\\Swagger\\Client\\Model\\InlineResponse20026',\n $e->getResponseHeaders()\n );\n $e->setResponseObject($data);\n break;\n }\n throw $e;\n }\n }", "public function list(Request $request)\n {\n $meetings = $this->list();\n\n \n }", "public function meetups() {\n return MeetUp::where('date_time', \n '>=', Carbon::now())->get();\n }", "public function setAllowAnonymousUsersToStartMeeting($val)\n {\n $this->_propDict[\"allowAnonymousUsersToStartMeeting\"] = $val;\n return $this;\n }", "public function edit(LiveMeeting $liveMeeting)\n {\n $liveMeeting->load('members');\n $meetingUsers = $liveMeeting->members->pluck('id')->toArray();\n $liveMeeting->setAttribute('meetingUsers', $meetingUsers);\n\n return $this->sendResponse($liveMeeting, 'Live Meeting retrieved successfully.');\n }", "public function makeOnline()\n {\n $this->online_at = new \\DateTime();\n\n $this->save();\n }", "public function SetOnline($isOnline)\n {\n if ($this->_db->ExecuteStmt(Statements::UPDATE_USER_DATA_ONLINE, $this->_db->BuildStmtArray(\"ii\", ($isOnline ? \"1\" : \"0\"), $this->GetId())))\n {\n $this->_isOnline = (bool)$isOnline;\n return true;\n }\n return false;\n }", "function testView_Upcoming_Meetings()\n {\n $meetings = PersonalMeeting::model()->findAllBySql(\"Select * from personal_meeting where date >= CURRENT_DATE AND time >= CURRENT_TIME \");\n foreach($meetings as $m) {\n $this->assertNull($m);\n }\n }", "private function handleRegularMeetingsJustInThePast(MeetingDate $currentMeetingDate){\n\t\t$startMeetingDateInMainPage = $currentMeetingDate;\n\n\t\tfor($startIndex = RoleRegOnline::CENTRAL_MEETING_ORDER - $this->startMeetingDateOrder; $startIndex < RoleRegOnline::NO_OF_AGENDAS_IN_ONE_SCREEN; $startIndex++){\n\n\t\t\t$this->regularMeetings[$startIndex] = new RegularMeeting($this->roleNames, $startMeetingDateInMainPage, $this->editAuthorized);\n\t\t\t$startMeetingDateInMainPage = $startMeetingDateInMainPage->getNextMeetingDate();\n\t\t}\n\n\t\t$startMeetingDateInMainPage = $currentMeetingDate->getLastMeetingDate();\n\n\t\tfor($startIndex = RoleRegOnline::CENTRAL_MEETING_ORDER - $this->startMeetingDateOrder - 1; $startIndex >= 0; $startIndex--){\n\t\t\t$this->regularMeetings[$startIndex] = new RegularMeeting($this->roleNames, $startMeetingDateInMainPage, $this->editAuthorized);\n\t\t\t$startMeetingDateInMainPage = $startMeetingDateInMainPage->getLastMeetingDate();\n\t\t}\n\t}", "public function dashboardMeetingsAsync($from, $to, $type = 'live', $page_size = '30', $next_page_token = null)\n {\n return $this->dashboardMeetingsAsyncWithHttpInfo($from, $to, $type, $page_size, $next_page_token)\n ->then(\n function ($response) {\n return $response[0];\n }\n );\n }", "public function changeMeetingRoomStatus()\n {\n $response = [];\n $response['error'] = true;\n\n if ($this->request->request->has('room') &&\n $this->request->request->has('status')\n ) {\n try {\n $this->standManagerRepo->updateRoomStatus(\n $this->request->request->get('room'),\n $this->request->request->get('status')\n );\n\n if ($this->request->request->has('stand')) {\n $smOnSite = $this->standManagerRepo->countStandManagerOnlineOrBusy(\n $this->request->request->get('stand')\n );\n\n $response['managersOnline'] = $smOnSite;\n\n }\n\n $response['error'] = false;\n } catch (Exception $e) {\n $response['error'] = true;\n }\n }\n\n return new JsonResponse($response);\n }", "private function handleRegularMeetingsInTheFuture(MeetingDate $currentMeetingDate){\n\t\t$startMeetingDateInMainPage = $currentMeetingDate;\n\n\t\tfor($index = 0; $index < $this->startMeetingDateOrder - RoleRegOnline::CENTRAL_MEETING_ORDER; $index++){\n\t\t\t$startMeetingDateInMainPage = $startMeetingDateInMainPage->getNextMeetingDate();\n\t\t}\n\n\t\tfor($startIndex = 0; $startIndex < RoleRegOnline::NO_OF_AGENDAS_IN_ONE_SCREEN; $startIndex++){\n\t\t\t$this->regularMeetings[$startIndex] = new RegularMeeting($this->roleNames, $startMeetingDateInMainPage, $this->editAuthorized);\n\t\t\t$startMeetingDateInMainPage = $startMeetingDateInMainPage->getNextMeetingDate();\n\t\t}\n\t}", "public function show(Meeting $meeting)\n {\n return response()->json($meeting->load('candidate', 'manager'));\n }", "public function dashboardMeetingParticipants($meeting_id, $type = 'live', $page_size = '30', $next_page_token = null)\n {\n list($response) = $this->dashboardMeetingParticipantsWithHttpInfo($meeting_id, $type, $page_size, $next_page_token);\n return $response;\n }", "public function setAvailability(Request $request, $meeting_id)\n {\n $meeting = Meeting::findOrFail($meeting_id);\n\n $this->authorize('setAvailability', $meeting);\n\n\n if(DatePoll\n ::where('meeting_id', $meeting_id)\n ->where('date', $request->date)->doesntExist()\n ) {\n $this->authorize('edit', $meeting);\n $request->validate([\n 'date' => 'required|date|after:yesterday'\n ]);\n }\n\n $datePoll = DatePoll::firstOrNew([\n 'user_id' => Auth::id(),\n 'meeting_id' => $meeting_id,\n 'date' => $request->date\n ]);\n\n $datePoll->availability = $request->availability;\n\n if($datePoll->save()) {\n Session::flash('alert-success', __('Choice has been saved'));\n } else {\n Session::flash('alert-danger', __('Unable to save your choice'));\n }\n\n return redirect(url()->previous() . '#date-poll')->withInput();\n }", "public function onlineIdContains(string $onlineId): FriendsListFactory\n {\n $this->onlineId = $onlineId;\n\n return $this;\n }", "function tsml_import_buffer_set($meetings, $data_source=null) {\n\tglobal $tsml_programs, $tsml_program, $tsml_days;\n\n\tif (strpos($data_source, \"spreadsheets.google.com\") !== false){\n\t\t$meetings = tsml_import_reformat_googlesheet($meetings);\n\t}\n\t\n\t//uppercasing for value matching later\n\t$upper_types = array_map('strtoupper', $tsml_programs[$tsml_program]['types']);\n\t$upper_days = array_map('strtoupper', $tsml_days);\n\n\t//get users, keyed by username\n\t$users = tsml_get_users(false);\n\t$user_id = get_current_user_id();\n\n\t//convert the array to UTF-8\n\tarray_walk_recursive($meetings, 'tsml_format_utf8');\n\n\t//trim everything\n\tarray_walk_recursive($meetings, 'tsml_import_sanitize_field');\n\n\t//check for any meetings with arrays of days and creates an individual meeting for each day in array\n\t$meetings_to_add = array();\n\t$indexes_to_remove = array();\n\n\tfor ($i = 0; $i < count($meetings); $i++) {\n\t\tif (isset($meetings[$i]['day']) && is_array($meetings[$i]['day'])) {\n\t\t\tarray_push($indexes_to_remove, $i);\n\t\t\tforeach ($meetings[$i]['day'] as $single_day) {\n\t\t\t\t$temp_meeting = $meetings[$i];\n\t\t\t\t$temp_meeting['day'] = $single_day;\n\t\t\t\t$temp_meeting['slug'] = $meetings[$i]['slug'] . \"-\" . $single_day;\n\t\t\t\tarray_push($meetings_to_add, $temp_meeting);\n\t\t\t}\n\t\t}\n\t}\n\n\tfor ($i = 0; $i < count($indexes_to_remove); $i++) {\n\t\tunset($meetings[$indexes_to_remove[$i]]);\n\t}\n\n\t$meetings = array_merge($meetings, $meetings_to_add);\n\n\t//prepare array for import buffer\n\t$count_meetings = count($meetings);\n\tfor ($i = 0; $i < $count_meetings; $i++) {\n\n\t\t$meetings[$i]['data_source'] = $data_source;\n\n\t\t//do wordpress sanitization\n\t\tforeach ($meetings[$i] as $key => $value) {\n\t\t\t\n\t\t\t//have to compress types down real quick (only happens with json)\n\t\t\tif (is_array($value)) $value = implode(',', $value);\n\t\t\t\n\t\t\tif (in_array($key, array('notes', 'location_notes', 'group_notes'))) {\n\t\t\t\t$meetings[$i][$key] = sanitize_text_area($value);\n\t\t\t} else {\n\t\t\t\t$meetings[$i][$key] = sanitize_text_field($value);\n\t\t\t}\n\t\t}\n\n\t\t//column aliases\n\t\tif (empty($meetings[$i]['postal_code']) && !empty($meetings[$i]['zip'])) {\n\t\t\t$meetings[$i]['postal_code'] = $meetings[$i]['zip'];\n\t\t}\n\t\tif (empty($meetings[$i]['name']) && !empty($meetings[$i]['meeting'])) {\n\t\t\t$meetings[$i]['name'] = $meetings[$i]['meeting'];\n\t\t}\n\t\tif (empty($meetings[$i]['location']) && !empty($meetings[$i]['location_name'])) {\n\t\t\t$meetings[$i]['location'] = $meetings[$i]['location_name'];\n\t\t}\n\t\tif (empty($meetings[$i]['time']) && !empty($meetings[$i]['start_time'])) {\n\t\t\t$meetings[$i]['time'] = $meetings[$i]['start_time'];\n\t\t}\n\n\t\t//if '@' is in address, remove it and everything after\n\t\tif (!empty($meetings[$i]['address']) && $pos = strpos($meetings[$i]['address'], '@')) $meetings[$i]['address'] = trim(substr($meetings[$i]['address'], 0, $pos));\n\t\t\n\t\t//if location name is missing, use address\n\t\tif (empty($meetings[$i]['location'])) {\n\t\t\t$meetings[$i]['location'] = empty($meetings[$i]['address']) ? __('Meeting Location', '12-step-meeting-list') : $meetings[$i]['address'];\n\t\t}\n\t\t\n\t\t//day can either be 0, 1, 2, 3 or Sunday, Monday, or empty\n\t\tif (isset($meetings[$i]['day']) && !array_key_exists($meetings[$i]['day'], $upper_days)) {\n\t\t\t$meetings[$i]['day'] = array_search(strtoupper($meetings[$i]['day']), $upper_days);\n\t\t}\n\n\t\t//sanitize time & day\n\t\tif (empty($meetings[$i]['time']) || ($meetings[$i]['day'] === false)) {\n\t\t\t$meetings[$i]['time'] = $meetings[$i]['end_time'] = $meetings[$i]['day'] = false; //by appointment\n\n\t\t\t//if meeting name missing, use location\n\t\t\tif (empty($meetings[$i]['name'])) $meetings[$i]['name'] = sprintf(__('%s by Appointment', '12-step-meeting-list'), $meetings[$i]['location']);\n\t\t} else {\n\t\t\t//if meeting name missing, use location, day, and time\n\t\t\tif (empty($meetings[$i]['name'])) {\n\t\t\t\t$meetings[$i]['name'] = sprintf(__('%s %ss at %s', '12-step-meeting-list'), $meetings[$i]['location'], $tsml_days[$meetings[$i]['day']], $meetings[$i]['time']);\n\t\t\t}\n\n\t\t\t$meetings[$i]['time'] = tsml_format_time_reverse($meetings[$i]['time']);\n\t\t\tif (!empty($meetings[$i]['end_time'])) $meetings[$i]['end_time'] = tsml_format_time_reverse($meetings[$i]['end_time']);\n\t\t}\n\n\t\t//google prefers USA for geocoding\n\t\tif (!empty($meetings[$i]['country']) && $meetings[$i]['country'] == 'US') $meetings[$i]['country'] = 'USA'; \n\t\t\n\t\t//build address\n\t\tif (empty($meetings[$i]['formatted_address'])) {\n\t\t\t$address = array();\n\t\t\tif (!empty($meetings[$i]['address'])) $address[] = $meetings[$i]['address'];\n\t\t\tif (!empty($meetings[$i]['city'])) $address[] = $meetings[$i]['city'];\n\t\t\tif (!empty($meetings[$i]['state'])) $address[] = $meetings[$i]['state'];\n\t\t\tif (!empty($meetings[$i]['postal_code'])) {\n\t\t\t\tif ((strlen($meetings[$i]['postal_code']) < 5) && ($meetings[$i]['country'] == 'USA')) $meetings[$i]['postal_code'] = str_pad($meetings[$i]['postal_code'], 5, '0', STR_PAD_LEFT);\n\t\t\t\t$address[] = $meetings[$i]['postal_code'];\t\n\t\t\t}\n\t\t\tif (!empty($meetings[$i]['country'])) $address[] = $meetings[$i]['country'];\n\t\t\t$meetings[$i]['formatted_address'] = implode(', ', $address);\n\t\t}\n\n\t\t//notes\n\t\tif (empty($meetings[$i]['notes'])) $meetings[$i]['notes'] = '';\n\t\tif (empty($meetings[$i]['location_notes'])) $meetings[$i]['location_notes'] = '';\n\t\tif (empty($meetings[$i]['group_notes'])) $meetings[$i]['group_notes'] = '';\n\n\t\t//updated\n\t\tif (empty($meetings[$i]['updated']) || (!$meetings[$i]['updated'] = strtotime($meetings[$i]['updated']))) $meetings[$i]['updated'] = time();\n\t\t$meetings[$i]['post_modified'] = date('Y-m-d H:i:s', $meetings[$i]['updated']);\n\t\t$meetings[$i]['post_modified_gmt'] = get_gmt_from_date($meetings[$i]['post_modified']);\n\t\t\n\t\t//author\n\t\tif (!empty($meetings[$i]['author']) && array_key_exists($meetings[$i]['author'], $users)) {\n\t\t\t$meetings[$i]['post_author'] = $users[$meetings[$i]['author']];\n\t\t} else {\n\t\t\t$meetings[$i]['post_author'] = $user_id;\n\t\t}\n\n\t\t//default region to city if not specified\n\t\tif (empty($meetings[$i]['region']) && !empty($meetings[$i]['city'])) $meetings[$i]['region'] = $meetings[$i]['city'];\n\n\t\t//sanitize types (they can be Closed or C)\n\t\tif (empty($meetings[$i]['types'])) $meetings[$i]['types'] = '';\n\t\t$types = explode(',', $meetings[$i]['types']);\n\t\t$meetings[$i]['types'] = $unused_types = array();\n\t\tforeach ($types as $type) {\n\t\t\t$upper_type = trim(strtoupper($type));\n\t\t\tif (array_key_exists($upper_type, $upper_types)) {\n\t\t\t\t$meetings[$i]['types'][] = $upper_type;\n\t\t\t} elseif (in_array($upper_type, array_values($upper_types))) {\n\t\t\t\t$meetings[$i]['types'][] = array_search($upper_type, $upper_types);\n\t\t\t} else {\n\t\t\t\t$unused_types[] = $type;\n\t\t\t}\n\t\t}\n\t\t\n\t\t//if a meeting is both open and closed, make it closed\n\t\tif (in_array('C', $meetings[$i]['types']) && in_array('O', $meetings[$i]['types'])) {\n\t\t\t$meetings[$i]['types'] = array_diff($meetings[$i]['types'], array('O'));\n\t\t}\n\t\t\n\t\t//append unused types to notes\n\t\tif (count($unused_types)) {\n\t\t\tif (!empty($meetings[$i]['notes'])) $meetings[$i]['notes'] .= str_repeat(PHP_EOL, 2);\n\t\t\t$meetings[$i]['notes'] .= implode(', ', $unused_types);\n\t\t}\n\n\t\t//make sure we're not double-listing types\n\t\t$meetings[$i]['types'] = array_unique($meetings[$i]['types']);\n\n\t\t//clean up\n\t\tforeach(array('address', 'city', 'state', 'postal_code', 'country', 'updated') as $key) {\n\t\t\tif (isset($meetings[$i][$key])) unset($meetings[$i][$key]);\n\t\t}\n\t\t\n\t\t//preserve row number for errors later\n\t\t$meetings[$i]['row'] = $i + 2;\t\t\n\t}\n\n\t//allow user-defined function to filter the meetings (for gal-aa.org)\n\tif (function_exists('tsml_import_filter')) {\n\t\t$meetings = array_filter($meetings, 'tsml_import_filter');\n\t}\n\t\t\n\t//prepare import buffer in wp_options\n\tupdate_option('tsml_import_buffer', $meetings, false);\n}", "public static function getUsersOnlineMarkings() {\n\t\t$usersOnlineMarkings = $showOnTeamPage = $teamPagePosition = array();\n\t\t\n\t\t// get groups\n\t\tWCF::getCache()->addResource('groups', WCF_DIR.'cache/cache.groups.php', WCF_DIR.'lib/system/cache/CacheBuilderGroups.class.php');\n\t\t$groups = WCF::getCache()->get('groups', 'groups');\n\t\tforeach ($groups as $group) {\n\t\t\tif ($group['userOnlineMarking'] != '%s') {\n\t\t\t\tif (isset($group['showOnTeamPage']) && isset($group['teamPagePosition'])) {\n\t\t\t\t\t$showOnTeamPage[] = $group['showOnTeamPage'];\n\t\t\t\t\t$teamPagePosition[] = $group['teamPagePosition'];\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$usersOnlineMarkings[] = sprintf($group['userOnlineMarking'], StringUtil::encodeHTML(WCF::getLanguage()->get($group['groupName'])));\n\t\t\t}\n\t\t}\n\t\t\n\t\t// sort list\n\t\tif (count($showOnTeamPage)) {\n\t\t\tarray_multisort($showOnTeamPage, SORT_DESC, $teamPagePosition, $usersOnlineMarkings);\n\t\t}\n\t\t\n\t\tif (WCF::getUser()->userID && WCF::getUser()->buddies) {\n\t\t\t$usersOnlineMarkings[] = '<span class=\"buddy\">'.WCF::getLanguage()->get('wcf.usersOnline.marking.friends').'</span>';\n\t\t}\n\t\n\t\treturn $usersOnlineMarkings;\n\t}" ]
[ "0.66483134", "0.5911926", "0.5893222", "0.55176646", "0.5469691", "0.5340534", "0.520019", "0.51289016", "0.5092487", "0.506504", "0.48860937", "0.4885675", "0.4845755", "0.4833856", "0.47952294", "0.4790418", "0.4784146", "0.46808413", "0.46352082", "0.46221995", "0.46060872", "0.45920435", "0.4589585", "0.45646545", "0.45584166", "0.45373636", "0.4519201", "0.45173848", "0.44956115", "0.44651863" ]
0.6845812
0
Sets the onPremisesDistinguishedName property value. Contains the onpremises Active Directory distinguished name or DN. The property is only populated for customers who are synchronizing their onpremises directory to Azure Active Directory via Azure AD Connect. Readonly.
public function setOnPremisesDistinguishedName(?string $value): void { $this->getBackingStore()->set('onPremisesDistinguishedName', $value); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function setOnPremisesDomainName(?string $value): void {\n $this->getBackingStore()->set('onPremisesDomainName', $value);\n }", "public function setOnPremisesUserPrincipalName(?string $value): void {\n $this->getBackingStore()->set('onPremisesUserPrincipalName', $value);\n }", "public function setFullyQualifiedDomainName($fqdn);", "public function setOnPremisesConnectionName(?string $value): void {\n $this->getBackingStore()->set('onPremisesConnectionName', $value);\n }", "public function getOnPremisesDistinguishedName(): ?string {\n $val = $this->getBackingStore()->get('onPremisesDistinguishedName');\n if (is_null($val) || is_string($val)) {\n return $val;\n }\n throw new \\UnexpectedValueException(\"Invalid type found in backing store for 'onPremisesDistinguishedName'\");\n }", "public function setOnPremisesSamAccountName(?string $value): void {\n $this->getBackingStore()->set('onPremisesSamAccountName', $value);\n }", "public function setCustomDomainName(?string $value): void {\n $this->getBackingStore()->set('customDomainName', $value);\n }", "public function setOnPremisesSecurityIdentifier(?string $value): void {\n $this->getBackingStore()->set('onPremisesSecurityIdentifier', $value);\n }", "public function getOnPremisesDomainName(): ?string {\n $val = $this->getBackingStore()->get('onPremisesDomainName');\n if (is_null($val) || is_string($val)) {\n return $val;\n }\n throw new \\UnexpectedValueException(\"Invalid type found in backing store for 'onPremisesDomainName'\");\n }", "public function setDN($dn) {\n\t\tif (DEBUG_ENABLED && (($fargs=func_get_args())||$fargs='NOARGS'))\n\t\t\tdebug_log('Entered (%%)',5,1,__FILE__,__LINE__,__METHOD__,$fargs);\n\n\t\t$this->dn = $dn;\n\t}", "function setDomain($value) {\n $this->domain = trim($value);\n }", "public function setUseMiddleName($v)\n\t{\n\t\tif ($v !== null) {\n\t\t\t$v = (string) $v;\n\t\t}\n\n\t\tif ($this->use_middle_name !== $v) {\n\t\t\t$this->use_middle_name = $v;\n\t\t\t$this->modifiedColumns[] = UsersPeer::USE_MIDDLE_NAME;\n\t\t}\n\n\t\treturn $this;\n\t}", "public function setManagedDeviceName(?string $value): void {\n $this->getBackingStore()->set('managedDeviceName', $value);\n }", "public function setManagedDeviceName(?string $value): void {\n $this->getBackingStore()->set('managedDeviceName', $value);\n }", "public function getFullyQualifiedDomainName();", "public function setKerberosPrincipalName(?string $value): void {\n $this->getBackingStore()->set('kerberosPrincipalName', $value);\n }", "public function setDomain( $_value ) {\n\t\treturn $this -> setConfig( 'domain', $_value, function( &$_value ) {\n\t\t\treturn\tis_string( $_value ) && trim( $_value ) !== '';\n\t\t} );\n\t}", "public function setNome($d) {\n $pattern = '/^[[:alpha:]]{3,20}$/';\n if (preg_match($pattern, $d)) {\n\n $this->nome = $d;\n }\n else\n $this->nome = false;\n }", "function setDN($username, $nosub = 0) {\r\n\t\tif ($this->users_dn == '' || $nosub) {\r\n\t\t\t$this->_dn = $username;\r\n\t\t} else {\r\n\t\t\t$this->_dn = str_replace('[username]', $username, $this->users_dn);\r\n\t\t}\r\n\t}", "public function setDomain($value)\n {\n $this->domain = $value;\n }", "public function setDeletedByName($value)\n {\n $this->setProperty(\"DeletedByName\", $value, true);\n }", "public function setUserPrincipalName(?string $value): void {\n $this->getBackingStore()->set('userPrincipalName', $value);\n }", "public function setUserPrincipalName(?string $value): void {\n $this->getBackingStore()->set('userPrincipalName', $value);\n }", "public function setCertificationAuthorityName(?string $value): void {\n $this->getBackingStore()->set('certificationAuthorityName', $value);\n }", "protected function set_cookie_domain() {\n\t\tif ( defined( 'COOKIE_DOMAIN' ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\t$cookie_domain = $this->get_domain();\n\n\t\t// Remove `www.` from cookie domain.\n\t\tif ( substr( $cookie_domain, 0, 4 ) === 'www.' ) {\n\t\t\t$cookie_domain = substr( $cookie_domain, 4 );\n\t\t}\n\n\t\t/**\n\t\t * Modify cookie domain before definition.\n\t\t *\n\t\t * @param string $cookie_domain\n\t\t *\n\t\t * @return string\n\t\t */\n\t\t$cookie_domain = apply_filters( 'hercules_cookie_domain', $cookie_domain );\n\n\t\tif ( is_string( $cookie_domain ) ) {\n\t\t\tdefine( 'COOKIE_DOMAIN', $cookie_domain );\n\t\t}\n\t}", "public function setOnPremisesSyncEnabled(?bool $value): void {\n $this->getBackingStore()->set('onPremisesSyncEnabled', $value);\n }", "public function setOnPremisesSyncEnabled(?bool $value): void {\n $this->getBackingStore()->set('onPremisesSyncEnabled', $value);\n }", "public function getOnPremisesUserPrincipalName(): ?string {\n $val = $this->getBackingStore()->get('onPremisesUserPrincipalName');\n if (is_null($val) || is_string($val)) {\n return $val;\n }\n throw new \\UnexpectedValueException(\"Invalid type found in backing store for 'onPremisesUserPrincipalName'\");\n }", "public function setFullName($value)\n {\n Yii::trace('setFullName()', 'application.components.RinkfinderWebUser');\n\t$this->setState('__fullName', $value);\n }", "public function getDistrictManagerNameAttribute()\n {\n return data_get($this->field, 'manager.preferred_name');\n }" ]
[ "0.65556175", "0.61350435", "0.55748504", "0.54657245", "0.5406412", "0.53613776", "0.5182198", "0.4762307", "0.4714949", "0.46549025", "0.4595469", "0.4412632", "0.43718576", "0.43718576", "0.43375948", "0.43185785", "0.42897108", "0.42832458", "0.42690614", "0.42633238", "0.42575878", "0.4255747", "0.4255747", "0.42384535", "0.42261726", "0.420159", "0.420159", "0.41927093", "0.41914353", "0.41557425" ]
0.7890813
0
Sets the onPremisesDomainName property value. Contains the onpremises domainFQDN, also called dnsDomainName synchronized from the onpremises directory. The property is only populated for customers who are synchronizing their onpremises directory to Azure Active Directory via Azure AD Connect. Readonly.
public function setOnPremisesDomainName(?string $value): void { $this->getBackingStore()->set('onPremisesDomainName', $value); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function setFullyQualifiedDomainName($fqdn);", "public function setOnPremisesDistinguishedName(?string $value): void {\n $this->getBackingStore()->set('onPremisesDistinguishedName', $value);\n }", "public function setCustomDomainName(?string $value): void {\n $this->getBackingStore()->set('customDomainName', $value);\n }", "public function getOnPremisesDomainName(): ?string {\n $val = $this->getBackingStore()->get('onPremisesDomainName');\n if (is_null($val) || is_string($val)) {\n return $val;\n }\n throw new \\UnexpectedValueException(\"Invalid type found in backing store for 'onPremisesDomainName'\");\n }", "function setDomain($value) {\n $this->domain = trim($value);\n }", "public function getDomainName()\n {\n return $this->domain;\n }", "public function setOnPremisesUserPrincipalName(?string $value): void {\n $this->getBackingStore()->set('onPremisesUserPrincipalName', $value);\n }", "public function setOnPremisesSamAccountName(?string $value): void {\n $this->getBackingStore()->set('onPremisesSamAccountName', $value);\n }", "public function getDomainName()\n {\n return $this->domainName;\n }", "public function getDomainName()\n {\n return $this->domainName;\n }", "public function getDomainName()\n {\n return $this->_domainName;\n }", "public function setDomainName($domainName)\n {\n $this->domainName = $domainName;\n return $this;\n }", "public function setUserDomainNameSource(?DomainNameSource $value): void {\n $this->getBackingStore()->set('userDomainNameSource', $value);\n }", "public function setOnPremisesConnectionName(?string $value): void {\n $this->getBackingStore()->set('onPremisesConnectionName', $value);\n }", "public static function setDomainName(string $domain_name = '') : void\n {\n try\n {\n if (Request::$initial === null)\n {\n $domain_name = empty($domain_name) ? Arr::get(Core::$config->load('site'), 'minion_domain_name', '') : $domain_name;\n\n // Add trailing slash\n Core::$base_url = preg_replace('~^https?://[^/]+$~', '$0/', $domain_name);\n\n // Initialize Request Class\n $request = Request::factory();\n\n // Set HTTPS for https based urls\n if ($request !== null)\n {\n $request->secure(preg_match_all('#(https)://#i', Core::$base_url, $result) === 1);\n\n Request::$initial = $request;\n }\n }\n }\n catch (\\Exception $e)\n {\n throw new Exception($e->getMessage(), null, $e->getCode(), $e);\n }\n\n }", "public function getFullyQualifiedDomainName();", "public function setDomain($value)\n {\n $this->domain = $value;\n }", "protected function set_cookie_domain() {\n\t\tif ( defined( 'COOKIE_DOMAIN' ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\t$cookie_domain = $this->get_domain();\n\n\t\t// Remove `www.` from cookie domain.\n\t\tif ( substr( $cookie_domain, 0, 4 ) === 'www.' ) {\n\t\t\t$cookie_domain = substr( $cookie_domain, 4 );\n\t\t}\n\n\t\t/**\n\t\t * Modify cookie domain before definition.\n\t\t *\n\t\t * @param string $cookie_domain\n\t\t *\n\t\t * @return string\n\t\t */\n\t\t$cookie_domain = apply_filters( 'hercules_cookie_domain', $cookie_domain );\n\n\t\tif ( is_string( $cookie_domain ) ) {\n\t\t\tdefine( 'COOKIE_DOMAIN', $cookie_domain );\n\t\t}\n\t}", "public function setDomainName($domainName)\n {\n $this->domainName = $domainName;\n\n return $this;\n }", "public function getDomainName(): string\n {\n return $this->domainName;\n }", "public function setDomains()\n {\n foreach(array_keys(Core_Model_DiFactory::getDomainManager()->getDomains()) as $domainId) {\n $this->setDomain($domainId);\n }\n }", "public function set_dns($from_dhcp, $search_domain, $dns_manual) {\n\t\t$this->client->SetDNS(array(\n\t\t\t'FromDHCP' => $from_dhcp,\n\t\t\t'SearchDomain' => $search_domain,\n\t\t\t'DNSManual' => $dns_manual\n\t\t));\n\t}", "public function setDomain($domain);", "public function getDomainName(){\r\n return uri::getDomainName();\r\n }", "public function getDomainName(): string;", "public function getDomainName(): string;", "function setDomain($domain)\n {\n $this->domain = $domain;\n }", "public function setDomain( $_value ) {\n\t\treturn $this -> setConfig( 'domain', $_value, function( &$_value ) {\n\t\t\treturn\tis_string( $_value ) && trim( $_value ) !== '';\n\t\t} );\n\t}", "public function setDomicilio($domicilio) {\n $this->domicilio = $domicilio;\n }", "public function set_domain($domain)\n {\n clearos_profile(__METHOD__, __LINE__);\n\n Validation_Exception::is_valid($this->validate_domain($domain));\n\n $this->_set_dhcp_parameter('DOMAIN', $domain);\n }" ]
[ "0.6182064", "0.56943935", "0.5671626", "0.5242203", "0.50453395", "0.50288635", "0.50036335", "0.4989272", "0.49833572", "0.49833572", "0.49433446", "0.49262768", "0.49150985", "0.49147356", "0.48792666", "0.48659632", "0.48403046", "0.48172006", "0.47814086", "0.47461355", "0.46337286", "0.4551648", "0.45410252", "0.45231643", "0.44841936", "0.44841936", "0.44674066", "0.44588965", "0.44472283", "0.44393313" ]
0.7504951
0
Sets the onPremisesExtensionAttributes property value. Contains extensionAttributes115 for the user. These extension attributes are also known as Exchange custom attributes 115. For an onPremisesSyncEnabled user, the source of authority for this set of properties is the onpremises and is readonly. For a cloudonly user (where onPremisesSyncEnabled is false), these properties can be set during creation or update of a user object. For a cloudonly user previously synced from onpremises Active Directory, these properties are readonly in Microsoft Graph but can be fully managed through the Exchange Admin Center or the Exchange Online V2 module in PowerShell. Supports $filter (eq, ne, not, in).
public function setOnPremisesExtensionAttributes(?OnPremisesExtensionAttributes $value): void { $this->getBackingStore()->set('onPremisesExtensionAttributes', $value); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function setExtensionAttributes(\\Aheadworks\\News\\Api\\Data\\NewsExtensionInterface $extensionAttributes);", "public function setExtensionAttributes(\n \\MyFirstModule\\Mymodule\\Api\\Data\\CustomExtensionAttributeExtensionInterface $extensionAttributes\n );", "public function setExtensionAttributes(\n \\Shadab\\Customproduct\\Api\\Data\\ProductsExtensionInterface $extensionAttributes\n );", "public function setExtensionAttributes(\n \\MagePrakash\\ProductAttachment\\Api\\Data\\AttachmentExtensionInterface $extensionAttributes\n );", "public function setExtensionAttributes(\\Venice\\Product\\Api\\Data\\WatchSpecExtensionInterface $extensionAttributes);", "public function getOnPremisesExtensionAttributes(): ?OnPremisesExtensionAttributes {\n $val = $this->getBackingStore()->get('onPremisesExtensionAttributes');\n if (is_null($val) || $val instanceof OnPremisesExtensionAttributes) {\n return $val;\n }\n throw new \\UnexpectedValueException(\"Invalid type found in backing store for 'onPremisesExtensionAttributes'\");\n }", "public function setExtensionAttributes(\n \\Magento\\InventoryApi\\Api\\Data\\SourceExtensionInterface $extensionAttributes\n ): void;", "public function setExtensionAttributes(ConditionExtensionInterface $extensionAttributes);", "public function setExtensionAttributes(\n \\Magento\\Sales\\Api\\Data\\TotalExtensionInterface $extensionAttributes\n );", "public function setExtensionAttributes(\n \\Xigen\\Testimonial\\Api\\Data\\TestimonialExtensionInterface $extensionAttributes\n );", "public function setExtensionAttributes(\n \\Xigen\\Announce\\Api\\Data\\MessageExtensionInterface $extensionAttributes\n );", "public function getExtensionAttributes();", "public function getExtensionAttributes();", "public function getExtensionAttributes();", "public function getExtensionAttributes();", "public function getExtensionAttributes();", "public function getExtensionAttributes();", "public function getExtensionAttributes();", "public function getExtensionAttributes();", "public function getExtensionAttributes();", "public function getExtensionAttributes();", "public function getExtensionAttributes();", "public function getExtensionAttributes();", "public function setCustomAttributes($var)\n {\n $arr = GPBUtil::checkRepeatedField($var, \\Google\\Protobuf\\Internal\\GPBType::MESSAGE, \\Sugarcrm\\Apis\\Iam\\User\\V1alpha\\CustomAttribute::class);\n $this->custom_attributes = $arr;\n\n return $this;\n }", "public function setNormalizedExtensions($normalizedExtensions) {\n $this->normalizedExtensions = $normalizedExtensions;\n }", "public function setExtensionAttributes(\\Edu\\ExtensionAttribute\\Api\\Data\\EduNavisionExtensionInterface $extensionAttributes);", "public function setExtensionAttributes(\n \\Magento\\Company\\Api\\Data\\CompanyOrderExtensionInterface $extensionAttributes\n );", "public function setExtensionAttributes(\n \\Magento\\InventorySourceSelectionApi\\Api\\Data\\SourceSelectionAlgorithmExtensionInterface $extensionAttributes\n ): void;", "public function setExtensionFilter(array $extension= array()) {\n return $this->extensionsfilter = $extension;\n }", "public function setExtensionAttributes(\n \\Training\\Feedback\\Api\\Data\\FeedbackExtensionInterface $extensionAttributes\n );" ]
[ "0.5722868", "0.5658608", "0.5503976", "0.5452123", "0.5409483", "0.5308748", "0.5244916", "0.5241547", "0.52381325", "0.51320976", "0.5014571", "0.49710345", "0.49710345", "0.49710345", "0.49710345", "0.49710345", "0.49710345", "0.49710345", "0.49710345", "0.49710345", "0.49710345", "0.49710345", "0.49710345", "0.4927441", "0.48904213", "0.4884136", "0.48431203", "0.48387155", "0.48134932", "0.471552" ]
0.7541865
0
Sets the onPremisesImmutableId property value. This property is used to associate an onpremises Active Directory user account to their Azure AD user object. This property must be specified when creating a new user account in the Graph if you are using a federated domain for the user's userPrincipalName (UPN) property. Note: The $ and _ characters cannot be used when specifying this property. Supports $filter (eq, ne, not, ge, le, in).
public function setOnPremisesImmutableId(?string $value): void { $this->getBackingStore()->set('onPremisesImmutableId', $value); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getOnPremisesImmutableId(): ?string {\n $val = $this->getBackingStore()->get('onPremisesImmutableId');\n if (is_null($val) || is_string($val)) {\n return $val;\n }\n throw new \\UnexpectedValueException(\"Invalid type found in backing store for 'onPremisesImmutableId'\");\n }", "public function setIdentity($data);", "public function setItemPublic($id)\n {\n $query = $this->createQueryBuilder('q')\n ->update(Review::class, 'r')\n ->set('r.isPublic', '?1')\n ->where('r.id = ?2')\n ->setParameter(1, true)\n ->setParameter(2, $id)\n ->getQuery();\n\n $query->execute();\n }", "public function setOwnerId($value) \n {\n $this->_fields['OwnerId']['FieldValue'] = $value;\n return $this;\n }", "public function setUserIdAttribute($input)\n {\n $this->attributes['user_id'] = $input ? $input : null;\n }", "public function setUserIdAttribute($input)\n {\n $this->attributes['user_id'] = $input ? $input : null;\n }", "function setIdentity($user);", "public function setIdentity($value)\n {\n $canonicalName = $this->getCanonicalAccountName($value);\n \n $this->_identity = $canonicalName;\n return $this;\n }", "public function setOnPremisesSecurityIdentifier(?string $value): void {\n $this->getBackingStore()->set('onPremisesSecurityIdentifier', $value);\n }", "public function setIdentityName(?string $name);", "public function it_has_a_readonly_user_id()\n {\n $this->getUserId();\n }", "public function setAccountManagerIdAttribute($input)\n {\n $this->attributes['account_manager_id'] = $input ? $input : null;\n }", "public function setIdentity($identity);", "protected function setIdentity($id) {\n $headers = array(\n 'Authorization' => 'OAuth ' . $this->getAccessToken(),\n 'Content-type' => 'application/json',\n );\n $response = $this->httpRequest($id, NULL, $headers);\n if ($response->code != 200) {\n throw new SalesforceException(t('Unable to access identity service.'), $response->code);\n }\n $data = drupal_json_decode($response->data);\n variable_set('salesforce_identity', $data);\n }", "public function setId($value) {\n // insist that an ID be present\n if (empty($value))\n throw new InvalidArgumentException('An Id must have a value');\n $this->id = $value;\n return $this;\n }", "public function setOwnerId($newVal) {\n $this->ownerId = $newVal;\n }", "#[@arg(name= 'id')]\n public function setPersonId($personId) {\n $this->account->setPerson_id($personId);\n }", "public function setAssignedUserIdAttribute($input)\n {\n $this->attributes['assigned_user_id'] = $input ? $input : null;\n }", "public function setIdentity($value)\n {\n $this->_identity = $value;\n return $this;\n }", "public function setIdentity($value)\n {\n $this->_identity = $value;\n return $this;\n }", "public function setIdentity($value)\n {\n $this->_identity = $value;\n return $this;\n }", "public function setIdentityToken(string $token) : self {\n $this->identityToken = $token;\n\n return $this;\n }", "public function setOwnerUserId($ownerUserId);", "public function setId($value) {\n if (empty($value))\n throw new InvalidArgumentException('An Id must have a value');\n $this->id = $value;\n return $this;\n }", "Public function set_id_membre ($idm)\n\t\t\t{\n\t\t\t\t $this-> id_membre = $idm;\n\t\t\t}", "function setIdentity(?IIdentity $identity);", "public function setIdUser($id_user)\n {\n $this->id_user = $id_user;\n\n return $this;\n }", "public function setOnPremisesUserPrincipalName(?string $value): void {\n $this->getBackingStore()->set('onPremisesUserPrincipalName', $value);\n }", "public function setIdentityToken(?string $identityToken) : self\n {\n $this->identityToken = $identityToken;\n return $this;\n }", "function setUserId($userId) {\n\t\treturn $this->setData('userId', $userId);\n\t}" ]
[ "0.502721", "0.49139196", "0.48181862", "0.47894654", "0.47459832", "0.47459832", "0.47093064", "0.47050473", "0.46886376", "0.46166208", "0.4610359", "0.46034306", "0.45957986", "0.45840332", "0.45635587", "0.45580333", "0.45430243", "0.4538857", "0.4535714", "0.4535714", "0.4535714", "0.45335752", "0.45150822", "0.4514799", "0.44925144", "0.44850817", "0.44725028", "0.4457496", "0.4454368", "0.44205377" ]
0.6762361
0
Sets the onPremisesLastSyncDateTime property value. Indicates the last time at which the object was synced with the onpremises directory; for example: '20130216T03:04:54Z'. The Timestamp type represents date and time information using ISO 8601 format and is always in UTC time. For example, midnight UTC on Jan 1, 2014 is 20140101T00:00:00Z. Readonly. Supports $filter (eq, ne, not, ge, le, in).
public function setOnPremisesLastSyncDateTime(?DateTime $value): void { $this->getBackingStore()->set('onPremisesLastSyncDateTime', $value); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function setOnPremisesLastPasswordSyncDateTime(?DateTime $value): void {\n $this->getBackingStore()->set('onPremisesLastPasswordSyncDateTime', $value);\n }", "public function setLastSync($v)\n {\n $dt = PropelDateTime::newInstance($v, null, 'DateTime');\n if ($this->last_sync !== null || $dt !== null) {\n $currentDateAsString = ($this->last_sync !== null && $tmpDt = new DateTime($this->last_sync)) ? $tmpDt->format('Y-m-d H:i:s') : null;\n $newDateAsString = $dt ? $dt->format('Y-m-d H:i:s') : null;\n if ( ($currentDateAsString !== $newDateAsString) // normalized values don't match\n || ($dt->format('Y-m-d H:i:s') === '1901-01-01 00:00:00') // or the entered value matches the default\n ) {\n $this->last_sync = $newDateAsString;\n $this->modifiedColumns[] = YayasanPeer::LAST_SYNC;\n }\n } // if either are not null\n\n\n return $this;\n }", "public function setLastSyncDateTime($val)\n {\n $this->_propDict[\"lastSyncDateTime\"] = $val;\n return $this;\n }", "public function setLastSync($v)\n {\n $dt = PropelDateTime::newInstance($v, null, 'DateTime');\n if ($this->last_sync !== null || $dt !== null) {\n $currentDateAsString = ($this->last_sync !== null && $tmpDt = new DateTime($this->last_sync)) ? $tmpDt->format('Y-m-d H:i:s') : null;\n $newDateAsString = $dt ? $dt->format('Y-m-d H:i:s') : null;\n if ( ($currentDateAsString !== $newDateAsString) // normalized values don't match\n || ($dt->format('Y-m-d H:i:s') === '1901-01-01 00:00:00') // or the entered value matches the default\n ) {\n $this->last_sync = $newDateAsString;\n $this->modifiedColumns[] = JurusanSpPeer::LAST_SYNC;\n }\n } // if either are not null\n\n\n return $this;\n }", "public function setLastSync($v)\n {\n $dt = PropelDateTime::newInstance($v, null, 'DateTime');\n if ($this->last_sync !== null || $dt !== null) {\n $currentDateAsString = ($this->last_sync !== null && $tmpDt = new DateTime($this->last_sync)) ? $tmpDt->format('Y-m-d H:i:s') : null;\n $newDateAsString = $dt ? $dt->format('Y-m-d H:i:s') : null;\n if ( ($currentDateAsString !== $newDateAsString) // normalized values don't match\n || ($dt->format('Y-m-d H:i:s') === '1901-01-01 00:00:00') // or the entered value matches the default\n ) {\n $this->last_sync = $newDateAsString;\n $this->modifiedColumns[] = JenisPtkPeer::LAST_SYNC;\n }\n } // if either are not null\n\n\n return $this;\n }", "public function setLastSync($v)\n {\n $dt = PropelDateTime::newInstance($v, null, 'DateTime');\n if ($this->last_sync !== null || $dt !== null) {\n $currentDateAsString = ($this->last_sync !== null && $tmpDt = new DateTime($this->last_sync)) ? $tmpDt->format('Y-m-d H:i:s') : null;\n $newDateAsString = $dt ? $dt->format('Y-m-d H:i:s') : null;\n if ( ($currentDateAsString !== $newDateAsString) // normalized values don't match\n || ($dt->format('Y-m-d H:i:s') === '1901-01-01 00:00:00') // or the entered value matches the default\n ) {\n $this->last_sync = $newDateAsString;\n $this->modifiedColumns[] = PtkPeer::LAST_SYNC;\n }\n } // if either are not null\n\n\n return $this;\n }", "public function setLastSync($v)\n {\n $dt = PropelDateTime::newInstance($v, null, 'DateTime');\n if ($this->last_sync !== null || $dt !== null) {\n $currentDateAsString = ($this->last_sync !== null && $tmpDt = new DateTime($this->last_sync)) ? $tmpDt->format('Y-m-d H:i:s') : null;\n $newDateAsString = $dt ? $dt->format('Y-m-d H:i:s') : null;\n if ( ($currentDateAsString !== $newDateAsString) // normalized values don't match\n || ($dt->format('Y-m-d H:i:s') === '1901-01-01 00:00:00') // or the entered value matches the default\n ) {\n $this->last_sync = $newDateAsString;\n $this->modifiedColumns[] = RegistrasiPesertaDidikPeer::LAST_SYNC;\n }\n } // if either are not null\n\n\n return $this;\n }", "public function getLastSyncDateTime()\n {\n if (array_key_exists(\"lastSyncDateTime\", $this->_propDict)) {\n if (is_a($this->_propDict[\"lastSyncDateTime\"], \"\\DateTime\") || is_null($this->_propDict[\"lastSyncDateTime\"])) {\n return $this->_propDict[\"lastSyncDateTime\"];\n } else {\n $this->_propDict[\"lastSyncDateTime\"] = new \\DateTime($this->_propDict[\"lastSyncDateTime\"]);\n return $this->_propDict[\"lastSyncDateTime\"];\n }\n }\n return null;\n }", "public function getOnPremisesLastSyncDateTime(): ?DateTime {\n $val = $this->getBackingStore()->get('onPremisesLastSyncDateTime');\n if (is_null($val) || $val instanceof DateTime) {\n return $val;\n }\n throw new \\UnexpectedValueException(\"Invalid type found in backing store for 'onPremisesLastSyncDateTime'\");\n }", "public function getOnPremisesLastSyncDateTime(): ?DateTime {\n $val = $this->getBackingStore()->get('onPremisesLastSyncDateTime');\n if (is_null($val) || $val instanceof DateTime) {\n return $val;\n }\n throw new \\UnexpectedValueException(\"Invalid type found in backing store for 'onPremisesLastSyncDateTime'\");\n }", "public function setLastDynamicsSync(): void;", "public function filterByLastSync($lastSync = null, $comparison = null)\n {\n if (is_array($lastSync)) {\n $useMinMax = false;\n if (isset($lastSync['min'])) {\n $this->addUsingAlias(SertifikasiPdPeer::LAST_SYNC, $lastSync['min'], Criteria::GREATER_EQUAL);\n $useMinMax = true;\n }\n if (isset($lastSync['max'])) {\n $this->addUsingAlias(SertifikasiPdPeer::LAST_SYNC, $lastSync['max'], Criteria::LESS_EQUAL);\n $useMinMax = true;\n }\n if ($useMinMax) {\n return $this;\n }\n if (null === $comparison) {\n $comparison = Criteria::IN;\n }\n }\n\n return $this->addUsingAlias(SertifikasiPdPeer::LAST_SYNC, $lastSync, $comparison);\n }", "public function filterByLastSync($lastSync = null, $comparison = null)\n {\n if (is_array($lastSync)) {\n $useMinMax = false;\n if (isset($lastSync['min'])) {\n $this->addUsingAlias(BentukPendidikanPeer::LAST_SYNC, $lastSync['min'], Criteria::GREATER_EQUAL);\n $useMinMax = true;\n }\n if (isset($lastSync['max'])) {\n $this->addUsingAlias(BentukPendidikanPeer::LAST_SYNC, $lastSync['max'], Criteria::LESS_EQUAL);\n $useMinMax = true;\n }\n if ($useMinMax) {\n return $this;\n }\n if (null === $comparison) {\n $comparison = Criteria::IN;\n }\n }\n\n return $this->addUsingAlias(BentukPendidikanPeer::LAST_SYNC, $lastSync, $comparison);\n }", "public function setLastUpdateDateTime(?DateTime $value): void {\n $this->getBackingStore()->set('lastUpdateDateTime', $value);\n }", "public function setMicrosoftStoreForBusinessLastSuccessfulSyncDateTime(?DateTime $value): void {\n $this->getBackingStore()->set('microsoftStoreForBusinessLastSuccessfulSyncDateTime', $value);\n }", "public function setLastContactedDateTime(?DateTime $value): void {\n $this->getBackingStore()->set('lastContactedDateTime', $value);\n }", "public function getOnPremisesLastPasswordSyncDateTime(): ?DateTime {\n $val = $this->getBackingStore()->get('onPremisesLastPasswordSyncDateTime');\n if (is_null($val) || $val instanceof DateTime) {\n return $val;\n }\n throw new \\UnexpectedValueException(\"Invalid type found in backing store for 'onPremisesLastPasswordSyncDateTime'\");\n }", "public function setMicrosoftStoreForBusinessLastCompletedApplicationSyncTime(?DateTime $value): void {\n $this->getBackingStore()->set('microsoftStoreForBusinessLastCompletedApplicationSyncTime', $value);\n }", "public function setLastDataUpdateAt(\\DateTime $lastDataUpdateAt = null)\n {\n $this->lastDataUpdateAt = $lastDataUpdateAt;\n }", "public function setLastSeenDateTime(?DateTime $value): void {\n $this->getBackingStore()->set('lastSeenDateTime', $value);\n }", "public function setSyncDateExif(string $syncDate): void\n {\n $this->syncDateExif = $syncDate;\n }", "public function setLastUpdateDateTime($val)\n {\n $this->_propDict[\"lastUpdateDateTime\"] = $val;\n return $this;\n }", "public function setLastModifiedDateTime(?DateTime $value): void {\n $this->getBackingStore()->set('lastModifiedDateTime', $value);\n }", "public function setLastModifiedDateTime(?DateTime $value): void {\n $this->getBackingStore()->set('lastModifiedDateTime', $value);\n }", "public function setLastModifiedDateTime(?DateTime $value): void {\n $this->getBackingStore()->set('lastModifiedDateTime', $value);\n }", "public function setLastModifiedDateTime(?DateTime $value): void {\n $this->getBackingStore()->set('lastModifiedDateTime', $value);\n }", "public function setLastModifiedDateTime(?DateTime $value): void {\n $this->getBackingStore()->set('lastModifiedDateTime', $value);\n }", "public function setLastModifiedDateTime(?DateTime $value): void {\n $this->getBackingStore()->set('lastModifiedDateTime', $value);\n }", "public function setLastModifiedDateTime(?DateTime $value): void {\n $this->getBackingStore()->set('lastModifiedDateTime', $value);\n }", "public function setLastModifiedDateTime(?DateTime $value): void {\n $this->getBackingStore()->set('lastModifiedDateTime', $value);\n }" ]
[ "0.66942835", "0.63440937", "0.63332397", "0.62718695", "0.6222668", "0.62152666", "0.61411226", "0.59778637", "0.5771516", "0.5771516", "0.5731783", "0.56436324", "0.55448735", "0.5500933", "0.5481244", "0.54598445", "0.5342478", "0.52846366", "0.52148044", "0.51118594", "0.50849456", "0.5076677", "0.5050473", "0.5050473", "0.5050473", "0.5050473", "0.5050473", "0.5050473", "0.5050473", "0.5050473" ]
0.73056895
1
Sets the onPremisesSamAccountName property value. Contains the onpremises sAMAccountName synchronized from the onpremises directory. The property is only populated for customers who are synchronizing their onpremises directory to Azure Active Directory via Azure AD Connect. Readonly. Supports $filter (eq, ne, not, ge, le, in, startsWith).
public function setOnPremisesSamAccountName(?string $value): void { $this->getBackingStore()->set('onPremisesSamAccountName', $value); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function setOnPremisesUserPrincipalName(?string $value): void {\n $this->getBackingStore()->set('onPremisesUserPrincipalName', $value);\n }", "public function setAccountName($value)\n {\n $this->_azureTableUtil->setAccountName($value);\n }", "public function setAccountName($value)\n {\n return $this->set('AccountName', $value);\n }", "public function setAccountName($value)\n {\n return $this->set('AccountName', $value);\n }", "public function setAccountName($value)\n {\n return $this->set('AccountName', $value);\n }", "public function setAccountName($value)\n {\n return $this->set('AccountName', $value);\n }", "public function setOnPremisesDomainName(?string $value): void {\n $this->getBackingStore()->set('onPremisesDomainName', $value);\n }", "public function setOnPremisesConnectionName(?string $value): void {\n $this->getBackingStore()->set('onPremisesConnectionName', $value);\n }", "public function getOnPremisesSamAccountName(): ?string {\n $val = $this->getBackingStore()->get('onPremisesSamAccountName');\n if (is_null($val) || is_string($val)) {\n return $val;\n }\n throw new \\UnexpectedValueException(\"Invalid type found in backing store for 'onPremisesSamAccountName'\");\n }", "public function setExternalAccountName($a_name)\n\t{\n\t\t$this->migration_account = $a_name;\n\t}", "public function setAccountName($accountName) {\n $this->accountName = $accountName;\n }", "public function setOnPremisesDistinguishedName(?string $value): void {\n $this->getBackingStore()->set('onPremisesDistinguishedName', $value);\n }", "public function setOnPremisesSecurityIdentifier(?string $value): void {\n $this->getBackingStore()->set('onPremisesSecurityIdentifier', $value);\n }", "public function setFirstName($value)\n {\n Yii::trace('setFirstName()', 'application.components.RinkfinderWebUser');\n\t$this->setState('__firstName', $value);\n }", "public function setIdentity($value)\n {\n $canonicalName = $this->getCanonicalAccountName($value);\n \n $this->_identity = $canonicalName;\n return $this;\n }", "public function setFirstNameAttribute($value)\n {\n $this->attributes['first_name'] = strtolower($value);\n }", "public function setFirstNameAttribute($value)\n {\n $this->attributes['first_name'] = strtolower($value);\n }", "public function setUseFirstName($v)\n\t{\n\t\tif ($v !== null) {\n\t\t\t$v = (string) $v;\n\t\t}\n\n\t\tif ($this->use_first_name !== $v) {\n\t\t\t$this->use_first_name = $v;\n\t\t\t$this->modifiedColumns[] = UsersPeer::USE_FIRST_NAME;\n\t\t}\n\n\t\treturn $this;\n\t}", "public function setAccountName($accountName)\n {\n $this->setProperty(self::ACCOUNT_NAME, $accountName);\n\n return $this;\n }", "public function setOnPremisesSipInfo(?OnPremisesSipInfo $value): void {\n $this->getBackingStore()->set('onPremisesSipInfo', $value);\n }", "public function setOnPremisesSyncEnabled(?bool $value): void {\n $this->getBackingStore()->set('onPremisesSyncEnabled', $value);\n }", "public function setOnPremisesSyncEnabled(?bool $value): void {\n $this->getBackingStore()->set('onPremisesSyncEnabled', $value);\n }", "public function setFirstNameAttribute($value) {\n\t\t$this->attributes['first_name'] = mb_convert_case(mb_strtolower($value, \"UTF-8\"), MB_CASE_TITLE, \"UTF-8\");\n\t}", "public function setFirstNameAttribute($value) {\n $this->attributes['first_name'] = ucfirst($value);\n }", "public function setFirstNameAttribute($value) {\n $this->attributes['first_name'] = ucfirst($value);\n }", "public function setEmailAttribute($value)\n {\n $this->attributes['email'] = Str::lower($value);\n }", "public function getOnPremisesUserPrincipalName(): ?string {\n $val = $this->getBackingStore()->get('onPremisesUserPrincipalName');\n if (is_null($val) || is_string($val)) {\n return $val;\n }\n throw new \\UnexpectedValueException(\"Invalid type found in backing store for 'onPremisesUserPrincipalName'\");\n }", "public function setFirstName($value)\n {\n $this->firstName = $value;\n }", "protected function setFirstName($first_name) {\r\n $this->first_name = $first_name;\r\n }", "public function setAccount(string $ZCashAddress, string $account)\n {\n return $this->__call('setaccount', [$ZCashAddress, $account]);\n }" ]
[ "0.6347733", "0.60840845", "0.5821469", "0.5821469", "0.5821469", "0.5821469", "0.55488473", "0.55130523", "0.53078336", "0.5125942", "0.5114261", "0.50432074", "0.49833426", "0.49082536", "0.4761466", "0.47289103", "0.47289103", "0.46984223", "0.46862477", "0.4638037", "0.46280414", "0.46280414", "0.46273604", "0.4627065", "0.4627065", "0.45333752", "0.4506101", "0.44856077", "0.44686475", "0.44628376" ]
0.72835916
0
Sets the onPremisesSecurityIdentifier property value. Contains the onpremises security identifier (SID) for the user that was synchronized from onpremises to the cloud. Readonly. Supports $filter (eq including on null values).
public function setOnPremisesSecurityIdentifier(?string $value): void { $this->getBackingStore()->set('onPremisesSecurityIdentifier', $value); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function setOnPremisesUserPrincipalName(?string $value): void {\n $this->getBackingStore()->set('onPremisesUserPrincipalName', $value);\n }", "public function setOnPremisesSamAccountName(?string $value): void {\n $this->getBackingStore()->set('onPremisesSamAccountName', $value);\n }", "public function setOnPremisesSipInfo(?OnPremisesSipInfo $value): void {\n $this->getBackingStore()->set('onPremisesSipInfo', $value);\n }", "public function setSecurityIdentifier(?string $value): void {\n $this->getBackingStore()->set('securityIdentifier', $value);\n }", "public function getOnPremisesSecurityIdentifier(): ?string {\n $val = $this->getBackingStore()->get('onPremisesSecurityIdentifier');\n if (is_null($val) || is_string($val)) {\n return $val;\n }\n throw new \\UnexpectedValueException(\"Invalid type found in backing store for 'onPremisesSecurityIdentifier'\");\n }", "public function setIdentity($identifier)\n {\n $this->souls->identity = $identifier;\n }", "public function setOnPremisesConnectionName(?string $value): void {\n $this->getBackingStore()->set('onPremisesConnectionName', $value);\n }", "public function setOnPremisesDomainName(?string $value): void {\n $this->getBackingStore()->set('onPremisesDomainName', $value);\n }", "public function setOnPremisesImmutableId(?string $value): void {\n $this->getBackingStore()->set('onPremisesImmutableId', $value);\n }", "public function setIdentityToken(string $token) : self {\n $this->identityToken = $token;\n\n return $this;\n }", "public function setIdentityToken(?string $identityToken) : self\n {\n $this->identityToken = $identityToken;\n return $this;\n }", "public function setIdentity($value)\n {\n $canonicalName = $this->getCanonicalAccountName($value);\n \n $this->_identity = $canonicalName;\n return $this;\n }", "public function getSecurityId()\n\t{\n\t\treturn $this->securityId;\n\t}", "public function setOnPremisesDistinguishedName(?string $value): void {\n $this->getBackingStore()->set('onPremisesDistinguishedName', $value);\n }", "public function setSourceIdentity(?ProvisionedIdentity $value): void {\n $this->getBackingStore()->set('sourceIdentity', $value);\n }", "public function setIdentity($data);", "public function setServiceProvider($serviceProviderIdentifier) {\r\n\t\t$this->auth = new SimpleSAML_Auth_Simple($serviceProviderIdentifier);\r\n\t}", "public function setOnPremisesExtensionAttributes(?OnPremisesExtensionAttributes $value): void {\n $this->getBackingStore()->set('onPremisesExtensionAttributes', $value);\n }", "public function setSecurityId($newSecurityId){\n\t\t//allow the securityId to be null if a new object\n\t\tif($newSecurityId === null){\n\t\t\t$this->securityId = null;\n\t\t\treturn;\n\t\t}\n\n\t\t//ensure securityId is an integer\n\t\tif(filter_var($newSecurityId, FILTER_VALIDATE_INT) === false){\n\t\t\tthrow(new UnexpectedValueException(\"security id $newSecurityId is not numeric\"));\n\t\t}\n\n\t\t//enforce security id is an int and positive\n\t\t$newSecurityId = intval($newSecurityId);\n\t\tif($newSecurityId <= 0) {\n\t\t\tthrow(new RangeException(\"security id $newSecurityId is not positive\"));\n\t\t}\n\n\t\t//assign securityId\n\t\t$this->securityId = $newSecurityId;\n\t}", "private function setIdentity(){\n\t\t$config = $this->config->item('ion_auth');\n\t\t$this->_identity = $config['identity'];\n\n\t\t$this->_user = $this->ion_auth->user()->row();\n\t}", "protected function setIdentity(Identity $identity)\n {\n $this->identity = true;\n }", "public function set_Primary_ID($primary_in) {\n $this->primary = $primary_in;\n }", "public function setIdentity($identity);", "public function setIdProvSedeIdAttribute($input)\n {\n $this->attributes['id_prov_sede_id'] = $input ? $input : null;\n }", "public function setAttackSimUserId(?string $value): void {\n $this->getBackingStore()->set('attackSimUserId', $value);\n }", "public function issn($value)\n {\n $this->setProperty('issn', $value);\n return $this;\n }", "public function setIdentityProviderId(?string $identityProviderId) : self\n {\n $this->initialized['identityProviderId'] = true;\n $this->identityProviderId = $identityProviderId;\n return $this;\n }", "public function setUserIdentifier($identifier): void\n {\n $this->user_id = $identifier;\n }", "public function setIdentity($value)\n {\n $this->_identity = $value;\n return $this;\n }", "public function setIdentity($value)\n {\n $this->_identity = $value;\n return $this;\n }" ]
[ "0.5775927", "0.57487833", "0.5379941", "0.5180259", "0.516842", "0.51564056", "0.5108599", "0.5088619", "0.4875084", "0.48655075", "0.46993053", "0.4552673", "0.45435828", "0.44861135", "0.44655356", "0.44411147", "0.4392552", "0.43566078", "0.43385822", "0.43373382", "0.43174505", "0.42143628", "0.4205038", "0.4198993", "0.41980538", "0.4178156", "0.41591987", "0.4152688", "0.41509494", "0.41509494" ]
0.74286276
0
Sets the onPremisesSipInfo property value. Contains all onpremises Session Initiation Protocol (SIP) information related to the user. Readonly.
public function setOnPremisesSipInfo(?OnPremisesSipInfo $value): void { $this->getBackingStore()->set('onPremisesSipInfo', $value); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getOnPremisesSipInfo(): ?OnPremisesSipInfo {\n $val = $this->getBackingStore()->get('onPremisesSipInfo');\n if (is_null($val) || $val instanceof OnPremisesSipInfo) {\n return $val;\n }\n throw new \\UnexpectedValueException(\"Invalid type found in backing store for 'onPremisesSipInfo'\");\n }", "public function setOnPremisesSecurityIdentifier(?string $value): void {\n $this->getBackingStore()->set('onPremisesSecurityIdentifier', $value);\n }", "public function setOnPremisesSamAccountName(?string $value): void {\n $this->getBackingStore()->set('onPremisesSamAccountName', $value);\n }", "public function setUserInfo($info)\r\n {\r\n $this->userInfo = $info;\r\n $this->message .= \" [User Info: \" .$this->userInfo . \"]\";\r\n }", "public function setOnPremisesUserPrincipalName(?string $value): void {\n $this->getBackingStore()->set('onPremisesUserPrincipalName', $value);\n }", "public function setOnPremisesConnectionName(?string $value): void {\n $this->getBackingStore()->set('onPremisesConnectionName', $value);\n }", "public function setInfo($info) {\n $this->_info = $info;\n }", "public function setUserInfo($userinfo)\n {\n $this->userinfo = $userinfo;\n }", "public function setSenderInfo(array $senderInfo)\n {\n $senderEmail = $this->sandbox ? '[email protected]' : $this->sanitize($senderInfo, 'senderEmail');\n\n $senderPhone = $this->sanitizeNumber($senderInfo, 'senderPhone');\n\n $senderInfo = [\n 'senderName' => $this->sanitize($senderInfo, 'senderName'),\n 'senderAreaCode' => substr($senderPhone, 0, 2),\n 'senderPhone' => substr($senderPhone, 2),\n 'senderEmail' => $senderEmail,\n 'senderHash' => $this->checkValue($senderInfo, 'senderHash'),\n 'senderCNPJ' => $this->sanitizeNumber($senderInfo, 'senderCNPJ'),\n 'senderCPF' => $this->sanitizeNumber($senderInfo, 'senderCPF'),\n ];\n\n $this->validateSenderInfo($senderInfo);\n $this->senderInfo = $senderInfo;\n\n return $this;\n }", "public function setIp($ip)\n {\n if ($ip) {\n $this->ip = $ip;\n } elseif (!$this->ip) {\n if ($ip = $this->request->server('HTTP_CF_CONNECTING_IP')) {\n $this->ip = $ip;\n } elseif ($ip = $this->request->server->get('HTTP_X_FORWARDED_FOR')) {\n $this->ip = $ip;\n } elseif ($ip = $this->request->getClientIp()) {\n $this->ip = $ip;\n }\n }\n }", "public static function SetTrackInfo($sInfo)\n\t{\n\t\tself::$m_sInfo = $sInfo;\n\t}", "public function setServer($sAddress) {\n $this->m_aSocketInfo ['RemoteIP'] = $sAddress;\n }", "public function setNip($nip);", "public function set_ip(string $ip = null)\n {\n if (!empty($ip)) {\n Ipvalidation::validate($ip);\n $this->ip = (string)$ip;\n } else {\n // check if the user have one of this keys\n foreach (array('REMOTE_ADDR', 'HTTP_X_FORWARDED', 'HTTP_X_FORWARDED_FOR', 'HTTP_X_CLUSTER_CLIENT_IP', 'HTTP_FORWARDED_FOR', 'HTTP_FORWARDED', 'HTTP_CLIENT_IP') as $key) {\n if (array_key_exists($key, $_SERVER) === true) {\n foreach (explode(',', $_SERVER[$key]) as $ips) {\n Ipvalidation::validate($ips);\n $this->ip = (string)$ips;\n }\n }\n }\n }\n return $this;\n }", "public function set_ip($ip)\n {\n $this->set_default_property(self::PROPERTY_IP, $ip);\n }", "public function setCalSupInfo($id_supinfo, $id_resource, $name, $mandatory) {\n\n if ($this->isCalSupInfoId($id_supinfo, $id_resource)) {\n $this->updateCalSupInfo($id_supinfo, $id_resource, $name, $mandatory);\n } else {\n $this->addCalSupInfo($id_supinfo, $id_resource, $name, $mandatory);\n }\n }", "public function setAfiSafis($var)\n\t{\n\t\t$arr = GPBUtil::checkRepeatedField($var, \\Google\\Protobuf\\Internal\\GPBType::MESSAGE, \\Gobgpapi\\AfiSafi::class);\n\t\t$this->afi_safis = $arr;\n\n\t\treturn $this;\n\t}", "public function setUserIP($userip) {\r\n\t\t$this->_comment['user_ip'] = $userip;\r\n\t}", "private function _set_ip() {\n\t\tif (!property_exists($this->application,'ip')) {\n\t\t\tif (!$this->application->property_exists('ip')) {\n\t\t\t\tif (isset($_SERVER['REMOTE_ADDR'])) {\n\t\t\t\t\t$this->application->ip = $_SERVER['REMOTE_ADDR'];\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t$this->_set_ip_null_check();\n\t\t\t}\n\t\t} else {\n\t\t\t$this->_set_ip_null_check();\n\t\t}\n\t}", "function setInfo($info);", "public function set_wins_server($ip)\n {\n clearos_profile(__METHOD__, __LINE__);\n\n Validation_Exception::is_valid($this->validate_wins_server($ip));\n\n $this->_set_dhcp_parameter('WINS', $ip);\n }", "public function setinfo($info)\n {\n $this->info = $info;\n\n return $this;\n }", "public function setOnPremisesExtensionAttributes(?OnPremisesExtensionAttributes $value): void {\n $this->getBackingStore()->set('onPremisesExtensionAttributes', $value);\n }", "public function setPaymentMethodInfo($methodinfo);", "public function setInfo($info)\n {\n # Bring the content instance into scope.\n $main_content = Content::getInstance();\n\n # Check if the passed value is empty.\n if (!empty($info)) {\n # The the site name.\n $site_name = $main_content->getSiteName();\n # Strip slashes, convert new lines to <br /> and decode any html entities.\n $info = html_entity_decode(nl2br(stripslashes($info)), ENT_COMPAT, 'UTF-8');\n # Clean it up.\n $info = trim($info);\n # Replace any tokens with their correlating value.\n $info = str_ireplace(array('%{domain_name}', '%{site_name}', '%{fw_popup_handle}'),\n array(DOMAIN_NAME, $site_name, FW_POPUP_HANDLE), $info);\n } else {\n # Explicitly set the value to NULL.\n $info = null;\n }\n # Set the data member.\n $this->info = $info;\n }", "public function setMemberInfo($infoAuth)\n\t{\n\t\t$this->_session->member = $infoAuth;\n\t}", "public function setIpAddress($ip);", "private function setSenderPhone()\n {\n $addressData = ($this->getBillingAddress())\n ? $this->getBillingAddress()\n : $this->_checkoutSession->getLastRealOrder()->getShippingAddress();\n\n if (! empty($addressData['telephone'])) {\n $phone = \\UOL\\PagSeguro\\Helper\\Data::formatPhone($addressData['telephone']);\n $this->_paymentRequest->setSender()->setPhone()->withParameters(\n $phone['areaCode'],\n $phone['number']\n );\n }\n }", "public function setDottedInfo($info)\n {\n $this->info = $info;\n \n return true;\n }", "public function getUserInfo($userInfo)\n {\n $this->userInfo = $userInfo;\n }" ]
[ "0.612798", "0.54001874", "0.5155656", "0.4890456", "0.48773056", "0.44900593", "0.44735026", "0.4452822", "0.44510615", "0.43680894", "0.4330445", "0.4316205", "0.43116614", "0.4261559", "0.42458975", "0.42260066", "0.42182225", "0.42115694", "0.41912562", "0.41859087", "0.41818503", "0.4178009", "0.41711944", "0.41676196", "0.41633603", "0.41584682", "0.4146466", "0.41411904", "0.41332278", "0.41259193" ]
0.83455753
0
Sets the onPremisesSyncEnabled property value. true if this user object is currently being synced from an onpremises Active Directory (AD); otherwise the user isn't being synced and can be managed in Azure Active Directory (Azure AD). Readonly. Supports $filter (eq, ne, not, in, and eq on null values).
public function setOnPremisesSyncEnabled(?bool $value): void { $this->getBackingStore()->set('onPremisesSyncEnabled', $value); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function setSynchronizeUpnForManagedUsersEnabled(?bool $value): void {\n $this->getBackingStore()->set('synchronizeUpnForManagedUsersEnabled', $value);\n }", "public function setCloudPasswordPolicyForPasswordSyncedUsersEnabled(?bool $value): void {\n $this->getBackingStore()->set('cloudPasswordPolicyForPasswordSyncedUsersEnabled', $value);\n }", "public function setIsSync($var)\n {\n GPBUtil::checkBool($var);\n $this->isSync = $var;\n\n return $this;\n }", "public function setPasswordSyncEnabled(?bool $value): void {\n $this->getBackingStore()->set('passwordSyncEnabled', $value);\n }", "public function oisSyncEnabled($coId) {\n // Note we flip the value. The data model specifies \"disabled\" so that\n // the default (ie: no value present in the table) is enabled.\n return !$this->lookupValue($coId, 'disable_ois_sync');\n }", "public function setCalendarSyncEnabled($val)\n {\n $this->_propDict[\"calendarSyncEnabled\"] = $val;\n return $this;\n }", "public function setBypassDirSyncOverridesEnabled(?bool $value): void {\n $this->getBackingStore()->set('bypassDirSyncOverridesEnabled', $value);\n }", "public function setSyncContacts(?bool $value): void {\n $this->getBackingStore()->set('syncContacts', $value);\n }", "public function setSoftMatchOnUpnEnabled(?bool $value): void {\n $this->getBackingStore()->set('softMatchOnUpnEnabled', $value);\n }", "public function getOnPremisesSyncEnabled(): ?bool {\n $val = $this->getBackingStore()->get('onPremisesSyncEnabled');\n if (is_null($val) || is_bool($val)) {\n return $val;\n }\n throw new \\UnexpectedValueException(\"Invalid type found in backing store for 'onPremisesSyncEnabled'\");\n }", "public function getOnPremisesSyncEnabled(): ?bool {\n $val = $this->getBackingStore()->get('onPremisesSyncEnabled');\n if (is_null($val) || is_bool($val)) {\n return $val;\n }\n throw new \\UnexpectedValueException(\"Invalid type found in backing store for 'onPremisesSyncEnabled'\");\n }", "public function enabled($enabled)\n\t{\n\t\t$this->_userEnabled = (bool) $enabled;\n\t}", "public function getCalendarSyncEnabled()\n {\n if (array_key_exists(\"calendarSyncEnabled\", $this->_propDict)) {\n return $this->_propDict[\"calendarSyncEnabled\"];\n } else {\n return null;\n }\n }", "public function setOnPremisesLastSyncDateTime(?DateTime $value): void {\n $this->getBackingStore()->set('onPremisesLastSyncDateTime', $value);\n }", "public function setOnPremisesLastSyncDateTime(?DateTime $value): void {\n $this->getBackingStore()->set('onPremisesLastSyncDateTime', $value);\n }", "public function setOnPremisesSynchronization(?array $value): void {\n $this->getBackingStore()->set('onPremisesSynchronization', $value);\n }", "public function setAccountEnabled(?bool $value): void {\n $this->getBackingStore()->set('accountEnabled', $value);\n }", "public function set_enabled($enabled){\n\t\t$this->filter->set_enabled($enabled);\n\t}", "public function setUserForcePasswordChangeOnLogonEnabled(?bool $value): void {\n $this->getBackingStore()->set('userForcePasswordChangeOnLogonEnabled', $value);\n }", "public function setSyncMailChimp($sync = false) {\n $this->_syncMailChimp = (empty($sync)) ? false : true;\n }", "public function setIsMembershipLimitedToOwners(?bool $value): void {\n $this->getBackingStore()->set('isMembershipLimitedToOwners', $value);\n }", "public function getIsSync()\n {\n return $this->isSync;\n }", "public function setStatusInSyncBackend($_accountId, $_status)\n {\n if ($this->_isReadOnlyBackend) {\n return;\n }\n \n $metaData = $this->_getMetaData($_accountId);\n \n if ($_status == 'enabled') {\n $ldapData = array(\n 'useraccountcontrol' => $metaData['useraccountcontrol'][0] &= ~self::ACCOUNTDISABLE\n );\n if ($this->_options['useRfc2307']) {\n $ldapData = array_merge($ldapData, array(\n 'shadowMax' => 999999,\n 'shadowInactive' => array()\n ));\n }\n } else {\n $ldapData = array(\n 'useraccountcontrol' => $metaData['useraccountcontrol'][0] |= self::ACCOUNTDISABLE\n );\n if ($this->_options['useRfc2307']) {\n $ldapData = array_merge($ldapData, array(\n 'shadowMax' => 1,\n 'shadowInactive' => 1\n ));\n }\n }\n\n foreach ($this->_ldapPlugins as $plugin) {\n /** @var Tinebase_User_LdapPlugin_Interface $plugin */\n $plugin->inspectStatus($_status, $ldapData);\n }\n\n if (Core::isLogLevel(LogLevel::TRACE)) \n Core::getLogger()->trace(__METHOD__ . '::' . __LINE__ . \" {$metaData['dn']} ldapData: \" . print_r($ldapData, true));\n\n $this->_ldap->update($metaData['dn'], $ldapData);\n }", "public function supportsForceSync()\n {\n return false;\n }", "public function setOnPremisesLastPasswordSyncDateTime(?DateTime $value): void {\n $this->getBackingStore()->set('onPremisesLastPasswordSyncDateTime', $value);\n }", "public function sync($sync = null)\n {\n if(null === $sync)\n {\n return $this->property('sync');\n }\n return $this->property('sync', (bool) $sync);\n }", "public function update_zone_settings_always_online( string $id, bool $on ) {\n\t\t\t$args = array(\n\t\t\t\t'value' => ( true === $on ) ? 'on' : 'off',\n\t\t\t);\n\t\t\treturn $this->build_request( \"zones/$id/settings/always_online\", $args, 'PATCH' )->fetch();\n\t\t}", "public function SetOnline($isOnline)\n {\n if ($this->_db->ExecuteStmt(Statements::UPDATE_USER_DATA_ONLINE, $this->_db->BuildStmtArray(\"ii\", ($isOnline ? \"1\" : \"0\"), $this->GetId())))\n {\n $this->_isOnline = (bool)$isOnline;\n return true;\n }\n return false;\n }", "public function setBlockSoftMatchEnabled(?bool $value): void {\n $this->getBackingStore()->set('blockSoftMatchEnabled', $value);\n }", "public function omitIndividualSyncStatus()\n {\n return false;\n }" ]
[ "0.5580695", "0.5509162", "0.5395447", "0.5372998", "0.5143944", "0.50927585", "0.5082305", "0.49914062", "0.49836004", "0.4853244", "0.4853244", "0.4832663", "0.48222435", "0.4818358", "0.4818358", "0.4808481", "0.46778223", "0.46360955", "0.45920554", "0.45780137", "0.456509", "0.45636356", "0.45582005", "0.45560375", "0.44976035", "0.44797122", "0.44787535", "0.44766188", "0.4474408", "0.4459815" ]
0.70538324
1
Sets the onPremisesUserPrincipalName property value. Contains the onpremises userPrincipalName synchronized from the onpremises directory. The property is only populated for customers who are synchronizing their onpremises directory to Azure Active Directory via Azure AD Connect. Readonly. Supports $filter (eq, ne, not, ge, le, in, startsWith).
public function setOnPremisesUserPrincipalName(?string $value): void { $this->getBackingStore()->set('onPremisesUserPrincipalName', $value); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function setOnPremisesSamAccountName(?string $value): void {\n $this->getBackingStore()->set('onPremisesSamAccountName', $value);\n }", "public function setOnPremisesConnectionName(?string $value): void {\n $this->getBackingStore()->set('onPremisesConnectionName', $value);\n }", "public function getOnPremisesUserPrincipalName(): ?string {\n $val = $this->getBackingStore()->get('onPremisesUserPrincipalName');\n if (is_null($val) || is_string($val)) {\n return $val;\n }\n throw new \\UnexpectedValueException(\"Invalid type found in backing store for 'onPremisesUserPrincipalName'\");\n }", "public function setUserPrincipalName(?string $value): void {\n $this->getBackingStore()->set('userPrincipalName', $value);\n }", "public function setUserPrincipalName(?string $value): void {\n $this->getBackingStore()->set('userPrincipalName', $value);\n }", "public function setInitiatedByUserPrincipalName($val)\n {\n $this->_propDict[\"initiatedByUserPrincipalName\"] = $val;\n return $this;\n }", "public function setOnPremisesDistinguishedName(?string $value): void {\n $this->getBackingStore()->set('onPremisesDistinguishedName', $value);\n }", "public function setUserPrincipalName($val)\n {\n $this->_propDict[\"userPrincipalName\"] = $val;\n return $this;\n }", "public function setUserPrincipalName($val)\n {\n $this->_propDict[\"userPrincipalName\"] = $val;\n return $this;\n }", "public function setUserPrincipalName($val)\n {\n $this->_propDict[\"userPrincipalName\"] = $val;\n return $this;\n }", "public function setUserPrincipalName($val)\n {\n $this->_propDict[\"userPrincipalName\"] = $val;\n return $this;\n }", "public function setUserPrincipalName($val)\n {\n $this->_propDict[\"userPrincipalName\"] = $val;\n return $this;\n }", "public function setUserPrincipalName($val)\n {\n $this->_propDict[\"userPrincipalName\"] = $val;\n return $this;\n }", "public function setOnPremisesDomainName(?string $value): void {\n $this->getBackingStore()->set('onPremisesDomainName', $value);\n }", "public function setInvitedUserDisplayName($value)\n {\n $this->setProperty(\"InvitedUserDisplayName\", $value, true);\n }", "public function getUserPrincipalName()\n {\n if (array_key_exists(\"userPrincipalName\", $this->_propDict)) {\n return $this->_propDict[\"userPrincipalName\"];\n } else {\n return null;\n }\n }", "public function getUserPrincipalName()\n {\n if (array_key_exists(\"userPrincipalName\", $this->_propDict)) {\n return $this->_propDict[\"userPrincipalName\"];\n } else {\n return null;\n }\n }", "public function getUserPrincipalName()\n {\n if (array_key_exists(\"userPrincipalName\", $this->_propDict)) {\n return $this->_propDict[\"userPrincipalName\"];\n } else {\n return null;\n }\n }", "public function getUserPrincipalName()\n {\n if (array_key_exists(\"userPrincipalName\", $this->_propDict)) {\n return $this->_propDict[\"userPrincipalName\"];\n } else {\n return null;\n }\n }", "public function getUserPrincipalName()\n {\n if (array_key_exists(\"userPrincipalName\", $this->_propDict)) {\n return $this->_propDict[\"userPrincipalName\"];\n } else {\n return null;\n }\n }", "public function getUserPrincipalName()\n {\n if (array_key_exists(\"userPrincipalName\", $this->_propDict)) {\n return $this->_propDict[\"userPrincipalName\"];\n } else {\n return null;\n }\n }", "public function setFirstName($value)\n {\n Yii::trace('setFirstName()', 'application.components.RinkfinderWebUser');\n\t$this->setState('__firstName', $value);\n }", "public function setUseFirstName($v)\n\t{\n\t\tif ($v !== null) {\n\t\t\t$v = (string) $v;\n\t\t}\n\n\t\tif ($this->use_first_name !== $v) {\n\t\t\t$this->use_first_name = $v;\n\t\t\t$this->modifiedColumns[] = UsersPeer::USE_FIRST_NAME;\n\t\t}\n\n\t\treturn $this;\n\t}", "public function pre_user_nicename_filter( $user_nicename ) {\n\t\treturn isset( $_REQUEST['display_name'] ) ? sanitize_title( wp_unslash( $_REQUEST['display_name'] ) ) : $user_nicename; // WPCS: input var ok.\n\t}", "static function setUserName( $user_name, $event ) {\n\t\tif ( owa_coreAPI::getSetting( 'base', 'log_visitor_pii' ) ) {\n\t\t\t\n\t\t\t// set user name if one does not already exist on event\n\t\t\tif ( ! $user_name && owa_coreAPI::getSetting( 'base', 'log_owa_user_names' ) ) {\n\t\t\t\n\t\t\t\t$cu = owa_coreAPI::getCurrentUser();\n\t\t\t\t\n\t\t\t\t$user_name = $cu->user->get( 'user_id' );\n\t\t\t}\n\t\t\t\n\t\t\treturn $user_name;\n\t\t}\n\t}", "public function setKerberosPrincipalName(?string $value): void {\n $this->getBackingStore()->set('kerberosPrincipalName', $value);\n }", "function setUserName($userName) {\n $this->userName = strtolower($userName);\n }", "protected function authenticatedUserName( $accessToken )\n\t{\n\t\tif ( isset( $this->settings['real_name'] ) and $this->settings['real_name'] )\n\t\t{\n\t\t\treturn $this->_userData( $accessToken )['name'];\n\t\t}\n\t\treturn NULL;\n\t}", "public function getInitiatedByUserPrincipalName()\n {\n if (array_key_exists(\"initiatedByUserPrincipalName\", $this->_propDict)) {\n return $this->_propDict[\"initiatedByUserPrincipalName\"];\n } else {\n return null;\n }\n }", "public function setUserName($user_name) {\r\n\t\t$this->user_name = $user_name;\r\n\t\treturn $this;\r\n\t}" ]
[ "0.6044922", "0.58999753", "0.55864596", "0.5582702", "0.5582702", "0.5495195", "0.5470715", "0.5438599", "0.5438599", "0.5438599", "0.5438599", "0.5438599", "0.5438599", "0.5434287", "0.5236825", "0.51692253", "0.51692253", "0.51692253", "0.51692253", "0.51692253", "0.51692253", "0.5129938", "0.50962055", "0.5006685", "0.50043476", "0.5003417", "0.4961995", "0.48713428", "0.4831712", "0.48242158" ]
0.7752713
0
Sets the outlook property value. Selective Outlook services available to the user. Readonly. Nullable.
public function setOutlook(?OutlookUser $value): void { $this->getBackingStore()->set('outlook', $value); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getOutlook(): ?OutlookUser {\n $val = $this->getBackingStore()->get('outlook');\n if (is_null($val) || $val instanceof OutlookUser) {\n return $val;\n }\n throw new \\UnexpectedValueException(\"Invalid type found in backing store for 'outlook'\");\n }", "public function setInvitedUserMessageInfo($value)\n {\n $this->setProperty(\"InvitedUserMessageInfo\", $value, true);\n }", "protected function set_value( $value ) {\n\t\t$this->user_options->set( Active_Consumers::OPTION, $value );\n\t}", "public function set_imap_prop()\n {\n $this->imap->set_charset($this->config->get('default_charset', cmail_CHARSET));\n\n if ($default_folders = $this->config->get('default_imap_folders')) {\n $this->imap->set_default_mailboxes($default_folders);\n }\n if (!empty($_SESSION['mbox'])) {\n $this->imap->set_mailbox($_SESSION['mbox']);\n }\n if (isset($_SESSION['page'])) {\n $this->imap->set_page($_SESSION['page']);\n }\n \n // cache IMAP root and delimiter in session for performance reasons\n $_SESSION['imap_root'] = $this->imap->root_dir;\n $_SESSION['imap_delimiter'] = $this->imap->delimiter;\n }", "public function setInvitedUserType($value)\n {\n $this->setProperty(\"InvitedUserType\", $value, true);\n }", "public function setOutOfOfficeSettings($val)\n {\n $this->_propDict[\"outOfOfficeSettings\"] = $val;\n return $this;\n }", "public function setEmail($value)\n {\n Yii::trace('setEmail()', 'application.components.RinkfinderWebUser');\n\t$this->setState('__email', $value);\n }", "public function setReceiverUrl($value)\n {\n $this->setProperty(\"ReceiverUrl\", $value, true);\n }", "public function setAlternateNotificationEmails(?string $value): void {\n $this->getBackingStore()->set('alternateNotificationEmails', $value);\n }", "public function setMessagingSettings(?TeamMessagingSettings $value): void {\n $this->getBackingStore()->set('messagingSettings', $value);\n }", "function setEmail($value)\t\r\n {\r\n\t \t$this->email = $value; //θέτω την τιμή του loggedIn\r\n\t }", "public function setEMail($value) {\n\t\tif (!filter_var($value, FILTER_VALIDATE_EMAIL))\n\t\t\tthrow new \\Exception(\"U dient een geldig e-mail adres op te geven.\");\n\n\t\t$this->_email = $value;\n\t}", "public function setIsCertifiedByMicrosoft($val)\n {\n $this->_propDict[\"isCertifiedByMicrosoft\"] = $val;\n return $this;\n }", "public function setReceiverId($value)\n {\n $this->setProperty(\"ReceiverId\", $value, true);\n }", "public function setMicrosoft(bool $microsoft)\n\t{\n\t\t$this->addKeyValue('microsoft', $microsoft); \n\n\t}", "protected function setMobile($value=true) { $this->_is_mobile = $value; }", "public function setMail( \\Aimeos\\MW\\Mail\\Iface $mail );", "public function setIsEnabledForMicrosoftStoreForBusiness(?bool $value): void {\n $this->getBackingStore()->set('isEnabledForMicrosoftStoreForBusiness', $value);\n }", "function setValue($value)\n {\n $value = ($value?:false);\n if( $this->type == 'text' )\n $this->value = $value;\n else\n $this->Options['defaultDate'] = $value;\n }", "public function setEmail($value)\n {\n $this->setProperty(\"Email\", $value, true);\n }", "public function setMailboxOpt($name, $value)\n {\n $this->_mailboxOpts[$name] = $value;\n }", "public function setvalue($value){\n\t\t$this->value = $value;\n\t}", "public function setValueIn($value)\n\t{\n\t\t$this->value = $value;\n\t}", "public function setWindowsManagementApp(?WindowsManagementApp $value): void {\n $this->getBackingStore()->set('windowsManagementApp', $value);\n }", "function setClosedByEmail($value) {\n return $this->setFieldValue('closed_by_email', $value);\n }", "public function setReceiverClass($value)\n {\n $this->setProperty(\"ReceiverClass\", $value, true);\n }", "public function testDetectOutlook()\n {\n $this->assertEquals(EmailReplyExtractor::OUTLOOK, EmailReplyExtractor::detectMailer([ 'x-mailer' => 'Microsoft Office Outlook, Build 11.0.5510' ]));\n $this->assertEquals(EmailReplyExtractor::OUTLOOK, EmailReplyExtractor::detectMailer([ 'x-mailer' => 'Microsoft Office Outlook 12.0' ]));\n $this->assertEquals(EmailReplyExtractor::OUTLOOK, EmailReplyExtractor::detectMailer([ 'x-mailer' => 'Microsoft Outlook 14.0' ]));\n $this->assertEquals(EmailReplyExtractor::OUTLOOK, EmailReplyExtractor::detectMailer([ 'message-id' => '<597b57012a0f4f4c8952ed40f61ef9de@CO1PR07MB221.namprd07.prod.outlook.com>' ]));\n }", "function setEmail($value);", "public function __set($name, $value) {\n\t\tif ($name === \"isPublisher\") {\n\t\t\t$this->setIsPublisher($value);\n\t\t\treturn;\n\t\t}\n\t\tparent::__set($name, $value);\n\t}", "public function setMarketingNotificationEmails(?array $value): void {\n $this->getBackingStore()->set('marketingNotificationEmails', $value);\n }" ]
[ "0.5356665", "0.4929437", "0.4870631", "0.48692748", "0.48583063", "0.47798675", "0.47382787", "0.47080457", "0.47041646", "0.46512914", "0.4631375", "0.462434", "0.46020383", "0.45916516", "0.45879963", "0.45825028", "0.4581363", "0.45786622", "0.45509845", "0.45453003", "0.45350266", "0.453411", "0.4518804", "0.4514816", "0.45107466", "0.4502849", "0.44980192", "0.44922814", "0.44922295", "0.44903854" ]
0.7217333
0
Sets the ownedDevices property value. Devices that are owned by the user. Readonly. Nullable. Supports $expand.
public function setOwnedDevices(?array $value): void { $this->getBackingStore()->set('ownedDevices', $value); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function setManagedDevices(?array $value): void {\n $this->getBackingStore()->set('managedDevices', $value);\n }", "public function setManagedDevices(?array $value): void {\n $this->getBackingStore()->set('managedDevices', $value);\n }", "public function setManagedDevices($val)\n {\n $this->_propDict[\"managedDevices\"] = $val;\n return $this;\n }", "public function getOwnedDevices(): ?array {\n $val = $this->getBackingStore()->get('ownedDevices');\n if (is_array($val) || is_null($val)) {\n TypeUtils::validateCollectionValues($val, DirectoryObject::class);\n /** @var array<DirectoryObject>|null $val */\n return $val;\n }\n throw new \\UnexpectedValueException(\"Invalid type found in backing store for 'ownedDevices'\");\n }", "public function setOwnedObjects(?array $value): void {\n $this->getBackingStore()->set('ownedObjects', $value);\n }", "public function setDevices(?array $value): void {\n $this->getBackingStore()->set('devices', $value);\n }", "public function setRegisteredDevices(?array $value): void {\n $this->getBackingStore()->set('registeredDevices', $value);\n }", "public function setOwners(?array $value): void {\n $this->getBackingStore()->set('owners', $value);\n }", "public function getManagedDevices()\n {\n if (array_key_exists(\"managedDevices\", $this->_propDict)) {\n return $this->_propDict[\"managedDevices\"];\n } else {\n return null;\n }\n }", "public function getManagedDevices(): ?array {\n $val = $this->getBackingStore()->get('managedDevices');\n if (is_array($val) || is_null($val)) {\n TypeUtils::validateCollectionValues($val, ManagedDevice::class);\n /** @var array<ManagedDevice>|null $val */\n return $val;\n }\n throw new \\UnexpectedValueException(\"Invalid type found in backing store for 'managedDevices'\");\n }", "public function getManagedDevices(): ?array {\n $val = $this->getBackingStore()->get('managedDevices');\n if (is_array($val) || is_null($val)) {\n TypeUtils::validateCollectionValues($val, ManagedDevice::class);\n /** @var array<ManagedDevice>|null $val */\n return $val;\n }\n throw new \\UnexpectedValueException(\"Invalid type found in backing store for 'managedDevices'\");\n }", "public function setOwner($value)\n {\n if (is_array($value)) {\n $value = new Carerix_Api_Rest_Entity_CRUser($value);\n }\n $this->owner = $value;\n return $this;\n }", "public function setAllowedIosDeviceModels(?string $value): void {\n $this->getBackingStore()->set('allowedIosDeviceModels', $value);\n }", "public function setOwnerType(?ManagedDeviceOwnerType $value): void {\n $this->getBackingStore()->set('ownerType', $value);\n }", "public function setPlatform(?DeviceManagementConfigurationPlatforms $value): void {\n $this->getBackingStore()->set('platform', $value);\n }", "public function devices()\n {\n return $this->hasMany(UserDevice::class);\n }", "public function setManagedDeviceId(?string $value): void {\n $this->getBackingStore()->set('managedDeviceId', $value);\n }", "public function setManagedDeviceId(?string $value): void {\n $this->getBackingStore()->set('managedDeviceId', $value);\n }", "public function setManagedDeviceName(?string $value): void {\n $this->getBackingStore()->set('managedDeviceName', $value);\n }", "public function setManagedDeviceName(?string $value): void {\n $this->getBackingStore()->set('managedDeviceName', $value);\n }", "public function setAllowTestDevices($value)\n {\n $this->_allowTestDevices = $value;\n }", "public function setDeviceName(?string $value): void {\n $this->getBackingStore()->set('deviceName', $value);\n }", "public function setDeviceName(?string $value): void {\n $this->getBackingStore()->set('deviceName', $value);\n }", "public function setOwnerTokens(?array $ownerTokens) : self\n {\n $this->initialized['ownerTokens'] = true;\n $this->ownerTokens = $ownerTokens;\n return $this;\n }", "public function setDeviceKeys(?array $value): void {\n $this->getBackingStore()->set('deviceKeys', $value);\n }", "public function devices() {\n return $this->hasMany(\"App\\Laravel\\Models\\UserDevice\", \"user_id\");\n }", "public function getDevices(): ?array {\n $val = $this->getBackingStore()->get('devices');\n if (is_array($val) || is_null($val)) {\n TypeUtils::validateCollectionValues($val, Device::class);\n /** @var array<Device>|null $val */\n return $val;\n }\n throw new \\UnexpectedValueException(\"Invalid type found in backing store for 'devices'\");\n }", "public function devices()\n {\n return $this->hasMany('App\\Models\\Devices','user_id','id');\n }", "public function setDeviceStatuses(?array $value): void {\n $this->getBackingStore()->set('deviceStatuses', $value);\n }", "public function getOwnedObjects(): ?array {\n $val = $this->getBackingStore()->get('ownedObjects');\n if (is_array($val) || is_null($val)) {\n TypeUtils::validateCollectionValues($val, DirectoryObject::class);\n /** @var array<DirectoryObject>|null $val */\n return $val;\n }\n throw new \\UnexpectedValueException(\"Invalid type found in backing store for 'ownedObjects'\");\n }" ]
[ "0.6106916", "0.6106916", "0.60549897", "0.5857194", "0.57583153", "0.57520163", "0.5501361", "0.53718364", "0.5298732", "0.48785305", "0.48785305", "0.4865009", "0.4859678", "0.47162503", "0.46831557", "0.46782604", "0.46443966", "0.46443966", "0.46267173", "0.46267173", "0.4592333", "0.45899418", "0.45899418", "0.45831951", "0.45702538", "0.45694646", "0.45613056", "0.45461217", "0.45195365", "0.4487752" ]
0.7355899
0
Sets the ownedObjects property value. Directory objects that are owned by the user. Readonly. Nullable. Supports $expand, $select nested in $expand, and $filter (/$count eq 0, /$count ne 0, /$count eq 1, /$count ne 1).
public function setOwnedObjects(?array $value): void { $this->getBackingStore()->set('ownedObjects', $value); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getOwnedObjects(): ?array {\n $val = $this->getBackingStore()->get('ownedObjects');\n if (is_array($val) || is_null($val)) {\n TypeUtils::validateCollectionValues($val, DirectoryObject::class);\n /** @var array<DirectoryObject>|null $val */\n return $val;\n }\n throw new \\UnexpectedValueException(\"Invalid type found in backing store for 'ownedObjects'\");\n }", "public function setOwnedDevices(?array $value): void {\n $this->getBackingStore()->set('ownedDevices', $value);\n }", "public function setOwners(?array $value): void {\n $this->getBackingStore()->set('owners', $value);\n }", "public function ownedBy($owner, string $name);", "public function setOwner($value)\n {\n if (is_array($value)) {\n $value = new Carerix_Api_Rest_Entity_CRUser($value);\n }\n $this->owner = $value;\n return $this;\n }", "public function setOwnerUserId($ownerUserId);", "public function ownedFrom($ownedFrom)\n {\n return $this->setProperty('ownedFrom', $ownedFrom);\n }", "public function getOwnedDevices(): ?array {\n $val = $this->getBackingStore()->get('ownedDevices');\n if (is_array($val) || is_null($val)) {\n TypeUtils::validateCollectionValues($val, DirectoryObject::class);\n /** @var array<DirectoryObject>|null $val */\n return $val;\n }\n throw new \\UnexpectedValueException(\"Invalid type found in backing store for 'ownedDevices'\");\n }", "public function setRelatedObjects(?array $relatedObjects): void\n {\n $this->relatedObjects = $relatedObjects;\n }", "public function testInferedOwners()\n {\n // Make sure findOwned() works\n /** @var VersionedOwnershipTest\\TestPage $page1 */\n $page1 = $this->objFromFixture(VersionedOwnershipTest\\TestPage::class, 'page1_published');\n /** @var VersionedOwnershipTest\\TestPage $page2 */\n $page2 = $this->objFromFixture(VersionedOwnershipTest\\TestPage::class, 'page2_published');\n $this->assertListEquals(\n [\n ['Title' => 'Banner 1'],\n ['Title' => 'Image 1'],\n ['Title' => 'Custom 1'],\n ],\n $page1->findOwned()\n );\n $this->assertListEquals(\n [\n ['Title' => 'Banner 2'],\n ['Title' => 'Banner 3'],\n ['Title' => 'Image 1'],\n ['Title' => 'Image 2'],\n ['Title' => 'Custom 2'],\n ],\n $page2->findOwned()\n );\n\n // Check that findOwners works\n /** @var VersionedOwnershipTest\\Image $image1 */\n $image1 = $this->objFromFixture(VersionedOwnershipTest\\Image::class, 'image1_published');\n /** @var VersionedOwnershipTest\\Image $image2 */\n $image2 = $this->objFromFixture(VersionedOwnershipTest\\Image::class, 'image2_published');\n\n $this->assertListEquals(\n [\n ['Title' => 'Banner 1'],\n ['Title' => 'Banner 2'],\n ['Title' => 'Page 1'],\n ['Title' => 'Page 2'],\n ],\n $image1->findOwners()\n );\n $this->assertListEquals(\n [\n ['Title' => 'Banner 1'],\n ['Title' => 'Banner 2'],\n ],\n $image1->findOwners(false)\n );\n $this->assertListEquals(\n [\n ['Title' => 'Banner 3'],\n ['Title' => 'Page 2'],\n ],\n $image2->findOwners()\n );\n $this->assertListEquals(\n [\n ['Title' => 'Banner 3'],\n ],\n $image2->findOwners(false)\n );\n\n // Test custom relation can findOwners()\n /** @var VersionedOwnershipTest\\CustomRelation $custom1 */\n $custom1 = $this->objFromFixture(VersionedOwnershipTest\\CustomRelation::class, 'custom1_published');\n $this->assertListEquals(\n [['Title' => 'Page 1']],\n $custom1->findOwners()\n );\n }", "protected function owned()\n {\n foreach ($this->all() as $constraints) {\n foreach ($constraints as $constraint) {\n $this->getOwner()->add($constraint);\n }\n }\n }", "public function ownedThrough($ownedThrough)\n {\n return $this->setProperty('ownedThrough', $ownedThrough);\n }", "public function ownedBy() {\n\t\tif ($this->getUserobjecttype() != \"\") {\n\t\t\t$objectQueryName = $this->getUserobjecttype() . 'Query';\n\t\t\tif (class_exists($objectQueryName)) {\n\t\t\t\t$query = BaseQuery::create($this->getUserobjecttype());\n\t\t\t\treturn $query->findPK($this->getUserobjectid());\n\t\t\t}\n\t\t}\n\t\treturn;\n\t}", "public function setOwnerId($value) \n {\n $this->_fields['OwnerId']['FieldValue'] = $value;\n return $this;\n }", "public function setOwner($var)\n {\n GPBUtil::checkString($var, True);\n $this->owner = $var;\n\n return $this;\n }", "public function setOwner(string $path, string $owner, bool $recursion = true): bool;", "public function set_owner($owner){\n\t\t$this->owner = $owner;\n\t}", "public function is_owned($id){\n\t\tif($this->owner == $id){\n\t\t\treturn true;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}", "public function setOwner($owner) {\n chown($this->__full_path, $owner);\n }", "function setOwner($owner);", "public function getOwners(): ?array {\n $val = $this->getBackingStore()->get('owners');\n if (is_array($val) || is_null($val)) {\n TypeUtils::validateCollectionValues($val, User::class);\n /** @var array<User>|null $val */\n return $val;\n }\n throw new \\UnexpectedValueException(\"Invalid type found in backing store for 'owners'\");\n }", "public function setObjects(?array $objects): void\n {\n $this->objects = $objects;\n }", "public function testFindOwned()\n {\n /** @var VersionedOwnershipTest\\Subclass $subclass1 */\n $subclass1 = $this->objFromFixture(VersionedOwnershipTest\\Subclass::class, 'subclass1_published');\n $this->assertListEquals(\n [\n ['Title' => 'Related 1'],\n ['Title' => 'Attachment 1'],\n ['Title' => 'Attachment 2'],\n ['Title' => 'Attachment 5'],\n ['Title' => 'Related Many 1'],\n ['Title' => 'Related Many 2'],\n ['Title' => 'Related Many 3'],\n ],\n $subclass1->findOwned()\n );\n\n // Non-recursive search\n $this->assertListEquals(\n [\n ['Title' => 'Related 1'],\n ['Title' => 'Related Many 1'],\n ['Title' => 'Related Many 2'],\n ['Title' => 'Related Many 3'],\n ],\n $subclass1->findOwned(false)\n );\n\n // Search for unversioned parent\n /** @var VersionedOwnershipTest\\UnversionedOwner $unversioned */\n $unversioned = $this->objFromFixture(VersionedOwnershipTest\\UnversionedOwner::class, 'unversioned1');\n $this->assertListEquals(\n [\n ['Title' => 'Book 1'],\n ['Title' => 'Book 2'],\n ['Title' => 'Book 3'],\n ],\n $unversioned->findOwned()\n );\n\n /** @var VersionedOwnershipTest\\Subclass $subclass2 */\n $subclass2 = $this->objFromFixture(VersionedOwnershipTest\\Subclass::class, 'subclass2_published');\n $this->assertListEquals(\n [\n ['Title' => 'Related 2'],\n ['Title' => 'Attachment 3'],\n ['Title' => 'Attachment 4'],\n ['Title' => 'Attachment 5'],\n ['Title' => 'Related Many 4'],\n ],\n $subclass2->findOwned()\n );\n\n // Non-recursive search\n $this->assertListEquals(\n [\n ['Title' => 'Related 2'],\n ['Title' => 'Related Many 4'],\n ],\n $subclass2->findOwned(false)\n );\n\n /** @var VersionedOwnershipTest\\Related $related1 */\n $related1 = $this->objFromFixture(VersionedOwnershipTest\\Related::class, 'related1');\n $this->assertListEquals(\n [\n ['Title' => 'Attachment 1'],\n ['Title' => 'Attachment 2'],\n ['Title' => 'Attachment 5'],\n ],\n $related1->findOwned()\n );\n\n /** @var VersionedOwnershipTest\\Related $related2 */\n $related2 = $this->objFromFixture(VersionedOwnershipTest\\Related::class, 'related2_published');\n $this->assertListEquals(\n [\n ['Title' => 'Attachment 3'],\n ['Title' => 'Attachment 4'],\n ['Title' => 'Attachment 5'],\n ],\n $related2->findOwned()\n );\n }", "function setOwner($owner = \"\") \n\t{\n\t\t$this->owner = $owner;\n\t}", "public function ownerId(array|int|null $value): static\n {\n $this->ownerId = $value;\n return $this;\n }", "public function setObjects(Collection $objects)\n {\n $this->objects = $objects;\n }", "public function getAllOwnedGroups(){\n return $this->securityDAO->getAllOwnedGroupsDAO();\n }", "public function isUserOwned()\n {\n return $this->isBasicLevelOwned();\n }", "public function setOwner(User $owner)\n\t{\n\t\t$this->owner=$owner; \n\t\t$this->keyModified['Owner'] = 1; \n\n\t}", "protected function _set_owner($value) {\n // add author's username to the appropriate rules\n if (isset($this->policy) && isset($this->policy->draft))\n $this->policy->draft->condition->user = $value;\n parent::_set_owner($value);\n }" ]
[ "0.5988876", "0.5412235", "0.52645355", "0.52407396", "0.49755794", "0.49286398", "0.4914506", "0.4882388", "0.47609174", "0.47345772", "0.47007734", "0.46348548", "0.4630957", "0.46080765", "0.45774165", "0.45319042", "0.45297825", "0.4525093", "0.45040128", "0.44601446", "0.4420293", "0.44071135", "0.4404782", "0.43946195", "0.43882126", "0.43870926", "0.4386015", "0.43817845", "0.43785152", "0.4376865" ]
0.6435659
0
Sets the passwordPolicies property value. Specifies password policies for the user. This value is an enumeration with one possible value being DisableStrongPassword, which allows weaker passwords than the default policy to be specified. DisablePasswordExpiration can also be specified. The two may be specified together; for example: DisablePasswordExpiration, DisableStrongPassword. For more information on the default password policies, see Azure AD pasword policies. Supports $filter (ne, not, and eq on null values).
public function setPasswordPolicies(?string $value): void { $this->getBackingStore()->set('passwordPolicies', $value); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function setPermissionsManagePasswordPolicies($permissionsManagePasswordPolicies)\n {\n $this->permissionsManagePasswordPolicies = $permissionsManagePasswordPolicies;\n return $this;\n }", "public function policies($policies=true)\n {\n $clone = $this->makeClone(true);\n if ($policies === true) {\n $clone->useRoles = true;\n } elseif ($policies === false) {\n $clone->useRoles = false;\n } elseif (is_array($policies)) {\n $clone->policies = $policies;\n $clone->useRoles = false;\n }\n return $clone;\n }", "public function rules(UserPasswordPolicy $userPasswordPolicy)\n {\n return [\n 'password' => ['required', 'min:6', 'confirmed'],\n 'password_confirmation' => ['required', 'min:6'],\n 'current_password' => ['required', function($attribute, $value, $fail) use ($userPasswordPolicy) {\n if (! $userPasswordPolicy->isValid($this->user(), $this->get('current_password'))) {\n $fail('The current password is invalid');\n }\n }]\n ];\n }", "public function setPermissionsPasswordNeverExpires($permissionsPasswordNeverExpires)\n {\n $this->permissionsPasswordNeverExpires = $permissionsPasswordNeverExpires;\n return $this;\n }", "public function change_password(array $params = array())\n {\n $required = array(\n 'username',\n );\n if (!$this->checkIfAllParamsGood($params, $required)) {\n return false;\n }\n $params['program'] = 'change-password';\n $params['json'] = 1;\n $params[] = 'multiline';\n return json_decode($this->callServer($params));\n }", "public function getPasswordPolicies(): ?string {\n $val = $this->getBackingStore()->get('passwordPolicies');\n if (is_null($val) || is_string($val)) {\n return $val;\n }\n throw new \\UnexpectedValueException(\"Invalid type found in backing store for 'passwordPolicies'\");\n }", "public function change_password($params = [])\n {\n // Validate\n $v = $this->validator($params);\n $v->require_login();\n $v->set_rules('current_password', '現在のパスワード', 'required|valid_current_password');\n $v->set_rules('password', '新しいパスワード', 'required|min_length[8]|max_length[16]|valid_format_password');\n $v->set_rules('confirm_password', '新しいパスワード(確認)', 'required|valid_confirm_password[' . $params['password'] . ']');\n\n if (FALSE === $v->run()) {\n return $v->error_json();\n }\n\n // Load model\n $this->load->model('user_model');\n\n /** @var object $user Get user info */\n $user = $this->user_model->available(TRUE)->find($this->operator()->id);\n\n // Return error if user does not exist\n if (!$user) {\n return $this->false_json(self::USER_NOT_FOUND);\n }\n\n // Update password\n $this->user_model->update($this->operator()->id, [\n 'password' => $this->user_model->encrypt_password($params['password'])\n ]);\n\n // Return\n return $this->true_json();\n }", "public function changePassword($params = array())\n {\n $path = \"users/account/rest/changepassword\";\n $result = $this->_getRest($path, 'GET', $params);\n return $result;\n }", "public function getPolicies()\r\n {\r\n return $this->policies;\r\n }", "public function getPolicies()\n {\n return $this->policies;\n }", "public function testPasswordAgainstPolicy($password)\n {\n // Check password complexity\n $policy = $this->configService->getSetting('USER_PASSWORD_POLICY');\n\n if ($policy != '')\n {\n $policyError = $this->configService->getSetting('USER_PASSWORD_ERROR');\n $policyError = ($policyError == '') ? __('Your password does not meet the required complexity') : $policyError;\n\n if(!preg_match($policy, $password, $matches))\n throw new \\InvalidArgumentException($policyError);\n }\n }", "public function setEndpointPolicies($var)\n {\n $arr = GPBUtil::checkRepeatedField($var, \\Google\\Protobuf\\Internal\\GPBType::MESSAGE, \\Google\\Cloud\\NetworkServices\\V1beta1\\EndpointPolicy::class);\n $this->endpoint_policies = $arr;\n\n return $this;\n }", "public function setFeatureRolloutPolicies(?array $value): void {\n $this->getBackingStore()->set('featureRolloutPolicies', $value);\n }", "public function setPasswordAttribute($password)\n {\n if (!empty($password)) {\n $this->attributes['password'] = bcrypt($password);\n }\n }", "public function setPasswordAttribute($password) {\n $this->attributes['password'] = bcrypt($password);\n }", "public function setPasswordAttribute($password) {\n $this->attributes['password'] = bcrypt($password);\n }", "public function policies()\n {\n return $this->policies;\n }", "public function policies()\n {\n return $this->policies;\n }", "public function setPasswordAttribute($password)\n {\n $this->attributes['password'] = bcrypt($password);\n }", "public function setPasswordAttribute($password)\n {\n $this->attributes['password'] = bcrypt($password);\n }", "public function setPasswordAttribute($password)\n {\n $this->attributes['password'] = bcrypt($password);\n }", "public function setPasswordAttribute($password)\n {\n $this->attributes['password'] = bcrypt($password);\n }", "public function setPasswordAttribute($password)\n {\n $this->attributes['password'] = bcrypt($password);\n }", "public function setPasswordAttribute($password)\n {\n $this->attributes['password'] = bcrypt($password);\n }", "public function setPasswordAttribute($password)\n {\n $this->attributes['password'] = bcrypt($password);\n }", "protected function getSecurity_Validator_UserPasswordService()\n {\n return $this->services['security.validator.user_password'] = new \\Symfony\\Component\\Security\\Core\\Validator\\Constraints\\UserPasswordValidator(${($_ = isset($this->services['security.token_storage']) ? $this->services['security.token_storage'] : $this->get('security.token_storage')) && false ?: '_'}, ${($_ = isset($this->services['security.encoder_factory']) ? $this->services['security.encoder_factory'] : $this->get('security.encoder_factory')) && false ?: '_'});\n }", "public function password($password = null) {\n\t\twhile (empty($password)) {\n\t\t\t$password = $this->in('Password');\n\t\t}\n\n\t\t$this->loadModel(CLASS_USERS);\n\t\t$this->Users->addBehavior('Tools.Passwordable', ['confirm' => false]);\n\n\t\t/** @var \\App\\Model\\Entity\\User $entity */\n\t\t$entity = $this->Users->newEntity([\n\t\t\t'pwd' => $password,\n\t\t], ['validate' => false]);\n\t\t/** @var \\Tools\\Model\\Behavior\\PasswordableBehavior $Passwordable */\n\t\t$Passwordable = $this->Users->behaviors()->get('Passwordable');\n\t\t$Passwordable->beforeSave(new Event('beforeSave'), $entity, new ArrayObject());\n\n\t\t$this->out('Generating hash...');\n\t\t$this->hr();\n\t\t$this->out($entity->password);\n\t\t$this->hr();\n\t}", "public function setPlainPassword($password);", "public function setPlainPassword($password);", "public function setPlainPassword($password);" ]
[ "0.5875354", "0.5014522", "0.47316164", "0.47298104", "0.46263745", "0.46007755", "0.45452118", "0.45238066", "0.44877717", "0.44871038", "0.44757476", "0.44336587", "0.44097933", "0.4384555", "0.43843538", "0.43843538", "0.43467748", "0.43467748", "0.43390372", "0.43390372", "0.43390372", "0.43390372", "0.43390372", "0.43390372", "0.43390372", "0.43363383", "0.43189502", "0.42801714", "0.42801714", "0.42801714" ]
0.6049466
0
Sets the passwordProfile property value. Specifies the password profile for the user. The profile contains the user's password. This property is required when a user is created. The password in the profile must satisfy minimum requirements as specified by the passwordPolicies property. By default, a strong password is required. Supports $filter (eq, ne, not, in, and eq on null values).
public function setPasswordProfile(?PasswordProfile $value): void { $this->getBackingStore()->set('passwordProfile', $value); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function updatePassword($profileId, $password)\n\t{\n\t\t$profileId = (int) $profileId;\n\t\t$password = (string) $password;\n\n\t\t// get new salt\n\t\t$salt = FrontendProfilesModel::getRandomString();\n\n\t\t// encrypt password\n\t\t$encryptedPassword = FrontendProfilesModel::getEncryptedString($password, $salt);\n\n\t\t// update salt\n\t\tFrontendProfilesModel::setSetting($profileId, 'salt', $salt);\n\n\t\t// update password\n\t\tFrontendProfilesModel::update($profileId, array('password' => $encryptedPassword));\n\t}", "public function setPassword($var)\n {\n GPBUtil::checkString($var, True);\n $this->password = $var;\n\n return $this;\n }", "public function setPassword($var)\n {\n GPBUtil::checkString($var, True);\n $this->password = $var;\n\n return $this;\n }", "public function password($password = null) {\n\t\twhile (empty($password)) {\n\t\t\t$password = $this->in('Password');\n\t\t}\n\n\t\t$this->loadModel(CLASS_USERS);\n\t\t$this->Users->addBehavior('Tools.Passwordable', ['confirm' => false]);\n\n\t\t/** @var \\App\\Model\\Entity\\User $entity */\n\t\t$entity = $this->Users->newEntity([\n\t\t\t'pwd' => $password,\n\t\t], ['validate' => false]);\n\t\t/** @var \\Tools\\Model\\Behavior\\PasswordableBehavior $Passwordable */\n\t\t$Passwordable = $this->Users->behaviors()->get('Passwordable');\n\t\t$Passwordable->beforeSave(new Event('beforeSave'), $entity, new ArrayObject());\n\n\t\t$this->out('Generating hash...');\n\t\t$this->hr();\n\t\t$this->out($entity->password);\n\t\t$this->hr();\n\t}", "public function actionPassword() {\n $user = \\app\\models\\User::findByPk(WebApp::get()->user()->id)->setAction('change-password');\n if (isset($_POST['save'])) {\n $user->setAttributes($_POST['User']);\n if ($user->validate() && $user->changePassword()) {\n Messages::get()->success(\"Password changed!\");\n $this->getRequest()->goToPage('user', 'profile');\n }\n }\n $this->assign('model', $user);\n }", "public function update(Request $request)\n {\n $fields = $request->user;\n $fields['profile'] = $request->profile;\n $newPassword = null;\n\n if(!empty($fields['password']))\n {\n if(empty($fields['confirm-password']) || $fields['password'] != $fields['confirm-password'])\n {\n return Redirect::back()\n ->withErrors([trans('auth.please-confirm-password')])\n ->withInput();\n }\n $newPassword = Hash::make($fields['password']);\n }\n\n unset($fields['password']);\n unset($fields['confirm-password']);\n if(!empty($newPassword)) $fields['password'] = $newPassword;\n\n if(isset($fields['profile']['avatar'])) $fields['profile']['avatar'] = $fields['profile']['avatar']->store('public/avatars');\n $fields['profile']['identity'] = isset($fields['profile']['identity']) ? clearMask($fields['profile']['identity']) : null;\n $fields['profile']['birthdate'] = isset($fields['profile']['birthdate']) ? Carbon::createFromFormat('d/m/Y', $fields['profile']['birthdate']) : null;\n $fields['profile']['dark_mode'] = (Boolean) (isset($fields['profile']['dark_mode']) ? $fields['profile']['dark_mode'] : false);\n\n try {\n $profile = null;\n DB::transaction(function() use($fields, $profile) {\n $user = Auth::user();\n if(!isset($user->profile))\n {\n $profile = Profile::create([\n 'user_id' => $user->id\n ]);\n } else $profile = $user->profile;\n\n if(isset($fields['profile']['avatar']))\n $previousAvatar = $profile->avatar;\n\n $profile->update($fields['profile']);\n $user->update($fields);\n\n if(isset($previousAvatar))\n Storage::delete($previousAvatar);\n });\n return Redirect::route('admin:profile')\n ->with(['success' => trans('crud.successfully-saved', [trans('admin.profile')])]);\n } catch (\\Exception $e) {\n return Redirect::back()\n ->withErrors([trans('crud.error-occurred') . $e->getMessage()])\n ->withInput();\n }\n }", "public function actionProfile()\n {\n $model = $this->findModel(Yii::$app->user->id);\n $updatep = new ChangePasswordForm(Yii::$app->user->id);\n\n if ($model->load(Yii::$app->request->post()) && $updatep->load(Yii::$app->request->post())) {\n $model->email = $updatep->email;\n $model->save();\n $updatep->changePassword();\n echo \"<script>window.history.back();</script>\";\n die;\n }\n $updatep->email = $model->email;\n\n return $this->render('profile', [\n 'model' => $model,\n 'updatep' => $updatep,\n ]);\n }", "public function setPassword(User $request)\n {\n if(!$request->password) {\n $this->hashPass($request);\n } else {\n $request->password = $request->getOriginal('password');\n }\n }", "public function change_my_own_password() {\n\t\tif ($this->request->is('post') || $this->request->is('put')) {\n\t\t\t$message = $this->User->changePassword($this->request->data);\n\t\t\t$this->Session->setFlash($message);\n\t\t\t$this->redirect(array('action' => 'view_my_own_profile'));\n\t\t} else {\n\t\t\t$options = array('conditions' => array('User.' . $this->User->primaryKey => $this->Auth->user('id')));\n\t\t\t$this->request->data = $this->User->find('first', $options);\n\t\t}\n\t\t$this->render('change_my_own_password');\n\t}", "public function setPassword( $data ) {\n\t\tif ( $data[ 'password' ] !== $data[ 'password2' ] ) {\n\t\t\tgetError( 'set_password', 'The passwords are not equal!', 409 );\n\t\t}\n\n\t\t$id = intval( $data[ 'id' ] );\n\n\t\t$this->dbUpdate( 'set_password', 'users', [ 'password' => $data[ 'password' ] ], \"id = $id\" );\n\t}", "public function setPassword($aPassword)\n\t{\n\t\t$this->_password = RTString::stringWithString($aPassword);\n\t}", "public function setPasswordAttribute($password) {\n $this->attributes['password'] = bcrypt($password);\n }", "public function setPasswordAttribute($password) {\n $this->attributes['password'] = bcrypt($password);\n }", "public function setPasswordAttribute($password)\n {\n $this->attributes['password'] = bcrypt($password);\n }", "public function setPasswordAttribute($password)\n {\n $this->attributes['password'] = bcrypt($password);\n }", "public function setPasswordAttribute($password)\n {\n $this->attributes['password'] = bcrypt($password);\n }", "public function setPasswordAttribute($password)\n {\n $this->attributes['password'] = bcrypt($password);\n }", "public function setPasswordAttribute($password)\n {\n $this->attributes['password'] = bcrypt($password);\n }", "public function setPasswordAttribute($password)\n {\n $this->attributes['password'] = bcrypt($password);\n }", "public function setPasswordAttribute($password)\n {\n $this->attributes['password'] = bcrypt($password);\n }", "public function setPasswordAttribute($password)\n {\n if (!empty($password)) {\n $this->attributes['password'] = bcrypt($password);\n }\n }", "public function setPassword($value)\n {\n $this->password = $value;\n }", "public function setPassword($value)\n {\n $this->password = $value;\n }", "public function setPassword($value)\n {\n $this->password = $value;\n }", "public function setProfile(Profile $profile)\n\t{\n\t\t$this->addKeyValue('profile', $profile); \n\n\t}", "public function setPassword($value)\n\t{\n\t\t$this->password = $value;\n\t}", "public function p_profile_resetPassword() {\n\n\t\t# Make sure user is logged in\n\t\t$this->loginCheck();\n\n\t\t# Check user entered old password\n\t\t$_POST = DB::instance(DB_NAME)->sanitize($_POST);\n\t\t$_POST['password'] = sha1(PASSWORD_SALT.$_POST['password']);\n\n\t\t$q = \"SELECT password\n\t\t\t\tFROM users\n\t\t\t\tWHERE user_id = '\".$this->user->user_id.\"'\";\n\t\t$passwordFromDB = DB::instance(DB_NAME)->select_field($q);\n\n\t\t# If password correct, let user update with new password, otherwise redirect with error message\n\t\tif ($_POST['password'] == $passwordFromDB) {\n\t\t\t# Transform new password\n\t\t\t$_POST['newPassword'] = sha1(PASSWORD_SALT.$_POST['newPassword']);\n\t\t\t# Info to be updated\n\t\t\t$data = Array(\"password\" => $_POST['newPassword'],\n\t\t\t\t\t\t \"modified\" => Time::now());\n\t\t\t# Update databse\n\t\t\t$user_id = DB::instance(DB_NAME)->update(\"users\", $data, \"WHERE user_id = '\".$this->user->user_id.\"'\");\n\n\t\t\t# Redirect with notification\n\t\t\tRouter::redirect('/users/profile/passwordUpdateSuccess');\n\t\t} else {\n\t\t\tRouter::redirect('/users/profile/wrongPasswordError');\n\t\t}\n\t}", "function user_setprofile($profile=null) {\n \n $newProfile = $this->sendRequest('viddler.users.setProfile',$profile,'post');\n \n return $newProfile;\n }", "public function update(Request $request, User $profile)\n {\n // if (Hash::check(request('old_password'), $profile->password)) \n // {}\n\n $savingProfile = request()->validate([\n 'name' => ['required'],\n 'contact' => ['required'],\n 'address' => ['required'],\n // 'password'=> ['required','confirmed'] \n\n ]);\n\n $profile->update($savingProfile);\n return redirect()->route('profile')->with('success', 'Your Profile has been added successfully!');\n \n\n }", "public function update_password(Request $request)\n {\n $this->validate($request,[\n 'password' => 'required|string|confirmed',\n 'password_confirmation' => 'required|string',\n ]);\n\n $id=Auth::user()->id;\n $user=User::where('id',$id)->first();\n\n $user->password=bcrypt($request->get('password'));\n $user->save();\n return redirect()->to('users/profile')->with('change','Your password has been changed successfully');\n }" ]
[ "0.61195505", "0.567361", "0.567361", "0.55708534", "0.54614097", "0.54435486", "0.5290886", "0.5225813", "0.5187724", "0.51845723", "0.5180867", "0.51773345", "0.51773345", "0.5142549", "0.5142549", "0.5142549", "0.5142549", "0.5142549", "0.5142549", "0.5142549", "0.51330316", "0.5120392", "0.5120392", "0.5120392", "0.5115071", "0.5102354", "0.50987583", "0.5097423", "0.50884485", "0.5087276" ]
0.6782338
0
Sets the pastProjects property value. A list for the user to enumerate their past projects. Returned only on $select.
public function setPastProjects(?array $value): void { $this->getBackingStore()->set('pastProjects', $value); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function setPastOccurrences($pastOccurrences)\n {\n $this->pastOccurrences = $pastOccurrences;\n return $this;\n }", "public function showPastProjectsAction(Request $request, Application $app)\n {\n $projectStatus = 'projectStatus';\n $fieldName = 'past';\n\n $projects = Project::searchByColumn($projectStatus, $fieldName);\n\n $argsArray = [\n 'projects' => $projects,\n 'status' => $fieldName\n ];\n\n $templateName = 'projects';\n return $app['twig']->render($templateName . '.html.twig', $argsArray);\n }", "public function projectEventsPast($projectId)\n {\n $data = $this->get('/projects/' . $projectId . '/calendar_events/past.json');\n\n return $data;\n }", "public function getPastProjects(): ?array {\n $val = $this->getBackingStore()->get('pastProjects');\n if (is_array($val) || is_null($val)) {\n TypeUtils::validateCollectionValues($val, 'string');\n /** @var array<string>|null $val */\n return $val;\n }\n throw new \\UnexpectedValueException(\"Invalid type found in backing store for 'pastProjects'\");\n }", "function getMilestones($past=false) {\n\t\treturn $this->_basecamp->getMilestones('projects',$this->id,$past);\n\t}", "function qa_project_set($max_projects=50) {\n $this->max_projects = $max_projects;\n\n }", "function getRecentProjectsIds($selectedprojectid=0)\n {\n /* @var $securityManager atkSecurityManager */\n $securityManager = &atkGetSecurityManager();\n\n /* @var $query atkQuery */\n /* @var $db atkDb */\n $db = &atkGetDb();\n \n $subquery = $db->createQuery();\n $subquery->addTable(\"hoursbase\");\n $subquery->addField(\"phaseid\");\n $subquery->addCondition(\"hoursbase.userid='\".$this->m_userid.\"'\");\n $subquery->addOrderBy(\"id DESC\");\n \n $query = $db->createQuery();\n\n $query->addTable(\"phase\");\n\n $query->addField(\"project.id\");\n $query->addField(\"project.name\");\n $query->addField(\"project.abbreviation\");\n \n $query->addJoin(\"project\",\"\",\"phase.projectid=project.id\",false);\n $query->addJoin(\"(\".$subquery->buildSelect().\")\",\"hours\",\"phase.id=hours.phaseid\",false);\n $query->addCondition(\"project.status='active'\");\n\n if (!$securityManager->allowed(\"timereg.hours\", \"any_project\"))\n {\n $query->addJoin(\"project_person\",\"\",\"project_person.projectid = project.id\",true);\n $query->addCondition(\"(project_person.personid = \".$this->m_userid.\" OR project.timereg_limit = \".PRJ_TIMEREG_ALL_USERS.\")\");\n }\n \n $query->setLimit(0,atkconfig::get(\"project\",\"numberofrecentprojects\"));\n $arr = $db->getrows($query->buildSelect(true));\n\n //we add the selected project id on top.\n if(!is_numeric($selectedprojectid))\n {\n $values = decodeKeyValuePair($selectedprojectid);\n $value = $values[$this->m_destInstance->m_table.\".\".$this->m_destInstance->m_primaryKey[0]];\n if(is_numeric($value) && $value!=0)\n $selectedprojectid = $value;\n }\n $this->_addProject($selectedprojectid,$arr);\n return $arr;\n }", "public function setHasAccessToAllFutureProjects(?bool $hasAccessToAllFutureProjects) : self\n {\n $this->hasAccessToAllFutureProjects = $hasAccessToAllFutureProjects;\n return $this;\n }", "public function get_expired_projects(){\n\t\t\n\t\t// Get projects\n\t\treturn $this->db->query(\"SELECT p.*, u.email\n\t\t\t\t\t\t\t\tFROM projects AS p\n\t\t\t\t\t\t\t\tINNER JOIN users AS u ON p.iduser = u.iduser\n\t\t\t\t\t\t\t\tWHERE DATE_ADD(p.date_created, INTERVAL p.period DAY) <= NOW()\n\t\t\t\t\t\t\t\tAND p.status = 'open'\n\t\t\t\t\t\t\t\t\")->result(); // \n\t}", "function CPT_get_pending_project_list() {\n\t$t_project_ids = current_user_get_accessible_projects();\n\tproject_cache_array_rows( $t_project_ids );\n\t$s = '';\n\tforeach( $t_project_ids as $t_id ){\n\t\tif( CPT_access_has_level('manage_project', $t_id)\n\t\t\t&& ( null === @plugin_config_get( 'project', null, null, ALL_USERS, $t_id ) ) )\n\t\t{\n\t\t\t$s.= '<option value=\"' . $t_id . '\"';\n\t\t\t$s.= '>' . string_attribute( project_get_field( $t_id, 'name' ) ) . '</option>' . \"\\n\";\n\t\t}\n\t\t$s.= CPT_get_subproject_option_list( $t_id, Array() );\n\t}\n\treturn $s;\n}", "public function actionPublicProjects() {\n $publicProjects = Project::model()->findAll('status='.Project::STATUS_PUBLIC,array('order'=>'deadline'));\n $appliedProjects = Project::getProjectByStudentId(Yii::app()->user->studentId);\n $unappliedProjects = array_diff($publicProjects, $appliedProjects);\n \n $student = ControllerHelper::loadStudent();\n $profileIncomplete = count($student->profileErrors) > 0;\n \n $this->render('public_projects', array(\n 'projects' => $unappliedProjects,\n 'profileIncomplete' => $profileIncomplete,\n ));\n }", "public function filterAllowedProjects()\n {\n // Fetch current user.\n $user = wp_get_current_user();\n\n $this->allowAllProjects = count(array_intersect(\n (array)$user->roles,\n ['administrator', 'upstream_manager']\n )) > 0;\n if ( ! $this->allowAllProjects) {\n // Retrieve all projects current user can access.\n $allowedProjects = upstream_get_users_projects($user);\n // Stores the projects ids so they can be used on filter() function.\n $this->allowedProjects = array_keys($allowedProjects);\n // Retrieve the global query object.\n global $wp_query;\n // Assign this custom property so we know only this time the query will be filtered based on these ids.\n $wp_query->filterAllowedProjects = true;\n }\n }", "private function _getProjectsForMovingToBackoffice() {\n return DB::connection('mysql-ui')->table((new UIProject)->getTable().' AS t1')\n ->select([\n 't1.*',\n ])\n /* ->where('t1.current_budget', '=', 0)\n ->orWhere('t1.current_daily_budget', '=', 0) */\n ->get();\n }", "public function getProjectsForDropdown() {\n $projects = Project::forCompany()->get();\n return $projects;\n }", "public static function getUpcomingProjects($orgName){\n\n\t\t$orgID = DB::table('organizations')\n\t\t\t->where('organizations.OrgName', '=', $orgName)\n\t\t\t->only('OrganizationID');\n\n\t\t$query = DB::table('projects')\n\t\t ->left_join('orgproject', 'projects.ProjectID', '=', 'orgproject.ProjectID')\n\t\t ->left_join('organizations', 'orgproject.OrganizationID', '=', 'organizations.OrganizationID')\n\t\t\t->where('organizations.OrganizationID', '=', $orgID)\n\t\t ->get(array('projects.EndTime', 'projects.ProjectID', 'orgproject.OrganizationID', 'projects.ProjectName as ProjectName', 'projects.StartTime','projects.Spots', 'organizations.OrgName as OrgName', 'projects.Address', 'projects.Requirements', 'projects.Headline', 'projects.Details'));\n\t\treturn $query;\n\t}", "public function getThreeUpcomingEvents(int $page, int $perPage, bool $past = FALSE)\n {\n\n // Create the WHERE statement to either get past or upcoming events\n $pastStatement = $past ? \"events.date < subdate(current_date, 1)\" : \"events.date > subdate(current_date, 1)\";\n\n // Based on past or upcoming events order by DESCENDING dates (for past) or ASCENDING DATES (For upcoming)\n $orderStatement = $past ? \"events.date DESC, events.start_time DESC\" : \"events.date ASC, events.start_time ASC\";\n\n // Since MySQL pages start at 0, we deduct 1 of the value and add it back after the query\n $page = $page - 1;\n\n //$offset = $page * $perPage;\n\n // Run the query and get events limited with pages\n $conn = Database::connect();\n $stmt = $conn->prepare(\"SELECT events.event_id, \n DATE_FORMAT(events.date, '%d-%m-%Y') as date, \n DATE_FORMAT(events.start_time, '%H:%i') as start_time,\n DATE_FORMAT(events.end_time, '%H:%i') as end_time, \n events.name, events.description, events.img\n FROM events\n WHERE {$pastStatement}\n ORDER BY {$orderStatement}\n LIMIT :perPageVal;\n \");\n $stmt->execute([\n 'perPageVal' => $perPage\n ]);\n\n $result = $stmt->fetchAll();\n Database::disconnect();\n\n // Update totalEventsAmount based on upcoming or past events\n $this->getTotalEventsAmount($past);\n\n // Get max pages possible with pagination limits\n $outOfPages = ceil($this->totalEventsAmount / $perPage);\n\n // Create output object\n $output = (object) [\n 'page' => $page + 1, // add 1 back to the page value\n 'per_page' => $perPage,\n 'out_of_pages' => $outOfPages,\n 'events' => $result\n ];\n\n return $output;\n }", "public function assignedProjects()\n {\n if (auth()->user()->isTester()) {\n return $this->fetchTestersProjects();\n }\n\n if (auth()->user()->isDeveloper()) {\n return $this->fetchDevelopersProjects();\n }\n }", "public function user($maximum)\n {\n $services = $this->getServiceLocator();\n $p4Admin = $services->get('p4_admin');\n\n // short-circuit for production; if at least one of these specified projects is present, limit to this list\n // if not, show default behavior\n $projectIdList = array('p4perl', 'perforce-software-chronicle', 'perforce-software-p4win');\n $projects = Project::fetchAll(\n array(Project::FETCH_BY_IDS => $projectIdList),\n $p4Admin\n );\n if ($projects->count() > 0) {\n return $projectIdList;\n }\n\n $config = $services->get('config');\n $maximum = $maximum ?: isset($config['frontpage']['projects']['maximum'])\n ? $config['frontpage']['projects']['maximum']\n : 5;\n\n $creator = $this->getEvent()->getRouteMatch()->getParam('user');\n\n $projects = Project::fetchAll(array(), $p4Admin);\n $projectIdList = array();\n\n foreach ($projects as $project) {\n if ($project->hasField('creator') && $project->get('creator') == $creator) {\n $projectIdList[] = $project->getId();\n }\n }\n\n $projectIdList = array_slice($projectIdList, 0, $maximum);\n\n return $projectIdList;\n }", "public function getRecentProjects($count = 5, array $attributes = ['*']);", "public function projects()\n {\n return $this->unorderedProjects()->orderBy('open_date')->get();\n }", "function markProjectsList() {\r\n if (!in_array($this->Session->read('user_type'), array(1, 7, 2, 3))) {\r\n $this->Session->setFlash(ERR_NOT_AUTHORIZED_THIS);\r\n $this->redirect(\"/projects\");\r\n }\r\n $filters = \"\";\r\n if ($this->Session->read('user_type') == 1 || $this->Session->read('user_type') == 7) {\r\n $admin_id = $this->getAdminId();\r\n $filters = \"Project.admin_id= \" . $admin_id;\r\n } else if ($this->Session->read('user_type') == 2 || $this->Session->read('user_type') == 3) {\r\n $filters = \"Project.leader_id=\" . $this->Session->read('userid');\r\n } else {\r\n $filters.=\" 1=1 \";\r\n }\r\n $filters.=\" AND Project.published =1 AND DATEDIFF(curdate(), date_format(projectStudent.submitted_date, '%Y-%m-%d'))<=2\";\r\n $projects = $this->projectStudent->getProjectsForMarking($filters);\r\n $grpAcToDate = array();\r\n if (count($projects) > 0) {\r\n $gotData = array();\r\n $preDate = \"\";\r\n $i = 0;\r\n $currDate = date(\"Y-m-d\");\r\n $yesterday = date(\"Y-m-d\", strtotime(\"-1 DAY\"));\r\n $dayBeforeYesterday = date(\"Y-m-d\", strtotime(\"-2 DAY\"));\r\n foreach ($projects as $rec) {\r\n $dd = explode(\" \", $rec['projectStudent']['submitted_date']);\r\n $date = date(\"Y-m-d\", strtotime($dd[0]));\r\n if (strtotime($currDate) == strtotime($date)) {\r\n //Insert in today array\r\n $grpAcToDate[0][] = $rec;\r\n } else if (strtotime($yesterday) == strtotime($date)) {\r\n //Insert in today array\r\n $grpAcToDate[1][] = $rec;\r\n } else if (strtotime($dayBeforeYesterday) == strtotime($date)) {\r\n //Insert in today array\r\n $grpAcToDate[2][] = $rec;\r\n }\r\n }\r\n }\r\n $this->set(\"projects\", $grpAcToDate);\r\n }", "function set_show_past_events($value = FALSE){\n\t\t$this->show_past_events = $value;\n\t}", "public function getCountProjects(){\n\n return $this->_projectsCount;\n }", "public function setProject($value)\n {\n // Is this an instance of Project?\n if ($value instanceof Project) {\n return $this->setProjectObject($value);\n }\n\n // Is this an array representing a Project item?\n if (is_array($value) && !empty($value['id'])) {\n return $this->setProjectId($value['id']);\n }\n\n // Is this a scalar value representing the ID of this foreign key?\n return $this->setProjectId($value);\n }", "public function getProjects()\n {\n if (null === $this->projects) {\n $this->projects = [];\n foreach ($this->json->projects as $projectJson) {\n $this->projects[] = new Project($projectJson);\n }\n }\n return $this->projects;\n }", "public function getInvolvedProjects()\n {\n return array();\n }", "public function getHasAccessToAllFutureProjects() : ?bool\n {\n return $this->hasAccessToAllFutureProjects;\n }", "public function active($maximum = null)\n {\n $services = $this->getServiceLocator();\n\n $config = $services->get('config');\n if ($maximum === null) {\n $maximum = isset($config['frontpage']['projects']['maximum'])\n ? $config['frontpage']['projects']['maximum']\n : 5;\n }\n\n $minimum = isset($config['frontpage']['projects']['minimum'])\n ? $config['frontpage']['projects']['minimum']\n : 1;\n\n $wait = isset($config['frontpage']['projects']['wait'])\n ? $config['frontpage']['projects']['wait']\n : 10;\n\n $pad = ($config['frontpage']['projects']['pad']) ?: false;\n\n // if the project count is less than the requested count, return all ids\n // this value may be an empty array\n $p4Admin = $services->get('p4_admin');\n $allProjects = Project::fetchAll(array(), $p4Admin);\n\n $totalProjects = $allProjects->count();\n if ($totalProjects <= $minimum) {\n return $allProjects->keys();\n }\n\n // build fetch query.\n $options = array(\n Activity::FETCH_MAXIMUM => $maximum,\n Activity::FETCH_AFTER => null,\n Activity::FETCH_BY_TYPE => 'change'\n );\n\n // fetch activity and prepare data for output\n $projectIdList = array();\n $records = Activity::fetchAll($options, $p4Admin);\n\n if ($records->count() == 0) {\n return $allProjects->keys();\n }\n\n // for removing projects we don't have access to\n $ipProtects = $services->get('ip_protects');\n\n // scenarios at this point\n // many recently active projects -- best case\n // few recently active projects\n // a few recently active projects, but more projects that are not active; worst case scenario\n\n // count the amount of times we loop with no additional projects found; compare to wait value to decide when\n // to give up.\n $idleLoopCount = 0;\n while (count($projectIdList) < $maximum && $records->count() > 0) {\n\n foreach ($records as $event) {\n // filter out events related to files user doesn't have access to\n $depotFile = $event->get('depotFile');\n if ($depotFile && !$ipProtects->filterPaths($depotFile, Protections::MODE_READ)) {\n continue;\n }\n $projects = array_keys($event->get('projects'));\n foreach ($projects as $project) {\n if (!in_array($project, $projectIdList)) {\n $idleLoopCount = 0;\n $projectIdList[] = $project;\n }\n }\n }\n\n // if we've hit our limit, stop searching\n $idleLoopCount++;\n if (count($projectIdList) >= $minimum && $idleLoopCount >= $wait) {\n break;\n }\n\n $options[Activity::FETCH_AFTER] = $event->get('id');\n $records = Activity::fetchAll($options, $p4Admin);\n\n // remove activity related to restricted/forbidden changes\n $records = $services->get('changes_filter')->filter($records, 'change');\n }\n\n // if there are less projects than the minimum requested, merge in the project list to pad it out\n if ($pad && count($projectIdList) < $maximum && $totalProjects > count($projectIdList)) {\n $projectIds = array_merge($projectIdList, $allProjects->keys());\n $projectIds = array_unique($projectIds);\n $projectIds = array_slice($projectIds, 0, $maximum);\n\n return $projectIds;\n }\n\n return array_slice($projectIdList, 0, $maximum);\n }", "function setProjectId($value) {\n return $this->setFieldValue('project_id', $value);\n }", "function setProjectId($value) {\n return $this->setFieldValue('project_id', $value);\n }" ]
[ "0.6037269", "0.5950679", "0.57426304", "0.5675885", "0.55561894", "0.5298983", "0.52876574", "0.5089811", "0.5009313", "0.48584023", "0.47895592", "0.47841138", "0.47630405", "0.47305974", "0.47025183", "0.46555543", "0.46509117", "0.45934615", "0.45830286", "0.45751488", "0.4554115", "0.45445263", "0.45085454", "0.4494461", "0.44912273", "0.44768888", "0.44584736", "0.44560242", "0.44504735", "0.44504735" ]
0.7266329
0
Sets the pendingAccessReviewInstances property value. Navigation property to get list of access reviews pending approval by reviewer.
public function setPendingAccessReviewInstances(?array $value): void { $this->getBackingStore()->set('pendingAccessReviewInstances', $value); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getPendingAccessReviewInstances(): ?array {\n $val = $this->getBackingStore()->get('pendingAccessReviewInstances');\n if (is_array($val) || is_null($val)) {\n TypeUtils::validateCollectionValues($val, AccessReviewInstance::class);\n /** @var array<AccessReviewInstance>|null $val */\n return $val;\n }\n throw new \\UnexpectedValueException(\"Invalid type found in backing store for 'pendingAccessReviewInstances'\");\n }", "protected function countPendingApprovals()\n {\n $searchModel = new MembershipSearch();\n $searchModel->space_id = $this->space->id;\n $searchModel->status = Membership::STATUS_APPLICANT;\n return $searchModel->search([])->getCount();\n }", "public static function pending()\n\t{\n\t\treturn Approval::where('approved', '=', 'PENDING')\n\t\t\t\t\t\t->where('approver_id', '=', Auth::user()->id)\n\t\t\t\t\t\t->get();\n\n\t}", "public function setAccesses($var)\n {\n $arr = GPBUtil::checkRepeatedField($var, \\Google\\Protobuf\\Internal\\GPBType::MESSAGE, \\Google\\Cloud\\Asset\\V1\\IamPolicyAnalysisResult\\Access::class);\n $this->accesses = $arr;\n\n return $this;\n }", "public function setArsprestrictaccess($v)\n {\n if ($v !== null) {\n $v = (string) $v;\n }\n\n if ($this->arsprestrictaccess !== $v) {\n $this->arsprestrictaccess = $v;\n $this->modifiedColumns[SalesPersonTableMap::COL_ARSPRESTRICTACCESS] = true;\n }\n\n return $this;\n }", "public function getApprovalStatusAllowableValues()\n {\n return [\n self::APPROVAL_STATUS__NEW,\n self::APPROVAL_STATUS_CANCELED,\n self::APPROVAL_STATUS_SENT_TO_APPROVAL,\n self::APPROVAL_STATUS_RECEIVED_BY_APPROVAL,\n self::APPROVAL_STATUS_IN_PROGRESS_APPROVAL,\n self::APPROVAL_STATUS_REJECTED_IN_APPROVAL,\n self::APPROVAL_STATUS_APPROVED_IN_APPROVAL,\n self::APPROVAL_STATUS_ACTIVE_WORKFLOW_APPROVAL,\n ];\n }", "public function setAppConsentRequestsForApproval(?array $value): void {\n $this->getBackingStore()->set('appConsentRequestsForApproval', $value);\n }", "public function setAccess($access);", "function reapprove() {\n $comment = \"Set to In Progress status for re-approval.\";\n foreach ($this->approvals_required() as $ap_type_id => $ap_type_desc) {\n $this->approve($ap_type_id, \"\", $comment);\n } // foreach\n }", "public function approvalStatus()\n {\n $approval_statuses = ApprovelStatus::get();\n\n return ApprovelStatusResource::collection($approval_statuses);\n }", "public function setRoleAssignmentScheduleInstances($val)\n {\n $this->_propDict[\"roleAssignmentScheduleInstances\"] = $val;\n return $this;\n }", "public function setPendingCount($var)\n {\n GPBUtil::checkInt64($var);\n $this->pending_count = $var;\n\n return $this;\n }", "public function test_access_plan_limit() {\n\n\t\twp_set_current_user( $this->user_allowed );\n\n\t\tforeach ( array( 'course', 'llms_membership' ) as $pt ) {\n\n\t\t\t// Create 5 access plans, by default the limit is 6 per product.\n\t\t\t$access_plan_ids = $this->factory->post->create_many( 5, array( 'post_type' => $this->post_type ) );\n\n\t\t\t$product = $this->factory->post->create( array( 'post_type' => $pt ) );\n\n\t\t\tforeach ( $access_plan_ids as $access_plan_id ) {\n\t\t\t\tupdate_post_meta( $access_plan_id, '_llms_product_id', $product );\n\t\t\t}\n\n\t\t\t// Create an ap through api with same product id.\n\t\t\t$response = $this->perform_mock_request(\n\t\t\t\t'POST',\n\t\t\t\t$this->route,\n\t\t\t\tarray_merge(\n\t\t\t\t\t$this->sample_access_plan_args,\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'post_id' => $product,\n\t\t\t\t\t)\n\t\t\t\t)\n\t\t\t);\n\t\t\t$sixth_ap = $response->get_data()['id'];\n\t\t\t// The 6th passes.\n\t\t\t$this->assertResponseStatusEquals( 201, $response, $pt );\n\n\t\t\t// Create the 7th ap.\n\t\t\t$response = $this->perform_mock_request(\n\t\t\t\t'POST',\n\t\t\t\t$this->route,\n\t\t\t\tarray_merge(\n\t\t\t\t\t$this->sample_access_plan_args,\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'post_id' => $product,\n\t\t\t\t\t)\n\t\t\t\t)\n\t\t\t);\n\n\t\t\t// The 7th is blocked.\n\t\t\t$this->assertResponseStatusEquals( 400, $response, $pt );\n\t\t\t$this->assertResponseMessageEquals(\n\t\t\t\tsprintf(\n\t\t\t\t\t'Only %1$d %2$s allowed per %3$s',\n\t\t\t\t\t6,\n\t\t\t\t\tstrtolower( get_post_type_object( $this->post_type )->labels->name ),\n\t\t\t\t\tstrtolower( get_post_type_object( $pt )->labels->singular_name )\n\t\t\t\t),\n\t\t\t\t$response\n\t\t\t);\n\n\t\t\t// Update the 6th.\n\t\t\t$response = $this->perform_mock_request(\n\t\t\t\t'POST',\n\t\t\t\t$this->route . '/' . $sixth_ap,\n\t\t\t\tarray(\n\t\t\t\t\t'title' => 'Updated',\n\t\t\t\t)\n\t\t\t);\n\n\t\t\t// Update passes.\n\t\t\t$this->assertResponseStatusEquals( 200, $response, $pt );\n\n\t\t\t// Create an ap linked to a different product.\n\t\t\t$access_plan = $this->factory->post->create( array( 'post_type' => $this->post_type ) );\n\t\t\t$new_product = $this->factory->post->create( array( 'post_type' => $pt ) );\n\t\t\tupdate_post_meta( $access_plan, '_llms_product_id', $new_product );\n\n\t\t\t// Update its post_id so that it becomes the 7th ap of the first product.\n\t\t\t$response = $this->perform_mock_request(\n\t\t\t\t'POST',\n\t\t\t\t$this->route . '/' . $access_plan,\n\t\t\t\tarray_merge(\n\t\t\t\t\t$this->sample_access_plan_args,\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'post_id' => $product,\n\t\t\t\t\t)\n\t\t\t\t)\n\t\t\t);\n\n\t\t\t// The 7th is blocked.\n\t\t\t$this->assertResponseStatusEquals( 400, $response, $pt );\n\t\t\t$this->assertResponseMessageEquals(\n\t\t\t\tsprintf(\n\t\t\t\t\t'Only %1$d %2$s allowed per %3$s',\n\t\t\t\t\t6,\n\t\t\t\t\tstrtolower( get_post_type_object( $this->post_type )->labels->name ),\n\t\t\t\t\tstrtolower( get_post_type_object( $pt )->labels->singular_name )\n\t\t\t\t),\n\t\t\t\t$response\n\t\t\t);\n\t\t}\n\t}", "public function actionBulkSetAsPending()\n\t{\n\t\tif ( Yii::$app->request->post('selection') )\n\t\t{\n\t\t\t$modelClass = $this->modelClass;\n\n\t\t\t$modelClass::updateAll(\n\t\t\t\t['status'=>Feedback::STATUS_PENDING],\n\t\t\t\t['id'=>Yii::$app->request->post('selection', [])]\n\t\t\t);\n\t\t}\n\t}", "public function getInitiallyApproved();", "function getTotalApproved() {\n\t\treturn $this->getOption(self::STAT_TOTAL_APPROVED, 0);\n\t}", "public function markAsViewed(string $access_token)\n {\n return $this->request->post('notifications.markAsViewed', $access_token);\n }", "public function approve()\n {\n $now = Carbon::now();\n\n Observation::whereIn('id', $this->getObservationIds())->update([\n 'approved_at' => $now,\n 'updated_at' => $now,\n ]);\n\n FieldObservation::whereIn('id', $this->getIds())->update([\n 'unidentifiable' => false,\n 'updated_at' => $now,\n ]);\n }", "public function setAllowMultipleRatings($allowMultipleRatings) {\n\t\t$this->allowMultipleRatings = (bool) $allowMultipleRatings;\n\t}", "public function setAttemptsAllowed($attempts)\n\t\t{\n\t\t\t$this->attemptsAllowed = (is_bool($attempts) or !$attempts) ? false : (abs((int) $attempts) ?: 1);\n\t\t}", "public function setAccessDiff($var)\n {\n GPBUtil::checkMessage($var, \\Google\\Cloud\\PolicySimulator\\V1\\AccessStateDiff::class);\n $this->access_diff = $var;\n\n return $this;\n }", "public function setAccessType($var)\n {\n GPBUtil::checkEnum($var, \\Google\\Cloud\\Notebooks\\V1\\RuntimeAccessConfig\\RuntimeAccessType::class);\n $this->access_type = $var;\n\n return $this;\n }", "public function setAccessPackageAssignments(?array $value): void {\n $this->getBackingStore()->set('accessPackageAssignments', $value);\n }", "public function setSettings($var)\n {\n GPBUtil::checkMessage($var, \\Google\\Cloud\\AccessApproval\\V1\\AccessApprovalSettings::class);\n $this->settings = $var;\n\n return $this;\n }", "public function setRoleAssignmentRequests(?array $value): void {\n $this->getBackingStore()->set('roleAssignmentRequests', $value);\n }", "public function setApproved($request, $response, $args) \n {\n $commentIds = $request->getParam('commentIds') ?? [];\n \n if (empty($args['postId'])) {\n return $response->withStatus(400)->write(\n json_encode(['error' => 'Не указан идентификатор поста.'])\n );\n }\n \n $comments = \\Models\\PostComment::fetchAll([\n 'postId' => $args['postId'],\n 'isDeleted' => [\n '$ne' => true \n ]\n ]);\n \n foreach ($comments as $comment) {\n $comment->isApproved = in_array($comment->id, $commentIds);\n $comment->save();\n }\n \n return $response->write(\n json_encode(['success' => true])\n );\n }", "public function isPendingApproval()\n\t{\n\t\treturn is_null($this->attributes[ $this->getApprovedAtColumn() ]);\n\t}", "function aModAxs($access, $mod) {\r\n $out = array();\r\n foreach($this->accountSets[$mod] as $n => $s) {\r\n if($this->gM('user')->hasFlags('', $s['access'], $access)) {\r\n $out[$n] = $s;\r\n }\r\n }\r\n return $out;\r\n }", "public function test_get_access_plans_with_pagination() {\n\t\twp_set_current_user( $this->user_allowed );\n\n\t\t$access_plan_ids = $this->factory->post->create_many( 25, array( 'post_type' => $this->post_type ) );\n\t\t$course = $this->factory->course->create();\n\t\tforeach ( $access_plan_ids as $id ) {\n\t\t\tupdate_post_meta( $id, '_llms_product_id', $course );\n\t\t}\n\t\t$start_access_plan_id = $access_plan_ids[0];\n\t\t$this->pagination_test( $this->route, $start_access_plan_id );\n\t}", "public function unsuspendAccess(Access $access)\n {\n $access->patch(['is_active' => true]);\n\n return $this;\n }" ]
[ "0.5941554", "0.5357465", "0.5036191", "0.47756806", "0.47515956", "0.46603447", "0.4658434", "0.45463666", "0.45045057", "0.44384146", "0.44199964", "0.44051147", "0.43757874", "0.4333432", "0.43327576", "0.42912367", "0.42827722", "0.4236575", "0.42332757", "0.42137662", "0.41745198", "0.4145561", "0.41434282", "0.4141167", "0.4137357", "0.41341513", "0.4129607", "0.4127393", "0.41243693", "0.41236576" ]
0.70414674
0
Sets the people property value. Readonly. The most relevant people to the user. The collection is ordered by their relevance to the user, which is determined by the user's communication, collaboration and business relationships. A person is an aggregation of information from across mail, contacts and social networks.
public function setPeople(?array $value): void { $this->getBackingStore()->set('people', $value); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function setPersons($persons) {\n $this->persons = $persons;\n }", "public function getPeople()\n {\n\t\treturn $this->people;\n\t}", "public function appendPersons(\\Benchmark\\Converters\\AllegroPhpProtobuf\\Person $value)\n {\n return $this->append(self::PERSONS, $value);\n }", "public function people()\n {\n return $this->hasMany(People::class);\n }", "public function getPeople(){\n return $this->film['people'];\n }", "public function add_STE_Team_Member($people) {\n $this->ste_team[] = $people;\n }", "function getOfPeople($people) {\n $rel = $this->getRelation('_people');\n $res = $rel->getSrc($people); \n return $res;\n }", "function getOfPeople($people) {\n $rel = $this->getRelation('_people');\n $res = $rel->getSrc($people); \n return $res;\n }", "protected function lstPeople_Update() {\n\t\t\tif ($this->lstPeople) {\n\t\t\t\t$this->objCheckingAccountLookup->UnassociateAllPeople();\n\t\t\t\t$objSelectedListItems = $this->lstPeople->SelectedItems;\n\t\t\t\tif ($objSelectedListItems) foreach ($objSelectedListItems as $objListItem) {\n\t\t\t\t\t$this->objCheckingAccountLookup->AssociatePerson(Person::Load($objListItem->Value));\n\t\t\t\t}\n\t\t\t}\n\t\t}", "private function setUpPerson($people, $film_id){\n $this->person = [\n 'id' => $people->Id,\n 'filmid' => $film_id,\n 'name' => [\n 'first' => $people->FirstName,\n 'last' => $people->LastName\n ],\n 'role' => $people->Role\n ];\n }", "public function getPeople()\n {\n return $this->hasMany(Person::className(), ['user_id' => 'id']);\n }", "public function people()\n {\n return $this->belongsTo('App\\People');\n }", "public function people()\n {\n return $this->hasMany(Person::class);\n }", "function loadForPeople($people) {\n $rel = $this->getRelation('_people');\n return $rel->loadSrc($people); \n }", "function loadForPeople($people) {\n $rel = $this->getRelation('_people');\n return $rel->loadSrc($people); \n }", "public function getPeople(){\n \n $persons = person::all();\n\n return PersonResource::collection($persons);\n }", "public function setPerson($person) {\n $this->person = $person;\n }", "public function formatPeople($people)\n {\n return collect($people)->map(function ($person){\n return collect($person)->merge([\n 'id' => $int = (int) filter_var($person['url'], FILTER_SANITIZE_NUMBER_INT),\n ]);\n });\n }", "public function setPerson($person)\n {\n $this->person = $person;\n }", "public function persons()\n {\n return $this->morphedByMany(\\Illuminate\\Support\\Facades\\Config::get('sitec.core.models.person', \\Telefonica\\Models\\Actors\\Person::class), 'skillable');\n }", "public function setPerson(Person $person)\r\n {\r\n $this->person = $person;\r\n }", "private function setPeople(array $persons, $filmid){\n $people = [];\n foreach ($persons as $person) {\n $people[] = new Person($person, $filmid);\n }\n return $people;\n }", "public function edit(People $people)\n {\n //\n }", "public function setKnows(Person $knows)\n {\n $this->_knows = $knows;\n return $this;\n }", "public function listPeople($userId, $collection, $optParams = array())\n {\n $params = array('userId' => $userId, 'collection' => $collection);\n $params = array_merge($params, $optParams);\n return $this->call('list', array($params), \"Google_Service_Plus_PeopleFeed\");\n }", "public function getPersons() {\n return $this->persons;\n }", "function loadPeopleFor($religion) {\n $rel = $this->getRelation('_people');\n return $rel->loadDest($religion); \n }", "public function getPeopleMain()\n {\n return $this->people_main;\n }", "public function getAllPersons(\n\t\t\t$params = array()) {\n\t\t$this->onDebug ( __METHOD__, 1 );\n\t\t$this->getPersons( $params );\n\t\twhile( isset($this->getAdditionalData()['pagination']) && \n\t\t\t\tisset($this->getAdditionalData()['pagination']['more_items_in_collection']) && \n\t\t\t\t$this->getAdditionalData()['pagination']['more_items_in_collection']=== true ){\n\t\t\t$params['start']=$this->getAdditionalData()['pagination']['next_start'];\n\t\t\t$this->getPersons($params, true);\n\t\t}\n\t\treturn $this;\n\t}", "public function getScoreForPeople(People $people)\n {\n $params = [\n \"people_id\" => $people->getId()\n ];\n\n $dql = \"SELECT mhp.significance\n FROM CinemaHD\\Entities\\Ticket t\n LEFT JOIN CinemaHD\\Entities\\Showing s\n WITH t.showing = s\n LEFT JOIN CinemaHD\\Entities\\Movie m\n WITH s.movie = m\n LEFT JOIN CinemaHD\\Entities\\MovieHasPeople mhp\n WITH (\n mhp.movie = m\n AND (mhp.role = 'actrice' OR mhp.role = 'acteur')\n )\n LEFT JOIN CinemaHD\\Entities\\People pp\n WITH pp = mhp.people\n WHERE pp.id = :people_id\n GROUP BY t.id\n \";\n\n $query = $this->_em->createQuery($dql);\n $query->setParameters($params);\n\n $tickets = $query->getResult();\n\n $score = 0;\n foreach ($tickets as $ticket) {\n $score += 'principal' === $ticket[\"significance\"] ? 2 : 1;\n }\n\n return $score;\n }" ]
[ "0.585978", "0.58263165", "0.5634454", "0.54947144", "0.541669", "0.53904665", "0.53792477", "0.53792477", "0.53444254", "0.5300087", "0.52596515", "0.5225344", "0.5184957", "0.516663", "0.516663", "0.51016957", "0.5031652", "0.50153273", "0.50104076", "0.49122572", "0.49002716", "0.48636922", "0.48633695", "0.48088992", "0.47979864", "0.4778901", "0.47126746", "0.46540755", "0.46473336", "0.46424517" ]
0.62319887
0
Sets the photo property value. The user's profile photo. Readonly.
public function setPhoto(?ProfilePhoto $value): void { $this->getBackingStore()->set('photo', $value); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function setPhoto($photo)\n {\n $this->photo = $photo;\n }", "public function updateProfilePhoto(UploadedFile $photo)\n {\n tap($this->profile_photo_path, function ($previous) use ($photo) {\n $this->forceFill([\n 'profile_photo_path' => '/' . $photo->storePublicly(\n '/profile-photos', ['disk' => $this->profilePhotoDisk()]\n ),\n ])->save();\n\n if ($previous) {\n Storage::disk($this->profilePhotoDisk())->delete($previous);\n }\n });\n }", "public function setPhotoEleve($photo) \n {\n $this->photo = $photo;\n }", "public function setPhotoAttribute($value)\n {\n $attribute_name = \"photo\";\n $disk = \"uploads\";\n $destination_path = 'employees/' . $this->id;\n if (request()->file('photo_file')) {\n $this->attributes[$attribute_name] = $value;\n } else {\n if ($value == null) {\n Storage::disk($disk)->delete($this->{$attribute_name});\n $this->attributes[$attribute_name] = null;\n }\n\n if (starts_with($value, 'data:image')) {\n $image = Image::make($value)->encode('jpg', 90);\n $filename = md5($value . time()) . '.jpg';\n Storage::disk($disk)->put($destination_path . '/' . $filename, $image->stream());\n $this->attributes[$attribute_name] = $destination_path . '/' . $filename;\n }\n }\n }", "public function setPhoto($photo) { \n if($photo){\n $file =APPLICATION_PATH . DIRECTORY_SEPARATOR . 'temporary/'.$photo;\n }\n else {\n throw new User_Model_Exception('invalid argument passed to setPhoto');\n }\n\n $name = basename($file);\n $path = APPLICATION_PATH . DIRECTORY_SEPARATOR . 'temporary';\n \n $viewer = Engine_Api::_()->user()->getUser($this->_authResult->getIdentity());\n $userid= $viewer->getIdentity();\n \n $params = array( \n 'parent_type' => 'iphone',\n 'parent_id' => $userid \n ); \n \n // Save\n $storage = Engine_Api::_()->storage();\n\n // Resize image (main)\n $image = Engine_Image::factory();\n $image->open($file)\n // ->resize(720, 720)\n ->write($path.'/m_'.$name)\n ->destroy();\n \n // Resize image (main)\n $image = Engine_Image::factory();\n $image->open($file)\n ->resize(300, 230)\n ->write($path.'/in_'.$name)\n ->destroy();\n // Resize image (main)\n $image = Engine_Image::factory();\n $image->open($file)\n ->resize(40, 30)\n ->write($path.'/is_'.$name)\n ->destroy();\n\n // Store\n $iMain = $storage->create($path.'/m_'.$name, $params);\n $iIconNormal = $storage->create($path.'/in_'.$name, $params);\n $iSquare = $storage->create($path.'/is_'.$name, $params);\n\n $iMain->bridge($iIconNormal, 'thumb.normal');\n $iMain->bridge($iSquare, 'thumb.icon');\n\n // Update row\n $id = $this->photo_id = $iMain->file_id;\n // $this->save();\n\n return $id;\n }", "public function setPhoto($photo)\n {\n $this->photo = $photo;\n\n return $this;\n }", "public function setPhoto($photo)\n {\n $this->photo = $photo;\n\n return $this;\n }", "public function setPhoto($photo)\n {\n $this->photo = $photo;\n\n return $this;\n }", "public function setPhoto($photo)\n {\n $this->photo = $photo;\n\n return $this;\n }", "public function setPhoto($photo, $model) {\n // nazov suboru bude unikatny -> aktualny cas\n $fileName = time() . '.' . $photo->getClientOriginalExtension();\n // ak je dany model instanciou Post modelu\n if($model instanceof Post)\n // uloz obrazok do adresara pre clanky\n \tImage::make($photo)->resize(650, 350)->save('uploads/blog_photos/' . $fileName);\n // ak je dany model instanciou User modelu\n else if($model instanceof User)\n // uloz obrazok do adresara pre uzivatelov\n \tImage::make($photo)->resize(650, 350)->save('uploads/profile_photos/' . $fileName);\n else\n \treturn null;\n\n return $fileName;\n }", "public function setPhoto($photo) {\n\n if ($photo instanceof Zend_Form_Element_File) {\n $file = $photo->getFileName();\n $fileName = $file;\n } else if ($photo instanceof Storage_Model_File) {\n $file = $photo->temporary();\n $fileName = $photo->name;\n } else if ($photo instanceof Core_Model_Item_Abstract && !empty($photo->file_id)) {\n $tmpRow = Engine_Api::_()->getItem('storage_file', $photo->file_id);\n $file = $tmpRow->temporary();\n $fileName = $tmpRow->name;\n } else if (is_array($photo) && !empty($photo['tmp_name'])) {\n $file = $photo['tmp_name'];\n $fileName = $photo['name'];\n } else if (is_string($photo) && file_exists($photo)) {\n $file = $photo;\n $fileName = $photo;\n } else {\n throw new Zend_Exception(\"invalid argument passed to setPhoto\");\n }\n\n if (!$fileName) {\n $fileName = basename($file);\n }\n\n $extension = ltrim(strrchr(basename($fileName), '.'), '.');\n $base = rtrim(substr(basename($fileName), 0, strrpos(basename($fileName), '.')), '.');\n $path = APPLICATION_PATH . DIRECTORY_SEPARATOR . 'temporary';\n\n $params = array(\n 'parent_type' => 'sitevideo_playlist',\n 'parent_id' => $this->getIdentity(),\n 'user_id' => $this->owner_id,\n 'name' => $fileName,\n );\n\n // Save\n $filesTable = Engine_Api::_()->getDbtable('files', 'storage');\n\n // Resize image (main)\n $mainPath = $path . DIRECTORY_SEPARATOR . $base . '_m.' . $extension;\n $image = Engine_Image::factory();\n $image->open($file)\n ->resize(720, 720)\n ->write($mainPath)\n ->destroy();\n\n // Resize image (profile)\n $profilePath = $path . DIRECTORY_SEPARATOR . $base . '_p.' . $extension;\n $image = Engine_Image::factory();\n $image->open($file)\n ->resize(200, 400)\n ->write($profilePath)\n ->destroy();\n\n // Resize image (normal)\n $normalPath = $path . DIRECTORY_SEPARATOR . $base . '_in.' . $extension;\n $image = Engine_Image::factory();\n $image->open($file)\n ->resize(140, 160)\n ->write($normalPath)\n ->destroy();\n\n // Resize image (icon)\n $squarePath = $path . DIRECTORY_SEPARATOR . $base . '_is.' . $extension;\n $image = Engine_Image::factory();\n $image->open($file);\n\n $size = min($image->height, $image->width);\n $x = ($image->width - $size) / 2;\n $y = ($image->height - $size) / 2;\n\n $image->resample($x, $y, $size, $size, 48, 48)\n ->write($squarePath)\n ->destroy();\n\n // Store\n $iMain = $filesTable->createFile($mainPath, $params);\n $iProfile = $filesTable->createFile($profilePath, $params);\n $iIconNormal = $filesTable->createFile($normalPath, $params);\n $iSquare = $filesTable->createFile($squarePath, $params);\n\n $iMain->bridge($iProfile, 'thumb.profile');\n $iMain->bridge($iIconNormal, 'thumb.normal');\n $iMain->bridge($iSquare, 'thumb.icon');\n $iMain->bridge($iMain, 'thumb.main');\n // Remove temp files\n @unlink($mainPath);\n @unlink($profilePath);\n @unlink($normalPath);\n @unlink($squarePath);\n // Update row\n $this->modified_date = date('Y-m-d H:i:s');\n $this->file_id = $iMain->getIdentity();\n $this->save();\n return $this;\n }", "public function setProfilePic($profilePic){\n\t\t$this->profilePic = $profilePic;\n\t}", "public function setPhoto($photo): self\n {\n $this->photo = $photo;\n\n return $this;\n }", "public function setImageProfile ($name, $profile) {}", "public function setPhoto(File $image = null)\n {\n $this->photo = $image;\n\n if ($image) {\n // It is required that at least one field changes if you are using doctrine\n // otherwise the event listeners won't be called and the file is lost\n $this->updatedAt = new \\DateTime('now');\n }\n }", "function setPicture($picture)\r\n {\r\n $this->_picture = $picture;\r\n }", "public function setPicture($picture)\n {\n $this->picture = $picture;\n }", "public function setPicture($picture) {\n $this->picture = $picture;\n }", "function setPhoto($photo_id) {\n\t\t// set view\n\t\t$last = $this->db->do_sql(\"CALL log_photo_view ({$this->famu->active_id}, {$photo_id}, 1)\");\n\t\t$this->last = $last[0]['last_seen'];\n\n\t\t$info = $this->db->do_sql(\"CALL photoLookup({$this->famu->site_id}, {$this->famu->active_id}, {$photo_id})\");\n\t\t$this->photo = new Photo($this->db, $this->famu, $info[0]);\n\t}", "public function add_photo_to_user()\n {\n $path = 'node_modules/admin-lte/dist/img/avatar.png';\n $user = create(User::class);\n\n add_photo_to_user($user, $path);\n $photo = $user->person->photos()->first();\n\n $this->assertEquals('avatar.png',$photo->origin);\n $this->assertEquals('local',$photo->storage);\n $suffix = $user->person->id . '-' . snake_case($user->person->name) . '.png';\n $this->assertStringEndsWith($suffix,$photo->path);\n\n $this->assertTrue(Storage::disk('local')->exists($photo->path));\n }", "public function setImage($profile_image)\n {\n $this->profile_image = $profile_image;\n }", "public function setdefaultphotoAction() {\n\t\t$midencoded=($this->_request->getParam('mid'));\n\t\t$mid=base64_decode($midencoded);\n\t\t$uid=UserAcl::getUid();\n\t\t$result = PeopleService::setDefaultPhoto($uid, $mid);\n\t\tif($result)\n\t\t\techo \"success\";\n\t\telse\n\t\t\techo \"fail\";\n\t\texit();\n\t}", "public function setProfilePictureFile(UploadedFile $file = null) {\r\n // set the value of the holder\r\n $this->profilePictureFile = $file;\r\n // check if we have an old image path\r\n if (isset($this->profilePicturePath)) {\r\n // store the old name to delete after the update\r\n $this->tempProfilePicturePath = $this->profilePicturePath;\r\n $this->profilePicturePath = null;\r\n } else {\r\n $this->profilePicturePath = 'initial';\r\n }\r\n\r\n return $this;\r\n }", "public function avatar()\n {\n return $this->photo;\n }", "function setpicture($picture)\r\n\t{\r\n\t\t$this->picture = $picture;\r\n\t}", "public function setImage($value)\n {\n $this->image = $value;\n }", "public function getPhoto()\n {\n return $this->photo;\n }", "public function getPhoto()\n {\n return $this->photo;\n }", "public function getPhoto()\n {\n return $this->photo;\n }", "public function getPhoto()\n {\n return $this->photo;\n }" ]
[ "0.7549529", "0.698328", "0.69479215", "0.67801744", "0.6438661", "0.6385584", "0.6385584", "0.6385584", "0.6385584", "0.6354487", "0.6335994", "0.6294908", "0.62379736", "0.6210893", "0.6189144", "0.6173287", "0.6158025", "0.6143632", "0.6130938", "0.6059486", "0.6053499", "0.60390604", "0.6031247", "0.59987044", "0.59970963", "0.5966325", "0.5961259", "0.5961259", "0.5961259", "0.5961259" ]
0.8078307
1
Sets the photos property value. The photos property
public function setPhotos(?array $value): void { $this->getBackingStore()->set('photos', $value); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function setPhotosAttribute($value)\n\t {\n\t $attribute_name = \"fotos\";\n\t $disk = \"uploads\";\n\t $destination_path = public_path(\"img/residencias/\". $this->id);\n\n\t $this->uploadMultipleFilesToDisk($value, $attribute_name, $disk, $destination_path);\n\t }", "public function setPhotos(Tx_Extbase_Persistence_ObjectStorage $photos) {\n\t\t$this->photos = $photos;\n\t}", "public function updatePhotos()\n\t{\t\t\n\t\t$this->updateObject(\n\t\t\tarray(\n\t\t\t\t\"table_name\" => \"facebook_photos\",\n\t\t\t\t\"likes\" => true,\n\t\t\t\t\"date_field\" => \"created_time\",\n\t\t\t\t\"keys\" => array(\n\t\t\t\t\t\"from_name\" => array(\"from\", \"name\"),\n\t\t\t\t\t\"source\" => \"source\",\n\t\t\t\t\t\"link\" => \"link\"\n\t\t\t\t)\n\t\t\t),\n\t\t\t\"/me/photos\"\n\t\t);\n\t}", "public function setPhoto($photo)\n {\n $this->photo = $photo;\n }", "public function setPhoto(?ProfilePhoto $value): void {\n $this->getBackingStore()->set('photo', $value);\n }", "public function setPhoto(?ProfilePhoto $value): void {\n $this->getBackingStore()->set('photo', $value);\n }", "public function setPhotoEleve($photo) \n {\n $this->photo = $photo;\n }", "public function getPhotos() {\n\t\treturn clone $this->photos;\n\t}", "public function setImageProperty ($name, $value) {}", "public function setImages($images) {\r\n\t$this->images = $images;\r\n }", "public function photos() {\n return $this->morphToMany('CanRover\\Photo', 'photable');\n }", "public function setImageProperty($name, $value) {\n\t}", "public function setPhotoAttribute($value)\n {\n $attribute_name = \"photo\";\n $disk = \"uploads\";\n $destination_path = 'employees/' . $this->id;\n if (request()->file('photo_file')) {\n $this->attributes[$attribute_name] = $value;\n } else {\n if ($value == null) {\n Storage::disk($disk)->delete($this->{$attribute_name});\n $this->attributes[$attribute_name] = null;\n }\n\n if (starts_with($value, 'data:image')) {\n $image = Image::make($value)->encode('jpg', 90);\n $filename = md5($value . time()) . '.jpg';\n Storage::disk($disk)->put($destination_path . '/' . $filename, $image->stream());\n $this->attributes[$attribute_name] = $destination_path . '/' . $filename;\n }\n }\n }", "public function photos() {\n return $this -> hasMany(Photo::class);\n }", "function setPhoto($photo_id) {\n\t\t// set view\n\t\t$last = $this->db->do_sql(\"CALL log_photo_view ({$this->famu->active_id}, {$photo_id}, 1)\");\n\t\t$this->last = $last[0]['last_seen'];\n\n\t\t$info = $this->db->do_sql(\"CALL photoLookup({$this->famu->site_id}, {$this->famu->active_id}, {$photo_id})\");\n\t\t$this->photo = new Photo($this->db, $this->famu, $info[0]);\n\t}", "function getTotalPhotos() {\n return $this->TotalPhotos;\n }", "public function photos()\n {\n return $this->morphMany(Photo::class, 'photoable');\n }", "public function photos()\n {\n return $this->morphMany(Photo::class, 'photoable');\n }", "public function setPicture(?array $value): void {\n $this->getBackingStore()->set('picture', $value);\n }", "public function get_photos()\n {\n if ($this->photos == NULL)\n $this->photos = $this->external_id->get_details();\n\n return $this->photos;\n }", "public function removeAllPhotos() {\n\t\t$this->photos = new Tx_Extbase_Persistence_ObjectStorage();\n\t}", "public function photos()\n {\n return $this->morphMany('Photos', 'connection');\n //->select(array('id','path', 'description'));\n }", "function setPicture($picture)\r\n {\r\n $this->_picture = $picture;\r\n }", "public function photos($accid){\n\n $account = $this->Account->findPhotos($accid);\n\n $this->set(\"account\", $account);\n }", "public function photos()\n {\n return $this->morphMany('App\\Image','owner'); //会自动去image表找owner_type和owner_id来匹配\n }", "public function photos()\n {\n return $this->hasMany(Photo::class);\n }", "public function photos()\n {\n return $this->hasMany(Photo::class);\n }", "function setImagesSmall($images_small) {\r\r\n\t\t$this->images_small = $images_small;\r\r\n\t}", "public function hasPhotos()\n {\n return $this->photos->count();\n }", "public function getPhotoAttribute($value)\n {\n return url('images/docphotos/' . $value);\n }" ]
[ "0.75493455", "0.7525253", "0.7051336", "0.65312177", "0.6421087", "0.6421087", "0.6382913", "0.6323467", "0.6176312", "0.61215705", "0.60875434", "0.60014594", "0.5951194", "0.5899041", "0.5842472", "0.5833728", "0.58330965", "0.58330965", "0.57989436", "0.5795301", "0.5790339", "0.5637145", "0.56285524", "0.55924666", "0.55915445", "0.5557125", "0.5557125", "0.55394244", "0.55372924", "0.5534387" ]
0.75952554
0
Sets the planner property value. Selective Planner services available to the user. Readonly. Nullable.
public function setPlanner(?PlannerUser $value): void { $this->getBackingStore()->set('planner', $value); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function setDisabledPlans($val)\n {\n $this->_propDict[\"disabledPlans\"] = $val;\n return $this;\n }", "public function getJourneyPlanner()\n {\n return $this->journeyPlanner;\n }", "public function setJourneyPlanner($journeyPlanner)\n {\n $this->journeyPlanner = $journeyPlanner;\n return $this;\n }", "public function set_plan( $plan )\n\t{\n\t\t$this->_plan = $plan;\n\t}", "public function setServicePlanId($val)\n {\n $this->_propDict[\"servicePlanId\"] = $val;\n return $this;\n }", "public function setServicePlanName($val)\n {\n $this->_propDict[\"servicePlanName\"] = $val;\n return $this;\n }", "public function setPlanId($value)\n {\n return $this->setParameter('planId', $value);\n }", "public function setServicePlanId(?string $value): void {\n $this->getBackingStore()->set('servicePlanId', $value);\n }", "public function setProvisionedPlans(?array $value): void {\n $this->getBackingStore()->set('provisionedPlans', $value);\n }", "public function setProvisionedPlans(?array $value): void {\n $this->getBackingStore()->set('provisionedPlans', $value);\n }", "public function setServicePlanType(?CloudPcServicePlanType $value): void {\n $this->getBackingStore()->set('servicePlanType', $value);\n }", "public function setAssignedPlans(?array $value): void {\n $this->getBackingStore()->set('assignedPlans', $value);\n }", "public function setAssignedPlans(?array $value): void {\n $this->getBackingStore()->set('assignedPlans', $value);\n }", "public function setPlan(&$data)\n {\n $data['Business']['plan_id'] = 1;\n\n }", "public function setServicePlanName(?string $value): void {\n $this->getBackingStore()->set('servicePlanName', $value);\n }", "public function setModePlanning($modePlanning) {\n $this->modePlanning = $modePlanning;\n return $this;\n }", "public function setPlan($planName)\n {\n return $this->setParam(self::PLAN, $planName);\n }", "public function getPlanner(): ?PlannerUser {\n $val = $this->getBackingStore()->get('planner');\n if (is_null($val) || $val instanceof PlannerUser) {\n return $val;\n }\n throw new \\UnexpectedValueException(\"Invalid type found in backing store for 'planner'\");\n }", "public function setOptimizer(OptimizerInterface $optimizer = null);", "public function plan()\n {\n \n $planList = $this->Plan->find()->toArray();\n $this->set('planList',$planList);\n }", "public function plan()\n {\n $fromLocationId = $toLocationId = $timeMode = $at = $vehicleTypes = $walkSpeed = $maximumWalkingDistanceM = $serviceTypes = $fareTypes = null;\n extract($this->request->query);\n\n $passedArg = explode(\"/\", $this->passedArgs[0]);\n $fromLocationId = $passedArg[0];\n $toLocationId = $passedArg[1];\n\n $obj = $this->travel_api_client->plan($fromLocationId, $toLocationId, $timeMode, $at, $vehicleTypes, $walkSpeed, $maximumWalkingDistanceM, $serviceTypes, $fareTypes);\n\n $this->set('response', $obj);\n }", "public function setPlanName($plan_name) {\n $this->PLAN_NAME = $plan_name;\n }", "public function setPlanDesarrollo( $planDesarrollo ){\n\t\t\t$this->planDesarrollo = $planDesarrollo;\n\t\t}", "public function setPlanYear($plan_year) {\n $this->PLAN_YEAR = $plan_year;\n }", "public function setPlanID($plan_id) {\n $this->PLAN_ID = $plan_id;\n }", "public function planner_get_planification() {\n \n // Get planification's data\n (new MidrubBaseUserAppsCollectionPlannerHelpers\\Planify)->planner_get_planification();\n \n }", "public function findOptmialTravelPlan();", "public function Plan ()\n\t\t{\n\t\t\tif (!$this->_rrpRatePlan)\n\t\t\t{\n\t\t\t\t$selCurrentPlan = new StatementSelect (\n\t\t\t\t\t'ServiceRatePlan', \n\t\t\t\t\t'RatePlan', \n\t\t\t\t\t'Service = <Service> AND Now() BETWEEN StartDatetime AND EndDatetime', \n\t\t\t\t\t'CreatedOn DESC',\n\t\t\t\t\t1\n\t\t\t\t);\n\t\t\t\t\n\t\t\t\t$selCurrentPlan->Execute (Array ('Service' => $this->Pull ('Id')->getValue ()));\n\t\t\t\t\n\t\t\t\tif ($selCurrentPlan->Count () == 1)\n\t\t\t\t{\n\t\t\t\t\t$arrPlan = $selCurrentPlan->Fetch ();\n\t\t\t\t\t$this->_rrpRatePlan = $this->Push (new RatePlan ($arrPlan ['RatePlan']));\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\treturn $this->_rrpRatePlan;\n\t\t}", "public function setPlanVersion($plan_version) {\n $this->PLAN_VERSION = $plan_version;\n }", "public function getPlanID() {\n return $this->PLAN_ID;\n }" ]
[ "0.5458692", "0.5396196", "0.5351993", "0.53127086", "0.5111779", "0.5049001", "0.5029948", "0.50135654", "0.49393025", "0.49393025", "0.4933375", "0.49261844", "0.49261844", "0.4902684", "0.48549327", "0.4846006", "0.48309287", "0.48005897", "0.47433", "0.46919748", "0.46901208", "0.46228194", "0.46166313", "0.46093646", "0.4593756", "0.45806682", "0.45371613", "0.45330805", "0.4522186", "0.45051536" ]
0.69124377
0
Sets the preferredDataLocation property value. The preferred data location for the user. For more information, see OneDrive Online MultiGeo.
public function setPreferredDataLocation(?string $value): void { $this->getBackingStore()->set('preferredDataLocation', $value); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getPreferredDataLocation(): ?string {\n $val = $this->getBackingStore()->get('preferredDataLocation');\n if (is_null($val) || is_string($val)) {\n return $val;\n }\n throw new \\UnexpectedValueException(\"Invalid type found in backing store for 'preferredDataLocation'\");\n }", "public function setPreferred($preferred) {\n $this->preferred = $preferred;\n }", "public function setLocationData()\n\t{\n\t\t$location = Locations::where('id', '=', $this->location_id)->first();\n\t\t$this->location = $location;\n\t}", "public function setLocationData(Location $locationData)\n {\n $this->locationData = $locationData;\n\n return $this;\n }", "public function setData($oData) {\n $this->oData = $oData;\n }", "public function setData($data = null)\n {\n $this->data = $data;\n }", "public function set_data( $data ) {\n $this->data = $data;\n }", "public function set_data( $data ) {\n\t\t$this->data = $data;\n\t}", "public function setData($data)\n {\n $this->_data = $data;\n }", "public function setData($data)\n {\n $this->_data = $data;\n }", "public function setData($data)\n {\n $this->_data = $data;\n }", "public function setData($data) {\r\n\t\t$this->data = $data;\r\n\t}", "public function setData ($data)\n {\n $this->data = $data;\n }", "public function setData($data) {\n $this->data = $data;\n }", "public function setData($data)\n {\n $this->data = $data;\n }", "public function setData($data)\n {\n $this->data = $data;\n }", "public function setData($data)\n {\n $this->data = $data;\n }", "public function setData($data)\n {\n $this->data = $data;\n }", "public function setData($data) {\n\t\t$this->data = $data;\n\t}", "public function setData($data) {\n\t\t$this->data = $data;\n\t}", "public function installLocationData() {\n // Create the default settings.\n $this->setLocationSettings();\n\n update_option('gssi_location_version', GSSI_LOCATION_VERSION_NUM);\n }", "public function update_user_preference($data) {\n $data_where = array('UserId' => $this -> session -> userdata('userid'));\n $status = $this -> db -> update('userpreferredbrands', $data, $data_where);\n\n return $status;\n }", "public function setData( $data ) {\n $this->requestData = $data;\n $this->data = $data;\n }", "public function setData($data) {\n $this->data = $data;\n }", "function setData($data) {\n\t\t$this->_data = $data;\n\t}", "public function setLocation(array $locationData): BreweryImportItem {\n $this->values['location'][] = [\n 'country_code' => $locationData[\"country_code\"],\n 'administrative_area' => $locationData[\"administrative_area\"],\n 'locality' => $locationData[\"locality\"],\n 'postal_code' => $locationData[\"postal_code\"],\n 'address_line1' => $locationData[\"address_line1\"],\n 'address_line2' => $locationData[\"address_line2\"],\n ];\n return $this;\n }", "function setData( $data ) {\n $this->data = $data;\n }", "public function setPreferredName(?string $value): void {\n $this->getBackingStore()->set('preferredName', $value);\n }", "function setData($data)\n {\n $this->data = $data;\n }", "public function setPreferredLanguage(?string $value): void {\n $this->getBackingStore()->set('preferredLanguage', $value);\n }" ]
[ "0.56867486", "0.5678469", "0.5257264", "0.52039844", "0.51933473", "0.5119085", "0.5058037", "0.5013415", "0.49999028", "0.49999028", "0.49999028", "0.4980535", "0.49582615", "0.49510348", "0.49399844", "0.49399844", "0.49399844", "0.49399844", "0.49352485", "0.49352485", "0.49267897", "0.49260032", "0.491732", "0.48596814", "0.4821952", "0.4807676", "0.47881806", "0.47353786", "0.4730972", "0.4717918" ]
0.73793286
0
Sets the preferredName property value. The preferred name for the user. Not Supported. This attribute returns an empty string.Returned only on $select.
public function setPreferredName(?string $value): void { $this->getBackingStore()->set('preferredName', $value); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getPreferredNameOrFirstNameAttribute() {\n return $this->preferred_name ?: $this->first_name;\n }", "public function getNickname()\n {\n return Arr::get($this->user, 'preferred_username');\n }", "public function getDisplayNameAttribute()\n {\n return $this->nickname ?: $this->name;\n }", "public function getDefaultName()\n {\n return $this->name;\n }", "public function validate_preferredName()\n {\n $validationResult = [];\n if(strlen($this->preferredName) > 50){$validationResult ['preferredName'] = 'preferred Name maximum length is 50 characters';}\n return $validationResult;\n }", "protected function getActiveSpeakerNameAttribute()\n {\n return data_get($this->profile, 'preferred_name');\n }", "public function displayName()\n {\n return $this->nickname ?: $this->username;\n }", "function get_preferred_username(OpenIDConnectClient $oidc) {\n\tglobal $conf;\n\t$config = $conf['OIDC'];\n\n\t// Note: this value must be unique, therefore we use sub\n\t$name = $oidc->requestUserInfo('sub');\n\tif (!empty($config['preferred_username'] && $preferred = $oidc->requestUserInfo($config['preferred_username']))) {\n\t\t$name = $preferred;\n\t}\n\n\treturn $name;\n}", "public function getPreferredName(): ?string {\n $val = $this->getBackingStore()->get('preferredName');\n if (is_null($val) || is_string($val)) {\n return $val;\n }\n throw new \\UnexpectedValueException(\"Invalid type found in backing store for 'preferredName'\");\n }", "public function getDisplayName(){\n return $this->getProfileData('realname') ? $this->getProfileData('realname') : $this->getUsername();\n }", "public function getName()\n {\n return User::where('id', $this->user_id)->first()->first_name;\n }", "public function getUserNameAttribute() {\n // else return ship name\n return $this->ship_to_billing ? $this->user->display_name : $this->user->shipping_full_name;\n }", "function getName($options = null)\n {\n return $this->row['nickname'];\n }", "public function setUseName($v)\n\t{\n\t\tif ($v !== null) {\n\t\t\t$v = (string) $v;\n\t\t}\n\n\t\tif ($this->use_name !== $v) {\n\t\t\t$this->use_name = $v;\n\t\t\t$this->modifiedColumns[] = UsersPeer::USE_NAME;\n\t\t}\n\n\t\treturn $this;\n\t}", "public function assignedUserName()\n {\n\n return ($user = $this->user) ? $user->full_name : 'Unassigned';\n }", "public function getName()\n {\n return ucwords($this->first_name . ' ' . $this->last_name);\n }", "protected function getNameInput()\n {\n return studly_case(parent::getNameInput());\n }", "public function setDisplayName($name)\n {\n $this->displayName = trim($name);\n }", "public function getName()\n {\n return ucfirst($this->display_name);\n }", "private function name()\n {\n return $this->user->name ?? null;\n }", "protected function getNameInput()\n {\n return Str::of($this->argument('name'))\n ->trim()\n ->camel()\n ->ucfirst();\n }", "public function setPreferred($preferred) {\n $this->preferred = $preferred;\n }", "public function getNameAttribute()\n {\n return mb_convert_case(\n //\n str_replace(' ', ' ', $this->first_name . ' ' . $this->middle_name . ' ' . $this->last_name),\n //\n MB_CASE_TITLE\n );\n }", "public function setUseFirstName($v)\n\t{\n\t\tif ($v !== null) {\n\t\t\t$v = (string) $v;\n\t\t}\n\n\t\tif ($this->use_first_name !== $v) {\n\t\t\t$this->use_first_name = $v;\n\t\t\t$this->modifiedColumns[] = UsersPeer::USE_FIRST_NAME;\n\t\t}\n\n\t\treturn $this;\n\t}", "public function getUserDisplayName()\n {\n if (array_key_exists(\"userDisplayName\", $this->_propDict)) {\n return $this->_propDict[\"userDisplayName\"];\n } else {\n return null;\n }\n }", "public function getUserDisplayName()\n {\n if (array_key_exists(\"userDisplayName\", $this->_propDict)) {\n return $this->_propDict[\"userDisplayName\"];\n } else {\n return null;\n }\n }", "public function getUserDisplayName()\n {\n if (array_key_exists(\"userDisplayName\", $this->_propDict)) {\n return $this->_propDict[\"userDisplayName\"];\n } else {\n return null;\n }\n }", "public function getUserDisplayName()\n {\n if (array_key_exists(\"userDisplayName\", $this->_propDict)) {\n return $this->_propDict[\"userDisplayName\"];\n } else {\n return null;\n }\n }", "public function setFirstName($value)\n {\n Yii::trace('setFirstName()', 'application.components.RinkfinderWebUser');\n\t$this->setState('__firstName', $value);\n }", "public function getUserName()\n {\n $user = self::findOne(['id' => $this->id]);\n return $user->name;\n }" ]
[ "0.67612666", "0.6007692", "0.5942021", "0.58482164", "0.5794562", "0.57545483", "0.5705998", "0.5661115", "0.56456023", "0.5614833", "0.5611634", "0.5577976", "0.5559414", "0.5537946", "0.5525623", "0.55169684", "0.55009526", "0.54953015", "0.54705137", "0.54696274", "0.54674715", "0.5453739", "0.5426557", "0.54116875", "0.5405005", "0.5405005", "0.5405005", "0.5405005", "0.5384059", "0.538379" ]
0.664557
1
Sets the presence property value. The presence property
public function setPresence(?Presence $value): void { $this->getBackingStore()->set('presence', $value); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function setPresence(string $presence): UserResponse;", "public function setUserProperty($v)\n {\n $this->userProperty = (boolean) $v;\n }", "public function setPresenceMessage(PresenceCommand $value)\n {\n return $this->set(self::PRESENCEMESSAGE, $value);\n }", "public function setVisibleAttribute($value)\n {\n $this->attributes['visible'] = ($value=='on');\n }", "public function setHasToConfirmAttribute($value)\n {\n $this->attributes['has_to_confirm'] = $value ?? 0;\n\n }", "public function set_existing( $value ): void {\n\t\t// If this input has a single value.\n\t\tif ( Utils::class_uses_trait( $this, Single_Value::class ) ) {\n\t\t\t$this->value( $value );\n\t\t}\n\t}", "public function setMembersUndefined($value) {\n if (is_bool($value)) { $this->Members_Undefined = $value; }\n }", "public function setMetaValueAttribute($value)\n {\n if (! is_null($value)) {\n $value = $value ? 1 : 0;\n }\n parent::setMetaValueAttribute($value);\n }", "public function set_value($value)\n {\n $this->checked = (boolean)$value;\n }", "function onPresenceAvailable($username, $from)\n{\n global $presence;\n $presence = 'available';\n echo \"- The user is online\\n\\n\";\n}", "public function __construct($present)\n {\n //\n $this->present = $present;\n }", "public function setMembersManagement($value) {\n if (is_bool($value)) { $this->MembersManagement = $value; }\n }", "public function __set($name, $value) {\n\t\tif ($name === \"isPublisher\") {\n\t\t\t$this->setIsPublisher($value);\n\t\t\treturn;\n\t\t}\n\t\tparent::__set($name, $value);\n\t}", "function send_presence($message = '', $type = '', $unavailable = false)\n\t{\n\t\tif (!isset($this->session['jid']))\n\t\t{\n\t\t\t$this->add_to_log('ERROR: send_presence() - Cannot set presence at this point, no jid given.');\n\t\t\treturn false;\n\t\t}\n\n\t\t$type = strtolower($type);\n\t\t$type = (in_array($type, array('dnd', 'away', 'chat', 'xa'))) ? '<show>'. $type .'</show>' : '';\n\n\t\t$unavailable = ($unavailable) ? \" type='unavailable'\" : '';\n\t\t$message = ($message) ? '<status>' . utf8_htmlspecialchars($message) .'</status>' : '';\n\n\t\t$this->session['sent_presence'] = !$unavailable;\n\n\t\treturn $this->send(\"<presence$unavailable>\" . $type . $message . '</presence>');\n\t}", "public function setVisible(?bool $value): void {\n $this->getBackingStore()->set('visible', $value);\n }", "public function setUndefined($value) {\n if (is_bool($value)) { $this->Undefined = $value; }\n }", "public function set( $value ) {\n\t\tif ( ! in_array( $value, array( self::VALUE_COMPLETED, self::VALUE_MISSING, self::VALUE_REQUIRED, '' ), true ) ) {\n\t\t\treturn false;\n\t\t}\n\t\treturn parent::set( $value );\n\t}", "public function check()\n\t{\n\t\t// Set this value to 1\n\t\t$this->_field->set_var('value', TRUE);\n\t}", "public function setExplicitValue($val)\n {\n $this->_propDict[\"explicitValue\"] = boolval($val);\n return $this;\n }", "public function setParticipateAttribute($value)\n {\n $this->attributes['participate'] = $this->getParticipateAttribute($value);\n }", "public function getPresence(): ?Presence {\n $val = $this->getBackingStore()->get('presence');\n if (is_null($val) || $val instanceof Presence) {\n return $val;\n }\n throw new \\UnexpectedValueException(\"Invalid type found in backing store for 'presence'\");\n }", "function setValue($value)\n {\n // TODO checks\n $this->value = $value;\n\n return true;\n }", "public function setIsVisible($visible) {\n $this->visible = $visible;\n }", "function set_value($input)\n {\n $this->value = (boolean) $input;\n\n // always works.\n return true;\n }", "public function setBoolValue($var) {}", "public function isActive() {\n\t\treturn in_array($this->get('presence'), array(0,2));\n\t}", "function markuserAs($id,$value) {\n \n $stmt = Contactuspropertyinfo::where('id', $id)->update(array('status' => $value));\n if ($stmt) {\n return true;\n } else {\n return false;\n }\n }", "public function setOrganizerAvailability(?FreeBusyStatus $value): void {\n $this->getBackingStore()->set('organizerAvailability', $value);\n }", "public function setStatusPub($value)\n {\n return $this->set(self::STATUSPUB, $value);\n }", "public function setAlreadyFriend($a){\n $this->_alreadyfriend=(bool)$a;\n}" ]
[ "0.65730923", "0.5873352", "0.5770216", "0.55114096", "0.54823995", "0.5440195", "0.5410537", "0.5277246", "0.52508205", "0.52503693", "0.52459437", "0.52401024", "0.5239409", "0.52389675", "0.5232589", "0.51688564", "0.5149192", "0.5138309", "0.51364243", "0.5130044", "0.512301", "0.50630164", "0.5043299", "0.5027843", "0.50267196", "0.50119865", "0.50094664", "0.4997535", "0.49938095", "0.4973615" ]
0.7686598
0
Sets the profile property value. Represents properties that are descriptive of a user in a tenant.
public function setProfile(?Profile $value): void { $this->getBackingStore()->set('profile', $value); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function setProfileData($prop, $value) {\n $this->getProfileData();\n\n $this->profile[$prop] = $value;\n }", "public function setProfile(Profile $profile)\n\t{\n\t\t$this->addKeyValue('profile', $profile); \n\n\t}", "function user_setprofile($profile=null) {\n \n $newProfile = $this->sendRequest('viddler.users.setProfile',$profile,'post');\n \n return $newProfile;\n }", "public function setProfile($profileId)\n {\n $this->profile = $profileId;\n }", "private function setProfile()\n\t{\n\t\t// Set profile\n\t\t$profile = $this->input->get('profile', 1, 'int');\n\n\t\tif (empty($profile))\n\t\t{\n\t\t\t$profile = 1;\n\t\t}\n\n\t\t$session = Application::getInstance()->getContainer()->segment;\n\t\t$session->profile = $profile;\n\n\t\t/**\n\t\t * DO NOT REMOVE!\n\t\t *\n\t\t * The Model will only try to load the configuration after nuking the factory. This causes Profile 1 to be\n\t\t * loaded first. Then it figures out it needs to load a different profile and it does – but the protected keys\n\t\t * are NOT replaced, meaning that certain configuration parameters are not replaced. Most notably, the chain.\n\t\t * This causes backups to behave weirdly. So, DON'T REMOVE THIS UNLESS WE REFACTOR THE MODEL.\n\t\t */\n\t\tPlatform::getInstance()->load_configuration($profile);\n\t}", "public function setPasswordProfile(?PasswordProfile $value): void {\n $this->getBackingStore()->set('passwordProfile', $value);\n }", "public function setProfileID($value)\n {\n return $this->set('ProfileID', $value);\n }", "public function setPrivacyProfile(?PrivacyProfile $value): void {\n $this->getBackingStore()->set('privacyProfile', $value);\n }", "public function set_profile( $id )\n\t{\n\t\t$this->profile = $id;\n\t}", "public function myprofile() {\n\t\t$userId = $this->UserAuth->getUserId();\n\t\t$user = $this->User->read(null, $userId);\n\t\t$this->set('user', $user);\n\t}", "public static function set_profile($user_id, $profile_properties = array()) {\n static::_init();\n \n $properties = array();\n \n foreach ($profile_properties as $key => $value) {\n if (in_array($key, static::$_reserved_properties)) {\n $key = '$' . $key;\n }\n $properties[$key] = $value;\n }\n \n static::$_instance->people->set($user_id, $properties);\n }", "public function setPhoto(?ProfilePhoto $value): void {\n $this->getBackingStore()->set('photo', $value);\n }", "public function setPhoto(?ProfilePhoto $value): void {\n $this->getBackingStore()->set('photo', $value);\n }", "public function setProfile(\\Entities\\Profile $profile = null) {\n $this->profile = $profile;\n }", "public function setImageProfile ($name, $profile) {}", "public function profile()\n {\n $user = $this->currentUser;\n $this->viewBuilder()->setTemplate('user_profile');\n\n if ($this->request->is(['patch', 'post', 'put'])) {\n $user = $this->Users->patchEntity($user, $this->request->getData());\n if ($this->Users->save($user)) {\n $this->Flash->success(__('Your profile has been updated!'));\n } else {\n $this->Flash->error(__('Your profile could not be updated. Please, try again.'));\n }\n }\n $this->set(compact('user'));\n $this->set('_serialize', ['user']);\n }", "public function setProfile(Persistent $profile)\n {\n // save the profile if it hasn't been saved already\n if (!$profile->getId())\n {\n $profile->save();\n }\n \n $this->setProfileId($profile->getId());\n $this->profile = $profile;\n }", "public function __set($property, $value) {\n\t\tswitch($property) {\n\t\t\tcase 'auth':\n\t\t\t\t$this->auth = $value;\n\t\t\t\tbreak;\n\n\t\t\tcase 'user':\n\t\t\t\t$this->user = $value;\n\t\t\t\t$GLOBALS['user'] = $value;\n\t\t\t\tbreak;\n\n\t\t\tdefault:\n\t\t\t\tparent::__set($property, $value);\n\t\t\t\tbreak;\n\t\t}\n\t}", "public function profile()\n {\n \t$this->User->id = $this->othAuth->user('id');\n \t$user = $this->User->read();\n\n \tif(!empty($this->data))\n \t{\t\n \t\tif($this->User->save($this->data))\n \t\t{\n \t\t\t$this->set('saved', true);\n \t\t\t$this->othAuth->updateSession($this->data); \t\t\t\n \t\t}\n \t\t\n \t\t$user = $this->data;\t\t \t\t\n \t}\n \t\n \t$this->set('user', $user);\n }", "public function setImageProfile($name, $profile) {\n\t}", "public function setProfile($profile)\n\t{\n\t\t$this->profile = $profile;\n\t\treturn $this;\n\t}", "function changeProfileAction()\n {\n $this->profile = $_GET['profile'];\n if (!$this->acl->allowSetProfile($this->user['id']))\n {\n return;\n }\n\n $db = atkGetDb();\n $query = $db->createQuery();\n $query->addTable(\"competency_profile_person\");\n $query->addField(\"person_id\");\n $query->addCondition(\"person_id=\" . $this->user['id']);\n $profiles = $db->getrows($query->buildSelect());\n if (count($profiles) > 0)\n {\n $query = $db->createQuery();\n $query->addTable(\"competency_profile_person\");\n $query->addField(\"profile_id\", $this->profile);\n $query->addCondition(\"person_id =\" . $this->user['id']);\n $db->query($query->buildUpdate());\n }\n else\n {\n $query = $db->createQuery();\n $query->addTable(\"competency_profile_person\");\n $query->addField(\"profile_id\", $this->profile);\n $query->addField(\"person_id\", $this->user['id']);\n $db->query($query->buildInsert());\n }\n }", "public function setProfile($profile)\r\n\t{\r\n\t\t$this->profile = $profile;\r\n\r\n\t\treturn $this;\r\n\t}", "public function set_usermeta( $name, $value ) {\r\n\t\t$user_id = get_current_user_id();\r\n\r\n\t\tupdate_user_meta( $user_id, $name, $value );\r\n\t}", "public function __set($propName, $value){\n if ($propName === \"username\") {\n // var_dump($value);\n return $this->setName($value);\n }\n }", "public function setProfileId($profileId);", "function setUser($value) {\n $this->user = $value;\n }", "public function setValue(string $value): IAccountProperty;", "public function setProfileById($sProfileId)\n\t{\n\t\t$this->_sProfileId = $sProfileId;\n\t}", "public function setProfile($profile)\n {\n $this->profile = $profile;\n\n return $this;\n }" ]
[ "0.7361451", "0.6913007", "0.6683392", "0.66306347", "0.64972794", "0.6447662", "0.64177483", "0.6270225", "0.62578416", "0.61828816", "0.60890603", "0.6053624", "0.6053624", "0.6029428", "0.59827733", "0.58786064", "0.5866146", "0.5844599", "0.58039737", "0.5770956", "0.5743725", "0.57340574", "0.57230103", "0.5716651", "0.57105476", "0.563988", "0.56337065", "0.5577171", "0.5549162", "0.55275583" ]
0.71948993
1
Sets the provisionedPlans property value. The plans that are provisioned for the user. Readonly. Not nullable. Supports $filter (eq, not, ge, le).
public function setProvisionedPlans(?array $value): void { $this->getBackingStore()->set('provisionedPlans', $value); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function setAssignedPlans(?array $value): void {\n $this->getBackingStore()->set('assignedPlans', $value);\n }", "public function setAssignedPlans(?array $value): void {\n $this->getBackingStore()->set('assignedPlans', $value);\n }", "public function setDisabledPlans($val)\n {\n $this->_propDict[\"disabledPlans\"] = $val;\n return $this;\n }", "public function getPlans(): Collection\n {\n return $this->plans;\n }", "public function getProvisionedPlans(): ?array {\n $val = $this->getBackingStore()->get('provisionedPlans');\n if (is_array($val) || is_null($val)) {\n TypeUtils::validateCollectionValues($val, ProvisionedPlan::class);\n /** @var array<ProvisionedPlan>|null $val */\n return $val;\n }\n throw new \\UnexpectedValueException(\"Invalid type found in backing store for 'provisionedPlans'\");\n }", "public function getProvisionedPlans(): ?array {\n $val = $this->getBackingStore()->get('provisionedPlans');\n if (is_array($val) || is_null($val)) {\n TypeUtils::validateCollectionValues($val, ProvisionedPlan::class);\n /** @var array<ProvisionedPlan>|null $val */\n return $val;\n }\n throw new \\UnexpectedValueException(\"Invalid type found in backing store for 'provisionedPlans'\");\n }", "function has_paid_plan( $plans ) {\n\t\t\tif ( ! is_array( $plans ) || 0 === count( $plans ) ) {\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\t/**\n\t\t\t * @var FS_Plugin_Plan[] $plans\n\t\t\t */\n\t\t\tfor ( $i = 0, $len = count( $plans ); $i < $len; $i ++ ) {\n\t\t\t\tif ( ! $plans[ $i ]->is_free() ) {\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn false;\n\t\t}", "protected function delete_paid_plans() {\n\t\t\tforeach ( $this->_plans as $plan ) {\n\t\t\t\tif ( $this->_free_plan->id == $plan->id ) {\n\t\t\t\t\t// Skip free plan.\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\t$this->delete_plan( $plan->id );\n\t\t\t}\n\t\t}", "public function query(StripeSubscriptionsPlans $plan)\n {\n /* only for Package */\n /*$users = DB::Table('users')->select('users.id as id', 'users.first_name', 'users.last_name','users.email','users.country_code','users.mobile_number', 'users.status','companies.name as company_name','users.created_at',DB::raw('CONCAT(\"+\",users.country_code,\" \",users.mobile_number) AS mobile'))\n ->leftJoin('companies', function($join) {\n $join->on('users.company_id', '=', 'companies.id');\n })->where('user_type','Driver')->groupBy('id');*/\n\n $plans = $plan->get();\n\n return $plans;\n }", "public function getDisabledPlans()\n {\n if (array_key_exists(\"disabledPlans\", $this->_propDict)) {\n return $this->_propDict[\"disabledPlans\"];\n } else {\n return null;\n }\n }", "public function create_update_subsciption_plans($plans){\n\t\tif($plans)\n\t\t{\n\t\t\tforeach ($plans as $key => $value) {\n\t\t\t\t$plan_exist = getvalfromtbl(\"plan_id\",\"membership_plan\",\"plan_id = '\".$value->id.\"'\",\"single\");\n\t\t\t\tif($plan_exist != \"\")\n\t\t\t\t{\n\t\t\t\t\t/*update details*/\n\t\t\t\t\t$data = array(\n\t\t\t\t\t\t'plan_id'=> $value->id,\n\t\t\t\t\t\t'name' => $value->name,\n\t\t\t\t\t\t'description' => $value->description,\n\t\t\t\t\t\t'amount' => $value->price\n\t\t\t\t\t);\n\t\t\t\t\t$this->db->where('plan_id', $value->id);\n\t\t\t\t\t$this->db->update('membership_plan', $data);\n\t\t\t\t\t/*update details ends*/\n\n\t\t\t\t}else{ \n\t\t\t\t\t/*insert new plan*/\n\t\t\t\t\t$data = array(\n\t\t\t\t\t\t'plan_id'=> $value->id,\n\t\t\t\t\t\t'name' => $value->name,\n\t\t\t\t\t\t'description' => $value->description,\n\t\t\t\t\t\t'amount' => $value->price,\n\t\t\t\t\t\t'createdDate' => date('Y-m-d H:i:s')\n\t\t\t\t\t);\n\t\t\t\t\t$this->db->insert('membership_plan', $data);\n\t\t\t\t\t/*insert new plan ends*/\n\t\t\t\t}\n\t\t\t}\n\t\t}\t\n\t\telse{\n\t\t}\n\t}", "public function setSubscriptionPlanVariations(?array $subscriptionPlanVariations): void\n {\n $this->subscriptionPlanVariations['value'] = $subscriptionPlanVariations;\n }", "private function _getSubscriptionPlans() {\n $subscriptionDetailsModel = new SubscriptionDetailsModel();\n $this->_subscriptionPlans = $subscriptionDetailsModel->getSubscriptionPlans();\n }", "public function plan()\n {\n \n $planList = $this->Plan->find()->toArray();\n $this->set('planList',$planList);\n }", "public function listPlans($planID = null)\n {\n return $this->api->request('POST', '/2.0/subscription/plans', [\n 'plan' => (is_null($planID)) ? $planID : (int) $planID\n ]);\n }", "public function edit(Plans $plan)\n {\n $this->adminOnly();\n $theSelectedProcessor=strtolower(config('settings.subscription_processor','Stripe'));\n return view('plans.edit', ['plan' => $plan,\"theSelectedProcessor\"=>$theSelectedProcessor]);\n }", "public function getBillingPlans()\n {\n # GET /billing_plans\n }", "public function getAssignedPlans(): ?array {\n $val = $this->getBackingStore()->get('assignedPlans');\n if (is_array($val) || is_null($val)) {\n TypeUtils::validateCollectionValues($val, AssignedPlan::class);\n /** @var array<AssignedPlan>|null $val */\n return $val;\n }\n throw new \\UnexpectedValueException(\"Invalid type found in backing store for 'assignedPlans'\");\n }", "public function getAssignedPlans(): ?array {\n $val = $this->getBackingStore()->get('assignedPlans');\n if (is_array($val) || is_null($val)) {\n TypeUtils::validateCollectionValues($val, AssignedPlan::class);\n /** @var array<AssignedPlan>|null $val */\n return $val;\n }\n throw new \\UnexpectedValueException(\"Invalid type found in backing store for 'assignedPlans'\");\n }", "public function setPlanId($value)\n {\n return $this->setParameter('planId', $value);\n }", "public function plans()\n {\n return $this->morphedByMany('App\\Models\\Plan', 'cartable');\n }", "private function validate(&$plans)\n {\n $normalExercises = Exercises::getNormalExercises();\n $normalValue = $normalExercises[array_rand($normalExercises)];\n $cardioExercises = Exercises::getCardioExercises();\n $rings = Exercises::getRings();\n $pullups = Exercises::getPullups();\n $usingLimitedExercises = true;\n foreach ($plans as $key => $plan) {\n if (isset($plans[$key + 1]) && in_array($plans[$key], $cardioExercises)\n && in_array($plans[$key + 1], $cardioExercises)) {\n $plans[$key] = $normalValue;\n }\n if (!$usingLimitedExercises) {\n if ($plans[$key] == $rings || $plans[$key] == $pullups) {\n $plans[$key] = $normalValue;\n }\n } else {\n if ($plans[$key] == $rings) {\n if (!$this->limitedSpacesFlags['rings']) {\n $plans[$key] = $normalValue;\n } else {\n $this->limitedSpacesFlags['rings'] = 0;\n $usingLimitedExercises = false;\n }\n }\n if ($plans[$key] == $pullups) {\n if (!$this->limitedSpacesFlags['pullups']) {\n $plans[$key] = $normalValue;\n } else {\n $this->limitedSpacesFlags['pullups'] = 0;\n $usingLimitedExercises = false;\n }\n }\n }\n }\n }", "public function set_plan( $plan )\n\t{\n\t\t$this->_plan = $plan;\n\t}", "public static function plans(): Collection\n {\n return collect(static::$plans);\n }", "public function deploymentPlans()\n {\n return $this->hasMany('App\\Models\\DeploymentPlan');\n }", "private static function _canManagePlans()\n {\n $license = new \\pm_License();\n $properties = $license->getProperties();\n\n $hasHostingPlans = $properties['can-manage-customers'];\n $hasResellerPlans = $properties['can-manage-resellers'];\n\n if (!$hasHostingPlans || !$hasResellerPlans) {\n return false;\n } else {\n return true;\n }\n }", "public function setPlan(&$data)\n {\n $data['Business']['plan_id'] = 1;\n\n }", "public function setIsProvisioned($isProvisioned)\n {\n $this->isProvisioned = $isProvisioned;\n return $this;\n }", "function has_free_plan( $plans ) {\n\t\t\tif ( ! is_array( $plans ) || 0 === count( $plans ) ) {\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\t/**\n\t\t\t * @var FS_Plugin_Plan[] $plans\n\t\t\t */\n\t\t\tfor ( $i = 0, $len = count( $plans ); $i < $len; $i ++ ) {\n\t\t\t\tif ( $plans[ $i ]->is_free() ) {\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn false;\n\t\t}", "public function getPlans()\n {\n $FinanceApi = new FinanceApi();\n $plans = $FinanceApi->getPlans();\n\n return $plans;\n }" ]
[ "0.6545768", "0.6545768", "0.6227697", "0.57859", "0.5593346", "0.5593346", "0.53638315", "0.52817065", "0.52682275", "0.52576303", "0.5242845", "0.5209125", "0.51723075", "0.51082313", "0.50586414", "0.5055462", "0.5005755", "0.49958318", "0.49958318", "0.49511173", "0.49378094", "0.49273485", "0.49243996", "0.49183106", "0.49129137", "0.49025455", "0.4899933", "0.48632658", "0.48359662", "0.47941762" ]
0.7249505
1
Sets the refreshTokensValidFromDateTime property value. Any refresh tokens or sessions tokens (session cookies) issued before this time are invalid, and applications will get an error when using an invalid refresh or sessions token to acquire a delegated access token (to access APIs such as Microsoft Graph). If this happens, the application will need to acquire a new refresh token by making a request to the authorize endpoint. Readonly. Use invalidateAllRefreshTokens to reset.
public function setRefreshTokensValidFromDateTime(?DateTime $value): void { $this->getBackingStore()->set('refreshTokensValidFromDateTime', $value); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function setRefreshToken($token);", "public function refresh_access_token($refresh_token, $user_id) {\n global $wpdb;\n $token = $this->create_access_token($user_id);\n if ($wpdb->query($wpdb->prepare(\"UPDATE \" . $wpdb->base_prefix . \"user_tokens\n SET access_token = %s,\n access_token_valid = %s\", $token['token'], $token['expires_datetime'])))\n {\n return [\n 'access_token' => $token['token'],\n 'expires_in' => $token['expires_in']\n ];\n }\n return false;\n }", "function refreshToken()\n {\n if (empty($this->refreshToken)) {\n throw new OAuth2InvalidRefreshTokenException();\n }\n\n $grant = new RefreshTokenGrant();\n $token = $this->provider->getAccessToken($grant, ['refresh_token' => $this->refreshToken]);\n\n $this->accessToken = $token->getToken();\n $this->refreshToken = $token->getRefreshToken();\n $this->expires = $token->getExpires();\n }", "public function setSignInSessionsValidFromDateTime(?DateTime $value): void {\n $this->getBackingStore()->set('signInSessionsValidFromDateTime', $value);\n }", "public function test_it_refreshs_expired_token()\n {\n // updated_at will always be updated when saving!\n\n $newUpdateTimeStamp = \\Carbon\\Carbon::yesterday();\n $client = app()->make(Client::class);\n $user = $this->user();\n $imgurToken = $this->imgurToken($user);\n $imgurToken->update([\n 'updated_at' => $newUpdateTimeStamp,\n ]);\n\n $client->setUser($user);\n\n $this->assertNotEquals(\n $newUpdateTimeStamp,\n $client->getUser()->imgurToken->updated_at\n );\n }", "public function refresh_user_token() {\n $params = array(\n 'grant_type' => 'refresh_token',\n 'client_id' => $this->app_id,\n 'client_secret' => $this->app_secret,\n );\n $this->_update_token($params);\n return $this->access_token != null;\n }", "public function setRefreshToken($refreshToken)\n {\n $this->refreshToken = $refreshToken;\n }", "private function refreshToken() {\n\n $body = array(\"refresh\" => $this->authtokens[\"refresh\"]); \n $ch = curl_init($this->endpoints[\"refresh\"]);\n curl_setopt($ch, CURLOPT_CUSTOMREQUEST, \"POST\");\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); // Otherwise reponse=1\n curl_setopt($ch, CURLOPT_IPRESOLVE, CURL_IPRESOLVE_V4 );\n curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 7); //Timeout after 7 seconds\n curl_setopt($ch, CURLINFO_HEADER_OUT, false);\n curl_setopt($ch, CURLOPT_HEADER, false);\n curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($body));\n curl_setopt($ch, CURLOPT_HTTPHEADER, $this->headers);\n\n $result = curl_exec($ch);\n $statusCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);\n curl_close($ch);\n if ($statusCode != 200) {\n $this->logError(sprintf(\"Unable to refresh auth token %s:\\n%s\\n\", $statusCode, $result));\n } else {\n $respObj = json_decode($result);\n if ($respObj->access != null) {\n $this->authtokens[\"access\"] = $respObj->access;\n }\n }\n }", "public function setRefreshToken($refreshToken)\n {\n $this->auth->setRefreshToken($refreshToken);\n }", "public function set_refresh_token( $token, $user ) {\n\t\t$refresh = array(\n\t\t\t'scope' => $token['scope'],\n\t\t\t'client_id' => $token['client_id'],\n\t\t\t'iat' => time(),\n\t\t\t'me' => $token['me'],\n\t\t\t'uuid' => $token['uuid'], // Uses the token UUID from the access token and adds it to the refresh token allowing them to be associated.\n\t\t);\n\t\t$this->refresh_tokens->set_user( $user );\n\t\t$expires_in = array_key_exists( 'expires_in', $token ) ? $token['expires_in'] : null;\n\n\t\treturn $this->refresh_tokens->set( $refresh, $expires_in + 300 );\n\t}", "protected function refreshToken()\n {\n $payload = [\n ['name' => 'client_id', 'contents' => $this->client_id],\n ['name' => 'client_secret', 'contents' => $this->client_secret],\n ['name' => 'refresh_token', 'contents' => $this->refresh_token],\n ['name' => 'grant_type', 'contents' => 'refresh_token'],\n ];\n $response = $this->post('https://cloud.merchantos.com/oauth/access_token.php', [\n 'multipart' => $payload\n ]);\n $token = json_decode($response->getBody(), true)['access_token'];\n if ($token) {\n $this->access_token = $token;\n error_log('New Access Token: '. substr($token, 0, 8) . '************', 0);\n }\n }", "public function setTokenExpiry($secondsFromNow) {\n\n $seconds = intval($secondsFromNow);\n if ( $seconds > 0 ) {\n $this->logger->debug(\"DHL access token expiry in {$secondsFromNow} seconds\");\n $tokenExpiry = new DateTime('NOW');\n $tokenExpiry->modify(\"+ {$seconds} seconds\");\n $this->setCachedTokenExpiry($tokenExpiry);\n }\n else {\n $this->setCachedToken(null);\n }\n }", "public function testRefreshWithValidToken(\\ApiTester $I)\n {\n $I->register(true);\n $I->wantTo('verify refresh token renews session token');\n $payload = [\n 'refresh_token' => $I->getTokens()['refresh_token']\n ];\n\n $I->haveHttpHeader('Content-Type', 'application/json');\n $I->haveHttpHeader('Accept', 'application/json');\n $I->sendAuthenticatedRequest($this->uri, 'POST', $payload);\n\n $I->seeResponseIsJson();\n $I->seeResponseCodeIs(200);\n $I->seeResponseMatchesJsonType(\n [\n 'data' => [\n 'access_token' => 'string',\n 'refresh_token' => 'string',\n 'ikm' => 'string',\n 'expires_at' => 'integer'\n ],\n 'status' => 'integer'\n ]\n );\n }", "protected function setRefreshToken($refresh_token, $client_id, $expires, $scope = NULL) {\n return;\n }", "protected function refreshToken() {\n\t\t$now = round(microtime(true) * 1000);\n\t\t$notExpired = $this->tokenKeyExpires != null && $this->tokenKeyExpires > $now;\n\t\t$canRefresh = $this->tokenKeyNextRefresh != null &&\n\t\t\t\t($this->tokenKeyNextRefresh < $now || $this->tokenKeyNextRefresh > $this->tokenKeyExpires);\n\t\t// token present and NOT expired\n\t\tif ($this->tokenKey != null && $notExpired && $canRefresh) {\n\t\t\t$result = $this->getEntity($this->invokeGet(self::JWT_PATH));\n\t\t\tif ($result != null && array_key_exists(\"user\", $result) && array_key_exists(\"jwt\", $result)) {\n\t\t\t\t$jwtData = $result[\"jwt\"];\n\t\t\t\t$this->tokenKey = $jwtData[\"access_token\"];\n\t\t\t\t$this->tokenKeyExpires = $jwtData[\"expires\"];\n\t\t\t\t$this->tokenKeyNextRefresh = $jwtData[\"refresh\"];\n\t\t\t\treturn true;\n\t\t\t} else {\n\t\t\t\t$this->clearAccessToken();\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}", "public function setRefreshToken($refresh_token, $client_id, $user_id, $expires, $scope = null)\n {\n // TODO: Implement setRefreshToken() method.\n }", "public function isRefreshTokenExpired(?int $now = null): bool\n {\n $now = $now ?? time();\n return $this->refresh_token_expire_time < $now;\n }", "public function setRefreshToken(\n $refresh_token,\n $client_id,\n $user_id,\n $expires,\n $scope = null\n ) {\n $results = $this->getEventManager()->trigger(\n __FUNCTION__,\n $this,\n [\n 'refresh_token' => $refresh_token,\n 'client_id' => $client_id,\n 'user_id' => $user_id,\n 'expires' => $expires,\n 'scope ' => $scope,\n ]\n );\n if ($results->stopped()) {\n return $results->last();\n }\n\n $doctrineRefreshTokenField =\n $this->getConfig()->mapping->RefreshToken->mapping->refresh_token->name;\n\n $refreshToken = $this->getObjectManager()\n ->getRepository($this->getConfig()->mapping->RefreshToken->entity)\n ->findOneBy([\n $doctrineRefreshTokenField => $refresh_token,\n ]);\n\n if (! $refreshToken) {\n $entityClass = $this->getConfig()->mapping->RefreshToken->entity;\n\n $refreshToken = new $entityClass;\n $this->getObjectManager()->persist($refreshToken);\n }\n\n $mapper = $this->getMapperManager()->get('RefreshToken');\n $mapper->exchangeOAuth2Array([\n 'refresh_token' => $refresh_token,\n 'client_id' => $client_id,\n 'user_id' => $user_id,\n 'expires' => $expires,\n 'scope' => $scope,\n ]);\n\n $scopes = new ArrayCollection;\n foreach ((array)$scope as $scopeString) {\n $scopes->add($this->getObjectManager()\n ->getRepository($this->getConfig()->mapping->Scope->entity)\n ->findOneBy([\n $this->getConfig()->mapping->Scope->mapping->scope->name => $scopeString,\n ]));\n }\n\n $refreshToken->exchangeArray($mapper->getDoctrineArrayCopy());\n\n $this->getObjectManager()->flush();\n\n return true;\n }", "public function setApiTokenDate()\n {\n // calculate and then set token date\n // this function assumes it will be called in the context of using the token\n if ($this->apiTokenDate = time()) {\n return True;\n } else {\n return False;\n }\n }", "public function setDefaultRefreshToken($refreshToken);", "protected function _od_refreshToken()\n {\n if (!property_exists($this->token, 'expires') || $this->token->expires < time()) {\n if (!$this->options['client_id']) {\n $this->options['client_id'] = ELFINDER_ONEDRIVE_CLIENTID;\n }\n\n if (!$this->options['client_secret']) {\n $this->options['client_secret'] = ELFINDER_ONEDRIVE_CLIENTSECRET;\n }\n\n if (empty($this->token->data->refresh_token)) {\n throw new \\Exception(elFinder::ERROR_REAUTH_REQUIRE);\n } else {\n $refresh_token = $this->token->data->refresh_token;\n $initialToken = $this->_od_getInitialToken();\n }\n\n $url = self::TOKEN_URL;\n\n $curl = curl_init();\n\n curl_setopt_array($curl, array(\n // General options.\n CURLOPT_RETURNTRANSFER => true,\n CURLOPT_POST => true, // i am sending post data\n CURLOPT_POSTFIELDS => 'client_id=' . urlencode($this->options['client_id'])\n . '&client_secret=' . urlencode($this->options['client_secret'])\n . '&grant_type=refresh_token'\n . '&refresh_token=' . urlencode($this->token->data->refresh_token),\n\n CURLOPT_URL => $url,\n ));\n\n $result = elFinder::curlExec($curl);\n\n $decoded = json_decode($result);\n\n if (!$decoded) {\n throw new \\Exception('json_decode() failed');\n }\n\n if (empty($decoded->access_token)) {\n if ($this->aTokenFile) {\n if (is_file($this->aTokenFile)) {\n unlink($this->aTokenFile);\n }\n }\n $err = property_exists($decoded, 'error')? ' ' . $decoded->error : '';\n $err .= property_exists($decoded, 'error_description')? ' ' . $decoded->error_description : '';\n throw new \\Exception($err? $err : elFinder::ERROR_REAUTH_REQUIRE);\n }\n\n $token = (object)array(\n 'expires' => time() + $decoded->expires_in - 30,\n 'initialToken' => $initialToken,\n 'data' => $decoded,\n );\n\n $this->token = $token;\n $json = json_encode($token);\n\n if (!empty($decoded->refresh_token)) {\n if (empty($this->options['netkey']) && $this->aTokenFile) {\n file_put_contents($this->aTokenFile, json_encode($token));\n $this->options['accessToken'] = $json;\n } else if (!empty($this->options['netkey'])) {\n // OAuth2 refresh token can be used only once,\n // so update it if it is the same as the token file\n $aTokenFile = $this->_od_getATokenFile();\n if ($aTokenFile && is_file($aTokenFile)) {\n if ($_token = json_decode(file_get_contents($aTokenFile))) {\n if ($_token->data->refresh_token === $refresh_token) {\n file_put_contents($aTokenFile, $json);\n }\n }\n }\n $this->options['accessToken'] = $json;\n // update session value\n elFinder::$instance->updateNetVolumeOption($this->options['netkey'], 'accessToken', $this->options['accessToken']);\n $this->session->set('OneDriveTokens', $token);\n } else {\n throw new \\Exception(elFinder::ERROR_CREATING_TEMP_DIR);\n }\n }\n }\n\n return true;\n }", "public function setRefreshToken($value)\n {\n return $this->set('RefreshToken', $value);\n }", "public function setRefreshToken($value)\n {\n return $this->set('RefreshToken', $value);\n }", "protected function configureToken(Google_Client $client)\n {\n $token = $this->calDelegate->getGoogleToken();\n $client->setAccessToken($token);\n\n if ($client->isAccessTokenExpired()) {\n $refreshToken = json_decode($token)->refresh_token;\n $client->refreshToken($refreshToken);\n $this->calDelegate->setGoogleToken($client->getAccessToken());\n }\n }", "public function getRefreshTokensValidFromDateTime(): ?DateTime {\n $val = $this->getBackingStore()->get('refreshTokensValidFromDateTime');\n if (is_null($val) || $val instanceof DateTime) {\n return $val;\n }\n throw new \\UnexpectedValueException(\"Invalid type found in backing store for 'refreshTokensValidFromDateTime'\");\n }", "protected function _refreshTokens($refreshToken)\n {\n ApiDebug::p('refreshing the existing access token');\n\n return $this->_requestTokens('refresh_token', array('refresh_token' => $refreshToken));\n }", "public function refreshToken(): void\n {\n $rest = new RestClient($this->endpoint, $this->clientkey);\n $results = $rest->oauth2Principal();\n $this->access_token = $results->access_token;\n $this->expires_in = $results->expires_in;\n $this->token_type = $results->token_type;\n }", "public function setRefreshToken($token) : oauth2\\Token\n {\n // For any type other than an auth\\Token instance, instantiate a auth\\Token.\n // However, only strings are actually accepted in this scenario (the constructor will throw\n // on invalid types).\n if (!$token instanceof auth\\Token) {\n $token = new auth\\Token($token);\n }\n\n $this->refreshToken = $token;\n\n return $this;\n }", "private function refreshToken()\n {\n try {\n $tokens = $this->getLastToken();\n\n // Create a new GuzzleHTTP Client and define scopes\n $client = new Client();\n\n // Use the authorization code to fetch an access token\n $tokenQuery = array(\n \"grant_type\" => \"refresh_token\",\n \"refresh_token\" => $tokens[\"refresh_token\"]\n );\n\n $tokenUrl = $this->token_url.\"?\".http_build_query($tokenQuery);\n $response = $client->post(\n $tokenUrl, \n [\n 'auth' => [$this->client_id, $this->client_secret],\n 'curl' => array(CURLOPT_SSL_VERIFYPEER => false),\n 'verify' => false\n ]\n );\n\n // Insert in DB the new access token of Aweber\n $body = $response->getBody();\n $creds = json_decode($body, true);\n\n $qry = \"INSERT INTO tokens (access_token, refresh_token, token_type) VALUES (?, ?, ?);\";\n $this->_execQuery($qry, array($creds['access_token'], $creds['refresh_token'], $creds['token_type']));\n } catch (ClientException $e) {\n $response = $e->getResponse();\n error_log($response->getBody()->getContents());\n }\n }", "public function refresh_token(){\n\t\t$this->server->addGrantType(new OAuth2\\GrantType\\RefreshToken($this->storage, array(\n\t\t\t\"always_issue_new_refresh_token\" => true,\n\t\t\t\"unset_refresh_token_after_use\" => true,\n\t\t\t\"refresh_token_lifetime\" => 2419200,\n\t\t)));\n\t\t$this->server->handleTokenRequest($this->request)->send();\n\t}" ]
[ "0.5614436", "0.5479308", "0.54553235", "0.54519945", "0.5420873", "0.5395638", "0.53351605", "0.52748215", "0.5272821", "0.5237755", "0.5199834", "0.5198068", "0.5158336", "0.51209366", "0.5112583", "0.5103457", "0.50894403", "0.50826806", "0.5059215", "0.5046021", "0.504289", "0.5038417", "0.5038417", "0.50174683", "0.49984747", "0.499806", "0.4993905", "0.49937317", "0.49922532", "0.49757233" ]
0.71665007
0
Sets the registeredDevices property value. Devices that are registered for the user. Readonly. Nullable. Supports $expand.
public function setRegisteredDevices(?array $value): void { $this->getBackingStore()->set('registeredDevices', $value); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function setManagedDevices($val)\n {\n $this->_propDict[\"managedDevices\"] = $val;\n return $this;\n }", "public function setDevices(?array $value): void {\n $this->getBackingStore()->set('devices', $value);\n }", "public function setOwnedDevices(?array $value): void {\n $this->getBackingStore()->set('ownedDevices', $value);\n }", "public function setManagedDevices(?array $value): void {\n $this->getBackingStore()->set('managedDevices', $value);\n }", "public function setManagedDevices(?array $value): void {\n $this->getBackingStore()->set('managedDevices', $value);\n }", "public function getDevices()\n {\n return $this->devices;\n }", "public function getRegisteredDevices(): ?array {\n $val = $this->getBackingStore()->get('registeredDevices');\n if (is_array($val) || is_null($val)) {\n TypeUtils::validateCollectionValues($val, DirectoryObject::class);\n /** @var array<DirectoryObject>|null $val */\n return $val;\n }\n throw new \\UnexpectedValueException(\"Invalid type found in backing store for 'registeredDevices'\");\n }", "public function getManagedDevices()\n {\n if (array_key_exists(\"managedDevices\", $this->_propDict)) {\n return $this->_propDict[\"managedDevices\"];\n } else {\n return null;\n }\n }", "public function getDevices(): array\n {\n return $this->devices;\n }", "public function getDevices(): ?array {\n $val = $this->getBackingStore()->get('devices');\n if (is_array($val) || is_null($val)) {\n TypeUtils::validateCollectionValues($val, Device::class);\n /** @var array<Device>|null $val */\n return $val;\n }\n throw new \\UnexpectedValueException(\"Invalid type found in backing store for 'devices'\");\n }", "public function setWindowsInformationProtectionDeviceRegistrations(?array $value): void {\n $this->getBackingStore()->set('windowsInformationProtectionDeviceRegistrations', $value);\n }", "public function setWindowsInformationProtectionDeviceRegistrations(?array $value): void {\n $this->getBackingStore()->set('windowsInformationProtectionDeviceRegistrations', $value);\n }", "public function getRegisteredDevices()\n {\n return response()->json(\n Device::select(['id', 'app_id', 'uid', 'created_at', 'token'])->limit(10)->orderBy('id', 'desc')->get()\n );\n }", "public function getDevices() {\n $devices = isset($this->options['device_detection']) ? $this->options['device_detection'] : NULL;\n\n if ($devices && isset($devices['devices'])) {\n $devices = array_filter($devices['devices'], function ($var) {\n return($var != FALSE);\n });\n }\n return $devices;\n }", "public function devices()\n {\n return $this->hasMany(UserDevice::class);\n }", "public function setRegistered($value)\n {\n $this->registered = $value;\n }", "public function setRegistered($value)\n {\n $this->registered = $value;\n }", "public function setRegistered($value)\n {\n $this->registered = $value;\n }", "public function setManagedAppRegistrations(?array $value): void {\n $this->getBackingStore()->set('managedAppRegistrations', $value);\n }", "public function setManagedAppRegistrations(?array $value): void {\n $this->getBackingStore()->set('managedAppRegistrations', $value);\n }", "public function setDevice($value)\n {\n return $this->set(self::DEVICE, $value);\n }", "public function allDevices() {\n return new Device([\n \"iden\" => \"\",\n \"pushable\" => true,\n \"has_sms\" => false\n ], $this->apiKey);\n }", "public function getManagedDevices(): ?array {\n $val = $this->getBackingStore()->get('managedDevices');\n if (is_array($val) || is_null($val)) {\n TypeUtils::validateCollectionValues($val, ManagedDevice::class);\n /** @var array<ManagedDevice>|null $val */\n return $val;\n }\n throw new \\UnexpectedValueException(\"Invalid type found in backing store for 'managedDevices'\");\n }", "public function getManagedDevices(): ?array {\n $val = $this->getBackingStore()->get('managedDevices');\n if (is_array($val) || is_null($val)) {\n TypeUtils::validateCollectionValues($val, ManagedDevice::class);\n /** @var array<ManagedDevice>|null $val */\n return $val;\n }\n throw new \\UnexpectedValueException(\"Invalid type found in backing store for 'managedDevices'\");\n }", "public function devices () {\n return $this->hasMany('App\\Device');\n }", "public function devices() {\n return $this->hasMany(\"App\\Laravel\\Models\\UserDevice\", \"user_id\");\n }", "public function devices()\n {\n return $this->hasMany('App\\Models\\Devices','user_id','id');\n }", "public function setDeviceId($deviceId);", "public function setDeviceId(?string $value): void {\n $this->getBackingStore()->set('deviceId', $value);\n }", "public function getUserDevices()\n {\n $user = auth::user();\n $devices = Device::where([\n ['organization_id', '=', $user['organization_id']],\n ])->whereNull(\n 'left_pixel'\n )->get();\n \n return $devices;\n }" ]
[ "0.67516774", "0.66809916", "0.6337125", "0.63253486", "0.63253486", "0.5989044", "0.5984837", "0.5835186", "0.5747922", "0.5738687", "0.56750536", "0.56750536", "0.5572345", "0.5533822", "0.5520874", "0.55164397", "0.55164397", "0.55164397", "0.545357", "0.545357", "0.5406226", "0.53584534", "0.5341883", "0.5341883", "0.5268848", "0.5250485", "0.52156717", "0.5203863", "0.51929295", "0.5184893" ]
0.74143755
0
Sets the responsibilities property value. A list for the user to enumerate their responsibilities. Returned only on $select.
public function setResponsibilities(?array $value): void { $this->getBackingStore()->set('responsibilities', $value); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function setResponsibilities($value)\n {\n $this->responsibilities = $value;\n }", "public function getResponsibilities()\n {\n return $this->responsibilities;\n }", "public function setChoicesAttribute($choices)\n {\n if (isset($choices[0])) {\n foreach ($choices as $key => $value) {\n unset($choices[$key]);\n $choices[$value] = $value;\n }\n }\n $this->setContentAttribute('choices', $choices);\n }", "public function responsables()\n {\n return $this->hasMany(Responsable::class, 'persona_id', 'id');\n }", "public function responsables(){\n return $this->belongsToMany(User::class,'diplome_responsables','idDiplome','idResponsable');\n }", "public function set_mechanisms($value)\n {\n if (is_null($value)) {\n $value = array();\n } else if (!is_array($value)) {\n $value = array($value);\n }\n\n $this->mechanisms->clear();\n\n foreach ($value as $id) {\n $mechanism = self::id_or_entity_helper($id, 'Mechanism');\n $this->mechanisms->add($mechanism);\n }\n }", "public function testSetResponsable() {\n\n $obj = new Affaires();\n\n $obj->setResponsable(\"responsable\");\n $this->assertEquals(\"responsable\", $obj->getResponsable());\n }", "function campo_responsivo( $wp_customize ) {\n\t$wp_customize->add_section('responsivo_seccion', array('title' => 'Theme Responsivo', 'priority' => 200 ));\n\t$wp_customize->add_setting( 'responsivo_dato', array('default' => '0', 'transport' => 'postMessage'));\n\t$wp_customize->add_control( 'responsivo_dato', array('label' => 'Seleccione \"SI\" para habilitar las caracter&iacute;sticas responsivas (MUY IMPORTANTE: Debe tener los CSS responsivos previamente configurados)', 'section' \t=> 'responsivo_seccion', 'type' => 'select', 'choices' => array(\"no\", \"si\"), 'priority'\t => 2 ));\n\t}", "public function testSetCodeResponsable() {\n\n $obj = new Intervenants();\n\n $obj->setCodeResponsable(\"codeResponsable\");\n $this->assertEquals(\"codeResponsable\", $obj->getCodeResponsable());\n }", "public function testSetTypeResponsable() {\n\n $obj = new TypeMissions();\n\n $obj->setTypeResponsable(\"typeResponsable\");\n $this->assertEquals(\"typeResponsable\", $obj->getTypeResponsable());\n }", "public function getResponsibilities(): ?array {\n $val = $this->getBackingStore()->get('responsibilities');\n if (is_array($val) || is_null($val)) {\n TypeUtils::validateCollectionValues($val, 'string');\n /** @var array<string>|null $val */\n return $val;\n }\n throw new \\UnexpectedValueException(\"Invalid type found in backing store for 'responsibilities'\");\n }", "public function setSponsors(?array $value): void {\n $this->getBackingStore()->set('sponsors', $value);\n }", "protected function setCapabilities()\n {\n $this->capabilities = [Capability::DB_READ, Capability::VIEW_MACHINES, Capability::ADD_REQUEST,\n Capability::VIEW_AUTHORIZED_REQUESTS, Capability::VIEW_KEY_FOR_REQUEST, Capability::VIEW_REQUESTS];\n }", "public function responsable()\n {\n return $this->belongsTo(Responsable::class, 'responsable_id', 'id');\n }", "public function listarResponsableCombo()\n\t{\n\t\t$this->db->select('*');\n\t\t$this->db->from('rtspersona_deb');\n\t\t$this->db->where('Estado', 1);\n\t\t$this->db->where('IdPersona <> 1');\n\t\t$res = $this->db->get()->result();\n\n\t\treturn $res;\n\t}", "function set_item_caps(&$obj, $cap_names, $value)\r\n\t{\r\n\t\tforeach($cap_names as $cap_name)\r\n\t\t{\r\n\t\t\t$obj->add_cap($cap_name, $value);\r\n\t\t}\r\n\t}", "public function setActivitesPotentiellesValues($responsibilitiesArray, $activitiesString) {\n $activitiesString = trim($activitiesString, '}');\n if ($activitiesString != '{') {\n $activitiesString = $activitiesString . ',';\n }\n if (($key = array_search('(admin_region)', $responsibilitiesArray)) !== false) {\n unset($responsibilitiesArray[$key]);\n }\n if (($key = array_search('(admin_comite)', $responsibilitiesArray)) !== false) {\n unset($responsibilitiesArray[$key]);\n }\n if (empty($responsibilitiesArray)) {\n $activitiesString = trim($activitiesString, ',');\n }\n foreach ($responsibilitiesArray as $value) {\n $activitiesString = $activitiesString . $value;\n if ($value !== end($responsibilitiesArray)) {\n $activitiesString = $activitiesString . ',';\n }\n }\n return $activitiesString . '}';\n }", "function meteorslides_set_options_cap(){\n\n\t\tif ( function_exists( 'members_get_capabilities' ) ) {\n\t\n\t\t\treturn 'meteorslides_manage_options';\n\t\t\n\t\t} else {\n\t\n\t\t\treturn 'manage_options';\n\t\t\n\t\t}\n\t\n\t}", "public function testSetCodeResponsable() {\n\n $obj = new TypeMissions();\n\n $obj->setCodeResponsable(\"codeResponsable\");\n $this->assertEquals(\"codeResponsable\", $obj->getCodeResponsable());\n }", "public function setChoices(?array $value): void {\n $this->getBackingStore()->set('choices', $value);\n }", "public function setResponses($responses);", "public function set_msa_responses($value)\n {\n if (is_null($value)) {\n $value = array();\n } else if (!is_array($value)) {\n $value = array($value);\n }\n\n $this->msa_responses->clear();\n\n foreach ($value as $id) {\n $response = self::id_or_entity_helper($id, 'MentalResponse');\n $this->msa_responses->add($response);\n }\n }", "private function _update_capabilities ( $restrictions ) {\n\t\t$output = array();\n\t\t$saveables = Upfront_Permissions::boot()->get_saveable_restrictions();\n\n\t\tforeach ($restrictions as $role => $caps) {\n\t\t\tforeach ($caps as $cap => $allowed) {\n\t\t\t\tif (!$allowed) continue;\n\t\t\t\tif (!isset($output[$cap])) $output[$cap] = array();\n\n\t\t\t\t$output[$cap][] = $role;\n\n\t\t\t\t// If this role needs saving then let's grant the `Upfront_Permissions::SAVE`\n\t\t\t\tif (in_array($cap, $saveables)) {\n\t\t\t\t\tif (!isset($output[Upfront_Permissions::SAVE])) $output[Upfront_Permissions::SAVE] = array();\n\t\t\t\t\tif (!in_array($role, $output[Upfront_Permissions::SAVE])) $output[Upfront_Permissions::SAVE][] = $role;\n\t\t\t\t}\n\t\t\t\t// All done\n\t\t\t}\n\t\t}\n\n\t\tUpfront_Permissions::boot()->set_restrictions($output);\n\t}", "public function setMentions(?array $value): void {\n $this->getBackingStore()->set('mentions', $value);\n }", "public function responsable(){\n return $this->hasMany('App\\User', 'id', 'idresponsable');\n }", "public function setCapabilities( array $capabilities );", "public function setMembersManagement($value) {\n if (is_bool($value)) { $this->MembersManagement = $value; }\n }", "public function setChoices($choices)\n {\n if (func_num_args() > 1) {\n $choices = func_get_args();\n }\n\n $this->choices = [];\n return $this->addChoices($choices);\n }", "protected function setChoices(array $choices): void\n {\n $this->choices = $choices;\n }", "public function setResponsableProyecto( $responsableProyecto ){\n\t\t\t$this->responsableProyecto = $responsableProyecto;\n\t\t}" ]
[ "0.7096318", "0.5410997", "0.48331285", "0.48008507", "0.47332212", "0.4687071", "0.46448404", "0.46404585", "0.45895872", "0.45582464", "0.45303664", "0.45088083", "0.4425898", "0.43697596", "0.43662405", "0.43239757", "0.43042463", "0.427611", "0.42581218", "0.4219248", "0.41628134", "0.4162594", "0.4154007", "0.414003", "0.41338837", "0.4128592", "0.41077524", "0.40954033", "0.4071016", "0.4061542" ]
0.6304744
1
Sets the schools property value. A list for the user to enumerate the schools they have attended. Returned only on $select.
public function setSchools(?array $value): void { $this->getBackingStore()->set('schools', $value); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function schools()\n\t{\n\t\treturn $this->belongsToMany('School');\n\t}", "public function getSchools(){\r\n \r\n $options[\"\"] = \"--Select--\";\r\n \r\n $objects = $this->em->getRepository('\\Application\\Entity\\School')->findAll();\r\n foreach($objects as $object ){\r\n $options[$object->getPkSchoolid()] = $object->getSchoolName();\r\n }\r\n \r\n return $options;\r\n }", "public function schools()\n {\n return $this->belongsToMany(School::class);\n }", "public function schools()\n {\n return $this->hasMany('App\\School');\n }", "public function getAllSchools()\n { \n $schools = $this->school::where('is_deleted',0)->get(); \n return $schools;\n }", "public function schools()\n {\n return Inertia::render('Organization/Index', [\n 'schools' => OrganizationService::activeSchools()\n ]);\n }", "public function getSchool() {\r\n return $this->school;\r\n }", "public function getSchoolsCount()\n {\n self::initialize();\n\n return count(self::$schools);\n }", "public function schools()\n {\n return $this->hasMany('App\\School', 'province', 'name');\n }", "public function getSchoolsListAction()\n {\n\t\t$params=$this->getRequest()->getParams();\n\t\t$keyword=$params[\"term\"];\n\t\t$result=\\Extended\\school_ref::getSchoolList($keyword);\n\t\t$data_arr=array();\n\t\t$i=0;\n\t\twhile($i<count($result))\n\t\t{\n\t\t\t$data_arr[]=array(\n\t\t\t\t\t'label'=>$result[$i]['title'],\n\t\t\t\t\t'value'=>$result[$i]['title'],\n\t\t\t\t\t'id'=>$result[$i]['id']\n\t\t\t\t\t);\n\t\t\t$i++;\n\t\t}\n\t\techo Zend_Json::encode($data_arr);\n\t\tdie;\n }", "public function update(Request $request, Schools $school)\n {\n $request->validate([\n 'name' => 'required|max:255|min:10', \n 'description' => 'nullable|string', \n 'date_created' => 'nullable|date',\n 'states_id' => 'required|exists:states,id',\n 'lga_id' => 'required|exists:lgas,id',\n 'address' => 'required', \n 'programme_id' => 'required|exists:programmes,id', \n 'sponsored_id' => 'required|exists:sponsoreds,id', \n 'jamb_points' => 'nullable|integer',\n 'phone' => 'nullable|min:10|max:10', \n 'meta_description' => 'required|string|min:140|max:150', \n ]);\n\n $school->name = request('name'); \n $school->short_name = request('short_name'); \n $school->description = request('description'); \n $school->date_created = request('date_created');\n $school->website = request('website'); \n $school->portal_website = request('portal_website');\n $school->states_id = request('states_id');\n $school->lga_id = request('lga_id');\n $school->address = request('address'); \n $school->programme_id = request('programme_id'); \n $school->sponsored_id = request('sponsored_id');\n $school->phone = request('phone'); \n $school->email = request('email');\n $school->jamb_points = request('jamb_points');\n $school->meta_description = request('meta_description');\n $school->hostels_accomodation = request('hostels_accomodation');\n\n $school->save();\n\n return $school;\n }", "protected function setSchool($school) {\r\n $this->school = $this->create($school);\r\n }", "public function getSchool()\n {\n return $this->school;\n }", "public function setSchool($school)\n {\n $this->school = $school;\n return $this;\n }", "public function create(Schools $school)\n {\n return $school;\n }", "public function scopeInSchools($query, $schools)\n {\n return $query->join('school_user', 'school_user.user_id', '=', 'users.id')\n ->where('users.id','<>',Auth::id())\n ->whereIn('school_user.school_id', $schools->lists('id')->toArray())\n ->select('users.*')\n ->groupBy('users.id');\n\n }", "public function getSchools(): ?array {\n $val = $this->getBackingStore()->get('schools');\n if (is_array($val) || is_null($val)) {\n TypeUtils::validateCollectionValues($val, 'string');\n /** @var array<string>|null $val */\n return $val;\n }\n throw new \\UnexpectedValueException(\"Invalid type found in backing store for 'schools'\");\n }", "public function getSchoolsForFeeDetails(){\n $filledSchoolIDS = [];\n $schoolFeeDetail = $this->schoolFeeDetail::where('status',1)->where('is_deleted',0)->get();\n foreach ($schoolFeeDetail as $key => $value) {\n $filledSchoolIDS[] = $value->school_id;\n }\n $schools = $this->school::whereNotIN('id',$filledSchoolIDS)->where('status',1)->where('is_deleted',0)->get();\n return $schools;\n }", "public function getSchool()\n{\nreturn $this->school;\n}", "public function testGetAllSchoolsTest()\n {\n School::Factory()->count(2)->create();\n\n $response = $this->getJSON('/api/school');\n\n $response->assertStatus(200);\n\n $response->assertJsonStructure([\n 'data' => [\n [\n 'id',\n 'name',\n ]\n ]\n ]);\n }", "function getSchools($schoolId = \"\") {\r\n include(\"Data_Source.php\");\r\n mysql_connect(\"$host\", \"$username\", \"$password\")or die(\"Cannot connect to server \" . mysql_error());\r\n mysql_select_db(\"$db_name\")or die(\"Cannot select DB \" . mysql_error());\r\n\r\n $sql = \"SELECT * FROM schools AS s WHERE 1 = 1\";\r\n\r\n if(!empty($schoolId) && $schoolId != NULL) {\r\n $sql .= \" AND s.Id = $schoolId\";\r\n }\r\n\r\n $qrySchools = mysql_query($sql);\r\n\r\n if(mysql_error()) {\r\n echo \"SQL Error: \" . mysql_error();\r\n exit;\r\n }\r\n\r\n mysql_close();\r\n return $qrySchools;\r\n }", "function setSchoolYear($newSchoolYear)\n {\n $this->schoolyear = $newSchoolYear;\n }", "public function setWorkshops(){\n\n\t\t//$studentPlan = $this->plans->first()->id;\n\t\t//dd($this->code);\n\t\t$studentPlan = DB::table('plan_student')->where('matricula', $this->code)->first();\n\t\t//dd($studentPlan->plan_id);\n\t\t//dd($studentPlan);\n\t\t$plan = Plan::find($studentPlan->plan_id);\n\t\t//dd($plan->id);\n\n\t\t$year = new Year();\n\t\t//dd($plan->subjects);\n\t\t$workshops = collect();\n\n\t\t//regresa los planes de estudio del alumno\n\t\t//dd($plan->subjects);\n\t\t//foreach\n\t\tforeach($plan->subjects as $subject){\n\n\n\t\t\t$workshop = Workshop::find($subject->workshop_id);\n\t\t\t$sub = Subject::find($subject->id);\n\n\t\t\t$yearSubject = $subject->year_id;\n\n\t\t\t//si esta disponible y es del ciclo actual agregala\n\n\t\t\t//dd($sub->getQuota());\n\t\t\tif($sub->isAvailable($plan->id) && $year->isCurrentYear($subject->year_id)){\n\t\t\t\t$workshops->push([\n\t\t\t\t\t'id'=> $subject->id,\n\t\t\t\t\t'name'=> $workshop->name,\n\t\t\t\t\t'start_time' => $subject->start_time,\n\t\t\t\t\t'end_time' => $subject->end_time,\n\t\t\t\t\t'description' => $workshop->description,\n\t\t\t\t\t'days' => $subject->subjectDays(),\n\t\t\t\t\t'picture'=> $workshop->picture\n\t\t\t\t]);\n\t\t\t}\n\n\t\t}\n\t\t\n\t\treturn $workshops;\n\t}", "public function schoolsCount()\n {\n \t$standardProducts = collect(Product::$standardList)->map(function($name) {\n \t\treturn [\n \t\t\t'product_ids' => Product::where('name', $name)->pluck('id')->toArray(),\n \t\t\t'product_name' => $name,\n \t\t\t'school_count' => School::whereHas('products', function($query) use ($name) {\n\t \t\t\treturn $query->where('name', $name);\n\t \t\t})->count()\n\t \t];\n \t});\n\n \tif(request()->has('school_count')) {\n \t\t$standardProducts = $standardProducts->filter(function($standardProduct) {\n \t\t\treturn $standardProduct['school_count'] == request()->get('school_count');\n \t\t});\n \t}\n\n \treturn json_encode([\n \t\t'data' => array_values($standardProducts->toArray())\n \t]);\n }", "public function getSchoolDetails();", "function portal_generate_school_option_list() {\n\t// page and the main portal administrator page.\n\t\n\t$option_list = '';\n\t\n\t$current_state = '';\n\t\n\t$schools = portal_get_all_schools_info();\n\t\n\tfor ($i = 0; $i < count($schools); $i++) {\n\t\n\t\tif ($schools[$i]['school_state'] . ' - ' . $schools[$i]['school_district'] != $current_state) {\n\t\t\n\t\t\tif ($i > 0) {\n\t\t\t\t\n\t\t\t\t$option_list .= '\n\t\t\t\t</optgroup>\n\t\t\t\t';\n\t\t\t\n\t\t\t}\n\t\t\n\t\t\t$current_state = $schools[$i]['school_state'] . ' - ' . $schools[$i]['school_district'];\n\n\t\t\t$option_list .= '\n\t\t\t<optgroup label=\"' . $current_state . '\">\n\t\t\t';\n\t\t\n\t\t}\n\t\t\n\t\t$option_list .= '\n\t\t<option value=\"' . $schools[$i]['school_id'] . '\">' . $schools[$i]['school_city'] . ' — ' . $schools[$i]['school_name'] . '</option>\n\t\t';\n\t\n\t}\n\n\t$option_list .= '\n\t</optgroup>\n\t';\n\t\n\treturn $option_list;\n\n}", "public function index()\n {\n $schools = School::getAllSchools();\n return SchoolResource::collection($schools);\n }", "function getAllSchoolByCounty($county_id){\t\n\t \t\tApp::import('model','School');\n\t\t $this->School = new School();\t\t\t\n\t\t\t$SchoolList = $this->School->find('list', array('fields' => array('id', 'schoolname'),'order' => 'School.schoolname ASC','recursive' => -1,'conditions' => array('School.publish' => 'yes','School.county_id'=>$county_id)));\t\t\t\n\t\t\treturn $SchoolList;\n\t }", "public function setSchoolId($schoolId){\n\n $this->_school_id = trim($schoolId);\n\n return $this;\n }", "public function setSchoolName($var)\n {\n GPBUtil::checkString($var, True);\n $this->school_name = $var;\n\n return $this;\n }" ]
[ "0.6487523", "0.6459763", "0.63945216", "0.6084597", "0.60034686", "0.5905659", "0.57467616", "0.56848747", "0.5678059", "0.5670182", "0.5606438", "0.5604208", "0.55887836", "0.5560224", "0.5460947", "0.5425625", "0.5418207", "0.5305213", "0.52730536", "0.52427655", "0.5234156", "0.52330124", "0.51992285", "0.51949483", "0.5137708", "0.5118213", "0.51146126", "0.505435", "0.50440407", "0.5036363" ]
0.69438463
0
Sets the scopedRoleMemberOf property value. The scopedrole administrative unit memberships for this user. Readonly. Nullable.
public function setScopedRoleMemberOf(?array $value): void { $this->getBackingStore()->set('scopedRoleMemberOf', $value); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getScopedRoleMemberOf(): ?array {\n $val = $this->getBackingStore()->get('scopedRoleMemberOf');\n if (is_array($val) || is_null($val)) {\n TypeUtils::validateCollectionValues($val, ScopedRoleMembership::class);\n /** @var array<ScopedRoleMembership>|null $val */\n return $val;\n }\n throw new \\UnexpectedValueException(\"Invalid type found in backing store for 'scopedRoleMemberOf'\");\n }", "public function setMemberOf ($memberOf)\n {\n if (is_array($memberOf))\n $this->memberOf = $memberOf;\n else\n $this->memberOf = array($memberOf);\n }", "public function setMemberOf($memberOf)\n {\n $this->_memberOf = $memberOf;\n return $this;\n }", "public function setMember($member);", "public function manageRole($userId)\n {\n $this->currentlyManagingRole = true;\n $this->managingRoleFor = Jetstream::findUserByIdOrFail($userId);\n $this->currentRole = $this->managingRoleFor->teamRole($this->team)->key;\n }", "public function setMembersRole($newVal)\r\n {\r\n if ( is_array($newVal) ) {\r\n foreach ($newVal as &$_value) {\r\n $_value = trim($_value);\r\n if ( !Warecorp_Group_Enum_MemberRole::isIn($_value) ) {\r\n throw new Zend_Exception('Incorrect member role');\r\n }\r\n }\r\n } elseif ( strpos($newVal, ';') ) {\r\n $newVal = explode(';', $newVal);\r\n foreach ($newVal as &$_value) {\r\n $_value = trim($_value);\r\n if ( !Warecorp_Group_Enum_MemberRole::isIn($_value) ) {\r\n throw new Zend_Exception('Incorrect member role');\r\n }\r\n }\r\n } else {\r\n if ( !Warecorp_Group_Enum_MemberRole::isIn($newVal) ) {\r\n throw new Zend_Exception('Incorrect member role');\r\n }\r\n $newVal = array($newVal);\r\n }\r\n $this->_membersRole = $newVal;\r\n return $this;\r\n }", "public function addMember($userId)\n {\n\n $user = User::model()->findByPk($userId);\n $membership = $this->getMembership($userId);\n\n if ($membership == null) {\n // Add Membership\n $membership = new RoomMembership;\n $membership->room_id = $this->getOwner()->id;\n $membership->user_id = $userId;\n $membership->status = RoomMembership::STATUS_MEMBER;\n $membership->invite_role = 0;\n $membership->admin_role = 0;\n $membership->share_role = 0;\n\n $userInvite = UserInvite::model()->findByAttributes(array('email' => $user->email));\n if ($userInvite !== null && $userInvite->source == UserInvite::SOURCE_INVITE) {\n RoomInviteAcceptedNotification::fire($userInvite->user_originator_id, $user, $this->getOwner());\n }\n } else {\n\n // User is already member\n if ($membership->status == RoomMembership::STATUS_MEMBER) {\n return true;\n }\n\n // User requested membership\n if ($membership->status == RoomMembership::STATUS_APPLICANT) {\n RoomApprovalRequestAcceptedNotification::fire(Yii::app()->user->id, $user, $this->getOwner());\n }\n\n // User was invited\n if ($membership->status == RoomMembership::STATUS_INVITED) {\n RoomInviteAcceptedNotification::fire($membership->originator_user_id, $user, $this->getOwner());\n }\n\n // Update Membership\n $membership->status = RoomMembership::STATUS_MEMBER;\n }\n $membership->save();\n\n // Create Wall Activity for that\n $activity = new Activity;\n $activity->content->room_id = $this->getOwner()->id;\n $activity->content->visibility = Content::VISIBILITY_PRIVATE;\n $activity->content->created_by = $this->getOwner()->id;\n $activity->created_by = $userId;\n $activity->type = \"ActivityRoomMemberAdded\";\n $activity->save();\n $activity->fire();\n\n // Members can't also follow the space\n $this->getOwner()->unfollow($userId);\n\n // Cleanup Notifications\n RoomInviteNotification::remove($userId, $this->getOwner());\n RoomApprovalRequestNotification::remove($userId, $this->getOwner());\n }", "public function familyMember()\n {\n if ($this->is_admin && !Member::where('user_id', $this->id)->get()->count()) {\n $tempMember = new Member();\n\n $tempMember->is_administrator = true;\n\n return $tempMember;\n }\n\n return $this->member;\n }", "public function testMemberRole() {\n $membership = Og::createMembership($this->group, $this->user);\n $membership->setState(OgMembershipInterface::STATE_ACTIVE)->save();\n\n $membership = $this->entityTypeManager->getStorage('og_membership')->loadUnchanged($membership->id());\n\n $roles = $membership->getRoles();\n $role = current($roles);\n\n $this->assertEquals(1, count($roles));\n $this->assertEquals(OgRoleInterface::AUTHENTICATED, $role->getName());\n }", "public function memberRole()\n {\n return $this->belongsTo('MemberRole');\n }", "public function getMemberOf()\n {\n return $this->memberof;\n }", "private function setRole()\n {\n $this->role = $this->getUser()->getRoles();\n\n if(in_array('ROLE_USER', $this->role) && count($this->role) > 1) {\n unset($this->role[array_search('ROLE_USER', $this->role)]);\n }\n }", "public function setMembersManagement($value) {\n if (is_bool($value)) { $this->MembersManagement = $value; }\n }", "public function setRole($id, $memberOrOrganization, $role)\n {\n $roles = array('normal', 'observer', 'admin');\n\n if (!in_array($role, $roles)) {\n throw new InvalidArgumentException(sprintf(\n 'The \"role\" parameter must be one of \"%s\".',\n implode(\", \", $roles)\n ));\n }\n\n $params = array(\n 'idMember' => $memberOrOrganization,\n 'type' => $role,\n );\n\n return $this->post($this->getPath($id).'/'.rawurlencode($memberOrOrganization), $params);\n }", "public static function is_member()\n {\n static $is_member = NULL;\n if (NULL !== $is_member)\n return ($is_member);\n\n $role = self::_get_role();\n // banned, and registered/verified but not approved users are not full members\n if ('ban' === $role || 'register' === $role || 'verified' === $role)\n return ($is_member = FALSE);\n\n // TODO: use current_user_can() when/if we create capabilities\n//\t\tif (current_user_can('peepso_member'))\n//\t\t\treturn ($is_member = FALSE);\n\n return ($is_member = TRUE);\n }", "public function inviteMember($userId, $originatorUserId)\n {\n\n $membership = $this->getMembership($userId);\n\n if ($membership != null) {\n\n // User is already member\n if ($membership->status == RoomMembership::STATUS_MEMBER) {\n return;\n }\n\n // User requested already membership, just approve him\n if ($membership->status == RoomMembership::STATUS_APPLICANT) {\n $membership->addMember(Yii::app()->user->id);\n return;\n }\n\n // Already invite, reinvite him\n if ($membership->status == RoomMembership::STATUS_INVITED) {\n // Remove existing notification\n RoomInviteNotification::remove($userId, $this->getOwner());\n }\n } else {\n $membership = new RoomMembership;\n }\n\n\n $membership->room_id = $this->getOwner()->id;\n $membership->user_id = $userId;\n $membership->originator_user_id = $originatorUserId;\n\n $membership->status = RoomMembership::STATUS_INVITED;\n $membership->invite_role = 0;\n $membership->admin_role = 0;\n $membership->share_role = 0;\n\n $membership->save();\n\n RoomInviteNotification::fire($originatorUserId, $userId, $this->getOwner());\n }", "public function addMember($userId)\n {\n\n $user = User::model()->findByPk($userId);\n $membership = $this->getMembership($userId);\n\n if ($membership == null) {\n // Add Membership\n $membership = new SpaceMembership;\n $membership->space_id = $this->getOwner()->id;\n $membership->user_id = $userId;\n $membership->status = SpaceMembership::STATUS_MEMBER;\n $membership->invite_role = 0;\n $membership->admin_role = 0;\n $membership->share_role = 0;\n \n $userInvite = UserInvite::model()->findByAttributes(array('email' => $user->email));\n if ($userInvite !== null && $userInvite->source == UserInvite::SOURCE_INVITE) {\n SpaceInviteAcceptedNotification::fire($userInvite->user_originator_id, $user, $this->getOwner());\n }\n } else {\n\n // User is already member\n if ($membership->status == SpaceMembership::STATUS_MEMBER) {\n return true;\n }\n\n // User requested membership\n if ($membership->status == SpaceMembership::STATUS_APPLICANT) {\n SpaceApprovalRequestAcceptedNotification::fire(Yii::app()->user->id, $user, $this->getOwner());\n }\n\n // User was invited\n if ($membership->status == SpaceMembership::STATUS_INVITED) {\n SpaceInviteAcceptedNotification::fire($membership->originator_user_id, $user, $this->getOwner());\n }\n\n // Update Membership\n $membership->status = SpaceMembership::STATUS_MEMBER;\n }\n $membership->save();\n\n // Create Wall Activity for that\n $activity = new Activity;\n $activity->content->space_id = $this->getOwner()->id;\n $activity->content->visibility = Content::VISIBILITY_PRIVATE;\n $activity->content->created_by = $this->getOwner()->id;\n $activity->created_by = $userId;\n $activity->type = \"ActivitySpaceMemberAdded\";\n $activity->save();\n $activity->fire();\n\n // Members can't also follow the space\n $this->getOwner()->unfollow($userId);\n\n // Cleanup Notifications\n SpaceInviteNotification::remove($userId, $this->getOwner());\n SpaceApprovalRequestNotification::remove($userId, $this->getOwner());\n }", "public function getMemberOf ()\n {\n return $this->memberOf;\n }", "public function setAdmin($userId = \"\")\n {\n\n if ($userId == 0)\n $userId = Yii::app()->user->id;\n\n $membership = $this->getMembership($userId);\n if ($membership != null) {\n $membership->admin_role = 1;\n $membership->save();\n return true;\n }\n return false;\n }", "public function setAdmin($userId = \"\")\n {\n\n if ($userId == 0)\n $userId = Yii::app()->user->id;\n\n $membership = $this->getMembership($userId);\n if ($membership != null) {\n $membership->admin_role = 1;\n $membership->save();\n return true;\n }\n return false;\n }", "public function getMembersRole()\r\n {\r\n if ( $this->_membersRole === null ) $this->_membersRole = array(Warecorp_Group_Enum_MemberRole::MEMBER_ROLE_MEMBER, Warecorp_Group_Enum_MemberRole::MEMBER_ROLE_HOST, Warecorp_Group_Enum_MemberRole::MEMBER_ROLE_COHOST);\r\n return $this->_membersRole;\r\n }", "public function it_can_be_scoped_by_role()\n {\n User::factory()->create();\n User::factory()->create()->assignRole(Role::EDITOR);\n User::factory()->create()->assignRole(Role::ADMIN);\n User::factory()->create()->assignRole(Role::SUPERADMIN);\n\n $this->assertCount(3, User::whereHasRole(Role::EDITOR)->get());\n $this->assertCount(2, User::whereHasRole(Role::ADMIN)->get());\n $this->assertCount(1, User::whereHasRole(Role::SUPERADMIN)->get());\n }", "public function setUsersIn() {\n $users = $this->getProperty('users');\n $memberships = array();\n if (!empty($users)) {\n $users = is_array($users) ? $users : $this->modx->fromJSON($users);\n $memberships = array();\n foreach ($users as $userArray) {\n if (empty($userArray['id']) || empty($userArray['role'])) continue;\n \n /** @var modUserGroupMember $membership */\n $membership = $this->modx->newObject('modUserGroupMember');\n $membership->set('user_group',$this->object->get('id'));\n $membership->set('member',$userArray['id']);\n $membership->set('role',$userArray['role']);\n $memberships[] = $membership;\n }\n $this->object->addMany($memberships);\n }\n return $memberships;\n }", "public function setUsersIn() {\r\n $users = $this->getProperty('users');\r\n $memberships = array();\r\n if (!empty($users)) {\r\n $users = is_array($users) ? $users : $this->modx->fromJSON($users);\r\n $memberships = array();\r\n foreach ($users as $userArray) {\r\n if (empty($userArray['id']) || empty($userArray['role'])) continue;\r\n \r\n /** @var modUserGroupMember $membership */\r\n $membership = $this->modx->newObject('modUserGroupMember');\r\n $membership->set('user_group',$this->object->get('id'));\r\n $membership->set('member',$userArray['id']);\r\n $membership->set('role',$userArray['role']);\r\n $memberships[] = $membership;\r\n }\r\n $this->object->addMany($memberships);\r\n }\r\n return $memberships;\r\n }", "public function setMember($member)\n {\n $this->member = $member;\n\n return $this;\n }", "function clanpress_the_squad_member_role( $member = null ) {\n $member = isset( $member ) ? $member : clanpress_get_squad_member();\n if ( $member->is_admin || $member->is_mod ) {\n $role = __( 'Leader', 'clanpress' );\n } else {\n $role = __( 'Member', 'clanpress' );\n }\n\n echo $role;\n}", "public function addMemberToRole($member, $role)\n {\n $bindings = $this->getBindings();\n $existing = $this->getBinding($role);\n\n if ($existing) {\n array_push($existing['members'], $member);\n $existing['members'] = array_unique($existing['members']);\n\n $this->policy['bindings'] = $bindings->where('role', '!=', $role)\n ->push($existing)\n ->toArray();\n\n return $this;\n }\n\n $bindings->push([\n 'role' => $role,\n 'members' => [\n $member,\n ],\n ]);\n\n $this->policy['bindings'] = $bindings->toArray();\n\n return $this;\n }", "public function update($user, $team, $teamMemberId, string $role)\n {\n Gate::forUser($user)->authorize('updateTeamMember', $team);\n\n Validator::make([\n 'role' => $role,\n ], [\n 'role' => ['required', 'string', new Role],\n ])->validate();\n\n $team->users()->updateExistingPivot($teamMemberId, [\n 'role' => $role,\n ]);\n\n TeamMemberUpdated::dispatch($team->fresh(), Serenity::findUserByIdOrFail($teamMemberId));\n }", "public function userMember () {\n\t\tUser::$user = new User (2);\n\t}", "public function updateRole(UpdateTeamMemberRole $updater)\n {\n $updater->update(\n $this->user,\n $this->team,\n $this->managingRoleFor->id,\n $this->currentRole\n );\n\n $this->team = $this->team->fresh();\n\n $this->stopManagingRole();\n }" ]
[ "0.55790746", "0.508072", "0.49446416", "0.47896948", "0.477355", "0.4765932", "0.47248256", "0.46976325", "0.46444455", "0.4643478", "0.46348977", "0.46063092", "0.4578398", "0.45501423", "0.45322075", "0.45300296", "0.45164895", "0.45008016", "0.44504687", "0.44504687", "0.43935832", "0.43863097", "0.4368491", "0.43597782", "0.4356025", "0.43398392", "0.43287164", "0.43130678", "0.42755213", "0.42580608" ]
0.59414
0
Sets the security property value. The security property
public function setSecurity(?Security $value): void { $this->getBackingStore()->set('security', $value); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function setSecure($value) {\n $this->secure = (boolean) $value;\n }", "public function setSecurityIdentifier(?string $value): void {\n $this->getBackingStore()->set('securityIdentifier', $value);\n }", "public function setSecure( $_value ) {\n\t\treturn $this -> setConfig( 'secure', $_value, $this -> possibleBool() );\n\t}", "public function setSecurityPolicy(Dwoo_Security_Policy $policy = null)\n\t{\n\t\t$this->securityPolicy = $policy;\n\t}", "public abstract function setSecurityProvider(ProviderInterface $securityProvider): void;", "public function setSecure($secure)\n\t{\n\t\t$this->secure = $secure;\n\t}", "public function setCustomSecurityAttributes(?CustomSecurityAttributeValue $value): void {\n $this->getBackingStore()->set('customSecurityAttributes', $value);\n }", "public function setSecurity(SecurityContextInterface $security)\n {\n $this->security = $security;\n\n $this->loadUserStoredSettings($this->security->getToken());\n }", "public function setSecurity($security) {\n if ($security !== self::SECURITY_NO_TLS && $security !== self::SECURITY_TLS && $security !== self::SECURITY_SSL) {\n throw new MailException('Could not set the security: provided security is invalid, try notls, tls or ssl');\n }\n\n $this->security = $security;\n }", "public function setOnPremisesSecurityIdentifier(?string $value): void {\n $this->getBackingStore()->set('onPremisesSecurityIdentifier', $value);\n }", "public function __set($property, $value) {\n\t\tswitch($property) {\n\t\t\tcase 'auth':\n\t\t\t\t$this->auth = $value;\n\t\t\t\tbreak;\n\n\t\t\tcase 'user':\n\t\t\t\t$this->user = $value;\n\t\t\t\t$GLOBALS['user'] = $value;\n\t\t\t\tbreak;\n\n\t\t\tdefault:\n\t\t\t\tparent::__set($property, $value);\n\t\t\t\tbreak;\n\t\t}\n\t}", "public function setRights($value)\n {\n $this->setProperty(\"Rights\", $value, true);\n }", "public function set_security_policy($policy)\n {\n clearos_profile(__METHOD__, __LINE__);\n\n if ($errmsg = $this->validate_security_policy($policy))\n throw new Validation_Exception($errmsg);\n\n $file = new File(self::FILE_SYSCONFIG);\n\n if ($file->exists()) {\n $matches = $file->replace_lines('/^BIND_POLICY=.*/', \"BIND_POLICY=$policy\\n\");\n if ($matches === 0)\n $file->add_lines(\"BIND_POLICY=$policy\\n\");\n } else {\n $file->create('root', 'root', '0644');\n $file->add_lines(\"BIND_POLICY=$policy\\n\");\n }\n }", "public function setSecurity($security)\n {\n $this->security = $security;\n\n return $this;\n }", "private function setSecurity(SimpleXMLElement $element)\n {\n $security = $element->addChild('security');\n\n $xml_roles = new CNabuXMLSiteMapRoleList($this->nb_data_object->getRoles());\n $xml_roles->build($security);\n }", "public function setSecure($secure)\n {\n $this->offsetSet('secure', $secure);\n }", "public function setOriginSystem(?string $value): void {\n $this->getBackingStore()->set('originSystem', $value);\n }", "function setUser($value) {\n $this->user = $value;\n }", "public function setSecure($secure)\n {\n $this->secure = (bool) $secure;\n }", "public function setAccess($property, bool $set);", "private function setSecure()\n {\n $this->secure = json_decode(file_get_contents(__DIR__.'/../../conf/secure.json'), true);\n }", "public function setPermissionAttribute($value)\n {\n $this->attributes[\"permission\"] = ($value[0] != \"_\") ? \"_{$value}\" : $value;\n }", "public function setProperty($name, $value) {}", "public function setProperty($name, $value) {}", "public function setProperty($name, $value) {}", "public function setProperty($name, $value) {}", "public function setIsManagementRestricted(?bool $value): void {\n $this->getBackingStore()->set('isManagementRestricted', $value);\n }", "public function setCertificationAuthority(?string $value): void {\n $this->getBackingStore()->set('certificationAuthority', $value);\n }", "function siteorigin_settings_set( $setting, $value ){\n\tSiteOrigin_Settings::single()->set( $setting, $value );\n}", "public function setAsAuthorized()\n\t{\n\t\t$_SESSION[self::SESSION_IS_LOGGED] = TRUE;\n\t\t$_SESSION[self::SESSION_USER_NAME] = 'helbrary_user';\n\t}" ]
[ "0.6466056", "0.6195101", "0.61908996", "0.6037272", "0.59186614", "0.5824627", "0.5816268", "0.5810739", "0.5684771", "0.56389916", "0.56355697", "0.5635456", "0.560178", "0.5589903", "0.55597556", "0.5530683", "0.55059654", "0.54949284", "0.5479605", "0.5473163", "0.5420529", "0.5357825", "0.5347588", "0.5347588", "0.5347588", "0.5347588", "0.5341205", "0.532893", "0.5321781", "0.5310844" ]
0.73947924
0
Sets the securityIdentifier property value. Security identifier (SID) of the user, used in Windows scenarios. Readonly. Returned by default. Supports $select and $filter (eq, not, ge, le, startsWith).
public function setSecurityIdentifier(?string $value): void { $this->getBackingStore()->set('securityIdentifier', $value); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getSecurityId()\n\t{\n\t\treturn $this->securityId;\n\t}", "public function setOnPremisesSecurityIdentifier(?string $value): void {\n $this->getBackingStore()->set('onPremisesSecurityIdentifier', $value);\n }", "public function setSecurityId($newSecurityId){\n\t\t//allow the securityId to be null if a new object\n\t\tif($newSecurityId === null){\n\t\t\t$this->securityId = null;\n\t\t\treturn;\n\t\t}\n\n\t\t//ensure securityId is an integer\n\t\tif(filter_var($newSecurityId, FILTER_VALIDATE_INT) === false){\n\t\t\tthrow(new UnexpectedValueException(\"security id $newSecurityId is not numeric\"));\n\t\t}\n\n\t\t//enforce security id is an int and positive\n\t\t$newSecurityId = intval($newSecurityId);\n\t\tif($newSecurityId <= 0) {\n\t\t\tthrow(new RangeException(\"security id $newSecurityId is not positive\"));\n\t\t}\n\n\t\t//assign securityId\n\t\t$this->securityId = $newSecurityId;\n\t}", "public function GetSID()\r\n {\r\n return $this->_SID;\r\n }", "public function setIdentity($identifier)\n {\n $this->souls->identity = $identifier;\n }", "protected static function setSid(){\n posix_setsid();\n }", "public function setSecurity(?Security $value): void {\n $this->getBackingStore()->set('security', $value);\n }", "public function setUsr_id($value) {\r\n\t\t\t\t\t\tif( !is_string($value) ) {\r\nif(DEBUG_C)\t\t\t\techo \"<p class='debugClass err'><b>Line \" . __LINE__ . \"</b>: usr_id: Must be DATATYPE 'String'! <i>(\" . basename(__FILE__) . \")</i></p>\";\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t$this->usr_id = cleanString($value);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}", "public function setAttackSimUserId(?string $value): void {\n $this->getBackingStore()->set('attackSimUserId', $value);\n }", "public function setIdentifier($identifier);", "public function setIdentifier($identifier);", "public function setIdentifier($identifier);", "public function addSID() {\n\t\t$this->use_sid = true;\n\t\treturn $this;\n\t}", "public function getSid()\n\t{\n\t\treturn $this->sid;\n\t}", "public function setCsid($value)\n {\n return $this->setParameter('csid', $value);\n }", "public function setSecurity($security)\n {\n $this->security = $security;\n\n return $this;\n }", "public function getSecurityIdentifier(): ?string {\n $val = $this->getBackingStore()->get('securityIdentifier');\n if (is_null($val) || is_string($val)) {\n return $val;\n }\n throw new \\UnexpectedValueException(\"Invalid type found in backing store for 'securityIdentifier'\");\n }", "public function getSid($identity);", "public function getSid()\r\n\t\t{\r\n\t\t\treturn( $this->intSid );\r\n\t\t}", "public function setUserIdentifier($identifier): void\n {\n $this->user_id = $identifier;\n }", "public function setUserIdentifier($identifier);", "public function setUserIdentifier($identifier);", "protected static function getMySid(){\n return posix_getsid(0);\n }", "public function getSid() {\n $params = [\n 'account' => $this->username,\n 'passwd' => $this->password,\n 'session' => 'DownloadStation',\n 'format' => 'sid'\n ];\n return $this->request('auth', 'SYNO.API.Auth', 'login', 3, $params);\n }", "function setScortaUserId($scortaUserId)\n {\n $this->scortaUserId = $scortaUserId;\n }", "public function getSecurityCode()\n {\n return $this->_securityCode;\n }", "public function setIdentifierValue($var) {}", "final function setUser_id($value) {\n\t\treturn $this->setUserId($value);\n\t}", "public function create_sid() {\n $this->_sId = openssl_random_pseudo_bytes(32);\n return $this->_sId;\n }", "public function setIdentifier($identifier)\n {\n $this->identifier = $identifier;\n }" ]
[ "0.61267716", "0.60816056", "0.56722414", "0.54611164", "0.54270613", "0.5360955", "0.51936316", "0.51853156", "0.51730686", "0.5129279", "0.5129279", "0.5129279", "0.5123123", "0.50849533", "0.49778548", "0.49734345", "0.49235654", "0.48781595", "0.48760682", "0.48566416", "0.48564872", "0.48564872", "0.483265", "0.4786349", "0.4770097", "0.474325", "0.47422096", "0.4731794", "0.47155112", "0.4707488" ]
0.6939526
0
Sets the showInAddressList property value. Do not use in Microsoft Graph. Manage this property through the Microsoft 365 admin center instead. Represents whether the user should be included in the Outlook global address list. See Known issue.
public function setShowInAddressList(?bool $value): void { $this->getBackingStore()->set('showInAddressList', $value); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getIsInAddressFolderAttribute()\n {\n return in_array($this->folder_id, self::ADDRESS_FOLDER_IDS);\n }", "public function getShowInAddressList(): ?bool {\n $val = $this->getBackingStore()->get('showInAddressList');\n if (is_null($val) || is_bool($val)) {\n return $val;\n }\n throw new \\UnexpectedValueException(\"Invalid type found in backing store for 'showInAddressList'\");\n }", "public function showAddressAutocomplete()\n {\n if ($this->addressAutocompleteHelperData->getAddressAutocompleteStatus()) {\n return true;\n }\n return false;\n }", "public function showInListing()\n {\n return $this->hasOption('show_in_listing') ? $this->getOption('show_in_listing') : false;\n }", "public function revealAddress(){\n \tif(!$this->AddressLine1 && !$this->AddressLine2)\n \t\treturn true;\n \tif(!$this->AddressLine1Visible && !$this->AddressLine2Visible)\n \t\treturn true;\n \t$member = Member::currentUser();\n \tif(!$member)\n \t\treturn false;\n \tif($this->ClientID == $member->ID)\n \t\treturn true;\n \t$reveal = Reveal::get()->filter(array(\n \t\t\t'ContractorID' => $member->ID,\n \t\t\t'TenderID' => $this->ID\n \t))->first();\n \tif($reveal && $reveal->RevealAddress)\n \t\treturn true;\n \treturn false;\n }", "public function z_listAddresses(bool $includeWatchOnly = false)\n {\n return $this->__call('z_listaddresses', [$includeWatchOnly]);\n }", "public function set_friendsListPublic(bool $friendsListPublic){\n\t\t$this->friendsListPublic = $friendsListPublic;\n\t}", "public function clientsListAddress()\n {\n AuthRequire::loginIsRequired();\n $clientId = intval(end($this->_request->uriSegments));\n $clientModel = new ClientModel();\n $clientRows = $clientModel->select(\"*\", \"client_id\", $clientId);\n if (count($clientRows) > 0) {\n $clientRows = current($clientRows);\n $address = new AddressModel();\n $list = $address->select(\"*\", \"client_id\", $clientId);\n $this->setMetatag('title', ' - Lista de Endereços', true);\n $this->showView('address/list', ['list' => $list, 'client' => $clientRows, 'client_id' => $clientId, 'count' => count($list), 'hasRecords' => count($list) > 0]);\n } else {\n $this->_redirect(\"/clients/list\");\n }\n }", "public function getAdministrativeAreasList()\n {\n if (! $this->administrativeAreasList) {\n $this->administrativeAreasList = $this->addressing->getAdministrativeAreaRepository()->getList($this->getCountryCode(),\n 0, $this->getLocale());\n }\n\n return $this->administrativeAreasList;\n }", "public function isEmptyAddressList()\n {\n return empty($this->getAddressList());\n }", "public function setAddressMultiOptions()\n {\n if ($this->_user instanceof UserModel) {\n $usersAddressBook = new UsersAddressBook();\n $addressMultiOptions = $usersAddressBook->getMultiOptions($this->_user, '<br>', true);\n\n if (count($addressMultiOptions) > 0) {\n\n $addressMultiOptions[0] = array(\n 'title' => $this->getTranslate()->_('New address'),\n 'locationId' => null,\n 'postCode' => null,\n );\n }\n\n $this->_addressMultiOptions = $addressMultiOptions;\n }\n\n return $this;\n }", "public function subscribeAddress($list, $email)\n {\n return $this->client->put(\n 'lists/' . $list . '/members/' . $this->getAddressId($email),\n ['status' => 'subscribed', 'email_address' => $email]\n );\n }", "public function shouldShowShippingAddressForm()\n {\n return $this->_helper()->shouldShowShippingAddressForm();\n }", "public function setAddresses($addresses) {\n $this->addresses = $addresses;\n }", "public function isSingleAddress()\n {\n return 1 == count($this->getAddressList());\n }", "public function getAddressList()\n {\n if (!is_null($this->addressList)) {\n return $this->addressList;\n }\n\n $this->addressList = array();\n\n foreach ($this->getCustomer()->getAddresses() as $address) {\n\n $item = array(\n $address->getData('firstname') . ' ' . $address->getData('lastname'),\n $address->getData('postcode') . ' '. $address->getData('street') . ' ' . $address->getData('city'),\n $address->getData('region'),\n Mage::getModel('directory/country')->load($address->getData('country_id'))->getName()\n );\n\n $this->addressList[$address->getEntityId()] = implode(', ', $item);\n }\n\n return $this->addressList;\n }", "public function setAddresses(?array $value): void {\n $this->getBackingStore()->set('addresses', $value);\n }", "public function getAddressbook()\r\n {\r\n $numArgs = func_num_args();\r\n if ($numArgs > 0) throw new Warecorp_Exception(\"ERROR USING METHOD getAddressbook. NO params.\");\r\n if ( $this->Addressbook === null ) {\r\n $this->Addressbook = new Warecorp_User_Addressbook_ContactList(false, 'owner_id', $this->id);\r\n }\r\n return $this->Addressbook;\r\n }", "public function hasContactList()\n {\n return count($this->get(self::CONTACTLIST)) !== 0;\n }", "public function setIPv6Addresses(array $ipv6List)\n {\n $this->_ipv6 = $ipv6List;\n return $this;\n }", "public function setImAddresses(?array $value): void {\n $this->getBackingStore()->set('imAddresses', $value);\n }", "public function isSetShipFromAddress()\n {\n return !is_null($this->_fields['ShipFromAddress']['FieldValue']);\n\n }", "public function setUserDefinedList(array $userDefinedList)\n {\n $this->userDefinedList = $userDefinedList;\n return $this;\n }", "public function is_applied_to_user_lists() {\n // display of user lists for activities.\n return true;\n }", "function setAddress($value);", "public function issetAddress($index)\n {\n return isset($this->address[$index]);\n }", "private static function validateList($list, &$displayValue)\n\t{\n\t\t$list = explode('|', $list);\n\t\tif (in_array($displayValue, $list))\n\t\t\treturn $displayValue;\n\t\treturn false;\n\t}", "public function setFormattedAddress($formattedAddress);", "public function listAddresses($addresses = \"*\", $verbose = false, $count = \"MAX\", $start = \"-count\")\n {\n return $this->jsonRPCClient->execute(\"listaddresses\", [$addresses, $verbose, $count, $start]);\n }", "public function hasInvoiceAddress() : bool;" ]
[ "0.54852206", "0.5479391", "0.5426699", "0.54071164", "0.53543675", "0.5348135", "0.51937497", "0.5048216", "0.49655706", "0.49582195", "0.48982418", "0.48511666", "0.47408316", "0.4697122", "0.46656674", "0.46580157", "0.4614476", "0.45804417", "0.45755586", "0.45570856", "0.452409", "0.45073053", "0.44806236", "0.44797745", "0.4448594", "0.4430161", "0.4410361", "0.440942", "0.4401718", "0.43930882" ]
0.718892
0
Sets the signInActivity property value. Get the last signedin date and request ID of the signin for a given user. Readonly.Returned only on $select. Supports $filter (eq, ne, not, ge, le) but not with any other filterable properties. Note: Details for this property require an Azure AD Premium P1/P2 license and the AuditLog.Read.All permission.This property is not returned for a user who has never signed in or last signed in before April 2020.
public function setSignInActivity(?SignInActivity $value): void { $this->getBackingStore()->set('signInActivity', $value); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function markSignedIn();", "public function getSignInActivity(): ?SignInActivity {\n $val = $this->getBackingStore()->get('signInActivity');\n if (is_null($val) || $val instanceof SignInActivity) {\n return $val;\n }\n throw new \\UnexpectedValueException(\"Invalid type found in backing store for 'signInActivity'\");\n }", "public static function update_user_activity($request) {\n if ($request && $request->token && $request->token->token_type == \"access\") {\n Db::execute(\"\n update user set last_login=now()\n where user_id='\".Db::escape_string($request->token->user_id).\"'\n \");\n }\n }", "public function activity_user()\n\t{\n\t\treturn $this->_get_activity();\n\n\t}", "public function setActivity($activity)\n {\n $this->activity = $activity;\n\n return $this;\n }", "public function setActivity($activity) : self\n {\n $this->initialized['activity'] = true;\n $this->activity = $activity;\n return $this;\n }", "public function update_activity_time () {\n # update\n try { $this->Database->updateObject(\"users\", array(\"lastActivity\"=>date(\"Y-m-d H:i:s\"), \"id\"=>$this->user->id)); }\n catch (Exception $e) { }\n }", "public function update(Request $request, userActivity $userActivity)\n {\n //\n }", "public function setLastActivity($lastActivity)\n {\n $this->lastActivity = $lastActivity;\n }", "public function setActivityDateTime(?DateTime $value): void {\n $this->getBackingStore()->set('activityDateTime', $value);\n }", "public function setActivity($val)\n {\n $this->_propDict[\"activity\"] = $val;\n return $this;\n }", "public function edit(userActivity $userActivity)\n {\n //\n }", "function login_activity()\n {\n return LoginActivity::whereUserId(auth()->user()->id)->latest()->first();\n }", "public function addActivity($activity) {\n\t\t\\OCP\\Util::writeLog('user_notification', 'Notification: '.serialize($activity), \\OCP\\Util::DEBUG);\n\t\tif($activity['priority']>\\OCA\\UserNotification\\Data::PRIORITY_SEEN){\n\t\t\tparent::addActivity($activity);\n\t\t}\n\t}", "public function activity()\n {\n return $this->session['last_activity'];\n }", "function ajan_get_activity_by_id($activity_id=0){\n\n\t//if no user_id is passed then get the current logged in user id and return his activities\n\tif($user_id==0){\n\n\t\tglobal $user_ID;\n\n\t\t$user_id = $user_ID;\n\n\t}\n\t$args = array( \n\t\t// Filtering\n\t\t'in' => array($activity_id) , // user_id to filter on \n\t\t'display_comments' => 'stream', \n\t\t \n\t);\n\n\tadd_filter('ajan_has_activities','ajan_has_activities_return',10,3);\n\t$activity = ajan_has_activities($args);\n \tif($activity!=false){\n \t\treturn $activity[0] ;\n \t}else{\n \t\treturn $activity;\n \t}\n \n\n }", "public function setActivityId($activityId)\n {\n $this->activityId = $activityId;\n return $this;\n }", "public function getActivityID()\n {\n return $this->activityID;\n }", "public function setActivity(?string $activity) : void\n {\n $this->set('activity', $activity, 'companies');\n }", "public function activity_get_activities() {\n $oReturn = new stdClass();\n $this->init('activity', 'see_activity');\n\n if (!bp_has_activities())\n return $this->error('activity');\n if ($this->pages !== 1) {\n $aParams ['max'] = true;\n $aParams ['per_page'] = $this->offset;\n $iPages = $this->pages;\n }\n\n $aParams ['display_comments'] = $this->comments;\n $aParams ['sort'] = $this->sort;\n\n $aParams ['filter'] ['user_id'] = $this->userid;\n $aParams ['filter'] ['object'] = $this->component;\n $aParams ['filter'] ['action'] = $this->type;\n $aParams ['filter'] ['primary_id'] = $this->itemid;\n $aParams ['filter'] ['secondary_id'] = $this->secondaryitemid;\n $iLimit = $this->limit;\n\n if ($this->pages === 1) {\n $aParams ['page'] = 1;\n if ($iLimit != 0)\n $aParams['per_page'] = $iLimit;\n $aTempActivities = bp_activity_get($aParams);\n\n\n if (!empty($aTempActivities['activities'])) {\n foreach ($aTempActivities['activities'] as $oActivity) {\n $oReturn->activities[(int) $oActivity->id]->component = $oActivity->component;\n $oReturn->activities[(int) $oActivity->id]->user[(int) $oActivity->user_id]->username = $oActivity->user_login;\n $oReturn->activities[(int) $oActivity->id]->user[(int) $oActivity->user_id]->mail = $oActivity->user_email;\n $oReturn->activities[(int) $oActivity->id]->user[(int) $oActivity->user_id]->display_name = $oActivity->display_name;\n $oReturn->activities[(int) $oActivity->id]->type = $oActivity->type;\n $oReturn->activities[(int) $oActivity->id]->time = $oActivity->date_recorded;\n $oReturn->activities[(int) $oActivity->id]->is_hidden = $oActivity->hide_sitewide === \"0\" ? false : true;\n $oReturn->activities[(int) $oActivity->id]->is_spam = $oActivity->is_spam === \"0\" ? false : true;\n }\n $oReturn->count = count($aTempActivities['activities']);\n } else {\n return $this->error('activity');\n }\n return $oReturn;\n }\n\n for ($i = 1; $i <= $iPages; $i++) {\n if ($iLimit != 0 && ($i * $aParams['per_page']) > $iLimit) {\n $aParams['per_page'] = $aParams['per_page'] - (($i * $aParams['per_page']) - $iLimit);\n $bLastRun = true;\n }\n $aParams ['page'] = $i;\n $aTempActivities = bp_activity_get($aParams);\n if (empty($aTempActivities['activities'])) {\n if ($i == 1)\n return $this->error('activity');\n else\n break;\n }\n else {\n foreach ($aTempActivities['activities'] as $oActivity) {\n $oReturn->activities[(int) $oActivity->id]->component = $oActivity->component;\n $oReturn->activities[(int) $oActivity->id]->user[(int) $oActivity->user_id]->username = $oActivity->user_login;\n $oReturn->activities[(int) $oActivity->id]->user[(int) $oActivity->user_id]->mail = $oActivity->user_email;\n $oReturn->activities[(int) $oActivity->id]->user[(int) $oActivity->user_id]->display_name = $oActivity->display_name;\n $oReturn->activities[(int) $oActivity->id]->type = $oActivity->type;\n $oReturn->activities[(int) $oActivity->id]->time = $oActivity->date_recorded;\n $oReturn->activities[(int) $oActivity->id]->is_hidden = $oActivity->hide_sitewide === \"0\" ? false : true;\n $oReturn->activities[(int) $oActivity->id]->is_spam = $oActivity->is_spam === \"0\" ? false : true;\n }\n $oReturn->count = count($aTempActivities['activities']);\n if ($bLastRun)\n break;\n }\n }\n\n return $oReturn;\n }", "public function update(Request $request, Activity $activity)\n {\n $validator = \\Validator::make($request->all(), [\n 'name'=>['required', 'unique:activities,name,' . $activity->id],\n // 'name_ar'=>['required', 'unique:activities,name->ar,' . $activity->id],\n 'is_enabled' => 'nullable|boolean',\n ]);\n\n if($validator->fails()){\n return Message::response(false,'Invalid Input' ,$validator->errors()); \n }\n \n return Tenant::wrapTenant(function() use ($activity, $request){\n\n $activity->update(\n [\n 'name' => $request->name,\n // 'ar' => $request->name_ar,\n // ],\n #if is_enabled is null then it's false\n 'is_enabled' => $request->has('is_enabled') ? $request->is_enabled : 1,\n // 'created_by' => $request->created_by,\n 'modified_by' => auth()->user()->user_name,\n ]\n );\n\n return Message::response(true, 'updated', Activity::findOrFail($activity->id));\n });\n }", "function setToUserID($inToUserID) {\n\t\tif ( $inToUserID !== $this->_ToUserID ) {\n\t\t\t$this->_ToUserID = $inToUserID;\n\t\t\t$this->setModified();\n\t\t}\n\t\treturn $this;\n\t}", "function setUserID($inUserID) {\n\t\tif ( $inUserID !== $this->_UserID ) {\n\t\t\t$this->_UserID = $inUserID;\n\t\t\t$this->setModified();\n\t\t}\n\t\treturn $this;\n\t}", "function setUserID($inUserID) {\n\t\tif ( $inUserID !== $this->_UserID ) {\n\t\t\t$this->_UserID = $inUserID;\n\t\t\t$this->setModified();\n\t\t}\n\t\treturn $this;\n\t}", "protected function SetDefaultActivityId() {\n\t\tglobal $oBrand;\n\t\t$aSelected = array();\n\t\tforeach($oBrand->GetDefaultActivityId() as $id) {\n\t\t\t$aSelected[] = $id;\n\t\t}\n\t\t\n\t\treturn array_merge($aSelected, $this->SetDefaultActivityByProfileType());\n\t}", "protected function activity($activity) {\n static $activityModel = null;\n if (is_null($activityModel)) {\n $activityModel = new ActivityModel();\n }\n\n $activity = array_merge(array(\n 'ActivityType' => 'HotPotato',\n 'Force' => true,\n 'Notified' => ActivityModel::SENT_PENDING\n ), $activity);\n $activityModel->save($activity);\n }", "public function activity_date()\n\t{\n\t\t\n\t\treturn $this->_get_activity('activity_date');\n\t\t\n\t}", "public function save(Activity $activity) {\n $this->em->merge($activity);\n $this->em->flush();\n }", "public function getUserActivity($stream);", "public function signedInUserId(): int\n {\n return $this->sessionHelper->get(self::SESSION_LOGINUSERID, -1);\n }" ]
[ "0.516944", "0.50815827", "0.5008157", "0.47975394", "0.47356874", "0.46548143", "0.44341388", "0.43877828", "0.4387282", "0.4340093", "0.43376574", "0.43333134", "0.4332111", "0.43190888", "0.43101954", "0.4255726", "0.42522442", "0.41458958", "0.4142663", "0.41338086", "0.41323256", "0.412266", "0.4088772", "0.4088772", "0.4069728", "0.40609476", "0.40507412", "0.40477526", "0.40322304", "0.40270248" ]
0.6151205
0
Sets the signInSessionsValidFromDateTime property value. Any refresh tokens or sessions tokens (session cookies) issued before this time are invalid, and applications will get an error when using an invalid refresh or sessions token to acquire a delegated access token (to access APIs such as Microsoft Graph). If this happens, the application will need to acquire a new refresh token by making a request to the authorize endpoint. Readonly. Use revokeSignInSessions to reset.
public function setSignInSessionsValidFromDateTime(?DateTime $value): void { $this->getBackingStore()->set('signInSessionsValidFromDateTime', $value); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function setRefreshTokensValidFromDateTime(?DateTime $value): void {\n $this->getBackingStore()->set('refreshTokensValidFromDateTime', $value);\n }", "public function getSignInSessionsValidFromDateTime(): ?DateTime {\n $val = $this->getBackingStore()->get('signInSessionsValidFromDateTime');\n if (is_null($val) || $val instanceof DateTime) {\n return $val;\n }\n throw new \\UnexpectedValueException(\"Invalid type found in backing store for 'signInSessionsValidFromDateTime'\");\n }", "protected function validate()\n {\n // Regenerate session if gone too long and reset timers\n if ((time() - $this->get('timer.start', null, 'session') > self::EXPIRE)) {\n session_regenerate_id(true);\n $this->setTimers(true);\n }\n\n // Destroy session if expired and start a new one\n if ((time() - $this->get('timer.last', null, 'session') > self::EXPIRE)) {\n $this->destroy();\n $this->start();\n }\n }", "private static function checkInactivity(){\r\n\t\tif(isset($_SESSION[Constants::$KEY_LAST_TIME_SESSION])){\r\n\t\t\t//tenemos un tiempo registrado para nuestra ultima accion en el sitio\r\n\t\t\t//vemos si no nos excedimos de nuestra maxima inactividad configurada\r\n\t\t\t$time0 = $_SESSION[Constants::$KEY_LAST_TIME_SESSION];\r\n\t\t\t$userDTO = $_SESSION[Constants::$KEY_USUARIO_DTO];\r\n\t\t\t//el tiempo esta almacenado en minutos, lo llevamos a segundos\r\n\t\t\t$maxTime = $userDTO->getTiempoSesion() * 60;\r\n\t\t\t\t\r\n\t\t\tif((time() - $time0) > $maxTime) {\r\n\t\t\t\t//tengo inactivo mas tiempo del permitido, limpio la sesion\r\n\t\t\t\tsession_unset();\r\n\t\t\t\t$_SESSION[Constants::$KEY_MESSAGE_ERROR] = Constants::$TEXT_SESSION_EXPIRED;\r\n\t\t\t\theader(\"Location: index.php\");\r\n\t\t\t\texit();\r\n\t\t\t}\r\n\t\t}\r\n\t}", "function validate()\n{\n\tif (time() - $_SESSION['CREATED'] > 1800) \n {\n \t\t// session started more than 30 minutes ago\n \t//session_regenerate_id(true); // change session ID for the current session and invalidate old session ID\n \t//$_SESSION['CREATED'] = time(); // update creation time\n\t\theader(\"location:sign-in\");\n\t\texit();\n\t}\n}", "public function setValidFrom(DateTime $time)\n {\n \t$this->claims['nbf'] = $time;\n }", "public function setTimerStartTime($startTime) {\n\t\t$_SESSION[self::$timerStart] = $startTime;\n \treturn true;\n\t}", "public function setTokenExpiry($secondsFromNow) {\n\n $seconds = intval($secondsFromNow);\n if ( $seconds > 0 ) {\n $this->logger->debug(\"DHL access token expiry in {$secondsFromNow} seconds\");\n $tokenExpiry = new DateTime('NOW');\n $tokenExpiry->modify(\"+ {$seconds} seconds\");\n $this->setCachedTokenExpiry($tokenExpiry);\n }\n else {\n $this->setCachedToken(null);\n }\n }", "public function isSignedOn()\n {\n return ! empty($this->sessionToken) && ((time() - $this->sessionTokenTime) <= CwsConstants::SESSION_TOKEN_TIME);\n }", "function validate_user()\n{\n\tif (time() - $_SESSION['CREATED_USER'] > 1800) \n \t{\n \t\t// session started more than 30 minutes ago\n \t//session_regenerate_id(true); // change session ID for the current session and invalidate old session ID\n \t//$_SESSION['CREATED'] = time(); // update creation time\n\t\tsession_destroy(); \n\t\theader(\"location:sign-in\");\n\t\texit();\n\t}\n}", "function setStartTime($startTime)\n {\n $this->startTime = $this->validateDate($startTime);\n }", "public function isValidSessionToken(){\n\n if ($this->getSession()->AuthToken === null) {\n return false;\n }\n if ($this->currentUserID !== null) {\n return true;\n }\n $sessionToken = $this->getSession()->AuthToken;\n $result = $this ->prepare(\"SELECT id,session_token_expire FROM users WHERE session_token=?\",[$sessionToken])->execute();\n //if there is no such token in the user table .. session is not valid.. so return false\n if ($result === false) {\n return false;\n }\n\n $result = $result->fetchRllAssoc(); // getting the result\n\n // if expiration time is bigger then current time.. session expired .. soo return false\n if ($result['session_token_expire'] < time()) {\n return false;\n }\n\n // if we are here in code that means that everything is ok and we can save the user and update the time\n $this->setCurrentUserId($result['id']);\n\n // and we extend the lifetime of the users token\n if ($this->renewSessionLifeTime($sessionToken)) {\n return false;\n }\n\n return true;\n }", "public function signOn()\n {\n $this->sessionTokenTime = time();\n if (! empty($this->serviceKey)) {\n $this->sessionToken = $this->serviceInformationService->delegatedSignOn($this->identityToken, $this->serviceKey);\n } else {\n $this->sessionToken = $this->serviceInformationService->signOn($this->identityToken);\n }\n }", "public function setProfileDateTime($newProfileDateTime = null): void {\n\t\t//base case: if the date is null, wait for mySQL\n\t\tif($newProfileDateTime === null) {\n\t\t\t$this->profileDateTime = null;\n\t\t\treturn;\n\t\t}\n\n\t\t//store the profile date using the ValidateDate trait\n\t\ttry {\n\t\t\t$newProfileDateTime = self::validateDateTime($newProfileDateTime);\n\t\t} catch(\\InvalidArgumentException | \\RangeException $exception) {\n\t\t\t$exceptionType = get_class($exception);\n\t\t\tthrow(new $exceptionType($exception->getMessage(), 0, $exception));\n\t\t}\n\t\t$this->profileDateTime = $newProfileDateTime;\n\t}", "public function setStartedAt(?\\DateTime $date);", "private function setSessionStarted() {\n $this->sessionStarted = true;\n }", "public function invalidateCurrentLogin()\n {\n if (! $this->hasPersistentLogin()) {\n return;\n }\n\n // Invalidate the stored session\n $token = $this->tokenAdapter->getToken();\n $this->storageAdapter->invalidateSessionByToken($token);\n\n // Invalidate the token too\n $this->tokenAdapter->invalidateToken();\n }", "public function checkActiveSessions()\n {\n if ($this->openingDate) {\n $test = true;\n $today = new \\DateTime();\n if (($today->getTimestamp() > $this->openingDate->getTimestamp())\n &&\n ($today->getTimestamp() < $this->closingDate->getTimestamp())\n ) {\n $test = false;\n }\n } else {\n $test = true;\n }\n\n return $test;\n }", "public function setRegisteredDateTime(?DateTime $value): void {\n $this->getBackingStore()->set('registeredDateTime', $value);\n }", "public function getSessionExpirationDate()\n {\n $epoch = $this->getSamlResponse()->getSessionNotOnOrAfter();\n\n // keep consistent interface\n if ($epoch === null) {\n return null;\n }\n\n $dateTime = new \\DateTime();\n return $dateTime->setTimestamp($epoch);\n }", "public function setApiTokenDate()\n {\n // calculate and then set token date\n // this function assumes it will be called in the context of using the token\n if ($this->apiTokenDate = time()) {\n return True;\n } else {\n return False;\n }\n }", "public function setCurrentTime(DateTime $dateTime)\n {\n $this->runAsIfDatetime = $dateTime;\n }", "public function resetDates(Request $request)\n {\n session()->forget(\"{$this->sessionKey}.date_from\");\n session()->forget(\"{$this->sessionKey}.date_to\");\n\n return redirect_to_resource();\n }", "public function setExpirationDateTime(?DateTime $value): void {\n $this->getBackingStore()->set('expirationDateTime', $value);\n }", "protected static function validateSession() {\n if(isset($_SESSION['OBSOLETE']) && !isset($_SESSION['EXPIRES'])) return false;\n if(isset($_SESSION['EXPIRES']) && $_SESSION['EXPIRES'] < time()) return false;\n return true;\n }", "public function setAcceptedDateTime($val)\n {\n $this->_propDict[\"acceptedDateTime\"] = $val;\n return $this;\n }", "public function setExpiryDateTime(\\DateTimeImmutable $dateTime) {\n $this->accessToken['expiry'] = $dateTime->format('Y-m-d H:i:s');\n }", "public function markSignedIn();", "public function setValidBeforeTime(&$var)\n {\n GPBUtil::checkMessage($var, \\Google\\Protobuf\\Timestamp::class);\n $this->valid_before_time = $var;\n }", "public function setDateSysValidation(DateTime $dateSysValidation = null) {\n $this->dateSysValidation = $dateSysValidation;\n return $this;\n }" ]
[ "0.6118522", "0.5687664", "0.51685405", "0.51049215", "0.50952125", "0.4900594", "0.48576954", "0.4835986", "0.4716871", "0.4681185", "0.46780798", "0.46570033", "0.46238726", "0.46120852", "0.45861816", "0.45523998", "0.45417652", "0.45328128", "0.45213732", "0.45056903", "0.45016626", "0.45004332", "0.44863227", "0.44829723", "0.44749227", "0.44695944", "0.44529995", "0.4452493", "0.4443153", "0.4438659" ]
0.7546842
0
Sets the sponsors property value. The users and groups that are responsible for this guest user's privileges in the tenant and keep the guest user's information and access updated. (HTTP Methods: GET, POST, DELETE.). Supports $expand.
public function setSponsors(?array $value): void { $this->getBackingStore()->set('sponsors', $value); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function sponsors() {\n return $this -> belongsToMany(Sponsor::class) -> withTimestamps() -> withPivot('expires_at');\n }", "public function sponsors()\n {\n return $this->hasMany(Sponsors::class);\n }", "public function setUsers($users) {\n $this->users = $users;\n }", "public function setOwners(?array $value): void {\n $this->getBackingStore()->set('owners', $value);\n }", "public function setSponsor($sponsor)\n {\n ObjectHelper::isInstanceOf($sponsor, [Organization::class, PersonInterface::class]);\n\n $this->_sponsor = $sponsor;\n return $this;\n }", "public function setSponsor($sponsor) {\n $this->properties['sponsor'] = $sponsor;\n\n return $this;\n }", "public function setAgents($agents) {\n $this->agents = $agents;\n }", "public function assignSupervisorsPost(Request $request)\n {\n $this->validate(request(), [\n 'supervisorId' => 'required'\n ]);\n\n $bloggerArr = [];\n if ($request->bloggerId) {\n $bloggerArr = $request->bloggerId;\n }\n AssignedUsers::where('supervisor_id', $request->supervisorId)\n ->whereNotIn('blogger_id', $bloggerArr)\n ->delete();\n \n foreach ($bloggerArr as $row) {\n DB::table('assigned_users')->updateOrInsert(\n [\n 'supervisor_id' => $request->supervisorId,\n 'blogger_id' => $row\n ],\n [\n 'supervisor_id' => $request->supervisorId,\n 'blogger_id' => $row\n ]\n );\n }\n\n return redirect('admin/user-list');\n }", "public function setSuppliers(array $suppliers)\n {\n foreach ($suppliers as $supplier) {\n if (is_object($supplier) && property_exists($supplier, 'type')) {\n if ($supplier->type == 'BookingOveride') {\n $bs = booking\\Supplier::factory($supplier->route, $this);\n $this->suppliers->addElement($bs);\n } else if ($supplier->type == 'PropertyDefault') {\n $ps = property\\Supplier::factory($supplier->route);\n if ($this->getProperty()) {\n $prop = $this->getProperty();\n $ps->setParent($prop);\n }\n $this->suppliers->addElement($ps);\n }\n }\n }\n\n return $this;\n }", "public function set_user( $users ) {\n\t\t$this->client->SetUser(array(\n\t\t\t'User' => $users\n\t\t));\n\t}", "public function setDoors($doors) {\n $this->doors = $doors;\n }", "public function assignSupervisors(Request $request)\n {\n $supervisors = User::where('user_type', 'supervisor')\n ->get();\n\n $bloggerList = [];\n $assignedBloggers = [];\n if ($request->id) {\n $bloggerList = User::where('user_type', 'blogger')\n ->get();\n\n $assignedBloggers = AssignedUsers::where('supervisor_id', $request->id)\n ->get()\n ->pluck('blogger_id')\n ->toArray();\n }\n\n return view('admin.assign-supervisors', compact('supervisors', 'bloggerList', 'assignedBloggers'));\n }", "public function setProvisioners($provisioners)\n {\n $this->provisioners = $provisioners;\n }", "public function setUsers(Array $users)\n {\n $this->_users = $users;\n }", "public function userSonsPersons()\n {\n return $this\n ->belongsToMany(Person::class, 'user_persons', 'user_id', 'person_id')\n ->whereNotNull('parent_person_id');\n //'App\\Role', 'role_user', 'user_id', 'role_id'\n }", "public function setContributors($contributors) {\n $this->contributors = $contributors;\n }", "public function setContributors($contributors) {\n $this->contributors = $contributors;\n }", "public function setMembersManagement($value) {\n if (is_bool($value)) { $this->MembersManagement = $value; }\n }", "public function setMicrosoftTunnelServers($val)\n {\n\t\t$this->_propDict[\"microsoftTunnelServers\"] = $val;\n return $this;\n }", "public function add_sponsors_from_api() {\n\n\t\t// Get sponsors.\n\t\t$github_sponsors = $this->get_sponsors();\n\n\t\t// Loop sponsors and add them to the object's $sponsors property.\n\t\tforeach ( $github_sponsors as $gh_sponsor ) {\n\t\t\t$this->sponsors[] = array(\n\t\t\t\t'name' => $gh_sponsor->node->sponsor->name,\n\t\t\t\t'url' => $gh_sponsor->node->sponsor->websiteUrl || $gh_sponsor->node->sponsor->url,\n\t\t\t\t'img' => $gh_sponsor->node->sponsor->avatarUrl,\n\t\t\t\t'classes' => 'round',\n\t\t\t);\n\t\t}\n\t}", "public function setApproval(ObjectStorage $backendUsers);", "public function setCreators($creators)\n {\n $this->creators = $creators;\n }", "public function edit(Sponsor $sponsors)\n {\n //\n }", "public function setTutors(Tx_Extbase_Persistence_ObjectStorage $tutors) {\n\t\t$this->tutors = $tutors;\n\t}", "function updateInvites(array $sharees) {\n foreach ($sharees as $sharee) {\n if (in_array($sharee->principal, $this->addressBookInfo['administrators'])) {\n throw new \\Sabre\\DAV\\Exception\\MethodNotAllowed('Can not delegate for group administrators');\n }\n\n $sharee->inviteStatus = SPlugin::INVITE_ACCEPTED;\n }\n\n parent::updateInvites($sharees);\n }", "public function setManeuvers($maneuvers) {\n $this->maneuvers = $maneuvers;\n }", "public function setOtherLecturers(Tx_Extbase_Persistence_ObjectStorage $lecturers) {\n\t\t$this->otherLecturers = $lecturers;\n\t}", "public function setPlanner(?PlannerUser $value): void {\n $this->getBackingStore()->set('planner', $value);\n }", "public function approvers()\n {\n return $this->belongsToMany(User::class);\n }", "public function setManagedAppRegistrations(?array $value): void {\n $this->getBackingStore()->set('managedAppRegistrations', $value);\n }" ]
[ "0.5981068", "0.5671137", "0.5166937", "0.50361884", "0.5019189", "0.49617466", "0.49346703", "0.48869786", "0.48642692", "0.48144728", "0.47828737", "0.4779341", "0.47579318", "0.47134125", "0.46935284", "0.46889114", "0.46889114", "0.4682875", "0.4678468", "0.46572453", "0.464193", "0.4640541", "0.4625355", "0.46163696", "0.4607389", "0.45990917", "0.45821396", "0.45779783", "0.45684817", "0.4560485" ]
0.67128813
0
Sets the streetAddress property value. The street address of the user's place of business. Maximum length is 1024 characters. Supports $filter (eq, ne, not, ge, le, in, startsWith, and eq on null values).
public function setStreetAddress(?string $value): void { $this->getBackingStore()->set('streetAddress', $value); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function setStreetAddress($streetAddress) {\n $this->streetAddress = (string) $streetAddress;\n return $this;\n }", "public function setStreet($street)\n {\n if ($this->_validation->validateIsString($street)) {\n $this->_street = $street;\n } else {\n throw new PiRatepay_Paypage_Util_ValidationException(108);\n }\n }", "public function setStreet($street)\n {\n $this->street = $street;\n }", "public function set_street_address( string $street_address ): static {\n\t\treturn $this->set_property( 'streetAddress', $street_address );\n\t}", "function setStreetNumber($a_sStreetNumber)\n {\n $this->_sStreetNumber = is_null($a_sStreetNumber) ? NULL : (string) $a_sStreetNumber;\n $this->setSearchParameter('street_number', (string) $this->_sStreetNumber, is_null($this->_sStreetNumber) ? self::CONDITION_IS_NULL : self::CONDITION_EQUALS);\n }", "function setAddress($a_sAddress)\n {\n $this->_sAddress = (string) $a_sAddress;\n $this->setSearchParameter('address', $this->_sAddress);\n }", "public function setStreet(?string $street): void;", "public function setStreet(?string $value): void {\n $this->getBackingStore()->set('street', $value);\n }", "public function setStreet(string $street)\n\t{\n\t\t$this->addKeyValue('street', $street); \n\n\t}", "function setPostalAddress($a_sPostalAddress)\n {\n $this->_sPostalAddress = (string) $a_sPostalAddress;\n $this->setSearchParameter('postal_address', $this->_sPostalAddress);\n }", "public function setStreet($street)\n {\n if (is_array($street)) {\n $street = trim(implode(\"\\n\", $street));\n }\n $this->setData('street', $street);\n return $this;\n }", "public function setStreet($street)\n\t{\n\t\t$this->data[self::KEY_STREET] = $street;\n\t\treturn $this;\n\t}", "public function setStreet(string $street) {\n $this->street = $street;\n\n return $this;\n }", "public function setStreet(string $street)\n {\n $this->street = $street;\n\n return $this;\n }", "public function setStreet($street)\n {\n $this->street = $street;\n return $this;\n }", "public function setStreet($street)\n {\n $this->street = $street;\n return $this;\n }", "public function setFormattedAddress($formattedAddress);", "public function setBillingStreet($billingStreet);", "public function setAddress($value)\n\t{\n\t\t$this->address = $value;\n\t}", "public function setStreetNumber($streetNumber)\n {\n if ($this->_validation->validateWithRegex(\"^\\d.*\", $streetNumber) || $streetNumber == '') {\n $this->_streetNumber = $streetNumber;\n } else {\n throw new PiRatepay_Paypage_Util_ValidationException(306);\n }\n }", "private function _setStreet($street)\n {\n $this->street = $street;\n\n return $this;\n }", "public function setAddress($address)\n {\n }", "function setAddressNumber($a_sAddressNumber)\n {\n $this->_sAddressNumber = is_null($a_sAddressNumber) ? NULL : (string) $a_sAddressNumber;\n $this->setSearchParameter('address_number', (string) $this->_sAddressNumber, is_null($this->_sAddressNumber) ? self::CONDITION_IS_NULL : self::CONDITION_EQUALS);\n }", "function setAddress($value);", "public function setAddressAttribute($value) {\n $this->attributes['address'] = ucwords(strtolower($value));\n }", "public function testStreetAddress(): void\n {\n $actual = $expected = 'address';\n\n self::assertSame($this->bill, $this->bill->setStreetAddress($actual));\n self::assertSame($expected, $this->bill->getStreetAddress());\n }", "public function setAddress($value) : Contact\n {\n $this->validateJson($value);\n\n if ($this->data['address'] !== $value) {\n $this->data['address'] = $value;\n $this->setModified('address');\n }\n\n return $this;\n }", "public function setAddress($address)\n {\n $this->addParameter('address', (string)$address);\n }", "public function setAddress($address) {\n $this->address = $address;\n }", "public function setAddress($address) {\n\t\t$this->address = $address;\n\t}" ]
[ "0.7042635", "0.698584", "0.6909085", "0.6901945", "0.68233067", "0.68217987", "0.68193436", "0.67860067", "0.6777436", "0.67065334", "0.6630502", "0.6625143", "0.66219616", "0.6551502", "0.65432066", "0.65432066", "0.6487963", "0.6487116", "0.6455202", "0.6402588", "0.63481253", "0.6333245", "0.6288682", "0.62875485", "0.62364423", "0.6231326", "0.6175079", "0.6166991", "0.6159204", "0.61024123" ]
0.72249764
0
Sets the teamwork property value. A container for Microsoft Teams features available for the user. Readonly. Nullable.
public function setTeamwork(?UserTeamwork $value): void { $this->getBackingStore()->set('teamwork', $value); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getTeamwork(): ?UserTeamwork {\n $val = $this->getBackingStore()->get('teamwork');\n if (is_null($val) || $val instanceof UserTeamwork) {\n return $val;\n }\n throw new \\UnexpectedValueException(\"Invalid type found in backing store for 'teamwork'\");\n }", "function setSwimTeamOption($option, $value)\n {\n $this->__swim_team_option[$option] = $value ;\n }", "function setTeams($teamsArr) {\r\n $this->teams = is_array($teamsArr) ? $teamsArr : NULL;\r\n }", "public function get_STE_Team() {\n return $this->ste_team;\n }", "public function getTeam()\n {\n return $this->team;\n }", "public function team(){\n\t\t$staff = $this->Member->find('all', array(\n\t\t\t'conditions'=>'Member.mem_id > 1', \n\t\t\t'order'=>'Member.job_pos_id'\n\t\t));\n\t\t$job_title = $this->GlobalStatus->find('all', array(\n\t\t\t'conditions'=>\"GlobalStatus.fd_name LIKE 'job_pos_id'\", \n\t\t\t'order'=>'GlobalStatus.status_val'\n\t\t));\n\t\t$this->set('staff', $staff);\n\t\t$this->set('job_title', $this->relations('GlobalStatus', 'status_val', 'status_mean', $job_title));\n\t\t$this->set('bodyClass', 'staff');\n\t}", "public function setFunSettings(?TeamFunSettings $value): void {\n $this->getBackingStore()->set('funSettings', $value);\n }", "public function getProjectTeam()\n {\n return isset($this->project_team) ? $this->project_team : null;\n }", "public static function team($strValueDefault = NULL, $strFieldName = NULL, $strHasAllOption = 'labels.all', array $arrExtra = array())\n\t{\n\t\t$arrWhere = array('status' => 1);\n\t\t$strIndex = 'id';\n\t\t$strValue = 'name';\n\t\t$strOrderBy = 'name';\n\t\t$strModel = 'Model_Team';\n\t\treturn Util_Filter::generics($arrWhere, $strIndex, $strValue, $strOrderBy, $strModel, $strFieldName, $strHasAllOption, $arrExtra, $strValueDefault, FALSE);\n\t}", "public static function useTeamModel($teamModel)\n {\n static::$teamModel = $teamModel;\n }", "public function get_team_id()\n {\n return $this->team_id;\n }", "public function setMessagingSettings(?TeamMessagingSettings $value): void {\n $this->getBackingStore()->set('messagingSettings', $value);\n }", "public function setTeam($team)\n {\n $this->team = $team;\n\n return $this;\n }", "public function setSpecialization(?TeamSpecialization $value): void {\n $this->getBackingStore()->set('specialization', $value);\n }", "public function getTeam() {\n return $this->teamId;\n }", "public function getProjectTeam();", "public function setJoinedTeams(?array $value): void {\n $this->getBackingStore()->set('joinedTeams', $value);\n }", "public function getTeamId()\n {\n return $this->team_id;\n }", "public function getTeamId()\n {\n return $this->teamId;\n }", "public function setTimeWorked($time_worked)\n\t{\n\t\tif (!is_numeric($time_worked)) {\n\t\t\tlist($hours, $minutes) = explode(':', $time_worked);\n\t\t\t$time_worked = (60 * 60 * $hours) + (60 * $minutes);\n\t\t}\n\t\t$this->time_worked = $time_worked;\n\t\treturn $this;\n\t}", "public function getTeamID()\n {\n return $this->teamID;\n }", "public function setWorkHours($value)\n {\n $this->workHours = $value;\n }", "public function getTeamName ()\r\n {\r\n return $this->teamName;\r\n }", "public function getTravelTeam(){\n\t\t\treturn $this->travelteam;\n\t\t}", "public function getHasTeam ()\r\n {\r\n return $this->hasTeam;\r\n }", "function setTeam($param)\n{\n unset($param);\n\n $Auth = new ExtractorAuth();\n\n if (!$Auth->isAuthed()) {\n redirect('pwd');\n\n return;\n }\n\n $team = filter_input(INPUT_GET, 'team');\n\n $allowedTeams = [\n 'red1',\n 'red2',\n 'red3',\n 'blue1',\n 'blue2',\n 'blue3'\n ];\n\n if (in_array($team, $allowedTeams)) {\n $oc = new ExtractorConfig();\n $oc->setConfig('team', $team);\n }\n\n redirect('about');\n}", "public function getCurrentTeamAttribute()\n {\n return $this->currentTeam();\n }", "public function setTemplate(?TeamsTemplate $value): void {\n $this->getBackingStore()->set('template', $value);\n }", "public function set_team_id($team_id)\n {\n $this->team_id = $team_id;\n }", "public function switchToTeam($team)\n {\n $this->current_team_id = $team->id;\n\n $this->save();\n }" ]
[ "0.5784357", "0.5566614", "0.5491727", "0.52683175", "0.5248647", "0.5152279", "0.5080491", "0.5048583", "0.50355196", "0.5034208", "0.5020403", "0.49901602", "0.49759424", "0.49723262", "0.49701625", "0.49585694", "0.4958495", "0.49514255", "0.49289435", "0.490122", "0.4892222", "0.48843795", "0.48409992", "0.48305845", "0.48266962", "0.48260453", "0.4770009", "0.4765856", "0.47598937", "0.47405097" ]
0.7330262
0
Sets the todo property value. Represents the To Do services available to a user.
public function setTodo(?Todo $value): void { $this->getBackingStore()->set('todo', $value); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function setTodo($todo)\n {\n if((bool) $todo) {\n $this->options['todo'] = null;\n }\n }", "public function setTodoAttribute($value){\n $this->attributes[\"todo\"] = ucfirst($value);\n }", "public function __construct($todos)\n {\n $this->todos = $todos;\n }", "public function edit(Todo $todo)\n {\n //\n }", "public function edit(Todo $todo)\n {\n //\n }", "public function toggle(Todo $todo): Model\n {\n $todo->forceFill([\n 'completed_at' => (!$todo->status) ? Carbon::now() : null,\n 'status' => !$todo->status\n ])->save();\n\n return $todo;\n }", "public function edit(Todos $todos)\n {\n //\n }", "public function show(ToDo $toDo)\n {\n //\n }", "public function affectedTo(todo $todo, user $user)\n {\n $todo->affectedTo_id = $user->id;\n $todo->affectedBy_id = Auth::id();\n\n $todo->update(); \n $af = $todo->affectedTo->name;\n //smsapi(\"87175804\", \"Vous avez une nouvelle notification\");\n\n $user->notify(new todoAffected($todo));\n\n notify()->error(\"La todo <span class='bagde badge-dark'>#$todo->id</span>a été affecté a <span class='bagde badge-dark'>$af</span>. \");\n \n return back();\n }", "public function addTodo($sender) {\n $this->csi->lblTodos->html .= \"<div><b>\" . $this->counter . \".: </b>\" . $this->csi->txtTodo->value . \"</div>\";\n $this->csi->txtTodo->value = \"\";\n $this->counter++;\n }", "public function setTasks($value) {\n if (is_bool($value)) { $this->Tasks = $value; }\n }", "public function setTodos($values)\n {\n return $this->set_todos($values);\n }", "public function setTask(?Task $value): void {\n $this->getBackingStore()->set('task', $value);\n }", "public function edit(TodoStatus $todoStatus)\n {\n //\n }", "public function store(Todo $todo, Request $request)\n {\n\n $task = new \\App\\Task;\n $task->todoId = $request->get('id', $todo->todoId);\n $task->taskTitle = $request->get('taskTitle');\n $task->isComplete = $request->get('isComplete');\n\n $task->save();\n \n return back();\n }", "function todo($task = '', $todo_id = '', $swap_with = '') {\n \n if($task == 'add')\n $this->crud_model->add_todo();\n \n if($task == 'reload')\n $this->load->view('backend/todo_body');\n\n if($task == 'reload_incomplete_todo')\n $this->crud_model->get_incomplete_todo();\n \n if($task == 'mark_as_done')\n $this->crud_model->mark_todo_as_done($todo_id);\n \n if($task == 'mark_as_undone')\n $this->crud_model->mark_todo_as_undone($todo_id);\n \n if($task == 'swap')\n $this->crud_model->swap_todo($todo_id, $swap_with);\n \n if($task == 'delete')\n $this->crud_model->delete_todo($todo_id);\n }", "function it_marks_todo_as_done(TodoList $todoList, Todo $todo)\n {\n $input = new MarkTodoAsDoneInput('Learn OOP', 'cherif');\n \n // Use mock test double to check the call for entity method\n $todo->markAsDone($input->getOwner())->shouldBeCalled();\n\n // Use Stub test double to simulate $todo->getName result\n $todo->getName()->willReturn($input->getName());\n\n // Use Stub test double to simulate $todo->getOwner result\n $todo->getOwner()->willReturn($input->getOwner());\n\n // Check the result of the output\n $this->handle($input)->shouldReturnAnInstanceOf(MarkTodoAsDoneOutput::class);\n\n // Use spy test double to check the $todo::list method is called\n $todoList->save($todo)->shouldHaveBeenCalled();\n }", "public function edit(EditTodo $request)\n {\n // ユーザーモデルのインスタンスをキーで呼び出す(SQL投げるから当然キーじゃないと見つからない。見つからないとデータ形式が相違するからsave()もupdate()もできない。)\n $EditTodo = Todo::where('id', '=', $request->id)\n ->where('user_id', '=', Auth::user()->users())\n ->first();\n \n // 各カラムに入力された値を代入する\n $EditTodo->title = $request->title;\n $EditTodo->detail = $request->detail;\n $EditTodo->start_date = $request->start_date;\n $EditTodo->due_date = $request->due_date;\n $EditTodo->status = $request->status;\n\n //入力値を暗号化してから代入する(Authが暗号化されたパスワードを扱うことを前提としてるので、暗号化しないと登録はできてもログインできない。)\n //$EditUser->password = Hash::make($request['password']);\n \n // インスタンスの状態をデータベースに書き込む(save()は単なる上書きでなく、差分上書き。差分がなければ更新されない。更新処理の場合updated_atは自動更新される。)\n $EditTodo->save();\n \n return redirect()->route('todo.index');\n }", "public function setService($value)\n {\n $this->setProperty(\"Service\", $value, true);\n }", "public function todos()\n {\n return $this->hasMany(Todo::class, 'to_do_resp_user');\n }", "public function setServiceNotes($val)\n {\n $this->_propDict[\"serviceNotes\"] = $val;\n return $this;\n }", "public function show(Todo $todo)\n {\n //\n }", "public function show(Todo $todo)\n {\n //\n }", "public function show(Todo $todo)\n {\n //\n }", "public function show(Todo $todo)\n {\n //\n }", "public function test_todo_can_add_task()\n {\n $user = User::factory()->create();\n $todoPriority = TodoPriority::factory()->create();\n $this->actingAs($user, 'api');\n\n $response = $this->postJson('/api/todo', [\n 'title' => 'password',\n 'description' => 'new-password',\n 'id_user' => $user->id,\n 'id_todo_priority' => $todoPriority->id,\n 'deadline_at' => '2021-03-07',\n 'completed_at' => '',\n ], ['Accept' => 'application/json']);\n\n $response->assertStatus(200);\n }", "public function edit(Todo $todo)\n {\n ////Get authenticated user and display todo to edit\n $userId = Auth::user()->id;\n $todo = Todo::where(['user_id' => $userId, 'id' => $todo->id])->first();\n if ($todo) {\n return view('todo.edit', [ 'todo' => $todo ]);\n } else {\n return redirect('todo')->with('error', 'Todo not found');\n }\n }", "public function create(Todo $todo, CreateTodo $request)\n {\n // ユーザーモデルのインスタンスを作成する\n $NewTodo = new Todo();\n // 各カラムに入力された値を代入する\n $NewTodo->user_id = Auth::user()->users();\n $NewTodo->title = $request->title;\n $NewTodo->detail = $request->detail;\n $NewTodo->start_date = $request->start_date;\n $NewTodo->due_date = $request->due_date;\n $NewTodo->status = $request->status;\n\n $NewTodo->save();\n\n // インスタンスの状態をデータベースに書き込む(save()は単なる上書きでなく、差分上書き。差分がなければ更新されない。)\n //$NewTodo->save();\n \n return redirect()->route('todo.index', [\n 'id' => $NewTodo->id,\n ]);\n }", "public function edit(Todo $todo)\n {\n return Inertia::render('edit',['edits'=>$todo]);\n }", "public function index(ToDo $tod)\n {\n\n // $todo = ToDo::where('id' , 1)->get();\n\n $todos = ToDo::orderBy('completed', 'desc')->get();\n\n // dd($todo);\n\n return view('todos.index' , compact('todos'));\n }" ]
[ "0.7208782", "0.64848495", "0.5809661", "0.5698839", "0.5698839", "0.5659127", "0.5654152", "0.559039", "0.5553459", "0.5508131", "0.5503365", "0.53871304", "0.531201", "0.53059095", "0.5287732", "0.52754307", "0.5242822", "0.52342916", "0.5226587", "0.5215506", "0.52060205", "0.5200526", "0.5200526", "0.5200526", "0.5200526", "0.5147175", "0.5114356", "0.51051587", "0.50917625", "0.5067438" ]
0.71055114
1
Sets the transitiveMemberOf property value. The groups, including nested groups, and directory roles that a user is a member of. Nullable.
public function setTransitiveMemberOf(?array $value): void { $this->getBackingStore()->set('transitiveMemberOf', $value); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function setMemberOf ($memberOf)\n {\n if (is_array($memberOf))\n $this->memberOf = $memberOf;\n else\n $this->memberOf = array($memberOf);\n }", "public function setMemberOf($memberOf)\n {\n $this->_memberOf = $memberOf;\n return $this;\n }", "public function setMemberOf(?array $value): void {\n $this->getBackingStore()->set('memberOf', $value);\n }", "public function setGroupMemberSet($principal, array $members) {\n\t\tthrow new Exception('Setting members of the group is not supported yet');\n\t}", "public function setGroupMemberSet($principal, array $groupMembers) {\n\n // We only ever allow setting the group-member-set for\n // calendar delegation principals\n if (!preg_match('|^delegation/([0-9]+)/principal/calendar-proxy-(read|write)$|')) {\n throw new \\Sabre\\DAV\\Exception\\Forbidden('We don\\'t allow setting the group-member-set for this principal');\n }\n throw new \\Sabre\\DAV\\Exception\\NotImplemented('This method is currently not implemented');\n\n }", "function setGroupMemberSet(array $groupMembers) {\n\n $this->principalBackend->setGroupMemberSet($this->principalProperties['uri'], $groupMembers);\n\n }", "function og_set_association($group, $content, $state, $settings) {\n $groups = array('gid' => $node->nid, 'state' => $state);\n og_set_association('user', $user, $groups, $replace);\n}", "public function setScopedRoleMemberOf(?array $value): void {\n $this->getBackingStore()->set('scopedRoleMemberOf', $value);\n }", "public function getTransitiveMemberOf(): ?array {\n $val = $this->getBackingStore()->get('transitiveMemberOf');\n if (is_array($val) || is_null($val)) {\n TypeUtils::validateCollectionValues($val, DirectoryObject::class);\n /** @var array<DirectoryObject>|null $val */\n return $val;\n }\n throw new \\UnexpectedValueException(\"Invalid type found in backing store for 'transitiveMemberOf'\");\n }", "public function setMembersRole($newVal)\r\n {\r\n if ( is_array($newVal) ) {\r\n foreach ($newVal as &$_value) {\r\n $_value = trim($_value);\r\n if ( !Warecorp_Group_Enum_MemberRole::isIn($_value) ) {\r\n throw new Zend_Exception('Incorrect member role');\r\n }\r\n }\r\n } elseif ( strpos($newVal, ';') ) {\r\n $newVal = explode(';', $newVal);\r\n foreach ($newVal as &$_value) {\r\n $_value = trim($_value);\r\n if ( !Warecorp_Group_Enum_MemberRole::isIn($_value) ) {\r\n throw new Zend_Exception('Incorrect member role');\r\n }\r\n }\r\n } else {\r\n if ( !Warecorp_Group_Enum_MemberRole::isIn($newVal) ) {\r\n throw new Zend_Exception('Incorrect member role');\r\n }\r\n $newVal = array($newVal);\r\n }\r\n $this->_membersRole = $newVal;\r\n return $this;\r\n }", "public function setLocalUsersOrGroups($val)\n {\n $this->_propDict[\"localUsersOrGroups\"] = $val;\n return $this;\n }", "public function getMemberOf ()\n {\n return $this->memberOf;\n }", "function MoveMembers ($members = array (), $targetgroupID = null, $sourcegroupID = null) {\n\t// The default target group is the Public group\n\t// Moving an artist out also means removing him from any projects in the group\n\tglobal $IMAGES, $PRICES, $ARTISTS, $TOPICS, $KEYWORDS, $COMMENTS, $RATINGS, $SETS, $GROUPS, $PROJECTS, $PARTS, $SNIPPETS, $STORIES;\n\tglobal $msg, $error;\n\t\n\tisset($targetgroupID) || $targetgroupID = $this->ID;\n\tisset($sourcegroupID) || $sourcegroupID = $this->ID;\n\t\n\t$projects = $this->ProjectList();\n\n\tif ($targetgroupID != $sourcegroupID) {\t\n\t\tif (! is_array($members)) { $members = array ($members); }\n\t\tforeach ($members as $artistID) {\n\t\t\t// remove artist from all projects in the group\n\t\t\tforeach ($projects as $project) {\n\t\t\t\tRemoveArtistFromProject ($project['ID'], $artistID);\n\t\t\t}\n\t\t\t\n\t\t\t// don't mess with the member's default group.\n\t\t\t// UpdateRecord( $ARTISTS, $artistID, array ('GroupID' => $targetgroupID ));\n\t\t\t// Can't add if other group won't accept\n\t\t\tif ($this->AddMembersToGroup ($artistID, $targetgroupID))\t\t\t\n\t\t\t\t$this->DeleteMembersFromGroup ($artistID, $sourcegroupID);\n\t\t}\n\t}\n}", "public function setGroupNodes($values)\n {\n $this->toUser = (is_null($this->toUser)) ? new Carerix_Api_Rest_Entity_CRUser() : $this->toUser;\n $this->toUser->setGroupNodes($values);\n return $this;\n }", "function ExpelMembers ($members = array (), $targetgroupID = PUBLIC_GROUP_ID) {\n// Move members from current group to target, default is Public\n\t$this->MoveMembers ($members, $targetgroupID);\n}", "public function setMemberOf(array $dnGroups)\n {\n $this->memberof = $dnGroups;\n }", "function changeMemberGroup($memberId, $newGroup, $currentGroup = false)\n{\n\tglobal $config;\n\t$memberId = (int)$memberId;\n\t\n\t// Make sure we have the member's current group (if it wasn't passed as an argument.)\n\tif (!$currentGroup) $currentGroup = $this->db->result($this->db->query(\"SELECT account FROM {$config[\"tablePrefix\"]}members WHERE memberId=$memberId\"), 0);\n\t\n\t// Determine which groups the member can be changed to.\n\tif (!($possibleGroups = $this->canChangeGroup($memberId, $currentGroup)) or !in_array($newGroup, $possibleGroups)) return false;\n\t\n\t$this->callHook(\"changeMemberGroup\", array(&$newGroup));\n\t\n\t// Change the group!\n\t$this->db->query(\"UPDATE {$config[\"tablePrefix\"]}members SET account='$newGroup' WHERE memberId=$memberId\");\n}", "public function changeSubContractorGroup(User $subContractor, $groupId)\n {\n if($subContractor->group_id == $groupId) return $subContractor;\n $subContractor->update(['group_id' => $groupId]);\n $role = Role::byName('sub-contractor');\n if($subContractor->isSubContractorPrime()) {\n $role = Role::byName('sub-contractor-prime');\n }\n $subContractor->roles()->detach();\n $subContractor->attachRole($role);\n \\Event::fire('JobProgress.SubContractors.Events.SubContractorGroupChanged', new SubContractorGroupChanged($subContractor));\n return $subContractor;\n }", "function resolve_member($userid, $folder_id, &$folder_owner_id)\n{\n $inherits = CAN_ANNOTATE | CAN_SUBFOLDER | CAN_DOCUMENT | VETTER | MANAGER | CAN_OWN | INHERITS_MEMBERS;\n for (;$folder_id != 1; $folder_id = $row['parent_folder_id']) {\n $query = \n'select * from groups\n where user_id = ' . DBstring($userid) . '\n and folder_id = ' . DBnumber($folder_id);\n $ret = DBquery($query);\n if (!$ret) {\n return null;\n }\n $member = DBfetch($ret);\n if ($member) {\n $member['folder_permissions'] &= $inherits;\n if (!($inherits & INHERITS_MEMBERS) && !($member['folder_permissions'] & inherits)) {\n return false;\n }\n if (isset($folder_owner_id)) {\n return $member;\n } }\n $query =\n'select parent_folder_id, inherits, creator_user_id\n from folders\n where folder_id = ' . DBnumber($folder_id);\n $ret = DBquery($query);\n if (!$ret) {\n return null;\n }\n $folder = DBfetch($ret);\n if (!$folder) {\n echo '\n<br>Unable to read folder \"', htmlspecialchars($folder_id), '\"';\n return null;\n }\n if (!isset($folder_owner_id)) {\n $folder_owner_id = $folder['creator_user_id'];\n if (isset($member)) {\n return $member;\n } }\n $inherits_flag = $folder['inherits'];\n $inherits &= $inherits_flag;\n if (!$inherits) {\n break;\n } }\n return false;\n}", "public function setMembersManagement($value) {\n if (is_bool($value)) { $this->MembersManagement = $value; }\n }", "public function setMembers($members);", "function setTeamAcl( $userid ) {\n\t}", "public function setUsersIn() {\r\n $users = $this->getProperty('users');\r\n $memberships = array();\r\n if (!empty($users)) {\r\n $users = is_array($users) ? $users : $this->modx->fromJSON($users);\r\n $memberships = array();\r\n foreach ($users as $userArray) {\r\n if (empty($userArray['id']) || empty($userArray['role'])) continue;\r\n \r\n /** @var modUserGroupMember $membership */\r\n $membership = $this->modx->newObject('modUserGroupMember');\r\n $membership->set('user_group',$this->object->get('id'));\r\n $membership->set('member',$userArray['id']);\r\n $membership->set('role',$userArray['role']);\r\n $memberships[] = $membership;\r\n }\r\n $this->object->addMany($memberships);\r\n }\r\n return $memberships;\r\n }", "function theme_c4m_user_group_member_contact(array $field) {\n global $user;\n\n $account = $field['entity'];\n\n // Anonymous users cannot have contact forms.\n if (!$account->uid) {\n return NULL;\n }\n\n // Users may not contact themselves.\n if ($user->uid == $account->uid) {\n return NULL;\n }\n\n // If the requested user has disabled their contact form, or this preference\n // has not yet been saved, do not allow users to contact them.\n if (empty($account->data['contact'])) {\n return NULL;\n }\n\n // If requested user has been blocked, do not allow users to contact them.\n if (empty($account->status)) {\n return NULL;\n }\n\n $group = c4m_og_current_group();\n // If not within OG context, return early.\n if (!$group) {\n return NULL;\n }\n\n if (c4m_features_og_members_is_power_user($group)) {\n // Site admin, group admin/owner have 'contact multiple' instead of link.\n return NULL;\n }\n\n if (c4m_og_user_is_member()) {\n // User is group member.\n return '<i class=\"fa fa-envelope-o\"></i> ' . l(t('Contact'), \"user/{$account->uid}/contact\", array('query' => drupal_get_destination()));\n }\n}", "function chgrp($files, $group, $recursive = false);", "public function setUsersIn() {\n $users = $this->getProperty('users');\n $memberships = array();\n if (!empty($users)) {\n $users = is_array($users) ? $users : $this->modx->fromJSON($users);\n $memberships = array();\n foreach ($users as $userArray) {\n if (empty($userArray['id']) || empty($userArray['role'])) continue;\n \n /** @var modUserGroupMember $membership */\n $membership = $this->modx->newObject('modUserGroupMember');\n $membership->set('user_group',$this->object->get('id'));\n $membership->set('member',$userArray['id']);\n $membership->set('role',$userArray['role']);\n $memberships[] = $membership;\n }\n $this->object->addMany($memberships);\n }\n return $memberships;\n }", "public function setMember($member);", "public function setTeamMembers($var)\n {\n $arr = GPBUtil::checkRepeatedField($var, \\Google\\Protobuf\\Internal\\GPBType::STRING);\n $this->team_members = $arr;\n\n return $this;\n }", "public function setOrganismId($v)\n {\n if ($v !== null && is_numeric($v)) {\n $v = (int) $v;\n }\n\n if ($this->organism_id !== $v) {\n $this->organism_id = $v;\n $this->modifiedColumns[] = FeaturePeer::ORGANISM_ID;\n }\n\n if ($this->aOrganism !== null && $this->aOrganism->getOrganismId() !== $v) {\n $this->aOrganism = null;\n }\n\n\n return $this;\n }", "public function setOrganism(Organism $v = null)\n {\n if ($v === null) {\n $this->setOrganismId(NULL);\n } else {\n $this->setOrganismId($v->getOrganismId());\n }\n\n $this->aOrganism = $v;\n\n // Add binding for other direction of this n:n relationship.\n // If this object has already been added to the Organism object, it will not be re-added.\n if ($v !== null) {\n $v->addFeature($this);\n }\n\n\n return $this;\n }" ]
[ "0.52170175", "0.5050917", "0.48798826", "0.4622943", "0.45996374", "0.44929335", "0.44609997", "0.44285247", "0.44238952", "0.44143036", "0.43884045", "0.42486748", "0.42318508", "0.42240912", "0.42215073", "0.4147308", "0.41434637", "0.40688285", "0.40470996", "0.40249443", "0.40109244", "0.4006323", "0.39990395", "0.3991319", "0.39795467", "0.39754406", "0.3923515", "0.39081928", "0.39075676", "0.38929844" ]
0.5687342
0
Sets the transitiveReports property value. The transitive reports for a user. Readonly.
public function setTransitiveReports(?array $value): void { $this->getBackingStore()->set('transitiveReports', $value); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function reports() {\n \t$user = $this->Users->get($this->Auth->user('id'), ['contain' => ['DiscussionReports', 'ProjectReports', 'UserReports', 'TicketReports']]);\n \t$this->set('user', $user);\n \t$this->set('_serialize', ['user']);\n }", "public function setReportingTo(User $reportingTo)\n\t{\n\t\t$this->addKeyValue('Reporting_To', $reportingTo); \n\n\t}", "public function reports()\n {\n return $this->hasMany(Report::class, 'user_id');\n }", "public function setTransitiveDependentsIncluded($var)\n {\n GPBUtil::checkBool($var);\n $this->transitive_dependents_included = $var;\n\n return $this;\n }", "public function setTransitiveDependenciesIncluded($var)\n {\n GPBUtil::checkBool($var);\n $this->transitive_dependencies_included = $var;\n\n return $this;\n }", "public function setDirectReports(?array $value): void {\n $this->getBackingStore()->set('directReports', $value);\n }", "public function setReport(IReport $report);", "public function getTransitiveReports(): ?array {\n $val = $this->getBackingStore()->get('transitiveReports');\n if (is_array($val) || is_null($val)) {\n TypeUtils::validateCollectionValues($val, DirectoryObject::class);\n /** @var array<DirectoryObject>|null $val */\n return $val;\n }\n throw new \\UnexpectedValueException(\"Invalid type found in backing store for 'transitiveReports'\");\n }", "public function setReport(Report $report)\n {\n $this->report = $report;\n }", "function admin_userReports()\n\t{\n\t\t$this->User->recursive = 0;\n\t\t$rol = $this->data['User']['role_id'];\t\n\t\tforeach($this->data['User'] as $indice =>$valor)\n\t\t{\n\t\t\tif($valor==1)\n\t\t\t{\n\t\t\t\t$array[] = $indice;\n\t\t\t}\n\t\t}\n\t\t$reporte = $this->User->find('all', array('fields'=>$array,'conditions'=>array('User.role_id'=>$rol)));\n\t\t$this->set(compact('reporte'));\n\t}", "public function getReports()\n {\n return $this->hasMany(Report::className(), ['doctor_id' => 'doctor_id']);\n }", "public function ScriptReports()\n\t{\n\t\treturn $this->hasOne('App\\Models\\ScriptReport','user_id','id');\n\t}", "public function setTransitiveMemberOf(?array $value): void {\n $this->getBackingStore()->set('transitiveMemberOf', $value);\n }", "public function reports()\n\t{\n\t\treturn $this->hasMany('App\\Report');\n\t}", "public function setPermissionsSubscribeReportToOtherUsers($permissionsSubscribeReportToOtherUsers)\n {\n $this->permissionsSubscribeReportToOtherUsers = $permissionsSubscribeReportToOtherUsers;\n return $this;\n }", "public function reports()\n {\n return $this->hasMany('App\\Report');\n }", "public function reportsTo()\n {\n return $this->belongsTo(OrganizationUnit::class,'reports_to');\n }", "function Reports($reportid=\"\")\n\t{\n\t\tglobal $adb,$current_user,$theme,$mod_strings;\n\t\t$this->initListOfModules();\n\t\tif($reportid != \"\")\n\t\t{\n\t\t\t// Lookup information in cache first\n\t\t\t$cachedInfo = VTCacheUtils::lookupReport_Info($current_user->id, $reportid);\n\t\t\t$subordinate_users = VTCacheUtils::lookupReport_SubordinateUsers($reportid);\n\t\t\t\n\t\t\t$reportModel = Reports_Record_Model::getCleanInstance($reportid);\n\t\t\t$sharingType = $reportModel->get('sharingtype');\n\t\t\t\n\t\t\tif($cachedInfo === false) {\n\t\t\t\t$ssql = \"select vtiger_reportmodules.*,vtiger_report.* from vtiger_report inner join vtiger_reportmodules on vtiger_report.reportid = vtiger_reportmodules.reportmodulesid\";\n\t\t\t\t$ssql .= \" where vtiger_report.reportid = ?\";\n\t\t\t\t$params = array($reportid);\n\n\t\t\t\trequire_once('include/utils/GetUserGroups.php');\n\t\t\t\trequire('user_privileges/user_privileges_'.$current_user->id.'.php');\n\t\t\t\t$userGroups = new GetUserGroups();\n\t\t\t\t$userGroups->getAllUserGroups($current_user->id);\n\t\t\t\t$user_groups = $userGroups->user_groups;\n\t\t\t\tif(!empty($user_groups) && $sharingType == 'Private'){\n\t\t\t\t\t$user_group_query = \" (shareid IN (\".generateQuestionMarks($user_groups).\") AND setype='groups') OR\";\n\t\t\t\t\tarray_push($params, $user_groups);\n\t\t\t\t}\n\n\t\t\t\t$non_admin_query = \" vtiger_report.reportid IN (SELECT reportid from vtiger_reportsharing WHERE $user_group_query (shareid=? AND setype='users'))\";\n\t\t\t\tif($sharingType == 'Private'){\n\t\t\t\t\t$ssql .= \" and (( (\".$non_admin_query.\") or vtiger_report.sharingtype='Public' or vtiger_report.owner = ? or vtiger_report.owner in(select vtiger_user2role.userid from vtiger_user2role inner join vtiger_users on vtiger_users.id=vtiger_user2role.userid inner join vtiger_role on vtiger_role.roleid=vtiger_user2role.roleid where vtiger_role.parentrole like '\".$current_user_parent_role_seq.\"::%'))\";\n\t\t\t\t\tarray_push($params, $current_user->id);\n\t\t\t\t\tarray_push($params, $current_user->id);\n\t\t\t\t}\n\n\t\t\t\t$query = $adb->pquery(\"select userid from vtiger_user2role inner join vtiger_users on vtiger_users.id=vtiger_user2role.userid inner join vtiger_role on vtiger_role.roleid=vtiger_user2role.roleid where vtiger_role.parentrole like '\".$current_user_parent_role_seq.\"::%'\",array());\n\t\t\t\t$subordinate_users = Array();\n\t\t\t\tfor($i=0;$i<$adb->num_rows($query);$i++){\n\t\t\t\t\t$subordinate_users[] = $adb->query_result($query,$i,'userid');\n\t\t\t\t}\n\n\t\t\t\t// Update subordinate user information for re-use\n\t\t\t\tVTCacheUtils::updateReport_SubordinateUsers($reportid, $subordinate_users);\n\t\t\t\t\n\t\t\t\t//Report sharing for vtiger7\n\t\t\t\t$queryObj = new stdClass();\n\t\t\t\t$queryObj->query = $ssql;\n\t\t\t\t$queryObj->queryParams = $params;\n\t\t\t\t$queryObj = self::getReportSharingQuery($queryObj, $sharingType);\n\t\t\t\t\n\t\t\t\t$result = $adb->pquery($queryObj->query, $queryObj->queryParams);\n\t\t\t\tif($result && $adb->num_rows($result)) {\n\t\t\t\t\t$reportmodulesrow = $adb->fetch_array($result);\n\n\t\t\t\t\t// Update information in cache now\n\t\t\t\t\tVTCacheUtils::updateReport_Info(\n\t\t\t\t\t\t$current_user->id, $reportid, $reportmodulesrow[\"primarymodule\"],\n\t\t\t\t\t\t$reportmodulesrow[\"secondarymodules\"], $reportmodulesrow[\"reporttype\"],\n\t\t\t\t\t\t$reportmodulesrow[\"reportname\"], $reportmodulesrow[\"description\"],\n\t\t\t\t\t\t$reportmodulesrow[\"folderid\"], $reportmodulesrow[\"owner\"]\n\t\t\t\t\t);\n\t\t\t\t}\n\n\t\t\t\t// Re-look at cache to maintain code-consistency below\n\t\t\t\t$cachedInfo = VTCacheUtils::lookupReport_Info($current_user->id, $reportid);\n\t\t\t}\n\n\t\t\tif($cachedInfo) {\n\t\t\t\t$this->primodule = $cachedInfo[\"primarymodule\"];\n\t\t\t\t$this->secmodule = $cachedInfo[\"secondarymodules\"];\n\t\t\t\t$this->reporttype = $cachedInfo[\"reporttype\"];\n\t\t\t\t$this->reportname = decode_html($cachedInfo[\"reportname\"]);\n\t\t\t\t$this->reportdescription = decode_html($cachedInfo[\"description\"]);\n\t\t\t\t$this->folderid = $cachedInfo[\"folderid\"];\n\t\t\t\tif($is_admin==true || in_array($cachedInfo[\"owner\"],$subordinate_users) || $cachedInfo[\"owner\"]==$current_user->id)\n\t\t\t\t\t$this->is_editable = 'true';\n\t\t\t\telse\n\t\t\t\t\t$this->is_editable = 'false';\n\t\t\t} \n\t\t\t}\n\t}", "public function __invoke(Report $report)\n {\n if ($id = $this->resolver->resolve()->getUserId()) {\n $report->setUser(['id' => $id]);\n }\n }", "public function referral_reports()\n {\n return $this->hasMany(config('inventory.aircon'));\n }", "public function getChangeReports()\n {\n return $this->change_reports;\n }", "public function enableReporting($report = true)\n {\n return $this->reporting_enabled = (bool)$report;\n }", "private function participated($report, $user)\n {\n $reviewerParticipated = $this->reportRepository->hasReviewerParticipated($report->id, $user->id);\n\n if ($reviewerParticipated) {\n throw new \\Exception(trans('reports.no_participation'));\n }\n }", "public function canParticipate($report, $user)\n {\n if (!$user->hasRole('admin') && $report->user_id != $user->id) {\n throw new \\Exception(trans('reports.no_participation'));\n }\n\n $this->participated($report, $user);\n }", "public function view_reports(User $user){\n $is_report_owner = is_null(WorkshopReport::where('owner_user_id',$user->id)->select('id')->first())?false:true;\n// $has_report_perm = is_null(ModulePermission::where('user_id',$user->id)->where('permission','report')->select('id')->first())?false:true;\n $has_permission = is_null(WorkshopReport::whereJsonContains('permissions',$user->id)->select('id')->first())?false:true;\n if(in_array('run_workshop_reports',$user->user_permissions)\n || in_array('manage_workshop_reports',$user->user_permissions)\n || $is_report_owner\n || $has_permission\n// || $has_report_perm\n ){\n return true;\n }\n }", "public function setUser ( \\Maven\\Core\\Domain\\User $user ) {\n\t\t$this->user = $user;\n\t}", "public function setChangeReports($var)\n {\n $arr = GPBUtil::checkRepeatedField($var, \\Google\\Protobuf\\Internal\\GPBType::MESSAGE, \\Google\\Cloud\\ServiceManagement\\V1\\ChangeReport::class);\n $this->change_reports = $arr;\n\n return $this;\n }", "protected function setLastReport($last_report) {\n if ($log = @fopen($this->config->get('last_reported_log'), 'w+')) {\n fwrite($log, $last_report);\n fclose($log);\n }\n }", "public function getRelatedReports()\n {\n return array();\n }", "function setAllAsRead($user)\n\t{\n\t\t$notifs = $this->getUnreadUserNotifications($user);\n\n\t\tforeach ($notifs as $notif)\n\t\t{\n\t\t\t$this->setAsRead($notif, $user);\n\t\t}\n\n\t\treturn;\n\t}" ]
[ "0.4914812", "0.48242387", "0.47932523", "0.47712627", "0.45930153", "0.4531303", "0.44409055", "0.42899287", "0.42857963", "0.42777938", "0.41885933", "0.41847244", "0.41407165", "0.41209477", "0.40693578", "0.4055253", "0.40359125", "0.40273157", "0.40023294", "0.39573863", "0.3912322", "0.3895359", "0.3893894", "0.38735497", "0.3858185", "0.38531697", "0.38309315", "0.38220882", "0.38202026", "0.3818157" ]
0.6782486
0
Sets the usageLocation property value. A two letter country code (ISO standard 3166). Required for users that will be assigned licenses due to legal requirement to check for availability of services in countries. Examples include: US, JP, and GB. Not nullable. Supports $filter (eq, ne, not, ge, le, in, startsWith, and eq on null values).
public function setUsageLocation(?string $value): void { $this->getBackingStore()->set('usageLocation', $value); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function setUsageLocation($val)\n {\n $this->_propDict[\"usageLocation\"] = $val;\n return $this;\n }", "public function setUseLocation($v)\n\t{\n\t\tif ($v !== null) {\n\t\t\t$v = (string) $v;\n\t\t}\n\n\t\tif ($this->use_location !== $v) {\n\t\t\t$this->use_location = $v;\n\t\t\t$this->modifiedColumns[] = UsersPeer::USE_LOCATION;\n\t\t}\n\n\t\treturn $this;\n\t}", "public function set_location($location)\n {\n $this->location = $location;\n }", "public function setLocationFilter(?LoyaltyEventLocationFilter $locationFilter): void\n {\n $this->locationFilter = $locationFilter;\n }", "public function getUsageLocation()\n {\n if (array_key_exists(\"usageLocation\", $this->_propDict)) {\n return $this->_propDict[\"usageLocation\"];\n } else {\n return null;\n }\n }", "public function setLocation($location=null) {\n\t\tif($location == null) return;\n\t\tif(!($location instanceOf Intra_Object_Gis_Point)) {\n\t\t\t$location = Intra_Object_Gis::fromWKB($location);\n\t\t}\n\t\t$this->_set('c_location', $location);\n\t}", "public function setLocation($location) {\r\n\t$this->location = $location;\r\n }", "public function setUsageCategory(\\Mu4ddi3\\Compensa\\Webservice\\StructType\\CarUsageCategory $usageCategory = null)\n {\n if (is_null($usageCategory) || (is_array($usageCategory) && empty($usageCategory))) {\n unset($this->usageCategory);\n } else {\n $this->usageCategory = $usageCategory;\n }\n return $this;\n }", "public function setLocation($location) {\n $this->location = $location;\n }", "public function setLocationAttribute($value)\n {\n $location_lat = round(object_get($value, 'latitude'), 7);\n $location_lng = round(object_get($value, 'longitude'), 7);\n $this->attributes['location_lat'] = $location_lat;\n $this->attributes['location_lng'] = $location_lng;\n }", "public function set_location($value)\n {\n $this->set_default_property(self::PROPERTY_LOCATION, $value);\n }", "public function setLocation($var)\n {\n GPBUtil::checkString($var, True);\n $this->location = $var;\n\n return $this;\n }", "public function setLocation($var)\n {\n GPBUtil::checkString($var, True);\n $this->location = $var;\n\n return $this;\n }", "public function setLocation($var)\n {\n GPBUtil::checkString($var, True);\n $this->location = $var;\n\n return $this;\n }", "public function setLocation($location){\n\t\t$this->location = $location;\n\t}", "public function setLocation($location){\n\t\t$this->location = $location;\n\t}", "public function setLocation($location) {\n\t\t$this->location = $location;\n\t}", "public function setLocation($location) {\n\t\t$this->location = $location;\n\t}", "public function setLocation($location) {\n\t\t$this->location = $location;\n\t}", "public function setUsageCategory(string $usageCategory): self\n {\n $this->options['usageCategory'] = $usageCategory;\n return $this;\n }", "public function setDefaultUsageLocation(?string $value): void {\n $this->getBackingStore()->set('defaultUsageLocation', $value);\n }", "public function setLocation(Location $location)\n {\n $this->location = $location;\n }", "public function setLocation(Location $location)\n {\n $this->location = $location;\n }", "public function setLocationAttribute(array|string $location): void\n {\n if (is_array($location)) {\n $this->attributes['lat'] = $location['lat'];\n $this->attributes['lng'] = $location['lng'];\n }\n }", "protected function setLocation($location) {\r\n $this->location = $this->create($location);\r\n }", "public function setLocation($value)\n {\n $this->setProperty(\"Location\", $value, true);\n }", "private function setLocation(string $location): void\n {\n $this->location = $location;\n }", "public function setServiceLocation($val)\n {\n $this->_propDict[\"serviceLocation\"] = $val;\n return $this;\n }", "public function setLocation($var)\n {\n GPBUtil::checkMessage($var, \\Restaurant_service\\Restaurant_Location::class);\n $this->location = $var;\n\n return $this;\n }", "public function __construct($usage)\n {\n $this->usage = $usage;\n }" ]
[ "0.6948462", "0.61414015", "0.57427084", "0.5726908", "0.56448424", "0.5615568", "0.5562908", "0.55320543", "0.55319035", "0.55228454", "0.55212414", "0.5506361", "0.5506361", "0.5506361", "0.54900867", "0.54900867", "0.5479181", "0.5479181", "0.5479181", "0.5401296", "0.52067715", "0.51974714", "0.51974714", "0.5136182", "0.51096874", "0.5094045", "0.5053079", "0.50191075", "0.49510464", "0.49407077" ]
0.6190306
1
Sets the windowsInformationProtectionDeviceRegistrations property value. Zero or more WIP device registrations that belong to the user.
public function setWindowsInformationProtectionDeviceRegistrations(?array $value): void { $this->getBackingStore()->set('windowsInformationProtectionDeviceRegistrations', $value); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getWindowsInformationProtectionDeviceRegistrations(): ?array {\n $val = $this->getBackingStore()->get('windowsInformationProtectionDeviceRegistrations');\n if (is_array($val) || is_null($val)) {\n TypeUtils::validateCollectionValues($val, WindowsInformationProtectionDeviceRegistration::class);\n /** @var array<WindowsInformationProtectionDeviceRegistration>|null $val */\n return $val;\n }\n throw new \\UnexpectedValueException(\"Invalid type found in backing store for 'windowsInformationProtectionDeviceRegistrations'\");\n }", "public function getWindowsInformationProtectionDeviceRegistrations(): ?array {\n $val = $this->getBackingStore()->get('windowsInformationProtectionDeviceRegistrations');\n if (is_array($val) || is_null($val)) {\n TypeUtils::validateCollectionValues($val, WindowsInformationProtectionDeviceRegistration::class);\n /** @var array<WindowsInformationProtectionDeviceRegistration>|null $val */\n return $val;\n }\n throw new \\UnexpectedValueException(\"Invalid type found in backing store for 'windowsInformationProtectionDeviceRegistrations'\");\n }", "public function setMdmWindowsInformationProtectionPolicies(?array $value): void {\n $this->getBackingStore()->set('mdmWindowsInformationProtectionPolicies', $value);\n }", "public function setManagedAppRegistrations(?array $value): void {\n $this->getBackingStore()->set('managedAppRegistrations', $value);\n }", "public function setManagedAppRegistrations(?array $value): void {\n $this->getBackingStore()->set('managedAppRegistrations', $value);\n }", "public function setWindowsInformationProtectionPolicies(?array $value): void {\n $this->getBackingStore()->set('windowsInformationProtectionPolicies', $value);\n }", "public function setRegisteredDevices(?array $value): void {\n $this->getBackingStore()->set('registeredDevices', $value);\n }", "public function setWdacSupplementalPolicies(?array $value): void {\n $this->getBackingStore()->set('wdacSupplementalPolicies', $value);\n }", "public function setWindowsManagedAppProtections(?array $value): void {\n $this->getBackingStore()->set('windowsManagedAppProtections', $value);\n }", "public function setWindowsInformationProtectionWipeActions(?array $value): void {\n $this->getBackingStore()->set('windowsInformationProtectionWipeActions', $value);\n }", "public function setAllowedIosDeviceModels(?string $value): void {\n $this->getBackingStore()->set('allowedIosDeviceModels', $value);\n }", "public function setOwnedDevices(?array $value): void {\n $this->getBackingStore()->set('ownedDevices', $value);\n }", "public function setIosManagedAppProtections(?array $value): void {\n $this->getBackingStore()->set('iosManagedAppProtections', $value);\n }", "function setRegistration(RegisterInfoInterface $info);", "public function setSecurityComplianceNotificationPhones(?array $value): void {\n $this->getBackingStore()->set('securityComplianceNotificationPhones', $value);\n }", "public function setRegistered($value)\n {\n $this->registered = $value;\n }", "public function setRegistered($value)\n {\n $this->registered = $value;\n }", "public function setRegistered($value)\n {\n $this->registered = $value;\n }", "public function setDefaultManagedAppProtections(?array $value): void {\n $this->getBackingStore()->set('defaultManagedAppProtections', $value);\n }", "public function setInformationProtection(?InformationProtection $value): void {\n $this->getBackingStore()->set('informationProtection', $value);\n }", "public function register_notification( $notifications ) {\n\t\t$notifications['malware-scheduling'] = array(\n\t\t\t'recipient' => ITSEC_Notification_Center::R_USER_LIST,\n\t\t\t'optional' => true,\n\t\t\t'module' => 'malware-scheduling',\n\t\t);\n\n\t\treturn $notifications;\n\t}", "public function setRegistrationId($value)\n {\n $this->setProperty(\"RegistrationId\", $value, true);\n }", "public function setManagedDevices(?array $value): void {\n $this->getBackingStore()->set('managedDevices', $value);\n }", "public function setManagedDevices(?array $value): void {\n $this->getBackingStore()->set('managedDevices', $value);\n }", "public function registrationIds($registrationIds = null) {\n return $this->getterSetter('registrationIds', $registrationIds);\n }", "public function setDevices(?array $value): void {\n $this->getBackingStore()->set('devices', $value);\n }", "public function setDeviceKeys(?array $value): void {\n $this->getBackingStore()->set('deviceKeys', $value);\n }", "private function setRegister()\n {\n $this->register = isset($this->config->register)\n ? (object) $this->config->register\n : (object) [];\n }", "public function getManagedAppRegistrations(): ?array {\n $val = $this->getBackingStore()->get('managedAppRegistrations');\n if (is_array($val) || is_null($val)) {\n TypeUtils::validateCollectionValues($val, ManagedAppRegistration::class);\n /** @var array<ManagedAppRegistration>|null $val */\n return $val;\n }\n throw new \\UnexpectedValueException(\"Invalid type found in backing store for 'managedAppRegistrations'\");\n }", "public function getManagedAppRegistrations(): ?array {\n $val = $this->getBackingStore()->get('managedAppRegistrations');\n if (is_array($val) || is_null($val)) {\n TypeUtils::validateCollectionValues($val, ManagedAppRegistration::class);\n /** @var array<ManagedAppRegistration>|null $val */\n return $val;\n }\n throw new \\UnexpectedValueException(\"Invalid type found in backing store for 'managedAppRegistrations'\");\n }" ]
[ "0.60511", "0.60511", "0.5986532", "0.5919696", "0.5919696", "0.57954973", "0.5692557", "0.52207035", "0.52011555", "0.505041", "0.49013987", "0.49005294", "0.48680967", "0.4843249", "0.47979072", "0.4797395", "0.4797395", "0.4797395", "0.465379", "0.46273318", "0.461983", "0.46130687", "0.45889428", "0.45889428", "0.45834196", "0.45703915", "0.4559687", "0.45498046", "0.45134103", "0.45134103" ]
0.77245176
1
/ listmaker_fileupload( 'litesponsor', $id ); hameye field haye `<input type="file"` ro shenasai mikone, age taki bashan, tu hamun table ke moarefi mishe mirize, tu sotuni hamnam ba esme `input` age az nou`e array bashan (dokme + dashte bashan va chandtai bashan) tu ye table digei be esme `table`_`input` mirize, masalan age esme `input` bahse `image`, va esme table bashe `litesponsor`, hameye `image` ha ro mirize tu table `litesponsor_image`, va `id` az `table` mirize tu column e `litesponsor_id`, va address e file i ke upload mishe ro mirize tu ye column be esme `input`, ke inja mishe `image` dar majmu, in function ro call konim, hamin kafie baraye kolle saveNew, va saveEdit, va dge niaz nis kari konim. in function ro tu saveNew va saveEdit call mikonim, esme table va `id` ro behesh midim. paramter e sevom, extension haye mojaz hast, ke pishfarzesh extension e ax ha hast. age bedim, hamechio ghabul mikone, masalan: "zip,rar,tar.gz" ya "" , ya "wmv,flv,avi"
function listmaker_fileupload( $table , $id , $ext_array=null ){ # # no file to upload if(! sizeof($_FILES) ){ ;// # # some input[] found } else foreach ($_FILES as $column => $r) { # # its a single input if( $_REQUEST['ArrayInput_'.$column]!=1 ){ listmaker_fileupload_solo( $table, $column, $id, $ext_array ); # # its an ArrayInput } else { listmaker_fileupload_multi( $table, $column, $id, $ext_array ); } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function onUpload($roo, $table = false, $file = false)\n {\n \n if ($table !== false) {\n $this->ontable = $table->tableName();\n $this->onid = $table->pid();\n }\n \n if ($file === false) {\n $file = isset($_FILES['imageUpload']) ? $_FILES['imageUpload'] : array();\n }\n \n //print_r($_FILES); echo $_FILES['imageUpload']['type'];exit;\n if (empty($file['tmp_name']) || \n empty($file['name']) || \n empty($file['type'])\n ) {\n \n $emap = array( \n 0=>\"There is no error, the file uploaded with success\", \n 1=>\"The uploaded file exceeds the upload_max_filesize directive in php.ini\", \n 2=>\"The uploaded file exceeds the MAX_FILE_SIZE directive that was specified in the HTML form\" ,\n 3=>\"The uploaded file was only partially uploaded\",\n 4=>\"No file was uploaded\",\n 6=>\"Missing a temporary folder\" \n ); \n $estr = (empty($file['error']) ? '?': $emap[$file['error']]);\n $this->err = \"Missing file details : Error=\". $estr;\n return false;\n }\n \n if ($this->id) {\n HTML_FlexyFramework::get()->page->jerr(\"updating images is disabled\");\n exit;\n $this->beforeDelete();\n }\n if ( empty($this->ontable)) {\n $this->err = \"Missing ontable\";\n return false;\n }\n \n if (!empty($this->imgtype) && $this->imgtype[0] == '-' && !empty($this->onid)) {\n // then its an upload \n $img = DB_DataObject::factory('Images');\n $img->onid = $this->onid;\n $img->ontable = $this->ontable;\n $img->imgtype = $this->imgtype;\n \n $img->find();\n while ($img->fetch()) {\n HTML_FlexyFramework::get()->page->jerr(\"updating images is disabled\");\n exit;\n $img->beforeDelete();\n $img->delete();\n }\n \n }\n \n \n \n require_once 'File/MimeType.php';\n $y = new File_MimeType();\n $this->mimetype = $file['type'];\n if (in_array($this->mimetype, array(\n 'text/application',\n 'application/octet-stream',\n 'image/x-png', // WTF does this?\n 'image/pjpeg', // WTF does this?\n 'application/x-apple-msg-attachment', /// apple doing it's magic...\n 'application/vnd.ms-excel', /// sometimes windows reports csv as excel???\n 'application/csv-tab-delimited-table', // windows again!!?\n ))) { // weird tyeps..\n $inf = pathinfo($file['name']);\n $this->mimetype = $y->fromExt($inf['extension']);\n }\n \n \n $ext = $y->toExt(trim((string) $this->mimetype ));\n \n $this->filename = empty($this->filename) ? \n $file['name'] : ($this->filename .'.'. $ext); \n \n \n \n if (!$this->createFrom($file['tmp_name'])) {\n $this->err = isset($this->err) ? $this->err : \"createFrom Image failed\";\n return false;\n }\n return true;\n \n }", "function i_html_field_file(&$params){\n \n // http://www.mysite.com/upload.php\n \n // = '<form action=\"' . $action . '\" method=\"post\" enctype=\"multipart/form-data\">\n $id = ( isset($params['id']) ) ? ' id=\"' . $params['id'] . '\"' : '';\n $name = ( isset($params['name']) ) ? ' name=\"' . $params['name'] . '\"' : '';\n $multi = ( isset($params['multiple']) && $params['multiple'] ) ? ' multiple=\"multiple\"' : '';\n $class = ( isset($params['class']) ) ? ' class=\"' . $params['class'] . '\"' : '';\n $style = empty($params['style']) ? '' : ' style=\"' . $params['style'] . '\"';\n \n $buf = '<input type=\"file\"' . $id . $name . $multi . $class . $style . '>';\n \n if( isset($params['obj_js_file']) && $params['obj_js_file'] ) $buf .= '<div id=\"res\"></div>';\n \n return $buf;\n\n}", "public function upload_image(){\r\n \r\n $photo = $_FILES['foto'];\r\n\r\n $name = str_replace(\" \",\"_\",$photo['name']);\r\n $image=$photo['tmp_name'];\r\n $typeimg = exif_imagetype($image);\r\n \r\n $folder = (isset($_POST['pasta']) && $this->validate_name($_POST['pasta'])) ? $_POST['pasta'] : \"\";\r\n\r\n\r\n if($typeimg <> 1 && $typeimg <> 2 && $typeimg <> 3){\r\n\r\n return '{\"error\":\"ficheiro ineadequado\"}';\r\n }\r\n\r\n \r\n $r_check_name = logex::$tcnx->query(\"SELECT nome FROM foto_galeria WHERE nome='$name'\");\r\n $check_name = $r_check_name->fetch_array();\r\n \r\n if($check_name[0]==$name){\r\n \r\n return '{\"error\":\"ficheiro já existe\"}';\r\n }\r\n\r\n\r\n\r\n $path=_IMAGEPATH.$name;\r\n \r\n $up_file=move_uploaded_file($image,$path);\r\n \r\n if(!$up_file){\r\n \r\n return '{\"error\":\"erro de gravação\"}';\r\n \r\n }\r\n\r\n if($photo['size']>10 ){\r\n \r\n $main_pic = $name;\r\n $mini_pic = $this->redimensdiona($path,\"mini_\".$name,100,100);\r\n }\r\n \r\n \r\n if(logex::$tcnx->query(\"INSERT INTO foto_galeria (nome,pasta,mini) VALUES ('$main_pic','$folder','$mini_pic')\")){\r\n\r\n return $this->image_list();\r\n }\r\n else{\r\n \r\n return '{\"error\":\"erro de gravação\"}';\r\n }\r\n\r\n}", "public function saveAction() {\r\n $succFullImageUrl = \"\";\r\n $name = strip_tags(trim(Utils_Global::$params['Caption']));\r\n $source = strip_tags(Utils_Global::$params['Source']);\r\n \r\n $auth = Zend_Auth::getInstance();\r\n if($auth->hasIdentity()) {\r\n $identity = $auth->getIdentity();\r\n }\r\n if(!$identity || !$identity->username) {\r\n $this->_redirect('/admin');\r\n }\r\n $userName = $identity->username;\r\n if(!$name) {\r\n Utils_Global::$params['errMessage'] = 'Vui lòng nhập tên hợp lệ!';\r\n \t$this->_forward('upload', 'file-upload', 'admin');\r\n return;\r\n }\r\n \r\n if($this->_request->isPost()) {\r\n $data = array();\r\n $result = $this->uploadFile('documentary');\r\n if(is_array($result) && $result) {//Luu thong tin upload\r\n $modelFileUpload = Admin_Model_FileUpload::factory();\r\n\t $uploadInfo = array('username' => $userName,\r\n\t 'name' => $name,\r\n\t 'file_name' => $result['file_name'],\r\n\t 'file_type' => $result['file_type'],\r\n\t 'file_size' => $result['file_size'],\r\n\t 'hash_folder' => $result['hash_folder'],\r\n\t 'dateline' => time(),\r\n\t );\r\n\t $result = $modelFileUpload->insertNewUpload($uploadInfo);\r\n } else {//Loi xay ra\r\n if($result == -1) {//Dinh dang file ko hop le\r\n $errMessage = $this->_config->upload->msgInvalidType;\r\n } else if($result == -2) {//Size vượt quá\r\n $errMessage = $this->_config->upload->msgInvalidSize;\r\n } else if($result == -3) {//File qua nho\r\n $errMessage = $this->_config->upload->msgInvalidDemension;\r\n } else if($result == -4) {\r\n \t $errMessage = $this->_config->upload->msgFileNotFound;\r\n \t}\r\n }\r\n }\r\n \r\n if($result > 0) {\r\n $params = array('errMessage' => $errMessage, 'name' => $name, 'succMessage' => 'Uploaded!');\r\n $this->_helper->redirector('upload', 'file-upload', 'admin', $params);\r\n } else {\r\n $params = array('errMessage' => $errMessage, 'name' => $name);\r\n $this->_helper->redirector('upload', 'file-upload', 'admin', $params);\r\n }\r\n }", "function uploadFileMultiples($fk_id,$is_edit=NULL)\r\n{\r\n //echo 'file';\r\n\t\t$user_ip = $this->getIP();\r\n\t\t//echo 'file_type2='.$user_ip;exit;\r\n\t\t//$user_name = $_SESSION['username'];\r\n\t\t//$full_name = $_SESSION['full_name'];\r\n\r\n\t\t//define a maxim size for the uploaded images in Kb\r\n \t\tdefine (\"MAX_SIZE\",\"8000\"); \r\n\t\t$i=0;\r\n\t\tforeach ($_FILES['uploaded_file']['name'] as $f)\r\n\t\t\t {\r\n\t\t\t\t \r\n\t\t######### Binary checks for file type ###############\r\n\t\t\t$file_type = $this->getImgType($_FILES['uploaded_file']['tmp_name'][$i]);\r\n\t\t\t //echo 'file_type2='.$file_type;exit;\r\n\t\t\tif($file_type == 'other')\r\n\t\t\t {\r\n\t\t\t \t\r\n\t\t\t\techo '<div align=\"center\" style=\"color:#FF0000\">Can not upload this type of file!</div>';\r\n\t\t\t\t\r\n\t\t\t\t //$referer = parse_url($_SERVER['HTTP_REFERER']);\r\n \t\t\t\t //header('location:'. $referer);\r\n\t\t\t\texit;\r\n\t\t\t }\r\n\t\t######################################################\r\n\t\t\r\n\t\t################# Other type check #################\r\n\t\t//get the original name of the file from the clients machine\r\n \t\t$filename = stripslashes($_FILES['uploaded_file']['name'][$i]);\r\n \t//get the extension of the file in a lower case format\r\n \t\t$extension = $this->getExtension($filename);\r\n \t $extension = strtolower($extension);\r\n \r\n\t\t$allowedExts = array(\"gif\", \"jpeg\", \"jpg\", \"png\", \"pdf\");\r\n\t\t$temp = explode(\".\", $_FILES[\"uploaded_file\"][\"name\"][$i]);\r\n\t\t$extensions = strtolower(end($temp));\r\n\r\n\t\t######################################################\r\n\t\t if (( ($_FILES[\"uploaded_file\"][\"type\"][$i] == \"image/gif\")\r\n || ($_FILES[\"uploaded_file\"][\"type\"][$i] == \"image/jpeg\")\r\n || ($_FILES[\"uploaded_file\"][\"type\"][$i] == \"image/jpg\")\r\n || ($_FILES[\"uploaded_file\"][\"type\"][$i] == \"image/pjpeg\")\r\n || ($_FILES[\"uploaded_file\"][\"type\"][$i] == \"image/x-png\")\r\n || ($_FILES[\"uploaded_file\"][\"type\"][$i] == \"image/png\")\r\n || ($_FILES[\"uploaded_file\"][\"type\"][$i] == \"application/pdf\"))\r\n && in_array($extensions, $allowedExts))\r\n {\r\n\t\t\t\t \r\n\t\t\t\t \r\n\t\t\t\t ################ size check ###################\r\n\t\t\t\t $size=filesize($_FILES['uploaded_file']['tmp_name'][$i]);\r\n\t\t\t\t\techo 'size='.$size;\r\n\t\t\t\t\techo '<br> size allowed = '.MAX_SIZE*1024;\r\n\t\t\t\t\tif ($size > MAX_SIZE*10245)\r\n {\r\n echo '<div align=\"center\" style=\"color:red\">You have exceeded the size limit!</div>';\r\n $errors=1;\r\n\t\t\t\t\t\t\t\texit;\r\n }\r\n\t\t\t\t ###################################################\r\n //upload file\r\n\r\n\r\n########################### Image Resizing ##########################\r\n// Create an Image from it so we can do the resize\r\n$flag_img=0;\r\n if($_FILES[\"uploaded_file\"][\"type\"][$i] == \"image/png\")\r\n\t\t\t\t { \r\n \t$src1 = imagecreatefrompng($_FILES['uploaded_file']['tmp_name'][$i]);\r\n \t\t$flag_img=1;\r\n }\r\n else if (($_FILES[\"uploaded_file\"][\"type\"][$i] == \"image/jpg\")||($_FILES[\"uploaded_file\"][\"type\"][$i] == \"image/jpeg\"))\r\n {\r\n \t$src1 = imagecreatefromjpeg($_FILES['uploaded_file']['tmp_name'][$i]);\r\n \t$flag_img=1;\r\n }\r\n else if ($_FILES[\"uploaded_file\"][\"type\"][$i] == \"image/gif\")\r\n {\r\n \t$src1 = imagecreatefromgif($_FILES['uploaded_file']['tmp_name'][$i]);\r\n \t$flag_img=1;\r\n }\r\n\r\nif($flag_img==1)\r\n{\t\t\t\t \r\n\t\t // Capture the original size of the uploaded image\r\n\t\tlist($width1,$height1)=getimagesize($_FILES['uploaded_file']['tmp_name'][$i]);\r\n\t\tif(($width1 > 700)||($width1 >= '1000')||($width1 >= 1000))\r\n\t\t{\r\n\t\t\t\t$newwidth=700;\r\n\t\t\t\t$newheight=($height1/$width1)*$newwidth;\r\n\t\t\t\t$tmp=imagecreatetruecolor($newwidth,$newheight);\r\n\t\t\t\timagecopyresampled($tmp,$src1,0,0,0,0,$newwidth,$newheight,$width1,$height1);\r\n\t\t\t\timagejpeg($tmp,$_FILES['uploaded_file']['tmp_name'],100);\r\n\t\t\t\timagedestroy($tmp); // NOTE: PHP will clean up the temp file it created when the request\r\n\t\t}\r\n}\r\n#######################################################################\r\n// Gather all required data\r\n \r\n $mime = mysql_real_escape_string($_FILES['uploaded_file']['type'][$i]);\r\n\t\t$content = mysql_real_escape_string(file_get_contents($_FILES['uploaded_file']['tmp_name'][$i]));\r\n //$content = mysql_real_escape_string(file_get_contents($_FILES['uploaded_file']['tmp_name'])); \r\n $newname=time().'-'.$filename;\r\n\t\t\t\t\r\n\t//primary id of main table record\r\n\t$p_id =$fk_id;\r\n\r\n\tif($is_edit == 1) //edit document so delete previous document\r\n\t{\r\n\t\t$query_upd=\"UPDATE tbl_upl SET is_del='1',date_updated=NOW() WHERE fk_id = '$p_id'\";\r\n\t\tmysql_query($query_upd) or die (mysql_query());\r\n\t}\r\n\t\t\t\t\t\t $insert_archive_query=\"INSERT INTO tbl_upl SET name='$newname',type='$mime',size='$size',content = '$content', fk_id='$p_id', date_created=NOW(),user_ip='$user_ip'\";\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t mysql_query('SET GLOBAL max_allowed_packet = ' . 500 * 1024 * 1024);\r\n\t\t\t\t\t\t\tmysql_query($insert_archive_query) or die (mysql_query());\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\techo '<div align=\"center\" style=\"color:green\">Uploaded Successfully!</div>';\r\n\t\t\t\t\t\t\t//exit;\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\r\n\r\n\t}\r\n\telse\r\n\t {\r\n\t\t echo '<div align=\"center\" style=\"color:red\">Invalid file</div>';\r\n\t\t $errors=1;\r\n\t\t //exit;\r\n\t }\r\n\t\t\r\n\t\t/////////////////////////////////////////////\r\n\t\t\r\n\t\t$i++;\r\n\t} // end foreach\r\n}", "function getEditForm( $id = -1 )\n\t{\t\n\t\t$id = intVal($id);\n\t\t$db = new DB();\n\t\t\n\t\t//giving blank form\n\t\tif( $id == -1 || !is_int($id) )\n\t\t{\n\t\t\t$id = -1;\n\t\t\t$isSale = false;\n\t\t\t$name = '';\n\t\t\t$desc = '';\n\t\t\t$salePr = 0;\n\t\t\t$price = 0;\n\t\t\t$quantity = 0;\n\t\t\t$imgName = \"<span>Image Name:</span><input name='imgName' />\";\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$item = $db -> getItem( $id );\n\t\t\t\n\t\t\t//bad id\n\t\t\tif( empty($item) )\n\t\t\t{\n\t\t\t\t//<input name='imgName' type='file' />\n\n\t\t\t\t$id = -1;\n\t\t\t\t$isSale = false;\n\t\t\t\t$name = '';\n\t\t\t\t$desc = '';\n\t\t\t\t$salePr = 0;\n\t\t\t\t$price = 0;\n\t\t\t\t$quantity = 0;\n\t\t\t\t$imgName = \"<span>Image Name:</span><input name='imgName' />\";\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t/*$imgName = \"<label for='imgName'>Choose a file to upload:</label>\n\t\t\t\t\t<div>{$data['imgName']} <a href='js: selectImg()'>Upload New</a></div>\n\t\t\t\t\t<input name='imgName' value='{$data['imgName']}' style='display: none;'/>\";\n\t\t\t\t*/\n\t\t\t\t$data = $item[0];\n\t\t\t\t\n\t\t\t\t$name = $data -> name();\n\t\t\t\t$desc = $data -> descr();\n\t\t\t\t$salePr = $data -> salePrice();\n\t\t\t\t$price = $data -> price();\n\t\t\t\t$quantity = $data -> quant();\n\t\t\t\t$imgName = \"<span>Image Name:</span><input name='imgName' value='{$data -> imgName()}'/>\";\n\t\t\t\t$isSale = $data -> salePrice() != 0;\n\t\t\t}\n\t\t}\n\t\t$checked = ($isSale ? \"checked\" : \"\");\n\t\t$saleInput = (!$isSale ? \"style='display: none'\" : \"\");\n\t\t$title = ($name == '' ? \"Add Item\" : \"Edit $name\");\n\t\t\n\t\t$str = \"<h3>$title</h3>\\n\n\t\t<form action='edit.php' method='POST' id='edit'>\n\t\t\t<input style='display: none' name='id' value='$id'/>\\n\n\t\t\t<div><span>Name: </span><input name='name' value='$name'/></div>\\n\n\t\t\t<div><span>Description: </span><textarea name='description'>$desc</textarea></div>\\n\n\t\t\t<div><span>Quantity: </span><input name='quant' value='$quantity'/></div>\\n\n\t\t\t<div><span>Price: </span><input name='price' value='$price'/></div>\\n\n\t\t\t<div>\n\t\t\t\t<label for='isSale'>On Sale: </label><input type='checkbox' id='isSale' onchange='showSale()' name='isSale' $checked/>\n\t\t\t</div>\\n\n\t\t\t<div id='salePriceDiv' $saleInput>\n\t\t\t\t<span>Sale Price: </span><input type='text' name='salePrice' value='$salePr'/>\n\t\t\t</div>\\n\n\t\t\t<div>$imgName</div>\\n\n\t\t\t<input type='submit' value='Save' />\\n\n\t\t\t<input type='button' onclick='window.location=\\\"admin.php\\\"' value='Cancel'/>\\n\n\t\t</form>\";\n\t\t\n\t\treturn $str;\n\t}", "function uploadFileSingle($fk_id,$is_edit=NULL)\r\n{\r\n //echo 'file55';exit;\r\n\t\t$user_ip = $this->getIP();\r\n\t\t\r\n\t\t//$user_name = $_SESSION['username'];\r\n\t\t//$full_name = $_SESSION['full_name'];\r\n\r\n\t\t//define a maxim size for the uploaded images in Kb\r\n \t\tdefine (\"MAX_SIZE\",\"8000\"); \r\n\t\t######### Binary checks for file type ###############\r\n\t\t\t$file_type = $this->getImgType($_FILES['uploaded_file']['tmp_name']);\r\n\t\t\t\r\n\t\t\tif($file_type == 'other')\r\n\t\t\t {\r\n\t\t\t \t\r\n\t\t\t\techo '<div align=\"center\" style=\"color:#FF0000\">Can not upload this type of file!</div>';\r\n\t\t\t\t\r\n\t\t\t\t //$referer = parse_url($_SERVER['HTTP_REFERER']);\r\n \t\t\t\t //header('location:'. $referer);\r\n\t\t\t\texit;\r\n\t\t\t }\r\n\t\t######################################################\r\n\t\t\r\n\t\t################# Other type check #################\r\n\t\t//get the original name of the file from the clients machine\r\n \t\t$filename = stripslashes($_FILES['uploaded_file']['name']);\r\n \t//get the extension of the file in a lower case format\r\n \t\t$extension = $this->getExtension($filename);\r\n \t $extension = strtolower($extension);\r\n \r\n\t\t$allowedExts = array(\"gif\", \"jpeg\", \"jpg\", \"png\", \"pdf\");\r\n\t\t$temp = explode(\".\", $_FILES[\"uploaded_file\"][\"name\"]);\r\n\t\t$extensions = strtolower(end($temp));\r\n\r\n\t\t######################################################\r\n\t\t if (( ($_FILES[\"uploaded_file\"][\"type\"] == \"image/gif\")\r\n || ($_FILES[\"uploaded_file\"][\"type\"] == \"image/jpeg\")\r\n || ($_FILES[\"uploaded_file\"][\"type\"] == \"image/jpg\")\r\n || ($_FILES[\"uploaded_file\"][\"type\"] == \"image/pjpeg\")\r\n || ($_FILES[\"uploaded_file\"][\"type\"] == \"image/x-png\")\r\n || ($_FILES[\"uploaded_file\"][\"type\"] == \"image/png\")\r\n || ($_FILES[\"uploaded_file\"][\"type\"] == \"application/pdf\"))\r\n && in_array($extensions, $allowedExts))\r\n {\r\n\t\t\t\t \r\n\t\t\t\t \r\n\t\t\t\t ################ size check ###################\r\n\t\t\t\t $size=filesize($_FILES['uploaded_file']['tmp_name']);\r\n\t\t\t\t\techo 'size='.$size;\r\n\t\t\t\t\techo '<br> size allowed = '.MAX_SIZE*1024;\r\n\t\t\t\t\tif ($size > MAX_SIZE*10245)\r\n {\r\n echo '<div align=\"center\" style=\"color:red\">You have exceeded the size limit!</div>';\r\n $errors=1;\r\n\t\t\t\t\t\t\t\texit;\r\n }\r\n\t\t\t\t ###################################################\r\n //upload file\r\n\r\n\r\n########################### Image Resizing ##########################\r\n// Create an Image from it so we can do the resize\r\n$flag_img=0;\r\n if($_FILES[\"uploaded_file\"][\"type\"] == \"image/png\")\r\n\t\t\t\t { \r\n \t$src1 = imagecreatefrompng($_FILES['uploaded_file']['tmp_name']);\r\n \t\t$flag_img=1;\r\n }\r\n else if (($_FILES[\"uploaded_file\"][\"type\"] == \"image/jpg\")||($_FILES[\"uploaded_file\"][\"type\"] == \"image/jpeg\"))\r\n {\r\n \t$src1 = imagecreatefromjpeg($_FILES['uploaded_file']['tmp_name']);\r\n \t$flag_img=1;\r\n }\r\n else if ($_FILES[\"uploaded_file\"][\"type\"] == \"image/gif\")\r\n {\r\n \t$src1 = imagecreatefromgif($_FILES['uploaded_file']['tmp_name']);\r\n \t$flag_img=1;\r\n }\r\n\r\nif($flag_img==1)\r\n{\t\t\t\t \r\n\t\t // Capture the original size of the uploaded image\r\n\t\tlist($width1,$height1)=getimagesize($_FILES['uploaded_file']['tmp_name']);\r\n\t\tif(($width1 > 700)||($width1 >= '1000')||($width1 >= 1000))\r\n\t\t{\r\n\t\t\t\t$newwidth=700;\r\n\t\t\t\t$newheight=($height1/$width1)*$newwidth;\r\n\t\t\t\t$tmp=imagecreatetruecolor($newwidth,$newheight);\r\n\t\t\t\timagecopyresampled($tmp,$src1,0,0,0,0,$newwidth,$newheight,$width1,$height1);\r\n\t\t\t\timagejpeg($tmp,$_FILES['uploaded_file']['tmp_name'],100);\r\n\t\t\t\timagedestroy($tmp); // NOTE: PHP will clean up the temp file it created when the request\r\n\t\t}\r\n}\r\n#######################################################################\r\n// Gather all required data\r\n \r\n $mime = mysqli_real_escape_string($_FILES['uploaded_file']['type']);\r\n\t\t$content = mysqli_real_escape_string(file_get_contents($_FILES['uploaded_file']['tmp_name']));\r\n //$content = mysql_real_escape_string(file_get_contents($_FILES['uploaded_file']['tmp_name'])); \r\n $newname=time().'-'.$filename;\r\n\t\t\t\t\r\n\t//primary id of main table record\r\n\t$p_id =$fk_id;\r\n\r\n\tif($is_edit == 1) //edit document so delete previous document\r\n\t{\r\n\t\t$query_upd=\"UPDATE tbl_upl SET is_del='1',date_updated=NOW() WHERE fk_id = '$p_id'\";\r\n\t\tmysqli_query($query_upd) or die (mysql_query());\r\n\t}\r\n\t\t\t\t\t\t $insert_archive_query=\"INSERT INTO tbl_upl SET name='$newname',type='$mime',size='$size',content = '$content', fk_id='$p_id', date_created=NOW(),user_ip='$user_ip'\";\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t mysqli_query('SET GLOBAL max_allowed_packet = ' . 500 * 1024 * 1024);\r\n\t\t\t\t\t\t\tmysqli_query($insert_archive_query) or die (mysql_query());\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\techo '<div align=\"center\" style=\"color:green\">Uploaded Successfully!</div>';\t\t\r\n\r\n\t}\r\n\telse\r\n\t {\r\n\t\t echo '<div align=\"center\" style=\"color:red\">Invalid file</div>';\r\n\t\t $errors=1;\r\n\t\t //exit;\r\n\t }\r\n\t\t\r\n\t\t/////////////////////////////////////////////\r\n\r\n}", "function upload() {\r\n if ($_FILES['icone']['error'] > 0){ $erreur = \"Erreur lors du transfert\"; print $erreur; exit(0);}\r\n \r\n //test de l'extension du fichier\r\n $extensions_valides = array( 'jpg' , 'jpeg' , 'gif' , 'png' );\r\n $extension_upload = strtolower( substr( strrchr($_FILES['icone']['name'], '.') ,1) );\r\n if ( in_array($extension_upload,$extensions_valides) ) echo \"Extension valide\";\r\n else { $erreur = \"Erreur lors du transfert\"; print $erreur; exit(0); }\r\n \r\n //upload\r\n $nom = \"model/IMG/jons/external/{$_FILES['icone']['name']}.jpg\";\r\n $resultat = move_uploaded_file($_FILES['icone']['tmp_name'],$nom);\r\n \r\n //insert in BD\r\n $this->downloadDAO->insert($_FILES['icone']['name'],$_POST['categorie']);\r\n $this->goToHome();\r\n }", "function saveformrow($table,$id) {\r\n global $db_link, $uploads_path;\r\n \r\n $desc=qdescribe($table);\r\n $key=qkey($table);\r\n\r\n $c = ($id==0) ? 0 : qcount(\"$table WHERE $key='$id' LIMIT 1\");\r\n if($c==0) {\r\n // new entry\r\n $start=\"INSERT INTO $table SET \";\r\n $end=\"\";\r\n $action='added';\r\n } else {\r\n $start=\"UPDATE $table SET \";\r\n $end=\" WHERE $key='$id' LIMIT 1\";\r\n $action='updated';\r\n }\r\n\r\n // update post info\r\n $middle='';\r\n $sep='';\r\n foreach($desc as $k=>$v) {\r\n if(isset($_REQUEST[$k])) {\r\n $middle.=$sep.\"$k='\".CleanInput($_REQUEST[$k]).\"'\";\r\n $sep=', ';\r\n }\r\n }\r\n\r\n // upload files\r\n foreach($desc as $k=>$v) {\r\n if(isset($_FILES[$k])) {\r\n $f=$_FILES[$k];\r\n if($f['size']>0 && $f['error']==0) {\r\n $new_name=$f['name'];\r\n if(file_exists($uploads_path.\"/\".$new_name)) {\r\n $middle.=$sep.\"$k='$new_name'\";\r\n $sep=', ';\r\n echo \"<p class='alert alert-warning'>File <strong>$new_name</strong> already exists.</p>\";\r\n } else {\r\n if(move_uploaded_file($f['tmp_name'], $uploads_path.\"/\".$new_name)) {\r\n $middle.=$sep.\"$k='$new_name'\";\r\n $sep=', ';\r\n echo \"<p class='alert alert-notice'>File <strong>$new_name</strong> uploaded.</p>\";\r\n } else {\r\n echo \"<p class='alert alert-error'>File <strong>$new_name</strong> upload error.</p>\";\r\n }\r\n }\r\n }\r\n }\r\n }\r\n\r\n $ret=false;\r\n if(strlen($middle)) {\r\n q($start.$middle.$end);\r\n $ret = ($c==0) ? mysqli_insert_id($db_link) : $id;\r\n echo \"<p class='alert alert-success'>Entry $ret $action @ \".date(\"Y-m-d h:i:s\").\"</p>\";\r\n }\r\n \r\n return $ret;\r\n}", "function addUpload()\r\n{\r\n\t$msg = '';\r\n\t\r\n\t$id \t = $_POST['secid'];\r\n\t//$imageId \t = $_POST['image'];\r\n\t$image = $_FILES['fileselect'];\r\n\t\r\n\t_deleteImage($id);\r\n\t//$img = ImageName($imageId);\r\n\r\n\t$catImage \t = uploadImage('fileselect', SRV_ROOT . 'upload/');\r\n\t\r\n\t\t\t$sql = \"UPDATE security_users set photo_name = '$catImage', modified_on = now() WHERE pl_no = '$id'\";\r\n\t\t\t$result = dbQuery($sql);\t\r\n\t\t\r\n\t\t\t$msg = 'Passport was successfully uploaded';\r\n\t\t\r\n\t\r\n\treturn $msg;\r\n}", "function uploadImage($id) {\n }", "function model_upload($id)\n{\n\tglobal $_FILES;\n\tglobal $_SERVER;\n\tglobal $site_thumb_width;\n\tglobal $db;\n\t\n\t$swait=false;\n\t\n\t//upload photo\n\t$_FILES[\"modelphoto\"]['name']=result_file($_FILES[\"modelphoto\"]['name']);\n\t$nf=explode(\".\",$_FILES[\"modelphoto\"]['name']);\n\tif($_FILES[\"modelphoto\"]['size']>0 and $_FILES[\"modelphoto\"]['size']<1024*1024*1 and !preg_match(\"/text/i\",$_FILES[\"modelphoto\"]['type']) and preg_match(\"/.jpg$|.jpeg$/i\",$_FILES[\"modelphoto\"]['name']))\n\t{\n\t\t$swait=true;\n\t\t$photo=site_root.\"/content/models/modelphoto\".$id.\".\".$nf[count($nf)-1];\n\t\tmove_uploaded_file($_FILES[\"modelphoto\"]['tmp_name'],$_SERVER[\"DOCUMENT_ROOT\"].$photo);\n\n\t\t$size = getimagesize ($_SERVER[\"DOCUMENT_ROOT\"].$photo);\n\n\t\t$wd1=$site_thumb_width;\n\t\tif(isset($size[1]))\n\t\t{\n\t\t\tif($size[0]<$size[1]){$wd1=$size[0]*$site_thumb_height/$size[1];}\n\t\t}\n\t\n\t\teasyResize($_SERVER[\"DOCUMENT_ROOT\"].$photo,$_SERVER[\"DOCUMENT_ROOT\"].$photo,100,$wd1);\n\n\t\t$sql=\"update models set modelphoto='\".$photo.\"' where id_parent=\".$id;\n\t\t$db->execute($sql);\n\t}\n\n\t//upload release\n\t$_FILES[\"model\"]['name']=result_file($_FILES[\"model\"]['name']);\n\t$nf=explode(\".\",$_FILES[\"model\"]['name']);\n\tif($_FILES[\"model\"]['size']>0 and $_FILES[\"model\"]['size']<1024*1024*5 and !preg_match(\"/text/i\",$_FILES[\"model\"]['type']) and preg_match(\"/.pdf$|.zip$|.jpg$|.jpeg$/i\",$_FILES[\"model\"]['name']))\n\t{\n\t\t$swait=true;\n\t\t$photo=site_root.\"/content/models/model\".$id.\".\".$nf[count($nf)-1];\n\t\tmove_uploaded_file($_FILES[\"model\"]['tmp_name'],$_SERVER[\"DOCUMENT_ROOT\"].$photo);\n\n\t\t$sql=\"update models set model='\".$photo.\"' where id_parent=\".$id;\n\t\t$db->execute($sql);\n\t}\n\t\n\treturn $swait;\n}", "function user_image_upload($user_id , $db_connexion){\r\n\r\n}", "function vector_upload_form($lvector)\n{\nglobal $ds;\nglobal $dr;\nglobal $site_flash;\nglobal $_SESSION;\nglobal $global_settings;\n\n\n$res=\"\";\n\n$res.=\"<table border='0' cellpadding='5' cellspacing='1' class='profile_table' style='width:700px'>\n<tr>\n<th></th>\n<th><b>\".word_lang(\"title\").\":</b></th>\n<th><b>\".word_lang(\"price\").\":</b></th>\n<th><b>\".word_lang(\"file\").\":</b></th>\n</tr>\";\n\n\n$sql=\"select id_parent,name from licenses order by priority\";\n$dr->open($sql);\nwhile(!$dr->eof)\n{\n\n$res.=\"<tr class='snd'><td colspan='4'><b>\".word_lang(\"license\").\": </b>\".$dr->row[\"name\"].\"</td></tr>\";\n\n$sql=\"select * from vector_types where license=\".$dr->row[\"id_parent\"].\" order by priority\";\n$ds->open($sql);\nwhile(!$ds->eof)\n{\n\n$res.=\"<tr>\n<td><input name='vector_chk\".$ds->row[\"id_parent\"].\"' type='checkbox' checked></td>\n<td nowrap>\".$ds->row[\"title\"];\n\n\n\nif($ds->row[\"shipped\"]!=1)\n{\n\n$res.=\"(\";\n\n\n$uphoto=explode(\",\",str_replace(\" \",\"\",$ds->row[\"types\"]));\nfor($i=0;$i<count($uphoto);$i++)\n{\nif($i!=0){$res.=\",\";}\n$res.=\"*.\".$uphoto[$i];\n}\n\n$res.=\")\";\n}\n\n\t\t$readonly=\"readonly\";\n\t\tif(isset($_SESSION[\"entry_admin\"]) or $global_settings[\"seller_prices\"])\n\t\t{\n\t\t\t$readonly=\"\";\n\t\t}\n\n$res.=\"</td>\n<td><input name='vector_price\".$ds->row[\"id_parent\"].\"' value='\".float_opt($ds->row[\"price\"],2).\"' type='text' \".$readonly.\" style='width:70px' class='ibox'></td>\n<td>\";\n\n\nif($ds->row[\"shipped\"]!=1)\n{\n$res.=\"<input name='vector_sale\".$ds->row[\"id_parent\"].\"' type='file' style='width:200px' class='ibox'>\";\n}\nelse\n{\n$res.=word_lang(\"shipped\");\n}\n\n$res.=\"</td>\n</tr>\";\n\n$ds->movenext();\n}\n$dr->movenext();\n}\n\n\n\n\n\n\n$res.=\"<tr><td colspan='4'><span class='smalltext'>(\".word_lang(\"size\").\" < \".$lvector.\"Mb.)</span></td></tr>\";\n\n\n$res.=\"<tr><th colspan='4'><b>\".word_lang(\"preview\").\" \".word_lang(\"photo\").\":</b></th></tr><tr><td colspan=4><input name='preview2' type='file' style='width:400px' class='ibox'><br><span class='smalltext'>(*.jpg or *.zip file of jpg photos)</span></td></tr>\";\n\nif($site_flash)\n{\n$res.=\"<tr><th colspan='4'><b>\".word_lang(\"preview\").\" Flash:</b></th></tr><tr><td colspan=4><input name='preview3' type='file' style='width:400px' class='ibox'><br><span class='smalltext'>(*.swf)</span></td></tr>\";\n}\n\n$res.=\"</table>\";\n\nreturn $res;\n}", "function picEdit()\n{\n\tglobal $CONF_BASE;\n\tob_start();\n?>\n<div id=\"tip_before\">\n\t<?=txt(\"picedit-tiptext_before\")?>\n</div>\n<div id=\"tip_after\">\n\t<?=txt(\"picedit-tiptext_after\")?>\n</div>\n<div class=\"close\" title=\"<?=txt(\"seting-close_pop_win\")?>\"></div>\n\n<form action=\"<?=$CONF_BASE?>picEdit-master/dist/upload.php\" method=\"post\" enctype=\"multipart/form-data\" id=\"xid\">\n\n\t<input type=\"file\" name=\"own_image\" id=\"thebox\">\n\n\t<div id=\"picedit_btn\">\n\t\t<button type=\"submit\"><?=txt(\"setting-nahrajte_si_vlastni_obrazky-picedit_submit\")?></button>\n </div>\n\n</form>\n<?\n\treturn array(\"html\" => ob_get_clean());\n}", "function file_upload($nombre, $titulo='', $estilo='', $clase='', $aceptar='', $valid_fn='', $onkey_fn='')\n\t{\n\t\t$futmp = new lt_file_upload();\n\t\t$futmp->n = $nombre;\n\t\t$futmp->title = $titulo;\n\t\t$futmp->style = $estilo;\n\t\t$futmp->css_class = $clase;\n\t\t$futmp->accept = $aceptar;\n\t\t$futmp->valid_fn = $valid_fn;\n\t\t$futmp->onkey_fn = $onkey_fn;\n\t\t$futmp->render($this);\n\t}", "function do_Edit ($lang)\n {\n global $vnT, $func, $DB, $conf;\n //load Format\n $func->include_libraries('vntrust.html.format');\n $vnT->format = new vnT_Format();\n $id = (int) $vnT->input['id'];\n if ($vnT->input['do_submit']) {\n $data = $_POST;\n $num = $vnT->input['num'];\n $pollerTitle = $vnT->input['pollerTitle'];\n //upload\n if ($vnT->input['chk_upload'] && ! empty($_FILES['image']) && $_FILES['image']['name'] != \"\") {\n $up['path'] = MOD_DIR_UPLOAD;\n $up['dir'] = \"\";\n $up['file'] = $_FILES['image'];\n $up['type'] = \"hinh\";\n $up['w'] = 500;\n $result = $vnT->File->Upload($up);\n if (empty($result['err'])) {\n $picture = $result['link'];\n $file_type = $result['type'];\n } else {\n $err = $func->html_err($result['err']);\n }\n } else {\n if ($vnT->input['picture']) {\n $up['path'] = MOD_DIR_UPLOAD;\n $up['dir'] = \"\";\n $up['url'] = $vnT->input['picture'];\n $up['type'] = \"hinh\";\n $up['w'] = 500;\n $result = $vnT->File->UploadURL($up);\n if (empty($result['err'])) {\n $picture = $result['link'];\n $file_type = $result['type'];\n } else {\n $err = $func->html_err($result['err']);\n }\n }\n } //end upload\n if (empty($err)) {\n $res = $DB->query(\"select name from language \");\n while ($r = $DB->fetch_row($res)) {\n $arr_title[$r['name']] = $pollerTitle;\n }\n $cot['pollerTitle'] = $func->update_content(\"poller\", \"pollerTitle\", \"id=$id \", $lang, $pollerTitle);\n $cot['multiple'] = $vnT->input[\"multiple\"];\n if ($vnT->input['chk_upload'] == 1 || ! empty($picture)) {\n $img_q = $DB->query(\"SELECT picture FROM poller WHERE id=$id \");\n if ($img = $DB->fetch_row($img_q)) {\n $file_pic = MOD_DIR_UPLOAD . $img['picture'];\n if ((file_exists($file_pic)) && (! empty($img['picture'])))\n unlink($file_pic);\n }\n $cot['picture'] = $picture;\n }\n $ok = $DB->do_update(\"poller\", $cot, \"id=$id\");\n if ($ok) {\n $num_od = (int) $vnT->input['num_old'];\n $optionTexts = $vnT->input['optionText'];\n $arr_answers = $vnT->input['answers'];\n $arr_votes = $vnT->input['votes'];\n //update option\n if (is_array($arr_answers)) {\n foreach ($arr_answers as $key => $value) {\n $dup['optionText'] = $func->update_content(\"poller_option\", \"optionText\", \"id=$key \", $lang, $value);\n $dup['vote'] = $arr_votes[$key];\n $DB->do_update(\"poller_option\", $dup, \"id=$key\");\n }\n }\n // add option\n if (is_array($optionTexts)) {\n $i = 0;\n foreach ($optionTexts as $optionText) {\n $i ++;\n if ($optionText != \"\") {\n $cot_op['pollerID'] = $id;\n $cot_op['pollerOrder'] = ($num_od + $i);\n $res = $DB->query(\"select * from language \");\n while ($r = $DB->fetch_row($res)) {\n $tmp1[$r['name']] = $optionText;\n }\n $cot_op['optionText'] = serialize($tmp1);\n $DB->do_insert(\"poller_option\", $cot_op);\n }\n }\n }\n //xoa cache\n $func->clear_cache();\n //insert adminlog\n $func->insertlog(\"Edit\", $_GET['act'], $id);\n $err = $vnT->lang[\"edit_success\"];\n $url = $this->linkUrl . \"&sub=edit&id=$id\";\n $func->html_redirect($url, $err);\n } else\n $err = $func->html_err($vnT->lang[\"edit_failt\"] . $DB->debug());\n }\n }\n $query = $DB->query(\"SELECT * FROM poller WHERE id=\" . $id);\n if ($data = $DB->fetch_row($query)) {\n $data['pollerTitle'] = $func->fetch_content($data['pollerTitle'], $lang);\n if (! empty($data['picture'])) {\n $data['pic'] = \"<img src='\" . MOD_DIR_UPLOAD . $data['picture'] . \"' ><br>\";\n }\n $res_anwser = $DB->query(\"SELECT * FROM poller_option WHERE pollerID=\" . $id . \" order by pollerOrder ASC , id DESC \");\n $num = $DB->num_rows($res_anwser);\n $data['num_old'] = $num;\n $i = 0;\n while ($poll_answers = $DB->fetch_row($res_anwser)) {\n $i ++;\n $poll_answer[$i]['vote'] = $poll_answers['vote'];\n $poll_answer[$i]['op_id'] = $poll_answers['id'];\n $poll_answer[$i]['optionText'] = $func->fetch_content($poll_answers['optionText'], $lang);\n }\n } else {\n $mess = $vnT->lang['not_found'] . \" ID : \" . $id;\n $url = $this->linkUrl;\n $func->html_redirect($url, $mess);\n }\n for ($i = 1; $i <= $num; $i ++) {\n $row['stt'] = $i;\n $row['op_id'] = $poll_answer[$i]['op_id'];\n $row['vote'] = $poll_answer[$i]['vote'];\n $row['optionText'] = $poll_answer[$i]['optionText'];\n $row['btn_del'] = '<input type=\"button\" class=\"button\" onclick=\"delete_poll_ans(' . $id . ', ' . $poll_answer[$i]['op_id'] . ', ' . $i . ', \\'' . $vnT->format->js_escape($vnT->lang['are_you_sure_del']) . '\\');\" value=\"Delete\"/>';\n $this->skin->assign('row', $row);\n $this->skin->parse(\"edit.html_rowold\");\n }\n $data['num'] = $num;\n $data['poll_noquestion'] = $num;\n $data['list_multiple'] = vnT_HTML::list_yesno(\"multiple\", $vnT->input['multiple']);\n $data['err'] = $err;\n $data['link_action'] = $this->linkUrl . \"&sub=edit&id=$id\";\n /*assign the array to a template variable*/\n $this->skin->assign('data', $data);\n $this->skin->parse(\"edit\");\n return $this->skin->text(\"edit\");\n }", "function upload()\n {\n\t\t$args = new safe_args();\n\t\t$args->set('key',\t\t\tNOTSET,'any');\n\t\t$args->set('format_id', \tNOTSET,'any');\t\t\n\t\t$args->set('filename', \t\tNOTSET,'any');\t\t\n\t\t$args->set('userfile', \t\tNOTSET,'any');\t// must be the same declares in $_Files['userfile']\t\n\t\t$args->set('header', \t\t'N','any');\t\n\t\t$args->set('duplicate', \t'N','any');\n\t\t$args->set('related', \t\t'N','any');\t\t\t\t\t\t\t\n\t\t$args = $args->get(func_get_args());\n\n $GLOBALS['appshore']->add_xsl('lib.import');\n $GLOBALS['appshore']->add_xsl('lib.base'); \n \n // set up the different files format supported\n\t\t$fileFormat = array(\n\t array ( 'format_id' => ',', \t\t'format_name' => lang('Generic CSV file with comma delimiter')),\n\t array ( 'format_id' => ';', \t\t'format_name' => lang('Generic CSV file with semicolon delimiter')),\n\t array ( 'format_id' => ' ', \t\t'format_name' => lang('Generic CSV file with space delimiter')),\n\t array ( 'format_id' => chr(9), \t\t'format_name' => lang('Generic CSV file with tab delimiter'))\n\t ); \n\n#\t\t$duplicates = array(\n#\t array ( 'duplicate_id' => 'IG', \t\t'duplicate_name' => lang('Ignore new record')),\n#\t array ( 'duplicate_id' => 'MN', \t\t'duplicate_name' => lang('Merge records - new record prevails')),\n#\t array ( 'duplicate_id' => 'MO', \t\t'duplicate_name' => lang('Merge records - old record prevails')),\n#\t array ( 'duplicate_id' => 'RE', \t\t'duplicate_name' => lang('Replace old record'))\n#\t ); \n\n#\t\t$mapping = array(\n#\t array ( 'mapping_id' => 'I', \t\t'duplicate_name' => lang('Ignore')),\n#\t array ( 'duplicate_id' => 'M', \t\t'duplicate_name' => lang('Merge')),\n#\t array ( 'duplicate_id' => 'R', \t\t'duplicate_name' => lang('Replace'))\n#\t ); \n\t \n\t\t// test of RBAC level upon record owner, if no READ_WRITE then go to the View display\n\t\tif ( !$GLOBALS['appshore']->rbac->check( $this->appRole, RBAC_USER_WRITE ) || !$GLOBALS['appshore']->rbac->checkPermissionOnFeature($this->appRole, 'import'))\n {\n\t\t\tmessagebox( ERROR_PERMISSION_DENIED, ERROR);\n\t\t\treturn execMethod( $this->appName.'.base.start', null, true);\n }\n\n \t\tswitch($args['key'])\n\t\t{\n\t\t\tcase 'Next':\n\t\t\t\n\t\t\t\t// test if upload gone well\n\t\t\t\tif (is_uploaded_file( $_FILES['userfile']['tmp_name']))\n\t\t\t\t{ \n\t\t\t\t\tmove_uploaded_file( $_FILES['userfile']['tmp_name'], $_FILES['userfile']['tmp_name'].'.imp');\n\t\t\t\t\t$args['tmp_name'] = $_FILES['userfile']['tmp_name'].'.imp';\n\t\t\t\t\t$_SESSION['import']['format_id'] = $args['format_id'] ;\n\t\t\t\t\t$_SESSION['import']['filename'] = $args['filename'];\t\t\t\t\t\t\t\n\t\t\t\t\t$_SESSION['import']['userfile'] = $_FILES['userfile']['name'];\t\t\t\t\t\t\t\n\t\t\t\t\t$_SESSION['import']['tmp_name'] = $_FILES['userfile']['tmp_name'].'.imp';\t\t\t\t\t\t\n\t\t\t\t\t$_SESSION['import']['header'] = $args['header'];\n\n\t\t\t\t\tif( $this->isDuplicate )\t\t\n\t\t\t\t\t\t$_SESSION['import']['duplicate'] = $args['duplicate'];\t\n\t\t\t\t\telse\n\t\t\t\t\t\tunset($_SESSION['import']['duplicate']);\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\tif( $this->isRelated )\t\t\n\t\t\t\t\t\t$_SESSION['import']['related'] = $args['related'];\t\n\t\t\t\t\telse\n\t\t\t\t\t\tunset($_SESSION['import']['related']);\t\t\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\tunset( $args['key']);\t\t\t\t\t\t\n\t\t\t\t\t$result = $this->selectFields( $args);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t messagebox( ERROR_INVALID_DATA, ERROR);\t\n\t $result['error']['userfile'] = ERROR_MANDATORY_FIELD;\t\t\t\t\n\t\t\t\t\t$result['action']['import'] = 'upload';\n\t\t\t\t\t$result['format'] = $fileFormat;\t\n\t\t\t\t}\n\t\t\t\t$result['import'] = $_SESSION['import'];\t\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\tdefault:\n\t\t\t\t$result['action']['import'] = 'upload';\n\t\t\t\t$result['format'] = $fileFormat;\n\t\t\t\t$result['duplicates'] = $duplicates;\n\t\t\t\t$result['import'] = $_SESSION['import'];\t\n\t\t\t\t$result['import']['isDuplicate'] = $this->isDuplicate;\t\n\t\t\t\t$result['import']['isRelated'] = $this->isRelated;\t\t\t\t\t\t\n\t\t\t\tbreak;\n\t\t}\n\t\t\n\n return $result;\n }", "function sql_addphoto($sql,$data)\r\n\t{\r\n\t\tinclude_once $_SERVER['DOCUMENT_ROOT'].__CFG_document_place__.'/includes/log/logger.php';\r\n\t\tinclude $_SERVER['DOCUMENT_ROOT'].__CFG_document_place__.'/settings/files.php';\r\n\t\t$l=new logger($_SERVER['DOCUMENT_ROOT'].__CFG_document_place__.$cfg['file']['log']['serverlog']);\r\n\t\t\r\n\t\t$l->writelog('addphoto');\r\n\t\tinclude $_SERVER['DOCUMENT_ROOT'].__CFG_document_place__.'/includes/api/drives/piccuter.php';\r\n\t\tif (!(isset($_POST['title']))) $data['title']='UnName'; else $data['title']=$_POST['title'];\r\n\t\tif (!(isset($_POST['intro']))) $data['intro']=''; else $data['intro']=$_POST['intro'];\r\n\t\tif (!(isset($_POST['typeid']))) $data['typeid']='0';else $data['typeid']=$_POST['typeid'];\r\n\t\tif (!(isset($_POST['path']))) $data['path']=''; else $data['path']=$_POST['path'];\r\n\t\tif (!(isset($_POST['filename']))) $data['filename']=''; else $data['filename']=$_POST['filename'];\r\n\t\tif (!(isset($_POST['publish']))) $data['publish']=date('Y-m-d H:i:s'); else $data['publish']=$_POST['publish'];\r\n\t\t\r\n\t\tif ($_FILES['upload_pic']['error']==0)\r\n\t\t{\r\n\t\t\t//echo $_FILES['upload_pic']['tmp_name'].'<br>';\r\n\t\t\tinclude $_SERVER['DOCUMENT_ROOT'].__CFG_document_place__.'/settings/files.php';\r\n\t\t\tinclude $_SERVER['DOCUMENT_ROOT'].__CFG_document_place__.'/settings/drives_album.php';\t\t\r\n\t\t\t$extenstr=pathinfo($_FILES['upload_pic']['name']);\r\n\t\t\t$uploadfile=$cfg['file']['pic']['album_dir'].'.'.$extenstr['extension'];\r\n\t\t\t//echo \t$_SERVER['DOCUMENT_ROOT'].$cfg['file']['pic']['album_dir'].'.'.$extenstr['extension'];\r\n\t\t\tif (move_uploaded_file($_FILES['upload_pic']['tmp_name'], $_SERVER['DOCUMENT_ROOT'].$uploadfile)) \r\n\t\t\t{\r\n\t\t\t\tchmod($_SERVER['DOCUMENT_ROOT'].$uploadfile, 0664);\r\n\t\t\t\t$path=pathinfo($uploadfile);\r\n\t\t\t\t$data['path']=$path['dirname'];\r\n\t\t\t\t$data['filename']=$path['basename'];\r\n\t\t\t\t$dri=$cfg['drives'];\r\n\t\t\t\tforeach($dri as $drive=>$inf)\r\n\t\t\t\t{\t\r\n\t\t\t\t\t$res=piccuter($drive,$uploadfile,'album',stripos($drive,'big'));\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\t$out=\"'添加失败-文件上传出错'\";\r\n\t\t\t\techo \"\r\n\t\t\t\t<script>\r\n\t\t\t\t\talert($out);\r\n\t\t\t\t\tlocation.href='backstage/loader.php?f=showpic';\r\n\t\t\t\t</script>\";\r\n\t\t\t\treturn -1;\r\n\t\t\t}\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\t//echo $_FILES['upload_pic']['error'];\r\n\t\t\t$out=\"'添加失败-文件上传出错'\";\r\n\t\t\techo \"\r\n\t\t\t<script>\r\n\t\t\t\talert($out);\r\n\t\t\t\tlocation.href='backstage/loader.php?f=showpic';\r\n\t\t\t</script>\";\r\n\t\t\treturn -1;\r\n\t\t}\r\n\t\t$sql->table='moduletype';\r\n\t\t$sql->S_row=array('amount');\r\n\t\tarray_push($sql->S_where,array('id',$data['typeid']));\r\n\t\t$res=$sql->select();\r\n\t\tif ($result=$sql->fetch_assoc($res))\r\n\t\t{\t\r\n\t\t\t$sql->U_set['publish']=$data['publish'];\r\n\t\t\t$sql->U_set['amount']=$result['amount']+1;\r\n\t\t\tarray_push($sql->U_where,array('id',$data['typeid']));\r\n\t\t\t$res=$sql->update();\r\n\t\t\t$sql->table='album';\r\n\t\t\t$sql->I_data['title']=$data['title'];\r\n\t\t\t$sql->I_data['intro']=$data['intro'];\r\n\t\t\t$sql->I_data['typeid']=$data['typeid'];\r\n\t\t\t$sql->I_data['path']=$data['path'];\r\n\t\t\t$sql->I_data['filename']=$data['filename'];\t\t\r\n\t\t\t$sql->I_data['publish']=$data['publish'];\r\n\t\t\t$res=$sql->insert();\r\n\t\t\tif ($res<0) $out=\"'添加失败-无法添加图片信息'\";\r\n\t\t\telse $out=\"'添加成功'\";\r\n\t\t\techo \"\r\n\t\t\t<script>\r\n\t\t\t\talert($out);\r\n\t\t\t\tlocation.href='backstage/loader.php?f=showpic';\r\n\t\t\t</script>\r\n\t\t\t\";\r\n\t\t\treturn $res;\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\t$out=\"'添加失败-分类不存在'\";\r\n\t\t\techo \"\r\n\t\t\t<script>\r\n\t\t\t\talert($out);\r\n\t\t\t\tlocation.href='backstage/loader.php?f=showpic';\r\n\t\t\t</script>\";\r\n\t\t\treturn -1;\r\n\t\t}\r\n\t}", "public function createUploadForm() {\n \n global $REX, $I18N, $PERMALL;\n\n $rex_file_category = '';\n if(!$rex_file_category)\n {\n $rex_file_category = rex_session('media[rex_file_category]', 'int');\n }\n\n $output = '';\n $script_page_header = '';\n $uploadPath = \"index.php?page=\".$this->myself.\"&subpage=upload&upload_folder=\".$this->folder.\"&faceless=1\";\n \n if($this->sync_cat){\n // include cat sync select\n $cats_sel = new rex_select;\n $cats_sel->setStyle('class=\"inp100\"');\n $cats_sel->setSize(1);\n $cats_sel->setName('rex_file_category');\n $cats_sel->setId('rex_file_category_'.$this->time);\n $cats_sel->addOption($I18N->msg('pool_kats_no'),\"0\");\n\n $mediacat_ids = array();\n $rootCat = 0;\n $PERMALL = TRUE;\n if ($rootCats = OOMediaCategory::getRootCategories())\n {\n foreach( $rootCats as $rootCat) {\n rex_mediapool_addMediacatOptionsWPerm( $cats_sel, $rootCat, $mediacat_ids);\n }\n }\n $cats_sel->setSelected($rex_file_category);\n }\n \n \n if($this->markup){\n $output .='\n <div class=\"rex-form\">\n <fieldset class=\"rex-form-col-1\">\n <legend>Multiupload</legend>\n <div class=\"rex-form-wrapper\">'.\"\\n\";\n \n if($this->sync_cat){\n $output .='\n <div class=\"rex-form-row\">\n <p class=\"rex-form-text\">\n <label for=\"rex_file_category\">'.$I18N->msg('pool_file_category').'</label>\n '.$cats_sel->get().'\n </p>\n </div>'.\"\\n\";\n }\n \n $output .='\n <div class=\"rex-form-row\">\n <label>Upload:</label>'.\"\\n\";\n }\n $output .='\n <div id=\"multiupload'.$this->time.'\" class=\"'.($this->markup ? 'behave_normal' : 'styleless').'\"> \n <noscript> \n <p>JavaScript muss aktiviert sein.</p>\n </noscript> \n </div>';\n \n if($this->markup){\n $output .='\n </div>';\n if(!$this->clear_uploadlist_automatically) {\n $output .= '<div class=\"rex-form-row\">\n <p class=\"rex-form-text\">\n <label>Aktionen</label>\n <a href=\"javascript:void(0)\" onclick=\"clearUploadList();\">Abgeschlossene / fehlerhafte aus der Liste entfernen</a>\n </p>\n </div>'.\"\\n\";\n }\n }\n\n $script_page_header .= '\n <script>\n \n function rex_multiupload_createUploader'.$this->time.'(){ \n var uploader = new qq.FileUploader({\n element: document.getElementById(\"multiupload'.$this->time.'\"),\n action: \"'.$uploadPath.'\",\n mediaPoolSelector: \"rex_file_category_'.$this->time.'\",\n sizeLimit: 0, // max size \n minSizeLimit: 0, // min size';\n \n \n $script_page_header .= '\n onSubmit: function(id,filename) {'.\"\\n\";\n if($this->clear_uploadlist_automatically)\n {\n $script_page_header .= '\n clearUploadList();';\n }\n \n if($this->onSubmitCallback){\n $script_page_header .= '\n \n if(typeof '.$this->onSubmitCallback.' == \"function\") { \n // user callback function\n '.$this->onSubmitCallback.'(filename);\n }';\n }\n $script_page_header .= '\n },\n ';\n \n \n $script_page_header .= '\n onUpload: function(id,fileName, xhr) {'.\"\\n\";\n \n if($this->onUploadCallback){\n $script_page_header .= '\n \n if(typeof '.$this->onUploadCallback.' == \"function\") { \n // user callback function\n '.$this->onUploadCallback.'(fileName, xhr);\n }';\n }\n $script_page_header .= '\n \n \n },\n ';\n \n $script_page_header .= '\n onProgress: function(id,fileName, loaded, total) {'.\"\\n\";\n \n if($this->onProgressCallback){\n $script_page_header .= '\n \n if(typeof '.$this->onProgressCallback.' == \"function\") { \n // user callback function\n '.$this->onProgressCallback.'(fileName, loaded, total);\n }';\n }\n $script_page_header .= '\n \n \n },\n ';\n \n $script_page_header .= '\n onComplete: function(id,filename,json) {'.\"\\n\";\n if($this->clear_file_after_finish)\n {\n $script_page_header .= ' \n window.setTimeout(function(){\n clearUploadListSuccess();\n }, 5000);';\n }\n \n if($this->onCompleteCallback){\n $script_page_header .= '\n \n if(typeof '.$this->onCompleteCallback.' == \"function\" && json.success) { \n // user callback function\n '.$this->onCompleteCallback.'(json);\n }';\n }\n $script_page_header .= '\n \n \n },\n ';\n \n $script_page_header .= '\n onCancel: function(id,filename) {'.\"\\n\";\n \n if($this->onCancelCallback){\n $script_page_header .= '\n \n if(typeof '.$this->onCancelCallback.' == \"function\") { \n // user callback function\n '.$this->onCancelCallback.'(filename);\n }';\n }\n $script_page_header .= '\n \n \n },\n ';\n \n \n \n \n \n if($this->upload_simultaneously && is_numeric($this->upload_simultaneously)){\n $script_page_header .= ' \n maxConnections: '.$this->upload_simultaneously.',';\n }\n\n $script_page_header .= '\n debug: '.($this->javascript_debug ? \"true\" : \"false\").'\n }); \n }\n \n jQuery(document).ready(function(){\n rex_multiupload_createUploader'.$this->time.'();\n });\n </script>'.\"\\n\";\n \n if($this->markup){ \n if($this->showFootnote){\n $output .= \n '<div class=\"rex-form-row edit_panel\">\n <label>Dateien editieren</label>\n <ul class=\"qq-upload-list edit_uploads\">\n\n </ul>\n </p>\n </div>'.\"\\n\";\n }\n }\n\n if($this->markup){ \n if($this->showFootnote){\n $output .= \n '<div class=\"rex-form-row\">\n <p class=\"rex-form-file\">\n <span class=\"rex-form-notice\">\n Mehrfachauswahl mit STRG(WIN) oder CMD(MAC).<br />\n Die Dateien werden automatisch in die ausgewählte Kategorie sychronisiert.\n Ein Wechsel der Medienkategorie greift immer vor Auswahl einer Datei. \n Findet ein Upload bereits statt, kann für diese Datei die Kategorie nicht mehr verändert werden.\n </span>\n </p>\n </div>'.\"\\n\";\n }\n $output .= ' \n </div>\n </fieldset>\n </div>'.\"\\n\";\n }\n \n \n // Register EXTENSION POINT\n $header_func = 'return str_replace(\"<!-- ###MULTIUPLOAD_EP_REPLACE### -->\",\\''.$script_page_header.'\\'.\"<!-- ###MULTIUPLOAD_EP_REPLACE### -->\",$params[\"subject\"]);'; \n rex_register_extension('OUTPUT_FILTER', create_function('$params',$header_func));\n \n // TIME FOR OUTPUT\n return $output;\n }", "function m_uploadForm()\n\t{\n\t\t$obFile\t\t\t=new FileUpload();\n\t\t$this->ObTpl\t=new template();\n\n\t\t$this->ObTpl->set_file(\"Editor\",$this->uploadTemplate);\n\t\t$this->ObTpl->set_block(\"Editor\",\"TPL_IMAGE_BLK\", \"image_blk\");\n\t\t$this->ObTpl->set_var(\"TPL_VAR_DELETELINK\",\"\");\n\t\tif(!isset($this->request['type']))\n\t\t{\n\t\t\t$this->request['type']=\"option\";\n\t\t}\n\n\t\tif($this->request['type']==\"choice\")\n\t\t{\n\t\t\t$this->obDb->query = \"select iChoiceid_PK,vImage from \".CHOICES.\" where iChoiceid_PK = \".$this->request['id'];\n\t\t\t$rsImage = $this->obDb->fetchQuery();\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->obDb->query = \"select iOptionValueid_PK,vItem,vImage from \".OPTIONVALUES.\" where iOptionValueid_PK = \".$this->request['id'];\n\t\t\t$rsImage = $this->obDb->fetchQuery();\n\t\t}\n\n\t\tif($this->libFunc->m_checkFileExist($rsImage[0]->vImage,\"options\") && $rsImage[0]->vImage!=\"\")\n\t\t{\n\t\t\t\t$this->ObTpl->set_var(\"TPL_VAR_IMAGE\",\n\t\t\t\t\"<img src=\".$this->imageUrl.\"options/\".$rsImage[0]->vImage.\" alt='\".$rsImage[0]->vImage.\"' width=100 height=100>\");\t\t\n\t\t\t\t$this->ObTpl->set_var(\"TPL_VAR_DELETELINK\",\t\"<a href=\".SITE_URL.\"ecom/adminindex.php?action=ec_option.uploadForm&id=\".$this->request['id'].\"&type=\".$this->request['type'].\"&delete=1>Delete</a>\");\t\t\n\n\t\t\t\tif(isset($this->request['delete']) && $this->request['delete']==1)\n\t\t\t\t{\n\t\t\t\t\t$source=$this->imagePath.\"options/\".$rsImage[0]->vImage;\n\t\t\t\t\t$obFile->deleteFile($source);\n\t\t\t\t\t$this->ObTpl->set_var(\"TPL_VAR_IMAGE\",$this->libFunc->m_noImage());\n\t\t\t\t\t$this->ObTpl->set_var(\"TPL_VAR_DELETELINK\",\"\");\n\t\t\t\t\t$this->request['msg']=1;\n\t\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t\t$this->ObTpl->set_var(\"TPL_VAR_IMAGE\",$this->libFunc->m_noImage());\n\t\t}\n\t\t\n\t\t$this->ObTpl->parse(\"image_blk\",\"TPL_IMAGE_BLK\");\t\n\t\t$imgLabel=\"image\";\n\n\t\tif(isset($this->request['status']))\n\t\t{\n\t\t\t$this->ObTpl->set_var(\"TPL_VAR_TOPMSG\",\"\".ucfirst($imgLabel).\" has been \tUpdated\");\t\t\t\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->ObTpl->set_var(\"TPL_VAR_TOPMSG\",\"\");\t\t\t\n\t\t}\n\n\t\tif(isset($this->request['msg'])) \n\t\t{\n\t\t\tif($this->request['msg']==1)\n\t\t\t{\n\t\t\t\t$this->ObTpl->set_var(\"TPL_VAR_TOPMSG\",\"<span class='adminDetail'>\".MSG_IMGDELETE_SUCCESS.\"</span>\");\n\t\t\t}\n\t\t\telseif($this->request['msg']==2)\n\t\t\t{\n\t\t\t\t$this->ObTpl->set_var(\"TPL_VAR_TOPMSG\",\"<span class='adminDetail'>\".MSG_IMGDELETE_SUCCESS.\"</span>\");\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$this->ObTpl->set_var(\"TPL_VAR_TOPMSG\",\"\");\n\t\t\t}\n\t\t}elseif($this->err==1){\n\t\t\t$this->ObTpl->set_var(\"TPL_VAR_TOPMSG\",$this->errMsg);\n\t\t}\n\t\t$this->ObTpl->set_var(\"TPL_VAR_SITEURL\",SITE_URL);\n\t\t$this->ObTpl->set_var(\"TPL_VAR_ID\",$this->request['id']);\t\t\t\n\t\t$this->ObTpl->set_var(\"FORMURL\",SITE_URL.\"ecom/adminindex.php?action=ec_option.upload&id=\".$this->request['id'].\"&type=\".$this->request['type']);\n\t\t\n\t\t$this->ObTpl->pparse(\"return\",\"Editor\");\n\t\texit;\n\t}", "public function form($field)\r\n {\r\n global $_W;\r\n $cdn_url = $_W['cdn_url'];\r\n $files = [];\r\n $item = \"\";\r\n if (is_array($field->node_field_default_value) && count($field->node_field_default_value) > 0) {\r\n foreach ($field->node_field_default_value as $v) {\r\n $files[] = File::get(['file_id' => $v]);\r\n }\r\n }\r\n foreach ($files as $k => $f) {\r\n if (!$f) {\r\n unset($files[$k]);\r\n continue;\r\n } else {\r\n $url = render_file($f);\r\n }\r\n if (strpos($f[\"filemime\"], \"image\") === false) {\r\n $f->url = \"\";\r\n }\r\n $item .= \"<li class=\\\"state-complete\\\"><p class=\\\"title\\\">$f->filename</p><p class=\\\"imgWrap\\\"><img src=\\\"$url\\\"></p>\r\n<p class=\\\"progress\\\"><span style=\\\"display: none; width: 0px;\\\"></span></p><span class=\\\"success\\\"><input type=\\\"hidden\\\" value=\\\"$f->file_id\\\" name=\\\"$field->form_group[$field->node_field_name]$field->multiple\\\"></span></li>\r\n\t \";\r\n }\r\n $form_str = \"\";\r\n if (!defined(\"WEB_UPLOADER\")) {\r\n //load css && js\r\n $form_str .= \"<script type=\\\"text/javascript\\\" src=\\\"{$cdn_url}statics/plugins/webuploader/webuploader.min.js\\\"></script>\";\r\n $form_str .= \"<script type=\\\"text/javascript\\\" src=\\\"{$cdn_url}statics/plugins/webuploader/md5.js\\\"></script>\";\r\n $form_str .= \"<script type=\\\"text/javascript\\\" src=\\\"{$cdn_url}statics/plugins/webuploader/upload.js\\\"></script>\";\r\n $form_str .= \"<link rel=\\\"stylesheet\\\" type=\\\"text/css\\\" href=\\\"{$cdn_url}statics/plugins/webuploader/upload.css\\\" />\";\r\n\r\n $form_str .= \" <script type='text/javascript'>\";\r\n $form_str .= \" prepare_upload();\";\r\n $form_str .= \" \";\r\n $form_str .= \" </script>\";\r\n define(\"WEB_UPLOADER\", 1);\r\n }\r\n $queue = \"<ul class=\\\"filelist {$field->node_field_name}_file_list\\\">$item</ul>\";\r\n $form_str .= \"<div class='uploader' name='$field->form_group[$field->node_field_name]$field->multiple' id=\\\"uploader_$field->node_field_name\\\">\";\r\n $form_str .= \" <div class=\\\"queueList\\\">\" . $queue;\r\n $form_str .= \" <div id=\\\"dndArea$field->node_field_name\\\" class=\\\"placeholder\\\">\";\r\n $form_str .= \" <div id=\\\"filePicker$field->node_field_name\\\"></div>\";\r\n $form_str .= \" <span class='ui info'>或将文件拖到这里,限<span class=\\\"text-danger\\\">$field->node_field_is_multiple</span>个文件, 支持格式 <span class=\\\"text-info\\\">$field->node_field_data_source_config</span></span>\";\r\n $form_str .= \" </div>\";\r\n $form_str .= \" </div>\";\r\n $form_str .= \" <div class=\\\"statusBar\\\" style=\\\"display:none;\\\">\";\r\n $form_str .= \" <div class=\\\"progress\\\">\";\r\n $form_str .= \" <span class=\\\"text\\\">0%</span>\";\r\n $form_str .= \" <span class=\\\"percentage\\\"></span>\";\r\n $form_str .= \" </div><div class=\\\"info\\\"></div>\";\r\n $form_str .= \" <div class=\\\"btns\\\">\";\r\n $form_str .= \" <div id=\\\"filePicker2$field->node_field_name\\\"></div><div class=\\\"uploadBtn\\\">开始上传</div>\";\r\n $form_str .= \" </div>\";\r\n $form_str .= \" </div>\";\r\n $form_str .= \" </div>\";\r\n $form_str .= \" <script type='text/javascript'>\";\r\n $form_str .= \" $(document).ready(function(){ init_upload('$field->node_field_name','$field->node_field_data_source_config',$field->node_field_is_multiple)});\";\r\n //$form_str .= \" $(document).ready(function(){ init_upload('$this->node_field_name','$this->node_field_data_source_config',$this->node_field_is_multiple)});\";\r\n $form_str .= \" </script>\";\r\n return $form_str;\r\n }", "public function admin_upload($id = null) {\n\t\n\t\t$this->layout = 'json';\n\t\t$successJSON = false;\n\t\t$contents = array();\n\t\t\n\t\n\t\tif ($id == null) {\n\t\t\techo \"0\";\n\t\t}\n\t\t\n\t\tif (!empty($_FILES)) {\n\t\n\t\t\t$tempFile = $_FILES['Filedata'];\n\t\t\t\n\t\t\t$this->Product->ProductImage->create();\n\t\t\t$data = array('ProductImage'=>array('filename'=>$tempFile,\n\t\t\t\t\t\t\t 'product_id' => $id,));\n\t\t\t\n\t\t\t$result = $this->Product->ProductImage->uploadifySave($data);\n\t\t\t\n\t\t\tif ($result != false) {\n\t\t\t\t$contents = array('id'=>$this->Product->ProductImage->id,\n\t\t\t\t\t\t 'filename'=>$result['ProductImage']['filename'],\n\t\t\t\t\t\t 'cover'=>$result['ProductImage']['cover']);\n\t\t\t}\n\t\t\t$successJSON = true;\n\t\t\t\n\t\t\t$this->set(compact('contents', 'successJSON'));\n\t\t\t$this->render('json/response');\n\t\t\n\t\t}\n\t\t\n\t\t\n\t}", "function uploadBy($table, $form_data){\n global $connect;\n\n if(isset($_POST['uploadBy'])){\n \n $target_dir = \"../images/\";\n $target_file = $target_dir . basename($_FILES[\"file\"][\"name\"]);\n\n $imageFileType = strtolower(pathinfo($target_file,PATHINFO_EXTENSION));\n $extensions_arr = array(\"jpg\",\"jpeg\",\"png\",\"gif\");\n if( in_array($imageFileType,$extensions_arr) ){\n\n $fields = array_keys($form_data);\n\n $sql = \"INSERT INTO \".$table.\"\n (`\".implode('`,`', $fields).\"`)\n VALUES('\".implode(\"','\", $form_data).\"')\";\n\n mysqli_query($connect,$sql);\n \n move_uploaded_file($_FILES['file']['tmp_name'],$target_dir.$_FILES['file']['name']);\n }\n }//$_POST['upload'] close tag\n }", "function put_file($fieldname, $rowindex, $module='', $param_1='', $param_2='', $param_3='', $param_4='') {\r\n $f = $this->get_files_array($fieldname, $rowindex);\r\n #~ print_r($f);\r\n if ($f['name'] == '')\r\n return '';\r\n #~ echo 'Go go go!';\r\n move_uploaded_file($f['tmp_name'], $f['suggest_path']);\r\n $rowid = $this->insert_row(array('filename'=>$f['name'], 'size'=>$f['size'], 'type'=>$f['type'], 'path'=>$f['suggest_path'], 'create_date'=>date('Y-m-d H:i:s'), 'module'=>$module, 'param_1'=>$param_1, 'param_2'=>$param_2, 'param_3'=>$param_3, 'param_4'=>$param_4));\r\n #~ echo 'Got!'.$rowid;\r\n return $rowid;\r\n }", "public function makeImagesUploadPage(){\n\t\t$this->title = \"Upload de clichés\";\n\t\t$this->content = \"<h2 id='poste'>Postez vos meilleurs clichés</h2>\";\n\t\t$this->content .= \"<h4> Vous pouvez envoyer une ou deux photos maximum </h4>\";\n\t\t$this->content .= \"<form enctype='multipart/form-data' action=\".$this->routeur->uploadCliche().\" method='POST'>\n\n\t\t<div class = 'uploadChamp'>\n\t\t\t\n\t\t\t<div class = 'uploadChamp1'>\n\t\t\t\t<fieldset>\n\t\t\t\t\t<legend class = title>Titre :</legend>\n\t\t\t\t\t<input type = 'text' placeholder='Enter the title' name = 'title'> \n\t\t\t\t</fieldset>\n\n\t\t\t\t<fieldset>\n\t\t\t\t\t<legend class = author>Auteur :</legend>\n\t\t\t\t\t<input type = 'text' placeholder='Enter the author' name = 'author'> \n\t\t\t\t</fieldset>\n\n\t\t\t\t<fieldset>\n\t\t\t\t\t<legend class = description>Description :</legend>\n\t\t\t\t\t<textarea id='input' placeholder=' Write a description' name = 'description' rows='10' cols='31'></textarea>\n\t\t\t\t</fieldset>\n\t\t\t\t\t<label> </label>\n\t\t\t\t<input class=uploader type='file' name='firstImage'/>\n\t\t\t</div>\n\n\n\t\t\t<div class = 'uploadChamp2'>\n\t\t\t\t<fieldset>\n\t\t\t\t\t<legend class = title>Titre :</legend>\n\t\t\t\t\t<input type = 'text' placeholder='Enter the title' name = 'title2'> \n\t\t\t\t</fieldset>\n\n\t\t\t\t<fieldset>\n \t\t\t\t\t<legend class = author>Auteur :</legend>\n\t\t\t\t\t<input type = 'text' placeholder='Enter the author' name = 'author2'> \n\t\t\t\t</fieldset>\n\t\t\t\t<fieldset>\n \t\t\t\t\t<legend class = description>Description :</legend>\n\t\t\t\t\t<textarea id='input' placeholder=' Write a description' name = 'description2' rows='10' cols='31'></textarea>\n\t\t\t\t</fieldset>\n\t\t\t\t<label> </label>\n\t\t\t\t<input class=uploader type='file' name='secondImage'/>\n\t\t\t</div>\n\n\t\t</div>\n\n\t\t\t<button class = 'valider' type='submit' >Valider</button>\n\t\t\t</form>\";\n\t}", "public function edit_PrkSave(){\r\n $pStatus = $_POST['pStatus'];\r\n $pReqId = $_POST['pReqId'];\r\n $pReqDetId = $_POST['pReqDetId'];\r\n $pParkirdId = $_POST['pCtrlID'];\r\n $pCType=$_POST['pCType'];\r\n $pFile = $_FILES['file']['tmp_name'];\r\n //$pFile = $_POST['file'];\r\n /*\r\n $fdest = \"upload/a.jpg\";\r\n move_uploaded_file($_FILES[\"file\"][\"tmp_name\"], $fdest); \r\n ?>\r\n <script>\r\n top.location.href=\"<?php echo site_url(\"/search_global/search_global\");?>\";\r\n </script>\r\n <?php \r\n //echo $pFile; exit;\r\n */\r\n \r\n $msg = \"\";\r\n $pNik = $_POST['pNik'];\r\n $pNikFor = $_POST['r_id']; //\r\n $pStatusFor = $_POST['pStatusFor'];\r\n $pAktif = $_POST['CarRadio'];\r\n $pParkirType1 = \"MOBIL\";\r\n $pStnk1 = $_POST['Certificate1'];\r\n $pPlat1 = $_POST['License1'];\r\n $pParkirType2 = \"MOBIL\";\r\n $pStnk2 = $_POST['Certificate2'];\r\n $pPlat2 = $_POST['License2'];\r\n $pParkirType3 = \"MOBIL\";\r\n $pStnk3 = $_POST['Certificate3'];\r\n $pPlat3 = $_POST['License3'];\r\n $pParkirType4 = \"MOTOR\";\r\n $pStnk4 = $_POST['Certificate4'];\r\n $pPlat4 = $_POST['License4'];\r\n $pFile = $_POST['file'];\r\n $tmpname = $_FILES['file']['tmp_name'];\r\n $filename = $_FILES['file']['name'];\r\n $filesize = $_FILES['file']['size'];\r\n $filetype = $_FILES['file']['type'];\r\n $pAtasanNik = $_POST['r_mgrid'];\r\n $pAtasanNama = $_POST['r_mgr'];\r\n $pDescription = str_replace(\"'\", \"x\", $_POST['pDescription']);\r\n \r\n //var_dump($tmpname); exit;\r\n $arr['pParkirdId'] = $_POST['pCtrlID'];\r\n $arr['pCType']=$_POST['pCType'];\r\n $arr['pStatus'] = $_POST['pStatus'];\r\n $arr['pReqId'] = $_POST['pReqId'];\r\n $arr['pReqDetId'] = $_POST['pReqDetId'];\r\n \r\n $arr['msg'] = \"\";\r\n $arr['pNik'] = $_POST['pNik'];\r\n $arr['pNikFor'] = $_POST['r_id']; //\r\n $arr['pStatusFor'] = $_POST['pStatusFor'];\r\n $arr['pAktif'] = $_POST['CarRadio'];\r\n $arr['pParkirType1'] = \"MOBIL\";\r\n $arr['pStnk1'] = $_POST['Certificate1'];\r\n $arr['pPlat1'] = $_POST['License1'];\r\n $arr['pParkirType2'] = \"MOBIL\";\r\n $arr['pStnk2'] = $_POST['Certificate2'];\r\n $arr['pPlat2'] = $_POST['License2'];\r\n $arr['pParkirType3'] = \"MOBIL\";\r\n $arr['pStnk3'] = $_POST['Certificate3'];\r\n $arr['pPlat3'] = $_POST['License3'];\r\n $arr['pParkirType4'] = \"MOTOR\";\r\n $arr['pStnk4'] = $_POST['Certificate4'];\r\n $arr['pPlat4'] = $_POST['License4'];\r\n $arr['pFile'] = $_POST['file'];\r\n $arr['tmpname'] = $_FILES['file']['tmp_name'];\r\n $arr['filename'] = $_FILES['file']['name'];\r\n $arr['filesize'] = $_FILES['file']['size'];\r\n $arr['filetype'] = $_FILES['file']['type'];\r\n $arr['pAtasanNik'] = $_POST['r_mgrid'];\r\n $arr['pAtasanNama'] = $_POST['r_mgr'];\r\n $arr['pDescription'] = str_replace(\"'\", \"x\", $_POST['pDescription']);\r\n //$vAtasanName = dbora_getname($pAtasanNik);\r\n //$pStatus = $_POST['pStatus'];\r\n //$pReqId = $_POST['pReqId'];\r\n //$pReqDetId = $_POST['pReqDetId'];\r\n \r\n \r\n if ($pAktif == 1) { //JIKA PILIHAN ADALAH MOBIL 1\r\n $pParkirType = $pParkirType1;\r\n $pPlat = $pPlat1;\r\n $pStnk = $pStnk1;\r\n $pFlag1 = 'Y';\r\n $arr['pParkirType'] = $pParkirType1;\r\n $arr['pPlat'] = $pPlat1;\r\n $arr['pStnk'] = $pStnk1;\r\n $arr['pFlag1'] = 'Y';\r\n } \r\n else if ($pAktif == 2) { ////JIKA PILIHAN ADALAH MOBIL 2\r\n $pParkirType = $pParkirType2;\r\n $pPlat = $pPlat2;\r\n $pStnk = $pStnk2;\r\n $pFlag2 = 'Y';\r\n $arr['pParkirType'] = $pParkirType2;\r\n $arr['pPlat'] = $pPlat2;\r\n $arr['pStnk'] = $pStnk2;\r\n $arr['pFlag2'] = 'Y';\r\n } \r\n else if ($pAktif == 3) { //JIKA PILIHAN ADALAH MOBIL 3\r\n $pParkirType = $pParkirType3;\r\n $pPlat = $pPlat3;\r\n $pStnk = $pStnk3;\r\n $pFlag3 = 'Y';\r\n $arr['pParkirType'] = $pParkirType3;\r\n $arr['pPlat'] = $pPlat3;\r\n $arr['pStnk'] = $pStnk3;\r\n $arr['pFlag3'] = 'Y';\r\n } \r\n else { //JIKA PILIHAN ADALAH MOTOR\r\n $pPlat = $pPlat4;\r\n $pStnk = $pStnk4;\r\n $pFlag4 = 'Y';\r\n $arr['pPlat'] = $pPlat4;\r\n $arr['pStnk'] = $pStnk4;\r\n $arr['pFlag4'] = 'Y';\r\n }\r\n \r\n //var_dump($arr); exit;\r\n if (empty($pParkirdId)) { //JIKA REQUESTNO KOSONG, ARTINYA MENU ADD/BUKAN MENU EDIT\r\n /*\r\n if ($_FILES[\"file\"][\"error\"] > 0) {\r\n if ($_FILES[\"file\"][\"error\"] <> 4)\r\n echo \"Error: \" . $_FILES[\"file\"][\"error\"] . \"<br />\";\r\n } \r\n else {\r\n $qryz = \"select max(parkird_filename) xx from fm_parkir_det where lower(parkird_filename) like 'park_%'\";\r\n $DB4->parse($qryz);\r\n $DB4->execute();\r\n $fn1 = ($a = $DB4->nextrow()) ? $a['XX'] : '';\r\n $fn = preg_match('/^park_(\\d{5})/', $fn1, $match) ? str_pad(++$match[1], 5, '0', STR_PAD_LEFT) : '00001';\r\n $fext = ($x = strrpos($_FILES[\"file\"][\"name\"], '.')) !== false ? substr($_FILES[\"file\"][\"name\"], $x) : '';\r\n $fext = strtolower($fext);\r\n $fname = \"park_$fn$fext\";\r\n $fdest = \"upload/$fname\";\r\n unset($fn, $fext);\r\n \r\n $res_upload = move_uploaded_file($_FILES[\"file\"][\"tmp_name\"], $fdest);\r\n if ($res_upload) {\r\n chmod($fdest, 0644);\r\n } else {\r\n $fname = '';\r\n $filename = '';\r\n }\r\n }\r\n \r\n $qry1 = \"select max(to_number(substr(parkird_id,1,5),'99999')) parkird_id_old, rtrim(to_char(sysdate,'RM')) romawi from fm_parkir_det\";\r\n $DB1->parse($qry1);\r\n $DB1->execute();\r\n if ($a = $DB1->nextrow()) {\r\n $cParkirdIdOld = $a[\"PARKIRD_ID_OLD\"];\r\n $cRomawi = $a[\"ROMAWI\"];\r\n $cParkirdIdNew = $cParkirdIdOld + 1;\r\n }\r\n \r\n \r\n $qry2 = \"select lpad($cParkirdIdNew,5,0)||'/PARK/$cRomawi/'||TO_CHAR(SYSDATE,'YYYY') parkird_id from dual\";\r\n $DB2->parse($qry2);\r\n $DB2->execute();\r\n if ($a = $DB2->nextrow()) {\r\n $cParkirdId = $a[\"PARKIRD_ID\"];\r\n }\r\n \r\n $filename = str_replace(\"'\", \"x\", $filename);\r\n \r\n $stmt1 = \"insert into fm_parkir_det(parkird_id, parkird_nik, parkird_untuk_nik, parkird_use_by, parkird_type, parkird_plat, parkird_stnk,\r\n \t\t\t\t\t\t\t\t\t\t parkird_type_1, parkird_plat_1, parkird_stnk_1, parkird_flag_1,\r\n \t\t\t\t\t\t\t\t\t\t parkird_type_2, parkird_plat_2, parkird_stnk_2, parkird_flag_2,\r\n \t\t\t\t\t\t\t\t\t\t parkird_type_3, parkird_plat_3, parkird_stnk_3, parkird_flag_3,\r\n \t\t\t\t\t\t\t\t\t\t parkird_type_4, parkird_plat_4, parkird_stnk_4, parkird_flag_4,\r\n \t\t\t\t\t\t\t\t\t\t parkird_description, parkird_atasan_nik, parkird_reference, parkird_date,\r\n \t\t\t\t\t\t\t\t\t\t parkird_file, parkird_filetype, parkird_size, parkird_status, parkird_filename) \" .\r\n \" values ('$cParkirdId','$pNik','$pNikFor','$pStatusFor','$pParkirType','$pPlat','$pStnk',\r\n \t\t\t\t\t\t\t\t\t\t '$pParkirType1','$pPlat1','$pStnk1','$pFlag1',\r\n \t\t\t\t\t\t\t\t\t\t '$pParkirType2','$pPlat2','$pStnk2','$pFlag2',\r\n \t\t\t\t\t\t\t\t\t\t '$pParkirType3','$pPlat3','$pStnk3','$pFlag3',\r\n \t\t\t\t\t\t\t\t\t\t '$pParkirType4','$pPlat4','$pStnk4','$pFlag4',\r\n \t\t\t\t\t\t\t\t\t\t '$pDescription','$pAtasanNik','$pReqId',sysdate,\r\n \t\t\t\t\t\t\t\t\t\t '$filename','$filetype','$filesize','Y','$fname')\";\r\n $DB3->parse($stmt1);\r\n $DB3->execute();\r\n \r\n $stmt2 = \"update fm_req_det set req_det_app = 'Y' where req_id='$pReqId' and req_det_id= '$pReqDetId'\";\r\n $DB3->parse($stmt2);\r\n $DB3->execute();\r\n \r\n $msg = \"FM : Order No $cParkirdId telah berhasil, untuk Proses selanjutnya menunggu Approval dari atasan anda $vAtasanName.\";\r\n $msgatasan = \"FM : Order No $cParkirdId membutuhkan approval anda.\";\r\n \r\n // Start Sms\r\n // Sms to User\r\n $msisdn = dbora_getgamsisdn($pNikFor);\r\n send_sms($msisdn, $msg);\r\n //End Sms User\r\n // Sms to Atasan\r\n $msisdnatasan = dbora_getgamsisdn($pAtasanNik);\r\n send_sms($msisdnatasan, $msgatasan);\r\n //End Sms Atasan\r\n //End Sms user\r\n //End Sms\r\n \r\n echo \"<script>\r\n \t\t\tlocation.href=\\\"room_notification.php?pMessage=$msg\\\";\r\n \t\t </script>\";\r\n */\r\n } \r\n else { //MERUPAKAN MENU EDIT, PERHATIKAN SAJA BAGIAN INI\r\n if ($_FILES[\"file\"][\"error\"] > 0) { //JIKA FILE UPLOAD ERROR\r\n if ($_FILES[\"file\"][\"error\"] <> 4)\r\n echo \"Error: \" . $_FILES[\"file\"][\"error\"] . \"<br />\";\r\n } \r\n else { //JIKA UPLOAD TIDAK ERROR\r\n //SELECT FM_PARKIR_DET\r\n $prkSelect1=$this->sGlobal_model->prkSelect1();\r\n $fn1='';\r\n foreach($prkSelect1 as $a){\r\n $fn1=$a['XX'];\r\n }\r\n //$fn1 = ($a = $DB4->nextrow()) ? $a['XX'] : '';\r\n $fn = preg_match('/^park_(\\d{5})/', $fn1, $match) ? str_pad(++$match[1], 5, '0', STR_PAD_LEFT) : '00001';\r\n $fext = ($x = strrpos($_FILES[\"file\"][\"name\"], '.')) !== false ? substr($_FILES[\"file\"][\"name\"], $x) : '';\r\n $fext = strtolower($fext);\r\n $fname = \"park_$fn$fext\";\r\n $arr['fname']=$fname;\r\n $fdest = \"upload/$fname\";\r\n \r\n //echo $fname; exit;\r\n unset($fn, $fext);\r\n \r\n $res_upload = move_uploaded_file($_FILES[\"file\"][\"tmp_name\"], $fdest);\r\n if ($res_upload) {\r\n chmod($fdest, 0644);\r\n } \r\n else {\r\n $fname = '';\r\n $filename = '';\r\n }\r\n }\r\n \r\n //exit;\r\n $filename = str_replace(\"'\", \"x\", $filename);\r\n \r\n if (empty($pStatus)) { //JIKA STATUS EMPTTY, UNTUK MENU EDIT SUDAH PASTI EMPTY\r\n if (!empty($filename)) { //JIKA UPLOAD FILE BARU, ARTINYA MENGUBAH FILE UPLOAD SEBELUMNYA\r\n //UPDATE FM_PARKIR_DET\r\n $prkUpdate1=$this->sGlobal_model->prkUpdate1($arr);\r\n } \r\n else { //JIKA TIDAK ADA FILE UPLOAD YANG BARU, MAKA TIDAK PERLU MENAMBAHKAN UPLOAD DIR KE DATABASE\r\n //UPDATE FM_PARKIR_DET\r\n $prkUpdate1=$this->sGlobal_model->prkUpdate2($arr);\r\n }\r\n ?>\r\n <script>\r\n top.location.href=\"<?php echo site_url(\"/search_global/search_global\");?>\";\r\n </script>\r\n <?php \r\n } //JIKA ADA STATUSNYA\r\n else { /*\r\n $stmt1 = \"update fm_parkir_det set parkird_status='N', parkird_date=sysdate where parkird_id = '$pParkirdId' \";\r\n $DB3->parse($stmt1);\r\n $DB3->execute();\r\n \r\n $filename = str_replace(\"'\", \"x\", $filename);\r\n \r\n $stmt2 = \"insert into fm_parkir_det(parkird_nik, parkird_stnk, parkird_plat, parkird_description, parkir_id, parkird_atasan_nik, parkird_use_by, parkird_untuk_nik, parkird_reference, parkird_date, parkird_file, parkird_type, parkird_size, parkird_status) \" .\r\n \" values ('$pNik','$pStnk','$pPlat','$pDescription','$pParkirId','$pAtasanNik', '$pStatusFor', '$pNikFor', '$pReqId',sysdate,'$filename','$filetype','$filesize','Y')\";\r\n $DB3->parse($stmt2);\r\n $DB3->execute();\r\n */\r\n }\r\n }\r\n\r\n }", "function ft_file_upload_submission_file($form_id, $submission_id, $file_field_info)\n{\n global $g_table_prefix, $g_filename_char_whitelist, $LANG;\n\n // get the column name and upload folder for this field\n $field_id = $file_field_info[\"field_id\"];\n $col_name = $file_field_info[\"field_info\"][\"col_name\"];\n\n // if the column name wasn't found, the $field_id passed in was invalid. Somethin' aint right...\n if (empty($col_name))\n return array(false, $LANG[\"notify_submission_no_field_id\"]);\n\n // clean up the filename according to the whitelist chars\n $field_name = $file_field_info[\"field_info\"][\"field_name\"];\n $fileinfo = $_FILES[$field_name];\n\n $filename_parts = explode(\".\", $fileinfo[\"name\"]);\n $extension = $filename_parts[count($filename_parts)-1];\n array_pop($filename_parts);\n $filename_without_extension = implode(\".\", $filename_parts);\n $valid_chars = preg_quote($g_filename_char_whitelist);\n $filename_without_ext_clean = preg_replace(\"/[^$valid_chars]/\", \"\", $filename_without_extension);\n\n // unlikely, but...!\n if (empty($filename_without_ext_clean))\n $filename_without_ext_clean = \"file\";\n\n $filename = $filename_without_ext_clean . \".\" . $extension;\n\n $tmp_filename = $fileinfo[\"tmp_name\"];\n $filesize = $fileinfo[\"size\"]; // always in BYTES\n $filesize_kb = $filesize / 1000;\n\n // pull a couple of values out of the field's settings (these are custom to the field)\n $file_upload_max_size = $file_field_info[\"settings\"][\"max_file_size\"];\n $file_upload_dir = $file_field_info[\"settings\"][\"folder_path\"];\n $permitted_file_types = $file_field_info[\"settings\"][\"permitted_file_types\"];\n\n // check file size\n if ($filesize_kb > $file_upload_max_size)\n {\n $placeholders = array(\n \"FILESIZE\" => round($filesize_kb, 1),\n \"MAXFILESIZE\" => $file_upload_max_size\n );\n $error = ft_eval_smarty_string($LANG[\"notify_file_too_large\"], $placeholders);\n return array(false, $error);\n }\n\n // check upload folder is valid and writable\n if (!is_dir($file_upload_dir) || !is_writable($file_upload_dir))\n return array(false, $LANG[\"notify_invalid_field_upload_folder\"]);\n\n // check file extension is valid. Note: this is \"dumb\" - it just tests for the file extension string, not\n // the actual file type based on it's header info [this is done because I want to allow users to permit\n // uploading of any file types, and I can't know about all header types]\n $is_valid_extension = true;\n if (!empty($permitted_file_types))\n {\n $is_valid_extension = false;\n $raw_extensions = explode(\",\", $permitted_file_types);\n\n foreach ($raw_extensions as $ext)\n {\n // remove whitespace and periods\n $clean_extension = str_replace(\".\", \"\", trim($ext));\n\n if (preg_match(\"/$clean_extension$/i\", $filename))\n $is_valid_extension = true;\n }\n }\n\n // all checks out!\n if ($is_valid_extension)\n {\n // find out if there was already a file uploaded in this field. We make a note of this so that\n // in case the new file upload is successful, we automatically delete the old file\n $submission_info = ft_get_submission_info($form_id, $submission_id);\n $old_filename = (!empty($submission_info[$col_name])) ? $submission_info[$col_name] : \"\";\n\n // check for duplicate filenames and get a unique name\n $unique_filename = ft_get_unique_filename($file_upload_dir, $filename);\n\n // copy file to uploads folder and remove temporary file\n if (@rename($tmp_filename, \"$file_upload_dir/$unique_filename\"))\n {\n @chmod(\"$file_upload_dir/$unique_filename\", 0777);\n\n // update the database\n $query = \"\n UPDATE {$g_table_prefix}form_{$form_id}\n SET $col_name = '$unique_filename'\n WHERE submission_id = $submission_id\n \";\n\n $result = mysql_query($query);\n\n if ($result)\n {\n // if there was a file previously uploaded in this field, delete it!\n if (!empty($old_filename))\n @unlink(\"$file_upload_dir/$old_filename\");\n\n return array(true, $LANG[\"notify_file_uploaded\"], $unique_filename);\n }\n else\n return array(false, $LANG[\"notify_file_not_uploaded\"]);\n }\n else\n return array(false, $LANG[\"notify_file_not_uploaded\"]);\n }\n\n // not a valid extension. Inform the user\n else\n return array(false, $LANG[\"notify_unsupported_file_extension\"]);\n}", "function ModifierInfCDJ()\n{\n $db = connection();\n $res = false;\n if (isset($_POST['sauvegarderCDJ']))\n {\n\n $req = 'update '. 'n31__coordonnees_CDJ'. ' set ';\n\n $req .= ' nom_CDJ =\"'. $_POST['nom_CDJ'].'\" , ';\n $req .= ' nom_Contacts =\"'. $_POST['nomCont'].'\" , ';\n $req .= ' adresse =\"'. $_POST['adresse_CDJ'].'\" , ';\n $req .= ' telephone =\"'. $_POST['tel_CDJ'].'\" , ';\n $req .= ' courriel =\"'. $_POST['courriel'].'\" , ';\n $req .= ' adresse_site =\"'. $_POST['site'].'\" , ';\n // $req .= ' image =\"'.''.'\" , ';\n $req .= ' id_arrondissement =\"'.$_POST['arronds'].'\" , ';\n $req .= ' description_CDJ =\"'. $_POST['desc'].'\" , ';\n $req .= ' id_type =\"'. $_POST['typeCDJ'].'\" , ';\n $req .= ' debut =\"'. $_POST['debut'].'\" , ';\n $req .= ' fin =\"'. $_POST['fin'].'\"';\n\n if (isset($_POST['myFile'])) {\n $fileName = uploadFile();\n $req .= ', image =\"' . $fileName . '\" ';\n }\n\n $req .= ' where id ='.$_GET['id'];\n if (execModif($req)){echo \"Le modification est fini\";}\n }\n\n return $res;\n}", "function uploadFileMultiples_folder($fk_id,$is_edit=NULL)\r\n{\r\n //echo 'file';\r\n\t\t$user_ip = $this->getIP();\r\n\t\t//echo 'file_type2='.$user_ip;exit;\r\n\t\t//$user_name = $_SESSION['username'];\r\n\t\t//$full_name = $_SESSION['full_name'];\r\n\r\n\t\t//define a maxim size for the uploaded images in Kb\r\n \t\tdefine (\"MAX_SIZE\",\"8000\"); \r\n\t\t$i=0;\r\n\t\tforeach ($_FILES['uploaded_file']['name'] as $f)\r\n\t\t\t {\r\n\t\t\t\t \r\n\t\t######### Binary checks for file type ###############\r\n\t\t\t$file_type = $this->getImgType($_FILES['uploaded_file']['tmp_name'][$i]);\r\n\t\t\t //echo 'file_type2='.$file_type;exit;\r\n\t\t\tif($file_type == 'other')\r\n\t\t\t {\r\n\t\t\t \t\r\n\t\t\t\techo '<div align=\"center\" style=\"color:#FF0000\">Can not upload this type of file!</div>';\r\n\t\t\t\t\r\n\t\t\t\t //$referer = parse_url($_SERVER['HTTP_REFERER']);\r\n \t\t\t\t //header('location:'. $referer);\r\n\t\t\t\texit;\r\n\t\t\t }\r\n\t\t######################################################\r\n\t\t\r\n\t\t################# Other type check #################\r\n\t\t//get the original name of the file from the clients machine\r\n \t\t$filename = stripslashes($_FILES['uploaded_file']['name'][$i]);\r\n\t\t$file_tmp_name = $_FILES['uploaded_file']['tmp_name'][$i];\r\n\t\t\r\n \t//get the extension of the file in a lower case format\r\n \t\t$extension = $this->getExtension($filename);\r\n \t $extension = strtolower($extension);\r\n \r\n\t\t$allowedExts = array(\"gif\", \"jpeg\", \"jpg\", \"png\", \"pdf\");\r\n\t\t$temp = explode(\".\", $_FILES[\"uploaded_file\"][\"name\"][$i]);\r\n\t\t$extensions = strtolower(end($temp));\r\n\r\n\t\t$file_type = $_FILES[\"uploaded_file\"][\"type\"][$i];\r\n\t\t\r\n\t\t######################################################\r\n\t\t if (( ($_FILES[\"uploaded_file\"][\"type\"][$i] == \"image/gif\")\r\n || ($_FILES[\"uploaded_file\"][\"type\"][$i] == \"image/jpeg\")\r\n || ($_FILES[\"uploaded_file\"][\"type\"][$i] == \"image/jpg\")\r\n || ($_FILES[\"uploaded_file\"][\"type\"][$i] == \"image/pjpeg\")\r\n || ($_FILES[\"uploaded_file\"][\"type\"][$i] == \"image/x-png\")\r\n || ($_FILES[\"uploaded_file\"][\"type\"][$i] == \"image/png\")\r\n || ($_FILES[\"uploaded_file\"][\"type\"][$i] == \"application/pdf\"))\r\n && in_array($extensions, $allowedExts))\r\n {\r\n\t\t\t\t \r\n\t\t\t\t ######### start uploading file #################\r\n\t\t\t\t\t\t \r\n\t\t\t\t\t\t\t // $categoryName = get_record_for('gallery_category', 'category_name', array('category_id' => $_POST['category_id']));\r\n\t\t\t\t\t\t\t \r\n\t\t\t\t\t\t\t // $new_file_name = time().'_'.$filename;\r\n\t\t\t\t\t\t\t $new_file_name = time().$i.'.'.$extension;\r\n\t\t\t\t\t\t\t \r\n\t\t\t\t\t\t\t // $caption = addslashes($_POST['caption']);\r\n\t\t\t\t\t\t\t // $caption = '';\r\n\t\t\t\t\t\t\t //$sql = 'INSERT INTO gallery_images (category_id, image_file, caption) \r\n\t\t\t\t\t\t\t//\t\t VALUES ('.$_POST['category_id'].', \"'.$new_file_name.'\", \"'.$caption.'\")';\r\n\t\t\t \r\n\t\t\t\t\t\t\t//$foldername =\r\n\t\t\t\t\t\t\t\tif (!file_exists('uploads/'.date(\"Y\").'/'.date(\"M\").'/'.date(\"d\").'/')) {\r\n\t\t\t\t\t\t\t\t\t\tmkdir('uploads/'.date(\"Y\").'/'.date(\"M\").'/'.date(\"d\").'/', 0755, true);\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t$dirpath = 'uploads/'.date(\"Y\").'/'.date(\"M\").'/'.date(\"d\").'/';\r\n\t\t\t\t\t\t\t\t$full_path_file_name = '';\r\n\t\t\t\t\t\t\t\t$full_path_file_name = $dirpath.$new_file_name;\r\n\t\t\t\t\t\t\t\t//echo $full_path_file_name;\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t// if(move_uploaded_file($file['tmp_name'],'images/'.$new_file_name))\r\n\t\t\t\t\t\t\t if(move_uploaded_file($file_tmp_name,$dirpath.$new_file_name))\r\n\t\t\t\t\t\t\t {\r\n\t\t\t\t\t\t//\t\t if(mysql_query($sql))\r\n\t\t\t\t\t\t//\t\t {\r\n\t\t\t\t\t\t\t//echo \"here\";\r\n\t\t\t\t\t\t\t//print_r($dbh);\r\n\t\t\t\t\t\t\t\t\t //unset($_POST);\r\n\t\t\t\t\t\t\t\t\t $sMsg = '<span style=\"color:#090\">Added Sucessfully!</span>';\r\n\t\t\t\t\t\t\t\t\t \r\n\t\t\t\t\t\t\t\t\t \r\n\t\t\t\t\t\t\t\t\t //add image insert query\r\n\t\t\t\t\t\t\t\t\t // $insert_image_query=\"INSERT INTO tbl_images SET img_name='$full_path_file_name',fk_id_tbl_visitors='$fk_id', datetime_created=NOW(),user_ip='$user_ip',fk_visitor_scan_id='$fk_visitor_scan_id'\";\r\n\t\t\t\t\t\t\t\t\t \r\n\t\t\t\t\t\t\t\t\t $insert_image_query=\"INSERT INTO tbl_upl SET name='$full_path_file_name',type='$file_type',fk_id='$fk_id', date_created=NOW(),user_ip='$user_ip'\";\r\n\t\t\t\t\t\t\t\t\t \t//echo $insert_image_query;\r\n\t\t\t\t\t\t \t\t\tmysqli_query($dbh,'SET GLOBAL max_allowed_packet = ' . 500 * 1024 * 1024);\r\n\t\t\t\t\t\t\t\t\t\tmysqli_query($dbh,$insert_image_query) or die (mysqli_query());\r\n\r\n\t\t\t\t\t\t\t\t\t\techo '<div align=\"center\" style=\"color:green\">Uploaded Successfully!</div>';\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//echo \"here\";\r\n\t\t\t\t\t\t\t//exit;\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t//\t\t }\r\n\t\t\t\t\t\t//\t\t else\r\n\t\t\t\t\t\t//\t\t {\r\n\t\t\t\t\t\t//\t\t\t\t\tif(file_exists('../galleryimages/'.$new_file_name))\r\n\t\t\t\t\t\t//\t\t\t\t\t{\r\n\t\t\t\t\t\t//\t\t\t\t\t\tunlink('../galleryimages/'.$new_file_name);\r\n\t\t\t\t\t\t//\t\t\t\t\t}\r\n\t\t\t\t\t\t//\t\t\t\t $sMsg = '<span style=\"color:#F00\">Error on Inserting Record</span>';\r\n\t\t\t\t\t\t//\t\t }\r\n\t\t\t\t\t\t\t }\r\n\t\t\t\t\t\t \r\n\t\t\t\t #####################################################\r\n\t\t\t\t \r\n\t\t\r\n\t//primary id of main table record\r\n\t$p_id =$fk_id;\r\n\r\n\tif($is_edit == 1) //edit document so delete previous document\r\n\t{/*\r\n\t\t$query_upd=\"UPDATE tbl_upl SET is_del='1',date_updated=NOW() WHERE fk_id = '$p_id'\";\r\n\t\tmysql_query($query_upd) or die (mysql_query());*/\r\n\t}\r\n\t\r\n\t\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\techo '<div align=\"center\" style=\"color:green\">Uploaded Successfully!</div>';\r\n\t\t\t\t\t\t\t//exit;\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\r\n\r\n\t}\r\n\telse\r\n\t {\r\n\t\t echo '<div align=\"center\" style=\"color:red\">Invalid file</div>';\r\n\t\t $errors=1;\r\n\t\t //exit;\r\n\t }\r\n\t\t\r\n\t\t/////////////////////////////////////////////\r\n\t\t\r\n\t\t$i++;\r\n\t} // end foreach\r\n}" ]
[ "0.6882793", "0.6560249", "0.6526663", "0.6483253", "0.6466119", "0.64517605", "0.64390635", "0.6427967", "0.6385586", "0.6335953", "0.6330783", "0.62977815", "0.62964517", "0.6263325", "0.6250527", "0.62452656", "0.62222576", "0.619736", "0.6195511", "0.61800766", "0.6173822", "0.61684", "0.6167083", "0.61639977", "0.6159119", "0.61513954", "0.6149343", "0.6149058", "0.6125856", "0.6117409" ]
0.7447558
0
Sets the current image width and height and check if the setted values are allowed Redirects no $Core>pageNotFoundLocation if type, width or height is not allowed
private function setImageDimensions() { global $Core; if ($this->allowedSizes) { if (!isset($this->allowedSizes[$this->sizeType]) || !isset($this->allowedSizes[$this->sizeType][$this->sizeKey])) { $Core->doOrDie(); } else { $this->width = $this->allowedSizes[$this->sizeType][$this->sizeKey]['width']; $this->height = $this->allowedSizes[$this->sizeType][$this->sizeKey]['height']; } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function setOnDemand()\n {\n global $Core;\n\n if (preg_match(\"~^\".$Core->imagesWebDir.\"(width|height)/((?!0)[\\d]+)/((?!0)[\\d]+)/(.*)~\",$_SERVER['REQUEST_URI'] ,$m)) {\n $this->sizeType = $m[1];\n $this->sizeKey = $m[2];\n $this->name = urldecode(mb_substr($m[4], 0, mb_strripos($m[4], '.')));\n $this->currentFolder = $m[1].'/'.$m[2].'/'.$m[3].'/';\n $this->currentFileLocation = urldecode($Core->imagesStorage.$m[3].'/'.$m[4]);\n\n if ($m[1] == 'width') {\n $this->width = $m[2];\n } elseif ($m[1] == 'height') {\n $this->height = $m[2];\n }\n } elseif (preg_match(\"~^\".$Core->imagesWebDir.\"(fixed)/((?!0)[\\d]+-(?!0)[\\d]+)/((?!0)[\\d]+)/(.*)~\",$_SERVER['REQUEST_URI'] ,$m)) {\n $this->sizeType = $m[1];\n $this->sizeKey = $m[2];\n\n $ratio = explode('-', $m[2]);\n $this->width = $ratio[0];\n $this->height = $ratio[1];\n\n $this->name = urldecode(mb_substr($m[4], 0, mb_strripos($m[4], '.')));\n $this->currentFolder = $m[1].'/'.$m[2].'/'.$m[3].'/';\n $this->currentFileLocation = urldecode($Core->imagesStorage.$m[3].'/'.$m[4]);\n } elseif (preg_match(\"~^\".$Core->imagesWebDir.\"(org)/((?!0)[\\d]+)/(.*)~\",$_SERVER['REQUEST_URI'] ,$m)) {\n $this->sizeType = 'org';\n $this->sizeKey = 'org';\n $this->name = urldecode(mb_substr($m[3], 0, mb_strripos($m[3], '.')));\n $this->currentFolder = $m[1].'/'.$m[2].'/';\n $this->currentFileLocation = urldecode($Core->imagesStorage.$m[2].'/'.$m[3]);\n } else {\n //invalid file location or size type\n $Core->doOrDie();\n }\n\n if (!is_file($this->currentFileLocation)) {\n //unexisting file\n $Core->doOrDie();\n }\n\n $this->setImageDimensions();\n }", "private function checkAndGetImageSizeIfNeeded(){\n\t\tif(!($this->imageWidth && $this->imageHeight)){\n\t\t\t$arr = $this->getimagesize(WEBEDITION_PATH . '../' . $this->imagePath);\n\t\t\tif(count($arr) >= 2){\n\t\t\t\t$this->imageWidth = $arr[0];\n\t\t\t\t$this->imageHeight = $arr[1];\n\t\t\t}\n\t\t}\n\t}", "public function setImagePage ($width, $height, $x, $y) {}", "protected function setImageRequiredSize()\n\t{\n\t\t//Set image maximum size\n\t\tif(!empty($this->rules['DimensionSize']['height']))\n\t\t{\t\n\t\t\t$this->imageHeight = (int) $this->rules['DimensionSize']['height'];\n\t\t}\n\t\t//Set image minimum size\n\t\tif(!empty($this->rules['DimensionSize']['width']))\n\t\t{\t\n\t\t\t$this->imageWidth = (int) $this->rules['DimensionSize']['width'];\n\t\t}\n\t}", "public function setImagePage($width, $height, $x, $y) {\n\t}", "public function checkImageDimensions()\n\t{\n\t\t//Get image diamentions\n\t\t$imageDimensions = $this->getImageDimensions();\n\n\t\tif($imageDimensions[0] == $this->imageHeight and $imageDimensions[1] == $this->imageWidth)\n\t\t{\n\t\t\t//Image size restricted \n\t\t\treturn true;\n\t\t}\n\t\telseif( (($this->imageHeight == null) and $imageDimensions[0] > 0) and (($this->imageWidth == null) and $imageDimensions[1] > 0) )\n\t\t{\n\t\t\t//Any size image but the image must have diamentions\n\t\t\treturn true;\n\t\t}\n\t\telseif( (($this->imageHeight != null) and $imageDimensions[0] == $this->imageHeight) and $imageDimensions[1] > 0)\n\t\t{\n\t\t\t//Validate just image height width just needs to have any dimentions\n\t\t\treturn true;\n\t\t}\n\t\telseif( (($this->imageWidth != null) and $imageDimensions[1] == $this->imageWidth) and $imageDimensions[0] > 0)\n\t\t{\n\t\t\t//Validate just image width, height just needs to have any dimentions\n\t\t\treturn true;\n\t\t}\n\n\t\treturn false;\n\t}", "private function prepara_propriedade_image() \r\n {\r\n $types = array(1 => 'gif', 2 => 'jpeg', 3 => 'png');\r\n\r\n $_INFO = @getimagesize($this->url_imagem);\r\n \r\n $this->width_original = $_INFO[0];\r\n $this->height_original = $_INFO[1];\r\n\r\n $this->mime_type = $_INFO['mime'];\r\n $this->imagem_type = $types[ $_INFO[2] ];\r\n }", "public function setImageSize() {\r\t\t//enforce image size requirements in megabytes\r\t\tif($_FILES[\"fileToUpload\"][\"size\"] > 500000) {\r\t\t\techo \"Sorry, your file is too large.\";\r\t\t}\r\t\treturn ($this->imageSize);\r\t}", "private function validateImageSize() {\n\n if (!$this->image->getSize()) {\n\n $this->errors[] = $this->image->getClientOriginalName() . ' had 0 size';\n $this->is_ok = null;\n return;\n }\n\n if (isset($this->options['max_image_size'])) {\n $max_image_size = $this->options['max_image_size'];\n } elseif (isset($this->config['max_image_size'])) {\n $max_image_size = $this->config['max_image_size'];\n } else {\n $max_image_size = 1;\n }\n\n $image_size = $this->image->getSize() / 1024 / 1024;\n\n if ($image_size > $max_image_size) {\n $this->errors[] = $this->image->getClientOriginalName() . ' is bigger than allowed image size';\n $this->is_ok = null;\n }\n }", "protected function _validates()\n {\n // Verifica que se pueda escribir en el directorio\n if (!is_writable($this->_path)) {\n Flash::error('Error: no se puede escribir en el directorio');\n return FALSE;\n }\n\n\n $image = $this->_imgInfo;\n // Verifica que sea un archivo de imagen\n if (!$image){\n Flash::error('Error: el archivo debe ser una imagen');\n return FALSE;\n }\n\n // Verifica ancho minimo de la imagen\n if ($this->_minWidth !== NULL) {\n if ($image[0] < $this->_minWidth) {\n Flash::error(\"Error: el ancho de la imagen debe ser superior o igual a {$this->_minWidth}px\");\n return FALSE;\n }\n }\n\n // Verifica ancho maximo de la imagen\n if ($this->_maxWidth !== NULL) {\n if ($image[0] > $this->_maxWidth) {\n Flash::error(\"Error: el ancho de la imagen debe ser inferior o igual a {$this->_maxWidth}px\");\n return FALSE;\n }\n }\n\n // Verifica alto minimo de la imagen\n if ($this->_minHeight !== NULL) {\n if ($image[1] < $this->_minHeight) {\n Flash::error(\"Error: el alto de la imagen debe ser superior o igual a {$this->_minHeight}px\");\n return FALSE;\n }\n }\n\n // Verifica alto maximo de la imagen\n if ($this->_maxHeight !== NULL) {\n if ($image[1] > $this->_maxHeight) {\n Flash::error(\"Error: el alto de la imagen debe ser inferior o igual a {$this->_maxHeight}px\");\n return FALSE;\n }\n }\n\n // Validaciones\n return parent::_validates();\n }", "public function setvar($imagesize=array()){\n if(is_numeric($imagesize['maxwidth']))\n $this -> maxwidth = $imagesize['maxwidth'];\n if(is_numeric($imagesize['maxheight']))\n $this -> maxheight = $imagesize['maxheight'];\n if(is_numeric($imagesize['setwidth'])) \n $this -> setwidth= $imagesize['setwidth']; \n }", "public function set_defltimage() {\n $sess = $this->session->all_userdata();\n $content_id = @$_GET['cid'];\n $file_id = @$_GET['fid'];\n $redirect_url = @$_GET['redirect_url'];\n $result = $this->Ads_model->setDefaultImg($content_id, $file_id);\n $msg = $this->loadPo($this->config->item('success_default_image_set'));\n $this->log($this->user, $msg);\n $this->session->set_flashdata('message', $this->_successmsg($msg));\n redirect($redirect_url);\n }", "function setSize()\n\t\t{\t\n\t\t\t$ratio_image=$this->imageSizeX/$this->imageSizeY;\n\t\t\t$ratio=$this->reduction_width/$this->reduction_height;\n\t\t\tif($ratio_image<$ratio)\n\t\t\t{\n\t\t\t $ratio_image=$this->imageSizeX/$this->imageSizeY;\n\t\t\t $this->resizeY=$this->reduction_height;\n\t\t\t $this->resizeX=round($ratio_image*$this->resizeY);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t $ratio_image=$this->imageSizeY/$this->imageSizeX;\n\t\t\t $this->resizeX=$this->reduction_width;\n\t\t\t $this->resizeY=round($ratio_image*$this->resizeX);\n\t\t\t}\n\t\t\n /*if($this->imageSizeY<$this->imageSizeX){\n $ratio=$this->imageSizeY/$this->imageSizeX;\n $this->resizeX=$this->reduction_width;\n $this->resizeY=round($ratio*$this->reduction_width);\n }else{\n $ratio=$this->imageSizeX/$this->imageSizeY;\n $this->resizeY=$this->reduction_height;\n $this->resizeX=round($ratio*$this->reduction_height);\n }*/\n }", "function do_dynamic_images()\n\t{\n\t\t//-----------------------------------------\n\t\t// Update the setting...\n\t\t//-----------------------------------------\n\n\t\t$this->update_setting( 'allow_dynamic_img', $this->ipsclass->vars['allow_dynamic_img'] ? 0 : 1 );\n\n\t\t//-----------------------------------------\n\t\t// Done..\n\t\t//-----------------------------------------\n\n\t\t$lang = $this->ipsclass->vars['allow_dynamic_img'] == 0 ? 'запрещены' : 'разрешены';\n\n\t\t$this->ipsclass->main_msg = \"Динамические изобаржения {$lang}.\";\n\t\t$this->security_overview();\n\t}", "function getSize(){\n $imgParams=getimagesize($this->fileName);\n $this->imageSizeX=$imgParams[0];\n $this->imageSizeY=$imgParams[1];\n \n switch($imgParams[2]){\n case 1:\n $this->imageType=\"gif\";\n $this->image = imagecreatefromgif($this->fileName);\n break;\n\n case 2:\n $this->imageType=\"jpg\";\n $this->image = imagecreatefromjpeg($this->fileName);\n break;\n \n case 3:\n $this->imageType=\"png\";\n $this->image = imagecreatefrompng($this->fileName);\n break;\n \n default:\n $this->errorState(1);\n }\n \n }", "public function set_dimensions($width, $height) {\n if (!is_int($width)) $this->set_error(\"You must specify an integer for width\");\n if (!is_int($height)) $this->set_error(\"You must specify an integer for height\");\n if ($this->haserror) {\n return false;\n }\n $this->imagewidth = $width;\n $this->imageheight = $height;\n return true;\n }", "public function getImageResolution () {}", "private function valid()\n {\n if (isset($this->_imageTypes[$this->_size['mime']])) {\n return true;\n } else {\n return false;\n }\n }", "function register_image_sizes(){\n // Defined in CMS\n // thumbnail - 150, 150, true\n // medium - 300, 300, false\n // large - 1024, 1024, false\n \n // Additional sizes\n // FORCE CROP\n add_image_size('slider', 1400, 586, true);\n add_image_size('column', 437, 350, true);\n add_image_size('event', 130, 130, true);\n add_image_size('lightbox-preview-hor', 300, 225, true);\n add_image_size('lightbox-preview-ver', 225, 300, true);\n \n // NO CROP\n // add_image_size('poster', 1000, 500, false);\n // add_image_size('content', 1000, 1000, false);\n }", "public function initContent()\n {\n header('HTTP/1.1 404 Not Found');\n header('Status: 404 Not Found');\n\n if (preg_match('/\\.(gif|jpe?g|png|ico)$/i', parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH))) {\n $this->context->cookie->disallowWriting();\n if (!isset($_SERVER['REDIRECT_URL'])) {\n $_SERVER['REDIRECT_URL'] = '';\n if (preg_match('@^'.__PS_BASE_URI__.'([0-9]+)\\-([_a-zA-Z0-9-]+)(/[_a-zA-Z0-9-]+)?\\.jpg$@', $_SERVER['REQUEST_URI'], $matches)) {\n $_SERVER['REDIRECT_URL'] = __PS_BASE_URI__.'p/'.Image::getImgFolderStatic($matches[0]).'/'.$matches[0].'-'.$matches[1].'.jpg';\n }\n }\n if (preg_match('#/p[0-9/]*/([0-9]+)\\-([_a-zA-Z]*)\\.(png|jpe?g|gif)$#', $_SERVER['REDIRECT_URL'], $matches)) {\n // Backward compatibility since we suffixed the template image with _default\n if (Tools::strtolower(substr($matches[2], -8)) != '_default') {\n header('Location: '.$this->context->link->getImageLink('', $matches[1], $matches[2]), true, 302);\n exit;\n } else {\n $image_type = ImageType::getByNameNType($matches[2], 'products');\n if ($image_type && count($image_type)) {\n $root = _PS_PROD_IMG_DIR_;\n $folder = Image::getImgFolderStatic($matches[1]);\n $file = $matches[1];\n $ext = '.'.$matches[3];\n\n if (file_exists($root.$folder.$file.$ext)) {\n if (ImageManager::resize($root.$folder.$file.$ext, $root.$folder.$file.'-'.$matches[2].$ext, (int)$image_type['width'], (int)$image_type['height'])) {\n header('HTTP/1.1 200 Found');\n header('Status: 200 Found');\n header('Content-Type: image/jpg');\n readfile($root.$folder.$file.'-'.$matches[2].$ext);\n exit;\n }\n }\n }\n }\n } elseif (preg_match('#/c/([0-9]+)\\-([_a-zA-Z]*)\\.(png|jpe?g|gif)$#', $_SERVER['REDIRECT_URL'], $matches)) {\n $image_type = ImageType::getByNameNType($matches[2], 'categories');\n if ($image_type && count($image_type)) {\n $root = _PS_CAT_IMG_DIR_;\n $file = $matches[1];\n $ext = '.'.$matches[3];\n\n if (file_exists($root.$file.$ext)) {\n if (ImageManager::resize($root.$file.$ext, $root.$file.'-'.$matches[2].$ext, (int)$image_type['width'], (int)$image_type['height'])) {\n header('HTTP/1.1 200 Found');\n header('Status: 200 Found');\n header('Content-Type: image/jpg');\n readfile($root.$file.'-'.$matches[2].$ext);\n exit;\n }\n }\n }\n }\n\n header('Content-Type: image/gif');\n readfile(_PS_IMG_DIR_.'404.gif');\n exit;\n } elseif (in_array(Tools::strtolower(substr($_SERVER['REQUEST_URI'], -3)), array('.js', 'css'))) {\n $this->context->cookie->disallowWriting();\n exit;\n }\n\n parent::initContent();\n\n $this->setTemplate(_PS_THEME_DIR_.'404.tpl');\n }", "function setImage($image) {\n\t\tif(file_exists($image) && is_file($image)) {\n\t\t\t$this->imageInfo = getimagesize($image);\n\t\t\t$img_mime = strtolower($this->imageInfo['mime']);\n\t\t\tif(!in_array($img_mime, $this->enableTypes)) {\n\t\t\t\texit('系统不能操作这种图片类型.');\n\t\t\t}\n\t\t\tswitch ($img_mime) {\n\t\t\t\tcase 'image/gif':\n\t\t\t\t\t$link = imagecreatefromgif($image);\n\t\t\t\t\t$this->createFunc = 'imagegif';\n\t\t\t\t\t$this->imageType = 'gif';\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'image/jpeg':\n\t\t\t\tcase 'image/jpg':\n\t\t\t\t\t$link = imagecreatefromjpeg($image);\n\t\t\t\t\t$this->createFunc = 'imagejpeg';\n\t\t\t\t\t$this->imageType = 'jpeg';\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'image/png':\n\t\t\t\t\t$link = imagecreatefrompng($image);\n\t\t\t\t\t$this->createFunc = 'imagepng';\n\t\t\t\t\t$this->imageType = 'png';\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\t$link = 'unknow';\n\t\t\t\t\t$this->imageType = 'unknow';\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif($link !== 'unknow') {\n\t\t\t\t$this->imageResource = $link;\n\t\t\t} else {\n\t\t\t\texit('这种图片类型不能改变尺寸.');\n\t\t\t}\n\t\t\tunset($link);\n\t\t\treturn true;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}", "function crop_thumb() {\n $this->data['welcome'] = $this;\n $thumb_imgName = $_REQUEST['thumb_imgName'];\n $content_id = $_REQUEST['content_id'];\n $redirect_url = $_REQUEST['redirect_url'];\n $fileExt = $this->_getFileExtension($thumb_imgName);\n $fileUniqueName = uniqid() . \".\" . $fileExt;\n $fileDestPath = REAL_PATH . serverImageRelPath . $fileUniqueName;\n $targ_w = $targ_h = 170;\n $jpeg_quality = 90;\n $fileSrcPath = REAL_PATH . serverImageRelPath . $thumb_imgName;\n\n switch ($fileExt) {\n case \"1\":\n $imageType = 'image/gif';\n $img_r = imagecreatefromgif($fileSrcPath);\n $dst_r = ImageCreateTrueColor($targ_w, $targ_h);\n imagecopyresampled($dst_r, $img_r, 0, 0, $_POST['x'], $_POST['y'], $targ_w, $targ_h, $_POST['w'], $_POST['h']);\n header('Content-type: image/gif');\n imagegif($dst_r, $fileDestPath, $jpeg_quality);\n break;\n case \"2\":\n $imageType = 'image/jpg';\n $img_r = imagecreatefromjpeg($fileSrcPath);\n $dst_r = ImageCreateTrueColor($targ_w, $targ_h);\n imagecopyresampled($dst_r, $img_r, 0, 0, $_POST['x'], $_POST['y'], $targ_w, $targ_h, $_POST['w'], $_POST['h']);\n header('Content-type: image/jpeg');\n imagejpeg($dst_r, $fileDestPath, $jpeg_quality);\n break;\n case \"3\":\n $imageType = 'image/png';\n $img_r = imagecreatefrompng($fileSrcPath);\n $dst_r = ImageCreateTrueColor($targ_w, $targ_h);\n imagecopyresampled($dst_r, $img_r, 0, 0, $_POST['x'], $_POST['y'], $targ_w, $targ_h, $_POST['w'], $_POST['h']);\n header('Content-type: image/png');\n imagepng($dst_r, $fileDestPath, $jpeg_quality);\n break;\n case \"3\":\n $imageType = 'image/jpeg';\n $img_r = imagecreatefromjpeg($fileSrcPath);\n $dst_r = ImageCreateTrueColor($targ_w, $targ_h);\n imagecopyresampled($dst_r, $img_r, 0, 0, $_POST['x'], $_POST['y'], $targ_w, $targ_h, $_POST['w'], $_POST['h']);\n header('Content-type: image/jpeg');\n imagejpeg($dst_r, $fileDestPath, $jpeg_quality);\n break;\n }\n $result = $this->_upload($fileSrcPath, $fileUniqueName, 'thumb');\n if ($result) {\n $type = 'thumbnail';\n $fileData = array();\n $fileData['content_id'] = $content_id;\n $fileData['filename'] = $fileUniqueName;\n $fileData['type'] = $type;\n $fileData['minetype'] = $imageType;\n $fileData['width'] = $targ_w;\n $fileData['height'] = $targ_h;\n $fileData['relative_path'] = serverImageRelPath . $fileUniqueName;\n $fileData['absolute_path'] = REAL_PATH . serverImageRelPath . $fileUniqueName;\n $fileData['status'] = '0';\n $fileData['uid'] = $this->uid;\n $fileData['created'] = date('Y-m-d');\n $data_postThumb = @serialize($fileData);\n $data_thumb = base64_encode($data_postThumb);\n $fileData['info'] = $data_thumb;\n\n $file_id = $this->videos_model->_saveThumb($fileData);\n $msg = $this->loadPo($this->config->item('success_image_crop'));\n $this->log($this->user, $msg);\n $this->session->set_flashdata('message', $this->_successmsg($msg));\n } else {\n $msg = $this->loadPo($this->config->item('error_file_upload'));\n $this->log($this->user, $msg);\n $this->data['message'] = $msg;\n $this->show_ads_view('videoEditThumbnail', $this->data);\n }\n redirect($redirect_url);\n }", "public function resize($url,$width=null,$height=null){\n \n if ($height!=null){\n $heightSet=\"&h=\".$height.\"\"; \n }\n return \"\".SERVER_URL.\"system_files/modules/resizer/imgresize?src=\".$url.\"&w=\".$width.\"\".$heightSet.\"&zc=1&a=t\";\n}", "function verify($name){\n\t\t$this->link = strip_tags($this->link);\t\t\n\t\tif($this->checkfilesize()){\n\t\t\ttry{\n\t\t\t\t$size = getimagesize($this->link);\n\t\t\t\tif($size[\"mime\"]=='image/gif'){\n\t\t\t\t\t$this->save($name,'.gif');\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t\telseif($size[\"mime\"]=='image/jpeg'){\n\t\t\t\t\t$this->save($name,'.jpg');\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t\telseif($size[\"mime\"]=='image/png'){\n\t\t\t\t\t$this->save($name,'.png');\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t\telse\treturn false;\n\t\t\t}\n\t\t\tcatch (Exception $e)\treturn false;\n\t\t}\n\t\telse{\n\t\t\techo '<br><b>File size is greater than 6mb</b>';\n\t\t\treturn false;\n\t\t}\t\t\n\t}\n\n\t//This returns the \"width height\" of the image to be displayed.\n\tfunction getw_h(){\n\t\t$size = getimagesize($this->link);\n\t\t$width = $size[0];\n\t\t$height = $size[1];\n\t\t$allowed_W = 450;\n\t\t$allowed_H = 400;\n\t\t//This will always keep the image ratio within the max allowed size!\n\t\tif($width>$height)\n\t\t\treturn ($allowed_W.\" \".intval($allowed_W*($height/$width)));\n \telseif($height>$width)\n\t\t\treturn (intval($allowed_H*($width/$height)).\" \".$allowed_H);\n\t\telse\n\t\t\treturn ('400'.\" \".$allowed_H);\n\t}\n}", "public function getImageResolution() {\n\t}", "function do_dynamic_images()\n\t{\n\t\t//-----------------------------------------\n\t\t// Update the setting...\n\t\t//-----------------------------------------\n\t\t\n\t\t$this->update_setting( 'allow_dynamic_img', $this->ipsclass->vars['allow_dynamic_img'] ? 0 : 1 );\n\t\t\n\t\t//-----------------------------------------\n\t\t// Done..\n\t\t//-----------------------------------------\n\t\t\n\t\t$lang = $this->ipsclass->vars['allow_dynamic_img'] == 0 ? 'disabled' : 'enabled';\n\t\t\n\t\t$this->ipsclass->main_msg = \"Dynamic images {$lang}\";\n\t\t$this->security_overview();\n\t}", "public function test_image_size_method_with_nonexistent_image()\n {\n $result = $this->website_object->image_size(\n 'https://www.example.com/elephpant.png'\n );\n\n $this->assertFalse($result);\n $this->assertInternalType('bool', $result);\n }", "function autoSize()\n {\n $size = getimagesize(ASCMS_DOCUMENT_ROOT.'/'.$this->path);\n if ($size && $size[0] && $size[1]) {\n $this->width = $size[0];\n $this->height = $size[1];\n return true;\n }\n return false;\n }", "public function images_custom_validation(){\n\t\t\n\t\t$error = 0;\n\t\t# CUSTOM VALIDATIONS\n\t\tif($this->data['Video']['interval'] < 1){\n\t\t\t $this->validationErrors['interval'] = 'Interval should be selected!';\n\t\t\t $error = 1; \t \n\t\t}else if(!is_dir(PROCESS_DIR . $this->data['Video']['hash'])){\n\t\t\t $this->validationErrors['type'] = 'Upload images for processing!';\n\t\t\t $error = 1; \n\t\t}else if($this->dir_is_empty(PROCESS_DIR . $this->data['Video']['hash'])){\n\t\t\t $this->validationErrors['type'] = 'Upload images for processing!';\n\t\t\t $error = 1; \n\t\t}\n\t\treturn $error;\n\t}", "function ImageHandler(){\n\t\t$this->TipoImg = '';\n\t\t$this->ImgResource = null;\n\t}" ]
[ "0.6338882", "0.6228766", "0.6185036", "0.61175185", "0.5805673", "0.5501705", "0.55004317", "0.5467897", "0.5441195", "0.541551", "0.53668386", "0.5336566", "0.53169715", "0.53133565", "0.5298594", "0.5264005", "0.523934", "0.5221172", "0.5188907", "0.51840955", "0.5182557", "0.5176524", "0.5171148", "0.5153539", "0.5144924", "0.51328456", "0.5129245", "0.5113124", "0.5094075", "0.50821555" ]
0.6776982
0
Checks if watermark is required
private function isWatermarkRequired() { if($this->getAll(0, "`hash` = '{$this->orgMd5}' AND `org` = 1 AND `watermark` = 1")) { return true; } return false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function removeWatermark();", "function addpngwatermark(){\n\n\t\tif(file_exists($this->Watermarkpng)){\n\t\t\t$this->newimage = imagecreatefrompng($this->Watermarkpng);\n\t\t\t$wpos = explode(' ', str_replace('%', '', $this->Watermarkposition));\n\t\t\timagecopymerge($this->im, $this->newimage, min(max(imagesx($this->im) * ($wpos[0] / 100) - 0.5 * imagesx($this->newimage), 0), imagesx($this->im) - imagesx($this->newimage)), min(max(imagesy($this->im) * ($wpos[1] / 100) - 0.5 * imagesy($this->newimage), 0), imagesy($this->im) - imagesy($this->newimage)), 0, 0, imagesx($this->newimage), imagesy($this->newimage), intval($this->Watermarktransparency));\n\t\t\timagedestroy($this->newimage);\n\t\t}\n\n\t}", "function createWatermarks(){\n\ttry {\n\t\t$watermark = new Watermark(null, null, null, null, null, null, null, null);\n\n\t\t// ** Define the parent container for the watermark\t\t\n\t\t$watermark->StartPage = 1; \n\t\t$watermark->EndPage = 1; \n\t\t$watermark->Rotation = \"0\"; \n\t\t$watermark->Width = \"500\"; \n\t\t$watermark->Height = \"500\"; \n\t\t$watermark->HPosition = HPosition::Center; \n\t\t$watermark->VPosition = VPosition::Middle; \n\t\t// ** Display the watermark in the foreground so it is even displayed \n\t\t// ** for scans with a white, non-transparent, background.\n\t\t$watermark->ZOrder = 1;\n\t\t\n\t\t// ** Create a simple text based watermark, this will be placed inside the parent container\n\t\t$cfText = new Text(null, null, null, null);\n\t\t$cfText->Content = \"Confidential\"; \n\t\t$cfText->FontSize = \"20\"; \n\t\t$cfText->Rotation = \"-45\"; \n\t\t$cfText->HPosition = HPosition::Left; \n\t\t$cfText->VPosition = VPosition::Middle; \n\t\t$cfText->Width = \"200\"; \n\t\t$cfText->Height = \"200\"; \n\t\t$cfText->Transparency = \"0.10\";\n\t\t$cfText->ZOrder = 0.1;\n\n\t\t// ** Create a simple QR Code based watermark, this will also be placed in the parent container\n\t\t$cfQR = new QRCode(null, null, null);\n\t\t$cfQR->Text = \"http://www.muhimbi.com/\";\n\t\t$cfQR->ErrorCorrectionLevel = ErrorCorrectionLevel::Low;\n\t\t$cfQR->InputMode = BarcodeInputMode::Binary;\n\t\t$cfQR->Version = QRCodeVersion::Auto;\n\t\t$cfQR->HPosition = HPosition::Right; \n\t\t$cfQR->VPosition = VPosition::Middle; \n\t\t$cfQR->Width = \"200\"; \n\t\t$cfQR->Height = \"200\"; \n\t\t\n\t\t// ** Create a simple Linear Barcode watermark\n\t\t$cfLB = new LinearBarcode(null, null, null, null, null, null, null);\n\t\t$cfLB->Text = \"012345678\";\n\t\t$cfLB->BarcodeType = BarcodeType::Code39;\n\t\t$cfLB->HPosition = HPosition::Center; \n\t\t$cfLB->VPosition = VPosition::Bottom; \n\t\t$cfLB->Width = \"200\"; \n\t\t$cfLB->Height = \"50\";\n\t\t\n\t\t// ** Add the individual watermarks to the container\n\t\t$elements = array($cfText, $cfQR, $cfLB);\t\n\t\t$watermark->Elements = $elements;\n\t\t\n\t\treturn array($watermark);\n\t} catch (Exception $e) \t{\n\t\tthrow new Exception($e->getMessage());\n\t}\t\n\t\n}", "protected function perform(): ?bool\n {\n $image = $this->imagine->open($this->file->path());\n\n if (! ($watermark = $this->getWatermarkImage())) {\n return false;\n }\n\n $imageSize = $image->getSize();\n $watermarkSize = $watermark->getSize();\n\n // Calculate the placement of the watermark (we're aiming for the bottom right corner here).\n\n // Place the image in the correct position\n switch ($this->getWatermarkPosition()) {\n case static::POSITION_TOP_LEFT:\n $position = new Point(0, 0);\n break;\n\n case static::POSITION_TOP_RIGHT:\n $position = new Point(\n $imageSize->getWidth() - $watermarkSize->getWidth(),\n 0\n );\n break;\n\n case static::POSITION_BOTTOM_LEFT:\n $position = new Point(\n 0,\n $imageSize->getHeight() - $watermarkSize->getHeight()\n );\n break;\n\n case static::POSITION_CENTER;\n $position = new Point(\n ((int) round($imageSize->getWidth() / 2)) - ((int) round($watermarkSize->getWidth() / 2)),\n ((int) round($imageSize->getHeight() / 2)) - ((int) round($watermarkSize->getHeight() / 2))\n );\n break;\n\n case static::POSITION_BOTTOM_RIGHT:\n default:\n $position = new Point(\n $imageSize->getWidth() - $watermarkSize->getWidth(),\n $imageSize->getHeight() - $watermarkSize->getHeight()\n );\n }\n\n $image->paste($watermark, $position);\n $image->save();\n\n return true;\n }", "function watermark($image, $mimeType, $imgWidth, $imgHeight, $watermark, $watermarkHeight, $watermarkWidth, $position = \"center\")\n{\n switch ($position) {\n case \"center\":\n $marginBottom = round($imgHeight / 2);\n $marginRight = round($imgWidth / 2) - round($watermarkWidth / 2);\n break;\n\n case \"top-left\":\n $marginBottom = round($imgHeight - $watermarkHeight);\n $marginRight = round($imgWidth - $watermarkWidth);\n break;\n\n case \"bottom-left\":\n $marginBottom = 5;\n $marginRight = round($imgWidth - $watermarkWidth);\n break;\n\n case \"top-right\":\n $marginBottom = round($imgHeight - $watermarkHeight);\n $marginRight = 5;\n break;\n\n default:\n $marginBottom = 2;\n $marginRight = 2;\n break;\n }\n\n\n $watermark = imagecreatefrompng($watermark);\n\n switch ($mimeType) {\n case \"jpeg\":\n case \"jpg\":\n $createImage = imagecreatefromjpeg($image);\n break;\n\n case \"png\":\n $createImage = imagecreatefrompng($image);\n break;\n\n case \"gif\":\n $createImage = imagecreatefromgif($image);\n break;\n\n default:\n $createImage = imagecreatefromjpeg($image);\n break;\n }\n\n $sx = imagesx($watermark);\n $sy = imagesy($watermark);\n imagecopy(\n $createImage,\n $watermark,\n imagesx($createImage) - $sx - $marginRight,\n imagesy($createImage) - $sy - $marginBottom,\n 0,\n 0,\n imagesx($watermark),\n imagesy($watermark)\n );\n\n\n switch ($mimeType) {\n case \"jpeg\":\n case \"jpg\":\n imagejpeg($createImage, $image);\n break;\n\n case \"png\":\n imagepng($createImage, $image);\n break;\n\n case \"gif\":\n imagegif($createImage, $image);\n break;\n\n default:\n throw new \\Exception(\"A watermark can only be applied to: jpeg, jpg, gif, png images \");\n break;\n }\n}", "protected function hasRequiredData() {\n return $this->Context->activity()->elevation() > 0;\n\t}", "protected function hasPlaceholderImage()\n {\n return ($this->placeholder && null !== FilesModel::findByPk($this->placeholder));\n }", "protected function _getWatermarkFilePath()\n {\n $file = $this->_getFullMediaPath() . $this->getWatermarkFile();\n return file_exists($file) ? $file : false;\n }", "private function setWaterMark() {\n\n if (isset($this->options['water_mark_image'])) {\n $this->water_mark_image = $this->options['water_mark_image'];\n } else {\n $this->water_mark_image = $this->config['water_mark_image'];\n }\n\n if (isset($this->options['water_mark_position'])) {\n $this->water_mark_position = $this->options['water_mark_position'];\n } elseif (isset($this->config['water_mark_position'])) {\n $this->water_mark_position = $this->config['water_mark_position'];\n } else {\n $this->water_mark_position = 'top-center';\n }\n }", "public function valid()\n {\n\n if ($this->container['image_file'] === null) {\n return false;\n }\n if (strlen($this->container['image_file']) < 1) {\n return false;\n }\n return true;\n }", "function watermark_image($target, $wtrmrk_file, $newcopy) {\n $watermark = imagecreatefrompng($wtrmrk_file);\n imagealphablending($watermark, false);\n imagesavealpha($watermark, true);\n $wtrmrk_w = imagesx($watermark);\n $wtrmrk_h = imagesy($watermark);\n\n $info = getimagesize($target);\n $ext = $info['mime'];\n\n\n switch( $ext ){\n case 'image/jpeg':\n $img = imagecreatefromjpeg($target);\n $img_w = imagesx($img);\n $img_h = imagesy($img);\n $dst_x = ($img_w / 1) - ($wtrmrk_w / 1); // For centering the watermark on any image\n $dst_y = ($img_h / 1) - ($wtrmrk_h / 1); // For centering the watermark on any image\n imagecopy($img, $watermark, $dst_x, $dst_y, 0, 0, $wtrmrk_w, $wtrmrk_h);\n imagejpeg($img, $newcopy, 100);\n imagedestroy($img);\n imagedestroy($watermark);\n break;\n\n case 'image/png':\n $img = imagecreatefrompng($target);\n $img_w = imagesx($img);\n $img_h = imagesy($img);\n $dst_x = ($img_w / 1) - ($wtrmrk_w / 1); // For centering the watermark on any image\n $dst_y = ($img_h / 1) - ($wtrmrk_h / 1); // For centering the watermark on any image\n imagecopy($img, $watermark, $dst_x, $dst_y, 0, 0, $wtrmrk_w, $wtrmrk_h);\n imagepng($img, $newcopy, 5);\n imagedestroy($img);\n imagedestroy($watermark);\n break;\n }\n}", "public function add(Watermark $watermark);", "public function isExternal();", "function check()\n\t{\n\t\tif ( ! $this->path )\n\t\t{\n\t\t\t$this->setError( JText::_('Please specify the directory path and file name of the image.') );\n\t\t\treturn false;\n\t\t}\n\n\t\tif ( ! $this->title )\n\t\t{\n\t\t\t$this->setError( JText::_('Please specify a title for this image.') );\n\t\t\treturn false;\n\t\t}\n\n\t\t// if ( ! $this->description )\n\t\t// {\n\t\t// \t$this->setError( JText::_('Please supply a description of the image.') );\n\t\t// \treturn false;\n\t\t// }\n\n\t\treturn true;\n\t}", "protected function _getWatermarkFilePath()\n {\n $filePath = false;\n\n if (!$file = $this->getWatermarkFile()) {\n return $filePath;\n }\n\n $baseDir = Mage::getSingleton('xmlconnect/catalog_category_media_config')->getBaseMediaPath();\n\n if (file_exists($baseDir . '/watermark/stores/' . Mage::app()->getStore()->getId() . $file)) {\n $filePath = $baseDir . '/watermark/stores/' . Mage::app()->getStore()->getId() . $file;\n } elseif (file_exists($baseDir . '/watermark/websites/' . Mage::app()->getWebsite()->getId() . $file)) {\n $filePath = $baseDir . '/watermark/websites/' . Mage::app()->getWebsite()->getId() . $file;\n } elseif (file_exists($baseDir . '/watermark/default/' . $file)) {\n $filePath = $baseDir . '/watermark/default/' . $file;\n } elseif (file_exists($baseDir . '/watermark/' . $file)) {\n $filePath = $baseDir . '/watermark/' . $file;\n } else {\n $baseDir = Mage::getDesign()->getSkinBaseDir();\n if (file_exists($baseDir . $file)) {\n $filePath = $baseDir . $file;\n }\n }\n\n return $filePath;\n }", "function loadWatermarkHooks()\n{\n add_integration_function('integrate_admin_areas', 'addWatermarkAdminArea', false);\n add_integration_function('integrate_modify_modifications', 'addWatermarkAdminAction', false);\n add_integration_function('integrate_menu_buttons', 'addWatermarkCopyright', false);\n}", "public function validateExternal() {\n\t\t\t$this->setSize($this->target);\n\t\t\ttry {\n\t\t\t\tif($this->fileType == 'image') $this->checkReal();\n\t\t\t\t$this->checkType();\n\t\t\t\t$this->checkSize();\n\t\t\t} catch(Exception $e) {\n\t\t\t\t$this->delete($this->target); // File is invalid - delete.\n\t\t\t\treturn $e->getMessage();\n\t\t\t}\n\t\t\treturn true;\n\t\t}", "function createImageWithWatermark($source, $destination, $type, $watermark) {\n // load source file\n if ($type === \"jpg\") {\n $orig_image = imagecreatefromjpeg($source);\n }\n elseif ($type === \"png\") {\n $orig_image = imagecreatefrompng($source);\n }\n else {\n return;\n }\n\n // get original size and set size for thumbnail\n $orig_width = imagesx($orig_image);\n $orig_height = imagesy($orig_image);\n $fontSize = $orig_width/20;\n $fontPath = \"static/fonts/watermark.ttf\";\n\n //get size of text, to get center coordinate on image\n $textCoords=imagettfbbox($fontSize , -45 , $fontPath , $watermark );\n\n $mark_width = $textCoords[4] - $textCoords[6] + 20;\n $mark_height = $textCoords[1] - $textCoords[7] + 5;\n\n $textcolor = imagecolorallocatealpha($orig_image, 100, 100, 100, 48);\n imagettftext($orig_image, $fontSize, -45, $orig_width - $mark_width, $mark_height, $textcolor, $fontPath, $watermark);\n\n imagejpeg($orig_image, $destination);\n\n imagedestroy($orig_image);\n}", "public function addWatermark( $path, $xInc=0, $yInc=16 ){\n\t\tif ( !file_exists( $path ) ) return false;\n\t\t$watermark = imagecreatefrompng( $path );\n\t\t$width = imagesx( $watermark ); \n\t\t$height = imagesy( $watermark ); \n\t\t$x = $this->width - $width + $xInc;\n\t\t$y = $this->height - $height + $yInc; \n\t\timagecopy( $this->src, $watermark, $x, $y, 0, 0, $width, $height );\n\t\timagedestroy( $watermark ); \n\t\treturn true; \n\t}", "function validate_upload(DocumentInfo $doc) {\n return true;\n }", "function textwatermark($src, $watermark, $save=NULL) { \n list($width, $height) = getimagesize($src);\n $image_p = imagecreatetruecolor($width, $height);\n $image = imagecreatefromjpeg($src);\n imagecopyresampled($image_p, $image, 0, 0, 0, 0, $width, $height, $width, $height); \n// $txtcolor = imagecolorallocate($image_p, 200, 255, 300);\n$txtcolor = imagecolorallocate($image_p, 255, 200, 300);\n $font = 'monofont.ttf';\n $font_size = 20;\n //imagettftext($image_p, $font_size, 0, 50, 150, $txtcolor, $font, $watermark);\n imagettftext($image_p, $font_size, 0, 26, 88, $txtcolor, $font, $watermark);\n if ($save<>'') {\n imagejpeg ($image_p, $save, 100); \n } else {\n header('Content-Type: image/jpeg');\n imagejpeg($image_p, null, 100);\n }\n imagedestroy($image); \n imagedestroy($image_p); \n}", "function _render_watermark_image_fields()\n {\n $message = __('An absolute or relative (to the site document root) file system path', 'nggallery');\n if (ini_get('allow_url_fopen')) {\n $message = __('An absolute or relative (to the site document root) file system path or an HTTP url', 'nggallery');\n }\n return $this->object->render_partial('photocrati-nextgen_other_options#watermark_image_fields', array('image_url_label' => __('Image URL:', 'nggallery'), 'watermark_image_url' => $this->object->get_model()->wmPath, 'watermark_image_text' => $message), TRUE);\n }", "public function hasImage()\r\n {\r\n return $this->getImage() != '';\r\n }", "function publication_watermark_add($id,$file)\n{\nglobal $site_watermark;\nglobal $site_server_activ;\nglobal $site_servers;\nglobal $db;\n\n\t$watermark_position=5;\n\n\tif($site_watermark!=\"\" and file_exists($_SERVER[\"DOCUMENT_ROOT\"].$site_watermark))\n\t{\n\t\twatermark($file,$_SERVER[\"DOCUMENT_ROOT\"].$site_watermark);\n\t}\n\n\t$size = getimagesize ($file);\n\t$orientation=0;\n\tif($size[1]>$size[0]){$orientation=1;}\n\n\t$sql=\"update photos set watermark=\".$watermark_position.\",color='\".define_color($file).\"',orientation=\".$orientation.\" where id_parent=\".$id;\n\t$db->execute($sql);\n\n}", "public function hasTransparency()\n {\n return $this->image->getImageAlphaChannel() == 1;\n }", "public function valid()\n {\n if (!parent::valid()) {\n return false;\n }\n\n if ($this->container['x_resolution'] === null) {\n return false;\n }\n if ($this->container['y_resolution'] === null) {\n return false;\n }\n return true;\n }", "function watermark($filename)\n{\n $stamp = imagecreatefrompng(DIR.'/common/logo.png');\n $im = imagecreatefromjpeg($filename);\n $marge_right = 5;\n $marge_bottom = 5;\n $sx = imagesx($stamp);\n $sy = imagesy($stamp);\n imagecopy($im, $stamp, imagesx($im) - $sx - $marge_right, imagesy($im) - $sy - $marge_bottom, 0, 0, imagesx($stamp), imagesy($stamp));\n imagejpeg($im,$filename);\n imagedestroy($stamp);\n imagedestroy($im);\n}", "protected function check_allowed_source()\n\t{\n\t\t$this->image_type = exif_imagetype($this->image_file);\n\n\t\tif (in_array($this->image_type, $this->allowed_source_types))\n\t\t{\n\t\t\treturn true;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\n\t}", "public function hasArtifactSignature()\n {\n return $this->artifact_signature !== null;\n }", "public function hasImage(): bool\n {\n return false;\n }" ]
[ "0.59331346", "0.59017825", "0.5860107", "0.58596903", "0.58095425", "0.5798637", "0.57045424", "0.5681488", "0.5636405", "0.5580786", "0.5507264", "0.548238", "0.547255", "0.54525906", "0.5432609", "0.5388724", "0.53463364", "0.534098", "0.5325297", "0.5320104", "0.531947", "0.5309247", "0.53086674", "0.5290829", "0.5258871", "0.5247237", "0.52458066", "0.5225721", "0.522009", "0.520492" ]
0.827161
0
Resizes current image by the setted params. If $this>sizeType = 'org' and width anf height are bigger than 0 it will resize the image keeping the aspect ratio. If $this>sizeType = 'org' and only width or height are bigger than 0 it will resize the image by give param. If $this>sizeType = 'org' and only width or height are bigger than 0 it will resize the image by give param. If $this>sizeType = 'width' or $this>sizeType = 'height' and is bigger than 0 it will resize the image by give param. If $this>sizeType = 'fixed' and both width and height are bigger than 0 it will resize the image strict by give params. In all $this>sizeType except 'fixed' if the given size is bigger than the original size and $this>allowSizeOverflow is not set to true the original size will be used.
private function resize() { if (!$this->width && !$this->height && $this->sizeType == 'org') { return false; } //get image size $currentWidth = $this->imagick->getImageWidth(); $currentHeight = $this->imagick->getImageHeight(); //get image resize ratio $witdhRatio = $this->width / $currentWidth; $heightRatio = $this->height / $currentHeight; if ($this->imageFormat == 'gif') { $this->imagick = $this->imagick->coalesceImages(); } elseif(in_array($this->imageFormat, array('png', 'svg'))) { $this->imagick->setBackgroundColor(new ImagickPixel('transparent')); if(in_array($this->imageFormat, array('svg'))) { $this->imagick->readImageBlob(file_get_contents($this->currentFileLocation)); } } //resizes and crops if ($this->sizeType == 'fixed') { if($witdhRatio >= $heightRatio){ $newHeight = floor($currentHeight * $witdhRatio); if ($this->imageFormat != 'gif') { $this->imagick->resizeImage($this->width, null, imagick::FILTER_LANCZOS, 1); } else { foreach ($this->imagick as $frame) { $frame->thumbnailImage($this->width, null); $frame->setImagePage($this->width, null, 0, 0); } } if ($this->height != 0 && $newHeight > $this->height) { if ($this->imageFormat != 'gif') { $this->imagick->cropImage($this->width, $this->height, 0, floor(($newHeight - $this->height) / 2)); } else { foreach ($this->imagick as $frame) { $frame->thumbnailImage($this->width, $this->height); $frame->setImagePage($this->width, $this->height, 0, 0); } } } } else { $newWidth = floor($currentWidth * $heightRatio); if ($this->imageFormat != 'gif') { $this->imagick->resizeImage(null, $this->height, imagick::FILTER_LANCZOS, 1); } else { foreach ($this->imagick as $frame) { $frame->thumbnailImage(null, $this->height); $frame->setImagePage(null, $this->height, 0, 0); } } if ($this->width != 0 && $newWidth > $this->width) { if ($this->imageFormat != 'gif') { $this->imagick->cropImage($this->width, $this->height, ceil(($newWidth - $this->width) / 2 ), 0); } else { foreach ($this->imagick as $frame) { $frame->thumbnailImage($this->width, $this->height); $frame->setImagePage($this->width, $this->height, 0, 0); } } } } } else { if ($witdhRatio >= $heightRatio) { if ($currentWidth > $this->width || $this->allowSizeOverflow) { if ($this->imageFormat != 'gif') { $this->imagick->resizeImage($this->width, null, imagick::FILTER_LANCZOS, 1); } else { foreach ($this->imagick as $frame) { $frame->thumbnailImage($this->width, null); $frame->setImagePage($this->width, null, 0, 0); } } } if ($this->height != 0 && $this->imagick->getImageHeight() > $this->height) { if ($this->imageFormat != 'gif') { $this->imagick->resizeImage(null, $this->height, imagick::FILTER_LANCZOS, 1); } else { foreach ($this->imagick as $frame) { $frame->thumbnailImage(null, $this->height); $frame->setImagePage(null, $this->height, 0, 0); } } } } else { if ($currentHeight > $this->height || $this->allowSizeOverflow) { if ($this->imageFormat != 'gif') { $this->imagick->resizeImage(null, $this->height, imagick::FILTER_LANCZOS, 1); } else { foreach ($this->imagick as $frame) { $frame->thumbnailImage(null, $this->height); $frame->setImagePage(null, $this->height, 0, 0); } } } if ($this->width != 0 && $this->imagick->getImageWidth() > $this->width) { if ($this->imageFormat != 'gif') { $this->imagick->resizeImage($this->width, null, imagick::FILTER_LANCZOS, 1); } else { foreach ($this->imagick as $frame) { $frame->thumbnailImage($this->width, null); $frame->setImagePage($this->width, null, 0, 0); } } } } } if ($this->imageFormat == 'gif') { $this->imagick = $this->imagick->deconstructImages(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function resize()\n {\n global $objDatabase;\n\n if (!$this->id) {\n//DBG::log(\"Image::resize(): No Image ID! Failed\");\n return false;\n }\n // Only applies to files that contain a\n // file name with a known extension\n if ( $this->path == ''\n || !preg_match('/\\.(?:jpe?g|gif|png)$/i', $this->path)) {\n//DBG::log(\"Image::resize(): Invalid extension: $this->path\");\n return false;\n }\n // Get the thumbnail size for the associated type\n $arrInfo = \\Cx\\Core\\ImageType\\Controller\\ImageType::getInfoArray($this->imagetype_key);\n//DBG::log(\"resize(): Info: \".var_export($arrInfo, true));\n if ($arrInfo['width_thumb'] || $arrInfo['height_thumb']) {\n if (!self::scale(\n $this->path, self::getThumbnailPath($this->path), true,\n $arrInfo['width_thumb'], $arrInfo['height_thumb'],\n $arrInfo['quality_thumb']))\n//DBG::log(\"Image::resize(): Failed to scale thumbnail\");\n return false;\n }\n // Only resize the original if the width and/or height are limited\n if ($arrInfo['width'] || $arrInfo['height']) {\n $path = self::getJpegPath($this->path);\n if (!self::scale(\n $this->path, $path, true,\n $arrInfo['width'], $arrInfo['height'],\n $arrInfo['quality']))\n//DBG::log(\"Image::resize(): Failed to scale myself\");\n return false;\n // If the jpeg file name is different from the original name,\n // the original image is deleted to save disk space\n if ($this->path != $path) {\n File::delete_file($this->path);\n File::delete_file(self::getThumbnailPath($this->path));\n }\n // The path *MUST* be updated\n $this->setPath($path);\n // And so *SHOULD* the size\n $size = getimagesize(ASCMS_DOCUMENT_ROOT.'/'.$path);\n if ($size[0] && $size[1]) {\n $this->setWidth($size[0]);\n $this->setHeight($size[1]);\n//DBG::log(\"Image::resize(): New size: {$this->getWidth()} x {$this->getHeight()}\");\n }\n//DBG::log(\"Image::resize(): returning result from store()\");\n return $this->store();\n }\n//DBG::log(\"Image::resize(): No resizing, finished successfully\");\n return true;\n }", "public function resize()\n {\n $args = func_get_args();\n \n if (array_key_exists(0, $args) && is_array($args[0])) {\n \n // extract 'width' and 'height' \n extract(array_only($args[0], array('width', 'height')));\n $width = isset($width) ? intval($width) : null;\n $height = isset($height) ? intval($height) : null;\n \n if ( ! is_null($width) OR ! is_null($height)) {\n // if width or height are not set, define values automatically\n $width = is_null($width) ? intval($height / $this->height * $this->width) : $width;\n $height = is_null($height) ? intval($width / $this->width * $this->height) : $height;\n } else {\n // width or height not defined (resume with original values)\n throw new Exception('Width or Height needs to be defined as keys in paramater array');\n }\n\n } elseif (array_key_exists(0, $args) && array_key_exists(1, $args) && is_numeric($args[0]) && is_numeric($args[1])) {\n $width = intval($args[0]);\n $height = intval($args[1]);\n }\n\n if (is_null($width) OR is_null($height)) {\n throw new Exception('width or height needs to be defined');\n }\n\n // create new image in new dimensions\n return $this->modify(0, 0, 0, 0, $width, $height, $this->width, $this->height);\n }", "function setSize()\n\t\t{\t\n\t\t\t$ratio_image=$this->imageSizeX/$this->imageSizeY;\n\t\t\t$ratio=$this->reduction_width/$this->reduction_height;\n\t\t\tif($ratio_image<$ratio)\n\t\t\t{\n\t\t\t $ratio_image=$this->imageSizeX/$this->imageSizeY;\n\t\t\t $this->resizeY=$this->reduction_height;\n\t\t\t $this->resizeX=round($ratio_image*$this->resizeY);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t $ratio_image=$this->imageSizeY/$this->imageSizeX;\n\t\t\t $this->resizeX=$this->reduction_width;\n\t\t\t $this->resizeY=round($ratio_image*$this->resizeX);\n\t\t\t}\n\t\t\n /*if($this->imageSizeY<$this->imageSizeX){\n $ratio=$this->imageSizeY/$this->imageSizeX;\n $this->resizeX=$this->reduction_width;\n $this->resizeY=round($ratio*$this->reduction_width);\n }else{\n $ratio=$this->imageSizeX/$this->imageSizeY;\n $this->resizeY=$this->reduction_height;\n $this->resizeX=round($ratio*$this->reduction_height);\n }*/\n }", "protected function setSizeOption(): void\n {\n // If no option has been provided, we'll use default values.\n if (\n empty($this->userOptions[WebThumbnailer::MAX_HEIGHT])\n && empty($this->userOptions[WebThumbnailer::MAX_WIDTH])\n ) {\n return;\n }\n\n // If the rules doesn't specify anything about size, abort.\n if (empty($this->finderOptions[static::SIZE_KEY])) {\n return;\n }\n\n // Load height user option.\n if (!empty($this->userOptions[WebThumbnailer::MAX_HEIGHT])) {\n $height = $this->userOptions[WebThumbnailer::MAX_HEIGHT];\n if (SizeUtils::isMetaSize((string) $height)) {\n $height = SizeUtils::getMetaSize((string) $height);\n }\n }\n\n // Load width user option.\n if (!empty($this->userOptions[WebThumbnailer::MAX_WIDTH])) {\n $width = $this->userOptions[WebThumbnailer::MAX_WIDTH];\n if (SizeUtils::isMetaSize((string) $width)) {\n $width = SizeUtils::getMetaSize((string) $width);\n }\n }\n\n // Trying to find a resolution higher than the one asked.\n foreach ($this->finderOptions[static::SIZE_KEY] as $sizeOption => $value) {\n if ($sizeOption == 'default') {\n continue;\n }\n\n if (\n (empty($value['maxwidth']) || empty($width) || $value['maxwidth'] >= $width)\n && (empty($value['maxheight']) || empty($height) || $value['maxheight'] >= $height)\n ) {\n $this->userOptions[static::SIZE_KEY] = $sizeOption;\n break;\n }\n }\n\n // If the resolution asked hasn't been reached, take the highest resolution we have.\n if ((!empty($width) || !empty($height)) && empty($this->userOptions[static::SIZE_KEY])) {\n $ref = array_keys($this->finderOptions[static::SIZE_KEY]);\n $this->userOptions[static::SIZE_KEY] = end($ref);\n }\n }", "public function resize($filename, $width, $height = 0, $type = '') {\n\t\tif (!is_file(DIR_IMAGE . $filename)) {\n\t\t\treturn;\n\t\t}\n\t\t$this->load->model('setting/setting');\n\t\t$main = $this->model_setting_setting->getSetting('imagengine');\n\n\t\t$extension = pathinfo($filename, PATHINFO_EXTENSION);\n\n// BOF - Zappo - ImagEngine - Load proper image settings\n\t\t$config = false;\n\t\t$quality = (isset($main['imagengine_image_quality'])) ? $main['imagengine_image_quality'] : 80;\n\t\t$add_on = false;\n\t\tif (!is_numeric($width)) {\n\t\t\t// Passed as second argument...\n\t\t\t$config = 'config_image_' . $width . '_';\n\t\t\t$add_on = $width;\n\t\t\tif ($width == 'popup' && isset($main['imagengine_popup_quality'])) $quality = $main['imagengine_popup_quality'];\n\t\t} else {\n\t\t\t// Detect from backtrace\n\t\t\t$config = debug_backtrace();\n\t\t\t$config = isset($config[0]['file']) ? $config[0]['file'] : '';\n\t\t\tif ($config && isset($main['imagengine_cache'])) {\n\t\t\t\t$base = basename(dirname($config));\n\t\t\t\t$caller = substr(basename($config),0,-4);\n\t\t\t\t//echo \"Base = $base --- Caller = $caller<br/>\";\n\t\t\t\t// Get real name from vQMod cache file\n\t\t\t\tif ($base == 'vqcache' || substr($caller,0,4) == 'vq2-') {\n\t\t\t\t\t$base = explode('_', substr($caller, 4));\n\t\t\t\t\tforeach ($base as $bnum => $fldr) {\n\t\t\t\t\t\t// \"Base folder\" is the one after \"controller\"\n\t\t\t\t\t\tif ($fldr == 'controller') {\n\t\t\t\t\t\t\t$base = $base[$bnum+1];\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t$caller = explode('_' . $base . '_', $caller, 2);\n\t\t\t\t\t$caller = $caller[1];\n\t\t\t\t}\n\t\t\t\t$config = 'config_image_' . $base . '_' . $caller . '_';\n\t\t\t\t$add_on = $base . '_' . $caller;\n\t\t\t\tif (!$this->config->get($config . 'width')) {\n\t\t\t\t\t$config = 'config_image_' . $caller . '_';\n\t\t\t\t\t$add_on = $caller;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif ($config && $this->config->get($config . 'width')) {\n\t\t\t$width = $this->config->get($config . 'width');\n\t\t\t$height = $this->config->get($config . 'height');\n\t\t\t// Got with & height --> Replace \"config_\" with \"imagengine_\" for the rest of the values\n\t\t\t$config = str_replace('config_image_', 'imagengine_image_', $config);\n\t\t} else {\n\t\t\t$config = false;\n\t\t}\n\t\t//echo basename($filename) . \" &nbsp; &nbsp; from: \" . ($config ? $config : $add_on) . \"<br/>\";\n\t\tif (!is_array($type)) {\n\t\t\t$cfg = array();\n\t\t\tif ($type) $cfg['fixed'] = $type;\n\t\t} else {\n\t\t\t$cfg = $type;\n\t\t}\n\t\t$output = (isset($cfg['output']) && $cfg['output']) ? $cfg['output'] : 'url';\n\t\t$crop = (isset($cfg['crop']) && is_array($cfg['crop'])) ? $cfg['crop'] : array();\n\t\t$cache = (isset($cfg['cache']) && !$cfg['cache']) ? false : true;\n\t\t$settings = array('angle', 'anglefix', 'fixed', 'border', 'back');\n\t\tforeach ($settings as $setting) {\n\t\t\t${$setting} = isset($cfg[$setting]) ? $cfg[$setting] : ($config ? $this->config->get($config . $setting) : false);\n\t\t}\n\t\t$type = '';\n\t\tif ($fixed) $type .= '-f';\n\t\tif ($crop && isset($crop[3]) && $crop[0] < $crop[2] && $crop[1] < $crop[3]) $type .= '-'.$crop[0].$crop[1].$crop[2].$crop[3];\n\t\t$angle = ($angle && !$anglefix) ? mt_rand($angle*-1, $angle) : $angle;\n\t\tif ($angle) $type .= '-r' . ((isset($main['imagengine_save_angle']) && $main['imagengine_save_angle']) ? $angle : '');\n\t\tif ($border) $type .= '-b'.$border;\n\t\tif ($back) $type .= '-c'.$back;\n\t\t// BOF - Add Add-Ons\n\t\t$ttype = '';\n\t\t$addon = $addbdr = array();\n\t\tif (isset($cfg['addon']) && $cfg['addon']) {\n\t\t\tif (!is_array($cfg['addon'])) $cfg['addon'] = array($cfg['addon']);\n\t\t\tforeach ($cfg['addon'] as $add) {\n\t\t\t\t$addon_image = $this->config->get('imagengine_' . $add . '_addon');\n\t\t\t\t$addon_add = $this->config->get('imagengine_' . $add . '_show');\n\t\t\t\tif ($addon_image && is_array($addon_add) && in_array($add_on, $addon_add)) {\n\t\t\t\t\t$addon[$add] = array(\n\t\t\t\t\t\t'scale' => $this->config->get('imagengine_' . $add . '_scale'),\n\t\t\t\t\t\t'image' => $addon_image,\n\t\t\t\t\t\t'x' => $this->config->get('imagengine_' . $add . '_x'),\n\t\t\t\t\t\t'y' => $this->config->get('imagengine_' . $add . '_y')\n\t\t\t\t\t);\n\t\t\t\t\t$ttype .= substr($add, 0, 1);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t$addon_image = $this->config->get('imagengine_border_addon');\n\t\t$addon_add = $this->config->get('imagengine_border_show');\n\t\tif ($addon_image && is_array($addon_add) && in_array($add_on, $addon_add)) {\n\t\t\t$addbdr = array(\n\t\t\t\t'scale' => $this->config->get('imagengine_border_scale'),\n\t\t\t\t'image' => $addon_image\n\t\t\t);\n\t\t\t$ttype .= 'B';\n\t\t}\n\t\tif ($ttype != '') $type .= '-a' . $ttype;\n\t\t// EOF - Add Add-Ons\n\t\t// Add random number if this image should not be cached\n\t\tif (!$cache) $type .= mt_rand();\n// EOF - Zappo - ImagEngine - Load proper image settings\n\n\t\t$old_image = $filename;\n\t\t$new_image = 'cache/' . utf8_substr($filename, 0, utf8_strrpos($filename, '.')) . '-' . $width . 'x' . $height . $type . '.' . $extension;\n\n// BOF - Zappo - ImagEngine - TWO LINES - Set caching\n\t\t$cache = (isset($main['imagengine_cache']) && !$main['imagengine_cache']) ? false : true;\n\t\tif (!$cache || !file_exists(DIR_IMAGE . $new_image) || (filectime(DIR_IMAGE . $old_image) > filectime(DIR_IMAGE . $new_image))) {\n\t\t\t$path = '';\n\n\t\t\t$directories = explode('/', dirname(str_replace('../', '', $new_image)));\n\n\t\t\tforeach ($directories as $directory) {\n\t\t\t\t$path = $path . '/' . $directory;\n\n\t\t\t\tif (!is_dir(DIR_IMAGE . $path)) {\n\t\t\t\t\t@mkdir(DIR_IMAGE . $path, 0777);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tlist($width_orig, $height_orig) = getimagesize(DIR_IMAGE . $old_image);\n\n// BOF - Zappo - ImagEngine - ONE LINE - Adjust Image (not just resize)\n\t\t\tif ($crop || $angle || $border || $back || $width_orig != $width || $height_orig != $height) {\n\t\t\t\t$image = new Image(DIR_IMAGE . $old_image);\n// BOF - Zappo - ImagEngine - Added image Cropping\n\t\t\t\tif ($crop) {\n\t\t\t\t\t$ratio = (isset($crop[4])) ? ($width_orig > $height_orig ? $width_orig / $crop[4] : $height_orig / $crop[4]) : 1;\n\t\t\t\t\t$image->crop($crop[0] * $ratio, $crop[1] * $ratio, $crop[2] * $ratio, $crop[3] * $ratio);\n\t\t\t\t}\n// EOF - Zappo - ImagEngine - Added image Cropping\n// BOF - Zappo - ImagEngine - ONE LINE - Added image rotation (Keeping exact size)\n\t\t\t\tif ($angle && $fixed) $image->rotate($angle*-1);\n// BOF - Zappo - Add Add-on Border\n\t\t\t\tif ($addbdr) {\n\t\t\t\t\t$w = $width;\n\t\t\t\t\t$h = $height;\n\t\t\t\t\t$width = ($width/100) * $addbdr['scale'];\n\t\t\t\t\t$height = ($height/100) * $addbdr['scale'];\n\t\t\t\t}\n// EOF - Zappo - Add Add-on Border\n// BOF - Zappo - ImagEngine - ONE LINE - Changed resize function\n\t\t\t\t$image->resize($width, $height, $fixed, $border);\n// BOF - Zappo - ImagEngine - ONE LINE - Added image rotation (Disregarding exact size)\n\t\t\t\tif ($angle && !$fixed) $image->rotate($angle*-1);\n// BOF - Zappo - Add Add-on Border and Image\n\t\t\t\tif ($addbdr) {\n\t\t\t\t\tif (($w && $width != $w) || ($h && $height != $h)) {\n\t\t\t\t\t\t$image->setsize($w, $h, $fixed, $back);\n\t\t\t\t\t\t$addme = new Image(DIR_IMAGE . $addbdr['image']);\n\t\t\t\t\t\t$size = $image->getInfo();\n\t\t\t\t\t\t$width = $size['width'];\n\t\t\t\t\t\t$height = $size['height'];\n\t\t\t\t\t\t$addme->resize($width, $height, 'stretch');\n\t\t\t\t\t}\n\t\t\t\t\t$image->merge($addme->getResource(), 0, 0);\n\t\t\t\t}\n\t\t\t\tif ($addon) {\n\t\t\t\t\t$padded = false;\n\t\t\t\t\tforeach ($addon as $add) {\n\t\t\t\t\t\t// Add extra space for add-on\n\t\t\t\t\t\tif ($this->config->get('imagengine_addon_padding') && !$padded) {\n\t\t\t\t\t\t\t$width += $main['imagengine_addon_padding'] * 2;\n\t\t\t\t\t\t\t$height += $main['imagengine_addon_padding'] * 2;\n\t\t\t\t\t\t\t$image->setsize($width, $height, $fixed);\n\t\t\t\t\t\t\t$size = $image->getInfo();\n\t\t\t\t\t\t\t$width = $size['width'];\n\t\t\t\t\t\t\t$height = $size['height'];\n\t\t\t\t\t\t\t$padded = true;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$addme = new Image(DIR_IMAGE . $add['image']);\n\t\t\t\t\t\t$w = ($add['scale'] >= 0) ? ($width/100) * $add['scale'] : abs($add['scale']);\n\t\t\t\t\t\t$h = ($add['scale'] >= 0) ? ($height/100) * $add['scale'] : abs($add['scale']);\n\t\t\t\t\t\t$addme->resize($w, $h);\n\t\t\t\t\t\tif ($add['x'] < 0 || $add['x'] == -0) $add['x'] += $width - $w;\n\t\t\t\t\t\tif ($add['y'] < 0 || $add['y'] == -0) $add['y'] += $height - $h;\n\t\t\t\t\t\t$image->merge($addme->getResource(), $add['x'], $add['y']);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif ($addon || $addbdr) $image->flatten($main['imagengine_border_fill']);\n\t\t\t\telse $image->flatten($back);\n// EOF - Zappo - Add Add-on Border and Image\n\t\t\t\t$image->save(DIR_IMAGE . $new_image, $quality);\n\t\t\t} else {\n\t\t\t\tcopy(DIR_IMAGE . $old_image, DIR_IMAGE . $new_image);\n\t\t\t}\n\t\t}\n\n// BOF - Zappo - ImagEngine - Added Output Options (for Ajax output)\n\t\tif ($output == 'json') {\n\t\t\tif (!isset($image)) $image = new Image(DIR_IMAGE . $new_image);\n\t\t\t$imageArray['width'] = $image->getInfo('width');\n\t\t\t$imageArray['height'] = $image->getInfo('height');\n\t\t\t$imageArray['image'] = $new_image;\n\t\t\treturn $imageArray;\n\t\t} elseif ($output == 'data') {\n\t\t\tif (!isset($image)) $image = new Image(DIR_IMAGE . $new_image);\n\t\t\treturn $image->getData();\n\t\t} else {\n\t\t\tif ($this->request->server['HTTPS']) {\n\t\t\t\treturn $this->config->get('config_ssl') . 'image/' . $new_image;\n\t\t\t} else {\n\t\t\t\treturn $this->config->get('config_url') . 'image/' . $new_image;\n\t\t\t}\n\t\t}\n// EOF - Zappo - ImagEngine - Added Output Options (for Ajax output)\n\t}", "private static function _resizeImage($path, $type) {\n\t\t$imgType = self::_getFileType($path);\t\n\t\tif(null === $imgType) {\n\t\t\tthrow ExceptionUtil::throwInvalidArgument('$path', 'file type png, gif or jpg', $path);\n\t\t}\t\n\t\t\n\t\tlist($imgWidth, $imgHeight) = getimagesize($path);\n\t\t$aimedWidth = null;\n\t\tswitch($type) {\n\t\t\tcase self::TYPE_PROFILE_PIC:\n\t\t\t\t$aimedWidth = self::PROFILE_PIC_MAX_WIDTH;\n\t\t\t\tbreak;\n\t\t\tcase self::TYPE_VEHICLE_PIC:\n\t\t\t\t$aimedWidth = self::VEHICLE_PIC_MAX_WIDTH;\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tthrow ExceptionUtil::throwInvalidArgument('$type', 'type constants in FilesUtil', $type);\n\t\t}\n\t\t\n\t\tif(null !== $aimedWidth && $imgWidth > $aimedWidth) {\t\t\t\n\t\t\t$newHeight = ($imgHeight / $imgWidth) * $aimedWidth;\t\n\n\t\t\t$source = \"\";\n\t\t\tswitch($imgType) {\n\t\t\t\tcase self::FILE_TYPE_GIF:\n\t\t\t\t\t$source = imagecreatefromgif($path);\n\t\t\t\t\tbreak;\n\t\t\t\tcase self::FILE_TYPE_PNG:\n\t\t\t\t\t$source = imagecreatefrompng($path);\n\t\t\t\t\tbreak;\n\t\t\t\tcase self::FILE_TYPE_JPEG:\n\t\t\t\t\t$source = imagecreatefromjpeg($path);\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\tthrow ExceptionUtil::throwInvalidArgument('$type', 'type constants in FilesUtil', $type);\n\t\t\t}\t\t\t\n\t\t\t$thumb = imagecreatetruecolor($aimedWidth, $newHeight);\t \t\t\t\n\t\t\timagecopyresized($thumb, $source, 0, 0, 0, 0, $aimedWidth, $newHeight, $imgWidth, $imgHeight);\n\t\t\tswitch($imgType) {\n\t\t\t\tcase self::FILE_TYPE_GIF:\n\t\t\t\t\timagegif($thumb, $path);\n\t\t\t\t\tbreak;\n\t\t\t\tcase self::FILE_TYPE_PNG:\n\t\t\t\t\timagepng($thumb, $path);\n\t\t\t\t\tbreak;\n\t\t\t\tcase self::FILE_TYPE_JPEG:\n\t\t\t\t\timagejpeg($thumb, $path);\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\tthrow ExceptionUtil::throwInvalidArgument('$type', 'type constants in FilesUtil', $type);\n\t\t\t}\t\t\t\n\t\t}\n\t\t\n\t\t\t\n\t}", "function resize($width=null,$height=null,$allow_rescale=true){\n if(!isset($width) && !isset($height))throw new \\Exception(\"You must specify width and/or height for resize.\");\n if(!isset($height))$height=($width/$this->width)*$this->height;\n else if(!isset($width))$width=($height/$this->height)*$this->width;\n\n //TODO:Make percentage\n\n if($allow_rescale===true){\n $this->image=$this->resample($this->image,$width,$height);\n $this->updateSize();\n }\n else{\n $temp=imagecreatetruecolor($width,$height);//TODO:make this more elegant and/or replace with crop\n imagefill($temp,0,0,$this->color);\n imagecopy($temp,$this->image,0,0,0,0,$this->width,$this->height);\n $this->image=$temp;\n $this->updateSize();\n }\n\n\n }", "public function resizeImageUrl($image,$type,$width=null,$height=null)\n {\n\n\n if ($type == 'family-photo') {\n $path = 'brandcollection/brandcollection/';\n }else{\n return '';\n }\n\n if(empty($image) && $type == 'family-photo'){\n return $this ->_storeManager-> getStore()->getBaseUrl(\\Magento\\Framework\\UrlInterface::URL_TYPE_MEDIA).$path.'NoImages.jpg';\n }\n\n if(empty($image)) {\n return '';\n }\n\n $absolutePath = $this->_filesystem->getDirectoryRead(\\Magento\\Framework\\App\\Filesystem\\DirectoryList::MEDIA)->getAbsolutePath($path).$image;\n // check if width and height is specified, if specified, create a new image base on the $width,$height specified\n if(isset($width) && isset($height)){\n $imageResized = $this->_filesystem->getDirectoryRead(\\Magento\\Framework\\App\\Filesystem\\DirectoryList::MEDIA)->getAbsolutePath($path . 'resized/'.$width.'/').$image;\n //create image factory...\n $imageResize = $this->_imageFactory->create();\n $imageResize->open($absolutePath);\n $imageResize->constrainOnly(TRUE);\n $imageResize->keepTransparency(TRUE);\n $imageResize->keepFrame(FALSE);\n $imageResize->keepAspectRatio(TRUE);\n $imageResize->resize($width,$height);\n //destination folder\n $destination = $imageResized ;\n //save image\n $imageResize->save($destination);\n $resizedURL = $this->_storeManager->getStore()->getBaseUrl(\\Magento\\Framework\\UrlInterface::URL_TYPE_MEDIA).$path.'resized/'.$width.'/'.$image;\n return $resizedURL;\n }else{\n return $this->_storeManager->getStore()->getBaseUrl(\\Magento\\Framework\\UrlInterface::URL_TYPE_MEDIA).$path.$image;\n }\n\n\n\n }", "private function setImageDimensions()\n {\n global $Core;\n\n if ($this->allowedSizes) {\n if (!isset($this->allowedSizes[$this->sizeType]) || !isset($this->allowedSizes[$this->sizeType][$this->sizeKey])) {\n $Core->doOrDie();\n } else {\n $this->width = $this->allowedSizes[$this->sizeType][$this->sizeKey]['width'];\n $this->height = $this->allowedSizes[$this->sizeType][$this->sizeKey]['height'];\n }\n }\n }", "private function ResizeToAndCrop($thisSize){\n\t\tif( $this->isError ) return;\n\t\t$proportion = 1;\n\t\t$new_height = $new_width = 0;\n\t\tif($this->imgSize['width'] > $this->imgSize['height']){\n\t\t\t// resize in height and crop the sides\n\t\t\t$proportion = $this->imgSize['height'] / $thisSize[\"height\"];\n\t\t\t$new_height = $thisSize[\"height\"];\n\t\t\t$new_width = ceil($this->imgSize['width'] * $proportion);\n\t\t\t$this->image = $this->image->resize($new_width, $new_height);\n\t\t\t// crop the center:\n\t\t\t$this->image = $this->image->crop(\"center\", \"top\", $thisSize['width'], $thisSize['height']);\n\t\t} else {\n\t\t\t// resize in width and crop the bottom\n\t\t\t$proportion = $this->imgSize['width'] / $thisSize[\"width\"];\n\t\t\t$new_width = $thisSize[\"width\"];\n\t\t\t$new_height = ceil($this->imgSize['height'] * $proportion);\n\t\t\t$this->image = $this->image->resize($new_width, $new_height);\n\t\t\t// crop from top:\n\t\t\t$this->image = $this->image->crop(0, 0, $thisSize['width'], $thisSize['height']);\n\t\t}\n\t\t$this->imgSize = $thisSize;\n\t}", "function resize($desired_width, $desired_height, $mode=\"-\"){\n //if any of dimensions == \"*\" then no resizing on this dimension \n //>> mode = \"+\" then image is resized to cover the region specified by desired_width, _height \n //>> mode = \"-\" then image is resized to fit into the region specified by desired_width, _height \n // width-to-height ratio is all the time the same \n //>>mode=0 then image will be exactly resized to $desired_width _height. \n //geometrical distortion can occur in this case. \n // say u have picture 400x300 and there is circle on the picture \n //now u resized in mode=0 to 800x300 -- circle shape will be distorted and will look like ellipse. \n //GD2 provides much better quality but is not everywhere installed \n //global $ERR; \n\n if($desired_width == \"*\" && $desired_height == \"*\"){ \n //This is stupid to specify that we don't care about both dimensions \n //That just means that no resizing should occur at all \n $this->image_resized = $this->image_original; \n Return true;\n } \n switch($mode) {\n case \"-\":\n case '+':\n //multipliers \n if($desired_width != \"*\") $mult_x = $desired_width / $this->image_original_width;\n if($desired_height != \"*\") $mult_y = $desired_height / $this->image_original_height;\n $ratio = $this->image_original_width / $this->image_original_height; \n //here we handle case when we don't care about resizing \n //on one of the dimensions \n if($desired_width == \"*\"){ \n $new_height = $desired_height; \n $new_width = $ratio * $desired_height; \n }elseif($desired_height == \"*\"){ \n $new_height = $desired_width / $ratio; \n $new_width = $desired_width; \n\n }else{ \n //if we are here that means that both dimensions are specified and we have \n //to calculate $new_width $new_height according to the resize mode: \n if($mode==\"-\"){ \n //image must be smaller than given $desired_ region \n //test which multiplier gives us best result \n if( $this->image_original_height * $mult_x < $desired_height ){ \n //$mult_x does the job \n $new_width = $desired_width; \n $new_height = $this->image_original_height * $mult_x; \n }else{ \n //$mult_y does the job \n $new_width = $this->image_original_width * $mult_y; \n $new_height = $desired_height; \n } \n\n }else{ \n //mode == \"+\" \n // cover the region \n //image must be bigger than given $desired_ region \n //test which multiplier gives us best result \n if( $this->image_original_height * $mult_x > $desired_height ){ \n //$mult_x does the job \n $new_width = $desired_width; \n $new_height = $this->image_original_height * $mult_x; \n }else{ \n //$mult_y does the job \n $new_width = $this->image_original_width * $mult_y; \n $new_height = $desired_height; \n } \n\n } \n } \n break; \n\n case '0': \n //fit the region exactly. \n //The easiest resize mode -- no Math is required :) \n if($desired_width == \"*\") $desired_width = $this->image_original_width; \n if($desired_height == \"*\") $desired_height = $this->image_original_height; \n $new_width = $desired_width; \n $new_height = $desired_height; \n \n break; \n default: \n $this->error($ERR[\"UNKNOWN_RESIZE_MODE\"].\" $mode\"); \n break; \n } \n\n // OK here we have $new_width $new_height \n //lets create destination image checking for GD2 functions: \n if( $this->use_gd2 ){ \n if( function_exists(\"imagecreatetruecolor\")){ \n \n $this->image_resized = imagecreatetruecolor($new_width, $new_height) or $this->error($ERR[\"GD2_NOT_CREATED\"]); \n }else { \n $this->error($ERR[\"GD2_UNAVALABLE\"].\" ImageCreateTruecolor()\"); \n } \n } else { \n\n\n $this->image_resized = imagecreate($new_width, $new_height) or $this->error($ERR[\"IMG_NOT_CREATED\"]); \n } \n\n //Resize \n if( $this->use_gd2 ){ \n\n if( function_exists(\"imagecopyresampled\")){ \n $res = imagecopyresampled($this->image_resized, \n $this->image_original, \n 0, 0, //dest coord \n 0, 0, //source coord \n $new_width, $new_height, //dest sizes \n $this->image_original_width, $this->image_original_height // src sizes \n ) or $this->error($ERR[\"GD2_NOT_RESIZED\"]); \n\n }else { \n error($ERR[\"GD2_UNAVALABLE\"].\" ImageCopyResampled()\"); \n } \n } else { \n //hmmm... GD2 is not available or ImageCopyResampled() is disabled \n //I had such a problem in my practice \n //So lets use old function ImageCopyResized() \n $res = imagecopyresized($this->image_resized, \n $this->image_original, \n 0, 0, //dest coord \n 0, 0, //source coord \n $new_width, $new_height, //dest sizes \n $this->image_original_width, $this->image_original_height // src sizes \n ) or $this->error($ERR[\"IMG_NOT_RESIZED\"]); \n } \n\n}", "public function zoom($type = 'width', $size = 100, $p = 'px')\n {\n $img = $this->data;\n $width = imagesx($img);\n $height = imagesy($img);\n $tt = strtolower($type);\n $n = $size;\n if ($p == \"%\") {\n $zk = $n / 100;\n $new_height = $height * $zk;\n $new_width = $width * $zk;\n } else {\n $k = $width / $height;\n if ($tt == \"h\" || $tt == 'height') {\n $new_height = $n;\n $new_width = $new_height * $k;\n } elseif ($tt == 'd' || $tt == 'diagonal') {\n $d1 = sqrt(($height * $height) + ($width * $width));\n $d2 = $n;\n $k2 = $d2 / $d1;\n $new_height = $k2 * $height;\n $new_width = $k2 * $width;\n } else {\n $new_width = $n;\n $new_height = $new_width / $k;\n }\n }\n $newImg = imagecreatetruecolor($new_width, $new_height);\n imagealphablending($newImg, false);\n imagesavealpha($newImg, true);\n $transparent = imagecolorallocatealpha($newImg, 255, 255, 255, 127);\n imagefilledrectangle($newImg, 0, 0, $new_width, $new_height, $transparent);\n\n imagecopyresampled($newImg, $img, 0, 0, 0, 0, $new_width, $new_height, $width, $height);\n $this->data = $newImg;\n $this->refresh();\n return $this;\n }", "public function resize($image, $width, $height, $mode = null);", "public function resizeImage($imgSize)\n\t{\n\t\t$optionArray = $this->getDimensions($imgSize['width'], $imgSize['height'], $imgSize['option']);\n\t\t$optimalWidth = $optionArray['optimalWidth'];\n\t\t$optimalHeight = $optionArray['optimalHeight'];\n\n\n\t\t// *** Resample - create image canvas of x, y size\n\n\t\t$this->imageResized = imagecreatetruecolor($optimalWidth, $optimalHeight);\n\t\timagealphablending($this->imageResized, false);\n\t\timagesavealpha($this->imageResized,true);\n\t\t$transparent = imagecolorallocatealpha($this->imageResized, 255, 255, 255, 127);\n\t\t$w=$optimalWidth;\n\t\t$h=$optimalHeight;\n\t\timagefilledrectangle($this->imageResized, 0, 0, $w, $h, $transparent);\n\t\timagecopyresampled($this->imageResized, $this->image, 0, 0, 0, 0, $optimalWidth, $optimalHeight, $this->width, $this->height);\n\n\n\t\t// *** if option is 'crop', then crop too\n\t\tif ($imgSize['option'] == 'crop')\n\t\t{\n\t\t\t$this->crop($optimalWidth, $optimalHeight, $newWidth, $newHeight);\n\t\t}\n\t}", "function changeSize($width, $height=-1) {\n\t\tif(!is_resource($this->imageResource)) {\n\t\t\texit('不能改变图片的尺寸,可能是你没有设置图片来源.');\n\t\t}\n\t\t$s_width = $this->imageInfo[0];\n\t\t$s_height = $this->imageInfo[1];\n\t\t$width = intval($width);\n\t\t$height = intval($height);\n\n\t\tif($width <= 0) exit('图片宽度必须大于零.');\n\t\tif($height <= 0) {\n\t\t\t$height = ($s_height / $s_width) * $width;\n\t\t}\n\t\t$height_diff=0;\n\t\t$width_diff=0;\n\t\t\n\t\t$this->target = imagecreatetruecolor($width, $height);\n\t\t//如果比例不对,则取中间的部分\n\t\tif(abs($s_width/$s_height*$height-$width)>2){\n\t\t\tif(($s_height-$height/$width*$s_width)>0){//说明高度过高,需要在上下截取\n\t\t\t\t$height_diff=floor(($s_height-$s_width*$height/$width)/2);\n\t\t\t}else{//宽度过大,左右截取\n\t\t\t\t$width_diff=floor(($s_width-$s_height*$width/$height)/2);\n\t\t\t}\n\t\t}\n\t\tif(@imagecopyresized($this->target, $this->imageResource, 0, 0, $width_diff, $height_diff, $width, $height, $s_width-2*$width_diff, $s_height-2*$height_diff)){\n\t\t\treturn true;\n\t\t}else{\n\t\t\treturn false;\n\t\t}\n\t}", "public function resizeImage() \n {\n $response = array(\n 'success' => true,\n 'action' => Input::get('action'),\n 'size' => Input::get('size'),\n 'oldName' => Input::get('oldName'),\n 'extension' => Input::get('extension'),\n 'mime' => Input::get('mime'),\n 'isImage' => Input::get('isImage'),\n 'name' => null,\n //'tmpName' => Request::input('tmpName'),\n //'tmpFolder' => Request::input('tmpFolder'),\n //'folder' => Request::input('folder'),\n //'width' => Request::input('width'),\n //'height' => Request::input('height'),\n //'constrainProportions' => Request::input('constrainProportions'),\n //'outputExtension' => Request::input('outputExtension'),\n //'sizes' => Request::input('sizes')\n );\n \n // Image source and target\n $srcPath = $this->documentRoot.Input::get('tmpFolder').'/'.Input::get('tmpName');\n $dstPath = $this->documentRoot.Input::get('folder').'/'.Input::get('tmpName');\n \n // Values for resize\n $values = $this->getResizeValues($srcPath, Input::get('constrainProportions'), Input::get('width'), Input::get('height'));\n \n $response['name'] = ImageManager::resizeImage($srcPath, $dstPath, Input::get('outputExtension'), $values['srcX'], $values['srcY'], $values['destW'], $values['destH'], $values['srcW'], $values['srcH']);\n \n // Other sizes\n $pathInfo = pathinfo($dstPath);\n $responseSizes = $this->setResizesImage(Input::get('sizes'), $pathInfo['dirname'].'/'.$response['name']);\n\n if(is_array($responseSizes)) $response['sizes'] = $responseSizes;\n \n $data['json'] = json_encode($response);\n \n header('Content-type: application/json');\n echo $data['json'];\n }", "public function testSize()\n {\n $imageSize = new ImageSize(10, 10);\n\n $this->assertEquals(1, $imageSize->getRatio(ImageSize::RELATION_WIDTH));\n $this->assertEquals(1, $imageSize->getRatio(ImageSize::RELATION_HEIGHT));\n\n $resizeImageSize = $imageSize->getResizedSize(new ImageSize(5, 10), ImageResizer::RESIZE_TYPE_EXACT);\n $this->assertEquals(5, $resizeImageSize->getWidth());\n $this->assertEquals(10, $resizeImageSize->getHeight());\n\n $resizeImageSize = $imageSize->getResizedSize(new ImageSize(5, 10), ImageResizer::RESIZE_TYPE_CROP);\n $this->assertEquals(10, $resizeImageSize->getWidth());\n $this->assertEquals(10, $resizeImageSize->getHeight());\n\n $resizeImageSize = $imageSize->getResizedSize(new ImageSize(5, 5), ImageResizer::RESIZE_TYPE_AUTO);\n $this->assertEquals(5, $resizeImageSize->getWidth());\n $this->assertEquals(5, $resizeImageSize->getHeight());\n\n $resizeImageSize = $imageSize->getResizedSize(new ImageSize(5, 10), ImageResizer::RESIZE_TYPE_LANDSCAPE);\n $this->assertEquals(5, $resizeImageSize->getWidth());\n $this->assertEquals(5, $resizeImageSize->getHeight());\n\n $resizeImageSize = $imageSize->getResizedSize(new ImageSize(5, 10), ImageResizer::RESIZE_TYPE_PORTRAIT);\n $this->assertEquals(10, $resizeImageSize->getWidth());\n $this->assertEquals(10, $resizeImageSize->getHeight());\n }", "public function resizeImage($newWidth, $newHeight, $option = \"auto\")\n {\n $optionArray = $this->getDimensions($newWidth, $newHeight,\n strtolower($option)) ;\n\n $optimalWidth = $optionArray[ 'optimalWidth' ] ;\n $optimalHeight = $optionArray[ 'optimalHeight' ] ;\n\n// *** Resample - create image canvas of x, y size\n $this->editedImage = imagecreatetruecolor($optimalWidth, $optimalHeight) ;\n imagecopyresampled($this->editedImage, $this->image, 0, 0, 0, 0,\n $optimalWidth, $optimalHeight, $this->width,\n $this->height) ;\n\n// *** if option is 'crop', then crop too\n// if ( $option == 'crop' )\n// {\n// $this->crop($optimalWidth, $optimalHeight, $newWidth, $newHeight) ;\n// }\n }", "public function adaptiveResize($fileName, $width, $height)\n\t{\n\t\t$folderURL = Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_MEDIA);\n\t\t$imageURL = $folderURL . $fileName;\n\n\t\t$basePath = Mage::getBaseDir(Mage_Core_Model_Store::URL_TYPE_MEDIA) . '/' . $fileName;\n\t\t$newPath = Mage::getBaseDir(Mage_Core_Model_Store::URL_TYPE_MEDIA) . '/' . \"resized\" . '/' . $fileName;\n\t\t//if width empty then return original size image's URL\n\t\tif ($width != '') {\n\t\t\t//if image has already resized then just return URL\n\t\t\tif (file_exists($basePath) && is_file($basePath) && !file_exists($newPath)) {\n\t\t\t\t$imageObj = new Varien_Image($basePath);\n\t\t\t\t$imageObj->constrainOnly(FALSE);\n\t\t\t\t$imageObj->keepAspectRatio(TRUE);\n\t\t\t\t$imageObj->keepFrame(FALSE);\n\t\t\t\t$imageObj->quality(95);\n\n\t\t\t\t$this->currentDimensions = array();\n\t\t\t\t$this->currentDimensions['width'] = $imageObj->getOriginalWidth();\n\t\t\t\t$this->currentDimensions['height'] = $imageObj->getOriginalHeight();\n\n\t\t\t\t$this->newDimensions = array();\n\t\t\t\t$this->newDimensions['newWidth'] = $imageObj->getOriginalWidth();\n\t\t\t\t$this->newDimensions['newHeight'] = $imageObj->getOriginalHeight();\n\n\t\t\t\t$this->adaptiveResizeDimensions($width, $height);\n\n\t\t\t\t$imageObj->resize($this->newDimensions['newWidth'], $this->newDimensions['newHeight']);\n\t\t\t\tif ( $this->cropDimensions['x'] > 0 || $this->cropDimensions['y'] > 0 ) {\n\t\t\t\t\t//top, left, right, bottom\n\t\t\t\t\t$imageObj->crop(\n\t\t\t\t\t\t$this->cropDimensions['y'],\n\t\t\t\t\t\t$this->cropDimensions['x'],\n\t\t\t\t\t\tintval( $this->newDimensions['newWidth'] - $this->_adaptiveMaxWidth - $this->cropDimensions['x']),\n\t\t\t\t\t\tintval( $this->newDimensions['newHeight'] - $this->_adaptiveMaxHeight - $this->cropDimensions['y'])\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t\t$imageObj->save($newPath);\n\t\t\t}\n\t\t\t$resizedURL = Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_MEDIA) . \"resized\" . '/' . $fileName;\n\t\t} else {\n\t\t\t$resizedURL = $imageURL;\n\t\t}\n\t\treturn $resizedURL;\n\t}", "function resizeIt(){\n\n if($this->imageSizeX<=$this->resizeX){\n $this->resizeX=$this->imageSizeX;\n }\n\n if($this->imageSizeY<=$this->resizeY){\n $this->resizeY=$this->imageSizeY;\n }\n $copy=imagecreatetruecolor($this->resizeX,$this->resizeY);\n if($copy){\n if(imagecopyresampled($copy,$this->image,0,0,0,0,$this->resizeX,$this->resizeY,$this->imageSizeX,$this->imageSizeY)){\n if(imagedestroy($this->image)){\n $this->image=$copy;\n }else{\n $this->errorState(6);\n }\n }else{\n $this->errorState(4);\n }\n }else{\n $this->errorState(5);\n }\n }", "function img_resize($type, $orig, $new, $size, $quality = 75) {\n\tglobal $cfg;\n\n\tif ($orig === '') return FALSE;\n\n\t$type = strtolower($type);\n\n\tif ($type === 'jpg') $type = 'jpeg';\n\tif (array_search($type,$cfg['image_types']) === FALSE) return FALSE;\n\n\t$width = $size;\n\t$height = $size;\n\n\tlist($width_orig,$height_orig) = getimagesize($orig);\n\n\t// If it doesn't need to be resized, copy original file\n\tif ($width_orig < $width && $height_orig < $height) {\n\t\tif (!copy($orig,$new)) return FALSE;\n\t}\n\t// Resize otherwise\n\telse {\n\t\tif ($width && ($width_orig < $height_orig)) {\n\t\t\t$width = ($height/$height_orig)*$width_orig;\n\t\t}\n\t\telse $height = ($width/$width_orig)*$height_orig;\n\n\t\t$image_p = imagecreatetruecolor($width,$height);\n\t\t$image = call_user_func('imagecreatefrom'.$type,$orig);\n\t\timagecopyresampled($image_p,$image,0,0,0,0,$width,\n\t\t\t\t\t\t\t$height,$width_orig,$height_orig);\n\n\t\tif ($type === 'jpeg') {\n\t\t\tcall_user_func('image'.$type,$image_p,$new,$quality);\n\t\t}\n\t\telse call_user_func('image'.$type,$image_p,$new);\n\t}\n\n\tchmod($new,0777); // Make sure it has proper permissions\n\n\treturn TRUE;\n}", "function getSize(){\n $imgParams=getimagesize($this->fileName);\n $this->imageSizeX=$imgParams[0];\n $this->imageSizeY=$imgParams[1];\n \n switch($imgParams[2]){\n case 1:\n $this->imageType=\"gif\";\n $this->image = imagecreatefromgif($this->fileName);\n break;\n\n case 2:\n $this->imageType=\"jpg\";\n $this->image = imagecreatefromjpeg($this->fileName);\n break;\n \n case 3:\n $this->imageType=\"png\";\n $this->image = imagecreatefrompng($this->fileName);\n break;\n \n default:\n $this->errorState(1);\n }\n \n }", "public function resizeImage($newWidth, $newHeight, $option=\"auto\"){\n $optionArray = $this->getDimensions($newWidth, $newHeight, $option);\n\n $optimalWidth = $optionArray['optimalWidth'];\n $optimalHeight = $optionArray['optimalHeight'];\n\n\n // *** Resample - create image canvas of x, y size\n $this->imageResized = imagecreatetruecolor($optimalWidth, $optimalHeight);\n imagecopyresampled($this->imageResized, $this->image, 0, 0, 0, 0, $optimalWidth, $optimalHeight, $this->width, $this->height);\n\n\n // *** if option is 'crop', then crop too\n if ($option == 'crop') {\n $this->crop($optimalWidth, $optimalHeight, $newWidth, $newHeight);\n }\n }", "function _resize_and_crop_imagemagik($width, $height)\n\t{\n\t\n\t\t//debug_message('The requested resize width is: \t'. $width);\n\t\t//debug_message('The requested resize height is: \t'. $height);\t\n\n\t\t// Are we jumping the gun here?\n\t\tif ( empty($this->temporary_image_file) || empty($this->temporary_image_type) )\n\t\t{\n\t\t\t$this->error \t= 'Cannot perform resize as no image has been checked or loaded yet.';\n\t\t\treturn false;\t\t\n\t\t}\n\t\t\n\t\t\n\t\t\n\t\t// What size of image are we resizing too?\n\t\t/*\n\t\tif ($thumbnail) { $thumb_w = $this->thumbnail_width; $thumb_h = $this->thumbnail_height; }\n\t\telse\t\t\t{ $thumb_w = $this->fullsize_width; $thumb_h = $this->fullsize_height; }\n\t\t*/\n\t\t\n\t\n\t $imagick = new \\Imagick(realpath($this->temporary_image_file));\n//\t\t$imagick->scaleImage($thumb_w, $thumb_h);\n\n\t\t// Don't attempt to be smart and resize / if it's too small, or pointless\n\t\tif ( ($width > 4) && ($height > 4) )\n\t\t{\n\t\t\t $imagick->cropThumbnailImage($width, $height);\n\t\t\t\t$imagick->setImageCompressionQuality($this->output_quality);\t\t// HACK\t\t\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$imagick->setImageCompressionQuality(90);\t\t// Keep a high quality original\t\t\n\t\t}\t\t\n\t\t\n\t\t// Output format is according to top\n\t\tswitch ($this->output_format)\n\t\t{\n\t\t\tcase 'image/gif': $imagick->setImageFormat('gif'); break;\n\t\t\tcase 'image/png': $imagick->setImageFormat('png'); break;\n\t\t\tdefault: $imagick->setImageFormat('jpeg'); break;\n\t\t}\n\t\t\n\t\t// Set the binary into the classes stores\n\t\t$this->output_binary = $imagick->getImageBlob();\n\t\t\n\t\t// All is good so return true\n\t\treturn true;\n\t\t\n\t}", "function ImageResize(\n $width,\n $height,\n $img_name,\n $tmp_name,\n $type,\n $maintain_ratio = false\n) {\n list($w, $h) = getimagesize($tmp_name);\n\n // to maintain aspect ratio of image\n if ($maintain_ratio) {\n $ratio = $w / $h;\n $size = $width;\n\n $width = $height = min($size, max($w, $h));\n\n if ($ratio < 1) {\n $width = $height * $ratio;\n } else {\n $height = $width / $ratio;\n }\n }\n\n /* Calculate new image size */\n $ratio = max($width / $w, $height / $h);\n $h = ceil($height / $ratio);\n $x = ($w - $width / $ratio) / 2;\n $w = ceil($width / $ratio);\n /* set new file name */\n $path = $img_name;\n\n /* Save image */\n if ($type == 'image/jpeg') {\n /* Get binary data from image */\n $imgString = file_get_contents($tmp_name);\n /* create image from string */\n $image = imagecreatefromstring($imgString);\n $tmp = imagecreatetruecolor($width, $height);\n imagecopyresampled($tmp, $image, 0, 0, $x, 0, $width, $height, $w, $h);\n imagejpeg($tmp, $path, 100);\n } elseif ($type == 'image/png') {\n $image = imagecreatefrompng($tmp_name);\n $tmp = imagecreatetruecolor($width, $height);\n imagealphablending($tmp, false);\n imagesavealpha($tmp, true);\n imagecopyresampled($tmp, $image, 0, 0, $x, 0, $width, $height, $w, $h);\n imagepng($tmp, $path, 0);\n } elseif ($type == 'image/gif') {\n $image = imagecreatefromgif($tmp_name);\n\n $tmp = imagecreatetruecolor($width, $height);\n $transparent = imagecolorallocatealpha($tmp, 0, 0, 0, 127);\n imagefill($tmp, 0, 0, $transparent);\n imagealphablending($tmp, true);\n\n imagecopyresampled($tmp, $image, 0, 0, 0, 0, $width, $height, $w, $h);\n imagegif($tmp, $path);\n } else {\n return false;\n }\n\n return true;\n //imagedestroy($image);\n //imagedestroy($tmp);\n}", "function imageResize($in_file, $out_file, $mode = \"\") {\n // -----------------------------------------------\n // $in_file = <string> full INput jpg FILE path\n // $out_file = <string> full OUTput jpg FILE path\n // $mode = <string> function mode:\n // \"1200\" = scale to match longer side size\n // \"200x300\" = scale to exact size (stretch)\n // \"width:300\" = scale to match width\n // \"height:300\" = scale to match height\n // \"max:200\" = scale to not exceed maximal longer side size\n\t//\t\t\"max:200x300\" = scale to not exceed maximal format size\n // \"50%\", \"scale:50%\", \"scale:0.5\" = scale image proportionaly\n\t//\t\t\"crop: 100x200\" = scale to exact size & crop to destination proportions (centered)\n // -----------------------------------------------\n // RETURNS: <boolean> 'true' for resized image save success or not necessary, 'false' if resize or saving failed.\n // -----------------------------------------------\n list($wid, $hei) = getimagesize($in_file);\n $ratio = $wid / $hei; // r = w/h, w = r*h, h = w/r\n\t\t$c_x = 0;\n\t\t$c_y = 0;\n // ====== take care about mode ======\n $mode = trim($mode);\n if((substr($mode, (strlen($mode) - 1), 1) == \"%\") && is_numeric(substr($mode), 0, (strlen($mode) - 1))) { $mode = \"scale:\".$mode; }; // \"50%\" -> \"scale:50%\"\n // ====== find new width & height ======\n if(!file_exists($in_file)) { echo \"#ERROR! imageResize() file not found!<br>\"; }\n elseif($mode == \"\") { echo \"#ERROR! imageResize() no mode specified!<br>\"; }\n elseif(is_numeric($mode)) {\n // ====== \"<longer side>\" ======\n if($wid >= $hei) {\n $n_wid = $mode;\n $n_hei = round($n_wid / $ratio);\n }\n else {\n $n_hei = $mode;\n $n_wid = round($n_hei * $ratio);\n };\n }\n elseif((count($dat = explode(\"x\", $mode)) == 2) && is_numeric($dat[0]) && is_numeric($dat[1])) {\n // ====== \"<width>x<height>\" ======\n list($n_wid, $n_hei) = $dat;\n }\n elseif(count($dat = explode(\":\", $mode)) != 2) { echo \"#ERROR! imageResize() invalid mode format!<br>\"; }\n\t\telseif($dat[0] == \"crop\") {\n\t\t\tif((count($crop = explode(\"x\", $dat[1])) == 2) && is_numeric($crop[0]) && is_numeric($crop[1])) {\n\t\t\t\t// ====== \"crop:<width>x<height>\" ======\n\t\t\t\tlist($n_wid, $n_hei) = $crop;\n\t\t\t\t$n_ratio = $n_wid / $n_hei;\n\t\t\t\tif($ratio > $n_ratio) { // by height\n\t\t\t\t\t$c_hei = $hei;\n\t\t\t\t\t$c_wid = round($c_hei * $n_ratio);\n\t\t\t\t\t$c_x = round(($wid - $c_wid) / 2.0);\n\t\t\t\t\t$c_y = 0;\n\t\t\t\t}\n\t\t\t\telse { // by width\n\t\t\t\t\t$c_wid = $wid;\n\t\t\t\t\t$c_hei = round($c_wid / $n_ratio);\n\t\t\t\t\t$c_x = 0;\n\t\t\t\t\t$c_y = round(($hei - $c_hei) / 2.0);\n\t\t\t\t};\n\t\t\t\t$wid = $c_wid;\n\t\t\t\t$hei = $c_hei;\n\t\t\t};\n\t\t}\n elseif($dat[0] == \"scale\") {\n // ====== \"scale:<scale> or <scale in precentage>%\" ======\n if(is_numeric($dat[1])) {\n\t\t\t\t$scale = $dat[1];\n\t\t\t}\n elseif((substr($dat[1], (strlen($dat[1]) - 1), 1) == \"%\") && is_numeric($scale = substr($dat[1], 0, 1))) {\n $scale = $dat[1] / 100.0;\n };\n if($scale != 1.0) {\n $n_wid = $wid;\n $n_hei = $hei;\n $n_wid = round($wid * $scale);\n $n_hei = round($hei * $scale);\n };\n }\n elseif($dat[0] == \"max\") {\n\t\t\tif(is_numeric($dat[1])) {\n\t\t\t\t// ====== \"max:<maximal longer side>\" ======\n\t\t\t\tif(($wid >= $hei) && ($wid > $dat[1])) {\n\t\t\t\t\t$n_wid = $dat[1];\n\t\t\t\t\t$n_hei = round($n_wid / $ratio);\n\t\t\t\t}\n\t\t\t\telseif(($hei > $wid) && ($hei > $dat[1])) {\n\t\t\t\t\t$n_hei = $dat[1];\n\t\t\t\t\t$n_wid = round($n_hei * $ratio);\n\t\t\t\t}\n else {\n $n_wid = $wid;\n $n_hei = $hei;\n };\n\t\t\t}\n\t\t\telseif((count($max = explode(\"x\", $dat[1])) == 2) && is_numeric($max[0]) && is_numeric($max[1])) {\n\t\t\t\t// ====== \"max:<width>x<height>\" ======\n\t\t\t\tlist($n_wid, $n_hei) = $max;\n\t\t\t\t$n_ratio = $n_wid / $n_hei; // r = w/h, w = r*h, h = w/r\n\t\t\t\tif(($n_ratio > $ratio) && ($hei > $n_hei)) {\n\t\t\t\t\t$n_wid = round($n_hei * $ratio);\n\t\t\t\t}\n\t\t\t\telseif(($n_ratio < $ratio) && ($wid > $n_wid)) {\n\t\t\t\t\t$n_hei = round($n_wid / $ratio);\n\t\t\t\t}\n else {\n $n_wid = $wid;\n $n_hei = $hei;\n };\n\t\t\t};\n }\n elseif(!is_numeric($dat[1])) { echo \"#ERROR! imageResize() non numeric value!<br>\"; }\n elseif($dat[0] == \"width\") {\n // ====== \"width:<width>\" ======\n $n_wid = $dat[1];\n $n_hei = round($n_wid / $ratio);\n }\n elseif($dat[0] == \"height\") {\n // ====== \"height:<height>\" ======\n $n_hei = $dat[1];\n $n_wid = round($n_hei * $ratio);\n }\n else { echo \"#ERROR! imageResize() unknown mode!<br>\"; };\n // =================================\n // Resize & save image\n // =================================\n if($n_wid && $n_hei) {\n $ext = pathinfo($in_file);\n $ext = strtolower($ext['extension']);\n if(in_array($ext, array(\"jpg\", \"jpeg\"))) {\n $image = imagecreatetruecolor($n_wid, $n_hei);\n $in_file = imagecreatefromjpeg($in_file);\n imagecopyresized($image, $in_file, 0, 0, $c_x, $c_y, $n_wid, $n_hei, $wid, $hei);\n return (imagejpeg($image, $out_file));\n }\n elseif($ext == \"png\") {\n $image = imagecreatetruecolor($n_wid, $n_hei);\n $in_file = imagecreatefrompng($in_file);\n imagealphablending( $image, false );\n imagesavealpha( $image, true );\n imagecopyresized($image, $in_file, 0, 0, $c_x, $c_y, $n_wid, $n_hei, $wid, $hei);\n \n return (imagepng($image, $out_file, 9));\n }\n elseif($ext == \"gif\") {\n $image = imagecreatetruecolor($n_wid, $n_hei);\n $in_file = imagecreatefromgif($in_file);\n imagealphablending( $out_file, false );\n imagesavealpha( $out_file, true );\n imagecopyresized($image, $in_file, 0, 0, $c_x, $c_y, $n_wid, $n_hei, $wid, $hei);\n return (imagegif($image, $out_file));\n }\n }\n else {\n return false;\n };\n }", "public function resize()\n\t{\n\t\t// get post body json data\n\t\t$data = $this->request->getJsonRawBody();\n\n\t\tif (!isset($data->contents) || !isset($data->config))\n\t\t\t$this->jsonResponse(400, \"Missing contents & config json props.\");\n\n\t\tif (empty($data->config->filename) || empty($data->config->resize))\n\t\t\t$this->jsonResponse(400, \"Missing filename/resize property config.\");\n\n\t\tif (strpos($data->config->filename, \"/\") !== false)\n\t\t\t$this->jsonResponse(400, \"Filename can't contains slashes.\");\n\n\t\ttry {\n\n\t\t\t$filepath = self::UPLOAD_PATH.$data->config->filename;\n\n\t\t\tfile_put_contents($filepath, base64_decode($data->contents));\n\n\t\t\t$this->logger->debug(\"CoreController::resize -> resizing image [\".strlen($data->contents).\"]: \".json_encode($data->config->resize));\n\n\t\t\t// resize images\n\t\t\t$resized = Images::resize($filepath, $data->config->resize);\n\t\t\t// optimize images\n\t\t\t$this->_optimizer($resized);\n\t\t\t// push files to s3\n\t\t\t$response = $this->_pushFiles($filepath, $data->config);\n\n\t\t}\n\t\tcatch (\\Exception | Exception $e) {\n\n\t\t\t$response = $e->getMessage();\n\n\t\t\t$this->logger->error(\"CoreController::resize -> An error ocurred: $response\");\n\t\t}\n\n\t\t// clean old files\n\t\t$this->_cleanFiles();\n\n\t\t$this->logger->debug(\"CoreController::resize -> sending response [\".strlen($data->contents).\"]: \".json_encode($response, JSON_UNESCAPED_SLASHES));\n\n\t\t$this->jsonResponse(200, $response);\n\t}", "public function resizeProportional($newWidth = null, $newHeight = null)\n { \n if (null !== $newWidth && null !== $newHeight) {\n $aspectRatio = $newWidth / $newHeight;\n \n if ($aspectRatio !== $this->_aspectRatio) {\n \t// TODO: translate\n throw new Exception('Unable to proportionally resize image, invalid width and height given. Both given - invalid aspect ratio of destination image.');\n }\n }\n \n $createImageFunction = $this->_imageTypes[$this->_size['mime']]['createFunction'];\n $saveImageFunction = $this->_imageTypes[$this->_size['mime']]['saveFunction'];\n \n // do we have already changed image?\n if (null !== $this->_image) {\n $source = $this->_image;\n } else {\n $source = $createImageFunction($this->_path . DIRECTORY_SEPARATOR . $this->_name);\n }\n \n // determine new dimensions\n if (null !== $newWidth) {\n $newHeight = (int) ($newWidth / $this->_aspectRatio);\n } else {\n $newWidth = (int) ($newHeight * $this->_aspectRatio);\n }\n \n $resizedImage = imagecreatetruecolor($newWidth, $newHeight);\n \n $resizeFunctionName = ($this->_hq) ? 'imagecopyresampled' : 'imagecopyresized';\n \n if (!$resizeFunctionName($resizedImage, $source, 0, 0, 0, 0, $newWidth, $newHeight, $this->_size[0], $this->_size[1])) {\n \t// TODO: translate\n throw new Exception('Failed resizing image.');\n } else {\n $this->_image = $resizedImage;\n $this->_size[0] = $newWidth;\n $this->_size[1] = $newHeight;\n $this->_size[3] = 'width=\"' . $newWidth . '\" height=\"' . $newHeight . '\"';\n }\n \n return $this;\n }", "public function showAction($type = 1, $w = 0, $h = 0, $name, $path = '') {\n\t\t// max image size 900x600\n\t\t// image_resize_min_width: \t\t30\n\t\t// image_resize_min_height: \t20\n\t\t// image_resize_max_width: \t\t2600\n\t\t// image_resize_max_height: \t1950\n\n\t\t$minwidth \t= 0;\n\t\t$minheight \t= 0;\n\t\t$maxwidth \t= 2600;\n\t\t$maxheight \t= 1950;\n\n\t\tif (Config::has('parameters.image_resize_min_width')) {\n\t\t\t$minwidth = Config::get('parameters.image_resize_min_width');\n\t\t}\n\n\t\tif (Config::has('parameters.image_resize_min_height')) {\n\t\t\t$minheight = Config::get('parameters.image_resize_min_height');\n\t\t}\n\n\t\tif (Config::has('parameters.image_resize_max_width')) {\n\t\t\t$maxwidth = Config::get('parameters.image_resize_max_width');\n\t\t}\n\n\t\tif (Config::has('parameters.image_resize_max_height')) {\n\t\t\t$maxheight = Config::get('parameters.image_resize_max_height');\n\t\t}\n\n\t\t$width = max($minwidth, min($w, $maxwidth));\n\t\t$height = max($minheight, min($h, $maxheight));\n\n\t\ttry {\n \n\t\t\t$data_dir = $this->getDataDir() . DIRECTORY_SEPARATOR . GalleryItem::getFolder($type) . DIRECTORY_SEPARATOR;\n\t\t\t$photo_dir = $this->getPhotoDir() . DIRECTORY_SEPARATOR . GalleryItem::getFolder($type) . DIRECTORY_SEPARATOR;\n\n\t\t\t$src = $data_dir . $name;\n \n\t\t\tif (!file_exists($src)) {\n \n\t\t\t\t$color = 'eeeeee';\n\t\t\t\tif (Config::has('parameters.image_resize_color')) {\n\t\t\t\t\t$color = Config::get('parameters.image_resize_color');\n\t\t\t\t}\n\n\t\t\t\t$img = imagecreate($w, $h);\n\t\t\t\t$color = imagecolorallocate($img, hexdec(substr($color, 0, 2)), hexdec(substr($color, 2, 2)), hexdec(substr($color, 4, 2)));\n\t\t\t\timagefill($img, 0, 0, $color);\n\t\t\t\theader('Content-Type: image/jpeg');\n\t\t\t\timagejpeg ($img);\n\t\t\t\timagedestroy($img);\n\n\t\t\t\texit;\n\t\t\t}\n\n\t\t\t$info = getimagesize($src);\n\n\t\t\tif ($info) {\n\n\t\t\t\t$destination_dir = $photo_dir . $width . 'x' . $height . DIRECTORY_SEPARATOR;\n\n\t\t\t\t$destination = $destination_dir . $name;\n\n\t\t\t\tif (!file_exists($destination_dir)) {\n\t\t\t\t\tmkdir($destination_dir, 0777, true);\n\t\t\t\t} else {\n\t\t\t\t\t//\t\tchmod( $destination_dir, 0777 );\n\t\t\t\t}\n\n\t\t\t\tif ($width == 0 && $height == 0) {\n\t\t\t\t\t$no_resize = TRUE;\n\t\t\t\t} else if ($width == 0 || $height == 0) {\n\n\t\t\t\t\t$no_resize = FALSE;\n\t\t\t\t\t$resize_type = ImageTools::FIT_AND_EXPAND;\n\n\t\t\t\t\t$w = $info[0];\n\t\t\t\t\t$h = $info[1];\n\n\t\t\t\t\tif ($height == 0) {\n\t\t\t\t\t\t$ar = $width / $w;\n\t\t\t\t\t\t$height = $h * $ar;\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$ar = $height / $h;\n\t\t\t\t\t\t$width = $w * $ar;\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t$no_resize = FALSE;\n\t\t\t\t\t$resize_type = ImageTools::TARGET_ASPECT_RATIO;\n\t\t\t\t}\n\n\t\t\t\tif (!$no_resize) {\n\t\t\t\t\t$quality = 80;\n\t\t\t\t\tif (Config::has('parameters.image_resize_quality')) {\n\t\t\t\t\t\t$quality = Config::get('parameters.image_resize_quality');\n\t\t\t\t\t}\n\n\t\t\t\t\t$success = ImageTools::resizeImage($src, $destination, $width, $height, $resize_type, $quality);\n\t\t\t\t} else {\n\t\t\t\t\t$success = copy($src, $destination);\n\t\t\t\t}\n\n\t\t\t\t//\tchmod( $destination, 0776 );\n\t\t\t\t//\t\tchmod( $photo_dir, 0775 );\n\n\t\t\t\tif ($success) {\n\t\t\t\t\t$fp = fopen($destination, 'rb');\n\t\t\t\t\tif ($fp) {\n\t\t\t\t\t\t$time = 60 * 60 * 24;\n\t\t\t\t\t\theader(\"Cache-Control: private, max-age={$time}, pre-check={$time}\");\n\t\t\t\t\t\theader('Content-Type: image/jpeg');\n\t\t\t\t\t\tfpassthru($fp);\n\n\t\t\t\t\t\texit;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t} catch (\\Exception $e) {\n\t\t\techo $e->getMessage();\n\t\t\texit;\n\t\t\treturn new Response('Server Error', 500);\n\t\t}\n\n\t\t$reponse->setPublic();\n\t\t$reponse->setPrivate();\n\n\t\t$time = 60 * 60 * 24;\n\n\t\t// set the private or shared max age\n\t\t$reponse->setMaxAge($time);\n\t\t$reponse->setSharedMaxAge($time);\n\n\t\treturn $reponse;\n\t}", "private function resolveSize($img, $size)\n {\n $size = config(implode('.', [self::IMAGE_SIZES_CONFIG, $size]));\n\n if ($size) {\n $width = empty($size['width']) ? null : intval($size['width']);\n $height = empty($size['height']) ? null : intval($size['height']);\n $mode = bindec(intval(!empty($width)) . intval(!empty($height)));\n\n switch ($mode) {\n case self::RESIZE_AND_CROP:\n $img->fit($width, $height, function ($constraint) {\n $constraint->upsize();\n });\n break;\n case self::RESIZE_WIDTH:\n $img->resize($width, null, function ($constraint) {\n $constraint->aspectRatio();\n $constraint->upsize();\n });\n break;\n case self::RESIZE_HEIGHT:\n $img->resize(null, $height, function ($constraint) {\n $constraint->aspectRatio();\n $constraint->upsize();\n });\n break;\n default:\n break;\n }\n }\n\n return $img;\n }" ]
[ "0.68175167", "0.6504787", "0.6418391", "0.61382186", "0.6093467", "0.6045653", "0.60064185", "0.60024494", "0.5991972", "0.5967251", "0.59587866", "0.59520465", "0.59156346", "0.58937305", "0.5861466", "0.5820071", "0.5819928", "0.57357085", "0.5729919", "0.571957", "0.57097834", "0.56932044", "0.56850386", "0.56754196", "0.5659002", "0.5655839", "0.5652721", "0.56281614", "0.56221545", "0.56196856" ]
0.74064523
0
Sets Imagick by $this>currentFileLocation
private function setImagick() { $this->imagick = new Imagick($this->currentFileLocation); $this->setImageFormat(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function setCurrentFile($current_filepath)\n {\n $this->current_file = new FileInfo($current_filepath, $this);\n }", "public function current()\n {\n $this->_logDebug('Horde_Image_Imagick#current');\n $params = array('data' => $this->raw());\n $image = new Horde_Image_Imagick($params, $this->_context);\n\n return $image;\n }", "private function setOutputPath(){\n\t\tif(\n\t\t\t( (!$this->useOriginalSize()) || (!$this->hasOriginalType() ) ) &&\n\t\t\twe_base_imageEdit::gd_version() > 0 &&\n\t\t\twe_base_imageEdit::is_imagetype_supported($this->outputFormat) &&\n\t\t\twe_base_imageEdit::is_imagetype_read_supported(\n\t\t\t\tisset(we_base_imageEdit::$GDIMAGE_TYPE[strtolower($this->imageExtension)]) ?\n\t\t\t\t\twe_base_imageEdit::$GDIMAGE_TYPE[strtolower($this->imageExtension)] : ''\n\t\t\t)\n\t\t){\n\t\t\t$this->outputPath = self::getThumbDirectory() . '/' . $this->imageID . '_' . $this->thumbID . '_' . $this->imageFileName . '.' . $this->outputFormat;\n\t\t} else {\n\t\t\t$this->outputPath = $this->imagePath;\n\t\t}\n\t}", "private function saveCurrentShape()\n\t{\n\t\t$this->settings->currentShape = $this->currentShape;\n\t}", "function setImageFile($filePath);", "protected function setImage(){\n\t\tif($this->deviceID === false){\n\t\t\t$this->image = null;\n\t\t\treturn;\n\t\t}\n\t\tif(!file_exists($this->imagesDirectory)){\n\t\t\t$realpath = @realpath($this->imagesDirectory);\n\t\t\tif(!$realpath){\n\t\t\t\tif($this->imagesDirectory[0]=='.'){\n\t\t\t\t\tthrow new Exception(\"Error: the local images directory was specified as a relative path ($this->imagesDirectory), but could not be resolved. Current directory: \".getcwd());\n\t\t\t\t\texit(1);\n\t\t\t\t}else{\n\t\t\t\t\tthrow new Exception(\"Error: the local images directory specified does not exist: \".$this->imagesDirectory);\n\t\t\t\t\texit(1);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif(!$this->imageExists($this->deviceID)){\n\t\t\tif($this->descend){\n\t\t\t\t// Check fall back tree for an alternate image, starting at the current device, working back to generic\n\t\t\t\tforeach(array_reverse(explode(',',$this->wurfl->capabilities['tera_wurfl']['fall_back_tree'])) as $parentID){\n\t\t\t\t\tif($this->imageExists($parentID)){\n\t\t\t\t\t\t$this->image = $this->baseURL . $parentID . $this->imageExt;\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t$this->image = null;\n\t\t\treturn;\n\t\t}\n\t\t$this->image = $this->baseURL . $this->deviceID . $this->imageExt;\n\t}", "protected function openCurrentFile()\n {\n if($this->files->valid()) {\n $this->resource = fopen($this->files->current(), 'r');\n }\n }", "public function setImage (Imagick $replace) {}", "function set_path(){\n # - recognise operating systems, or something\n \n $path = $this->file_path;\n \n return $path;\n }", "function setPath($f) {\n $this->file = $f;\n }", "public function set_path() {\n\t\t$this->path = $this->get_base_path( explode( $this->path_delimiter , plugin_dir_path( __FILE__ ) ) );\n\t}", "public function getCurrentFile()\n {\n return $this->current_file;\n }", "public function setAsCurrent();", "public function originalImage($file, $current_name)\n {\n $accountOriginalDestination = 'uploads/images/original/';\n\n Image::make($file)->save($accountOriginalDestination . $current_name);\n }", "function setImagePath( $value )\r\n {\r\n $this->ImagePath = $value;\r\n }", "public function current() {\n\t\treturn $this->currentFile;\n\t}", "private function setCurrentFileIndex() {\n \t$index = 0;\n \tforeach ($this->fileNamesInFolder as $f) {\n \tif ($f == $this->fileName) {\n \t$this->currentFileIndex = $index;\n\t\t\t}\n \t$index++;\n \t}\n\t}", "public function reload() {\n if ($this->_isFile) {\n if (!file_exists($this->_source)) {\n $this->_image = $this->_copy;\n } else {\n $this->_init($this->_source);\n }\n } else {\n $this->_init($this->_source);\n }\n $this->_calculate();\n }", "private function setImageFormat()\n {\n if (empty($this->imageFormat)) {\n $fileMimeType = mime_content_type($this->currentFileLocation);\n $this->imageFormat = mb_substr($fileMimeType, mb_strrpos($fileMimeType, '/') + 1);\n }\n\n if (stristr($this->imageFormat, 'svg')) {\n $this->imageFormat = 'svg';\n }\n\n $this->imageFormat = mb_strtolower($this->imageFormat);\n\n if (mb_strtolower($this->imagick->getImageFormat()) != $this->imageFormat) {\n $this->imagick->setImageFormat($this->imageFormat);\n }\n }", "#[\\ReturnTypeWillChange]\n public function current()\n {\n return new FileResource(parent::current()->getPathname());\n }", "public function setCurrent($file, $refill=false) {\n\t\tif ($file || !$refill)\n\t\t\t$this->cfg->current = $file;\n\t}", "public function &setPath($filename){\n\t\t$this->filename = $this->rawFilename = $filename;\n\t\t/**\n\t\t* And we MUST set full path in ->filename because after f.e. chdir(...) relative path may change sense.\n\t\t* Additionally, in __destruct call to getcwd return '/'!!! {@See http://bugs.php.net/bug.php?id=30210}\n\t\t**/\n\t\t// We can't direct use $this->filename instead of $realpath because if it ! we not always want null it!\n\t\tif (!($realpath = realpath($this->rawFilename))){\n\t\t\t/**\n\t\t\t* Realpath may fail because file not found. But we can't agree with that,\n\t\t\t* because setPath may be invoked to set path for write new (create) file!\n\t\t\t* So, we try manually construct current full path (see abowe why we should do it)\n\t\t\t**/\n\t\t\tif (! OS::isPathAbsolute($this->rawFilename)){\n\t\t\t\t$this->filename = getcwd() . DIRECTORY_SEPARATOR . $this->rawFilename;\n\t\t\t}\n\t\t}\n\t\telse $this->filename = $realpath;\n\t\treturn $this;\n\t}", "public function getCurrentFile()\n\t{\n\t\treturn $this->_current_file;\n\t}", "public function setBaseFile($file)\n {\n $this->_isBaseFilePlaceholder = false;\n\n if (($file) && (0 !== strpos($file, '/', 0))) {\n $file = '/' . $file;\n }\n $baseDir = Mage::getSingleton('xmlconnect/catalog_category_media_config')->getBaseMediaPath();\n\n if ('/no_selection' == $file) {\n $file = null;\n }\n if ($file) {\n if ((!file_exists($baseDir . $file)) || !$this->_checkMemory($baseDir . $file)) {\n $file = null;\n }\n }\n if (!$file) {\n // check if placeholder defined in config\n $isConfigPlaceholder = Mage::getStoreConfig(\n 'catalog/placeholder/' . $this->getDestinationSubdir() . '_placeholder'\n );\n $configPlaceholder = '/placeholder/' . $isConfigPlaceholder;\n if ($isConfigPlaceholder && file_exists($baseDir . $configPlaceholder)) {\n $file = $configPlaceholder;\n } else {\n // replace file with skin or default skin placeholder\n $skinBaseDir = Mage::getDesign()->getSkinBaseDir();\n $skinPlaceholder = '/images/xmlconnect/catalog/category/placeholder/' . $this->getDestinationSubdir()\n . '.jpg';\n\n $file = $skinPlaceholder;\n if (file_exists($skinBaseDir . $file)) {\n $baseDir = $skinBaseDir;\n } else {\n $baseDir = Mage::getDesign()->getSkinBaseDir(array('_theme' => 'default'));\n if (!file_exists($baseDir . $file)) {\n $baseDir = Mage::getDesign()->getSkinBaseDir(\n array('_theme' => 'default', '_package' => 'base')\n );\n }\n }\n }\n $this->_isBaseFilePlaceholder = true;\n }\n\n $baseFile = $baseDir . $file;\n\n if ((!$file) || (!file_exists($baseFile))) {\n Mage::throwException(Mage::helper('xmlconnect')->__('Image file was not found.'));\n }\n\n $this->_baseFile = $baseFile;\n\n // build new filename (most important params)\n $path = array(Mage::getSingleton('xmlconnect/catalog_category_media_config')->getBaseMediaPath(),\n 'cache', Mage::app()->getStore()->getId(), $path[] = $this->getDestinationSubdir());\n\n if ((!empty($this->_width)) || (!empty($this->_height))) {\n $path[] = \"{$this->_width}x{$this->_height}\";\n }\n\n // add misk params as a hash\n $miscParams = array(\n ($this->_keepAspectRatio ? '' : 'non') . 'proportional',\n ($this->_keepFrame ? '' : 'no') . 'frame',\n ($this->_keepTransparency ? '' : 'no') . 'transparency',\n ($this->_constrainOnly ? 'do' : 'not') . 'constrainonly',\n $this->_rgbToString($this->_backgroundColor),\n 'angle' . $this->_angle,\n 'quality' . $this->_quality\n );\n\n // if has watermark add watermark params to hash\n if ($this->getWatermarkFile()) {\n $miscParams[] = $this->getWatermarkFile();\n $miscParams[] = $this->getWatermarkImageOpacity();\n $miscParams[] = $this->getWatermarkPosition();\n $miscParams[] = $this->getWatermarkWidth();\n $miscParams[] = $this->getWatermarkHeigth();\n }\n\n $path[] = md5(implode('_', $miscParams));\n\n // append prepared filename\n $this->_newFile = implode('/', $path) . $file; // the $file contains heading slash\n\n return $this;\n }", "function setCurrentPath($path) {\n\t\t$_SESSION['currentPath'] = $path;\n\t}", "public function image_path() {\n\t return $this->location;\n\t}", "protected function getCurrentFilePath(): string {\n if($this->currentFilePath === null) {\n $this->currentFilePath = $this->getNewFilePath();\n }\n return $this->currentFilePath;\n }", "public function setIoncubePath($value)\n {\n $this->ioncubePath = $value;\n }", "protected function _setDefaultFile() {\n\t\t$this->_file = dirname(__FILE__) . \"/\" . $this->_type . \"/crosswalk\"; \n\t}", "public function setPath( $path );" ]
[ "0.65289426", "0.5966249", "0.5945916", "0.5825675", "0.57113016", "0.5700006", "0.56654257", "0.5647155", "0.5455588", "0.5419807", "0.54188484", "0.5382421", "0.5369982", "0.5353557", "0.53466666", "0.5319866", "0.5315768", "0.53041255", "0.5302217", "0.5257064", "0.5251966", "0.5241451", "0.5238377", "0.5215324", "0.52019393", "0.5182821", "0.5179822", "0.51780134", "0.5138664", "0.5134257" ]
0.71053535
0
If $this>imageFormat is empty, sets it to the format of $this>currentFileLocation. If the format of $this>currentFileLocation is not the same as $this>imageFormat, sets the Imagick format to $this>imageFormat.
private function setImageFormat() { if (empty($this->imageFormat)) { $fileMimeType = mime_content_type($this->currentFileLocation); $this->imageFormat = mb_substr($fileMimeType, mb_strrpos($fileMimeType, '/') + 1); } if (stristr($this->imageFormat, 'svg')) { $this->imageFormat = 'svg'; } $this->imageFormat = mb_strtolower($this->imageFormat); if (mb_strtolower($this->imagick->getImageFormat()) != $this->imageFormat) { $this->imagick->setImageFormat($this->imageFormat); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function setImageFormat ($format) {}", "public function setImageFormat($format) {\n\t}", "public final function convert(string $format){\n\t\tswitch($format){\n\t\t\tdefault:\n\t\t\tcase 'JPEG':\n\t\t\t\t$this->image_mime = IMAGETYPE_JPEG;\n\t\t\tbreak;\n\t\t\tcase 'PNG':\n\t\t\t\t$this->image_mime = IMAGETYPE_PNG;\n\t\t\tbreak;\n\t\t\tcase 'GIF':\n\t\t\t\t$this->image_mime = IMAGETYPE_GIF;\n\t\t\tbreak;\n\t\t}\n\t\treturn $this;\n\t}", "protected function _setFormat()\n {\n $this->format = $this->identifier->getFormatByFile($this->file);\n\n return $this;\n }", "public function setImageFormat($format = 'jpg')\n {\n if ( ! $this->imagick->setImageFormat($format)) {\n throw new \\ImagickException('Error while setting image format.');\n }\n }", "public function getImageFormat() {\n\t}", "private function setImagick()\n {\n $this->imagick = new Imagick($this->currentFileLocation);\n\n $this->setImageFormat();\n }", "public function getImageFormat () {}", "public function getFormat()\n {\n return $this->image->getImageFormat();\n }", "public function setFormat ($format) {}", "private function setOutputPath(){\n\t\tif(\n\t\t\t( (!$this->useOriginalSize()) || (!$this->hasOriginalType() ) ) &&\n\t\t\twe_base_imageEdit::gd_version() > 0 &&\n\t\t\twe_base_imageEdit::is_imagetype_supported($this->outputFormat) &&\n\t\t\twe_base_imageEdit::is_imagetype_read_supported(\n\t\t\t\tisset(we_base_imageEdit::$GDIMAGE_TYPE[strtolower($this->imageExtension)]) ?\n\t\t\t\t\twe_base_imageEdit::$GDIMAGE_TYPE[strtolower($this->imageExtension)] : ''\n\t\t\t)\n\t\t){\n\t\t\t$this->outputPath = self::getThumbDirectory() . '/' . $this->imageID . '_' . $this->thumbID . '_' . $this->imageFileName . '.' . $this->outputFormat;\n\t\t} else {\n\t\t\t$this->outputPath = $this->imagePath;\n\t\t}\n\t}", "public function fileFormat($fileFormat) {\n $this->fileFormat = $fileFormat;\n }", "public function setFormat($format) {\n\t}", "function setFormat($format) {\n $this->format = $format;\n }", "public function getImageFormat() {\n return Mage::getStoreConfig('ls_instagram/general_feed_setup/image_format');\n }", "public function setFormat($format);", "public function setFormat($format);", "function output($format = null, $quality = null) {\n\n // Determine quality\n $quality = $quality ?: $this->quality;\n\n // Determine mimetype\n switch (strtolower($format)) {\n case 'gif':\n $mimetype = 'image/gif';\n break;\n case 'jpeg':\n case 'jpg':\n imageinterlace($this->image, true);\n $mimetype = 'image/jpeg';\n break;\n case 'png':\n $mimetype = 'image/png';\n break;\n default:\n $info = (empty($this->imagestring)) ? getimagesize($this->filename) : getimagesizefromstring($this->imagestring);\n $mimetype = $info['mime'];\n unset($info);\n break;\n }\n\n // Output the image\n header('Content-Type: '.$mimetype);\n switch ($mimetype) {\n case 'image/gif':\n imagegif($this->image);\n break;\n case 'image/jpeg':\n imageinterlace($this->image, true);\n imagejpeg($this->image, null, round($quality));\n break;\n case 'image/png':\n imagepng($this->image, null, round(9 * $quality / 100));\n break;\n default:\n throw new Exception('Unsupported image format: '.$this->filename);\n break;\n }\n }", "function init() {\n\t\t//check to see if file exists\n\t\tif(!file_exists($this->fileName)) {\n\t\t\t$this->errmsg = \"File not found:\".$this->fileName;\n\t\t\t$this->error = true;\n\t\t}\n\t\t//check to see if file is readable\n\t\telseif(!is_readable($this->fileName)) {\n\t\t\t$this->errmsg = \"File is not readable\";\n\t\t\t$this->error = true;\n\t\t}\n\t\t\n\t\t//determine file extension\n\t\tif($this->error == false) {\n\t\t\t//check if gif\n\t\t\tif(stristr(strtolower($this->fileName),'.gif')) $this->format = 'GIF';\n\t\t\t//check if jpeg\n\t\t\telseif(stristr(strtolower($this->fileName),'.jpg') || stristr(strtolower($this->fileName),'.jpeg')) $this->format = \"JPG\";\n\t\t\t//check if png\n\t\t\telseif(stristr(strtolower($this->fileName),'.png')) $this->format = 'PNG';\n\t\t\t//unknown file format\n\t\t\telse {\n\t\t\t\t$this->errmsg = \"Unknown file format\";\n\t\t\t\t$this->error = true;\n\t\t\t}\n\t\t}\n\t\t\n\t\t//catch user forgetting to specify size paramenters\n\t\tif($this->maxWidth == 0 && $this->maxHeight == 0 && $this->percent == 0) $this->percent = 100;\n\t\t\n\t\tif($this->error == false) {\n\t\t\tswitch($this->format) {\n\t\t\t\tcase \"GIF\":\n\t\t\t\t\t$this->oldImage = ImageCreateFromGif($this->fileName);\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"JPG\":\n\t\t\t\t\t$this->oldImage = ImageCreateFromJpeg($this->fileName);\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"PNG\":\n\t\t\t\t\t$this->oldImage = ImageCreateFromPng($this->fileName);\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t\t$size = GetImageSize($this->fileName);\n\t\t\t$this->currentDimensions = array(\"width\"=>$size[0],\"height\"=>$size[1]);\n\t\t\t$this->newImage = $this->oldImage;\n\t\t}\n\t\t\n\t\tif($this->error) {\n\t\t\t//$this->showErrorImage();\n\t\t\techo $this->errmsg;\n\t\t\texit;\n\t\t}\n\t}", "function getFormat()\n\t{\n\t\treturn $this->_format;\n\t}", "public function setFormat($format)\n {\n $this->_format = $format;\n }", "public function setFormat($format) {\n $this->format = $format;\n }", "public function setFormat($format = null)\n {\n if (null === $format || (is_object($format) && !method_exists($format, '__toString'))) {\n $format = $this->defaultFormat;\n }\n $this->format = (string)$format;\n }", "public function setFormat($format) {\n\t\t\tif($this->isValidFormat(strtolower($format))) {\n\t\t\t\t$this->format = $format;\n\t\t\t}\n\t\t}", "public function setFileFormat($fileFormat)\n {\n $this->fileFormat = $fileFormat;\n return $this;\n }", "public function getFormattedImage($format) {\n\t\t$args = func_get_args();\n\t\t\n\t\tif ($this->ID && $this->Filename && Director::fileExists($this->Filename)) {\n\t\t\t$cacheFile = call_user_func_array(array($this, \"cacheFilename\"), $args);\n\t\t\t$filename = Director::baseFolder() . \"/\" . $cacheFile;\n\t\t\t$filename = $this->insertFilenameAppender($filename, '-10x');\n\t\t\tif (!file_exists($filename) || isset($_GET['flush'])) {\n\t\t\t\tcall_user_func_array(array($this, \"generateFormattedImage\"), $args);\n\t\t\t} else {\n\t\t\t\t$this->adaptiveimages['1.0'] = $this->insertFilenameAppender($cacheFile, '-10x');\n\t\t\t\t$this->adaptiveimages['1.5'] = $this->insertFilenameAppender($cacheFile, '-15x');\n\t\t\t\t$this->adaptiveimages['2.0'] = $this->insertFilenameAppender($cacheFile, '-20x');\n\t\t\t}\n\n\t\t\t$cached = RetinaImage_Cached::create($cacheFile);\n\t\t\t// Pass through the title so the templates can use it\n\t\t\t$cached->Title = $this->Title;\n\t\t\t// Pass through the parent, to store cached images in correct folder.\n\t\t\t$cached->ParentID = $this->ParentID;\n\t\t\t\n\t\t\treturn $cached;\n\t\t}\n\t}", "public function setFormat($format)\n {\n $this->format = $format;\n }", "public function setFormat($format)\n {\n $this->format = $format;\n }", "public function setFormat($format)\n {\n $this->format = $format;\n }", "public function setMapFormat($format=\"GIF\")\n\t{\n\t\t$this->format = strtoupper($format);\n\t}" ]
[ "0.6974066", "0.67446584", "0.6342574", "0.617353", "0.60709643", "0.6033631", "0.58201444", "0.573718", "0.5654405", "0.56420225", "0.5631944", "0.5519645", "0.5504208", "0.54780626", "0.5422494", "0.53737533", "0.53737533", "0.53522694", "0.5324293", "0.5310843", "0.5307524", "0.52880245", "0.5233596", "0.52334565", "0.5228968", "0.5209458", "0.52042174", "0.52042174", "0.52042174", "0.52027476" ]
0.78983784
0
Checks if image exists in database by given hash(md5 of the file)
private function isExistingImage(string $md5) { if ($res = $this->getAll(0, "`hash` = '{$md5}'")) { return current($res); } return ''; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function image_exists($iid) {\n\t\t$r = $this->db->query(sprintf(\"SELECT img_id FROM images WHERE img_path='%d'\",$iid));\n\t\t$ret = $r->fetchObject(); $r = null;\t\n\n\t\tif(is_object($ret) && $ret->img_id) {\n\t\t\tif(md5_file($ret->img_path) != $ret->img_sum) {\n\t\t\t\treturn -1;\n\t\t\t} else {\n\t\t\t\treturn $ret->img_id;\n\t\t\t}\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}", "function checkExistingImage($img_name){\n // Create a connection object from the eaglemotors connection function\n $db = eaglemotorsConnect(); \n $sql = \"SELECT img_name FROM images WHERE img_name = :img_name\";\n // Create the prepared statement using the eaglemotors connection\n $stmt = $db->prepare($sql);\n $stmt->bindValue(':img_name', $img_name, PDO::PARAM_STR);\n // Run the query \n $stmt->execute();\n // Count how many rows were changed\n $imageMatch = $stmt->fetch(); \n // Close the database interaction\n $stmt->closeCursor();\n // Return the result that was found, if any. \n return $imageMatch; \n }", "public function exists($image_id);", "function imagematches ($hash) {\n\t\t$x = $this->query('?action=query&list=allimages&format=php&aisha1='.$hash);\n\t\treturn count($x['query']['allimages']);\n }", "function checkIfImageExists($id) {\n $servername = \"localhost\";\n $db_username = \"php_projekt\";\n $db_password = \"php_projekt\";\n $dbname = \"awd_projekt\";\n \n $conn = new mysqli($servername, $db_username, $db_password, $dbname);\n //Check if the connection succeeded, otherwise abort\n if ($conn->connect_error) {\n //An error occured, return FALSE for error handling\n $errorMessage = \"We're sorry, there was an error trying to establish a connection to our database. Please try again later.\";\n echo \"ERROR\";\n return;\n }\n \n //Get row where username or email exists\n $sql = \"SELECT COUNT(`ID`) AS IMG_EXISTS FROM `image` WHERE `ID` = \".$id;\n \n $result = $conn->query($sql);\n \n $row = $result->fetch_assoc();\n \n if($row[\"IMG_EXISTS\"] == 1) {\n return true;\n } else {\n return false;\n }\n}", "function checkExistingImage($name) {\n $db = shoesDB();\n $sql = \"SELECT name FROM images WHERE name = :name\";\n $stmt = $db->prepare($sql);\n $stmt->bindValue(':name', $name, PDO::PARAM_STR);\n $stmt->execute();\n $imageMatch = $stmt->fetch();\n $stmt->closeCursor();\n return $imageMatch;\n}", "protected function isFileExist($md5file){\n $mFiles = new Application_Model_DbTable_Files();\n $rFile = $mFiles ->fetchRow($mFiles -> select() -> where ('md5_hash = ?' , $md5file));\n if ($rFile == NULL)return FALSE;\n return $rFile;\n }", "private function _checkFileInDB()\n {\n global $zdb;\n\n try {\n $select = $this->getCheckFileQuery();\n $results = $zdb->execute($select);\n $pic = $results->current();\n //what's $pic if no result?\n if ( $pic !== false ) {\n // we must regenerate the picture file\n $file_wo_ext = $this->store_path . $this->id;\n file_put_contents(\n $file_wo_ext . '.' . $pic->format,\n $pic->picture\n );\n\n $this->format = $pic->format;\n switch($this->format) {\n case 'jpg':\n $this->mime = 'image/jpeg';\n break;\n case 'png':\n $this->mime = 'image/png';\n break;\n case 'gif':\n $this->mime = 'image/gif';\n break;\n }\n $this->file_path = $file_wo_ext . '.' . $this->format;\n return true;\n }\n } catch (\\Exception $e) {\n return false;\n }\n }", "function recordExists()\n {\n global $objDatabase;\n\n if (!$this->id) return false;\n $query = \"\n SELECT 1\n FROM \".DBPREFIX.\"core_image\n WHERE id=$this->id\n AND ord=$this->ord\";\n $objResult = $objDatabase->Execute($query);\n if (!$objResult) return self::errorHandler();\n if ($objResult->EOF) return false;\n return true;\n }", "private function checkHash($hash)\n {\n $sql = 'SELECT hash FROM bookshop_users WHERE hash = :hash';\n $result = $this->db->execute($sql, ['hash' => $hash]);\n \n if (!$result)\n return FALSE;\n\n return TRUE;\n }", "function hashesMatch($email, $hash){\n\n\ttry {\n\n\t\t# Throw exception if hash is not 32 characters\n\t\tif (strlen($hash) != 32){\n\t\t\tthrow new Exception(\"Hash value must be 32 character\");\n\t\t}\n\n\n\t\t# Query database to see if $email exists\n\t\t$base = Connector::getDatabase();\n\t\t$sql = \"SELECT * FROM user WHERE email = '$email';\";\n\t\t$stmt = $base->prepare($sql);\n\t\t$stmt->execute();\n\t\t$result = $stmt->fetch();\n\n\t\tif ($result['hash'] == $hash){\n\t\t\treturn True;\n\t\t} else {\n\t\t\treturn False;\n\t\t}\n\n\t} catch (Exception $e){\n\t\terror_log($e);\n\t\theader(\"Location: /src/views/error.php\");\n \texit();\n\t}\n\n\treturn True;\n}", "function is_cached($remote_img,$data_md5){\r\n\t\t\t\t\r\n\t\t\t\t//md5\r\n\t\t\t\t$md5=md5($remote_img);\r\n\t\t\t\t\r\n\t\t\t\t//query database for this image \r\n\t\t\t\t\r\n\t\t\t\t$query=\"SELECT * FROM {$this->db->prefix}automatic_cached where img_hash='$md5' and img_data_hash='$data_md5' limit 1\";\r\n\t\t\t\t\r\n\t\t\t\t \r\n\t\t\t\t$rows=$this->db->get_results($query);\r\n\t\t\t\t\r\n\t\t\t\tif(count($rows) == 0 ) return false;\r\n\t\t\t\t$row=$rows[0];\r\n\t\t\t\t\r\n\t\t\t\t//hm we have cached image with previous same source let's compare \r\n\t\t\t\t$local_src = $row->img_internal;\r\n\t\t\t\t\r\n\t\t\t\t//make sure current image have same data md5 right now otherwise delete\r\n\t\t\t\t//curl get\r\n\t\t\t\tcurl_setopt($this->ch, CURLOPT_HTTPGET, 1);\r\n\t\t\t\tcurl_setopt($this->ch, CURLOPT_URL, trim($local_src));\r\n\t\t\t \t$exec=curl_exec($this->ch);\r\n\t\t\t \t\r\n\t\t\t \tif(md5($exec) == $data_md5) {\r\n\t\t\t \t\t\r\n\t\t\t \t\t$this->cached_file_path = $row->img_path;\r\n\t\t\t \t\t\r\n\t\t\t \t\treturn $local_src;\r\n\t\t\t \t}else{\r\n\t\t\t \t\t\r\n\t\t\t \t\t//now the local image no more giving the same md5 may be deleted or changed delete the record\r\n\t\t\t \t\t$query=\"delete from {$this->db->prefix}automatic_cached where img_hash = '$md5' \";\r\n\t\t\t \t\t$this->db->query($query);\r\n\t\t\t \t\t\r\n\t\t\t \t\treturn false;\r\n\t\t\t \t}\r\n\t\t\t \t\r\n\t\t\t \t \r\n\t\t\t\t \t \r\n\t\t\t}", "function update_checksum($iid) {\n\n\t\t$r = $this->db->query(sprintf(\"SELECT * FROM images WHERE img_id='%s'\",$iid));\n\t\t$ret = $r->fetchObject(); $r = null;\n\t\t\t\t\n\t\tif(is_object($ret) && $ret->img_id) {\n\t\t\t$this->db->query(sprintf(\n\t\t\t\t\"UPDATE images SET img_sum='%s' WHERE img_id='%d'\",\n\t\t\t\tmd5_file($ret->img_path),\n\t\t\t\t$ret->img_id\n\t\t\t));\n\t\t\treturn true;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\t\t\n\t\t\n\t}", "public function testGetByHash()\n {\n $this->createModels(\n 'tiny_compressimages/image', array(\n array(\n 'path' => '1.jpg',\n 'hash_before' => '54eab696c5c868b669076216ede66a9f',\n 'hash_after' => '636734773941b236c82c9285b11d7f6c',\n 'processed_at' => Varien_Date::now(),\n ),\n array(\n 'path' => '2.jpg',\n 'hash_before' => 'e79f197d28bebd30ba1bc571c2cc075a',\n 'hash_after' => 'df72ed8dbbdca9c440ff6d3182fb0070',\n 'processed_at' => Varien_Date::now(),\n ),\n array(\n 'path' => '3.jpg',\n 'hash_before' => '59c50fe6455c85fe00b169bde7cb1962',\n 'hash_after' => '8e160a4f7fa67e9126269bedcc81c640',\n 'processed_at' => Varien_Date::now(),\n ),\n )\n );\n\n $model = $this->_instance->getByHash('54eab696c5c868b669076216ede66a9f');\n $this->assertEquals('1.jpg', $model->getPath());\n\n $model = $this->_instance->getByHash('df72ed8dbbdca9c440ff6d3182fb0070');\n $this->assertEquals('2.jpg', $model->getPath());\n\n $model = $this->_instance->getByHash('foobar');\n $this->assertNull($model);\n }", "public static function md5Match($asset_id, $md5){\n\t\t$sql = \"SELECT md5 FROM remote_assets WHERE id = $asset_id\";\n\t\t$db = Database::sqlite();\n\t\tif($old_md5 = $db->querySingle($sql)){\n\t\t\tif($old_md5 === $md5){\n\t\t\t\treturn TRUE;\n\t\t\t} else {\n\t\t\t\treturn FALSE;\n\t\t\t}\n\t\t}\n\t\t$db->close();\n\t}", "function getFromHashURL($url)\n {\n $id = false;\n if (preg_match('/#image-([0-9]+)$/', $url, $matches)) {\n $id = $matches[1];\n } else if (preg_match('#Images/Thumb/[^/]+/([0-9]+)/#', $url, $matches)) {\n $id = $matches[1];\n } else if (preg_match('#Images/([0-9]+)/#', $url, $matches)) {\n $id = $matches[1];\n } else if (preg_match('#images[^/]+/([0-9]+)/#i', $url, $matches)) {\n // supports images.xxxxx.com/{number}/name...\n $id = $matches[1];\n }\n if ($id === false || $id < 1) {\n return false;\n }\n \n $img = DB_DAtaObject::Factory('images');\n if ($img->get($id)) {\n return $img;\n }\n return false;\n }", "protected function check_image_exists()\n\t{\n\t\t\n\t\tif (file_exists($this->image_file))\n\t\t{\n\t\t\treturn true;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}", "function validateHash($argHash,$argFileId,$webuserId)\n{\n $hash = substr($argHash,0,32);\n $expire = substr($argHash,32,strlen($argHash));\n if (mktime() > $expire) return false;\n return (md5($expire.$argFileId.$webuserId) == $hash)? true : false;\n}", "protected function searchImageMd5(string $md5): ?int\n {\n //====================================================================//\n // List Post\n $posts = get_posts(array(\n 'numberposts' => -1,\n 'post_type' => 'attachment'\n ));\n //====================================================================//\n // Check Post\n /** @var WP_Post $post */\n foreach ($posts as $post) {\n if ($this->checkImageMd5($post, $md5)) {\n return $post->ID;\n }\n }\n\n return null;\n }", "function hasProfileImage($id, $photoname){\n\t$real_path = APPLICATION_PATH.\"/../public/uploads/user_\";\n \tif (APPLICATION_ENV == \"production\") {\n \t\t$real_path = str_replace(\"public/\", \"\", $real_path); \n \t}\n\t$real_path = $real_path.$id.DIRECTORY_SEPARATOR.\"avatar\".DIRECTORY_SEPARATOR.\"base_\".$photoname;\n\tif(file_exists($real_path) && !isEmptyString($photoname)){\n\t\treturn true;\n\t}\n\treturn false;\n}", "public function checkHashExists($hash) {\n $return = false;\n\n $query = \"SELECT COUNT(id) AS hash_exists, 'student' AS registration_type FROM students WHERE activation_hash=:hash AND is_activated=0\";\n $q = $this->getEntityManager()->getConnection()->executeQuery($query, array(':hash' => $hash));\n $result_students = $q->fetch(2);\n\n $query = \"SELECT COUNT(id) AS hash_exists, 'teacher' AS registration_type FROM teachers WHERE activation_hash=:hash AND is_activated=0\";\n $q = $this->getEntityManager()->getConnection()->executeQuery($query, array(':hash' => $hash));\n $result_teachers = $q->fetch(2);\n\n if ($result_students['hash_exists']) {\n $return = $result_students;\n } elseif ($result_teachers['hash_exists']) {\n $return = $result_teachers;\n }\n\n return $return;\n }", "protected function checkImageMd5($post, string $md5): bool\n {\n //====================================================================//\n // Safety Check\n if (empty($post)) {\n return false;\n }\n //====================================================================//\n // Load Post ID\n $postId = ($post instanceof WP_Post) ? $post->ID : $post;\n //====================================================================//\n // Compute Image Full Path\n $imagePath = function_exists(\"wp_get_original_image_path\")\n ? (string) wp_get_original_image_path($postId, true)\n : (string) get_attached_file($postId, true);\n //====================================================================//\n // Safety Check\n if (!is_file($imagePath)) {\n return false;\n }\n\n //====================================================================//\n // Check Md5\n return (md5_file($imagePath) === $md5);\n }", "function testdHash() {\r\n try {\r\n ImgHasher\\CalcHash::dHash(null);\r\n $this->assertTrue(false);\r\n } catch (Exception $e) {\r\n $this->assertEquals($e->getMessage(), 'Invalid image', 'Exception thrown for invalid image');\r\n }\r\n\r\n // Instantiating with a valid image should work\r\n $img = loadImage();\r\n $hash = ImgHasher\\CalcHash::dHash($img);\r\n $this->assertEquals(9114861776524122264, $hash, 'Image hash is as expected');\r\n\r\n }", "function is_exists_pic($vid)\n{\n\t$len = DB::queryFirstField(\"SELECT length(vphoto) FROM visitor WHERE vid=%s\", $vid);\n\t//echo \"len is: \" . $len . \"\\n\";\n\tif ($len > 1000) {\n\t\treturn 1;\n\t}\n\treturn 0;\n}", "public function check($hash, $path, array $runtimeConfig = null);", "function getImageHash($asset_id) {\n\t\t\n\t}", "public function load_by_hash($hash) {\n $db = nc_core('db');\n $bills = nc_bills::get_instance();\n $hash = $db->escape($hash);\n $secret_key = $db->escape($bills->get_key());\n\n $id_column = $this->mapping[$this->primary_key];\n\n $query = \"SELECT \" . $this->get_all_column_names() .\n \" FROM `$this->table_name`\" .\n \" WHERE MD5(CONCAT(`{$id_column}`, ':{$secret_key}')) = '{$hash}'\" .\n \" LIMIT 1\";\n\n return $this->select_from_database($query);\n }", "public function findImage($imageName);", "function handle_sha(\n $uri)\n{\n $name = basename($uri);\n /* Scan the static files to see if it contains the correct sha sum */\n scan_dir_for_hashes('static', $name);\n\n /* No joy, switch into the submitted files instead */\n scan_dir_for_hashes('dynamic', $name);\n not_found(\"\");\n}", "static public function hit($hash){\n\t\t$url = self::where('hash', '=', $hash)->first();\n\t\tif (!$url){\n\t\t\treturn false;\n\t\t}\n\t\t$url->count++;\n\t\t$url->save();\n\t\treturn $url->url;\n\t}" ]
[ "0.7345232", "0.66455895", "0.6602006", "0.6563635", "0.64877665", "0.6416525", "0.6372276", "0.63656574", "0.62694347", "0.61945933", "0.6148425", "0.6134161", "0.6037449", "0.6012845", "0.6005486", "0.5978905", "0.5970323", "0.5942372", "0.583819", "0.580377", "0.57925653", "0.5766216", "0.57605964", "0.57499164", "0.5671032", "0.5614499", "0.560256", "0.5588345", "0.5581565", "0.55373275" ]
0.7196538
1
Returns image id by given source
public function getIdBySrc(string $src) { if ($res = $this->getAll(0, "`src` = '{$src}'")) { return intval(current($res)['id']); } return 0; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getImageID()\n {\n \treturn $this->getItemNum('1');\n }", "public function getSourceID();", "function get_attachment_id_from_src($image_src) {\n\n\tglobal $wpdb;\n\t$query = \"SELECT ID FROM \".$wpdb->posts.\" WHERE guid LIKE '%\".$image_src.\"%'\";\n\t$id = $wpdb->get_var($query);\n\n\treturn $id;\n\n}", "public function getSrcId(){\n if(!Book::checkIfSrcExists($this))\n {\n $sql = \"SELECT MAX(srcId) AS id \";\n $sql .= \"FROM sources \";\n $sql .= \"WHERE srcType ='\". $this->srcType . \"'\";\n $result = self::$database->prepare($sql);\n $result->execute();\n if(!$result) {\n exit(\"Database query failed.\");\n }\n $result->setFetchMode(PDO::FETCH_ASSOC); \n while($record = $result->fetch()) {\n $srcId = $record['id'];\n }\n return $srcId + 1;\n }else{\n return $this->retrieveSrcID();\n } \n }", "public function getImageId() \n {\n return $this->_fields['ImageId']['FieldValue'];\n }", "public function getImageId() \n {\n return $this->_fields['ImageId']['FieldValue'];\n }", "function getUserIdWithSrc ($imgSrc, $connDb) {\n\t$sql_get_image_id = \"SELECT * FROM images WHERE image_name = :image_name\";\n\t$get_image_id = $connDb->prepare($sql_get_image_id);\n\t$get_image_id->bindValue(':image_name', $imgSrc);\n\t$get_image_id->execute();\n\t$image_id_found = $get_image_id->fetch(PDO::FETCH_ASSOC);\n\t// $user_id = $image_id_found['user_id'];\n\treturn $image_id_found;\n}", "function get_attachment_id_from_src($url) {\n\tglobal $wpdb;\n\t$prefix = $wpdb->prefix;\n\n\tif (strpos($url, 'http') === 0) {\n\t\t$img_source = $url;\n\t} else {\n\t\t$img_source = site_url() . $url;\n\t}\n\n\t$attachment = $wpdb->get_col($wpdb->prepare(\"SELECT ID FROM \" . $prefix . \"posts\" . \" WHERE guid='%s';\", $img_source ));\n\treturn $attachment[0];\n}", "public function get_image_id($img_location) {\r\n $this->db->select(\"id\");\r\n $this->db->where(\"img_location\", $img_location);\r\n $this->db->from(\"images\");\r\n\r\n $query = $this->db->get();\r\n $row = $query->row();\r\n\r\n if ( is_object($row) ) {\r\n return $row->id;\r\n }\r\n\r\n return -1;\r\n }", "public function getImageId(){\r\t\treturn ($this->imageId);\r\t}", "function thirty8_pippin_get_image_id($image_url) {\n\tglobal $wpdb;\n\t$attachment = $wpdb->get_col($wpdb->prepare(\"SELECT ID FROM $wpdb->posts WHERE guid='%s';\", $image_url )); \n return $attachment[0]; \n}", "public function getImageId()\r\n {\r\n return $this->_imageId;\r\n }", "abstract public function get_source_object_id();", "static function get_imageid_by_url( $image_url ) {\n\t\tglobal $wpdb;\n\t\t$attachment = $wpdb->get_col($wpdb->prepare(\"SELECT ID FROM $wpdb->posts WHERE guid='%s';\", $image_url ));\n\t\tif ( $attachment ) { \n\n\t return $attachment[0]; \n\t \n\t\t}\n\t}", "public function get_image_id() {\n\t\t// if this is a voucher product, return the selected image id\n\t\tif ( isset( $this->item['voucher_image_id'] ) ) return $this->item['voucher_image_id'];\n\n\t\t// otherwise return the template primary image id\n\t\treturn $this->image_id;\n\t}", "private function get_source( $source ){\n\t\t\n\t\t$sources = (array) $this->media_sources();\n\t\tif( !array_key_exists( $source , $sources ) ){\n\t\t\treturn $this->register_error('fa-media-query', __('Source not available', 'fapro'));\n\t\t}\n\t\t\n\t\treturn $sources[ $source ];\t\t\n\t}", "function wyz_get_image_id( $image_url ) {\n\tglobal $wpdb;\n\t$attachment = $wpdb->get_col( $wpdb->prepare( \"SELECT ID FROM $wpdb->posts WHERE guid='%s';\", $image_url ) );\n\treturn $attachment[0];\n}", "protected function _getImageIdByPath($path) {\n $connection = $this->getConnection();\n $select = $connection->select()->from(\n $this->getTable(\\Simi\\Simistorelocator\\Setup\\InstallSchema::SCHEMA_IMAGE), ['image_id']\n )->where(\n 'path = :path'\n );\n\n return $connection->fetchOne(\n $select, [':path' => $path]\n );\n }", "public function getImageID() {\n\t\treturn $this->GetField(DotCoreGalleryImageDAL::GALLERY_IMAGE_ID);\n\t}", "function get_image_id($image_url) {\n\tglobal $wpdb;\n\t$attachment = $wpdb->get_col($wpdb->prepare(\"SELECT ID FROM $wpdb->posts WHERE guid='%s';\", $image_url));\n\tif ($attachment[0] > 0) {\n\t\treturn $attachment[0];\n\t}\n\treturn false;\n}", "function fetchImageID($image_name = NULL)\r\n\t{\r\n\t\tglobal $mysqli, $db_table_prefix; \r\n\t\t$stmt = $mysqli->prepare(\"SELECT \r\n\t\t\tid\r\n\t\t\tFROM \".$db_table_prefix.\"images\r\n\t\t\tWHERE name = ?\r\n\t\t\tLIMIT 1\");\r\n\t\t\t$stmt->bind_param(\"s\", $image_name);\r\n\t\t$stmt->execute();\r\n\t\t$stmt->bind_result($im);\r\n\t\t$row = null;\r\n\t\twhile ($stmt->fetch())\r\n\t\t{\r\n\t\t\t$row = $im;\r\n\t\t}\r\n\t\t$stmt->close();\r\n\t\treturn ($row);\r\n\t}", "public function getImgId(): int|string\n {\n return $this->imgId;\n }", "protected function get_image_id(): ?int {\n\t\t$product_image = new Product_Image();\n\n\t\t$filename_base = sanitize_file_name(\n\t\t\tsprintf(\n\t\t\t\t'%s-%s',\n\t\t\t\tgmdate( 'Y', strtotime( $this->plato_project->get_start_date() ) ),\n\t\t\t\t$this->plato_project->get_code()\n\t\t\t)\n\t\t);\n\n\t\t// Afbreken indien afbeeldingen niet gedownload moeten worden of als er geen afbeeldingen zijn\n\t\tif ( ! Config::get_plato_download_images() || empty( $this->plato_project->get_image_file_identifiers() ) ) {\n\t\t\treturn null;\n\t\t}\n\n\t\t$image_id = $product_image->get_project_image(\n\t\t\t$this->plato_project->get_image_file_identifiers(),\n\t\t\t$filename_base,\n\t\t\t$this->plato_project->get_project_id()\n\t\t);\n\t\tif ( is_int( $image_id ) ) {\n\t\t\t$this->product->set_has_plato_image( true );\n\t\t\treturn $image_id;\n\t\t}\n\t\treturn null;\n\t}", "function mts_get_image_id_from_url( $image_url ) {\n\tglobal $wpdb;\n\t$attachment = $wpdb->get_col( $wpdb->prepare( \"SELECT ID FROM $wpdb->posts WHERE guid='%s';\", $image_url ) );\n\tif ( isset( $attachment[0] ) ) {\n\t\treturn $attachment[0];\n\t} else {\n\t\treturn false;\n\t}\n}", "public function getIdImage()\n {\n return $this->idImage;\n }", "public function getThumbnailId(): int;", "function eo_get_image_id_by_link($link)\n{\n global $wpdb;\n $link = preg_replace('/-\\d+x\\d+(?=\\.(jpg|jpeg|png|gif)$)/i', '', $link);\n return $wpdb->get_var(\"SELECT ID FROM {$wpdb->posts} WHERE BINARY guid='$link'\");\n}", "public function setImageId() {\r\t\treturn $this->imageId;\r\r\t}", "function sofa_get_image_id_from_url($image_url) {\n global $wpdb;\n $attachment = $wpdb->get_col( $wpdb->prepare(\"SELECT ID FROM $wpdb->posts WHERE guid = %s;\", $image_url ) ); \n return $attachment[0]; \n}", "public function imageSrc() {\n\t\t$currentImage = $this->urlSegment1 - 1;\n\t\treturn $this->chapterImages()->eq($currentImage)->url;\n\t}" ]
[ "0.66352475", "0.6630695", "0.6600361", "0.65825135", "0.65006906", "0.65006906", "0.6461592", "0.6450168", "0.63762105", "0.6337392", "0.62585324", "0.62506366", "0.6235245", "0.6182743", "0.6163523", "0.6097728", "0.6092998", "0.6080361", "0.6059945", "0.6025739", "0.6015555", "0.6012622", "0.5964551", "0.5906778", "0.5875791", "0.58481675", "0.58421016", "0.5836792", "0.5832901", "0.5816212" ]
0.7053876
0
Returns image src by given id
public function getSrcById(int $id) { if ($res = $this->getById($id)) { return $res['src']; } return ''; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function findImgById(int $id)\r\n {\r\n $db = $this->db;\r\n $stmt = $db->prepare('SELECT * FROM images WHERE id=:id');\r\n $stmt->bindValue('id', $id);\r\n $stmt->execute();\r\n $img = $stmt->fetch();\r\n\r\n return $img;\r\n }", "function getImg($id)\n{\n\tglobal $db;\n\t$m = $db->prepare(\"SELECT img FROM munishri WHERE id = ?\");\n\t$m->execute(array($id));\n\tif($m->rowCount() == 1) {\n\t\t$n = $m->fetch(PDO::FETCH_ASSOC);\n\t\t$t = $n['img'];\n\t\treturn $t;\n\t} else {\n\t\treturn \"na.png\";\n\t}\n}", "public function getImage($id)\n {\n if (Image::where([['id_product', $id], ['cover', '=', 1]])->exists())\n $image = Image::where([['id_product', $id], ['cover', '=', 1]])->first()->id_image;\n else\n $image = '';\n return $image;\n }", "public static function getFileImg($id) {\n if (!intval($id)) return false;\n return self::_getDao()->get(intval($id));\n }", "public static function getImage($id){\n $noImage = 'no-image.jpg';\n $path = '/template/images/articles/';\n $pathToNewsImages = $path.$id.'.jpg';\n\n if (file_exists ($_SERVER['DOCUMENT_ROOT'])){\n return $pathToNewsImages;\n }\n return $path.$noImage;\n\n }", "public function getImage($id)\n {\n $image = static::$imageImpdao->findById(self::CLASSNAMEIMAGE, $id);\n\n return $image;\n }", "public function getImage($id)\n {\n if (Lens::find($id)->hasMedia('lens')) {\n return Lens::find($id)\n ->getFirstMedia('lens');\n } else {\n Lens::find($id)\n ->addMediaFromUrl(asset('images/lens.jpg'))\n ->usingFileName($id . '.png')\n ->toMediaCollection('lens');\n\n return Lens::find($id)\n ->getFirstMedia('lens');\n }\n }", "public static function getImage($id) {\n $sql = \"SELECT image_name_img FROM image_img WHERE id_mshm = $id\";\n \n $result = static::query($sql);\n if($result==null) {\n return null;\n } else {\n return $result;\n }\n }", "function GetImg($url = null, $imgid = 1) {\n\t\treturn GetImgURL($url, $imgid);\n\t}", "function pearl_get_image_url($id, $size = 'full')\r\r\n{\r\r\n\t$url = '';\r\r\n\tif (!empty($id)) {\r\r\n\t\t$image = wp_get_attachment_image_src($id, $size);\r\r\n\t\tif (!empty($image[0])) {\r\r\n\t\t\t$url = $image[0];\r\r\n\t\t}\r\r\n\t}\r\r\n\r\r\n\treturn $url;\r\r\n}", "function build_image_url_by_id( $id, $args ) {\n\t$image = wp_get_attachment_image_src( $id, 'full' );\n\n\treturn build_image_url( $image[0], $args );\n}", "public function showImage($id)\n\t{\n\t\tif($id) {\n\t\t\t$sql = \"SELECT image from rewardimages where reward_id = $id AND defaultimage='1'\";\t\n \t\t$list = Yii::app()->db->createCommand($sql)->queryRow();\n\t \t\t//return $list['name'];\n\t \t\t//$filepath = 'IMG_2510.JPG';\n\t \t\t$filepath = $list['image'];\n\t\t //$img=CHtml::image(Yii::app()->baseUrl.\"/images/reward/$id/\".$filepath);\n\t\t $setImage = Yii::app()->baseUrl.\"/images/reward/\".$id.\"/\".$filepath;\n\t\t if($filepath!='') {\n\t\t \t\t$img = '<img src=\"'.$setImage.'\" width=\"150px\" />';\n\t\t\t}else{\n\t\t\t\t$setImage = 'IMG_2510.JPG';\n\t\t\t\t$img = '<img src=\"'.$setImage.'\" width=\"150px\" />';\n\t\t\t}\n\t\t}\n\treturn $img;\n\t}", "function getImage($id)\r\n\t{\r\n\t\t\r\n\t\tglobal $mysqli, $db_table_prefix; \r\n\t\t$stmt = $mysqli->prepare(\"SELECT image FROM \".$db_table_prefix.\"images WHERE id=?\");\r\n\t\t\t\r\n\t\t$stmt->bind_param(\"i\",$id);\r\n\t\t$stmt->execute();\r\n\t\t$stmt->store_result();\r\n\t\t$stmt->bind_result($showimage);\r\n\t\t$stmt->fetch();\r\n\t\tif(!isset($showimage))\r\n\t\t{\r\n\t\t\techo \"Please select an image.\";\r\n\t\t}\r\n\t\telse{\r\n\t\t\techo '<img src=\"data:image/jpeg;base64,'.base64_encode($showimage).'\"/>';\t\r\n\t\t}\r\n\t\t//header(\"Content-Type: image/jpeg\");\r\n\t\r\n\t\t$stmt->close();\t\r\n\t\t\r\n\t}", "public function get($id) {\n\n return $this->getItem($this->cn, $this->images_dir, self::MODELS_SQL, self::SQL_ITEM_BY_ID, [':id'=>$id]);\n \n }", "public function get_image_by_id($img_id) {\r\n $this->db->select(\"img_location\");\r\n $this->db->where(\"id\", $img_id);\r\n $this->db->from(\"images\");\r\n\r\n $query = $this->db->get();\r\n $row = $query->row();\r\n\r\n if ( is_object($row) ) {\r\n return $row->img_location;\r\n }\r\n\r\n return false;\r\n }", "public function readImage(int $id) {\n return $this->dataHandler->readData(\n \"SELECT * FROM `image` WHERE `id` = :id\",\n [\n \":id\" => $id\n ],\n false\n );\n }", "public function getImage($id){\n \t$gemStone = GemStone::find($id);\n \t$path = '/shops/'.$gemStone->shop->id.\n \t\t\t'_'.$gemStone->shop->user->name.'/'.\n \t\t\t$gemStone->image_name ;\n \t$image = Storage::disk('local')->get($path);\n \tob_end_clean();\n return response($image,200,['Content-type'=>'image/jpg']);\n }", "public function getImage($image_id,$size='medium'){\n if(!empty($image_id)) {\n return wp_get_attachment_image($image_id, $size);\n }\n return '';\n }", "public function getImage($id){\n $id = (int) $id;\n $rowset = $this->tableGateway->select(array('idImage' => $id));\n $row = $rowset->current();\n if (!$row) {\n throw new \\Exception(\"Could not find row $id\");\n }\n return $row;\n }", "public function get_IMAGE_file($id)\n\t{\n\t\tif (!$this->is_allowed('store_update', false)) {\n\t\t\techo json_encode([\n\t\t\t\t'success' => false,\n\t\t\t\t'message' => 'Image not loaded, you do not have permission to access'\n\t\t\t\t]);\n\t\t\texit;\n\t\t}\n\n\t\t$store = $this->model_store->find($id);\n\n\t\techo $this->get_file([\n 'uuid' => $id, \n 'delete_by' => 'id', \n 'field_name' => 'IMAGE_STORE', \n 'table_name' => 'store',\n 'primary_key' => 'ID_STORE',\n 'upload_path' => 'uploads/store/',\n 'delete_endpoint' => 'administrator/store/delete_IMAGE_file'\n ]);\n\t}", "public function selectById($id) {\n $sql = \"SELECT * FROM `images` WHERE `id` = :id\"; \n $stmt = $this->pdo->prepare($sql); \n $stmt->bindValue('id', $id); \n $stmt->execute(); \n return $stmt->fetch(PDO::FETCH_ASSOC);\n }", "function px_attachment_image_src($attachment_id, $width, $height) {\n\t\t$image_url = wp_get_attachment_image_src($attachment_id, array($width, $height), true);\n\t\t\n\t\tif ($image_url[1] == $width and $image_url[2] == $height); else \n\t\t$image_url = wp_get_attachment_image_src($attachment_id, \"full\", true);\n\t\t$parts = explode('/uploads/',$image_url[0]);\n\t\t\n\t\tif ( count($parts) > 1 ) return $image_url[0];\n\t}", "public function imgsrc($imgid){\n\t\t$this->FW->load->model('cms/cms_plugin_images_model','images_model');\n\t\t\n\t\t$img_file\t\t\t= $this->FW->images_model->image_file_display($imgid);\n\t\t$img_route\t\t\t= $this->FW->images_model->display_image_route();\n\t\t$imgsrc\t\t\t\t= base_url($img_route.$img_file);\n\t\t\n\t\treturn $imgsrc;\n\t}", "public function getProductImage($id){\n\n return $this->_productRepositoryFactory->create()->getById($id);\n // $product->getData('image');\n // return $product->getData('thumbnail');\n // $product->getData('small_image');\n \n }", "function get_image($id)\n {\n $query = $this->db->select('*')\n ->from('userphoto')\n ->where('id', $id);\n $result['rows'] = $query->get()->result();\n\n return $result;\n\n }", "function getAvatar($id)\r\n{\r\n if(file_exists(\"src/views/profile/avatars/{$id}avatar.jpg\")) {\r\n return \"/src/views/profile/avatars/{$id}avatar.jpg\";\r\n } else {\r\n return \"/src/views/profile/avatars/default.jpg\";\r\n }\r\n}", "public function getUserImageMain($id)\n {\n $data = $this->db->select(\"SELECT userImage FROM \".PREFIX.\"users_images WHERE userID=:id AND defaultImage = '1' \",array(\":id\"=>$id));\n return $data[0]->userImage;\n }", "public function getCurrentPicture($id)\r\n {\r\n $result = $this->startConditions()\r\n ->select('product_picture')\r\n ->where('id', $id)\r\n ->first();\r\n\r\n return $result;\r\n }", "public function get_image($table, $id) \r\n\t{\r\n\t\t$res = select_query_assoc(\r\n\t\t\t\"SELECT url FROM image WHERE type_table='$table' AND type_id=$id;\"\r\n\t\t);\r\n\t\tif (!empty($res)) {\r\n\t\t\treturn json_encode($res);\r\n\t\t}\r\n\t\telse\r\n\t\t\treturn null;\t\t\r\n\t}", "public function apiShowImage($id) {\n // If the authenticated user doesn't have permission to see the course (is not the owner or invited), abort\n if (!$this->canView($id)) abort(401);\n\n // Find the course and return the image path\n $course = Course::find($id);\n return json_encode($course->cover_image);\n }" ]
[ "0.7540133", "0.7468654", "0.744052", "0.73949444", "0.7354295", "0.7329512", "0.73137903", "0.7295461", "0.727864", "0.71957266", "0.7102224", "0.7084658", "0.70719635", "0.6999038", "0.6895294", "0.68418616", "0.68407464", "0.68083715", "0.6808278", "0.67925245", "0.67874175", "0.67790884", "0.6777471", "0.6747703", "0.6699332", "0.6675101", "0.66711205", "0.66625845", "0.6654327", "0.66408336" ]
0.7828064
0
Process $fields for $item by fields $collection. This method do not perform saving, only set values in $item.
public function processFields( \Bitrix\Crm\Item $item, array $fields, Field\Collection $collection ): void { foreach($collection as $field) { $fieldName = $field->getName(); if (!array_key_exists($fieldName, $fields)) { continue; } if (empty($fields[$fieldName])) { $item->set($fieldName, null); continue; } if ($field->isFileUserField()) { $this->processFileField($field, $item, $fields[$fieldName]); } elseif ( $this->getScope() === self::SCOPE_REST && ( $field->getType() === Field::TYPE_DATE || $field->getType() === Field::TYPE_DATETIME ) ) { if ($field->getType() === Field::TYPE_DATETIME) { $convertDateMethod = 'unConvertDateTime'; } else { $convertDateMethod = 'unConvertDate'; } if($field->isMultiple()) { $result = []; $value = (array)$fields[$fieldName]; foreach($value as $date) { $result[] = \CRestUtil::$convertDateMethod($date); } $item->set($fieldName, $result); } else { $item->set($fieldName, \CRestUtil::$convertDateMethod($fields[$fieldName])); } } else { $value = $fields[$fieldName]; if ($field->getType() === Field::TYPE_BOOLEAN) { $value = $this->prepareBooleanFieldValue($value); } $item->set($fieldName, $value); } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function processFields()\n {\n foreach ($this->addFields() as $field) {\n $this->addField($field);\n }\n }", "public function processFieldsBeforeSave(): Result\n\t{\n\t\t$result = new Result();\n\n\t\tif (!$this->fieldsCollection)\n\t\t{\n\t\t\treturn $result;\n\t\t}\n\n\t\tforeach($this->fieldsCollection as $field)\n\t\t{\n\t\t\t$fieldResult = $field->process($this->item, $this->getContext());\n\t\t\tif (!$fieldResult->isSuccess())\n\t\t\t{\n\t\t\t\t$result->addErrors($fieldResult->getErrors());\n\t\t\t}\n\t\t}\n\n\t\treturn $result;\n\t}", "function createFields() {\n\t\t// Existing record\n\t\tif($this->item && $this->data) {\n\t\t\t$form = $this->data;\n\t\t\t$this->fieldset = $form->Fields();\n\t\t\t$this->fieldset->removeByName('SecurityID');\n\t\t\tif($this->fieldset) {\n\t\t\t\t$i=0;\n\t\t\t\tforeach($this->fieldset as $field) {\n\t\t\t\t\t$origFieldName = $field->Name();\n\n\t\t\t\t\t// set unique fieldname with id\n\t\t\t\t\t$combinedFieldName = $this->parent->Name() . \"[\" . $this->ID() . \"][\" . $origFieldName . \"]\";\n\t\t\t\t\t// ensure to set field to nested array notation\n\t\t\t\t\t// if its an unsaved row, or the \"add row\" which is present by default\n\t\t\t\t\tif($this->isAddRow || $this->ID() == 'new') $combinedFieldName .= '[]';\n\t\t\t\t\t\n\t\t\t\t\t// get value\n\t\t\t\t\tif(strpos($origFieldName,'.') === false) {\n\t\t\t\t\t\t$value = $field->dataValue();\n\t\t\t\t\t} else {\t\t\t\t\t\n\t\t\t\t\t\t// this supports the syntax fieldName = Relation.RelatedField\t\t\t\t\n\t\t\t\t\t\t$fieldNameParts = explode('.', $origFieldName)\t;\n\t\t\t\t\t\t$tmpItem = $this->item;\n\t\t\t\t\t\tfor($j=0;$j<sizeof($fieldNameParts);$j++) {\n\t\t\t\t\t\t\t$relationMethod = $fieldNameParts[$j];\n\t\t\t\t\t\t\t$idField = $relationMethod . 'ID';\n\t\t\t\t\t\t\tif($j == sizeof($fieldNameParts)-1) {\n\t\t\t\t\t\t\t\t$value = $tmpItem->$relationMethod;\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t$tmpItem = $tmpItem->$relationMethod();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t$field->Name = $combinedFieldName;\n\t\t\t\t\t$field->setValue($field->dataValue());\n\t\t\t\t\t$field->addExtraClass('col'.$i);\n\t\t\t\t\t$field->setForm($this->data); \n\n\t\t\t\t\t// transformation\n\t\t\t\t\tif(isset($this->parent->transformationConditions[$origFieldName])) {\n\t\t\t\t\t\t$transformation = $this->parent->transformationConditions[$origFieldName]['transformation'];\n\t\t\t\t\t\t$rule = str_replace(\"\\$\",\"\\$this->item->\", $this->parent->transformationConditions[$origFieldName]['rule']);\n\t\t\t\t\t\t$ruleApplies = null;\n\t\t\t\t\t\teval('$ruleApplies = ('.$rule.');');\n\t\t\t\t\t\tif($ruleApplies) {\n\t\t\t\t\t\t\t$field = $field->$transformation();\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t// formatting\n\t\t\t\t\t$item = $this->item;\n\t\t\t\t\t$value = $field->Value();\n\t\t\t\t\tif(array_key_exists($origFieldName, $this->parent->fieldFormatting)) {\n\t\t\t\t\t\t$format = str_replace('$value', \"__VAL__\", $this->parent->fieldFormatting[$origFieldName]);\n\t\t\t\t\t\t$format = preg_replace('/\\$([A-Za-z0-9-_]+)/','$item->$1', $format);\n\t\t\t\t\t\t$format = str_replace('__VAL__', '$value', $format);\n\t\t\t\t\t\teval('$value = \"' . $format . '\";');\n\t\t\t\t\t\t$field->dontEscape = true;\n\t\t\t\t\t\t$field->setValue($value);\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t$this->fields[] = $field;\n\t\t\t\t\t$i++;\n\t\t\t\t}\n\t\t\t}\n\t\t// New record\n\t\t} else {\n\t\t\t$list = $this->parent->FieldList();\n\t\t\t$i=0;\n\t\t\tforeach($list as $fieldName => $fieldTitle) {\n\t\t\t\tif(strpos($fieldName, \".\")) {\n\t\t\t\t\t$shortFieldName = substr($fieldName, strpos($fieldName, \".\")+1, strlen($fieldName));\n\t\t\t\t} else {\n\t\t\t\t\t$shortFieldName = $fieldName;\n\t\t\t\t}\n\t\t\t\t$combinedFieldName = $this->parent->Name() . \"[new][\" . $shortFieldName . \"][]\";\n\t\t\t\t$fieldType = $this->fieldTypes[$fieldName];\n\t\t\t\tif(isset($fieldType->class) && is_subclass_of($fieldType, 'FormField')) {\n\t\t\t\t\t$field = clone $fieldType; // we can't use the same instance all over, as we change names\n\t\t\t\t\t$field->Name = $combinedFieldName;\n\t\t\t\t} elseif(strpos($fieldType, '(') === false) {\n\t\t\t\t\t//echo (\"<li>Type: \".$fieldType.\" fieldName: \". $filedName. \" Title: \".$fieldTitle.\"</li>\");\n\t\t\t\t\t$field = new $fieldType($combinedFieldName,$fieldTitle);\n\t\t\t\t} else {\n\t\t\t\t\t$field = eval(\"return new \" . $fieldType . \";\");\n\t\t\t\t}\n\t\t\t\t$field->addExtraClass('col'.$i);\n\t\t\t\t$this->fields[] = $field;\n\t\t\t\t$i++;\n\t\t\t}\n\t\t}\n\t\treturn new FieldSet($this->fields);\n\t}", "public function item_custom_fields_to_form() {\n // 1. special management for fields equipped with \"free\" checkbox\n // nothing to do: they don't exist in this plugin\n\n // 2. special management for composite fields\n // nothing to do: they don't exist in this plugin\n\n // 3. special management for defaultvalue\n // nothing to do: defaultvalue doesn't need any further care\n\n // 4. special management for autofill contents\n $referencearray = array(''); // <-- take care, the first element is already on board\n for ($i = 1; $i <= SURVEYFIELD_AUTOFILL_CONTENTELEMENT_COUNT; $i++) {\n $referencearray[] = constant('SURVEYFIELD_AUTOFILL_CONTENTELEMENT'.sprintf('%02d', $i));\n }\n\n $items = array();\n for ($i = 1; $i < 6; $i++) {\n $index = sprintf('%02d', $i);\n $fieldname = 'element'.$index.'_select';\n if (in_array($this->{'element'.$index}, $referencearray)) {\n $this->{$fieldname} = $this->{'element'.$index};\n } else {\n $constantname = 'SURVEYFIELD_AUTOFILL_CONTENTELEMENT'.SURVEYFIELD_AUTOFILL_CONTENTELEMENT_COUNT;\n $this->{$fieldname} = constant($constantname);\n $fieldname = 'element'.$index.'_text';\n $this->{$fieldname} = $this->{'element'.$index};\n }\n }\n }", "public function process_fields($fields) {\n foreach ($fields as $key => $value) {\n if ($value['type'] == 'datalist' || $value['type'] == 'dataSelect') {\n switch ($value['search']) {\n case 'users':\n $users = User::whereNull('play_id')->\n orderby('name', 'ASC')->pluck('name', 'id');\n $result = $users;\n break;\n }\n if ($value['type'] == 'dataSelect') {\n $value['arraykeyval'] = $result;\n } else {\n $value = $result;\n }\n }\n $list[$key] = $value;\n }\n return $list;\n }", "protected function normalizeFields(array $fields, FieldMetadataCollection $collection, $object, array &$data)\n {\n foreach ($fields as $field) {\n if ($this->isFieldSerializable($field, $collection)) {\n $value = $this->propertyAccessor->getValue($object, $field);\n $this->propertyAccessor->setValue($data, $this->getPropertyPath($field), $value);\n }\n }\n }", "public function checkFields() {\n\t\t// bag items\n\t\tif(!is_null($this->bagItems)) {\n\t\t\tforeach($this->bagItems as $key=>$bagItem) {\n\t\t\t\t$bagItem->checkFields();\n\t\t\t\t$this->bagItems[$key] = splitNullValuesInObject($bagItem);\n\t\t\t}\n\t\t}\n\t\t\n\t\t// totals\n\t\tif($this->totals != null) {\n\t\t\t$this->totals = splitNullValuesInObject($this->totals);\n\t\t}\n\t\t\n\t\t// context\n\t\tif($this->context != null) {\n\t\t\t$this->context->checkFields();\n\t\t\t$this->context = splitNullValuesInObject($this->context);\n\t\t}\n\t\t\n\t\t// customer\n\t\tif($this->customer != null) {\n\t\t\t$this->customer->checkFields();\n\t\t\t$this->customer = splitNullValuesInObject($this->customer);\n\t\t}\n\t}", "function filterField(&$item, $key, $field)\n {\n $item = $item->{$field};\n }", "function field_collection_entity_xliff_translatable_fields_alter(&$fields, $wrapper) {\n $info = $wrapper->getPropertyInfo();\n $needle = 'field_collection_item';\n\n for ($n = 0; $n < count($fields); $n++) {\n // Other alters are sometimes deleting array elements.\n $fields = array_values($fields);\n $field = $fields[$n];\n // If this field is translatable and it's a field collection, move it to\n // the back of the translatable list.\n if (isset($info[$field]['type']) && strpos($info[$field]['type'], $needle)) {\n unset($fields[$n]);\n $fields[] = $field;\n }\n }\n // Reset before returning to be nice to other alters..\n $fields = array_values($fields);\n }", "protected function convertData(UiComponentInterface $component, DocumentInterface $item, array $fields)\n {\n $columns = $this->getColumns($component);\n foreach ($fields as $fieldName) {\n $fieldValue = $item->getData($fieldName);\n\n if($fieldName == 'customer'){\n $fieldValue = $item->getData();\n }\n\n if (is_array($fieldValue)) {\n $item->setData($fieldName, json_encode($fieldValue));\n }\n\n if ($columns[$fieldName] instanceof ExportValueConverterInterface) {\n $item->setData($fieldName, $columns[$fieldName]->convertExportValue($fieldValue));\n }\n }\n }", "function pick_fields( $item, $fields ) {\n\t$values = [];\n\n\tif ( is_object( $item ) ) {\n\t\tforeach ( $fields as $field ) {\n\t\t\t$values[ $field ] = isset( $item->$field ) ? $item->$field : null;\n\t\t}\n\t} else {\n\t\tforeach ( $fields as $field ) {\n\t\t\t$values[ $field ] = isset( $item[ $field ] ) ? $item[ $field ] : null;\n\t\t}\n\t}\n\n\treturn $values;\n}", "public function ___save(Saveable $item) {\n\n\t\t$database = $this->wire('database');\n\t\t\n\t\t/** @var Fieldgroup $item */\n\n\t\tif($item->id && $item->removedFields) {\n\n\t\t\tforeach($this->wire('templates') as $template) {\n\t\t\t\tif($template->fieldgroup->id !== $item->id) continue; \n\t\t\t\tforeach($item->removedFields as $field) {\n\t\t\t\t\t// make sure the field is valid to delete from this template\n\t\t\t\t\t$error = $this->isFieldNotRemoveable($field, $item, $template);\n\t\t\t\t\tif($error !== false) throw new WireException(\"$error Save of fieldgroup changes aborted.\");\n\t\t\t\t\tif($field->type) $field->type->deleteTemplateField($template, $field); \n\t\t\t\t\t$item->finishRemove($field); \n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$item->resetRemovedFields();\n\t\t}\n\n\t\t$contextData = array();\n\t\tif($item->id) { \n\t\t\t// save context data\n\t\t\t$query = $database->prepare(\"SELECT fields_id, data FROM fieldgroups_fields WHERE fieldgroups_id=:item_id\"); \n\t\t\t$query->bindValue(\":item_id\", (int) $item->id, \\PDO::PARAM_INT); \n\t\t\t$query->execute();\n\t\t\t/** @noinspection PhpAssignmentInConditionInspection */\n\t\t\twhile($row = $query->fetch(\\PDO::FETCH_ASSOC)) {\n\t\t\t\t$contextData[$row['fields_id']] = $row['data'];\n\t\t\t}\n\t\t\t$query->closeCursor();\n\t\t}\n\n\t\t$result = parent::___save($item); \n\n\t\tif(count($contextData)) {\n\t\t\t// restore context data\n\t\t\tforeach($contextData as $fields_id => $data) {\n\t\t\t\t$fieldgroups_id = (int) $item->id; \n\t\t\t\t$fields_id = (int) $fields_id; \n\t\t\t\t$query = $database->prepare(\"UPDATE fieldgroups_fields SET data=:data WHERE fieldgroups_id=:fieldgroups_id AND fields_id=:fields_id\"); // QA\n\t\t\t\t$query->bindValue(\":data\", $data, \\PDO::PARAM_STR); \n\t\t\t\t$query->bindValue(\":fieldgroups_id\", $fieldgroups_id, \\PDO::PARAM_INT);\n\t\t\t\t$query->bindValue(\":fields_id\", $fields_id, \\PDO::PARAM_INT); \n\t\t\t\t$query->execute();\n\t\t\t}\n\t\t}\n\n\t\treturn $result;\n\t}", "function set_item($item)\n\t{\n\t\tglobal $db;\n\n\t\t$this->item = $item;\n\t\t$this->values = array();\n\n\t\tif (strlen($this->item))\n\t\t{\n\t\t\t$inf = $this->get_info();\n\t\t\t$title = $inf['TITLE'];\n\t\t\t$single = $inf['SINGLE'];\n\t\t\t$fields = $inf['FIELDS'];\n\t\t\t$table = $inf['TABLE'][0];\n\t\t\t$prefix = $inf['TABLE'][1];\n\t\t\t$idfield = $inf['TABLE'][2];\n\n\t\t\t$pull_fields = array($prefix.'_'.$idfield);\n\t\t\t$this->field_titles = array(''=>'&nbsp;');\n\t\t\twhile (list($a,list($f,$t)) = each($fields))\n\t\t\t{\n\t\t\t\t$this_field = $prefix.'_'.$f;\n\t\t\t\t$pull_fields[] = $this_field;\n\t\t\t\t$this->field_titles[$this_field] = $t;\n\t\t\t}\n\n\t\t\t// pull in the values\n\t\t\tif ($this->item == 'sources') { $sortby = \"sor_type,$pull_fields[1]\"; }\n\t\t\telse { $sortby = $pull_fields[1]; }\n\n\t\t\tif ($this->item != 'platforms') { $where = \"WHERE ${prefix}_platformID=$this->platformID \"; } else { $where = \"\"; }\n\n\t\t\t$this->values = array();\n\t\t\t$sql = \"SELECT \".implode(\",\",$pull_fields).\" FROM $table ${where}ORDER BY $sortby\";\n\t\t\t$result = mysql_query($sql,$db);\n\t\t\t$this->error->mysql(__FILE__,__LINE__);\n\t\t\twhile ($row = mysql_fetch_row($result))\n\t\t\t{\n\t\t\t\tfor ($i=0; $i<count($row); $i++) { $row[$i] = stripslashes($row[$i]); }\n\t\t\t\t$this->values[] = $row;\n\t\t\t}\n\n\t\t\t// pulls in all of the values\n\t\t\t$this->good_values = array();\n\t\t\t$sql = \"SELECT * FROM $table ORDER BY $sortby\";\n\t\t\t$result = mysql_query($sql,$db);\n\t\t\t$this->error->mysql(__FILE__,__LINE__);\n\t\t\twhile ($row = mysql_fetch_assoc($result))\n\t\t\t{\n\t\t\t\t$this->good_values[$row[$prefix . '_' . $idfield]] = $row;\n\t\t\t}\n\t\t}\n\t}", "public function setField(FieldItemListInterface $field);", "function setValuesByPost()\n\t{\n\t foreach($this->items as $item)\n\t\t{\n\t\t\t$item->setValueByArray($_POST);\n\t\t}\n\t}", "function setFields($fields);", "public function processItems(EntityInterface $entity, $type = 'input') {\n\t\t$fields = $this->_config['fields'];\n\n\t\tforeach ($fields as $field => $map) {\n\t\t\tif (is_numeric($field)) {\n\t\t\t\t$field = $map;\n\t\t\t\t$map = [];\n\t\t\t} else {\n\t\t\t\t$map = (array)$map;\n\t\t\t}\n\n\t\t\t$val = $entity->get($field);\n\t\t\tif (!$val && !is_numeric($val)) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tif (!$map) {\n\t\t\t\t$map = $this->_config[$type];\n\t\t\t}\n\t\t\tif (!$map) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t$entity->set($field, $this->_process($val, $map));\n\t\t}\n\t}", "function PostProcess($item)\n {\n if (!isset($item[ \"ID\" ]) || $item[ \"ID\" ]==0) { return $item; }\n\n\n $updatedatas=array();\n if (empty($item[ \"SqlDef\" ]) && !empty($item[ \"Type\" ]))\n {\n $item[ \"SqlDef\" ]=\n $this->ItemData[ \"Type\" ][ \"SQLDefault\" ][ $item[ \"Type\" ]-1 ];\n array_push($updatedatas,\"SqlDef\");\n }\n\n if (empty($item[ \"SortOrder\" ]) && !empty($item[ \"ID\" ]))\n {\n $item[ \"SortOrder\" ]=$item[ \"ID\" ];\n array_push($updatedatas,\"SortOrder\");\n }\n\n foreach (array(\"Text\",\"Text_UK\") as $data)\n {\n $rdata=preg_replace('/^Text/',\"Title\",$data);\n if (empty($item[ $rdata ]) && !empty($item[ $data ]))\n {\n $item[ $rdata ]=$item[ $data ];\n array_push($updatedatas,$rdata);\n }\n }\n\n\n if (count($updatedatas)>0)\n {\n $this->MySqlSetItemValues(\"\",$updatedatas,$item);\n }\n\n return $item;\n }", "public function processUpdateFields()\r\r\n {\r\r\n if (!is_array($fields = Tools::getValue('fieldsBox'))) {\r\r\n $fields = array();\r\r\n }\r\r\n\r\r\n $object = new $this->className();\r\r\n if (!$object->addFieldsRequiredDatabase($fields)) {\r\r\n $this->errors[] = Tools::displayError('An error occurred when attempting to update the required fields.');\r\r\n } else {\r\r\n $this->redirect_after = self::$currentIndex . '&conf=4&token=' . $this->token;\r\r\n }\r\r\n\r\r\n return $object;\r\r\n }", "public function setFields($var) {}", "public function setFields($var) {}", "public function update_fields() {\n $migration_mapping = $this->get_migration_mappings();\n $database = \\Drupal::service('database');\n $replaced_items = [];\n\n // Database table names to process and the column names that will be edited.\n // table_name => column_name.\n $fields = [\n 'resource__field_department' => 'field_department_target_id',\n 'location__field_department' => 'field_department_target_id',\n 'user__field_departments' => 'field_departments_target_id',\n 'node__field_parent_department' => 'field_parent_department_target_id',\n 'node_revision__field_parent_department' => 'field_parent_department_target_id',\n 'node__field_departments' => 'field_departments_target_id',\n 'node_revision__field_departments' => 'field_departments_target_id',\n 'node__field_city_department' => 'field_city_department_target_id',\n 'node_revision__field_city_department' => 'field_city_department_target_id',\n 'node__field_dept' => 'field_dept_target_id',\n 'node_revision__field_dept' => 'field_dept_target_id',\n 'node__field_public_body' => 'field_public_body_target_id',\n 'node_revision__field_public_body' => 'field_public_body_target_id',\n 'paragraph__field_node' => 'field_node_target_id',\n 'paragraph_revision__field_node' => 'field_node_target_id',\n 'paragraph__field_department' => 'field_department_target_id',\n 'paragraph_revision__field_department' => 'field_department_target_id',\n 'paragraph__field_agency_reference' => 'field_agency_reference_target_id',\n 'paragraph_revision__field_agency_reference' => 'field_agency_reference_target_id',\n ];\n\n // This make a direct database update and changes the value on the field.\n // Not sure yet if this should be changed to more of a node::load() and save\n // process.\n foreach ($fields as $field_name => $column_name) {\n foreach ($migration_mapping as $map) {\n $updated = $database->update($field_name)\n ->fields([$column_name => $map['new_agency_nid']])\n ->condition($column_name, $map['old_public_body_nid'], '=')\n ->execute();\n if ($updated) {\n $replaced_items[] = $map['old_public_body_nid'] . ' was replaced with ' . $map['new_agency_nid'] . ' for ' . $field_name;\n }\n }\n }\n\n if (count($replaced_items) > 0) {\n $this->output()->writeln(count($replaced_items) . ' reference values had their public body replaced with a new agency node.');\n\n // Clear caches if changes were applied.\n drupal_flush_all_caches();\n $this->output->writeln('Caches cleared.');\n }\n else {\n $this->output->writeln('No reference values were updated');\n }\n }", "protected function FillFieldsValuesFromRequest() {\n\t\tforeach($this->m_fieldsMetadata as $lFieldName => $lFieldInfo){\n\t\t\t$lFieldValue = $this->GetValueFromRequest($lFieldName, $this->m_formMethod);\n\t\t\t// var_dump('REQ', $lFieldName, $lFieldValue['value'],\n\t\t\t// $_REQUEST[$lFieldName]);\n\t\t\t// echo \"\\n <br/>\";\n\t\t\t$this->m_fieldsValues[$lFieldName] = $lFieldValue['value'];\n\t\t}\n\t}", "private static function validize($item) {\n $collection = 'products';\n $fields = array('name','type','key');\n\n if(!$item) return false;\n if($item['valid']) return true;\n\n foreach($fields as $key) \n if($item[$key] === false) return false;\n\n // all clear!\n\n $update['valid'] = true;\n MongoLib::set($collection, $item['_id'], $update);\n\n return true;\n }", "function pick_fields($item, $fields) {\n $item = (object)$item;\n $values = array();\n\n foreach ($fields as $field) {\n $values[$field] = isset($item->$field) ? $item->$field : null;\n }\n\n return $values;\n}", "private function processField() {\n\t\t$conditions = 1;\n\t\tif($this->strict) {\n\t\t\t$conditions = array(\n\t\t\t\t\t'LENGTH(`' . $this->field . '`) <>' => 40\n\t\t\t);\n\t\t}\n\n\t\t$fieldsToHash = $this->model->find('all', array(\n\t\t\t\t'recursive' => -1,\n\t\t\t\t'fields' => array($this->model->primaryKey, $this->field),\n\t\t\t\t'conditions' => $conditions\n\t\t));\n\n\t\tforeach($fieldsToHash as $field) {\n\t\t\t$fieldValue = $field[$this->model->alias][$this->field];\n\t\t\t$recordId = $field[$this->model->alias][$this->model->primaryKey];\n\n\t\t\t$fieldValue = Security::hash($fieldValue, NULL, TRUE);\n\n\t\t\t$this->out('Changing password for: ' . $recordId);\n\t\t\t$this->out('Changed to: ' . $fieldValue);\n\n\t\t\t$this->model->create();\n\t\t\t$this->model->id = $recordId;\n\t\t\t$data = array(\n\t\t\t\t$this->model->alias => array(\n\t\t\t\t\t\t$this->field => $fieldValue\n\t\t\t\t)\n\t\t\t);\n\t\t\t$this->model->save($data, array(\n\t\t\t\t\t'validate' => FALSE,\n\t\t\t\t\t'callbacks' => FALSE\n\t\t\t));\n\t\t}\n\t}", "public function setAllFormValues(): void\n {\n foreach ($this->Form()->getFields() as $Field) {\n // Use the Model Field's value if it has the field\n if (isset($this->{$Field->getOriginalName()})) {\n $value = $this->{$Field->getOriginalName()};\n }\n // Use the Field's Default value if it has one\n elseif ($this->Form()->{$Field->getOriginalName()}->default_value != null) {\n $value = $this->Form()->{$Field->getOriginalName()}->default_value;\n }\n // Just use null\n else {\n $value = null;\n }\n\n // If the field has a CustomField object, then try to use it's hook for setting them value.\n if (is_object($Field->CustomField)) {\n try {\n $this->Form()->{$Field->getOriginalName()}->attributes->value = $Field->CustomField->hook_setAllFormValues($Field, $value);\n continue;\n } catch (NotImplementedException $e) {\n }\n }\n\n // If it's a checkbox or otherwise has multi_key set, assume we have a divided string that needs to be made into an array.\n if ($value !== null && ! is_array($value) && ($Field->attributes->type == 'checkbox' || $Field->attributes->multi_key)) {\n $value = explode($this->multi_delimiter, $value);\n }\n\n $this->Form()->{$Field->getOriginalName()}->attributes->value = $value;\n }\n }", "public function prepare_items()\n {\n\n global $wpdb;\n $cfdb = apply_filters( 'cfdb7_database', $wpdb );\n $table_name = $cfdb->prefix.'db7_forms';\n $columns = $this->get_columns();\n $hidden = $this->get_hidden_columns();\n $data = $this->table_data();\n $perPage = 10;\n $currentPage = $this->get_pagenum();\n $count_forms = wp_count_posts('wpcf7_contact_form');\n $totalItems = $count_forms->publish;\n\n\n $this->set_pagination_args( array(\n 'total_items' => $totalItems,\n 'per_page' => $perPage\n ) );\n\n $this->_column_headers = array($columns, $hidden );\n $this->items = $data;\n }", "abstract protected function prepareItem(array $item);", "abstract public function update( $fields );" ]
[ "0.6993024", "0.6408055", "0.5939241", "0.5823848", "0.5770377", "0.57505906", "0.5750281", "0.5735333", "0.57163507", "0.5684738", "0.55805737", "0.556548", "0.55561244", "0.55481344", "0.55175334", "0.55015504", "0.5477968", "0.5441511", "0.5421509", "0.5386304", "0.5386304", "0.5330011", "0.5322481", "0.53217894", "0.53021795", "0.5282893", "0.5274441", "0.5270859", "0.5265287", "0.5259084" ]
0.780567
0
Arrays constructor, wraps the subject for chainable operations
function __construct( array $_subject ) { $this->subject = $_subject; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static function from( array $_subject ): Arrays {\n\t\treturn new Arrays( $_subject );\n\t}", "public static function make(array ...$arrays): Collection;", "public abstract function as_array();", "public function __construct(array $data);", "public static function toArray(): callable\n {\n return [Arrays::class, 'coerce'];\n }", "final public function array(): self\n {\n return $this->constraint($this->constraintFactory()->type(IsType::TYPE_ARRAY));\n }", "public function __construct( $array = array(), $flags = parent::ARRAY_AS_PROPS )\n\t{\n\t\tparent::__construct( $array, $flags );\n\t}", "public function __construct($array = array())\n {\n $this->array = is_array($array) ? $array : func_get_args();\n }", "abstract public function __construct(array $data = []);", "public function __construct($array = [])\n\t{\n\t\t$this->array = self::convertToArray($array);\n\t}", "public function __construct()\n {\n $this->initArrays();\n }", "abstract public function build(): array;", "public function __construct(array $value = [])\n {\n parent::__construct();\n\n if ($value instanceof ArrayObject) {\n $value = $value->getArrayCopy();\n }\n\n $this->value = array_values($value);\n $this->size = count($value);\n }", "protected function __construct($array) {\r\n if (isset($array)) {\r\n foreach ($array as $index=>$value) {\r\n if (is_array($value)) {\r\n # Check for recursive arrays, this idea of print_r isn't good\r\n if (\r\n count($value) === count($array)\r\n &&\r\n print_r($value,true) === print_r($array,true)\r\n ) {\r\n continue;\r\n }\r\n else {\r\n # Fix for https://code.google.com/p/add-mvc-framework/issues/detail?id=83\r\n $this->data[$index] = new self($value);\r\n }\r\n\r\n }\r\n else {\r\n $this->data[$index] = $value;\r\n }\r\n }\r\n }\r\n }", "public function __construct($array)\n {\n $this->array = $array;\n }", "public function __construct($array)\n {\n $this->m_array = $array;\n }", "public static function make($array = array())\n {\n return new static(is_array($array) ? $array : func_get_args());\n }", "public static function fromArray(array $data): self\n {\n return (new self($data));\n }", "abstract public function toArray();", "abstract public function toArray();", "abstract public function toArray();", "abstract public function toArray();", "abstract public function toArray();", "abstract public function toArray();", "abstract public function toArray();", "public function getArrayCopy()\n {\n $subject = $this->itSubject;\n return $this->$subject;\n }", "public function __construct(array $array)\n {\n $this->array=$array;\n }", "function __construct(){\n $this->array = array();\n }", "public function __construct(Array $arr) {\n $this->length = count($arr);\n foreach ($arr as $item) {\n \t// We are using a pointer to save on memory\n $this->data[$item] = &$this->stub;\n }\n }", "public function newArray($array = array())\n {\n return new RsoArray($array);\n }" ]
[ "0.7380493", "0.6180964", "0.5977752", "0.5947154", "0.59452665", "0.5941631", "0.5895915", "0.5895073", "0.5858389", "0.58257544", "0.58067006", "0.57720363", "0.57474214", "0.57053673", "0.5647954", "0.5626801", "0.5600221", "0.5600002", "0.55617887", "0.55617887", "0.55617887", "0.55617887", "0.55617887", "0.55617887", "0.55617887", "0.55593663", "0.55591244", "0.5547575", "0.551063", "0.54976493" ]
0.6409402
1
Maybe append an array segment to this array is $_should_append is true
function appendMaybe( array $_addition, bool $_should_append ): Arrays { if ( $_should_append ) { $this->subject = array_merge( $this->subject, $_addition ); } return $this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function appendToArray(array &$arr, $withKeys = false);", "public function append();", "function append(array $array, $value = null)\n{\n $array[] = $value;\n\n return $array;\n}", "public function append()\n\t{\n\n\t}", "public function isAppend();", "public function append($value): void {\n throw new \\Exception('This ' . __CLASS__ . ' does not support this action but it must implement it, because it is extending \\ArrayObject.');\n }", "static function add_or_append($key, $value, &$array){\n\t\tif(self::is_set($array, $key)){\n\t\t\tif(is_array($array[$key])){\n\t\t\t\t$array[$key][] = $value;\n\t\t\t}else{\n\t\t\t\t$array[$key] = array($array[$key],$value);\n\t\t\t}\n\t\t}else{\n\t\t\t$array[$key] = $value;\n\t\t}\n\t}", "public function setAppend($append);", "protected function getArrayableAppends()\n {\n $defaults = ['settings'];\n\n if (!count($this->appends)) {\n return $defaults;\n }\n\n return array_merge($defaults, $this->appends);\n }", "public function append($key, $value, $value_2 = true)\n {\n if (!isset($this->data[$key])) {\n $this->data[$key] = array();\n }\n\n if ((isset($this->data[$key])) && (!is_array($this->data[$key]))) { // Fix to corrupted data\n $this->data[$key] = array();\n }\n\n if ((!isset($this->data[$key][$value])) && !array_key_exists($value, $this->data[$key]) || $this->data[$key][$value] !== $value_2) {\n if ($this->paused) {\n return true;\n }\n\n $this->data[$key][$value] = $value_2;\n\n $this->save(false);\n\n return true;\n }\n\n return false;\n }", "function append( array $value, $preFormatCallable = false, $mode = \"a+\" ){\n \n return $this->write( $value, $preFormatCallable, $mode );\n \n }", "public function valueCanBeAppended()\n {\n $appended = $this->dto->append(['role' => 'admin']);\n $this->assertTrue(array_key_exists('role', $appended));\n }", "private function appendThings($array, $key, $value) {\n\t\tif(empty($array[$key]) && !isset($array[$key])){\n\t\t\t$array[$key] = array(0 => $value);\n\t\t}else{ //(is_array($array[$key]))\n\t\t\tif(array_key_exists($key, $array)){\n\t\t\t\t$array[$key][] = $value;\n\t\t\t}\n\t\t}\n\t\treturn $array;\n\t}", "public static function append(&$array, $value, $key = null)\n {\n if (!is_null($key)) {\n $process = self::get($array, $key);\n } else {\n $process = $array;\n }\n $process[] = $value;\n self::set($array, $key, $process);\n }", "public function add(int $newData) :bool\n {\n if ($this->numberOfElements >= ARRAY_MAX) return false;\n\n if ($this->tailHead == -1) $this->tailHead++;\n\n // If current tail end is latest value of array, we have to move it to hea.\n if ($this->tailEnd == ARRAY_MAX-1) $this->tailEnd = 0;\n\n $data[$this->tailEnd] = $newData;\n\n // Increase number of elements\n $this->numberOfElements++;\n\n }", "protected function arrayupdate() {\n \n }", "public function appendTo( ArrayNodeDefinition &$rootNode )\n\t{\n\t\t$rootNode->append( $this->addDaemonNode() );\n\t}", "function addArray($array, $prefix = 'index_')\r\n {\r\n $parent_row = $this->insertNewResult($metadata);\r\n\r\n $array = $this->prepareArray($array, $prefix);\r\n if (!$array) {\r\n return false;\r\n }\r\n\r\n $this->DoArray2Xml($array, $parent_row);\r\n }", "public function appendData() {\n\t\tforeach(func_get_args() as $data) {\n\t\t\tif($data) {\n\t\t\t\tif ($data instanceof Core_ActiveRecordSet) {\n\t\t\t\t\t$this->activeRecords = array_merge($this->activeRecords, $data->activeRecords);\n\t\t\t\t}\n\t\t\t\telseif(is_array($data) && $data) {\n\t\t\t\t\t$this->activeRecords = array_merge($this->activeRecords, $data);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "function array_insert(&$array, $insert, $position){\n\tif(!is_numeric($position)) return false;\n\t\tif(is_object($insert) OR is_array($insert)) {\n\t\t\t$array = array_merge($array, array($insert));\n\t\t\t}\n\t\telse{\n\t\t\t$head = array_slice($array, 0, $position);\n\t\t\t$insert = array($insert);\n\t\t\t$tail = array_slice($array, $position);\n\t\t\t$array = array_merge($head, $insert, $tail);\n\t\t\t}\n\n\treturn true;\n\t}", "public function isAppend()\n\t{\n\t\treturn $this->append;\n\t}", "function add_item(&$arr, $item)\n{\n if (array_search($item, $arr) === false) {\n $arr[] = $item;\n return true;\n } else {\n return false;\n }\n}", "public function isAppend()\n {\n return $this->append;\n }", "public function isAppend()\n {\n return $this->append;\n }", "private function append_array(&$a1, $a2) {\r\n for($i = 0; $i < count($a2); $i++) {\r\n $a1[] = $a2[$i];\r\n }\r\n }", "public function hasArrayAllowed(): bool\n {\n return $this->has(ConfigUtil::ALLOW_ARRAY);\n }", "function array_push (array &$array, $var, $_ = null) {}", "function append( array $_addition ): Arrays {\n\t\t$this->subject = array_merge( $this->subject, $_addition );\n\n\t\treturn $this;\n\t}", "function add(array $data) : ?array;", "public function append($item);" ]
[ "0.58010006", "0.57899815", "0.5637473", "0.56306154", "0.5596132", "0.5548915", "0.55274105", "0.54928267", "0.544207", "0.5422187", "0.5356023", "0.5355554", "0.5343864", "0.5231759", "0.52278894", "0.52243143", "0.5220125", "0.5207111", "0.51927376", "0.51633793", "0.5153899", "0.51329887", "0.51286453", "0.51286453", "0.5117391", "0.50832933", "0.50760186", "0.5071712", "0.50644153", "0.50471324" ]
0.62594366
0
Chainable wrapper to run array_filter on the internal subject
function filter( ?callable $_function ): Arrays { $this->subject = array_filter( $this->toArray(), $_function ); return $this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function array_filter (array $input, callable $callback = \"\") {}", "function filter($callback = NULL) {\n return array_filter($this->a, $callback);\n }", "public function filter($closure = null, int $flag = \\ARRAY_FILTER_USE_BOTH);", "function filter(...$args) {\n return sizeof($args) === 2\n ? call_user_func_array('array_filter', [$args[1], $args[0]])\n : function($arr) use ($args) { return call_user_func_array('array_filter', [$arr, $args[0]]); };\n}", "function filter_array($array)\n{\n foreach($array as $value)\n {\n //call the filter funciton just above\n filter($value);\n }\n}", "function lfilter(callable $callback): Closure\n{\n return function (array $input) use ($callback): array {\n return filter($input, $callback);\n };\n}", "function filter_me($array) { \n\n foreach ($array as &$value)\n if (is_array($value)) $value = filter_me($value); \n return array_filter($array); \n}", "function filter(array $input, callable $callback): array\n{\n return array_values(array_filter($input, $callback));\n}", "function arrayFilter($array)\n {\n if(!empty($array)) {\n return array_filter($array);\n }\n }", "public function filter(callable $test): array;", "public function complexFilter(){\n $mainoffers = Offer::get();\n $offersArr = collect($mainoffers);\n $resultOfFilter = $offersArr->filter(function($key, $value){\n return $key['id'] >= 42;\n });\n return array_values($resultOfFilter->all()); //get only values of array\n }", "public function filter(callable $callable) : Arrays\n {\n $this->array = array_filter($this->array, $callable);\n return $this;\n }", "function array_filter($input, $callback, $reKey=false)\n {\n if ($input instanceof \\Iterator) {\n $input = iterator_to_array($input);\n }\n $filtered = \\array_filter($input, $callback);\n if ($reKey) {\n $filtered = array_values($filtered);\n }\n return $filtered;\n }", "public static function filter($array, $closure = null)\n {\n if (!$closure) {\n return ArraysMethods::clean($array);\n }\n\n return array_filter($array, $closure);\n }", "public function filter($callable);", "public function filter($callable)\n {\n return self::fromArray(array_filter($this->_arr, $callable));\n }", "public function filter($callback = null)\n {\n if (is_null($callback)) {\n return new static(array_filter($this->array)); \n }\n return new static(array_filter($this->array, $callback));\n }", "function myfilter($input_var_outer, $param) {\n global $var_to_pass;\n $var_to_pass = $param;\n\n function mycallback($input_var_inner) {\n global $var_to_pass;\n return ($input_var_inner == $var_to_pass) ? true : false;\n }\n\n $return_arr = array_filter($input_var_outer, 'mycallback');\n $return_arr = array_merge(array(), $return_arr);\n return $return_arr;\n}", "public function testArrayFilterWithMultipleValues() {\n $original = ['foo', 0, '', 'bar', FALSE, 'baz', [], 'zip'];\n $expected = ['foo', 'bar', 'baz', 'zip'];\n $this->assertArrayEquals($expected, $this->plugin->tamper($original));\n }", "function filterUnique( int $_sort_flags = SORT_REGULAR ): Arrays {\n\t\t$this->subject = array_unique( $this->subject, $_sort_flags );\n\n\t\treturn $this;\n\t}", "function filter(callable $predicate, iterable $collection = null) {\n return autocurry(\n function ($predicate, $collection): iterable {\n $collection = is_array($collection) ? $collection : iterator_to_array($collection);\n $filtered = array_filter($collection, $predicate);\n return is_assoc($collection) ? $filtered : array_values($filtered);\n },\n 2\n )(...func_get_args());\n}", "public function filter(Closure $p) {\n return new static(array_filter($this->_collection, $p));\n }", "public abstract function filter(callable $predicate);", "public static function filterArray($arr){\n return filter_var_array($arr);\n }", "function filter($callable, array $data) {\n $query = apply($data)->filter($callable);\n \n return $query();\n}", "function array_where($array, Closure $callback)\n {\n $filtered = array();\n\n foreach ($array as $key => $value)\n {\n if (call_user_func($callback, $key, $value)) $filtered[$key] = $value;\n }\n\n return $filtered;\n }", "function array_where($array, Closure $callback)\n {\n $filtered = array();\n\n foreach ($array as $key => $value) {\n if (call_user_func($callback, $key, $value)) $filtered[$key] = $value;\n }\n\n return $filtered;\n }", "function filter($iterable, $callback): \\Iterator {\n return new CallbackFilterIterator(toIterator($iterable), $callback);\n}", "function array_split_filter(array $array, callable $callback)\n {\n $passesFilter = array_filter($array, $callback);\n $negatedCallback = function ($item) use ($callback) {\n return !$callback($item);\n };\n $doesNotPassFilter = array_filter($array, $negatedCallback);\n return [$passesFilter, $doesNotPassFilter];\n }", "function filter($data) {\n return $data;\n}" ]
[ "0.74107796", "0.70855355", "0.6795378", "0.6728478", "0.671863", "0.6368098", "0.6329193", "0.6259172", "0.62471914", "0.6239074", "0.62065065", "0.6182684", "0.6140251", "0.61201924", "0.61096686", "0.6095753", "0.60923463", "0.595189", "0.5949852", "0.5891695", "0.587843", "0.5874676", "0.5858432", "0.5848477", "0.58453596", "0.5813871", "0.57949215", "0.5789938", "0.5780293", "0.57760817" ]
0.73517275
1
Is used to fill `$this>mirrors` using current configuration
protected function fill_mirrors () { $this->mirrors = [ 'count' => 0, 'http' => [], 'https' => [] ]; foreach ($this->core['url'] as $i => $address) { list($protocol, $urls) = explode('://', $address, 2); $urls = explode(';', $urls); $this->mirrors[$protocol][] = $urls[0]; } $this->mirrors['count'] = count($this->mirrors['http']) + count($this->mirrors['https']); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function reflect($mirrors = null)\n {\n app(MirrorManager::class)->reflect($this, $mirrors);\n }", "public function reflectNow($mirrors = null)\n {\n app(MirrorManager::class)->reflect($this, $mirrors);\n }", "public function populate()\n {\n $config = $this->getConfig();\n\n if (is_array($config)) {\n foreach ($config as $key => $value) {\n $this->$key = $value;\n }\n }\n }", "public function __construct ()\n\t{\n\t\t$query = DB::Query(Database::SELECT, 'SELECT `key`, `value` FROM config');\n\t\t\n\t\t$results = $query->execute('default-slave');\n\n\t\tforeach ($results AS $result)\n\t\t{\n\t\t\t$this->config[$result['key']] = $result['value'];\n\t\t}\n\t}", "protected function _setupMetadata() {\n $this->_referenceMap = array(\n 'feeds' => array(\n 'columns' => 'feed',\n 'refTableClass' => 'application_models_feeds',\n 'refColumn' => 'id'\n )\n );\n parent::_setupMetadata();\n }", "protected function _postConstruct()\n {\n parent::_postConstruct();\n \n // populate each of these properties with its config value ...\n $list = array_keys($this->_Solar_Php);\n foreach ($list as $key) {\n // ... but only if not null.\n if ($this->_config[$key] !== null) {\n $var = \"_$key\";\n $this->$var = $this->_config[$key];\n }\n }\n }", "protected function setProxies()\n {\n $proxyHandler = $this->getMeta()->getProxyHandler();\n\n $class = $this->getConfig('proxy.class') ?: config('field.proxy.class');\n $proxies = \\array_merge(config('field.proxy.configurations'), $this->getConfig('proxy.configurations', []));\n\n foreach ($proxies as $methodName => $data) {\n if (\\is_null($data)) {\n continue;\n }\n\n $templates = Arr::get($data, 'templates', []);\n\n $proxyHandler->add(new $class(\n $this, $methodName,\n Arr::get($data, 'static', false),\n Arr::get($data, 'allow_multi', true),\n Arr::get($data, 'needs_value', false),\n Arr::get($templates, 'name'), Arr::get($templates, 'multi_name')\n ));\n }\n }", "protected function resolve()\n {\n // Loop through all of the providers\n foreach ($this->providers as $name => $class) {\n\n // Merge all of the possible settings together\n $this->settings[$name] =\n $this->resolveContentSettings($name, $class)\n ->merge($this->resolveAppSettings($name, $class))\n ->merge($this->resolveDatabaseSettings($name, $class))\n ->merge($this->resolveUserSettings($name, $class))\n ->all();\n\n // Write the settings to the main config\n $this->publishSettings(\n $this->getSettingsNamespace($name),\n $this->settings[$name]\n );\n }\n }", "public function init()\n {\n foreach($this->attributes() as $attribute) {\n $this->$attribute = Settings::get(explode('_', $attribute));\n }\n }", "private function setUpDefaults()\n {\n// $this->defaults = Config::get('defaults'); ????????????????\n $defaults = Config::get('defaults');\n\n// foreach ($this->defaults as $key => $default) { ????????????\n foreach ($defaults as $key => $default) {\n $this->$key = $default;\n }\n }", "abstract protected function configure();", "abstract protected function configure();", "abstract public function configure();", "private function resolveConfigs()\n {\n foreach ($this->typeConfigs as $identifier => $config) {\n $this->resolveConfig($identifier, $config);\n }\n $this->typeConfigs = [];\n }", "protected function loadDefinition() {\n $cache = PerfORMController::getCache();\n $cacheKey = $this->getCacheKey();\n if (isset($cache[$cacheKey]) and is_object($cache[$cacheKey]) and get_class($cache[$cacheKey]) == get_class($this)) {\n foreach ($cache[$cacheKey]->getProperties() as $property => $value) {\n $this->{$property} = $value;\n }\n }\n else {\n $this->buildDefinition();\n }\n }", "protected function _init() \n\t{\n\t\tforeach($this->_autoConfig as $key => $flag) \n\t\t{\n\t\t\tif(!isset($this->_config[$key]) && !isset($this->_config[$flag]))\n\t\t\t\tcontinue;\n\n\t\t\tif($flag === 'merge')\n\t\t\t\t$this->{\"_{$key}\"} = $this->_config[$key] + $this->{\"_{$key}\"};\n\t\t\telse\n\t\t\t\t$this->{\"_$flag\"} = $this->_config[$flag];\n\t\t}\n\t}", "function __construct() {\n\n $path = dirname(dirname(__DIR__)).\"/config/\";\n\n $this->contenttypes = Yaml::parse($path.\"contenttypes.yml\");\n $this->configuration = Yaml::parse($path.\"config.yml\");\n $this->taxonomies = Yaml::parse($path.\"taxonomies.yml\");\n $this->widgets = Yaml::parse($path.\"widgets.yml\");\n\n /*\n echo \"<pre>\\n\";\n print_r($this->contenttypes);\n echo \"</pre>\\n\";\n\n echo \"<pre>\\n\";\n print_r($this->configuration);\n echo \"</pre>\\n\";\n\n echo \"<pre>\\n\";\n print_r($this->taxonomies);\n echo \"</pre>\\n\";\n */\n }", "public function __construct() {\n $this->buildCustomMappings();\n }", "function initialize($config = array()) \n {\n foreach ($config as $key => $val) \n {\n if (isset($this->$key)) \n {\n $this->$key = $val;\n }\n }\n }", "public function init()\n {\n foreach ($this->dynamic as $key => $data) {\n // Locate field.\n $path = explode('/', $key);\n $current = &$this->items;\n\n foreach ($path as $field) {\n if (is_object($current)) {\n // Handle objects.\n if (!isset($current->{$field})) {\n $current->{$field} = [];\n }\n\n $current = &$current->{$field};\n } else {\n // Handle arrays and scalars.\n if (!is_array($current)) {\n $current = [$field => []];\n } elseif (!isset($current[$field])) {\n $current[$field] = [];\n }\n\n $current = &$current[$field];\n }\n }\n\n // Set dynamic property.\n foreach ($data as $property => $call) {\n $action = $call['action'];\n $method = 'dynamic' . ucfirst($action);\n $call['object'] = $this->object;\n\n if (isset($this->handlers[$action])) {\n $callable = $this->handlers[$action];\n $callable($current, $property, $call);\n } elseif (method_exists($this, $method)) {\n $this->{$method}($current, $property, $call);\n }\n }\n }\n\n return $this;\n }", "function initialize($config = array()) {\r\n foreach ($config as $key => $val) {\r\n if (isset($this->$key)) {\r\n $this->$key = $val;\r\n }\r\n }\r\n }", "public function __construct()\n {\n if (isset($GLOBALS['TYPO3_CONF_VARS']['EXT']['extConf']['maps2'])) {\n // get global configuration\n $extConf = unserialize($GLOBALS['TYPO3_CONF_VARS']['EXT']['extConf']['maps2']);\n if (is_array($extConf) && count($extConf)) {\n // call setter method foreach configuration entry\n foreach ($extConf as $key => $value) {\n $methodName = 'set' . ucfirst($key);\n if (method_exists($this, $methodName)) {\n $this->$methodName($value);\n }\n }\n }\n }\n }", "public function collect() {\n foreach($this->loader->getPrefixesPsr4() as $dir) {\n $this->drilldown($dir);\n }\n foreach($this->loader->getClassMap() as $dir) {\n $this->drilldown($dir);\n }\n\n return $this->configData;\n }", "public function __construct()\n {\n foreach (parse_ini_file(__DIR__ . '/classmap.ini') as $wsdlType => $phpType) {\n $this[$wsdlType] = $phpType;\n }\n }", "public function __construct()\n {\n // get global configuration\n $extConf = unserialize($GLOBALS['TYPO3_CONF_VARS']['EXT']['extConf']['maps2']);\n if (is_array($extConf) && count($extConf)) {\n // call setter method foreach configuration entry\n foreach ($extConf as $key => $value) {\n $methodName = 'set' . ucfirst($key);\n if (method_exists($this, $methodName)) {\n $this->$methodName($value);\n }\n }\n }\n }", "private function restoreManualIPs()\n {\n $providerManager = $this->app->make(ProviderManager::class);\n $manualConfiguration = $providerManager->getProviderConfiguration('manual');\n $config = $this->app->make('config');\n $config->set('concrete.security.trusted_proxies.ips', $manualConfiguration['ips']);\n $config->save('concrete.security.trusted_proxies.ips', $manualConfiguration['ips']);\n }", "protected function _setupMetadata() {\n $this->_referenceMap = array(\n 'categories' => array(\n 'columns' => 'category',\n 'refTableClass' => 'application_models_categories',\n 'refColumn' => 'id'\n )\n );\n parent::_setupMetadata();\n }", "public function __construct()\n {\n parent::__construct();\n $this->defaultDirectories = [\n config('images.boards_images_dir'),\n config('images.project_thumb_dir'),\n config('images.user_avatar_dir')\n ];\n $this->defaultPlaceHolders = [\n [\n 'remote' => config('images.project_thumb_dir') . '/' . config('images.default_project_thumb'),\n 'local' => File::get('public/images/placeholders/project_default.png')\n ],\n [\n 'remote' => config('images.user_avatar_dir') . '/' . config('images.default_user_avatar'),\n 'local' => File::get('public/images/placeholders/avatar_default.png')\n ]\n ];\n }", "private function init()\n\t{\n\t\tif (!$this->init) {\n\t\t\t$this->init = true;\n\t\t\t$this->defaultMapper = new DefaultMapper;\n\t\t\t$this->checkConflicts();\n\t\t\tforeach ($this->mappers as $mapper) {\n\t\t\t\tforeach ($mapper->getMappedTables() as $table) {\n\t\t\t\t\t$this->tableToMapper[$table] = $mapper;\n\t\t\t\t}\n\n\t\t\t\tforeach ($mapper->getMappedEntities() as $entity) {\n\t\t\t\t\t$this->entityClassToMapper[$entity] = $mapper;\n\t\t\t\t}\n\n\t\t\t\tforeach ($mapper->getMappedNamespaces() as $namespace) {\n\t\t\t\t\t$this->entityNamespaceToMapper[$namespace] = $mapper;\n\t\t\t\t}\n\n\t\t\t\tforeach ($mapper->getMappedRepositories() as $repository) {\n\t\t\t\t\t$this->repositoryClassToMapper[$repository] = $mapper;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "private function __loader()\n {\n foreach ($_ENV['APP']['loader'] as $__set__var => $__set__key)\n if ($this->__set__($__set__var))\n $this->$__set__var = new $__set__key();\n }" ]
[ "0.5750839", "0.56932795", "0.5585786", "0.54781246", "0.5335855", "0.5301735", "0.5217733", "0.5199369", "0.5121368", "0.5060295", "0.5058123", "0.5058123", "0.5036338", "0.5035665", "0.5033002", "0.50085413", "0.49863067", "0.49696198", "0.4964981", "0.49368587", "0.489783", "0.48534405", "0.4838859", "0.4798869", "0.47981796", "0.4772043", "0.47711638", "0.47544354", "0.47502503", "0.4739685" ]
0.7401114
0
Canceling of applied settings
function cancel () { Cache::instance()->del('config'); $this->load_configuration(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function revertSettings() {\n if (!empty($this->settings)) {\n if (isset($this->settings['language'])) {\n $lang = $this->settings['language'];\n $this->updateLanguage($lang['field'], $lang['value'], $lang['langcode']);\n }\n }\n }", "public function reset_settings() {\n\t\t// Die if user does not have permission to change settings.\n\t\tif ( ! $this->_plugin->settings()->CurrentUserCan( 'edit' ) ) {\n\t\t\twp_send_json_error( esc_html__( 'Access Denied.', 'wp-security-audit-log' ) );\n\t\t}\n\n\t\t// Verify nonce.\n\t\t$nonce = filter_input( INPUT_POST, 'nonce', FILTER_SANITIZE_STRING );\n\t\tif ( empty( $nonce ) || ! wp_verify_nonce( $nonce, 'wsal-reset-settings' ) ) {\n\t\t\twp_send_json_error( esc_html__( 'Nonce Verification Failed.', 'wp-security-audit-log' ) );\n\t\t}\n\n // delete all settings\n WSAL_Uninstall::delete_options_from_wp_options();\n\n // Log settings reset event.\n $this->_plugin->alerts->Trigger( 6006 );\n wp_send_json_success( esc_html__( 'Plugin settings have been reset.', 'wp-security-audit-log' ) );\n\t}", "function reset() {\n\t$reset = new Reset( new Context( GOOGLESITEKIT_PLUGIN_MAIN_FILE ) );\n\t$reset->all();\n\n\tWP_CLI::success( 'Settings successfully reset.' );\n}", "public function resetPreferences() {\n\t\tif ($this->isDirty()) {\n\t\t\tforeach (self::$allowedPreferences as $preference) {\n\t\t\t\t$fn = self::preferenceMethod($preference, false);\n\t\t\t\t$this->{$fn}();\n\t\t\t}\n\t\t}\n\t}", "function jr_mt_delete_settings_expl() {\n\tif ( defined( 'JR_MT_LIST_SETTINGS' ) ) {\n\t\t?>\n\t\t<p>\n\t\tAll Theme Selection entries are displayed below,\n\t\tin the exact order in which they will be processed.\n\t\tFor example,\n\t\tif a match is made with the first Entry,\n\t\tthe first Entry's Theme will be used,\n\t\tno matter what Theme the Second and subsequent Entries specify.\n\t\t</p>\n\t\t<p>\n\t\tYou can delete any of these entries by filling in the check box beside the entry\n\t\tand clicking any of the <b>Save All Changes</b> buttons.\n\t\tTo change the Theme for an entry,\n\t\tyou will need to delete the entry\n\t\tand add the same entry with a different Theme in the relevant section\n\t\ton this or the Advanced Settings tab.\n\t\t</p>\n\t\t<p>\n\t\tTo add or remove (or to learn about) the Sticky or Override setting for a Query,\n\t\tsee the Advanced Settings tab.\n\t\t</p>\n\t\t<?php\n\t}\n}", "public function cancelWithoutChecks(): void {\n\t\t$this->cancelled = true;\n\t}", "function Deactivate() {\r\n\t\t\t# Cleanup data\r\n\t\t\tif (get_option(c_pwa_option_clean) == 'TRUE') {\r\n\t\t\t\tglobal $wpdb;\r\n\t\t\t\t# Delete options\r\n\t\t\t\t$rows = $wpdb->get_results(\"SELECT option_name FROM \" . $wpdb->options . \" WHERE option_name LIKE 'pwaplusphp_%'\");\r\n\t\t\t\tforeach ($rows as $row)\r\n\t\t\t\t\tdelete_option($row->option_name);\r\n\t\t\t}\r\n\r\n\t\t}", "private static function reset() {\n\t\tfile_put_contents(static::$file, self::defaultSettings());\n\t}", "public static function ajax_reset_settings() {\n\t\tif ( check_ajax_referer( 'wprm', 'security', false ) ) {\n\t\t\t// Clear all settings.\n\t\t\tdelete_option( 'wprm_settings' );\n\n\t\t\twp_send_json_success( array(\n\t\t\t\t'redirect' => admin_url( 'admin.php?page=wprm_settings' ),\n\t\t\t) );\n\t\t}\n\n\t\twp_die();\n\t}", "function language_selector_invalidate_setting() {\n\telgg_unset_plugin_setting(\"allowed_languages\", \"language_selector\");\n}", "public function cancel()\n {\n $this->resetInput();\n $this->updateMode = false;\n }", "public static function clearSettings() {\n global $wpdb;\n\n //clear wp_options\n $oquery = \"DELETE FROM {$wpdb->options} WHERE (`option_name` LIKE %s) AND \";\n $oquery .= \"(`option_name` NOT IN ('aam-extensions', 'aam-uid'))\";\n $wpdb->query($wpdb->prepare($oquery, 'aam%'));\n\n //clear wp_postmeta\n $pquery = \"DELETE FROM {$wpdb->postmeta} WHERE `meta_key` LIKE %s\";\n $wpdb->query($wpdb->prepare($pquery, 'aam-post-access-%'));\n\n //clear wp_usermeta\n $uquery = \"DELETE FROM {$wpdb->usermeta} WHERE `meta_key` LIKE %s\";\n $wpdb->query($wpdb->prepare($uquery, 'aam%'));\n\n $mquery = \"DELETE FROM {$wpdb->usermeta} WHERE `meta_key` LIKE %s\";\n $wpdb->query($wpdb->prepare($mquery, $wpdb->prefix . 'aam%'));\n \n self::clearCache();\n }", "public function global_reset_option() {\n\t\tupdate_option( 'aione_dynamic_css_posts', array() );\n\t}", "public function wash()\n {\n foreach ($this->getDirty() as $name) {\n if (isset($this->settings[$name])) {\n $this->setting->updateOrCreate(\n ['name' => $name],\n ['value' => $this->settings[$name]]\n );\n } else {\n $this->setting->destroyByName($name);\n }\n }\n\n if ($this->dirtyCount) {\n $this->event->fire(new SettingsSaved);\n $this->dirty = [];\n }\n\n $this->dirtyCount = 0;\n }", "protected function revert() {\n $this->replaceini('');\n $this->reset();\n }", "function sunset_theme_options() {\r\n\techo 'Activate and Deactivate specific Theme Support Options';\r\n}", "function deactivate() {\n\tif ( function_exists( 'rocket_delete_config_file' ) {\n\t\trocket_delete_config_file();\n\t}\n\t\n\t// Remove customizations upon deactivation.\n\tremove_filter( 'rocket_config_files_path', __NAMESPACE__ . '\\clone_config' );\n\t\n\t// Flush .htaccess rules, and regenerate WP Rocket config file.\n\tflush_wp_rocket();\n\n\n}", "function Deactivate_Pro() {\r\n\t\t\tdelete_option('pwaplusphp_flickr_username');\r\n\t\t\tdelete_option('pwaplusphp_cache_thumbs');\r\n\t\t\t//delete_option('pwaplusphp_main_photo_page');\r\n\t\t\tdelete_option('pwaplusphp_show_comments');\r\n\t\t\t//delete_option('pwaplusphp_jq_pagination');\r\n\t\t\tdelete_option('pwaplusphp_images_on_front');\r\n\t\t\tdelete_option('pwaplusphp_show_button');\r\n\t\t\tdelete_option('pwaplusphp_show_exif');\r\n\t\t\tdelete_option('pwaplusphp_lazyload');\r\n\t\t\tdelete_option('pwaplusphp_lazyload_img');\r\n\t\t\tdelete_option('pwaplusphp_add_widget');\r\n\t\t\tdelete_option('pwaplusphp_option_clean');\r\n\t\t}", "public function disable(): void\n {\n $this->config->disable();\n }", "function _cancel()\n\t{\n\t\t$this->selected_id = $this->_none;\n\t\t$this->db_cancel();\n\t\t$this->Mode = '';\n\t}", "public function beforeSurveySettings()\n {\n $oEvent = $this->event;\n $oEvent->set(\"surveysettings.{$this->id}\", array(\n 'name' => get_class($this),\n 'settings' => array(\n 'bDeleteResponses' => array(\n 'type' => 'select',\n 'label' => 'Delete response on redacting',\n 'options'=>array(\n 0=> 'No (default)',\n 1=> 'Yes'\n ),\n 'default'=>0,\n 'help'=>'If set to yes, whenever a user redacts his token data, all the responses belonging to that token will get deleted',\n 'current'=> $this->get('bDeleteResponses','Survey',$oEvent->get('survey')),\n \n )\n ),\n ));\n }", "private function _clearConfig() {\n\t \n\t $config = Mage::getConfig();\t\t\n\t\t$config->deleteConfig('rublon_temp_key');\n\t\t$config->deleteConfig('rublon_start_time');\n\t}", "function clean_up_global_scope() {\n\t\tglobal $wp_customize;\n\t\t$wp_customize = null;\n\t\tparent::clean_up_global_scope();\n\t}", "public function reset_all_transients() {\n\n\t\tglobal $wpdb;\n\t\t/**\n\t\t * Build the query to delete all aione transients and execute the required SQL\n\t\t */\n\t\t$sql = \"DELETE FROM $wpdb->options WHERE option_name LIKE '_transient_aione_dynamic_css_%'\";\n\t\t$clean = $wpdb->query( $sql );\n\n\t}", "public function cancel()\n {\n $this->_cancel = true;\n }", "function reset_global_settings(){\n\n\t$settings = pl_get_global_settings();\n\n\t$set['draft'] = array();\n\t\n\tpl_update_global_settings( $set );\n\t\n\tset_default_settings();\n\n\tglobal $dms_cache;\n\t$dms_cache->purge('draft');\n\t\n\treturn $set;\n}", "private function _cancel_action(){\n $r_stat = (new Remover($this->_project_id, $this->_user_id))->innocentlyRemove();\n if($r_stat === Remover::R_DELETE_INPUT){ // Reverted\n $this->_log(\"Reverted back to the previous result.\", Logger::GREEN);\n }else{ // Couldn't revert back\n $this->_log(\"The project files are deleted.\", Logger::RED);\n }\n }", "public static function unregisterPlayerSettings(): void\n {\n SettingsInfo::unregisterSetting(self::SETTING_PE_ONLY);\n SettingsInfo::unregisterSetting(self::SETTING_SPECTATE_DUELS);\n }", "public function applyDefaultValues()\n {\n $this->is_analysis = false;\n $this->is_obsolete = false;\n }", "function bbp_converter_setting_callback_clean()\n{\n}" ]
[ "0.6634452", "0.63895786", "0.6378764", "0.63372517", "0.62634104", "0.6260323", "0.61683565", "0.615524", "0.61374426", "0.60708594", "0.6055785", "0.60271215", "0.60247254", "0.5983207", "0.597127", "0.5956885", "0.5938904", "0.59072435", "0.5882195", "0.58472645", "0.5841191", "0.58381", "0.58304006", "0.5821277", "0.58145237", "0.5814453", "0.5799768", "0.57922304", "0.5784724", "0.5784394" ]
0.6937666
0
Get base url of current mirror including language suffix
function base_url () { if (Request::instance()->mirror_index === -1) { return ''; } $base_url = $this->core_url(); if ($this->core['multilingual']) { $L = Language::instance(); $base_url .= "/$L->clang"; } return $base_url; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function get_base_url()\n\t{\n\t\tif( Authority::can('access', 'admin'))\n\t\t{\n\t\t\tSettings::set_all_languages_online();\n\t\t}\n\n\t\tif (count(Settings::get_online_languages()) > 1 )\n\t\t{\n\t\t\treturn base_url() . Settings::get_lang() .'/';\n\t\t}\n\n\t\treturn base_url();\n\t}", "public function get_base_url()\n {\n return $this->get_config('mode') === self::LIVE_MODE ?\n \"https://login.remita.net\" :\n \"https://remitademo.net\";\n }", "abstract public static function get_base_url();", "public static function getBaseURL() {\n return \"http\".(self::getEnv('SERVER_PORT') == 443 ? \"s://\" : \"://\").\n self::getEnv('HTTP_HOST').self::$ini_config['kernel']->getKey('BasePathRouter').'/'.\n explode('_', \\session::get('language'))[0];\n }", "public static function base_url()\n\t{\n\t\treturn \\Mooo\\System\\Core\\Mooo::$base_url;\n\t}", "public function get_base_url(){\n\t\t$url = $this->Option->findByKey('cakecms_base_url');\n\t\treturn $url['Option']['value'];\n\t}", "public function getUrlBase() {\n return 'http'\n . (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on' ? 's' : '')\n . '://'.$_SERVER['SERVER_NAME']\n . ($_SERVER['SERVER_PORT'] != 80 ? ':'.$_SERVER['SERVER_PORT'] : '');\n // . $this->getUrlSub();\n }", "public function getBaseUrl () {\n\t\t$urlParts = $this->getUrlParts();\n\t\t$path = $urlParts['scheme'] . '://' . $urlParts['host'] \n\t\t\t\t. self::LOCAL_BASE_PATH;\n\t\tif ( substr($path, strlen($path) - 2, 1) ) {\n\t\t\t$path .= '/';\n\t\t}\n\t\treturn $path;\n\t}", "static public function getCurrentBaseUrl(): string\n {\n return 'http' . ($_SERVER['HTTPS']?'s':'') .'://'. $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];\n\t}", "public function getUrlBase()\n { \n return 'http'\n .(isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on' ? 's' : '')\n .'://'.$_SERVER['SERVER_NAME']\n .($_SERVER['SERVER_PORT'] != 80 ? ':'.$_SERVER['SERVER_PORT'] : '');\n }", "function getBaseUrl(){\n\t $protocol = '//';\n\t $path = $_SERVER['PHP_SELF'];\n\t $path_parts = pathinfo($path);\n\t $directory = $path_parts['dirname'];\n\t $directory = ($directory == \"/\") ? \"\" : $directory;\n\t $host = $_SERVER['HTTP_HOST'];\n\t return $protocol . $host . $directory;\n\t}", "public static function base() {\r\n\t\t\t\r\n\t\t\treturn static::$protocol .'://'. $_SERVER['HTTP_HOST'];\r\n\t\t}", "public function _getBaseUrl() {\n\t\treturn Geko_Uri::getBase();\n\t}", "public function getBaseURL() {\n return $this->getConfig('url', $this->base) ;\n }", "private function getClubBaseUrl(){\r\n return BX_DOL_URL_ROOT . $GLOBALS['oBxClubModule']->_oConfig->getBaseUri();\r\n }", "protected function getBaseHttpUrl() {\n return str_replace('https://', 'http://', $this->minkParameters['base_url']);\n }", "abstract function getBaseUrl();", "private function base_url() {\n global $config;\n if(isset($config['base_url']) && $config['base_url']) return $config['base_url'];\n\n $url = '';\n $request_url = (isset($_SERVER['REQUEST_URI'])) ? $_SERVER['REQUEST_URI'] : '';\n $script_url = (isset($_SERVER['PHP_SELF'])) ? $_SERVER['PHP_SELF'] : '';\n if($request_url != $script_url) {\n $url = trim(preg_replace('/'. str_replace('/', '\\/', str_replace('index.php', '', $script_url)) .'/', '', $request_url, 1), '/');\n }\n\n $protocol = $this->get_protocol();\n return rtrim(str_replace($url, '', $protocol . \"://\" . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']), '/');\n }", "public static function base()\n\t{\n\t\tstatic $base = false;\n\n\t\tif($base === false)\n\t\t{\n\t\t\t$base = Config::get('application.base_url');\n\n\t\t\t// Try to autodetect base url if its not configured\n\n\t\t\tif($base === '' && isset($_SERVER['HTTP_HOST']))\n\t\t\t{\n\t\t\t\t$protocol = Request::main()->isSecure() ? 'https' : 'http';\n\n\t\t\t\t$script = $_SERVER['SCRIPT_NAME'];\n\t\t\t\t\n\t\t\t\t$base = rtrim($protocol . '://' . $_SERVER['HTTP_HOST'] . str_replace(basename($script), '', $script), '/');\n\t\t\t}\n\n\t\t\t// Are we using clean URLs?\n\n\t\t\tstatic::$clean = Config::get('application.clean_urls');\n\n\t\t\t// Add request language to URL?\n\n\t\t\t$language = Request::main()->language();\n\n\t\t\tif(!empty($language))\n\t\t\t{\n\t\t\t\tstatic::$language = '/' . $language;\n\t\t\t}\n\t\t}\n\n\t\treturn $base;\n\t}", "public function determineBaseUrl()\n {\n // why this works at all :)\n return dirname($_SERVER['SCRIPT_NAME']);\n }", "function suggestBaseUrl()\n{\n\t$dir = substr($_SERVER[\"PHP_SELF\"], 0, strrpos($_SERVER[\"PHP_SELF\"], \"/\"));\n\t$dir = substr($dir, 0, strrpos($dir, \"/\"));\n\t$baseURL = \"http://{$_SERVER[\"HTTP_HOST\"]}{$dir}/\";\n\treturn $baseURL;\n}", "public function getBaseUrl();", "public function getBaseUrl();", "public static function getUrl()\n {\n return self::$baseURL;\n }", "public static function getSiteUrl(): string\r\n {\r\n \r\n return BASE_URL;\r\n }", "private function getBaseUri(){\n return \"{$this->config['api_url']}/v{$this->config['api_version']}/\";\n }", "public function getBaseUrl() {\r\n if ($pos = strpos($this->url, '?')) {\r\n return substr($this->url, 0, $pos);\r\n }\r\n return $this->url;\r\n }", "function base_url()\n{\n\t$root='';\n\t$root = \"http://\".$_SERVER['HTTP_HOST'];\n $root .= \"/\".DIR_MAIN;\n\treturn $root;\n}", "protected function _getBaseUrl()\n {\n $oSession = $this->getSession();\n $sUrl = $this->getConfig()->getSslShopUrl() . \"index.php?lang=\" . oxRegistry::getLang()->getBaseLanguage() . \"&sid=\" . $oSession->getId() . \"&rtoken=\" . $oSession->getRemoteAccessToken();\n $sUrl .= \"&shp=\" . $this->getConfig()->getShopId();\n\n return $sUrl;\n }", "static public function baseurl()\n {\n //the str_replace helps the solution to work both with virtual host and without\n return 'http://' . $_SERVER['HTTP_HOST'] . str_replace('/index.php', '', $_SERVER['SCRIPT_NAME']);\n }" ]
[ "0.7696954", "0.7441324", "0.741262", "0.73533314", "0.7268379", "0.72668296", "0.725065", "0.71502584", "0.7087721", "0.70567524", "0.7016141", "0.69916576", "0.6955532", "0.69473284", "0.6941088", "0.6930417", "0.68920916", "0.6885203", "0.68803626", "0.6858961", "0.683681", "0.682619", "0.682619", "0.6809979", "0.67884773", "0.6782076", "0.678009", "0.6778025", "0.6773127", "0.67707115" ]
0.8483471
0
/ Note: Locally compressed JSON with "deflate" contentencoding would automatically inflate but compressed JSON in the staging envirnment would not. So checking for "decodeable" JSON first to handle local "wrongful" decpmpression.
function handle_compression($response){ if( empty( json_decode($response->body) ) ){ // Decompress JSON if compressed. if ( isset($response->headers['content-encoding']) ) { if ($response->headers['content-encoding'] == 'gzip') { $response->body = gzinflate(substr($response->body, 10)); } elseif ($response->headers['content-encoding'] == 'deflate') { $response->body = gzinflate($response->body); } } } return $response; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function hasJsonDecodeFailed()\n {\n // you cannot safely determine decode errors in PHP < 5.3\n if (!function_exists('json_last_error')) {\n return false;\n }\n\n return json_last_error() !== JSON_ERROR_NONE;\n }", "function better_decode_json($json_text)\n{\n $result_to_json = json_decode($json_text, true);\n\n $json_error = '';\n switch (json_last_error())\n {\n\tcase JSON_ERROR_NONE:\n\t //$json_error = ' - No errors';\n\t break;\n\tcase JSON_ERROR_DEPTH:\n\t $json_error = ' - Maximum stack depth exceeded';\n\t break;\n\tcase JSON_ERROR_STATE_MISMATCH:\n\t $json_error = ' - Underflow or the modes mismatch';\n\t break;\n\tcase JSON_ERROR_CTRL_CHAR:\n\t $json_error = ' - Unexpected control character found';\n\t break;\n\tcase JSON_ERROR_SYNTAX:\n\t $json_error = ' - Syntax error, malformed JSON';\n\t break;\n\tcase JSON_ERROR_UTF8:\n\t $json_error = ' - Malformed UTF-8 characters, possibly incorrectly encoded';\n\t break;\n\tdefault:\n\t $json_error = ' - Unknown error';\n\t break;\n }\n\n if ($json_error != '')\n\t$result_to_json['error'] = \"in better_decode_json read error \" . $json_error;\n\n return $result_to_json;\n\n}", "function json_decode_ex($json)\n{\n \n $data = json_decode($json, true);\n \n if (JSON_ERROR_NONE !== json_last_error()) {\n throw new Exception(\n 'json_decode error: ' . json_last_error_msg()\n . '<br>json string:<br>' . $json\n );\n }\n \n return $data;\n \n \n}", "public static function isJsonActivated()\n {\n return function_exists('json_decode');\n }", "function isJSON($str){\n json_decode($str);\n return (json_last_error() == JSON_ERROR_NONE);\n}", "function is_json($TEXT) {\n json_decode($TEXT);\n return (json_last_error() == JSON_ERROR_NONE);\n }", "public function checkJSON(string $json) {\n $stream_orginal = $json;\n $json = @json_decode($json,true);\n switch (json_last_error()) {\n case JSON_ERROR_NONE:\n return $json;\n break;\n case JSON_ERROR_DEPTH:\n print_r($stream_orginal);\n trigger_error(__CLASS__.': Maximum stack depth exceeded', E_USER_WARNING);\n break;\n case JSON_ERROR_STATE_MISMATCH:\n print_r($stream_orginal);\n trigger_error(__CLASS__.': Underflow or the modes mismatch', E_USER_WARNING);\n break;\n case JSON_ERROR_CTRL_CHAR:\n print_r($stream_orginal);\n trigger_error(__CLASS__.': Unexpected control character found', E_USER_WARNING);\n break;\n case JSON_ERROR_SYNTAX:\n print_r($stream_orginal);\n trigger_error(__CLASS__.': Syntax error, malformed JSON', E_USER_WARNING);\n break;\n case JSON_ERROR_UTF8:\n print_r($stream_orginal);\n trigger_error(__CLASS__.': Malformed UTF-8 characters, possibly incorrectly encoded', E_USER_WARNING);\n break;\n default:\n print_r($stream_orginal);\n trigger_error(__CLASS__.': Unknown error', E_USER_WARNING);\n break;\n }\n\n unset($stream_orginal);\n return false;\n }", "function json_decode_loose($json){\n\n $GLOBALS['json_strings'] = array();\n\n\n #\n # first find obvious strings\n #\n#echo \"PRE-FIND: $json\\n\";\n $json = preg_replace_callback('!\"((?:[^\\\\\\\\\"]|\\\\\\\\\\\\\\\\|\\\\\\\\\")*)\"!', 'json_dqs', $json);\n $json = preg_replace_callback(\"!'((?:[^\\\\\\\\']|\\\\\\\\\\\\\\\\|\\\\\\\\')*)'!\", 'json_sqs', $json);\n#echo \"POST-FIND: $json\\n\";\n#print_r($GLOBALS['json_strings']);\n\n $json = preg_replace('!\\s+!', '', $json);\n\n\n #\n # missing elements\n #\n\n $json = str_replace('[,', '[null,', $json);\n $json = str_replace('{,', '{', $json);\n\n $json = str_replace(',]', ']', $json);\n $json = str_replace(',}', '}', $json);\n\n $json = preg_replace('!\\[([^[{]+),(\\s*),!', '[$1,null,', $json);\n $json = preg_replace('!\\{([^[{]+),(\\s*),!', '{$1,', $json);\n\n\n #\n # quote unquoted key names\n #\n\n $json = preg_replace_callback('!([a-zA-Z0-9-_]+):!', 'json_key', $json);\n\n\n #\n # turn remaning barewords into nulls.\n # loosely based on the ECMA spec, but avoiding requiring unicode PCRE.\n # http://www.ecma-international.org/publications/files/ECMA-ST/Ecma-262.pdf\n # (section 7.6)\n #\n\n $start = \"[A-Za-z\\$_]|(\\\\\\\\u[0-9A-Fa-f]{4})\";\n $continue = $start.'|[0-9-.]';\n\n $json = preg_replace_callback(\"!(($start)($continue)*)!\", 'json_bareword', $json);\n\n\n #\n # strip functions\n #\n\n $l = strlen($json);\n while (1){\n $json = preg_replace(\"!null\\(([^()]*)\\)!\", 'null', $json);\n $l2 = strlen($json);\n if ($l == $l2) break;\n $l = $l2;\n }\n\n\n #\n # replace the strings\n #\n\n#echo \"PRE-CONV: $json\\n\";\n\n $pre = preg_quote($GLOBALS['json_str_prefix'], '!');\n $json = preg_replace_callback('!'.$pre.'(\\d+)!', 'json_strs', $json);\n\n#echo \"POST-CONV: $json\\n\";\n\n $ret = JSON_decode($json, true);\n\n if ($ret === null){\n die(\"Failed to parse JSON:\\n$json\\n\");\n }\n\n return $ret;\n }", "function json_decode_loose($json){\n\n $GLOBALS['json_strings'] = array();\n\n\n #\n # first find obvious strings\n #\n#echo \"PRE-FIND: $json\\n\";\n $json = preg_replace_callback('!\"((?:[^\\\\\\\\\"]|\\\\\\\\\\\\\\\\|\\\\\\\\\")*)\"!', 'json_dqs', $json);\n $json = preg_replace_callback(\"!'((?:[^\\\\\\\\']|\\\\\\\\\\\\\\\\|\\\\\\\\')*)'!\", 'json_sqs', $json);\n#echo \"POST-FIND: $json\\n\";\n#print_r($GLOBALS['json_strings']);\n\n $json = preg_replace('!\\s+!', '', $json);\n\n\n #\n # missing elements\n #\n\n $json = str_replace('[,', '[null,', $json);\n $json = str_replace('{,', '{', $json);\n\n $json = str_replace(',]', ']', $json);\n $json = str_replace(',}', '}', $json);\n\n $json = preg_replace('!\\[([^[{]+),(\\s*),!', '[$1,null,', $json);\n $json = preg_replace('!\\{([^[{]+),(\\s*),!', '{$1,', $json);\n\n\n #\n # quote unquoted key names\n #\n\n $json = preg_replace_callback('!([a-zA-Z0-9-_]+):!', 'json_key', $json);\n\n\n #\n # turn remaning barewords into nulls.\n # loosely based on the ECMA spec, but avoiding requiring unicode PCRE.\n # http://www.ecma-international.org/publications/files/ECMA-ST/Ecma-262.pdf\n # (section 7.6)\n #\n\n $start = \"[A-Za-z\\$_]|(\\\\\\\\u[0-9A-Fa-f]{4})\";\n $continue = $start.'|[0-9-.]';\n\n $json = preg_replace_callback(\"!(($start)($continue)*)!\", 'json_bareword', $json);\n\n\n #\n # strip functions\n #\n\n $l = strlen($json);\n while (1){\n $json = preg_replace(\"!null\\(([^()]*)\\)!\", 'null', $json);\n $l2 = strlen($json);\n if ($l == $l2) break;\n $l = $l2;\n }\n\n\n #\n # replace the strings\n #\n\n#echo \"PRE-CONV: $json\\n\";\n\n $pre = preg_quote($GLOBALS['json_str_prefix'], '!');\n $json = preg_replace_callback('!'.$pre.'(\\d+)!', 'json_strs', $json);\n\n#echo \"POST-CONV: $json\\n\";\n\n $ret = JSON_decode($json, true);\n\n if ($ret === null){\n die(\"Failed to parse JSON:\\n$json\\n\");\n }\n\n return $ret;\n }", "function dj_json_decode(string $str)\n{\n $res = json_decode($str, true);\n if (json_last_error() !== JSON_ERROR_NONE) {\n error(\"Error decoding JSON data '$str': \".json_last_error_msg());\n }\n return $res;\n}", "function is_JSON( $string )\r\n{\r\n\treturn is_object( json_decode( $string ) );\r\n}", "#[Pure]\nfunction gzdecode(string $data, int $max_length = 0): string|false {}", "protected function jsonDecode($json)\n {\n // From firebase/php-jwt\n if (! (defined('JSON_C_VERSION') && PHP_INT_SIZE > 4)) {\n /**\n * In PHP >=5.4.0, json_decode() accepts an options parameter, that allows you\n * to specify that large ints (like Steam Transaction IDs) should be treated as\n * strings, rather than the PHP default behaviour of converting them to floats.\n */\n $obj = json_decode($json, false, 512, JSON_BIGINT_AS_STRING);\n } else {\n // @codeCoverageIgnoreStart\n /**\n * Not all servers will support that, however, so for older versions we must\n * manually detect large ints in the JSON string and quote them (thus converting\n * them to strings) before decoding, hence the preg_replace() call.\n * Currently not sure how to test this so I ignored it for now.\n */\n $maxIntLength = strlen((string) PHP_INT_MAX) - 1;\n $jsonWithoutBigints = preg_replace('/:\\s*(-?\\d{'.$maxIntLength.',})/', ': \"$1\"', $json);\n $obj = json_decode($jsonWithoutBigints);\n // @codeCoverageIgnoreEnd\n }\n\n return $obj;\n }", "#[Pure]\nfunction gzinflate(string $data, int $max_length = 0): string|false {}", "function acfe_is_json($string){\n \n // in case string = 1\n if(is_numeric($string))\n return false;\n \n json_decode($string);\n \n return (json_last_error() == JSON_ERROR_NONE);\n \n}", "private function canonicalizeJson($json)\r\r\n {\r\r\n $decodedJson = \\json_decode($json, true);\r\r\n if (\\json_last_error()) {\r\r\n return [true, null];\r\r\n }\r\r\n $this->recursiveSort($decodedJson);\r\r\n $reencodedJson = \\json_encode($decodedJson);\r\r\n\r\r\n return [false, $reencodedJson];\r\r\n }", "function is_json($string)\n{\n return is_string($string) && is_array(json_decode($string, true)) && (json_last_error() == JSON_ERROR_NONE) ? true : false;\n}", "function isJson($string) {\n json_decode($string);\n return (json_last_error() == JSON_ERROR_NONE);\n }", "public function testJsonContentInvalid()\n {\n $parser = new RequestParser();\n $content = 'This is not JSON!';\n $request = new Request([], [], [], [], [], [], $content);\n $request->setRequestFormat('json');\n\n $parser->getEntityFromPost($request, 'test');\n }", "private function json_decode_nice($json)\n {\n $jsonString = $json;\n $json = str_replace(array(\"\\n\",\"\\r\"), \"\", $json); \n $json = preg_replace('/([{,]+)(\\s*)([^\"]+?)\\s*:/','$1\"$3\":', $json);\n $json = preg_replace('/(,)\\s*}$/','}', $json);\n $json = json_decode($json);\n if(json_last_error())\n throw new Exception('Not valid json : '.json_last_error_msg().'<br>'.$jsonString);\n return $json;\n }", "function isJson($string) {\n\tjson_decode($string);\n\treturn (json_last_error() == JSON_ERROR_NONE);\n}", "public function is_json();", "function isJSON($string) {\n try {\n // try to decode string\n json_decode($string);\n } catch (ErrorException $e) {\n // exception has been caught which means argument wasn't a string and thus is definitely no json.\n return FALSE;\n }\n\n // check if error occured\n return (json_last_error() == JSON_ERROR_NONE);\n }", "public static function JSONPrepare($json) {\n // Be careful with the third parameter (encoding detect list), because\n // if set wrong, some input encodings will get garbled (including UTF-8!)\n $input = mb_convert_encoding($json, 'UTF-8', 'auto');\n\n // Remove UTF-8 BOM if present, json_decode() does not like it.\n if (substr($input, 0, 3) == pack(\"CCC\", 0xEF, 0xBB, 0xBF)) {\n $input = substr($input, 0, 3);\n }\n return $input;\n }", "protected function _parse_json()\n {\n $this->_data_parsed = null;\n try {\n $parsed = json_decode($this->_data_raw);\n // switch (json_last_error()) {\n // case JSON_ERROR_DEPTH:\n // $this->_set_error_message('json', JSON_ERROR_DEPTH . ': Maximum stack depth exceeded');\n // break;\n // case JSON_ERROR_CTRL_CHAR:\n // $this->_set_error_message('json', JSON_ERROR_CTRL_CHAR . ': Unexpected control character found');\n // break;\n // case JSON_ERROR_SYNTAX:\n // $this->_set_error_message('json', JSON_ERROR_SYNTAX . ': Syntax error, malformed JSON');\n // break;\n // case JSON_ERROR_STATE_MISMATCH:\n // $this->_set_error_message('json', JSON_ERROR_STATE_MISMATCH . ': Invalid or malformed JSON');\n // break;\n // case JSON_ERROR_UTF8:\n // $this->_set_error_message('json', JSON_ERROR_UTF8 . ': Malformed UTF-8 characters, possibly incorrectly encoded');\n // break;\n // case JSON_ERROR_NONE:\n // default:\n // break;\n // }\n } catch (Exception $e) {\n $this->_set_error_message('exception', $e);\n }\n return $parsed;\n }", "function json_decode($content, $assoc = false, $depth = 512, $options = 0)\n {\n $decoded = \\json_decode($content, $assoc, $depth, $options);\n\n if (JSON_ERROR_NONE !== json_last_error()) {\n throw InvalidJsonException::create();\n }\n\n if (!$assoc && !is_object($decoded)) {\n throw new InvalidJsonException(null, 'JSON is not an object.');\n }\n\n if ($assoc && !is_array($decoded)) {\n throw new InvalidJsonException(null, 'JSON is not an object or array.');\n }\n\n return $decoded;\n }", "private function isJson($string)\n {\n json_decode($string);\n return (json_last_error() == JSON_ERROR_NONE);\n }", "function decodeCatalogJsonFile()\n{\n //Providers JSON File\n $path = storage_path() . env('HOTELS_FILE_PATH');\n\n $jsonRequest = file_get_contents($path);\n //Decoding JSON\n return json_decode($jsonRequest);\n}", "protected function decodeJson($content)\n {\n $jsonErrors = array(\n JSON_ERROR_DEPTH => 'JSON_ERROR_DEPTH - Maximum stack depth exceeded',\n JSON_ERROR_STATE_MISMATCH => 'JSON_ERROR_STATE_MISMATCH - Underflow or the modes mismatch',\n JSON_ERROR_CTRL_CHAR => 'JSON_ERROR_CTRL_CHAR - Unexpected control character found',\n JSON_ERROR_SYNTAX => 'JSON_ERROR_SYNTAX - Syntax error, malformed JSON',\n JSON_ERROR_UTF8 => 'JSON_ERROR_UTF8 - Malformed UTF-8 characters, possibly incorrectly encoded'\n );\n\n // Can we use JSON_BIGINT_AS_STRING?\n $options = 0;\n if (version_compare(PHP_VERSION, '5.4.0', '>=') && !(defined('JSON_C_VERSION') && PHP_INT_SIZE > 4)) {\n $options = JSON_BIGINT_AS_STRING;\n };\n\n $data = json_decode($content, false, 512, $options);\n if (JSON_ERROR_NONE !== json_last_error()) {\n $last = json_last_error();\n $error = 'Unknown error';\n\n if (isset($jsonErrors[$last])) {\n $error = $jsonErrors[$last];\n }\n \n $apiError = new Error(\n rand(),\n null,\n 400,\n self::INVALID_JSON_ERROR,\n 'Unable to parse JSON data',\n $error\n );\n\n throw new JsonApiException($apiError, 400);\n }\n\n return $data;\n }", "function is_json($string)\n {\n if (!is_string($string)) {\n return false;\n }\n\n json_decode($string);\n\n return json_last_error() === JSON_ERROR_NONE;\n }" ]
[ "0.648834", "0.6446261", "0.62555516", "0.6183526", "0.60899734", "0.6089908", "0.60879356", "0.60873544", "0.60873544", "0.602704", "0.6013808", "0.59430873", "0.5863468", "0.5833261", "0.5819521", "0.5815822", "0.58105105", "0.5807063", "0.5784957", "0.57657635", "0.5703658", "0.56723815", "0.56517464", "0.5646819", "0.56412214", "0.5591705", "0.55773723", "0.55676067", "0.5566106", "0.55600584" ]
0.69276303
0
Films Helpers Casts Helpers
function getCastByFilm($filmId) { $cn = getConnection(); $cn->consulta('SELECT * FROM elencos WHERE id_pelicula = :id_pelicula', array(array("id_pelicula", $filmId, 'int'))); return $cn->restantesRegistros(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function cast()\n\t{\n\t\t$cast = array();\n\t\tforeach ($this->_html->find('td.section_heading') as $category) {\n\t\t\tif (trim($category->plaintext) == \"CAST\") {\n\t\t\t\tforeach ($this->_html->find('td.GrayDialogBody') as $td) {\n\t\t\t\t\tforeach ($td->find('a') as $actor) {\n\t\t\t\t\t\tif (preg_match_all('/search_performerid/', $actor->href, $matches)) {\n\t\t\t\t\t\t\t$cast[] = trim($actor->plaintext);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t$this->_res['cast'] = array_unique($cast);\n\n\t\treturn $this->_res;\n\t}", "public function getCasts()\r\n {\r\n $casts = $this->casts;\r\n\r\n if ($this->getIncrementing()) {\r\n $casts = array_merge([$this->getKeyName() => $this->getKeyType()], $casts);\r\n }\r\n\r\n if ($this->hasFileCasts()) {\r\n foreach (array_keys($this->uploadifyFiles) as $key) {\r\n $casts = array_merge([$key => 'file'], $casts);\r\n }\r\n }\r\n\r\n if ($this->hasImageCasts()) {\r\n foreach (array_keys($this->uploadifyImages) as $key) {\r\n $casts = array_merge([$key => 'image'], $casts);\r\n }\r\n }\r\n\r\n return $casts;\r\n }", "public function getCasts()\n {\n return $this->casts;\n }", "public function getCasts()\n {\n return $this->casts;\n }", "public function getFilms(){\n\t\treturn $this->Films;\n\t}", "protected function casts()\r\n {\r\n $tempMan = new TemplateManager('model/casts.txt', ['columns' => implode(\",\", array_reverse($this->modelBuilder->casts))]);\r\n return $tempMan->get();\r\n }", "abstract protected function casts(): array;", "abstract protected function casts(): array;", "public function getCasts($movie) {\n if($movie instanceof Data\\Movie) $id = $movie->getId();\n else $id = $movie;\n\n $casts = $this->get('movie/' . $id . '/casts');\n\n if(!isset($casts['id'])) throw new Exception\\NotFoundException();\n\n // Wrap Cast\n $list = new ArrayCollection();\n foreach($casts['cast'] AS $cast) {\n $list->add( new Data\\Cast($cast) );\n }\n $casts['cast'] = $list;\n\n // Wrap Crew\n $list = new ArrayCollection();\n foreach($casts['crew'] AS $cast) {\n $list->add( new Data\\Crew($cast) );\n }\n $casts['crew'] = $list;\n\n return new Data\\Casts($casts);\n }", "public static function fixCast(&$destination, $source);", "public function getCastAndCharacterAsUrl($intLimit = 20, $bolMore = true) {\n if ($this->isReady) {\n $arrReturned = $this->matchRegex($this->_strSource, IMDB::IMDB_CAST);\n $arrChar = $this->matchRegex($this->_strSource, IMDB::IMDB_CHAR);\n if (count($arrReturned[2])) {\n foreach ($arrReturned[2] as $i => $strName) {\n if ($i >= $intLimit) break;\n $arrChar[1][$i] = trim(preg_replace('~\\((.*)\\)~Ui', '', $arrChar[1][$i]));\n preg_match_all('~<a href=\"/character/ch(\\d+)/\">(.*)</a>~Ui', $arrChar[1][$i], $arrMatches);\n if (isset($arrMatches[1][0]) && isset($arrMatches[2][0])) {\n $arrReturn[] = '<a href=\"http://www.imdb.com/name/nm' . $arrReturned[1][$i] . '/\">' . $strName . '</a> as <a href=\"http://www.imdb.com/character/ch' . $arrMatches[1][0] . '/\">' . $arrMatches[2][0] . '</a>';\n }\n else {\n if ($arrChar[1][$i]) {\n $arrReturn[] = '<a href=\"http://www.imdb.com/name/nm' . $arrReturned[1][$i] . '/\">' . $strName . '</a> as ' . strip_tags($arrChar[1][$i]);\n }\n else {\n $arrReturn[] = '<a href=\"http://www.imdb.com/name/nm' . $arrReturned[1][$i] . '/\">' . $strName . '</a>';\n }\n }\n }\n return implode(' / ', $arrReturn) . ($bolMore && (count($arrReturned[2]) > $intLimit) ? '&hellip;' : '');\n }\n return $this->strNotFound;\n }\n return $this->strNotFound;\n }", "public function getCastAndCharacter($intLimit = 20, $bolMore = true) {\n if ($this->isReady) {\n $arrReturned = $this->matchRegex($this->_strSource, IMDB::IMDB_CAST);\n $arrChar = $this->matchRegex($this->_strSource, IMDB::IMDB_CHAR);\n if (count($arrReturned[2])) {\n foreach ($arrReturned[2] as $i => $strName) {\n if ($i >= $intLimit) break;\n $arrChar[1][$i] = trim(preg_replace('~\\((.*)\\)~Ui', '', strip_tags($arrChar[1][$i])));\n if ($arrChar[1][$i]) {\n $arrReturn[] = $strName . ' as ' . $arrChar[1][$i];\n }\n else {\n $arrReturn[] = $strName;\n }\n }\n return implode(' / ', $arrReturn) . ($bolMore && (count($arrReturned[2]) > $intLimit) ? '&hellip;' : '');\n }\n return $this->strNotFound;\n }\n return $this->strNotFound;\n }", "function filmovi21Vek($films)\n {\n foreach($films as $film)\n {\n if($film->getGodina() > 2000)\n {\n $film->stampaj();\n }\n }\n }", "public function getCastAsUrl($intLimit = 20, $bolMore = true) {\n if ($this->isReady) {\n $arrReturned = $this->matchRegex($this->_strSource, IMDB::IMDB_CAST);\n if (count($arrReturned[2])) {\n foreach ($arrReturned[2] as $i => $strName) {\n if ($i >= $intLimit) break;\n $arrReturn[] = '<a href=\"http://www.imdb.com/name/nm' . $arrReturned[1][$i] . '/\">' . $strName . '</a>';\n }\n return implode(' / ', $arrReturn) . ($bolMore && (count($arrReturned[2]) > $intLimit) ? '&hellip;' : '');\n }\n return $this->strNotFound;\n }\n return $this->strNotFound;\n }", "public function testFilings()\n {\n }", "private function xpath_cast($cast_function, $path, $multiple = FALSE) {\n $objects = $this->xpath($path);\n\n if (empty($objects)) {\n return NULL;\n }\n\n if (!is_array($objects)) return $objects;\n\n if ($multiple) {\n $result = array();\n foreach ($objects as $object) {\n $result[] = $this->xpath_object_value($cast_function, $object);\n }\n return array_filter($result);\n }\n else {\n\n if (!isset($objects[0])) {\n return NULL;\n }\n\n return call_user_func($cast_function, $objects[0]);\n }\n }", "private function chargeLesFilms()\n\t\t{\n\t\t$resultat=$this->maBD->chargement('film');\n\t\t$nb=0;\n\t\twhile ($nb<sizeof($resultat))\n\t\t\t{\n\t\t\t\t$leSupport = $this->tousLesSupports->donneObjetSupportDepuisNumero($resultat[$nb][2]);\n\t\t\t\t$leGenre = $leSupport->getLeGenreDeSupport();\n\t\t\t\t$leGenre = $this->tousLesGenres->donneObjetGenreDepuisNumero($leGenre->getIdGenre());\n\t\t\t\t$this->tousLesFilms->ajouteUnFilm($resultat[$nb][0],$leSupport->getTitreSupport(),$leSupport->getRealisateurSupport(),$leSupport->getImageSupport(),$leGenre,$resultat[$nb][1]);\n\t\t\t$nb++;\n\t\t\t}\n\n\t\t}", "function cast($type);", "public function getFilms()\n {\n $registers = Register::where('vote_id', $this->voteId)->get();\n $films = Films::all();\n foreach ($registers as $register) {\n foreach ($films as $film) {\n if ($register->film_id == $film->id) {\n $result = $film->name_film;\n }\n }\n }\n\n return $result;\n }", "public function getAllFilms () {\n\t\t$allmovies = $this->orm->films()->find();\n\t\t$returnedL = [];\n\t\tforeach ( $allmovies as $movie ) {\n\t\t $returnedL[] = $this->hydrateMovie( new Film, $movie );\t\n\t\t}\n\n\t\treturn $returnedL;\n\t}", "abstract protected function cast($value);", "public function Medias() {\n\t\treturn new ArrayList(array_filter([$this->Audio()]));\n\t}", "public function films() {\n $films = $this->Films\n ->find('all', ['contain' => ['Actors']])\n ->where(['film_id IN' => [1,2,3]]);\n \n // dd($films->all());\n \n foreach($films as $film) {\n echo \"<b> {$film->title} </b> <br>\";\n foreach ($film->actors as $actor) {\n echo $actor->first_name . '<br>';\n }\n echo '<hr>';\n }\n\n die('');\n }", "public function getCastedValue();", "public function showCast($cast) {\n $actings = Acting::where('cast_id', '=', $cast->id)->get();\n $moviesNum = $actings->count();\n\n //retun cast show view with details\n return view('cast.show',[\n 'cast'=>$cast,\n 'actings'=>$actings,\n 'moviesNum' => $moviesNum,\n ]);\n }", "public function stream_cast();", "public function stream_cast($cast_as) {\n // @todo figure out if we really need to do something with this\n // This method is not implemented\n trigger_error('stream_cast() is not implemented in the stream wrappers plugin as of version 1.0.0.', E_USER_NOTICE);\n }", "public function stream_cast($cast_as)\n\t{\n\t\treturn $this->stream->cast($cast_as);\n\t}", "function cast_spell(&$objSrcUser, &$objTrgUser, $arrSpell, $amount, $minHours, $dmg)\n{\n $arrTrgStats = $objTrgUser->get_stats();\n $iDuration = max(0, $objTrgUser->get_spell(PEST));\n $iDuration2 = max(0, $objTrgUser->get_spell(VIRUS));\n\n $plural = 's';\n $plural2 = 's';\n if ($iDuration == 1) $plural = '';\n if ($iDuration2 == 1) $plural2 = '';\n\n $result[\"text_news\"] = \"An allied mage has <span class=positive>healed</span> our population from pestilence and engineered virus.\";\n $result[\"casted\"] = $amount;\n $result[\"damage\"] = $iDuration + $iDuration2;\n $result[\"text_screen\"] = \"We healed our alli \" . stripslashes($arrTrgStats[TRIBE]) . \" from <strong class=positive>$iDuration month$plural</strong> of Pestilence and <strong class=positive>$iDuration2 month$plural2</strong> of Engineered Virus.\";\n // Heal may target your own tribe, customized msg February 13, 2008 Martel\n if ($objTrgUser->get_userid() == $objSrcUser->get_userid())\n {\n $result[\"text_screen\"] = \"We healed ourselves from <strong class=positive>$iDuration month$plural</strong> of Pestilence and <strong class=positive>$iDuration2 month$plural2</strong> of Engineered Virus.\";\n $result[\"text_news\"] = '';\n $result[\"damage\"] = 0;\n }\n\n $objTrgUser->set_spells(array(PEST => 0, VIRUS => 0));\n\n return $result;\n}", "function getFilms() {\n $cn = getConnection();\n $cn->consulta('SELECT * FROM peliculas ORDER BY fecha_lanzamiento desc');\n return $cn->restantesRegistros();\n}" ]
[ "0.5843723", "0.5599072", "0.5487537", "0.5487537", "0.5455184", "0.536525", "0.5191795", "0.5191795", "0.5181259", "0.51196784", "0.5110699", "0.50827795", "0.5082676", "0.5067985", "0.50116324", "0.49852943", "0.4939312", "0.49306217", "0.49254575", "0.49126303", "0.48702425", "0.4834609", "0.47955662", "0.47880197", "0.47770658", "0.47616294", "0.47465572", "0.47162205", "0.4713455", "0.47024354" ]
0.5807226
1
Match a route pattern with optional wildcards (e.g users/string:name) to a string, returning an array of the matches (including the whole string) Array will be empty if no matches are found.
private function match(string $uri, string $pattern) : array { $namedMatches = ['uri_string']; // wildcards if(strpos($pattern, ':') !== false) { $output = []; $array = explode('/', $pattern); foreach($array as $segment) { if(strpos($segment, ':') !== false) { $match = explode(':', $segment); switch($match[0]) { case 'alpha': $output[] = '([a-zA-Z]+)'; break; case 'number': $output[] = '([0-9]+)'; break; case 'string': $output[] = '([a-zA-Z0-9-_]+)'; break; default: return []; // illegal wildcard } $namedMatches[] = $match[1]; } else { $output[] = $segment; } } $regex = $this->bookend(implode('/', $output)); } else { // no wildcards $regex = $this->bookend($pattern); } $match = preg_match($regex, $uri, $matches); if($match === 1) { return $this->applyKeys($namedMatches, $matches); } return []; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function match($pattern){\n\t\t$params = array();\n\t\t$shiftCount = 0;\n\t\t\n\t\t//User Defined Paths -\n\t\tif($pattern){\n\t\t\t$patternParts = explode('/', $pattern);\n\t\t\t$shiftCount = count($patternParts);\n\t\t\n\t\t\tforeach($patternParts as $i => $part) {\n\t\t\t\t$part = trim($part);\n\t\t\t\t\n\t\t\t\t// Match a variable\n\t\t\t\tif(isset($part[0]) && ($part[0] == '$' || $part[0] == '*')){\n\t\t\t\t\t$lastChar = substr($part,-1);\n\t\t\t\t\tif($lastChar == '!'){\n\t\t\t\t\t\t\n\t\t\t\t\t\t//This segment is required, if it doesn't returning false will throw a 404\n\t\t\t\t\t\tif(!isset($this->urlSegments[$i])) return false;\n\t\t\t\t\t\t$params[substr($part,1,-1)] = $this->urlSegments[$i];\n\t\t\t\t\t\t\n\t\t\t\t\t} else if($lastChar == \"*\"){\n\t\t\t\t\t\tif((strlen($part) > 1 && $part[0] != '$')) return false;\n\t\t\t\t\t\n\t\t\t\t\t\t$params[substr($part,1,-1) ?: \"*\"] = implode(\"/\", $remainingSegments = $this->urlSegments($i));\n\t\t\t\t\t\tif(isset($remainingSegments)) $this->unshiftedButParsedParts = count($remainingSegments);\n\t\t\t\t\t\t\n\t\t\t\t\t} else if($part[0] == '$'){\n\t\t\t\t\t\t$params[substr($part,1)] = $this->urlSegment($i);\n\t\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// Match a specific segment\n\t\t\t\t} else {\n\t\t\t\t\t\n\t\t\t\t\t//If the segment doesn't match, this is not the urlHandler to intercept.\n\t\t\t\t\tif($this->urlSegment($i) !== $part){\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t$this->_urlParams = $params;\n\t\t} \n\t\t\n\t\t$this->shift($shiftCount);\n\t\t// We keep track of pattern parts that we looked at but didn't shift off.\n\t\t// This lets us say that we have *parsed* the whole URL even when we haven't *shifted* it all\n\t\t$this->unshiftedButParsedParts = max($this->unshiftedButParsedParts, 0);\n\t\t\n\t\t// Load the arguments that actually have a value into $this->allParams\n\t\t// This ensures that previous values aren't overridden with blanks\n\t\tforeach($params as $k => $v) {\n\t\t\tif($v || !isset($this->allParams[$k])) $this->allParams[$k] = $v;\n\t\t}\n\t\t\n\t\treturn $params;\n\t}", "abstract protected function getRoutePattern();", "public function getAll(?string $pattern = null): array;", "public function match($request)\n {\n foreach($this->_routes as $route)\n {\n if(!preg_match($route->getRoute(),$request->getPath(),$match))\n {\n continue;\n }\n return $match;\n }\n return array();\n }", "protected function _match($url)\n {\n if (!$this->_createdRegs && !empty($this->controllerScan)) {\n $this->createRegs();\n } elseif (!$this->_createdRegs) {\n $msg = 'You must generate the regular expressions before matching.';\n throw new Horde_Routes_Exception($msg);\n }\n\n if ($this->alwaysScan) {\n $this->createRegs();\n }\n\n $matchLog = array();\n if (!empty($this->prefix)) {\n if (preg_match('@' . $this->_regPrefix . '@', $url)) {\n $url = preg_replace('@' . $this->_regPrefix . '@', '$1', $url);\n if (empty($url)) {\n $url = '/';\n }\n } else {\n return array(null, null, $matchLog);\n }\n }\n\n foreach ($this->matchList as $route) {\n if ($route->static) {\n if ($this->debug) {\n $matchLog[] = array('route' => $route, 'static' => true);\n }\n continue;\n }\n\n $match = $route->match($url, array('environ' => $this->environ,\n 'subDomains' => $this->subDomains,\n 'subDomainsIgnore' => $this->subDomainsIgnore,\n 'domainMatch' => $this->domainMatch));\n if ($this->debug) {\n $matchLog[] = array('route' => $route, 'regexp' => (bool)$match);\n }\n if ($match) {\n return array($match, $route, $matchLog);\n }\n }\n\n return array(null, null, $matchLog);\n }", "public function routeMatches($pattern, $path)\n {\n $matches = true;\n $args = array();\n\n if (!$this->strict_url_mode) {\n $last_pattern_char = substr($pattern, -1, 1);\n if (strlen($path) > 1 && substr($path, -1, 1) === '/' && $last_pattern_char !== '/') {\n $path = substr($path, 0, -1);\n }\n }\n\n if ($pattern !== $path) {\n $url_parts = explode('/', $path);\n $pattern_parts = explode('/', $pattern);\n $m = count($url_parts);\n\n if ($m !== count($pattern_parts)) {\n $matches = false;\n } else {\n for ($n = 0; $n < $m; $n++) {\n if (urldecode($url_parts[$n]) !== $pattern_parts[$n]) {\n if (strlen($pattern_parts[$n]) > 1 && substr($pattern_parts[$n], 0, 1) === ':') {\n $args[substr($pattern_parts[$n], 1)] = urldecode($url_parts[$n]);\n } else {\n $matches = false;\n break;\n }\n }\n }\n }\n }\n\n return ($matches ? $args : false);\n }", "public function match($path) {\n if ($path === $this->path) return TRUE;\n \n list ($path, $query)= $this->splitParams($path);\n \n if (preg_match('#^'.$this->pattern.'$#', $path, $matches)) {\n array_shift($matches);\n \n $params= array();\n foreach ($this->names as $i => $name) {\n $params[$name]= rawurldecode($matches[$i]);\n }\n \n foreach ($this->query as $name => $param) {\n if (isset($query[$name])) $params[$param]= $query[$name];\n }\n \n return $params;\n }\n \n return FALSE;\n }", "private function extractParameters($pattern) {\n\t\t$orig_pattern = $pattern;\n\t\t// prepare pattern for testing! router pattern to array\n\t\t$pattern = $this->preparePattern($pattern);\n\n\t\t// Check for parameters in pattern to match via pattern and passed uri\n\t\t$results = array();\n\t\t$uri_len = count($this->uri);\n\t\t\n\t\tfor($i = 0; $i < $uri_len; $i++) {\n\n\t\t\tif(substr($pattern[$i], 0, 1) == ':')\n\t\t\t\t$results[] = $this->uri[$i];\n\t\t\t\n\t\t\t// an optional parameter was passed that was not included, pass null\n\t\t\tif($i == ($uri_len - 1) && $this->optParam($orig_pattern))\n\t\t\t\t$results[] = null;\n\t\t}\n\n\t\treturn $results;\n\t}", "public function extractWildcardNames($route)\n {\n preg_match_all('/{\\s*([a-zA-Z0-9_\\-]+)\\s*}/', $route, $matches);\n\n return $matches[1];\n }", "public function getParameters(string $pattern): array;", "public static function matchRoute($url)\n {\n $route = [];\n foreach (self::$routes as $pattern => $route) {\n if (preg_match(\"#$pattern#\", $url, $matches)) {\n foreach ($matches as $k => $v) {\n if (is_string($k) && !(isset($route[$k]))) {\n $route[$k] = $v;\n }\n }\n if (!isset($route['controller'])) {\n $route['controller'] = 'home';\n }\n if (!isset($route['action'])) {\n $route['action'] = 'index';\n }\n break;\n }\n }\n return $route;\n }", "public function testMatchWithWildcard()\n {\n $this->router->map('GET', '/a', 'foo_action', 'foo_route');\n $this->router->map('GET', '*', 'bar_action', 'bar_route');\n $this->assertEquals(\n array(\n 'target' => 'bar_action',\n 'params' => array(),\n 'name' => 'bar_route'\n ),\n $this->router->match('/everything', 'GET')\n );\n\n }", "public function routematch($url)\n {\n $result = $this->_match($url);\n\n if ($this->debug) {\n return array($result[0], $result[1], $result[2]);\n }\n\n return ($result[0]) ? array($result[0], $result[1]) : null;\n }", "private function parsePlaceholders($route) {\n if (!preg_match_all(\n '~' . self::VARIABLE_REGEX . '~x', $route, $matches,\n PREG_OFFSET_CAPTURE | PREG_SET_ORDER\n )) {\n return [$route];\n }\n\n $offset = 0;\n $routeData = [];\n foreach ($matches as $set) {\n if ($set[0][1] > $offset) {\n $routeData[] = substr($route, $offset, $set[0][1] - $offset);\n }\n $routeData[] = [\n $set[1][0],\n isset($set[2]) ? trim($set[2][0]) : self::DEFAULT_DISPATCH_REGEX\n ];\n $offset = $set[0][1] + strlen($set[0][0]);\n }\n\n if ($offset != strlen($route)) {\n $routeData[] = substr($route, $offset);\n }\n\n return $routeData;\n }", "private function parsePatternOptionalParameters(string $parameters): array\n {\n return array_filter(explode('/', trim($parameters, '[]')));\n }", "private function matchRoutes($pattern){\n\t\t$splitPattern = split(\"/\", $pattern);\n\n\t\t//Quick check to see if number of parameters match\n\t\tif(count($splitPattern) !== count($this->route['parsed'])){\n\t\t\treturn FALSE;\n\t\t}\n\n\t\t$routeParams = [];\n\t\tforeach($splitPattern as $key=>$param){\n\t\t\tif(strpos($param, \":\") !== FALSE){\n\t\t\t\t$routeParams[ltrim($param, \":\")] = $this->route['parsed'][$key];\n\t\t\t}\n\t\t\telse{\n\t\t\t\tif($this->route['parsed'][$key] !== $param){\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t$this->route['params'] = $routeParams;\n\t\treturn TRUE;\n\t}", "public static function match($route, array &$params = array()) {\n self::reload();\n\n $base = '/' . implode('/', self::$_values) . '/';\n // Optional first\n $match = preg_replace('/\\\\\\[:]\\\\\\[:](\\w+)/', '(?<\\1>[^\\/]+)?', preg_quote($route, '/'));\n // Required\n $match = preg_replace('/\\\\\\[:](\\w+)/', '(?<\\1>[^\\/]+)', $match);\n $count = preg_match(\"/^$match/\", $base, $params);\n\n // Remove extra fields\n foreach ($params as $key => $value) {\n if (ctype_digit((string) $key)) {\n unset($params[$key]);\n }\n }\n return $count === 1;\n }", "public function discoverRouteMappings(): array;", "public function extractParametersFromPath(string $pattern, string $urlPath): array;", "public function getRouteArguments($pattern, $request)\n\t{\n\t\t/**\n\t\t * Obtener todos los argumentos incluidos en el patrón de la ruta. Estos irán entre\n\t\t * corchetes {arg}. Obtendremos un array en el cual el primero elemento contendrá el\n\t\t * resultado de la regex y en segundo su posición dentro del string.\n\t\t */\n\t\tpreg_match_all('#\\{\\w+\\}#', $pattern, $matches, PREG_OFFSET_CAPTURE | PREG_SET_ORDER);\n\n\t\t$arguments = array();\n\n\t\t$varRegex = '';\n\n\t\t// recortar para obtener la parte estática\n\t\tforeach ($matches as $match) {\n\t\t\t// Nombre de la variable obtenida del pattern\n\t\t\t$varName = substr($match[0][0], 1, -1);\t\n\t\t\t$varRegex .= \"\\/(?P<$varName>[^/]+)?\";\n\t\t}\n\t\t// La parte estática desde el inicio hasta el inicio del primer parámetro, sin el slash final\n\t\t$pos = strlen($pattern);\n\t\t// Si no hay ningúna coincidencia puede ser que se esté intentando acceder al root /. En caso de que esté intentando acceder a root la parte estática de la ruta es desde el inicio hasta el final del string, en caso de que si existan coincidencias desde el inicio al primero.\n\t\tif (!empty($matches)) {\n\t\t\t$pos = $matches[0][0][1] - 1;\n\t\t}\n\t\t$staticPath = substr($pattern, 0, $pos);\n\t\t\n\t\t// Generar expresión regular\n\t\t$regex = \"~^\" . $staticPath . $varRegex . \"~\";\n\n\t\t// Obtener los argumentos de la expresión regular\n\t\tpreg_match($regex, $request, $arguments);\n\n\t\treturn $arguments;\n\t}", "public static function getMatchRoutes () {\n self::parse(); \n $matches = array();\n $routes = self::getDbRoutes();\n \n foreach ($routes as $pattern => $call) { \n if (preg_match($pattern, self::$pathInfo['path'] , $matches)) {\n return $call;\n } \n }\n return false;\n }", "private function urlMatchesRoute(&$route) {\n if ($route['method'] != strtolower($this->req->method) && $route['method'] != 'all') {\n return false; }\n if ($route['url'] == '*' || $route['url'] == $this->req->url->path) {\n return true; }\n if ($route['url'] == '/' && $this->req->url->path != $route['url']) {\n return false; } /* Dirty hack for '/' */\n \n $result = array();\n preg_match_all($route['regex'], $this->req->url->path, $result, PREG_PATTERN_ORDER);\n \n if (count($result[0]) > 0) {\n return true; }\n return false;\n }", "function Router_parseURI($routes, $requestedURI, $root = '') {\n\n\tforeach ($routes as $route => $action) {\n\n\t\t$route = rtrim($root . $route, '/');\n\n\t\t// check array branch\n\t\tif (is_array($action)) {\n\t\t\t$params = Router_parseURI($action, $requestedURI, $route);\n\t\t\tif (!empty($params)) {\n\t\t\t\treturn $params;\n\t\t\t}\n\t\t\tcontinue;\n\t\t} \n\n\t\t// transorm router into a regular expression\n\t\tif (strpos($route, '{') !== false) {\n\n\t\t\t/* two preg_replace can be used instead callback function */\n\t\t\t// $route = preg_replace('#{([^:}]+)}#', '{$1:.+}', $route);\n\t\t\t// $route = preg_replace('#{(\\w+):([^}]+)}#', '(?<$1>$2)', $route);\n\n\t\t\t$route = preg_replace_callback('#{(\\w+):?([^}]+)?}#', function($matches) {\n\t\t\t\t\t$mask = (isset($matches[2])?$matches[2]:'.+'); // set default mask\n\t\t\t\t\treturn \"(?<$matches[1]>$mask)\";\n\t\t\t\t}, $route\n\t\t\t);\n\t\t}\n\n\t\t// matching\n\t\tif (preg_match('#^'.$route.'$#', $requestedURI)) {\n\t\t\t\n\t\t\t// get params from url-string\n\t\t\t$params = [];\n\t\t\tif (strpos($route, '(') !== false) {\n\n\t\t\t\tpreg_match_all('#^'.$route.'$#', $requestedURI, $matches, PREG_SET_ORDER);\n\n\t\t\t\tforeach ($matches[0] as $key => $value) {\n\t\t\t\t\tif (!is_numeric($key)) {\n\t\t\t\t\t\t$params[$key] = $value;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// get controller and function\n\t\t\t$pos = strrpos($action, '/');\n\t\t\t$file = substr($action, 0, $pos);\n\t\t\t$fun = substr($action, $pos + 1);\n\n\t\t\treturn [\n\t\t\t\t'file' => $file,\n\t\t\t\t'function' => $fun,\n\t\t\t\t'params' => $params,\n\t\t\t];\n\t\t}\n\t}\n\n\treturn false;\n}", "public function match($path) {\n $this->_matches = array();\n\n $nodeStack = array();\n\n if($path == '/') {\n if($wildcard = $this->_root->getChild('*')) array_push($this->_matches, '/*/');\n } else {\n $this->visit($this->_root, $nodeStack, $path);\n }\n\n return $this->_matches;\n }", "public function getMatchRoute($routes = [], $uri = '');", "public static function matchAll($pattern, $subject, $offset = 0)\n {\n $matches = [];\n $subject = substr($subject, $offset);\n preg_match_all($pattern, $subject, $matches, PREG_PATTERN_ORDER);\n\n $fullMatches = reset($matches);\n if (empty($fullMatches)) {\n return;\n }\n\n if (count($fullMatches) === 1) {\n foreach ($matches as &$match) {\n $match = reset($match);\n }\n }\n\n if (!empty($matches)) {\n return $matches;\n }\n }", "public function match($url)\n {\n /* First, try to match static route\n * which is not in fail list\n */\n $route_name = array_search($url, $this->_urls);\n\n if (($route_name !== false)\n && (array_key_exists($route_name, $this->_static))) {\n return $this->match_failed(array($route_name,\n $this->_actions[$route_name], null));\n }\n unset($route_name);\n\n $url_parts = explode('/', $url);\n $url_parts_len = count($url_parts);\n\n $matched_routes = $this->_dynamic;\n $matched_wildcard = null;\n\n /* Find potential candidate(s), always preferring routes with\n * static parts e.g. for routes\n * ':category/:article' and 'news/:article'\n * and url\n * 'news/something'\n * we can safely discard the first route, otherwise we would have to\n * specify requirement for the first: 'category' => '(?!(news)).*'\n */\n foreach ($url_parts as $offset => $part) {\n $dynamic_part_routes = array();\n $static_part_routes = array();\n\n foreach ($matched_routes as $matched_name => $matched_parts) {\n if (count($matched_parts) <= $offset) {\n // route too short\n continue;\n }\n\n if (($matched_parts[$offset][0] != ':') && ($matched_parts[$offset] == $part)) {\n $static_part_routes[$matched_name] = $matched_parts;\n } elseif ($matched_parts[$offset][0] == ':') {\n $dynamic_part_routes[$matched_name] = $matched_parts;\n } elseif ($matched_parts[$offset][0] == '*') {\n // xxx: What if both, route and url contain * at same place?\n $wild_args = $this->extract_args($matched_parts, $url_parts);\n\n if ($this->check_reqs($matched_name, $wild_args)) {\n if (!$matched_wildcard) {\n $matched_wildcard = $this->match_failed(array($matched_name,\n $this->_actions[$matched_name], $wild_args));\n } else {\n throw new ERouteMapNoReqs();\n }\n } else {\n /* Some parts of wildcard route didn't match,\n it will be discarded. */\n continue;\n }\n }\n }\n\n if (!empty($static_part_routes)) {\n $matched_routes = $static_part_routes;\n } else {\n $matched_routes = $dynamic_part_routes;\n }\n }\n\n if (count($matched_routes) == 0) {\n if (!$matched_wildcard) {\n throw new ERouteMapNoMatch();\n } else {\n return $matched_wildcard;\n }\n } elseif (count($matched_routes) == 1) {\n /* Anyone knows how to extract key->value pair from a dictionary\n * with length=1 where we don't know the key?\n */\n foreach ($matched_routes as $name => $route_parts) {\n $route_name = $name;\n $route_args = $this->extract_args($route_parts, $url_parts);\n }\n \n if (count($this->_dynamic[$route_name]) != $url_parts_len) {\n if (!$matched_wildcard) {\n // false match, actual route is longer\n throw new ERouteMapNoMatch();\n } else {\n return $matched_wildcard;\n }\n }\n\n if ($this->check_reqs($route_name, $route_args)) {\n return $this->match_failed(array($route_name,\n $this->_actions[$route_name], $route_args));\n } else {\n if (!$matched_wildcard) {\n throw new ERouteMapReqs();\n } else {\n return $matched_wildcard;\n }\n }\n } elseif (count($matched_routes) > 1) {\n // filter out false matches\n $real_matched = array();\n\n foreach ($matched_routes as $n_name => $n_parts) {\n if (count($n_parts) == $url_parts_len) {\n $real_matched[$n_name] = $n_parts;\n }\n }\n\n if (empty($real_matched)) {\n if (!$matched_wildcard) {\n throw new ERouteMapNoMatch();\n } else {\n return $matched_wildcard;\n }\n }\n\n /* OK, we have N routes with same signature\n * At least N-1 routes *must* specify requirements. We try to match\n * dynamic route with requirements. If requirements are not\n * satisfied we select route without requirements (if such route\n * exists). Otherwise we fail.\n */\n\n $no_req_seen = false; // have we seen route without arguments?\n $no_req_name = null;\n $no_req_parts = null;\n\n foreach ($real_matched as $n_name => $n_parts) {\n if (empty($this->_reqs[$n_name])) {\n if ($no_req_seen) {\n if (!$matched_wildcard) {\n throw new ERouteMapNoReqs();\n } else {\n return $matched_wildcard;\n }\n } else {\n $no_req_seen = true;\n $no_req_name = $n_name;\n $no_req_parts = $n_parts;\n }\n } else {\n $n_args = $this->extract_args($n_parts, $url_parts);\n\n if ($this->check_reqs($n_name, $n_args)) {\n // We have a winner, return immediately\n return $this->match_failed(array($n_name,\n $this->_actions[$n_name], $n_args));\n }\n }\n }\n\n /**\n * OK, at this point we either have \"safe\" route, without\n * requirements, or none of the duplicates fulfills requirements.\n */\n if ($no_req_seen) {\n $no_req_args = $this->extract_args($no_req_parts, $url_parts);\n\n return $this->match_failed(array($no_req_name,\n $this->_actions[$no_req_name], $no_req_args));\n } else {\n if (!$matched_wildcard) {\n throw new ERouteMapReqs();\n } else {\n return $matched_wildcard;\n }\n }\n }\n }", "public function match(string $event): array\n {\n $matches = [];\n\n //do the obvious match\n if (isset($this->observers[$event])) {\n $matches[$event] = array(\n 'event' => $event,\n 'pattern' => $event,\n 'variables' => []\n );\n }\n\n //deal with regexp\n foreach ($this->regex as $pattern) {\n //if it matches\n if (preg_match_all($pattern, $event, $match)) {\n $variables = [];\n\n if (is_array($match) && !empty($match)) {\n //flatten\n $variables = call_user_func_array('array_merge', $match);\n array_shift($variables);\n }\n\n $matches[$pattern] = array(\n 'event' => $event,\n 'pattern' => $pattern,\n 'variables' => $variables\n );\n }\n }\n\n return array_values($matches);\n }", "static public function find_match($str,$exact = false)\n {\n $res = null;\n if( !is_array(self::$_routes) )\n {\n\treturn $res;\n }\n \n foreach( self::$_routes as $route )\n {\n\tif( $route->matches($str,$exact) )\n\t {\n\t return $route;\n\t }\n }\n\n return $res;\n }", "public function match()\n {\n foreach (func_get_args() as $pattern) {\n if (str_match($this->decodedPath(), $pattern)) {\n return true;\n }\n }\n\n return false;\n }" ]
[ "0.6107232", "0.5956875", "0.59541446", "0.58897114", "0.5779823", "0.5762585", "0.5747048", "0.57119626", "0.57061124", "0.5673543", "0.56292707", "0.56164587", "0.56038773", "0.5593444", "0.553632", "0.5527044", "0.5525241", "0.54894316", "0.54770356", "0.5473212", "0.5453578", "0.54023236", "0.5390493", "0.53682715", "0.53535974", "0.5330349", "0.5307475", "0.5303263", "0.5297194", "0.52868503" ]
0.6811269
0
Use the values in one linear array as keys on a target array
private function applyKeys(array $keys, array $target) : array { if($this->isAssociative($keys) || $this->isAssociative($target)) { return []; } $result = []; for($i = 0; $i < count($target); $i++) { $result[$keys[$i]] = $target[$i]; } return $result; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function array_combine (array $keys, array $values) {}", "function ImposeArray($target_array, $stamp_array)\n\t{\n\t\tforeach ($stamp_array as $k1=>$v1)\n\t\t{\n\t\t\tif (!isset($target_array[$k1])) $target_array[$k1] = $v1;\n\t\t\telse\n\t\t\t{\n\t\t\t\tforeach ($v1 as $k2=>$v2) $target_array[$k1][$k2] = $v2;\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn $target_array;\n\t}", "function linear_merge(array $x, array $y) {\n\n}", "function array_fill_keys (array $keys, $value) {}", "function array_intersect_key (array $array1, array $array2, array $_ = null) {}", "function array_merge_maintain_keys() {\n\t$args = func_get_args();\n\t$result = array();\n\tforeach ( $args as &$array ) {\n\t\tforeach ( $array as $key => &$value ) {\n\t\t\t$result[$key] = $value;\n\t\t}\n\t}\n\treturn $result;\n}", "function key (array &$array) {}", "function arrayKeysAndValues() {\r\n}", "function arrayPrefixKeys($prefix, array $arr)\n{\n $keys = arrayPrefix($prefix, array_keys($arr));\n return array_combine($keys, array_values($arr));\n\n}", "public function getTargetKeys();", "function array2d_rekey($arr, $new_key, $val_key_key, $val_key) {\n\n\tif(is_array($arr) && count($arr) > 0) {\n\n//get the y-values for each series\n//return only one record of each value of 'title'\n//make a 2d array, with each value of 'title' as the \n//1d key, and a blank array as 2D key\n\t\t$return_value = array();\n\t\t$return_value = array2d_unique2d2($arr, $new_key);\n\t\n//now loop through the input array, grabbing each record, and assigning it \n//as a sub-array to the list of unique titles\n\t\tforeach($arr as $point_array) {\n\t\t\tforeach($return_value as $key => $value) {\n\t\t\t\tif($key == $point_array[$new_key]) {\n\t\t\t\t\t$return_value[$key][$point_array[$val_key_key]] = $point_array[$val_key];\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\n\t\treturn $return_value;\n\t\t}\n\t\n\tdebug_text_print(\"passed value not an array for array2d_sort()\");\n\treturn 0;\n\t}", "public static function keyFromData($array, $key_index = 0, $val_index = false)\n\t{\n\t\t$new_array = array();\n\n\t\tif (!$val_index) {\n\t\t\tforeach ($array as $sub_array) {\n\t\t\t\t$new_array[$sub_array[$key_index]] = $sub_array;\n\t\t\t}\n\t\t} else {\n\t\t\tforeach ($array as $sub_array) {\n\t\t\t\t$new_array[$sub_array[$key_index]] = $sub_array[$val_index];\n\t\t\t}\n\t\t}\n\n\t\treturn $new_array;\n\t}", "public function testAssignKeyB() {\n\t\t// Define standard array\n\t\t$array = array(\n array(\n 'color' => 'blue'\n , 'fruit' => 'blueberry'\n )\n , array(\n 'color' => 'orange'\n , 'fruit' => 'orange'\n )\n , array(\n 'color' => 'green'\n , 'fruit' => 'apple'\n )\n );\n\n // Assign the key to the array Remove the key from the original\n $new_array = ar::assign_key( $array, 'color', true );\n\n // Create the array it should look like\n $proper_array = array(\n 'blue' => 'blueberry'\n , 'orange' => 'orange'\n , 'green' => 'apple'\n );\n\n // Make sure they're equal\n $this->assertEquals( $new_array, $proper_array );\n\t}", "public static function arrayReplaceKey($search, $replace, array &$target)\n {\n $tempArray = array();\n foreach ($target as $key => $val) {\n if ($search === $key && array_key_exists($replace, $target) === false) {\n $tempArray[$replace] = $val;\n } else {\n $tempArray[$key] = $val;\n }\n }\n $target = $tempArray;\n }", "final protected function internalMerge($source, $target)\n {\n foreach ($target as $key => $value) {\n if (gettype($value) === \"array\" && isset($source[$key]) && gettype($source[$key] === \"array\")) {\n $source[$key] = $this->internalMerge($source[$key], $value);\n } elseif (gettype($key) === \"int\") {\n $source[] = $value;\n } else {\n $source[$key] = $value;\n }\n }\n\n return $source;\n }", "function twoSum2($nums, $target) {\n $hashTable = [];\n foreach($nums as $index => $each) {\n $y = $target - $each;\n if (isset($hashTable[$y]) && $index != $hashTable[$y]) {\n return [$index, $hashTable[$y]];\n }\n $hashTable[$each] = $index;\n }\n return [];\n }", "function array4key($array,$id,$val = FALSE){\n\t\t$tmp = array();\n\t\tforeach($array as $key=>$value){\n\t\t $k = $id ? $value[$id] : $key;\n\t\t\tif($val === TRUE){\n\t\t\t\t$tmp[$k][] = $value;\n\t\t\t}\n\t\t\telse {\n\t\t\t\tif($val && isset($value[$val])){\n\t\t\t\t\t$tmp[$k] = $value[$val];\n\t\t\t\t\t \n\t\t\t\t}\n\t\t\t\telseif(!$val) {\n\t\t\t\t\t$tmp[$k] = $value;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn $array = $tmp;\n\t}", "static function uniform($mat,$keys=NULL,$def=NULL){\n if(is_null($keys)) $keys = ops_matrix::keys($mat,FALSE);\n $res = array();\n foreach($mat as $key=>$val){\n $cl = array();\n foreach($keys as$ck){\n\tif(isset($val[$ck])) $cl[$ck] = $val[$ck];\n\telse if(is_array($def)) $cl[$ck] = isset($def[$ck])?$def[$ck]:NULL;\n\telse $cl[$ck] = $def;\n }\n $res[$key] = $cl;\n }\n return($res);\n }", "function array_copy($source, $keys, $all=false) {\n if(is_object($source)) $source = (array) $source;\n $dest = $all ? $source : array();\n if(isAssoc($keys)) { // assoc. array, we're mapping\n foreach($keys as $k => $v) {\n if(isint($k)) $dest[$v] = $source[$v];\n else $dest[$v] = $source[$k];\n }\n } else { // plain array\n if($all) return $dest; // we're done, just return a copy\n $dest = is_array($keys) ? array_intersect_key($source, array_flip($keys)) : $source;\n }\n return $dest;\n}", "protected function diverse_array($vector) { \n\t\t$result = array(); \n\t\t\tforeach($vector as $key1 => $value1) \n\t\t\t\tforeach($value1 as $key2 => $value2) \n\t\t\t\t\t$result[$key2][$key1] = $value2; \n\t\t\treturn $result; \n\t}", "static public function arrayUpdate(&$base, $source) {\n foreach ($source as $k => $v) {\n if (is_array($v) && isset($base[$k]) && is_array(($base[$k]))) {\n self::arrayUpdate($base[$k], $v);\n } else {\n $base[$k] = $v;\n }\n }\n }", "function twoSum($nums, $target) {\n $hashTable = [];\n foreach($nums as $index => $each) {\n if (isset($hashTable[$each])) {\n $hashTable[$each][count($hashTable[$each])]= $index;\n } else {\n $hashTable[$each][0] = $index;\n }\n }\n\n foreach($nums as $each) {\n $y = $target - $each;\n if (isset($hashTable[$y])) {\n if ($y == $each && count($hashTable[$y]) == 1) {\n continue;\n }\n return [current($hashTable[$each]), end($hashTable[$y])];\n }\n }\n return [];\n }", "function array_flat($array, $toKey = false, mixed $toValue = false, $unique = false) {\n\n\tif (!is_array($array)) {\n\t\treturn false;\n\t}\n\n\t$result = [];\n\n\tforeach ($array as $key => $value) {\n\n\t\t// choose value\n\t\tswitch (true) {\n\t\t\t// if list of keys\n\t\t\tcase is_array($toValue):\n\t\t\t\t$newValue = array_intersect_key($value, array_flip(array_values($toValue)));\n\t\t\t\tbreak;\n\t\t\t// if false\n\t\t\tdefault:\n\t\t\tcase $toValue === false:\n\t\t\t\t$newValue = $value; // as was\n\t\t\t\tbreak;\n\t\t\t// if true\n\t\t\tcase $toValue === true:\n\t\t\t\t$newValue = $key; // as key\n\t\t\t\tbreak;\n\t\t\t// if dot delimited string keys\n\t\t\tcase is_scalar($toValue) && strpos($toValue, '.'):\n\t\t\t\t$newValue = $value;\n\t\t\t\tforeach (explode('.', $toValue) as $toValueKey) {\n\t\t\t\t\t$newValue = $newValue[$toValueKey];\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t// if scalar\n\t\t\tcase is_scalar($toValue):\n\t\t\t\t$newValue = $value[$toValue];\n\t\t}\n\n\t\t// choose key\n\t\tswitch (true) {\n\t\t\t// if we just simplifiying some kind of php array to list\n\t\t\tcase $toKey === false:\n\t\t\t\t$result[] = $newValue;\n\t\t\t\tcontinue 2;\n\t\t\t// default\n\t\t\tdefault:\n\t\t\tcase $toKey === true:\n\t\t\tcase is_scalar($value):\n\t\t\t\t$newKey = $key;\n\t\t\t\tbreak;\n\t\t\t// some field of value will be used as key in new map\n\t\t\tcase is_array($value) && array_key_exists($toKey, $value):\n\t\t\t\t$newKey = $value[$toKey];\n\t\t}\n\n\t\t// push key-value pair to result\n\t\t$result[$newKey] = $newValue;\n\t}\n\n\t$unique && $result = array_flip(array_flip($result));\n\n\treturn $result;\n}", "static public function wrapKeys($array, $prefix, $suffix)\n {\n $result = array();\n foreach ($array as $key => $value)\n {\n $result[$prefix . $key . $suffix] = $value;\n }\n return $result;\n }", "function array_intersect_ukey (array $array1, array $array2, array $_ = null, callable $key_compare_func) {}", "public function testAssignKeyC() {\n\t\t// Define standard array\n\t\t$array = array(\n array(\n 'color' => 'blue'\n , 'fruit' => 'blueberry'\n , 'environment' => 'sky'\n )\n , array(\n 'color' => 'orange'\n , 'fruit' => 'orange'\n , 'environment' => 'fire'\n )\n , array(\n 'color' => 'green'\n , 'fruit' => 'apple'\n , 'environment' => 'grass'\n )\n );\n\n // Assign the key to the array Remove the key from the original\n $new_array = ar::assign_key( $array, 'color', true );\n\n // Create the array it should look like\n $proper_array = array(\n 'blue' => array(\n 'fruit' => 'blueberry'\n , 'environment' => 'sky'\n )\n , 'orange' => array(\n 'fruit' => 'orange'\n , 'environment' => 'fire'\n )\n , 'green' => array(\n 'fruit' => 'apple'\n , 'environment' => 'grass'\n )\n );\n\n // Make sure they're equal\n $this->assertEquals( $new_array, $proper_array );\n\t}", "public function mergeValues($destination, $source)\n {\n return array_keys(array_merge(array_flip($destination), array_flip($source)));\n }", "public function mergeValues($destination, $source)\n {\n return array_keys(array_merge(array_flip($destination), array_flip($source)));\n }", "public function mergeValues($destination, $source)\n {\n return array_keys(array_merge(array_flip($destination), array_flip($source)));\n }", "protected function arrayMapKeys($fn, $array): array\n {\n $newArray = [];\n foreach ($array as $key => $value) {\n $newArray[$fn($key)] = $value;\n }\n return $newArray;\n }" ]
[ "0.5988121", "0.554012", "0.5422198", "0.5418502", "0.5413169", "0.53756225", "0.53264487", "0.5293269", "0.52156264", "0.5214903", "0.51852715", "0.5157338", "0.510667", "0.50961953", "0.5089131", "0.50889504", "0.5076885", "0.5043353", "0.5027122", "0.50153196", "0.500057", "0.49793437", "0.4975632", "0.4966781", "0.49561676", "0.4946547", "0.4903628", "0.4903628", "0.4903628", "0.4896317" ]
0.6145345
0
Update the order meta with field value
function clover_checkout_field_update_order_meta( $order_id ) { if ( $_POST['clover_order_id'] ) update_post_meta( $order_id, 'clover_order_id', esc_attr( $_POST['clover_order_id'] ) ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function purchase_order_custom_field_update_order_meta ( $order_id )\n\t{\n\t\tif ( $_POST[ 'purchase_order' ] )\n\t\t{\n\t\t\tupdate_post_meta ( $order_id, 'Purchase Order', esc_attr ( $_POST[ 'purchase_order' ] ) );\n\t\t}\n\t}", "function update_order_info($order){\n }", "function my_custom_checkout_field_update_order_meta( $order_id ) {\n if ( $_POST['my_tax_invoice'] ) update_post_meta( $order_id, '_require_tax_invoice', esc_attr( $_POST['my_tax_invoice'] ) );\n if ( $_POST['tax_personal_id'] ) update_post_meta( $order_id, '_tax_personal_id', esc_attr( $_POST['tax_personal_id'] ) );\n if ( $_POST['tax_company_id'] ) update_post_meta( $order_id, '_tax_company_id', esc_attr( $_POST['tax_company_id'] ) );\n}", "function purchase_order_custom_field_update_user_meta ( $user_id )\n\t{\n\t\tif ( $user_id && $_POST[ 'purchase_order' ] )\n\t\t{\n\t\t\tupdate_user_meta ( $user_id, 'purchase_order', esc_attr ( $_POST[ 'purchase_order' ] ) );\n\t\t}\n\t}", "function comments_checkout_field_update_order_meta($order_id)\n{\n if (!empty($_POST['comments'])) {\n update_post_meta($order_id, 'comment', sanitize_text_field($_POST['comments']));\n }\n}", "public function updated(Order $order)\n {\n\n }", "function co_admin_save_control_number($order_id, $post)\n{\n $order = wc_get_order($order_id);\n if (isset($_POST['metodo-pago'])) {\n if ($_POST['metodo-pago'] != 'Efectivo') {\n $var_to_save = array('tipo' => $_POST['metodo-pago'], 'banco' => $_POST['banco'], 'referencia' => $_POST['referencia']);\n }else{\n $var_to_save = array('tipo' => $_POST['metodo-pago'], 'banco' => null, 'referencia' =>null);\n }\n $order->update_meta_data('metodo-pago', $var_to_save);\n $order->save_meta_data();\n }\n if (isset($_POST['numero-control'])) {\n $order->update_meta_data('numero-control', wc_clean($_POST['numero-control']));\n $order->save_meta_data();\n }\n}", "public function update_order_meta_on_checkout( $order_id, $data ) {\n\t\t$order = wc_get_order( $order_id );\n\t\t$settings = $this->checkout_fields_pro->get_settings();\n\t\t$session_data = WC()->session->get( 'checkout-fields', array() );\n\t\tforeach ( $settings as $key => $section_fields ) {\n\t\t\tif ( is_array( $section_fields ) ) {\n\t\t\t\tforeach ( $section_fields as $field ) {\n\t\t\t\t\t$session_data = $this->maybe_update_order_meta_for_field( $field, $data, $session_data, $order );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tWC()->session->set( 'checkout-fields', $session_data );\n\t}", "public function testUpdateOrderLineCustomFields()\n {\n }", "function carton_process_shop_order_meta( $post_id, $post ) {\n\tglobal $wpdb, $carton, $carton_errors;\n\n\t// Add key\n\tadd_post_meta( $post_id, '_order_key', uniqid('order_'), true );\n\n\t// Update post data\n\tupdate_post_meta( $post_id, '_billing_first_name', carton_clean( $_POST['_billing_first_name'] ) );\n\tupdate_post_meta( $post_id, '_billing_last_name', carton_clean( $_POST['_billing_last_name'] ) );\n\tupdate_post_meta( $post_id, '_billing_company', carton_clean( $_POST['_billing_company'] ) );\n\tupdate_post_meta( $post_id, '_billing_address_1', carton_clean( $_POST['_billing_address_1'] ) );\n\tupdate_post_meta( $post_id, '_billing_address_2', carton_clean( $_POST['_billing_address_2'] ) );\n\tupdate_post_meta( $post_id, '_billing_city', carton_clean( $_POST['_billing_city'] ) );\n\tupdate_post_meta( $post_id, '_billing_postcode', carton_clean( $_POST['_billing_postcode'] ) );\n\tupdate_post_meta( $post_id, '_billing_country', carton_clean( $_POST['_billing_country'] ) );\n\tupdate_post_meta( $post_id, '_billing_state', carton_clean( $_POST['_billing_state'] ) );\n\tupdate_post_meta( $post_id, '_billing_email', carton_clean( $_POST['_billing_email'] ) );\n\tupdate_post_meta( $post_id, '_billing_phone', carton_clean( $_POST['_billing_phone'] ) );\n\tupdate_post_meta( $post_id, '_shipping_first_name', carton_clean( $_POST['_shipping_first_name'] ) );\n\tupdate_post_meta( $post_id, '_shipping_last_name', carton_clean( $_POST['_shipping_last_name'] ) );\n\tupdate_post_meta( $post_id, '_shipping_company', carton_clean( $_POST['_shipping_company'] ) );\n\tupdate_post_meta( $post_id, '_shipping_address_1', carton_clean( $_POST['_shipping_address_1'] ) );\n\tupdate_post_meta( $post_id, '_shipping_address_2', carton_clean( $_POST['_shipping_address_2'] ) );\n\tupdate_post_meta( $post_id, '_shipping_city', carton_clean( $_POST['_shipping_city'] ) );\n\tupdate_post_meta( $post_id, '_shipping_postcode', carton_clean( $_POST['_shipping_postcode'] ) );\n\tupdate_post_meta( $post_id, '_shipping_country', carton_clean( $_POST['_shipping_country'] ) );\n\tupdate_post_meta( $post_id, '_shipping_state', carton_clean( $_POST['_shipping_state'] ) );\n\tupdate_post_meta( $post_id, '_shipping_email', carton_clean( $_POST['_shipping_email'] ) );\n\tupdate_post_meta( $post_id, '_shipping_phone', carton_clean( $_POST['_shipping_phone'] ) );\n\tupdate_post_meta( $post_id, '_order_shipping', carton_clean( $_POST['_order_shipping'] ) );\n\tupdate_post_meta( $post_id, '_order_shipping_real', carton_clean( $_POST['_order_shipping_real'] ) );\n\tupdate_post_meta( $post_id, '_order_shipping_tracking', carton_clean( $_POST['_order_shipping_tracking'] ) );\n\tupdate_post_meta( $post_id, '_order_shipping_tracking_status', carton_clean( $_POST['_order_shipping_tracking_status'] ) );\n\tupdate_post_meta( $post_id, '_order_shipping_tracking_label', carton_clean( $_POST['_order_shipping_tracking_label'] ) );\n\tupdate_post_meta( $post_id, '_order_shipping_customer_instruction', $_POST['_order_shipping_customer_instruction'] );\n\t\n\tupdate_post_meta( $post_id, '_cart_discount', carton_clean( $_POST['_cart_discount'] ) );\n\tupdate_post_meta( $post_id, '_order_discount', carton_clean( $_POST['_order_discount'] ) );\n\tupdate_post_meta( $post_id, '_order_total', carton_clean( $_POST['_order_total'] ) );\n\tupdate_post_meta( $post_id, '_customer_user', absint( $_POST['customer_user'] ) );\n\n\tif ( isset( $_POST['_order_tax'] ) )\n\t\tupdate_post_meta( $post_id, '_order_tax', carton_clean( $_POST['_order_tax'] ) );\n\n\tif ( isset( $_POST['_order_shipping_tax'] ) )\n\t\tupdate_post_meta( $post_id, '_order_shipping_tax', carton_clean( $_POST['_order_shipping_tax'] ) );\n\n\t// Shipping method handling\n\tif ( get_post_meta( $post_id, '_shipping_method', true ) !== stripslashes( $_POST['_shipping_method'] ) ) {\n\n\t\t$shipping_method = carton_clean( $_POST['_shipping_method'] );\n\n\t\tupdate_post_meta( $post_id, '_shipping_method', $shipping_method );\n\t}\n\n\tif ( get_post_meta( $post_id, '_shipping_method_title', true ) !== stripslashes( $_POST['_shipping_method_title'] ) ) {\n\n\t\t$shipping_method_title = carton_clean( $_POST['_shipping_method_title'] );\n\n\t\tif ( ! $shipping_method_title ) {\n\n\t\t\t$shipping_method = esc_attr( $_POST['_shipping_method'] );\n\t\t\t$methods = $carton->shipping->load_shipping_methods();\n\n\t\t\tif ( isset( $methods ) && isset( $methods[ $shipping_method ] ) )\n\t\t\t\t$shipping_method_title = $methods[ $shipping_method ]->get_title();\n\t\t}\n\n\t\tupdate_post_meta( $post_id, '_shipping_method_title', $shipping_method_title );\n\t}\n\n\t// Payment method handling\n\tif ( get_post_meta( $post_id, '_payment_method', true ) !== stripslashes( $_POST['_payment_method'] ) ) {\n\n\t\t$methods \t\t\t\t= $carton->payment_gateways->payment_gateways();\n\t\t$payment_method \t\t= carton_clean( $_POST['_payment_method'] );\n\t\t$payment_method_title \t= $payment_method;\n\n\t\tif ( isset( $methods) && isset( $methods[ $payment_method ] ) )\n\t\t\t$payment_method_title = $methods[ $payment_method ]->get_title();\n\n\t\tupdate_post_meta( $post_id, '_payment_method', $payment_method );\n\t\tupdate_post_meta( $post_id, '_payment_method_title', $payment_method_title );\n\t}\n\n\t// Update date\n\tif ( empty( $_POST['order_date'] ) ) {\n\t\t$date = current_time('timestamp');\n\t} else {\n\t\t$date = strtotime( $_POST['order_date'] . ' ' . (int) $_POST['order_date_hour'] . ':' . (int) $_POST['order_date_minute'] . ':00' );\n\t}\n\n\t$wpdb->query( $wpdb->prepare( \"UPDATE $wpdb->posts SET post_date = %s WHERE \\\"ID\\\" = %s\", date_i18n( 'Y-m-d H:i:s', $date ), $post_id ) );\n\n\n\t// Tax rows\n\tif ( isset( $_POST['order_taxes_id'] ) ) {\n\n\t\t$get_values = array( 'order_taxes_id', 'order_taxes_rate_id', 'order_taxes_amount', 'order_taxes_shipping_amount' );\n\n\t\tforeach( $get_values as $value )\n\t\t\t$$value = isset( $_POST[ $value ] ) ? $_POST[ $value ] : array();\n\n\t\tforeach( $order_taxes_id as $item_id ) {\n\n\t\t\t$item_id = absint( $item_id );\n\t\t\t$rate_id = absint( $order_taxes_rate_id[ $item_id ] );\n\n\t\t\tif ( $rate_id ) {\n\t\t\t\t$rate = $wpdb->get_row( $wpdb->prepare( \"SELECT * FROM {$wpdb->prefix}carton_tax_rates WHERE tax_rate_id = %s\", $rate_id ) );\n\t\t\t\t$label = $rate->tax_rate_name ? $rate->tax_rate_name : $carton->countries->tax_or_vat();\n\t\t\t\t$compound = $rate->tax_rate_compound ? 1 : 0;\n\n\t\t\t\t$code = array();\n\n\t\t\t\t$code[] = $rate->tax_rate_country;\n\t\t\t\t$code[] = $rate->tax_rate_state;\n\t\t\t\t$code[] = $rate->tax_rate_name ? $rate->tax_rate_name : 'TAX';\n\t\t\t\t$code[] = absint( $rate->tax_rate_priority );\n\t\t\t\t$code = strtoupper( implode( '-', array_filter( $code ) ) );\n\t\t\t} else {\n\t\t\t\t$code = '';\n\t\t\t\t$label = $carton->countries->tax_or_vat();\n\t\t\t}\n\n\t\t\t$wpdb->update(\n\t\t\t\t$wpdb->prefix . \"carton_order_items\",\n\t\t\t\tarray( 'order_item_name' => carton_clean( $code ) ),\n\t\t\t\tarray( 'order_item_id' => $item_id ),\n\t\t\t\tarray( '%s' ),\n\t\t\t\tarray( '%d' )\n\t\t\t);\n\n\t\t\tcarton_update_order_item_meta( $item_id, 'rate_id', $rate_id );\n\t\t\tcarton_update_order_item_meta( $item_id, 'label', $label );\n\t\t\tcarton_update_order_item_meta( $item_id, 'compound', $compound );\n\n\t\t\tif ( isset( $order_taxes_amount[ $item_id ] ) )\n\t\t \t\tcarton_update_order_item_meta( $item_id, 'tax_amount', carton_clean( $order_taxes_amount[ $item_id ] ) );\n\n\t\t \tif ( isset( $order_taxes_shipping_amount[ $item_id ] ) )\n\t\t \t\tcarton_update_order_item_meta( $item_id, 'shipping_tax_amount', carton_clean( $order_taxes_shipping_amount[ $item_id ] ) );\n\t\t}\n\t}\n\n\n\t// Order items + fees\n\tif ( isset( $_POST['order_item_id'] ) ) {\n\n\t\t$get_values = array( 'order_item_id', 'order_item_name', 'order_item_qty', 'line_subtotal', 'line_subtotal_tax', 'line_total', 'line_tax', 'order_item_tax_class' );\n\n\t\tforeach( $get_values as $value )\n\t\t\t$$value = isset( $_POST[ $value ] ) ? $_POST[ $value ] : array();\n\n\t\tforeach ( $order_item_id as $item_id ) {\n\n\t\t\t$item_id = absint( $item_id );\n\n\t\t\tif ( isset( $order_item_name[ $item_id ] ) )\n\t\t\t\t$wpdb->update(\n\t\t\t\t\t$wpdb->prefix . \"carton_order_items\",\n\t\t\t\t\tarray( 'order_item_name' => carton_clean( $order_item_name[ $item_id ] ) ),\n\t\t\t\t\tarray( 'order_item_id' => $item_id ),\n\t\t\t\t\tarray( '%s' ),\n\t\t\t\t\tarray( '%d' )\n\t\t\t\t);\n\n\t\t\tif ( isset( $order_item_qty[ $item_id ] ) )\n\t\t \t\tcarton_update_order_item_meta( $item_id, '_qty', apply_filters( 'carton_stock_amount', $order_item_qty[ $item_id ] ) );\n\n\t\t \tif ( isset( $item_tax_class[ $item_id ] ) )\n\t\t \t\tcarton_update_order_item_meta( $item_id, '_tax_class', carton_clean( $item_tax_class[ $item_id ] ) );\n\n\t\t \tif ( isset( $line_subtotal[ $item_id ] ) )\n\t\t \t\tcarton_update_order_item_meta( $item_id, '_line_subtotal', carton_clean( $line_subtotal[ $item_id ] ) );\n\n\t\t \tif ( isset( $line_subtotal_tax[ $item_id ] ) )\n\t\t \t\tcarton_update_order_item_meta( $item_id, '_line_subtotal_tax', carton_clean( $line_subtotal_tax[ $item_id ] ) );\n\n\t\t \tif ( isset( $line_total[ $item_id ] ) )\n\t\t \t\tcarton_update_order_item_meta( $item_id, '_line_total', carton_clean( $line_total[ $item_id ] ) );\n\n\t\t \tif ( isset( $line_tax[ $item_id ] ) )\n\t\t \t\tcarton_update_order_item_meta( $item_id, '_line_tax', carton_clean( $line_tax[ $item_id ] ) );\n\n\t\t \t// Clear meta cache\n\t\t \twp_cache_delete( $item_id, 'order_item_meta' );\n\t\t}\n\t}\n\n\t// Save meta\n\t$meta_keys \t\t= isset( $_POST['meta_key'] ) ? $_POST['meta_key'] : array();\n\t$meta_values \t= isset( $_POST['meta_value'] ) ? $_POST['meta_value'] : array();\n\n\tforeach ( $meta_keys as $id => $meta_key ) {\n\t\t$meta_value = ( empty( $meta_values[ $id ] ) && ! is_numeric( $meta_values[ $id ] ) ) ? '' : $meta_values[ $id ];\n\t\t$wpdb->update(\n\t\t\t$wpdb->prefix . \"carton_order_itemmeta\",\n\t\t\tarray(\n\t\t\t\t'meta_key' => $meta_key,\n\t\t\t\t'meta_value' => $meta_value\n\t\t\t),\n\t\t\tarray( 'meta_id' => $id ),\n\t\t\tarray( '%s', '%s' ),\n\t\t\tarray( '%d' )\n\t\t);\n\t}\n\n\t// Order data saved, now get it so we can manipulate status\n\t$order = new CTN_Order( $post_id );\n\n\t// Order status\n\t$order->update_status( $_POST['order_status'] );\n\n\t// Handle button actions\n\tif ( ! empty( $_POST['ctn_order_action'] ) ) {\n\n\t\t$action = carton_clean( $_POST['ctn_order_action'] );\n\n\t\tif ( strstr( $action, 'send_email_' ) ) {\n\n\t\t\tdo_action( 'carton_before_resend_order_emails', $order );\n\n\t\t\t$mailer = $carton->mailer();\n\n\t\t\t$email_to_send = str_replace( 'send_email_', '', $action );\n\n\t\t\t$mails = $mailer->get_emails();\n\n\t\t\tif ( ! empty( $mails ) ) {\n\t\t\t\tforeach ( $mails as $mail ) {\n\t\t\t\t\tif ( $mail->id == $email_to_send ) {\n\t\t\t\t\t\t$mail->trigger( $order->id );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tdo_action( 'carton_after_resend_order_email', $order, $email_to_send );\n\n\t\t} else {\n\n\t\t\tdo_action( 'carton_order_action_' . sanitize_title( $action ), $order );\n\n\t\t}\n\t}\n\n\tdelete_transient( 'carton_processing_order_count' );\n}", "function update_invoice_meta($invoice){\n\n \t\t$this->db->where('REF_NO', $invoice['REF_NO']);\n \t\t$this->db->where('TYPE', $invoice['TYPE']);\n\t\tif($this->db->update('invoice_order', $invoice)){\n\t\t\treturn true;\n\t\t}\n\t\telse{\n\t\t\treturn false;\n\t\t}\n \t}", "public function Edit_Meta_Form($term) {\n //$arr_value = get_option($this->prefix_name . $term->term_id);\n $option_name = $this->prefix_name;\n $arr_value = get_post_meta($term->term_id, $option_name,true );\n\n ?>\n <tr class=\"form-field\">\n <th scope=\"row\" valign=\"top\"> <label> <?php _e('Order') ?></label> </th>\n <td> <input type=\"text\" name=\"branch_order\" id=\"branch_order\" value=\"<?php echo $arr_value; ?>\" /></td>\n </tr>\n <?php\n }", "public function tista_rocket_additional_fields_update( $order_id ){\n\n\t\t\tif($_POST['payment_method'] != 'tista_rocket' )\n\t\t\t\treturn;\n\n\t\t\t$rocket_number = sanitize_text_field( $_POST['rocket_number'] );\n\t\t\t$rocket_transaction_id = sanitize_text_field( $_POST['rocket_transaction_id'] );\n\n\t\t\t$number = isset($rocket_number) ? $rocket_number : '';\n\t\t\t$transaction = isset($rocket_transaction_id) ? $rocket_transaction_id : '';\n\n\t\t\tupdate_post_meta($order_id, '_rocket_number', $number);\n\t\t\tupdate_post_meta($order_id, '_rocket_transaction', $transaction);\n\n\t\t}", "public function updateMeta()\n\t{\n\t\t\n\t}", "abstract protected function set_metafield();", "function update_custom_meta($postID, $newvalue, $field_name) {\n\tif(!get_post_meta($postID, $field_name)){\n\tadd_post_meta($postID, $field_name, $newvalue);\n\t}else{\n\t// or to update existing meta\n\tupdate_post_meta($postID, $field_name, $newvalue);\n\t}\n}", "function process_meta_field($post, $key, $value) {\n if ( $post->post_type == 'revision' ) {\n return;\n }\n\n $value = implode(',', (array) $value );\n\n if ( get_post_meta($post->ID, $key, FALSE) ) { \n update_post_meta($post->ID, $key, $value);\n } else { \n add_post_meta($post->ID, $key ,$value);\n }\n \n if (! $value ) {\n delete_post_meta($post->ID, $key);\n }\n}", "function save_sdg_order_meta( $term_id, $tt_id ){\n if( isset( $_POST['sdg_order'] ) && '' !== $_POST['sdg_order'] ){\n $sdg_order = sanitize_title( strtoupper($_POST['sdg_order']) );\n add_term_meta( $term_id, 'sdg_order', $sdg_order, true );\n }\n }", "public function updated_post_meta( $meta_id, $object_id, $meta_key, $meta_value ) {\n\t\tif ( false !== $this->get_listing_subscription_order_id( $object_id )\n\t\t && '' !== $meta_value\n\t\t && '_job_expires' === $meta_key\n\t\t) {\n\t\t\tupdate_post_meta( $object_id, '_job_expires', '' ); // Never expire automatically\n\t\t}\n\t}", "function add_custom_order_item_meta_data( $item_id, $values, $cart_item ) {\n\n global $order;\n\n echo wc_get_order_item_meta( $item_id, 'optional', $single = true );\n\n}", "function add_product_custom_field_to_order_item_meta( $item_id, $item_values, $item_key ) {\n if( ! empty( $item_values['printSizeImage'] ) ){\n wc_update_order_item_meta( $item_id, 'printSizeImage', $item_values['printSizeImage'] );\n }\n else{\n error_log(\"printSizeImage not set\");\n }\n\n if( ! empty( $item_values['userImagePreview'] ) ){\n wc_update_order_item_meta( $item_id, 'userImagePreview', $item_values['userImagePreview'] );\n }\n else{\n error_log(\"userImagePreview not set\");\n }\n}", "public function setFieldOrder($field_order){\n\t\t$this->field_order = $field_order;\n\t}", "function set_order($value) {\n $this->set_mapped_property('order', $value);\n }", "private function update_field($target_post_id, $field_name, $field_value)\n\t{\n\t\tglobal $wpdb;\n\t\t$sql = \"SELECT *\n\t\t\t\tFROM `{$wpdb->postmeta}`\n\t\t\t\tWHERE `post_id`=%d AND\n\t\t\t\t\t`meta_key`=%s\n\t\t\t\tLIMIT 1\";\n\t\t$res = $wpdb->get_row($q = $wpdb->prepare($sql, $target_post_id, $field_name), ARRAY_A);\nSyncDebug::log(__METHOD__.'():' . __LINE__ . ' sql=' . $q . ' = ' . var_export($res, TRUE));\n\t\tif (NULL !== res) {\n\t\t\t$meta_id = abs($res['meta_id']);\nSyncDebug::log(__METHOD__.'():' . __LINE__ . ' updating meta id #' . $meta_id);\n\t\t\t// found existing field, update it\n\t\t\t$sql = \"UPDATE `{$wpdb->postmeta}`\n\t\t\t\t\tSET `meta_value`=%s\n\t\t\t\t\tWHERE `meta_id`=%d\n\t\t\t\t\tLIMIT 1\";\n\t\t\t$res = $wpdb->query($q = $wpdb->prepare($sql, $field_value, $meta_id));\nSyncDebug::log(__METHOD__.'():' . __LINE__ . ' sql=' . $q . ' = ' . var_export($res, TRUE));\n\t\t} else {\n\t\t\t$wpdb->insert($wpdb->postmeta, array(\n\t\t\t\t'post_id' => $target_post_id,\n\t\t\t\t'meta_key' => $field_name,\n\t\t\t\t'meta_value' => $field_value,\n\t\t\t\t));\nSyncDebug::log(__METHOD__.'():' . __LINE__ . ' inserted new key=' . $field_name . '=' . $field_value);\n\t\t}\n\t}", "public function update(Request $request, order $order)\n {\n //\n }", "public function update(Request $request, order $order)\n {\n //\n }", "public function updateField($order_id, $field, $new_value)\n {\n $result = $this->update(\"UPDATE `suppliers_orders` SET `$field` = '$new_value' WHERE order_id = $order_id\");\n// $new_order = $this->getFirst(\"SELECT * FROM suppliers_orders WHERE order_id = $order_id\");\n//\n// $this->update(\"UPDATE suppliers_orders\n// SET total_price = $total_price\n// WHERE order_id = $order_id\");\n//\n return $result;\n }", "private function maybe_update_order_meta_for_field( array $field, array $data, array $session_data, $order ) {\n\t\tif ( $this->is_file( $field ) ) {\n\t\t\t$name = 'name';\n\t\t\tif ( isset( $field[ $name ] ) && isset( $data[ $field[ $name ] ] ) && isset( $session_data[ $field[ $name ] ] ) ) {\n\t\t\t\t$attachment = get_post( $session_data[ $field['name'] ] );\n\t\t\t\t$attachment->post_parent = $order->get_id();\n\t\t\t\twp_update_post( $attachment );\n\t\t\t\t$order->update_meta_data( '_' . $field['name'], $attachment->ID );\n\t\t\t\tupdate_post_meta( $attachment->ID, self::META_CHECKOUT_FIELDS_FIELD_FILE, $field );\n\t\t\t\tunset( $session_data[ $field['name'] ] );\n\t\t\t\t$order->save();\n\t\t\t}\n\t\t}\n\t\treturn $session_data;\n\t}", "function updateOrd()\r\n {\r\n $sql = \"update order1 set quantity = quantity +:quantity where Service_ID=:Service_ID and Cus_ID=:Cus_ID\";\r\n $args = [':Service_ID' => $this->Service_ID, ':quantity' => $this->quantity, ':Cus_ID' => $this->Cus_ID];\r\n DB::run($sql, $args);\r\n }", "public function update_meta_data($object, $key, $value) {\n\t\ttrigger_error(\"WooCommerce_Compat_0_3::update_meta_data() - this library is deprecated and you should change your code to stop using it\", E_USER_NOTICE);\n\t\t\n\t\tif (is_callable($object, 'update_meta_data')) {\n\t\t\t$meta_id = 0;\n\t\t\t$object->update_meta_data($key, $value, $meta_id);\n\t\t\t$object->save();\n\t\t\treturn;\n\t\t}\n\t\tif (is_a($object, 'WC_Order')) {\n\t\t\tupdate_post_meta($this->get_id($object), $key, $value);\n\t\t} else {\n\t\t\tthrow new Exception('woocommerce-compat: unknown object type: '.gettype($object));\n\t\t}\n\t}" ]
[ "0.7521543", "0.69629556", "0.6651993", "0.6619924", "0.6614941", "0.6474168", "0.64330196", "0.64255244", "0.6298942", "0.62104696", "0.61584467", "0.614009", "0.6095323", "0.6061027", "0.6048038", "0.6029816", "0.60216945", "0.6019752", "0.60137075", "0.59561825", "0.5823901", "0.58228695", "0.5804669", "0.57971716", "0.5787874", "0.5787874", "0.578598", "0.57819384", "0.5781213", "0.57787454" ]
0.71915424
1
Find the subjects by a given array /w id keys
protected function findSubjects(Array $subjects) { return $this->subjects->getByIds( array_pluck($subjects, 'id') ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function searchMulti($id, $array, $needle) {\n\t\t\t foreach ($array as $key => $val) {\n\t\t\t if ($val[$needle] === $id) {\n\t\t\t return $key;\n\t\t\t }\n\t\t\t }\n\t\t\t return null;\n\t\t\t}", "function subjectArray($id_subject) {\n\t$_SESSION['id_subject'] = $id_subject;\n\tif (!isset($_SESSION['subject_array'])) {\n\t\t$subject_array = array();\n\t} else {\n\t\t$subject_array = $_SESSION['subject_array'];\n\t}\n\tif (!in_multi_array($id_subject, $subject_array)) {\n\t\tarray_push($subject_array, $id_subject);\n\t\t$_SESSION['subject_array'] = $subject_array;\n\t}\n}", "public function allBySubjectKeyIdentifier(string $id): array\n {\n $map = $this->_getKeyIdMap();\n if (! isset($map[$id])) {\n return [];\n }\n return $map[$id];\n }", "function get_subject_ids($class_id)\n {\n \t\t\n \t $sql = \"select DISTINCT SubjectId from subjectteachers where ClassId='$class_id'\";\n\t $res = mysql_query($sql) or die(\"Error in fetching SubjectId from subjectexams Table\".mysql_error());\n\t $subject_ids = array();\n\n\t while($row = mysql_fetch_array($res)){\n\t \t\n\t $subject_id = $row[\"SubjectId\"];\n\t array_push($subject_ids,$subject_id);\n\t }\n\t return $subject_ids; \t\n }", "public function getSubject($id) {\n return dibi::fetch(\"\n SELECT s.*,\n (\n SELECT GROUP_CONCAT(t.login)\n FROM teachers_in_subjects t\n WHERE t.id = s.id\n ) teachers\n FROM subjects s\n WHERE s.id = %i\", $id\n );\n }", "function array_search_key_by_id($themultiarray, $theid) {\n foreach ($themultiarray as $key => $value) {\n\t\t// debugMessage($subkey);\n\t\tif($theid == $value['id']){\n\t\t\treturn $key;\n\t\t}\n }\n}", "function findByIds(array $ids);", "public function getSubjects(array $filters = array());", "function find(array $ids);", "public function getSubjectsByYear($years) {\n $q = dibi::query(\"\n SELECT *\n FROM subjects\n %if\", !empty($years), \"WHERE year IN %in\", $years, \"%end\n ORDER BY year\n \");\n\n return $q->fetchAssoc('year|id');\n }", "function getByIds(array $ids);", "function array_select_keys($objects, $ids) {\n $ret = array();\n foreach ($ids as $id) {\n $ret[$id] = $objects[$id];\n }\n return $ret;\n}", "function find_subject_by_id($id, $options=[]){\n\t\tglobal $db;\n\t\t$visible = isset($options['visible']) ? $options['visible'] : 'false' ;\n\t\t$sql = \"SELECT * FROM subjects \";\n\t\t$sql .= \"WHERE id='\" . db_escape($db,$id) . \"' \";\n\t\tif ($visible === true) {\n\t\t\t$sql .= \"AND visible=true\";\n\t\t}\n\t\t$result = mysqli_query($db,$sql);\n\t\t$record = mysqli_fetch_assoc($result);\n\t\tmysqli_free_result($result);\n\n\t\treturn $record;\n\n\t}", "public function getSharingEntries(array $subjects, $sids = null): array;", "function get_subject_by_id($sel_sid){\n\tglobal $connection;\n\t\t$query= \"SELECT * \".\" \";\n\t\t$query.=\"FROM subjects\".\" \";\n\t\t$query.=\"WHERE id={$sel_sid}\".\" \";\n\t\t$query.=\"LIMIT 1 \";\n\t\t$result = mysql_query($query,$connection);\n\t\t$subject_set=confirm_query($result);\n\t\t$subject_set = mysql_fetch_array($subject_set);\n\t\tif($subject_set){\n\t\t\treturn $subject_set;\n\t\t}\n}", "public static function getsubjects()\n {\n $subjects = Subjects::all();\n return $subjects;\n }", "function searchForId($id, $array) {\n\t foreach ($array as $key => $val) {\n\t if ($val['value'] === $id) {\n\t return $key;\n\t }\n\t }\n\t return null;\n}", "public function getSubjects(\\Caridea\\Auth\\Principal $principal): array;", "function find_subject_by_id($subject_id)\n {\n global $connection;\n\n /* Genero la cadena con el query */\n $query = \"select * \";\n $query .= \"from Subjects \";\n $query .= \"where id= \" . mysqli_prep($subject_id) .\" \";\n $query .= \"limit 1 \";\n\n /* Ejecuto query en la base */\n $subject_set = mysqli_query($connection,$query);\n\n /* Verifico si hubo retorno del query */\n confirm_query($subject_set);\n\n /* Genero un array asociativo con toda la información o null */\n if($subject=mysqli_fetch_assoc($subject_set))\n {\n return $subject;\n }\n return null;\n\n }", "function subjects($s_type = NULL) {\r\n\t\t$this->filterAdd ( NULL, NULL, NULL, $s_type );\r\n\t\t$triples = $this->filter ()->getTriples ();\r\n\t\t$subjects = array ();\r\n\t\tforeach ( $triples as $triple ) {\r\n\t\t\tarray_push ( $subjects, $triple ['s'] );\r\n\t\t}\r\n\t\treturn array_unique ( $subjects );\r\n\t}", "private function getMatches(array $subject, array $pattern)\n {\n return array_intersect_assoc($subject, $pattern);\n }", "public function getByArrayId($array)\n {\n foreach($array as $k => $v){\n $array[$k] = $this->getRep()->findOneBy(array('tag_id'=>$v));\n }\n return $array;\n }", "public function getSubjectsByTeacher($login) {\n $ds = \\dibi::dataSource(\"\n SELECT s.*\n FROM subjects s\n JOIN teachers_in_subjects tis ON tis.id = s.id\n WHERE tis.login = %s\", $login\n );\n\n return $ds;\n }", "function searchForId($id, $array) {\n foreach ($array as $key => $val) {\n if ($val['SkillName'] === $id) {\n return $key;\n }\n }\n return null;\n}", "public function find(array $ids);", "private function loadSubjects() {\n $res = $this->subjectRepository->findAll();\n \n foreach($res as $row){ \n\n $this->dbis_to_t3_subjects[$row->getDbisId()]['dbisid'] = $row->getDbisId();\n $this->dbis_to_t3_subjects[$row->getDbisId()]['title'] = $row->getTitle();\n $this->dbis_to_t3_subjects[$row->getDbisId()]['uid'] = $row->getUid();\n \n $this->t3_to_dbis_subjects[$row->getUid()]['uid'] = $row->getUid();\n $this->t3_to_dbis_subjects[$row->getUid()]['dbisid'] = $row->getDbisId();\n $this->t3_to_dbis_subjects[$row->getUid()]['title'] = $row->getTitle();\n }\n }", "function array_search_key($all, $checkarray) {\n foreach ($all as $key => $value) {\n\t\t// debugMessage($subkey);\n\t\tif($checkarray['id'] == $value['id'] && count(array_diff($value, $checkarray)) == 0){\n\t\t\treturn $key;\n\t\t}\n }\n}", "function scanArrayKeysForID($a, $varnames){\r\n\t\r\n\tif(!is_array($varnames)){\r\n\t\t$varnames = array($varnames);\r\n\t}\r\n\t$data = array();\r\n\tforeach($varnames as $name){\r\n\t\tforeach($a as $key => $value){\r\n\t\t\t\r\n\t\t\tif (preg_match(\"/^({$name})_/\", $key, $kp)){\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t$key = preg_replace(\"/^{$name}_/\",\"\",$key);\r\n\t\t\t\t$data[$key][$kp[1]] = $value;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\treturn $data;\r\n}", "public function updateSubjectById($id, $array)\n {\n $this->db->setStatement(\"UPDATE t:faecher SET Kuerzel = :kuerzel, Name = :name WHERE Fach_Id = :id \");\n $this->db->bindParameter(\"id\", \"i\", $id);\n $this->db->bindParameter(\"kuerzel\", \"s\", $array[\"kuerzel\"]);\n $this->db->bindParameter(\"name\", \"s\", $array[\"name\"]);\n\n return $this->db->pdbquery();\n }", "public function findAllByIdArray($idArray);" ]
[ "0.62665915", "0.62580305", "0.6052684", "0.6024105", "0.5968932", "0.590194", "0.5891247", "0.588668", "0.5855326", "0.5797926", "0.5719875", "0.56306463", "0.56260055", "0.5592229", "0.55887437", "0.5587959", "0.5581584", "0.55775446", "0.5531261", "0.5525979", "0.5520036", "0.5493503", "0.5491349", "0.54904103", "0.5485873", "0.5462157", "0.5451589", "0.54423386", "0.54306054", "0.54186106" ]
0.677547
0
/ Page Extra Fields Remove Image Get
public function page_extra_remove_image($id) { $pages_extra = PageExtra::where('id',$id)->get(); if($pages_extra[0]->image!='' && file_exists(public_path().'/uploads/'.$pages_extra[0]->image)) { unlink(public_path().'/uploads/'.$pages_extra[0]->image); } if($pages_extra[0]->image2!='' && file_exists(public_path().'/uploads/'.$pages_extra[0]->image2)) { unlink(public_path().'/uploads/'.$pages_extra[0]->image2); } if ($pages_extra[0]->type==1 || ($pages_extra[0]->type==7 && $pages_extra[0]->page_id!=1)) { DB::delete('delete from pages_extra where id = ?',[$id]); }else{ DB::table('pages_extra') ->where('id', $id) ->update( array('image' => '' ) ); } return redirect()->back()->with('remove_image_success', true); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function inspiry_remove_gallery_image() {\n\n\t\t// Verify Nonce\n\t\t$nonce = $_POST['nonce'];\n\t\tif ( ! wp_verify_nonce( $nonce, 'inspiry_allow_upload' ) ) {\n\t\t\t$ajax_response = array(\n\t\t\t\t'post_meta_removed' => false,\n\t\t\t\t'attachment_removed' => false,\n\t\t\t\t'reason' => esc_html__( 'Security check failed!', 'framework' )\n\t\t\t);\n\t\t\techo json_encode( $ajax_response );\n\t\t\tdie;\n\t\t}\n\n\t\t$post_meta_removed = false;\n\t\t$attachment_removed = false;\n\n\t\t// Default Meta Key\n\t\t$meta_key = 'REAL_HOMES_property_images';\n\t\tif ( isset( $_POST['meta_key'] ) && ! empty( $_POST['meta_key'] ) ) {\n\t\t\t$meta_key = $_POST['meta_key'];\n\t\t}\n\n\t\tif ( isset( $_POST['property_id'] ) && isset( $_POST['attachment_id'] ) ) {\n\t\t\t$property_id = intval( $_POST['property_id'] );\n\t\t\t$attachment_id = intval( $_POST['attachment_id'] );\n\t\t\tif ( $property_id > 0 && $attachment_id > 0 ) {\n\t\t\t\t$post_meta_removed = delete_post_meta( $property_id, $meta_key, $attachment_id );\n\t\t\t\t$attachment_removed = wp_delete_attachment( $attachment_id );\n\t\t\t} else if ( $attachment_id > 0 ) {\n\t\t\t\tif ( false === wp_delete_attachment( $attachment_id ) ) {\n\t\t\t\t\t$attachment_removed = false;\n\t\t\t\t} else {\n\t\t\t\t\t$attachment_removed = true;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t$ajax_response = array(\n\t\t\t'post_meta_removed' => $post_meta_removed,\n\t\t\t'attachment_removed' => $attachment_removed,\n\t\t);\n\n\t\techo json_encode( $ajax_response );\n\t\tdie;\n\n\t}", "function delete_image()\n {\n if (isset($_POST['remove'])) {\n global $wpdb;\n $img_path = $_POST['path'];\n\n // get the images meta ID.\n $query = \"SELECT ID FROM wp_posts where guid = '\" . esc_url($img_path) . \"' AND post_type = 'attachment'\";\n $results = $wpdb->get_results($query);\n\n // delete images meta\n foreach ($results as $row) {\n wp_delete_attachment($row->ID); //delete the image and also delete the attachment from the Media Library.\n }\n delete_option('ink_image'); //delete image path from database.\n }\n }", "public function removeImage () {}", "function actionRemoveImage(){\r\n $this->clubDatas = $this->_oDb->getEntryById($_POST['club_id']);\r\n $this->removeClubCoverBackground();\r\n }", "function dt_f_album_att_fields($fields, $post) {\r\n\tif( 'dt_gallery' == get_post_type($post->post_parent) ) {\r\n unset($fields['align']);\r\n unset($fields['image-size']);\r\n unset($fields['post_content']);\r\n unset($fields['image_alt']);\r\n unset($fields['url']);\r\n\t}\r\n\treturn $fields;\r\n}", "function mediacommons_imageextended_views_pre_render(&$view) {\n if ($view->name == 'image') {\n foreach ($view->result as $a => $result) {\n if (isset($result->field_field_image_extended)) {\n foreach ($result->field_field_image_extended as $b => $value) {\n if (!$value['raw']['extended_ri']) { \n unset($view->result[$a]->field_field_image_extended[$b]); \n }\n }\n }\n }\n }\n}", "public function resetImagePage ($page) {}", "function apptivo_ecommerce_populate_custom_fields() {\n\t// Attachment exclusion\n\t$args = array( \n\t\t'post_type' \t=> 'attachment', \n\t\t'numberposts' \t=> -1, \n\t\t'post_status' \t=> null, \n\t\t'fields' \t\t=> 'ids'\n\t); \n\t$attachments = get_posts($args);\n\tif ($attachments) foreach ($attachments as $id) :\n\t\tadd_post_meta($id, '_apptivo_ecommerce_exclude_image', 0);\n\tendforeach;\t\n}", "public function stripImage() {\n\t}", "public function stripImage () {}", "public function removeImage() {\n\t}", "public function Delete_Additional_Image()\n\t{\t\n\t\t// === GET ID === //\n\t\t$id = $this->segment_item;\n\t\t\n\t\t$image_id = $this->uri->segment($this->_getSegmentsOffset()+7);\n\t\t\n\t\tif(!$image_id) redirect($this->_getBaseURI());\n\t\t\n\t\t$this->companies_model->RemoveAdditionalImage($image_id);\n\t\t\n\t\tredirect($this->_getBaseURI().\"/edit/$this->segment_orderby/\".$this->segment_orderseq.\"/\".$this->segment_offset.\"/\".$id);\n\t}", "function wrny_remove_website_field( $fields ) {\n\tif( isset( $fields['url'] ) )\n\tunset( $fields['url'] );\n\treturn $fields;\n}", "function remove_url_field($fields){\n unset($fields['url']);\n return $fields;\n }", "public function getImagePage () {}", "function classifiedImgUnlink()\n\t{\n\t//\tprint_r($_REQUEST);\n\t\tif(isset($_REQUEST['cls_img']))\n\t\t{\n\t\t\t$business_img = $_REQUEST['cls_img'];\n\t\t\t$img_id = $_REQUEST['cls_img_id'];\n\t\t\t$cls_id = $_REQUEST['cls_id'];\n\t\t\t$return = $this->classifieddeleteImage($img_id, $business_img);\n\t\t\t$arr=array('a'=>$return);\n\t\t\tprint_r(json_encode($arr));\n\t\t}\n\t}", "function tidy_theme_img_code($new,$old,$table,$field,$db=NULL)\n{\n\tif ($new===$old) return; // Still being used\n\n\t$path=find_theme_image($old,true,true);\n\tif ((is_null($path)) || ($path=='')) return;\n\n\tif ((strpos($path,'/images_custom/')!==false) && ($GLOBALS['SITE_DB']->query_value('theme_images','COUNT(DISTINCT id)',array('path'=>$path))==1))\n\t{\n\t\tif (is_null($db)) $db=$GLOBALS['SITE_DB'];\n\t\t$count=$db->query_value($table,'COUNT(*)',array($field=>$old));\n\t\tif ($count==0)\n\t\t{\n\t\t\t@unlink(get_custom_file_base().'/'.$path);\n\t\t\t$GLOBALS['SITE_DB']->query_delete('theme_images',array('id'=>$old));\n\t\t}\n\t}\n}", "function flei_remove_meta_boxes()\n{\n // remove taxonomy meta box for my_expertise b/c for attachment this has to be done through ACF\n remove_meta_box('custom-post-type-onomies-my_expertise', 'attachment', 'normal');\n}", "public function remove_image() {\n $ad = $this->ad_protected_for_current_user($this->params['id']);\n $ad->remove_image($this->params['image_id']);\n redirect('/ads/edit', ['notice' => 'Image successfully removed.'], ['id' => $ad->id]);\n }", "public function despeckleImage() {\n\t}", "function my_remove_meta_box_page() {\n // Custom Fields\n remove_meta_box('postcustom', 'page', 'normal');\n // Discussion\n remove_meta_box('commentsdiv' , 'page', 'normal');\n // Comments\n remove_meta_box('commentstatusdiv', 'page', 'normal');\n // Revisions\n remove_meta_box('revisionsdiv', 'page', 'normal');\n // Author\n remove_meta_box('authordiv', 'page', 'normal');\n // Page Attributes\n //remove_meta_box( pageparentdiv ,'page', 'normal');\n // Publish\n //remove_meta_box( submitdiv ,'page', 'normal'); \n remove_meta_box('slugdiv', 'page', 'normal'); // Slug Metabox\n}", "function imagefield_file_delete($file) {\r\n if (imagefield_file_is_image($file)) {\r\n file_delete(imagefield_file_admin_thumb_path($file, FALSE));\r\n }\r\n}", "function dt_f_album_aftos( $post, $attachments ) {\r\n if( 'dt_gallery' == get_post_type($_REQUEST['post_id']) ) {\r\n if( isset($_GET['tab']) && 'type' == $_GET['tab']) {\r\n unset($_POST['save']);\r\n }\r\n }\r\n return $post;\r\n}", "function qw_theme_image($post, $field)\n{\n $style = $field['image_display_style'];\n $count = $field['image_display_count'];\n\n $images = qw_get_post_images($post->ID);\n if(is_array($images)){\n $output = '';\n $i = 0;\n foreach($images as $image){\n if($count == 0 || ($i < $count)){\n $output.= wp_get_attachment_image($image->ID, $style);\n }\n $i++;\n }\n return $output;\n }\n}", "function the_feature_image(){\n global $the_page;\n if(isset($the_page)){\n print $the_page->feature_image;\n }\n }", "function sfi_meta_callback( $post ) {\n wp_nonce_field( basename( __FILE__ ), 'sfi_nonce' );\n $sfi_stored_meta = get_post_meta( $post->ID );\n\n if ( isset ( $sfi_stored_meta['sfi-image'] ) ) : ?>\n <div id=\"sfi-thumbnail\">\n <img id=\"sfi-thumbnail\" src=\"<?php echo $sfi_stored_meta['sfi-image'][0]; ?>\" class=\"attachment-post-thumbnail\" ></a>\n </div>\n <?php\n endif;\n ?>\n\n <input type=\"hidden\" name=\"sfi-image\" id=\"sfi-image\" value=\"<?php if ( isset ( $sfi_stored_meta['sfi-image'] ) ) echo $sfi_stored_meta['sfi-image'][0]; ?>\" />\n\t<p>\n <a href=\"#\" id=\"sfi-remove-image\" class=\"<?php if ( empty ( $sfi_stored_meta['sfi-image'] ) ) echo 'hide'; ?>\" >Remove app featured image</a>\n <a href=\"#\" id=\"sfi-set-image\" class=\"<?php if ( isset ( $sfi_stored_meta['sfi-image'] ) ) echo 'hide'; ?>\">Set app featured image</a>\n\t</p>\n<?php\n}", "public function deleteValueImage()\r\n\t{\r\n\t\t// Get request\r\n\t\t$metaValueId = Request::getInt('value');\r\n\t\t$type = Request::getCmd('type', 'main');\r\n\t\t\r\n\t\t// Delete from model\r\n\t\t$metaModel = BluApplication::getModel('meta');\r\n\t\t$deleted = $metaModel->updateMetaValue($metaValueId, array(\r\n\t\t\t'images' => array($type => '')\r\n\t\t));\r\n\t\t\r\n\t\t// Back to listing\r\n\t\tif ($deleted) {\r\n\t\t\tMessages::addMessage('Meta value image deleted', 'info');\r\n\t\t}\r\n\t\t$this->view();\r\n\t}", "function mainPicture($page){\n\t$image = (count($page->images)) ? $page->images->first : $page->parent->images->first;\n\treturn $image;\n}", "function manidora_homepage_thumbnail_remove($pid = \"\") {\n if (strlen($pid) > 0) {\n $thumbnails = variable_get('manidora_thumbnail_pids', \"\");\n if (strlen($thumbnails) > 0) {\n $thumbs = explode('~', $thumbnails);\n $new_thumbs = array_filter($thumbs, create_function('$v', '$pid = \"' . $pid . '\"; return ($v != urlencode($pid));'));\n $thumbnails = implode('~', $new_thumbs);\n }\n variable_set('manidora_thumbnail_pids', $thumbnails);\n drupal_set_message(t('Image %p removed', array('%p' => $pid)), 'status', FALSE);\n }\n drupal_goto('admin/islandora/manidora/homepage');\n}", "public function despeckleImage () {}" ]
[ "0.65797085", "0.65762216", "0.63959676", "0.63552", "0.63487667", "0.6324269", "0.62364537", "0.62059593", "0.6193587", "0.6191102", "0.61870086", "0.61676466", "0.60773873", "0.60436976", "0.59885705", "0.5976713", "0.59078425", "0.58546865", "0.58425575", "0.5834097", "0.5809255", "0.5800597", "0.57717204", "0.5766571", "0.57645", "0.57475287", "0.5728817", "0.57283854", "0.57258064", "0.57199216" ]
0.6725089
0
/ Show College by Slug Get
public function ShowCollege($slug) { $setting = DB::table('mf_settings')->whereIn('id', array(5, 6, 7))->get(); $college = Colleges::where('slug',$slug)->first(); if($college) { if($college->college_name) { // @$setting[0]->value = $page[0]->meta_title; @$setting[0]->value = $college->college_name; } if($college->meta_keyword) { @$setting[1]->value = $college->meta_keyword; } if($college->meta_description) { @$setting[2]->value = $college->meta_description; } $page_image = ''; $page_url = url('/college/'.$college->slug); $site_logo = config('site.logo'); if($college->bannerimage && File::exists(public_path('uploads/'.$college->bannerimage)) ){ $page_image = url('/uploads/'.$college->bannerimage); }elseif ($college->logo && File::exists(public_path('uploads/'.$college->logo)) ){ $page_image = url('/uploads/'.$college->logo); }elseif ($site_logo && File::exists(public_path('uploads/'.$site_logo)) ){ $page_image = url('/uploads/'.$site_logo); } return view('frontend.college_details', compact('college','setting','page_url','page_image')); } else { return redirect('404'); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function show(College $college)\n {\n //\n }", "public function college()\n {\n return view('ministries.college.index')\n ->with('title', 'The Underground');\n }", "public function getUserCollege($tag)\n {\n return $this->db->query(\"select DISTINCT t.cid from college c INNER JOIN table1 t on t.COLL_ID=c.COLL_ID where c.COLL_NAME like '%$tag%'\");\n }", "public function show($slug)\n {\n return School::whereSlug($slug)->get()->first();\n }", "public function ShowFaculty($slug)\n\t{\n\t\t$setting = DB::table('mf_settings')->whereIn('id', array(5, 6, 7))->get();\n\n\t\t$faculty = Faculties::where('slug',$slug)->first();\n\t\tif($faculty)\n\t\t{\n\t\t\tif($faculty->title)\n\t\t\t{\n\t\t\t\t@$setting[0]->value = $faculty->title;\n\t\t\t}\n\t\t\tif($faculty->meta_keyword)\n\t\t\t{\n\t\t\t\t@$setting[1]->value = $faculty->meta_keyword;\n\t\t\t}\n\t\t\tif($faculty->meta_description)\n\t\t\t{\n\t\t\t\t@$setting[2]->value = $faculty->meta_description;\n\t\t\t}\n\t\t\t$college = Colleges::where('id',$faculty->college_id)->first();\n\n\t\t\t$page_image = '';\n\t\t\t$page_url = url('/'.$faculty->slug);\n\t\t\t$site_logo = config('site.logo');\n\t\t\tif($faculty->bannerimage && File::exists(public_path('uploads/'.$faculty->bannerimage)) ){\n\t\t\t\t$page_image = url('/uploads/'.$faculty->bannerimage);\n\t\t\t}elseif ($college->bannerimage && File::exists(public_path('uploads/'.$college->bannerimage)) ){\n\t\t\t\t$page_image = url('/uploads/'.$college->bannerimage);\n\t\t\t}elseif ($site_logo && File::exists(public_path('uploads/'.$site_logo)) ){\n\t\t\t\t$page_image = url('/uploads/'.$site_logo);\n\t\t\t}\n\t\t\t\n\t\t\treturn view('frontend.faculty_details', compact('faculty','college','setting','page_url','page_image'));\n\t\t\t\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn redirect('404');\n\t\t}\n\t}", "public function getSchoolDetails();", "public function show($slug)\n {\n $doctor=doctor::where('slug_en','like',$slug)->orWhere('slug_ar','like',$slug)->first();\n\n return view('doctor',compact('doctor'));\n }", "public function show(College $college)\n {\n // return $college;\n return view('collegeForAdmin.show', compact('college'));\n }", "public function show(University $university)\n {\n //\n }", "public function show(University $university)\n {\n //\n }", "public function index()\n {\n $colleges = College::all();\n return view('collegeForAdmin.index', compact('colleges'));\n }", "function cma_pla_college()\n {\n drupal_set_title('College Courses Title');\n $includePath=$_SERVER['DOCUMENT_ROOT'].base_path().drupal_get_path('module','vcn_cma').\"/vcn_cma_pla.theme.inc\";\n include_once($includePath);\n $output .= displayCollegeCourses();\n return($output);\n }", "public function get_slug();", "public function ShowCourse($slug)\n\t{\n\t\t$setting = DB::table('mf_settings')->whereIn('id', array(5, 6, 7))->get();\n\n\t\t$course = Courses::where('slug',$slug)->first();\n\t\tif($course)\n\t\t{\n\t\t\tif($course->name)\n\t\t\t{\n\t\t\t\t@$setting[0]->value = $course->name;\n\t\t\t}\n\t\t\tif($course->meta_keyword)\n\t\t\t{\n\t\t\t\t@$setting[1]->value = $course->meta_keyword;\n\t\t\t}\n\t\t\tif($course->meta_description)\n\t\t\t{\n\t\t\t\t@$setting[2]->value = $course->meta_description;\n\t\t\t}\n\n\t\t\t$page_image = '';\n\t\t\t$page_url = url('/course/'.$course->slug);\n\t\t\t$site_logo = config('site.logo');\n\t\t\tif($course->image && File::exists(public_path('uploads/'.$course->image)) ){\n\t\t\t\t$page_image = url('/uploads/'.$course->image);\n\t\t\t}elseif ($site_logo && File::exists(public_path('uploads/'.$site_logo)) ){\n\t\t\t\t$page_image = url('/uploads/'.$site_logo);\n\t\t\t}\n\t\t\t\n\t\t\treturn view('frontend.course_details', compact('course','setting','page_url','page_image'));\n\t\t\t\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn redirect('404');\n\t\t}\n\t}", "public function show($slug)\n {\n $results = $this->CC->getItem($slug);\n $item = $this->CC->parseItems($results['rows']);\n $params['item'] = $item[0]; \n \n if(!$item[0]->url || !$item[0]->uri){\n $this->CC->setCanonical($item[0]->_qname, 'professional-development/courses/'.$slug);\n }\n\n if($item[0]->hasRelatedArticles > 0){\n $related = $this->CC->getAssociationSorted($item[0]->_qname, 'ers:related-association');\n $params['relatedItems'] = $this->CC->parseItems($related['rows']);\n }\n\n if($params['item']->contentType == \"event_course_ebus\" ){\n return view('professional.ebus')->with($params);\n }\n return view('professional.course')->with($params); \n }", "public function show($slug)\n {\n\n }", "public function show($slug)\n {\n\n }", "public function show(school $school)\n {\n \n }", "public function getCollege(){\n\t\t\treturn $this->college;\n\t\t}", "public function index()\n {\n \n $college_dropdown = University::orderBy('uname')->pluck('uname', 'uname');\n // FUTURE NOTE: remove where clause\n $course_dropdown = Program::where('uid','=',1000000000)->orderBy('pname')->pluck('pname', 'pname');\n return view('pages.match', ['college_dropdown' => $college_dropdown, 'course_dropdown' => $course_dropdown]);\n }", "public function show($slug)\n {\n //\n }", "protected function show($collegeUrl,Request $request){\n if( false == InputSanitise::checkCollegeUrl($request)){\n return Redirect::to('/');\n }\n $loginUser = Auth::guard('web')->user();\n \t$vkitCategories = VkitCategory::getProjectCategoriesByCollegeIdByDeptIdWithPagination($loginUser->college_id);\n \treturn view('collegeModule.vkit.vkitCategory.list', compact('vkitCategories'));\n }", "public function show($param)\n {\n return NewHire::where('id', $param)\n ->orWhere('slug', $param)\n ->firstOrFail();\n }", "public function index(){\n if( auth()->user()->access_level > 2) {\n $schools = School::all();\n }\n else {\n $schools = School::where('id', auth()->user()->school_id)->get();\n }\n return view('school.show' , compact('schools'));\n }", "public function index($name)\n {\n // $schools= School::all()->where('name','=', $name);\n// foreach ($schools as $school):\n// return $school->name;\n// endforeach;\n //$classrooms=Classroom::latest()->paginate(20);\n $classrooms=Classroom::all()->where( 'school.name','=',$name);\n return view('Admin.classroom.all',compact('classrooms','name'));\n\n }", "public function getSchoolsListAction()\n {\n\t\t$params=$this->getRequest()->getParams();\n\t\t$keyword=$params[\"term\"];\n\t\t$result=\\Extended\\school_ref::getSchoolList($keyword);\n\t\t$data_arr=array();\n\t\t$i=0;\n\t\twhile($i<count($result))\n\t\t{\n\t\t\t$data_arr[]=array(\n\t\t\t\t\t'label'=>$result[$i]['title'],\n\t\t\t\t\t'value'=>$result[$i]['title'],\n\t\t\t\t\t'id'=>$result[$i]['id']\n\t\t\t\t\t);\n\t\t\t$i++;\n\t\t}\n\t\techo Zend_Json::encode($data_arr);\n\t\tdie;\n }", "public function show($slug){\n $education_levels = Educationlevel::all();\n $paper_types = Papertype::all();\n $styles= Style::all();\n $subjects = Subject::all();\n return view('pages.show',compact('education_levels','paper_types','styles','subjects','page'));\n }", "function getsuggestmentors_school($schoolid){\n\tglobal $DB;\n\t$mid = atal_get_roleidbyname('mentor');\n\t$conditions = array('msn'=>$mid);\n\t$content = '';\n\t//$data = $DB->get_records('watson_mentor_match',$conditions, '', 'mentorid', $limitfrom=0, $limitnum=3);\n\t$data = $DB->get_records('user',$conditions, '', 'id', $limitfrom=0, $limitnum=3);\n\tif(count($data)>0){\n\t\tforeach($data as $key=>$value){\n\t\t\t$encryptid = $value->id; //encryptdecrypt_userid($value->id,'en');\t\t\n\t\t\t$content.='<div class=\"userprofileimg\">\n\t\t\t'.frmuserimghtml($value->id).'\n\t\t\t</br>\n\t\t\t<a href=\"javascript:void(0);\" data-url=\"'.$encryptid.'\" class=\"watsonmentor\" onclick=\"assign_suggestmentorschool(this);\">Assign</a>\n\t\t\t</div>';\n\t\t}\n\t}\n\treturn $content;\n}", "public function index(school $school)\n {\n \n \n }", "public function getSlug();" ]
[ "0.702764", "0.6630198", "0.6455819", "0.6301536", "0.6258668", "0.6139947", "0.6111594", "0.60799414", "0.6015337", "0.6015337", "0.59861165", "0.5938296", "0.5937252", "0.59201175", "0.58894956", "0.58889014", "0.58889014", "0.5880584", "0.58352065", "0.583386", "0.57577914", "0.57448936", "0.57151735", "0.57057434", "0.5703306", "0.57028025", "0.5684329", "0.5672295", "0.56680346", "0.5660375" ]
0.7376756
0
/ Show Course by Slug Get
public function ShowCourse($slug) { $setting = DB::table('mf_settings')->whereIn('id', array(5, 6, 7))->get(); $course = Courses::where('slug',$slug)->first(); if($course) { if($course->name) { @$setting[0]->value = $course->name; } if($course->meta_keyword) { @$setting[1]->value = $course->meta_keyword; } if($course->meta_description) { @$setting[2]->value = $course->meta_description; } $page_image = ''; $page_url = url('/course/'.$course->slug); $site_logo = config('site.logo'); if($course->image && File::exists(public_path('uploads/'.$course->image)) ){ $page_image = url('/uploads/'.$course->image); }elseif ($site_logo && File::exists(public_path('uploads/'.$site_logo)) ){ $page_image = url('/uploads/'.$site_logo); } return view('frontend.course_details', compact('course','setting','page_url','page_image')); } else { return redirect('404'); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function show(Course $course)\n {\n\n }", "public function courseSlug()\n {\n $routeParameter = $this->property('courseSlug');\n\n return $this->param($routeParameter);\n }", "public function show($id)\n {\n return Course::find($id);\n //\n }", "public function getCourse()\n {\n return Course::where('slug', $this->courseSlug())\n ->first();\n }", "public function show(Course $course)\n {\n //\n }", "public function show(Course $course)\n {\n //\n }", "public function show(Course $course)\n {\n //\n }", "public function show(Course $course)\n {\n //\n }", "public function show(Course $course)\n {\n //\n }", "public function show($id)\n {\n return Course::findOrFail($id);\n }", "public function show($id)\n {\n return Course::find($id);\n }", "abstract public function get_course();", "public function show($slug)\n {\n $results = $this->CC->getItem($slug);\n $item = $this->CC->parseItems($results['rows']);\n $params['item'] = $item[0]; \n \n if(!$item[0]->url || !$item[0]->uri){\n $this->CC->setCanonical($item[0]->_qname, 'professional-development/courses/'.$slug);\n }\n\n if($item[0]->hasRelatedArticles > 0){\n $related = $this->CC->getAssociationSorted($item[0]->_qname, 'ers:related-association');\n $params['relatedItems'] = $this->CC->parseItems($related['rows']);\n }\n\n if($params['item']->contentType == \"event_course_ebus\" ){\n return view('professional.ebus')->with($params);\n }\n return view('professional.course')->with($params); \n }", "public function getcourse ($id_course){\n $coursesDetail = $this -> restfullDAO -> getcoursesByid_course ($id_course );\n return $coursesDetail [0];\n }", "public function show($id)\n {\n \n if($user = auth()->user()){\n\n $course = Course::query()->find($id);\n\n if($course) {\n $skills = $course->skills()->pluck('name')->toArray();\n\n $user_courses = $user->courses()->get()->pluck('id');\n \n $paginator = Course::query()->whereNotIn('id', $user_courses)->where('id', '!=', $course->id)\n ->whereHas('skills', function ($query) use ($skills) {\n foreach ($skills as $skill) {\n $query->where('name', 'like', $skill);\n }\n })->paginate(6);\n $similar_courses = $paginator->getCollection();\n\n $similar_courses = Fractal::create()->collection($similar_courses, new CourseTransformer())\n ->paginateWith(new IlluminatePaginatorAdapter($paginator))\n ->toArray();\n\n $teacher = $course->teacher()->first();\n $paginator = $teacher->courses()->whereNotIn('id', $user_courses)->paginate(3);\n $teacher_courses = $paginator->getCollection();\n\n $teacher_courses = Fractal::create()->collection($teacher_courses, new CourseTransformer())\n ->paginateWith(new IlluminatePaginatorAdapter($paginator))\n ->toArray();\n\n $course = Fractal::create()->item($course, new CourseTransformer())\n ->includeAbout()\n ->includeAboutTeacher()\n ->includeSectionGroups()\n ->includeSections()\n ->includeTeacherCourses()\n ->toArray();\n \n return view('course::course_show')->with(['course' => $course, 'similar_courses' => $similar_courses, 'teacher_courses' => $teacher_courses]);\n }\n else{\n\n abort(404, 'Course Not Found');\n return view('course::course_show')->withErrors('Course Not Found');\n }\n }\n else{\n\n return view('course::course_show')->withErrors('Unauthorized');\n }\n }", "public function show($slug)\n {\n $course = Course::whereSlug($slug)->first();\n if (!$course)\n abort(404);\n return view('admin.courses.show', compact('course'));\n }", "public function show($slug)\n {\n $course = Course::where('slug','=', $slug)->first();\n $show = true;\n return View::make('admin.course.new_edit_course', compact('course', 'show'));\n }", "public function show(Course $course)\n {\n $courseSchedule = Day::where('course_id', $course->id)->count();\n if($course->type == 1 || ($course->type == 3 && $courseSchedule == 0)){\n $days[0] = \"Bebas\";\n $hours[0] = \"Bebas\";\n }\n else {\n $days = preg_split('@;@', $course->day, NULL, PREG_SPLIT_NO_EMPTY);\n $hours = preg_split('@;@', $course->hour, NULL, PREG_SPLIT_NO_EMPTY);\n }\n\n $type = $course->type;\n if($type === 1){\n $backRoute = 'admin.muaythai.courses';\n }\n else if($type === 2){\n $backRoute = 'admin.dance.courses';\n }\n else if($type === 3){\n $backRoute = 'admin.private.courses';\n }\n else{\n $backRoute = 'admin.gymnastic.courses';\n }\n\n //Get customer/murid\n $customers = Schedule::where('course_id', $course->id)->get();\n return view('admin.courses.show', ['course' => $course, 'days' => $days, 'hours' => $hours, 'customers' => $customers, 'backRoute' => $backRoute]);\n }", "public function show()\n {\n $course = Course::all();\n\n return view('admission.course-show',compact('course'));\n }", "public function show($id)\n {\n //\n $course = Course::findOrFail($id);\n// dd ($course);\n return view('courses.show', compact('course'));\n }", "public function show($id)\n {\n //\n\n //$course = Course::find( $id );\n\n $course = DB::table('courses as c')\n ->selectRaw('c.*, cat.*, c.id as course_id, ins.firstname as instructor_name')\n ->leftjoin('categories as cat','c.cate_id','=','cat.id')\n ->leftjoin('users as ins','c.user_id','=','ins.id')\n ->where('c.id','=',$id)\n ->orderBy('c.id','desc')\n ->first();\n\n return view('courses.show',[\n 'course' => $course\n ]);\n }", "function coursePage($id) {\n $course = Course::find($id);\n $questions = $course->questions;\n return view('course', compact('course', 'questions'));\n }", "public function show($id)\n {\n $user = Auth::user();\n $title=\"Single Course\"; \n $course=Course::find($id);\n $chapters = Coursechapter::where('course',$course->id)->orderBy(\"indexing\")->get();\n foreach($chapters as $chapter){\n $chapter->lectures= Lecture::where('chapter', $chapter->id)->orderBy(\"indexing\")->get();\n \n }\n \n $related_courses=Course::where(\"coursecategory_id\",$course->coursecategory_id)->where('id','!=',$id)->get();\n\t\t//dd($related_courses);\n\t\tif($user){\n $enrolledCourse = Coursesenrolled::where(['student'=>$user->id,\"course\"=>$id])->get();\n\t\t return view('course.show',compact(\"course\", \"chapters\", \"title\" , \"user\",\"enrolledCourse\",\"related_courses\"));\n\t\t}else{\n\t\t\t\t return view('course.show',compact(\"course\", \"chapters\", \"title\" , \"user\",\"related_courses\"));\n\n\t\t}\t\n \n }", "public function show(Course $course)\n {\n if (Auth::check()) {\n $user = Auth::user();\n $text = UserCourse::where('user_id' , '=', $user->id)->where('course_id', '=', $course->id)->get()->first();\n $enroll = (isset($text))?$text->course_enrolled:'';\n $comp = UserCourse::where('user_id', '=', $user->id)->where('course_id', '=', $course->id)->get()->first();\n $complete = (isset($comp) && $comp->course_completed == 1)?$comp->course_completed:false;\n } else {\n $enroll = false;\n $complete = false;\n }\n $author = User::find($course->user_id);\n return view('courses.singlecourse', compact('course', 'author', 'enroll', 'complete'));\n }", "public function show($id)\n {\n // $courses = course::where('category_id',$id)->orwhere('subcategory_id',$id)->orwhere('subsubcategory_id',$id)->get();\n // $cat = category::whereNull('parent_id')->get();\n // return view('user.courses',compact('courses','cat'));\n \n\n }", "public function show(Course $id)\n {\n $isBiz = (Auth::check() ? Auth::user()->business : 0);\n if (!$isBiz) {\n $course = $id;\n $course->paths = (json_decode($course->paths, true) ? json_decode($course->paths, true) : []);\n $owned = (Auth::check() ? count(Auth::user()->courses()->where('course_id', $course->id)->get()) : 0);\n return view('courses.show', compact('course', 'owned'));\n } else {\n return back();\n }\n }", "public function show($id)\n {\n return redirect('courses');\n }", "public function index()\n {\n return view('admin.major_admin.course')->with(['url'=>'course']);\n }", "public function show($id)\n {\n $course = Course::with('Clients','Groups','Groups.Clients')->find($id);\n return view('admin.course.show',['title'=>trans('admin.show'),'course'=>$course]);\n }", "public function show(Course $course)\n {\n \n\n //prepare for AjaxCall \n if(request()->wantsJson()){\n\n return $course ; \n }\n\n return view('admin.courses.show' , compact('course'));\n\n }" ]
[ "0.7340351", "0.72635746", "0.71503156", "0.71493393", "0.7149166", "0.7149166", "0.7149166", "0.7149166", "0.7149166", "0.7066272", "0.70465404", "0.697678", "0.68943393", "0.687562", "0.68327224", "0.67922217", "0.67390174", "0.67070353", "0.6682967", "0.66730595", "0.66688955", "0.6623025", "0.66041934", "0.6603142", "0.6584608", "0.65775704", "0.6575574", "0.6537506", "0.6534918", "0.65238583" ]
0.74524736
0
/ Show Faculty by Slug Get
public function ShowFaculty($slug) { $setting = DB::table('mf_settings')->whereIn('id', array(5, 6, 7))->get(); $faculty = Faculties::where('slug',$slug)->first(); if($faculty) { if($faculty->title) { @$setting[0]->value = $faculty->title; } if($faculty->meta_keyword) { @$setting[1]->value = $faculty->meta_keyword; } if($faculty->meta_description) { @$setting[2]->value = $faculty->meta_description; } $college = Colleges::where('id',$faculty->college_id)->first(); $page_image = ''; $page_url = url('/'.$faculty->slug); $site_logo = config('site.logo'); if($faculty->bannerimage && File::exists(public_path('uploads/'.$faculty->bannerimage)) ){ $page_image = url('/uploads/'.$faculty->bannerimage); }elseif ($college->bannerimage && File::exists(public_path('uploads/'.$college->bannerimage)) ){ $page_image = url('/uploads/'.$college->bannerimage); }elseif ($site_logo && File::exists(public_path('uploads/'.$site_logo)) ){ $page_image = url('/uploads/'.$site_logo); } return view('frontend.faculty_details', compact('faculty','college','setting','page_url','page_image')); } else { return redirect('404'); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function faculty()\n {\n $viewName = 'Faculty'; // new changes for seo adding variable bladefile\n $page_info = Page::where('name', $viewName)->first(); // new changes for seo\n if ($page_info == null) { // Create New Information\n $page_info = new Page(['name' => $viewName]);\n $page_info->save();\n }\n\n $faculties = \\App\\Faculty::sorted()->get();\n return view($viewName, [\n 'name' => 'faculty',\n 'showPagesHero' => 1,\n 'pageName' => 'FACULTY',\n 'imageName' => 'header-adm.jpg',\n 'faculties' => $faculties,\n 'page'=>$page_info, // changes for seo\n ]);\n }", "public function show(facultyMembers $facultyMember)\n {\n\n }", "function getFacultyName($FacultyID){\n\tglobal $conn;\n\t\n\t$sqlGet = sprintf(\"SELECT CONCAT(`Title`,' ',`FName`,' ',`LName`) AS `FacultyName` FROM `\".DB_PREFIX.\"faculties` WHERE `FacultyID` = '%s' AND `deletedFlag` = 0\", $FacultyID);\n\t//Execute the query\n\t$resultGet = db_query($sqlGet,DB_NAME,$conn);\n\t\n\tif(db_num_rows($resultGet)>0){\n\t\t$rowGet = db_fetch_array($resultGet);\n\t\treturn $rowGet['FacultyName'];\n\t}\n\telse{\n\t\treturn \"N/A\";\n\t}\n}", "public function show(Faculty $faculty)\n {\n $htp = Humbertheatrepage::all();\n return view('faculties.show', compact('faculty'), compact('htp'));\n }", "public static function print_faculty() {\n\n // Check the nonce. Calls die() if it fails.\n check_ajax_referer( 'ajax-nonce', 'security' );\n\n // Set the subdepartment ID and/or user ID, if applicable.\n // Probably won't ever have both set at once, but preferences subdepartment.\n $sub_dept = isset( $_POST[ 'sub_dept'] ) ? $_POST[ 'sub_dept' ] : 0;\n $user_id = isset( $_POST[ 'id' ] ) ? $_POST[ 'id' ] : 0;\n\n // Gets the relevant staff query result.\n $result = self::get_NSCM_staff( DEPT, intval( $sub_dept ), intval( $user_id ) );\n\n // If we've defined a subdepartment, we'll go get that.\n if( intval( $sub_dept ) !== 0 )\n echo self::print_staff( $result, TRUE );\n\n // Or, if we've defined a user, we'll get them instead.\n else if( intval( $user_id ) !== 0 )\n echo self::staff_detail( $result );\n\n // Barring that, we'll get e'er'body.\n else\n echo self::print_staff( $result );\n\n // Important to remind the script to die at the end, for security's sake.\n die();\n }", "public function show($slug)\n {\n return School::whereSlug($slug)->get()->first();\n }", "public function index()\n {\n $faculties = Faculty::all();\n return view('admin.pages.faculties.faculty',['faculties'=>$faculties]);\n }", "public function index()\n {\n $faculties = Faculty::all();\n return view('viewFaculty', compact('faculties'));\n }", "public function show(Faculty $faculty)\n {\n $faculties = Faculty::find($faculty->id);\n\n $books = Book::all();\n\n $users = User::all();\n\n $categories = Category::all();\n\n return view('faculties.show', ['faculties' => $faculties, 'books' => $books, 'users' => $users, 'categories' => $categories]);\n }", "public function index()\n {\n $faculties = Faculty::all();\n //dd($faculties);\n //dump($faculties);\n return view('admin.faculty.list',compact('faculties'));\n //return view('admin.faculty.list', compact('facultyList'));\n }", "public function facultyCandidateDetails($faculty){\n\t$query=$this->db->query(\"SELECT * FROM candidates INNER JOIN students ON candidates.student_number=students.student_number WHERE students.faculty='$faculty' AND candidates.position NOT LIKE '%Guild President%'\");\n\treturn $query->result();\n}", "public function show($id)\n\t{\n\t\t$facility = Facility::findOrFail($id);\n\n\t\treturn $this->theme->scope('facilities.show', $facility)->render();\n\t}", "public function index() \n { \n $faculties = Faculty::all();\n $htp = Humbertheatrepage::all();\n return view('faculties.index', compact('faculties'), compact('htp'));\n }", "public function index()\n {\n $faculties = Faculty::paginate(10);\n return view('admin.faculties.index', compact('faculties'));\n }", "public function view_faculty()\n {\n $this->load->model('Capitalinfo_model');\n $data[\"faculty\"] = $this->Capitalinfo_model->all_faculty();\n $this->load->view('admin/header'); \n $this->load->view('admin/view_faculty',$data);\n $this->load->view('admin/footer');\n \n }", "public function faculty()\n {\n return $this->belongsTo(Faculty::class, 'faculty_id', 'id');\n }", "public function index($faculty_id, $classroom_id)\n {\n $cur_classroom = ClassRoom::findOrFail($classroom_id);\n $user_sec = User::where('id', $cur_classroom->uid_secretary)->first();\n $user_de1 = User::where('id', $cur_classroom->uid_deputysecre1)->first();\n $user_de2 = User::where('id', $cur_classroom->uid_deputysecre2)->first();\n\n //get list of students & paginate\n $students = Student::where('class_room_id', $classroom_id)->paginate(20);\n\n //get current student if exists\n $cur_student = Student::where('user_id', Auth::user()->id)->first();\n if($cur_student == null){\n return view('students.index', ['cur_classroom' => $cur_classroom, 'students' => $students,\n 'user_sec' => $user_sec, 'user_de1' => $user_de1, 'user_de2' => $user_de2,\n ]);\n }else{\n return view('students.index', ['cur_classroom' => $cur_classroom, 'students' => $students,\n 'user_sec' => $user_sec, 'user_de1' => $user_de1, 'user_de2' => $user_de2,\n 'cur_student' => $cur_student\n ]);\n }\n }", "public function ShowCollege($slug)\n\t{\n\t\t$setting = DB::table('mf_settings')->whereIn('id', array(5, 6, 7))->get();\n\n\t\t$college = Colleges::where('slug',$slug)->first();\n\t\tif($college)\n\t\t{\n\t\t\tif($college->college_name)\n\t\t\t{\n\t\t\t\t// @$setting[0]->value = $page[0]->meta_title;\n\t\t\t\t@$setting[0]->value = $college->college_name;\n\t\t\t}\n\t\t\tif($college->meta_keyword)\n\t\t\t{\n\t\t\t\t@$setting[1]->value = $college->meta_keyword;\n\t\t\t}\n\t\t\tif($college->meta_description)\n\t\t\t{\n\t\t\t\t@$setting[2]->value = $college->meta_description;\n\t\t\t}\n\n\t\t\t$page_image = '';\n\t\t\t$page_url = url('/college/'.$college->slug);\n\t\t\t$site_logo = config('site.logo');\n\t\t\tif($college->bannerimage && File::exists(public_path('uploads/'.$college->bannerimage)) ){\n\t\t\t\t$page_image = url('/uploads/'.$college->bannerimage);\n\t\t\t}elseif ($college->logo && File::exists(public_path('uploads/'.$college->logo)) ){\n\t\t\t\t$page_image = url('/uploads/'.$college->logo);\n\t\t\t}elseif ($site_logo && File::exists(public_path('uploads/'.$site_logo)) ){\n\t\t\t\t$page_image = url('/uploads/'.$site_logo);\n\t\t\t}\n\t\t\t\n\t\t\treturn view('frontend.college_details', compact('college','setting','page_url','page_image'));\n\t\t\t\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn redirect('404');\n\t\t}\n\t}", "public function show($slug)\n {\n $user = Userparking::where('slug','=',$slug)->firstOrFail(); \n return view('users.show', compact('user'));\n }", "public function show($slug)\n {\n $doctor=doctor::where('slug_en','like',$slug)->orWhere('slug_ar','like',$slug)->first();\n\n return view('doctor',compact('doctor'));\n }", "public function show(TeachingStaff $teachingStaff)\n {\n //\n }", "public function faculties() {\r\n return $this->belongsTo('App\\Faculty', 'fac_id');\r\n }", "public function show(University $university)\n {\n //\n }", "public function show(University $university)\n {\n //\n }", "public function showProfile()\n\t{\n\t\treturn View::make('university.profile')->with(\n\t\t\tarray(\n\t\t\t\t'university' => University::find(Auth::id()),\n\t\t\t)\n\t\t);\n\t}", "public function show($idKelas)\n {\n //\n \n // $courses = Teacher::find(Auth::user()->teachers[0]->id)->courses;\n $class = Schoolclass::find($idKelas);\n $courses = Schoolclass::findOrFail($idKelas)->courses;\n return view('teacher.courses.course-list', compact('courses', 'class', 'idKelas'));\n }", "public function show(Staff $staff)\n {\n //\n }", "public function show(Staff $staff)\n {\n //\n }", "public function show(Staff $staff)\n {\n //\n }", "public function faculties() {\r\n return $this->hasMany('App\\Faculty', 'uni_id');\r\n }" ]
[ "0.65238684", "0.63708216", "0.6357341", "0.63034755", "0.6220867", "0.62180805", "0.6211666", "0.611452", "0.6099685", "0.608873", "0.6055233", "0.6025607", "0.600705", "0.5959462", "0.59527194", "0.5946015", "0.593908", "0.5896847", "0.58934546", "0.58914244", "0.58728385", "0.58568746", "0.58475596", "0.58475596", "0.5847253", "0.57816446", "0.5754877", "0.5754877", "0.5754877", "0.5753463" ]
0.75800896
0
/ Show News by Slug Get
public function ShowNews($slug) { $setting = DB::table('mf_settings')->whereIn('id', array(5, 6, 7))->get(); $news = News::where('slug',$slug)->first(); if($news) { if($news->title) { @$setting[0]->value = $news->title; } if($news->meta_keyword) { @$setting[1]->value = $news->meta_keyword; } if($news->meta_description) { @$setting[2]->value = $news->meta_description; } $college = Colleges::where('id',$news->college_id)->first(); $page_image = ''; $page_url = url('/'.$news->slug); $site_logo = config('site.logo'); if($news->bannerimage && File::exists(public_path('uploads/'.$news->bannerimage)) ){ $page_image = url('/uploads/'.$news->bannerimage); }elseif ($college->bannerimage && File::exists(public_path('uploads/'.$college->bannerimage)) ){ $page_image = url('/uploads/'.$college->bannerimage); }elseif ($site_logo && File::exists(public_path('uploads/'.$site_logo)) ){ $page_image = url('/uploads/'.$site_logo); } return view('frontend.news_details', compact('news','college','setting','page_url','page_image')); } else { return redirect('404'); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function show($slug)\n {\n $news = Info::where('slug', $slug)->firstOrFail();\n //$posts = InfoPost::where('info_id', $news->id)->get();\n\n $results= InfoPost::with(['getComments'])->where('info_id',$news->id);\n $posts = $results->get();\n\n $author = User::find($news->user_id);\n $author = $author->username;\n\n\n return View('news.main')\n ->with('news', $news)\n ->with('posts', $posts)\n ->with('author', $author);\n }", "public function show($slug)\n {\n $news = News::findBySlug($slug);\n $like = Likeable::where('user_id', Auth::user()->id)->first();\n\n return view('news.showNews', compact('news', 'like'));\n }", "public function show($slug)\n {\n $news = News::where('slug',$slug)->firstOrFail();\n $publish = Carbon::parse($news->published_at)->format('d M Y');\n return view('FrontEnd.blog.show')->with([\n 'news' => $news,\n 'publish'=>$publish\n ]);\n }", "public function show($slug)\n {\n\n }", "public function show($slug)\n {\n\n }", "public function show(News $news)\n {\n //\n }", "public function show(News $news)\n {\n //\n }", "public function show(News $news)\n {\n //\n }", "public function show(News $news)\n {\n //\n }", "public function show($slug)\n {\n $post = Post::where('slug', '=', $slug)->first();\n $upcomingservices = Service::where('starttime', '>=', Carbon::now())->oldest('starttime')->limit(5)->get();\n $nextservice = Service::where('endtime', '>=', Carbon::now())->oldest('endtime')->first();\n\n return view('news.show', compact(['post', 'upcomingservices', 'nextservice']));\n }", "public function show($slug)\n {\n //\n }", "public function show($slug)\n\t{\n\t\t$inputNew = AdminNew::findBySlug($slug);\n\t\t$inputRelated = AdminNew::where('type_new_id', $inputNew->type_new_id)\n\t\t\t\t\t\t\t\t->whereNotIn('id', [$inputNew->id])\n\t\t\t\t\t\t\t\t->where('start_date', '<=', Carbon\\Carbon::now())\n\t\t\t\t\t\t\t\t->orderBy('id', 'desc')\n\t\t\t\t\t\t\t\t->limit(PAGINATE_RELATED)\n\t\t\t\t\t\t\t\t->get();\n\t\treturn View::make('site.news.showNews')->with(compact('inputNew', 'inputRelated'));\n\t}", "public function showNews()\n {\n $request = $this->request;\n $optimus = $this->optimus;\n $user = Auth::user();\n $masjid = Masjid::where('user_id', $user->id)->first();\n\n $id = $optimus->decode($request->input('id'));\n $news = News::findOrFail($id);\n\n return $news;\n // $news = $masjid->news()->paginate(10);\n // dd($news);\n // return view('pages.news', compact([\n // 'masjid',\n // 'news',\n // ]));\n }", "public function show($slug) {\n $newsRE = $this->newsRealEstale->getBySlug($slug);\n $photos = $newsRE->getPhotos()->select('path')->get();\n $catNews = $newsRE->getCategoryRealestale;\n $dateNow = date_format(Carbon::now(), \"Y-m-d\");\n $listPublished = $this->newsRealEstale->published();\n\n // Tag\n $tagNewsRE = $newsRE->getTagNewsRealEstales;\n \n foreach ($tagNewsRE as $tn) {\n $tagRE = $tn->getTagRealEstale;\n if ($tagRE->tag_parent_id == 0) {\n $tagREParent = $tagRE;\n $tagREChild = $tagRE->getTagChild;\n } else if ($tagRE->tag_parent_id > 0) {\n $tagREParent = TagRealEstale::where('id', $tagRE->tag_parent_id)->first();\n $tagREChild = $tagREParent->getTagChild;\n }\n }\n\n if ($newsRE == null) {\n return Response::view('errors.missing', [], 404);\n }\n\n return view('frontend.news_real_estale.show', compact('newsRE', 'dateNow', 'photos', 'catNews', 'listPublished', 'tagREParent', 'tagREChild'));\n }", "public function getDetail($slug)\n {\n $detail = Post::where('slug',$slug)->get()->first();\n $tags = Tag::all();\n return view('news.detail',compact('detail','tags'));\n }", "public function newsPublicSingle($slug)\n {\n $news = \\App\\News::where('slug', $slug)->firstOrFail();\n\n $viewName = 'NewsPublicSingle'; // new changes for seo adding variable bladefile\n $page_info = Page::where('name', $viewName)->first(); // new changes for seo\n if ($page_info == null) { // Create New Information\n $page_info = new Page(['name' => $viewName]);\n $page_info->save();\n }\n return view($viewName, [\n 'name' => 'newsSingle',\n 'showPagesHero' => 0,\n 'news' => $news,\n ]);\n }", "public function show($slug)\n {\n try {\n $data = [\n 'slug' => $slug,\n 'status' => NewsStatus::StatusPublished,\n ];\n\n $news = $this->newsRepo->findByAttributesGetOne($data);\n\n $category = $news->category;\n\n $uriCategory = [];\n\n while ($category->parent != null) {\n array_push($uriCategory, $category->parent);\n $category = $category->parent;\n }\n\n return view('newsdetail', compact('news', 'uriCategory'));\n } catch (ModelNotFoundException $exception) {\n return redirect()->route('home');\n }\n }", "public function view($slug = NULL) {\n $data['news_item'] = $this->news_model->get_news($slug);\t\t\n\t\tif (empty($data['news_item'])) {\n show_404();\n }\n $data['news_title'] = $data['news_item']['news_title'];\n\n $this->load->view('templates/header', $data);\n $this->load->view('news/view', $data);\n $this->load->view('templates/footer');\n }", "public function show($date,$slug)\n { \n $newsletter = Newsletter::where('active',1)\n ->where('deleted',0)\n ->where('slug',$slug)\n ->get();\n \n $recent = Newsletter::where('newsletter_id','!=',$newsletter[0]->newsletter_id)\n ->where('active',1)\n ->where('deleted',0)\n ->orderBy('created_date','DESC')\n ->get()\n ->take(8);\n \n return view('pages.newsletter.fullarticle',['newsletter' => $newsletter[0], 'recent' => $recent]);\n }", "public function show($news_id)\n {\n $obj = News::find($news_id);\n //load view\n }", "public function show($title){\n try{\n $news = News::get()->where('seo_title',$title);\n return view('user.news.show',compact('news'));\n }\n catch(\\Exception $exception){\n return view('errors.error', compact('exception'));\n }\n }", "public function getView($slug)\r\n\t{\r\n\t\t// Get this news post data\r\n\t\t$this->data['page'] = $page = Post::where('slug', $slug)->first();\r\n\r\n\t\t$media = null;\r\n\t\tswitch ($page->post_type) {\r\n\t\t\tcase 'intro':\r\n\t\t\t\t//$this->data['pages'] = $pages = Post::where('post_type', 'intro')->get();\r\n\t\t\t\t$post_type = 'intro';\r\n\t\t\t\t$this->data['page_slug'] = 'gioi-thieu';\r\n\t\t\t\t$this->data['page_group'] = 'Giới thiệu';\r\n\t\t\t\tbreak;\r\n\t\t\tcase 'service':\r\n\t\t\t\t//$this->data['pages'] = $pages = Post::where('post_type', 'service')->get();\r\n\t\t\t\t$post_type = 'service';\r\n\t\t\t\t$this->data['page_slug'] = 'dich-vu';\r\n\t\t\t\t$this->data['page_group'] = 'Dịch vụ';\r\n\t\t\t\tbreak;\r\n\t\t\tdefault:\r\n\t\t\t\t//$this->data['pages'] = $pages = Post::where('post_type', 'page')->get();\r\n\t\t\t\t$post_type = 'page';\r\n\t\t\t\t$this->data['page_slug'] = 'page';\r\n\t\t\t\t$this->data['page_group'] = 'Thông tin';\r\n\t\t}\r\n\r\n\t\t// Get all the news posts\r\n\t\t$this->data['pages'] = Post::select('posts.*', 'medias.mpath', 'medias.mname')\r\n\t\t\t->leftJoin('medias', 'medias.id', '=', 'posts.media_id')\r\n\t\t\t->where('status', 'published')\r\n\t\t\t->where('post_type', $post_type)\r\n\t\t\t->orderBy('publish_date', 'ASC')->get();\r\n\r\n\r\n\t\t$media = null;\r\n\t\tif($page->media_id) {\r\n\t\t\t$this->data['media'] = $media = Media::find($page->media_id);\r\n\t\t} else {\r\n\t\t\t$this->data['media'] = '';\r\n\t\t}\r\n\r\n\t\t// Check if the news post exists\r\n\t\tif (is_null($page))\r\n\t\t{\r\n\t\t\t// If we ended up in here, it means that a page or a news post\r\n\t\t\t// don't exist. So, this means that it is time for 404 error page.\r\n\t\t\treturn App::abort(404);\r\n\t\t}\r\n\r\n\t\t// Show the page\r\n\t\treturn View::make('frontend/pages/view-page', $this->data);\r\n\t}", "public function getNews($slug = false)\n // Query Builder also sanitizes input variables ($slug)\n {\n // getall() from news if no slug provided\n if ($slug === false)\n {\n return $this->findAll();\n }\n\n // get first() where $slug\n return $this->asArray()\n ->where(['slug' => $slug])\n ->first();\n }", "public function view($slug = NULL)\n {\n $data['news_item'] = $this->news_model->get_news($slug);\n\n if (empty($data['news_item'])) {\n show_404();\n }\n\n $data['title'] = $data['news_item']['title'];\n\n $this->load->view('templates/header', $data);\n $this->load->view('news/view', $data);\n $this->load->view('templates/footer');\n }", "public function show( $slug ) {\n\t\t$blog = Blog::where( 'slug', $slug )->first();\n\t\t$blogCategories = BlogCategory::all();\n\t\t$blogsLatest = Blog::orderBy( 'id', 'DESC' )->get()->take( 5 );\n\t\t$tags = Tag::all()->take( 5 );\n\n\n\t\tSEOMeta::setTitle( $blog->title );\n\t\tSEOMeta::setDescription( $blog->meta );\n\t\tSEOMeta::addMeta( 'article:published_time', $blog->updated_at->toW3CString(), 'property' );\n\t\tSEOMeta::addMeta( 'article:section', $blog->category->title, 'property' );\n\t\t$keywords = explode( ',', $blog->keywords );\n\t\tSEOMeta::addKeyword( $keywords );\n\n\t\tOpenGraph::setDescription( $blog->meta );\n\t\tOpenGraph::setTitle( $blog->title );\n\t\tOpenGraph::setUrl( route( 'news.show', $blog->slug ) );\n\t\tOpenGraph::addProperty( 'type', 'article' );\n\t\tOpenGraph::addProperty( 'locale:alternate', [ 'pt-pt', 'fa-ir' ] );\n\n\t\tOpenGraph::addImage( asset( $blog->image ), [ 'height' => 300, 'width' => 300 ] );\n\n\t\tJsonLd::setTitle( $blog->title );\n\t\tJsonLd::setDescription( $blog->meta );\n\t\tJsonLd::setType( 'Article' );\n\t\tJsonLd::addImage( asset( $blog->image ) );\n\n\n\t\treturn view( 'blog.single', compact( 'blog', 'blogCategories', 'tags', 'blogsLatest' ) );\n\t}", "public function getNewsSingle($title, $id)\n {\n $service_categories_footer = ServiceCategory::all();\n $industries_footer = Industry::whereNull('deleted_at')->orderBy('title', 'desc')->get();\n $services_arr = [];\n foreach ($service_categories_footer as $service) {\n $services_arr[$service->id] = Service::where('category_id', $service->id)->orderBy('id', 'desc')->get();\n }\n $slider_link = 0;\n //INCLUDE IN ALL - END\n\n $article = News::where('id', $id)->first();\n\n return view('public.news.single', ['article' => $article, 'service_categories_footer' => $service_categories_footer, 'industries_footer' => $industries_footer, 'services_arr' => $services_arr, 'slider_link' => $slider_link]);\n }", "function view_by_name () {\n\t\tif (empty($_GET[\"id\"])) {\n\t\t\treturn _e(\"Missing article name\");\n\t\t}\n\t\t// Get article info\n\t\t$article_info = db()->query_fetch(\"SELECT * FROM \".db('articles_texts').\" WHERE short_url='\"._es($_GET[\"id\"]).\"'\");\n\t\tif (empty($article_info)) {\n\t\t\treturn _e(\"No such article!\");\n\t\t}\n\t\t// Re-map id\n\t\t$_GET[\"id\"] = $article_info[\"id\"];\n\t\t// Display article\n\t\treturn $this->view($article_info);\n\t}", "public function show($id, $slug) { \n // ===== Set Blog read Counts ==================================================== //\n $stmt = 'UPDATE blog SET blog_read = blog_read + 1 WHERE blog_id = :id'; \n $sth = $this->db->prepare($stmt); \n $sth->execute(array(':id' => $id)); \n\n // ===== Show One Blog Post By Blog_id============================================= // \n $sql = 'SELECT '.TBLOG.' blog_id = :id'; \n $query = $this->db->prepare($sql);\n $query->execute(array(':id' => $id));\n\n return $query->fetch();\n }", "public function show($id)\n {\n $news = $this->news->getById($id);\n return $news;\n }", "public function show(NewsItem $slug): View\n {\n $pieceOfNews = $this->news_item_service->load($slug);\n\n $similar = $this->news_item_service->getSimilar($pieceOfNews);\n\n return view('web.news.show', compact('pieceOfNews', 'similar'));\n }" ]
[ "0.7196421", "0.7101889", "0.7090605", "0.70603144", "0.70603144", "0.70292073", "0.70292073", "0.70292073", "0.70292073", "0.70283973", "0.7023883", "0.69755673", "0.69605726", "0.684696", "0.684086", "0.6836728", "0.68206966", "0.6792993", "0.676728", "0.67645764", "0.6751059", "0.67390364", "0.6690128", "0.66501284", "0.65712404", "0.65562105", "0.6545698", "0.6528483", "0.6502712", "0.6494188" ]
0.73032624
0
Gets a localized description of the permission, or a generic message if the permission is unknown.
public function get_permission_description() { switch($this->channel_perm) { case 0: return t('Only me'); case PERMS_PUBLIC: return t('Public'); case PERMS_NETWORK: return t('Anybody in the $Projectname network'); case PERMS_SITE: return sprintf(t('Any account on %s'), \App::get_hostname()); case PERMS_CONTACTS: return t('Any of my connections'); case PERMS_SPECIFIC: return t('Only connections I specifically allow'); case PERMS_AUTHED: return t('Anybody authenticated (could include visitors from other networks)'); case PERMS_PENDING: return t('Any connections including those who haven\'t yet been approved'); default: return $this->fallback_description; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function message()\n {\n return 'Permission doesn\\'t exists';\n }", "public static function getErrorMsgPermission()\n {\n return __('Sorry! You have not been granted access to this page.');\n }", "public function get_permission_origin_description() {\n\n\t\tswitch($this->global_perm) {\n\t\t\tcase PERMS_R_STREAM: return t('This is your default setting for the audience of your normal stream, and posts.');\n\t\t\tcase PERMS_R_PROFILE: return t('This is your default setting for who can view your default channel profile');\n\t\t\tcase PERMS_R_ABOOK: return t('This is your default setting for who can view your connections');\n\t\t\tcase PERMS_R_STORAGE: return t('This is your default setting for who can view your file storage and photos');\n\t\t\tcase PERMS_R_PAGES: return t('This is your default setting for the audience of your webpages');\n\t\t\tdefault: return '';\n\t\t}\n\t}", "public function getDescription(): string\n {\n return $this->message;\n }", "public function permissionMessage($action = null)\n {\n foreach ($this->acosInfo as $label => $infos) {\n if (!in_array($action, $infos['actions'])) continue;\n\n return $infos['notAllowedMessage'];\n }\n\n return 'Você não possui permissão para acessar essa página';\n }", "protected function getPermissionDeniedMessage()\n {\n return trans()->has('passwords.missing_token')\n ? trans()->get('passwords.missing_token')\n : 'Invalid request for reset token';\n }", "public static function getStr($permission)\n {\n switch ($permission) {\n case 0:\n return 'Editor';\n break;\n case 1:\n return 'Administrator';\n break;\n case 2:\n return 'Super-Administrator';\n break;\n default:\n return null;\n }\n }", "function getDescription() {\n\t\tif ( $this->isUserPrivileged() ) {\n\t\t\treturn $this->msg( 'removeavatar' )->plain();\n\t\t} else {\n\t\t\treturn $this->msg( 'removeavatar-remove-my-avatar' )->plain();\n\t\t}\n\t}", "function hook_project_permission_info() {\n return array(\n 'some permission name' => array(\n 'title' => t('Name of this permission'),\n 'description' => t('Description of what this this permission allows project maintainers to do.'),\n ),\n );\n}", "public function __toString()\r\n {\r\n return \"\" . $this->getCodpermission() . \"\";\r\n }", "public function getDescription()\n {\n $value = $this->get(self::description);\n return $value === null ? (string)$value : $value;\n }", "public function message()\n {\n return 'Access denied';\n }", "public function message()\n {\n return trans('validation.not_allow_level_role');\n }", "public static function fromGlobalPermission($permname) {\n\n\t\t$result = null;\n\n\t\t$global_perms = \\Zotlabs\\Access\\Permissions::Perms();\n\n\t\tif(array_key_exists($permname, $global_perms)) {\n\n\t\t\t$channelPerm = \\Zotlabs\\Access\\PermissionLimits::Get(\\App::$channel['channel_id'], $permname);\n\n\t\t\t$result = new PermissionDescription('', $channelPerm);\n\t\t} else {\n\t\t\t// The acl dialog can handle null arguments, but it shouldn't happen\n\t\t\tlogger('null PermissionDescription from unknown global permission: ' . $permname, LOGGER_DEBUG, LOG_ERR);\n\t\t}\n\n\t\treturn $result;\n\t}", "public function GetPermission ($permissionName);", "public function getDescription() {\n $message = null;\n $action = $this->getAction();\n $state = $this->getStatus() == 0 ? true : false;\n\n switch ($action) {\n case 'order':\n if ($state) {\n $message = __('Deine Bestellung vom %s.', date('d.m.Y', $this->getCreated()));\n } else {\n $message = __('Deine Bestellung vom %s wurde storniert.', date('d.m.Y', $this->getCreated()));\n }\n break;\n case 'accountimage':\n if ($state) {\n $message = __('Du hast Dein Profilbild hochgeladen.');\n } else {\n if(!is_null($this->getUpdated()) && $this->getUpdated() > 0){\n $message = __('Du hast am %s Dein Profilbild entfernt.', date('d.m.Y', $this->getUpdated()));\n }else{\n $message = __('Du hast Dein Profilbild entfernt.');\n }\n }\n break;\n case 'manual':\n $message = __('Die Punkte wurden manuell am %s ergänzt.', date('d.m.Y', $this->getCreated()));\n break;\n case 'rate_high':\n case 'rate_low':\n if ($state) {\n if (!is_null($this->getOrder())) {\n $message = __('Du hast Deine Bestellung vom %s am %s bewertet.', date('d.m.Y', $this->getOrder()->getTime()),date('d.m.Y', $this->getCreated()));\n } else {\n $message = __('Für Deine Bewertung am %s', date('d.m.Y', $this->getCreated()));\n }\n } else {\n $updated = $this->getUpdated();\n if(is_null($updated) || $updated <= 0){\n $message = __('Deine Bewertung vom %s wurde offline gestellt.', date('d.m.Y', $this->getCreated()));\n }else{\n $message = __('Deine Bewertung vom %s wurde am %s offline gestellt.', date('d.m.Y', $this->getCreated()), date('d.m.Y', $updated));\n }\n }\n break;\n case 'register':\n case 'registeraftersale':\n if ($state) {\n $message = __('Du hast Dich am %s registriert.', date('d.m.Y', $this->getCreated()));\n } else {\n $message = __('Die Punkte für Deine Registrierung wurden am %s entfernt', date('d.m.Y', $this->getCreated()));\n }\n break;\n case 'usage':\n if ($state) {\n $message = __('Du hast Deine Punkte am %s eingelöst.', date('d.m.Y', $this->getCreated()));\n } else {\n if(!is_null($this->getUpdated()) && $this->getUpdated() > 0){\n $message = __('Die Einlösung deiner Punkte wurde am %s storniert.', date('d.m.Y', $this->getUpdated()));\n }else{\n $message = __('Die Einlösung deiner Punkte wurde storniert.');\n }\n }\n break;\n default:\n break;\n }\n\n $message .= ' ' . __('Punktestand vorher: %d', $this->getPointsUntil());\n return $message;\n }", "public function getDescription()\n {\n return $this->get(self::DESCRIPTION);\n }", "public function getMessage()\n {\n return Helper::getMessage($this->getCode(), $this->getValidLanguage());\n }", "public function getDescription(): string {\n\t\t$description = $this->metadata_description;\n\t\tif (empty($description) && elgg_language_key_exists(\"profile:types:{$this->metadata_name}:description\")) {\n\t\t\t$description = elgg_echo(\"profile:types:{$this->metadata_name}:description\");\n\t\t}\n\t\t\n\t\treturn (string) $description;\n\t}", "public static function getDescription();", "public static function getDescription();", "public static function getDescription();", "public function getPermission() {\n $this->group();\n\n if ($this->_editPermission) {\n return CRM_Core_Permission::EDIT;\n }\n elseif ($this->_viewPermission) {\n return CRM_Core_Permission::VIEW;\n }\n return NULL;\n }", "public function message(): string\n {\n return trans('validation.can_be_author');\n }", "public function message()\n {\n return __('You don\\'t have access to this feature.');\n }", "public function getMessage()\n {\n return $this->get(self::MESSAGE);\n }", "final public function getDescription()\n {\n return $this::DESCRIPTION;\n }", "public final function getDescription()\r\n {\r\n return \\Core\\Application::getInstance()->translate($this->getDescription_En(), $this->getDescription_Fr(), $this->getDescription_Ch());\r\n }", "public function getPermissionName()\n {\n return Str::camel($this->name);\n }", "public static function getDescription()\n {\n return static::$description;\n }" ]
[ "0.6841358", "0.6578191", "0.63874435", "0.624389", "0.62327194", "0.6172305", "0.61274827", "0.5990985", "0.5979438", "0.5955009", "0.59006196", "0.5866769", "0.58623236", "0.5836727", "0.5833698", "0.58297205", "0.5810951", "0.57938045", "0.57529473", "0.5743456", "0.5743456", "0.5743456", "0.5682082", "0.5678216", "0.5674337", "0.5670047", "0.5657602", "0.5643397", "0.56358504", "0.56206745" ]
0.7776678
0
Returns a localized description of where the permission came from, if this is known. If it's not know, or if the permission is standalone and didn't come from a default permission setting, then empty string is returned.
public function get_permission_origin_description() { switch($this->global_perm) { case PERMS_R_STREAM: return t('This is your default setting for the audience of your normal stream, and posts.'); case PERMS_R_PROFILE: return t('This is your default setting for who can view your default channel profile'); case PERMS_R_ABOOK: return t('This is your default setting for who can view your connections'); case PERMS_R_STORAGE: return t('This is your default setting for who can view your file storage and photos'); case PERMS_R_PAGES: return t('This is your default setting for the audience of your webpages'); default: return ''; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function get_permission_description() {\n\n\t\tswitch($this->channel_perm) {\n\t\t\tcase 0: return t('Only me');\n\t\t\tcase PERMS_PUBLIC: return t('Public');\n\t\t\tcase PERMS_NETWORK: return t('Anybody in the $Projectname network');\n\t\t\tcase PERMS_SITE: return sprintf(t('Any account on %s'), \\App::get_hostname());\n\t\t\tcase PERMS_CONTACTS: return t('Any of my connections');\n\t\t\tcase PERMS_SPECIFIC: return t('Only connections I specifically allow');\n\t\t\tcase PERMS_AUTHED: return t('Anybody authenticated (could include visitors from other networks)');\n\t\t\tcase PERMS_PENDING: return t('Any connections including those who haven\\'t yet been approved');\n\t\t\tdefault: return $this->fallback_description;\n\t\t}\n\t}", "public function getPermission(): string {\n\t\treturn \"blocksniper.type.\" . str_replace(\"hollow\", \"\", str_replace(\" \", \"_\", strtolower($this->getName())));\n\t}", "public function getPermissionName()\n {\n return Str::camel($this->name);\n }", "public function message()\n {\n return 'Permission doesn\\'t exists';\n }", "public static function getStr($permission)\n {\n switch ($permission) {\n case 0:\n return 'Editor';\n break;\n case 1:\n return 'Administrator';\n break;\n case 2:\n return 'Super-Administrator';\n break;\n default:\n return null;\n }\n }", "public function __toString()\r\n {\r\n return \"\" . $this->getCodpermission() . \"\";\r\n }", "public function getPermission() {\n $this->group();\n\n if ($this->_editPermission) {\n return CRM_Core_Permission::EDIT;\n }\n elseif ($this->_viewPermission) {\n return CRM_Core_Permission::VIEW;\n }\n return NULL;\n }", "public function getName()\n {\n return Craft::t('Location');\n }", "public function get_permission_icon() {\n\n\t\tswitch($this->channel_perm) {\n\t\t\tcase 0:/* only me */ return 'fa-eye-slash';\n\t\t\tcase PERMS_PUBLIC: return 'fa-globe';\n\t\t\tcase PERMS_NETWORK: return 'fa-share-alt-square'; // fa-share-alt-square is very similiar to the hubzilla logo, but we should create our own logo class to use\n\t\t\tcase PERMS_SITE: return 'fa-sitemap';\n\t\t\tcase PERMS_CONTACTS: return 'fa-group';\n\t\t\tcase PERMS_SPECIFIC: return 'fa-list';\n\t\t\tcase PERMS_AUTHED: return '';\n\t\t\tcase PERMS_PENDING: return '';\n\t\t\tdefault: return '';\n\t\t}\n\t}", "public static function getErrorMsgPermission()\n {\n return __('Sorry! You have not been granted access to this page.');\n }", "public function getLocationHint()\n {\n return isset($this->location_hint) ? $this->location_hint : '';\n }", "public function viewDraftPermission(): string\r\n {\r\n return $this->config['viewDraftPermission'];\r\n }", "public function getInfo()\n\t{\n\t\tglobal $langs;\n\n\t\treturn $langs->trans('OnlyWindowsLOG_USER');\n\t}", "protected function getAccessLevelAsText()\n {\n if (\\XLite\\Core\\Auth::getInstance()->getAdminAccessLevel() <= $this->getModelObject()->getAccessLevel()) {\n $label = static::t('Administrator');\n\n } elseif ($this->getModelObject()->getAnonymous()) {\n $sameProfile = \\XLite\\Core\\Database::getRepo('XLite\\Model\\Profile')\n ->findUserWithSameLogin($this->getModelObject());\n if ($sameProfile) {\n $label = static::t(\n 'Anonymous Customer, _Registered User with the same email_',\n [\n 'URL' => static::buildURL('profile', '', ['profile_id' => $sameProfile->getProfileId()]),\n ]\n );\n\n } else {\n $label = static::t('Anonymous Customer');\n }\n\n } else {\n $sameProfile = \\XLite\\Core\\Database::getRepo('XLite\\Model\\Profile')->findOneBy([\n 'login' => $this->getModelObject()->getLogin(),\n 'order' => null,\n 'anonymous' => true,\n ]);\n if ($sameProfile) {\n $label = static::t(\n 'Registered Customer, _Anonymous Customer with the same email_',\n [\n 'URL' => static::buildURL('profile', '', ['profile_id' => $sameProfile->getProfileId()]),\n ]\n );\n\n } else {\n $label = static::t('Registered Customer');\n }\n }\n\n return $label;\n }", "public function getFileName()\n {\n return 'permissions';\n }", "public function message()\n {\n return 'The domain cannot be a local one.';\n }", "public function getEditPermissionName(){\n\t\treturn $this->name. '.edit';\n\t}", "public function getDisplayName() {\n if($this->getPhysicalPerson() == null) {\n return 'anonyme';\n }\n return $this->getPhysicalPerson()->getDisplayName();\n }", "public function permissionsNeeded()\n {\n return ucwords(str_replace('-',' ',$this->permissionsNeeded->implode(', ')));\n }", "public function getUsageLocation()\n {\n if (array_key_exists(\"usageLocation\", $this->_propDict)) {\n return $this->_propDict[\"usageLocation\"];\n } else {\n return null;\n }\n }", "public function getPermissions() : string\n {\n return $this->permissions;\n }", "public function getPermissionPrefixForCurrentRoute()\n {\n $moduleKey = $this->getModuleKeyForCurrentRoute();\n\n if ( ! $moduleKey) return false;\n\n return $this->getPermissionPrefixForModuleKey($moduleKey);\n }", "public function permissionNames()\r\n {\r\n return array(\r\n 0x0008 => 'membership',\r\n 0x0400 => 're',\r\n 0x0080 => 'neighborhood',\r\n 0x0020 => 'ministry',\r\n 0x0040 => 'change',\r\n 0x0200 => 'admin',\r\n );\r\n\r\n }", "protected function permission(): string\n {\n return 'edit-name';\n }", "public function getCallPlace()\n {\n if (null === $this->file) {\n return 'unknown';\n }\n\n return sprintf('%s:%d', $this->file, $this->line);\n }", "public function GetPermission ($permissionName);", "protected function getHelpLink() {\n\t\tif ( $this->isAllowed( 'aft-oversighter' ) ) {\n\t\t\t$msg = 'articlefeedbackv5-help-special-linkurl-oversighters';\n\t\t} elseif ( $this->isAllowed( 'aft-monitor' ) ) {\n\t\t\t$msg = 'articlefeedbackv5-help-special-linkurl-monitors';\n\t\t} elseif ( $this->isAllowed( 'aft-editor' ) ) {\n\t\t\t$msg = 'articlefeedbackv5-help-special-linkurl-editors';\n\t\t} else {\n\t\t\t$msg = 'articlefeedbackv5-help-special-linkurl';\n\t\t}\n\t\treturn $this->msg( $msg )->text();\n\t}", "public function getDefaultShareLinkPermission()\n {\n return $this->getProperty(\"DefaultShareLinkPermission\");\n }", "public function whoDevelopedMe()\n {\n if ($this->outreferrer->first_name == 'N/A') {\n return $this->dev_by_consultant->fullname();\n } else {\n return $this->outreferrer->fullname() . ' (O.R.)';\n }\n }", "public function getCallerDescription() \n {\n return $this->_fields['CallerDescription']['FieldValue'];\n }" ]
[ "0.71460384", "0.6385593", "0.6254319", "0.6166884", "0.6059354", "0.60011524", "0.5965822", "0.58239573", "0.57903177", "0.57803375", "0.5706228", "0.56426525", "0.5630723", "0.5624989", "0.5621647", "0.5617887", "0.56005913", "0.5570658", "0.5532999", "0.5519136", "0.54880244", "0.54647905", "0.54631776", "0.5449738", "0.54462826", "0.5443252", "0.5435078", "0.5427769", "0.54235077", "0.5420798" ]
0.75596166
0
Creates database for first login then redirects to admin panel view If user has store_control id then writes db info to session and redirects admin panel
public function index() { if(! Confide::user()->store_control_id) { $dbString = "storedb_"; // Session::put('creating_db', 1); DB::insert('insert into store_control (store_name , contact_account_id) values (?,?)', array(Confide::user()->store__name, Confide::user()->id)); $store_control_id = DB::table('store_control')->where('contact_account_id', Confide::user()->id)->pluck('store_control_id'); DB::statement('CREATE DATABASE ' . $dbString . $store_control_id); DB::table('users') ->where('id', Confide::user()->id) ->update(array('store_control_id' => $store_control_id)); Session::put('selia_db', $dbString . $store_control_id); Config::set('database.connections.mysql.database', $dbString . $store_control_id); DB::reconnect(); $apppath = app_path(); DB::unprepared(File::get($apppath.'/SQLs/importDbTables.sql')); // Session::pull('creating_db'); return Redirect::to('/dashboard'); } return Redirect::to('/dashboard'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function suppDB() {\r\n $this->model->suppDB();\r\n header('location: index.php?controller=new');\r\n }", "public function addDB() {\r\n $this->model->addDB();\r\n header('location: index.php?controller=new');\r\n }", "private function admin_login()\n {\n\n $user_id = User::create([\n 'name' => 'customer',\n 'email' => '[email protected]',\n 'contact_no' => '6291839827',\n 'password' => Hash::make('password')\n ])->id;\n\n RoleUser::create([\n 'user_id' => $user_id,\n 'role_id' => 2,\n ]);\n }", "public function store()\n {\n $dbs = $this->Database->listarDatabases();\n $total = sizeof($dbs);\n if ($total >= Session::get('dominio_usuario')->plan->numero_dbs)\n {\n Session::flash('error', 'Se alcanzó el número máximo de Bases de datos para el plan');\n return Redirect::to('admin/dbs');\n }\n $validator = $this->getDbsValidator();\n if ($validator->passes())\n {\n $username = $dbs->count() + 1;\n $dbname = $dbs->count() + 1;\n $password = Input::get('password');\n if ($this->Database->agregarDatabase($username, $password, $dbname))\n {\n Session::flash('message', 'Base de datos agregada con exito');\n return Redirect::to('admin/dbs');\n }\n else\n {\n Session::flash('error', 'Error al crear la base de datos');\n }\n }\n return Redirect::to('admin/dbs/create')->withErrors($validator)->withInput();\n }", "public function checkforDb()\n\t{\n\t\tif (!$this->db->table_exists('sds_admin'))\n\t\t{\n\t\t\t$this->load->library('encrypt');\n\t\t\t\n\t\t\t$q = \"CREATE TABLE sds_admin \n\t\t\t\t\t(\n\t\t\t\t\tid_admin INT NOT NULL AUTO_INCREMENT, \n\t\t\t\t\tPRIMARY KEY(id_admin),\n\t\t\t\t\tusername VARCHAR(255),\n\t\t\t\t\tpassword VARCHAR(255),\n\t\t\t\t\tid_account INT\n\t\t\t\t\t)\";\n\t\t\t$this->db->query($q);\n\t\t\t\n\t\t\t// Insert default admin user\n\t\t\t$password = $this->encrypt->sha1('[add_password]');\n\t\t\t$q = \"INSERT INTO sds_admin (username, password, id_account) VALUES (?, ?, ?)\";\n\t\t\t$data = array(\n\t\t\t\t\t\t'admin',\n\t\t\t\t\t\t$password,\n\t\t\t\t\t\t3,\n\t\t\t\t\t);\n\t\t\t$this->db->query($q, $data);\n\t\t}\n\t\tif (!$this->db->table_exists('sds_activity'))\n\t\t{\n\t\t\t$q = \"CREATE TABLE sds_activity \n\t\t\t\t\t(\n\t\t\t\t\tid_activity INT NOT NULL AUTO_INCREMENT, \n\t\t\t\t\tPRIMARY KEY(id_activity),\n\t\t\t\t\tname VARCHAR(255),\n\t\t\t\t\tmaxNum INT,\n\t\t\t\t\tday VARCHAR(10),\n\t\t\t\t\tyear VARCHAR(12),\n\t\t\t\t\tactive VARCHAR(10)\n\t\t\t\t\t)\";\n\t\t\t$this->db->query($q);\n\t\t}\n\t\tif (!$this->db->table_exists('sds_user'))\n\t\t{\n\t\t\t$q = \"CREATE TABLE sds_user\n\t\t\t\t\t(\n\t\t\t\t\tid_user INT NOT NULL AUTO_INCREMENT, \n\t\t\t\t\tPRIMARY KEY(id_user),\n\t\t\t\t\tusername VARCHAR(255),\n\t\t\t\t\tpassword VARCHAR(255),\n\t\t\t\t\tfName VARCHAR(150),\n\t\t\t\t\tlName VARCHAR(150),\n\t\t\t\t\tDoB VARCHAR(12),\n\t\t\t\t\tyear VARCHAR(50),\n\t\t\t\t\tform VARCHAR(20),\n\t\t\t\t\tactDay1 VARCHAR(255),\n\t\t\t\t\tactDay2 VARCHAR(255),\n\t\t\t\t\tactDay3 VARCHAR(255),\n\t\t\t\t\tactDay4 VARCHAR(255),\n\t\t\t\t\tid_account INT,\n\t\t\t\t\tcompleted INT\n\t\t\t\t\t)\";\n\t\t\t$this->db->query($q);\n\t\t}\n\t}", "function cms_add_admin($hash,$nextPage) { \nglobal $loginTBL, $pw_salt, $today;\n \n $form_vals = array_map('trim', $hash); \n $link = db_connect(); \n $form_vals = realEscape($form_vals, $link);\n \n $form_vals['password'] = sha1($pw_salt . $form_vals['password']);\n \n // see if already in the database\n $result = mysql_query(\"SELECT COUNT(*) AS count FROM $loginTBL WHERE fname='{$form_vals['fname']}' AND lname='{$form_vals['lname']}' AND pword='{$form_vals['password']}'\"); \n \n if(!$result){\n return \"System unavailable.\";\n\texit;\n }\t\n \n $row = mysql_fetch_assoc($result);\n \n if($row['count'] > 0 ) { \n return \"User already exists.\";\n\texit;\n }\t\n \n $result = mysql_query(\"INSERT INTO $loginTBL (id,in_date,fname,lname,pword,level) \n VALUES (\n\t\t\t\t\t\t NULL,\n\t\t\t\t\t\t '$today',\n\t\t\t\t\t\t '{$form_vals['fname']}',\n\t\t\t\t\t\t '{$form_vals['lname']}',\n\t\t\t\t\t\t '{$form_vals['password']}',\n\t\t\t\t\t\t '{$form_vals['level']}' \n\t\t\t\t\t\t )\"\n\t\t\t\t\t\t );\n \n if(mysql_affected_rows() <> 1 ) {\n return \"Problem creating user.\";\n\texit;\n }\t\n\t\t\t\n db_disconnect($link); \t\t\t\n \n header(\"Location: $nextPage\");\n exit;\n}", "function action_index(){\r\n\t\t$_SESSION ['admin_username'] = \"\";\r\n\t\t$_SESSION ['admin_uid'] = \"\";\r\n\t\t$_SESSION ['admin_gid'] = \"\";\r\n\t\t//$_SESSION ['user_info'] = \"\";\r\n\t\t\r\n\t\tCookie::delete('user_login');\r\n\t\t\r\n\t\t$this->request->redirect('/admin');\r\n\t\t\r\n\t}", "function createUserDB( ) { \n}", "public function store ()\n {\n $this->_update_login ();\n $this->_pre_store ();\n\n if ($this->exists ())\n {\n $this->_update ();\n }\n else\n {\n $this->_create ();\n }\n }", "public function store()\n {\n $userDB = new UserModel();\n $userName = filter_input_array(INPUT_POST);\n $userDB->addUser($userName['login'], $userName['password'], $userName['email']);\n\n Route::redirect('admin', 'user');\n }", "public function adminStore()\n {\n //\n }", "public function index(){\n\t\t\t\t/*if(IdEnSession::getSession(DEFAULT_USER_AUTHENTICATE) == true){\n $this->redirect('admin');\n } else {\n $this->vView->visualize('login');\n }*/\n /* END VALIDATION TIME SESSION USER */ \n $this->vView->visualize('login');\n\t\t\t}", "function makeadminAction(){\n $auth = Zend_Auth::getInstance();\n if($auth->hasIdentity()){\n $identity = $auth->getIdentity(); \n $user_id = $identity->id_user;\n $type = $identity->type;\n\n $admin_user = $this->getRequest()->getParam('id');\n if($type == 1){\n $user = $this->model->makeAdminUser($admin_user);\n $this->redirect('users/index');\n }\n else{\n $this->_redirect('cateogry/index');\n }\n }\n else{\n $this->_redirect('users/login');\n } \n }", "public function create()\r\n {\r\n $userInfo = $this->UserRepository->getUserInfoByUserId(Auth::user()->id);\r\n $nameOfPage = 'Add Store';\r\n\r\n return view('admin.store.add', compact(self::viewShareVarsAdminPanel));\r\n }", "public function admin_index() {\r\n if($this->Session->check('Auth.User')){\r\n\t\t if($this->Auth->user('user_type_id')==3)\t\r\n $this->redirect(array('deo' => true , 'action' => 'index'));\t\r\n\t\t} \r\n\t\t$this->layout = 'panel_layout';\r\n\t\t$this->set('title', 'Dashbord');\r\n\t\t// Call Values for the Dashboard from the session\r\n\t\t$user_id=$this->Auth->user('id'); // Login user's user id\r\n\t\t$user_type_id=$this->Auth->user('user_type_id'); // Login user's user type\r\n \r\n }", "public function guestLogin()\n {\n $user = new User_model;\n //Load userdata\n $user->loadPropertiesFromPrimaryKey('123');\n //Setup session\n $_SESSION['UserID'] = $user->getUserID();\n //Redirect to the mainpage controller\n redirect('Mainpage');\n }", "function Create()\n {\n $admin = new Administrator();\n $admin->attributes=$_POST['administrator'];\n if ($admin->save()) {\n $this->user_id=$admin->user_id;\n }\n $this->dbcount++;\n }", "public function CreateSite(){\n if(!isset($_SESSION[\"user\"])){\n header(\"location: index.php?c=auth&a=login \");\n }else{\n $data= $_POST['data'];\n $result= $this->model->CreateSite($data);\n header(\"Location: ?c=admin&a=AdminSite&msn=$result\");\n }\n }", "public function finalsession() {\n\t // if(isset()){\n\t // update the create session table in login database\n\t //get the current database\n\t $dbname = $this->db->database;\t \n\t $data_id = $this->logmodel->get_listspfic1('createsession','id','dbname',$dbname)->id;\n\t print_r($dbname); \n\t print_r($data_id);\n\t die;\n /*\t $update_data = array(\n 'fstatus' => 'final',\n 'fsetupdate' => date('y-m-d')\n );\n\t $editflag=$this->logmodel->updaterec('createsession', $update_data,'id',$data_id);\n\t if(! $editflag)\n {\n $this->logger->write_logmessage(\"update\", \"Error in updating session configuration detail \" );\n $this->logger->write_dblogmessage(\"update\", \"Error in updating session configuration detail \");\n\t\t$this->session->set_flashdata('err_message','Error in updating session configuration detail - ' );\n\t\tredirect('home');\n }\n else{\n $this->logger->write_logmessage(\"update\", \" Updating session configuration details \");\n $this->logger->write_dblogmessage(\"update\", \"Updating session configuration details \");\n\t\t$this->session->set_flashdata('success','Updating session configuration details...');\n\t\tredirect('home');\n\t }*/\n\t//}\n\tredirect('home');\n\n }", "public function create(){\n\t\t//DB connection and create user\n\t}", "public function login_check()\n\t\t{\n\t\t\t$this->session_start();\n\n\t\t\t\n\t\t\t\tif(isset($_COOKIE['admin_id'])){\n\n\t\t\t\t\t$_SESSION['admin_id'] = $_COOKIE['admin_id'];\n\n\t\t\t\t} elseif(isset($_COOKIE['user_id'])) {\n\n\t\t\t\t\t$_SESSION['user_id'] = $_COOKIE['user_id'];\n\n\t\t\t\t} \n\n\t\t}", "public function index()\n\t{\n\t\t$exists = $this->exists_database();\n\t\tif($exists == \"existe\"){\n\t\t\t\n\t\t\t$this->migrations(); // Ejecutamos las migraciones\n\t\t\t\n\t\t}\n\t\t\n\t\t// Cargamos la plantilla base\n\t\t$this->load->view('login_form');\n\t}", "function setUpDatabases(){\r\n\r\ninclude 'dbvars.php';\r\n\r\n\r\n$conn = mysql_connect($serverurl, \"root\", $rootpass);\r\n\r\n$query = \"CREATE DATABASE $dbname;\";\r\nmysql_query($query);\r\n\r\n$query = \"USE $dbname;\";\r\nmysql_query($query);\r\n\r\n$query = \"GRANT ALL ON $dbname.* TO '$adminname'@'$serverurl';\";\r\nmysql_query($query);\r\n\r\n$query = \"SET PASSWORD FOR '$adminname'@'$serverurl' = PASSWORD('$adminp');\";\r\nmysql_query($query);\r\n//these queries are taken from the orignial DATABASE script\r\n\r\n//loginSet\r\n$query = \"CREATE TABLE `loginSet` (\r\n `email` varchar(40) NOT NULL,\r\n `isApproved` int(5) NOT NULL default '0',\r\n `hash` varchar(100) NOT NULL\r\n) ENGINE=MyISAM DEFAULT CHARSET=utf8;\r\n\";\r\nmysql_query($query);\r\n\r\n$query = \"INSERT INTO `loginSet` (`email`, `isApproved`, `hash`) VALUES('[email protected]', 1, '');\";\r\nmysql_query($query);\r\n\r\n\r\n\r\n//nLogin\r\n$query = \"CREATE TABLE `nLogin` (\r\n `email` varchar(40) collate ascii_bin NOT NULL,\r\n `password` varchar(100) collate ascii_bin NOT NULL,\r\n `name` varchar(40) collate ascii_bin NOT NULL,\r\n `buid` varchar(9) collate ascii_bin NOT NULL,\r\n `isactive` tinyint(1) NOT NULL,\r\n PRIMARY KEY (`email`)\r\n) ENGINE=MyISAM DEFAULT CHARSET=ascii COLLATE=ascii_bin;\";\r\n\r\nmysql_query($query);\r\n\r\n//need to be able to change the admin password\r\n$encradminp = md5($adminp);\r\n$query = \"INSERT INTO `nLogin` (`email`, `password`, `name`, `buid`, `isactive`) VALUES('[email protected]', '$encradminp', 'admin', 'U00000000', 2);\";\r\nmysql_query($query);\r\n\r\n\r\n\r\n//webData\r\n$query = \"CREATE TABLE `webData` (\r\n `email` varchar(40) NOT NULL,\r\n `name` varchar(40) NOT NULL default 'Title. Name M. Last',\r\n `bio` varchar(1500) NOT NULL default 'Lorem ipsum dolor sit amet, consectetur adipisicing elit, ...anim id est laborum.',\r\n `phone` varchar(15) NOT NULL default '(XXX) XXX-XXXX',\r\n `fax` varchar(40) NOT NULL default '(XXX) XXX-XXXX',\r\n `office` varchar(100) NOT NULL default '#XXX Street Name, BID-RMN <br> Boston, MA 02215, USA',\r\n `jobtitle` varchar(40) NOT NULL default 'Job Title Here',\r\n `ofhours` varchar(100) NOT NULL default 'Day TT:TT - TT:TT <br> Day TT:TT - TT:TT',\r\n `isonline` tinyint(1) NOT NULL default '0',\r\n `researchsum` varchar(2000) NOT NULL default 'Lorem ipsum dolor sit amet, consectetur adipisicing elit, ...anim id est laborum.',\r\n `teaching` varchar(1000) NOT NULL,\r\n `reslink` varchar(100) NOT NULL,\r\n `awards` varchar(5) NOT NULL,\r\n `projects` varchar(5) NOT NULL,\r\n `students` varchar(5) NOT NULL,\r\n `personal` varchar(5) NOT NULL\r\n) ENGINE=MyISAM DEFAULT CHARSET=utf8;\";\r\nmysql_query($query);\r\n\r\n$query = \"INSERT INTO `webData` (`email`, `name`, `bio`, `phone`, `fax`, `office`, `jobtitle`, `ofhours`, `isonline`, `researchsum`, `teaching`, `reslink`, `awards`, `projects`, `students`, `personal`) VALUES('[email protected]', 'Title. Name M. Last', 'Lorem ipsum dolor ... est laborum.', '(XXX) XXX-XXXX', '(XXX) XXX-XXXX', '#XXX Street Name, BID-RMN <br> Boston, MA 02215, USA', 'Job Title Here', 'Day TT:TT - TT:TT <br> Day TT:TT - TT:TT', 1, 'Lorem ipsum dolor sit ...anim id est laborum.', 'CS XXX : Course Title;; - Lorem ipsum dolor ... pariatur.;CS XXX : Course Title;; - Lorem ipsum dolor ... pariatur.;', '', '', '', '', '');\";\r\nmysql_query($query);\r\n\r\n//granting access to the admin\r\n$query = \"USE $dbname;\";\r\nmysql_query($query);\r\n\r\n$query = \"GRANT ALL ON $dbname.* TO '$adminname'@'bu.edu';\";\r\nmysql_query($query);\r\n\r\n$query = \"SET PASSWORD FOR '$adminname'@'bu.edu' = PASSWORD('$adminp');\";\r\nmysql_query($query);\r\n\r\n\r\nprint(\"Quartz is all set up! If you are admin, you are ready to begin using Quartz. Simply follow the below link to the login page and log in. If you are a professor, follow the link below to the Quartz login page. On that page, there is an option to create a new account. Choose that option and follow the instructions provided.\\n\");\r\n\r\nEcho \"<html>\";\r\nEcho \"<a href=$rootpath>Go to Quartz now!</a>\";\r\nEcho \"</html>\";\r\n}", "public function connect() {\n session_set_cookie_params(0, '/', '', false);\n /* Create signon session */\n $session_name = 'PMASignonSession';\n session_name($session_name);\n\n session_start();\n $_SESSION['PMA_single_signon_user'] = $this->db_username;\n $_SESSION['PMA_single_signon_password'] = $this->db_password;\n\n include(APPPATH . '/config/database.php');\n $_SESSION['PMA_single_signon_host'] = $db['default']['hostname'];\n $_SESSION['PMA_single_signon_port'] = 3306;\n\n /* Close that session */\n session_write_close();\n header('Location: ' . $this->config->base_url() . 'phpmyadmin/index.php?' . time());\n }", "public function login()\n {\n $this->session->set($this->sessionKey, $this->adminData);\n }", "private function adminLogIn()\n {\n $this->user = factory(Efed\\Models\\Wrestler::class)->create(['admin' => 1]);\n Auth::loginUsingId($this->user->id);\n }", "function index()\n\t{\n\t\t$this->session->set_userdata('idAdmin' , '');\n\t\t$this->session->set_userdata('idCareer', '');\n\t\t$this->session->set_userdata('userName', '');\n\t\t$this->call_login(\"Login\", \"\");\n\t}", "function databaseSetup()\n\t{\n\t\t$this->checkPreviousStepIsValid( __FUNCTION__ );\n\n\t\t// case the user hits the back button\n\t\t$this->session->skipThisStep = array(\n\t\t\t'firstWebsiteSetup' => false,\n\t\t\t'displayJavascriptCode' => false,\n\t\t);\n\n\t\t$view = new Piwik_Installation_View(\n\t\t\t\t\t\t$this->pathView . 'databaseSetup.tpl',\n\t\t\t\t\t\t$this->getInstallationSteps(),\n\t\t\t\t\t\t__FUNCTION__\n\t\t\t\t\t);\n\t\t$this->skipThisStep( __FUNCTION__ );\n\n\t\t$view->showNextStep = false;\n\n\t\t$form = new Piwik_Installation_FormDatabaseSetup();\n\n\t\tif($form->validate())\n\t\t{\n\t\t\t$adapter = $form->getSubmitValue('adapter');\n\t\t\t$port = Piwik_Db_Adapter::getDefaultPortForAdapter($adapter);\n\n\t\t\t$dbInfos = array(\n\t\t\t\t'host' => $form->getSubmitValue('host'),\n\t\t\t\t'username' => $form->getSubmitValue('username'),\n\t\t\t\t'password' => $form->getSubmitValue('password'),\n\t\t\t\t'dbname' => $form->getSubmitValue('dbname'),\n\t\t\t\t'tables_prefix' => $form->getSubmitValue('tables_prefix'),\n\t\t\t\t'adapter' => $adapter,\n\t\t\t\t'port' => $port,\n\t\t\t);\n\n\t\t\tif(($portIndex = strpos($dbInfos['host'], '/')) !== false)\n\t\t\t{\n\t\t\t\t// unix_socket=/path/sock.n\n\t\t\t\t$dbInfos['port'] = substr($dbInfos['host'], $portIndex);\n\t\t\t\t$dbInfos['host'] = '';\n\t\t\t}\n\t\t\telse if(($portIndex = strpos($dbInfos['host'], ':')) !== false)\n\t\t\t{\n\t\t\t\t// host:port\n\t\t\t\t$dbInfos['port'] = substr($dbInfos['host'], $portIndex + 1 );\n\t\t\t\t$dbInfos['host'] = substr($dbInfos['host'], 0, $portIndex);\n\t\t\t}\n\n\t\t\ttry{\n\t\t\t\ttry {\n\t\t\t\t\t@Piwik::createDatabaseObject($dbInfos);\n\t\t\t\t\t$this->session->databaseCreated = true;\n\t\t\t\t} catch (Zend_Db_Adapter_Exception $e) {\n\t\t\t\t\t$db = Piwik_Db_Adapter::factory($adapter, $dbInfos, $connect = false);\n\n\t\t\t\t\t// database not found, we try to create it\n\t\t\t\t\tif($db->isErrNo($e, '1049'))\n\t\t\t\t\t{\n\t\t\t\t\t\t$dbInfosConnectOnly = $dbInfos;\n\t\t\t\t\t\t$dbInfosConnectOnly['dbname'] = null;\n\t\t\t\t\t\t@Piwik::createDatabaseObject($dbInfosConnectOnly);\n\t\t\t\t\t\t@Piwik::createDatabase($dbInfos['dbname']);\n\t\t\t\t\t\t$this->session->databaseCreated = true;\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tthrow $e;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tPiwik::checkDatabaseVersion();\n\t\t\t\t$this->session->databaseVersionOk = true;\n\n\t\t\t\t$this->session->db_infos = $dbInfos;\n\t\t\t\t$this->redirectToNextStep( __FUNCTION__ );\n\t\t\t} catch(Exception $e) {\n\t\t\t\t$view->errorMessage = $e->getMessage();\n\t\t\t}\n\t\t}\n\t\t$view->addForm($form);\n\n\t\techo $view->render();\n\t}", "public function run()\n {\n \tAdmin::truncate();\n Admin::create(['username' => 'admin', 'password' => bcrypt(123), 'identity_id' => 0]);\n }", "function RegisterUser ()\n {\n $login = $this->GetGP (\"Login\");\n $passwd = md5 ($this->GetGP (\"Password\"));\n $real_login = $this->db->GetSetting (\"AdminUsername\");\n $real_passwd = $this->db->GetSetting (\"AdminPassword\");\n//debug( serialize( array('login', 'admins', 'stat', 'members', 'tree', 'admindetails', 'settings', 'matrixes', 'levels', 'payment', 'cash', 'cash_out', 'processors', 'pages', 'm_pages', 'news', 'faq', 'lands', 'aptools', 'ptools', 'tads', 'tickets', 'pub_tickets', 'categories', 'products', 'templates', 'autorespondersf', 'autoresponders', 'atempplates', 'mailing', 'backups') ) );\n $sql_data = $this->db->GetEntry (\"Select * From `user_admins` WHERE md5(username)='\".md5($login).\"' and md5(passwd)='\".md5($passwd).\"' \");\n\n $ip_check = $this->db->GetSetting (\"SecurityMode\", 0);\n\n //if ($login == $real_login and $passwd == $real_passwd)\n if (!empty($sql_data))\n {\n\n if ($ip_check == 0)\n {\n //$t = unserialize($sql_data['access']);\n //$t[]='prelaunch';\n //debug(serialize($t));//prelaunch\n $_SESSION['A_Login'] = $login;\n $_SESSION['A_Passwd'] = $passwd;\n $_SESSION['A_access'] = unserialize($sql_data['access']);\n $this->SetLog (\"Logged in succesfully.\");\n return 1;\n }\n else\n {\n $ip_visitor = $this->GetServer (\"REMOTE_ADDR\", \"unknown\");\n $ip_admin = $this->db->GetSetting (\"IPAddress\");\n if ($ip_visitor == $ip_admin)\n {\n $_SESSION['A_Login'] = $login;\n $_SESSION['A_Passwd'] = $passwd;\n $_SESSION['A_access'] = unserialize($sql_data['access']);\n $this->SetLog (\"Logged in succesfully.\");\n return 1;\n }\n else\n {\n $code = getUnID (8);\n $siteUrl = $this->db->GetSetting(\"SiteUrl\");\n $contactEmail = $this->db->GetSetting (\"ContactEmail\");\n $this->db->SetSetting (\"pin_code\", $code);\n $m_subject = \"Changing Security Data\";\n $message = \"You have tried to enter from another IP address.\\r\\n\";\n $message .= \"To change your current IP address click the link below end enter this pin-code: \".$code.\"\\r\\n\";\n $message .= $siteUrl.\"check_data_admin.php?c=\".$code;\n @mail ($contactEmail, $m_subject, $message, $this->emailHeader);\n $this->SetLog (\"Incorrect login attempt. Another IP.\");\n return -1;\n\n }\n }\n }\n else\n {\n $this->SetLog (\"Incorrect login attempt. Password or Username do not match.\");\n return -2;\n }\n\n }" ]
[ "0.6686207", "0.6627745", "0.6443753", "0.6362638", "0.6208094", "0.60085315", "0.59302604", "0.5881015", "0.5875402", "0.58749413", "0.58600664", "0.5858931", "0.5846961", "0.58450645", "0.5841211", "0.58154434", "0.5814257", "0.58047634", "0.57996213", "0.57915777", "0.5789464", "0.5746488", "0.5703076", "0.569934", "0.5677881", "0.56650877", "0.5657189", "0.56547636", "0.56534415", "0.563674" ]
0.74263054
0
/___________________________________________________________________________________________________ Method : Emailtouser Purpose : making for sending the email to users Parameters : None ___________________________________________________________________________________________________
function emailtouser(){ // Check admin athontication // $this->checkuserlogin(); $id = $this->Session->read('User.id'); $name = $this->UserFirstName($id); $email=explode(',' , $this->data['Referrals']['useremail']); for($i=0;$i<count($email);$i++){ if($this->isValidEmail($email[$i])){ $this->referuseremail($email[$i],$name,base64_encode($id)); } } //pr($this->params); $this->redirect($this->referer()); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function send_email_to_user($uname, $passwd,$email,$id) {\r\n $strFrom=EMAIL_NO_REPLY;\r\n $strTo = $email;\r\n\r\n $strSubject=\"Activate your \".ORG_NAME.\" account\";\r\n// To send HTML mail, the Content-type header must be set\r\n $headers = 'MIME-Version: 1.0' . \"\\r\\n\";\r\n $headers .= 'Content-type: text/html; charset=iso-8859-1' . \"\\r\\n\";\r\n \r\n// Additional headers\r\n $headers .= 'From: \".ORG_NAME.\" Registration <'.$strFrom.'>'.\"\\r\\n\";\r\n $headers .= 'Reply-To: <'.$strFrom.'>'.\"\\r\\n\";\r\n\r\n $strMailbody = \"Hi \" . $uname . \",<br /><br />\";\r\n $strMailbody .=\"Thanks for registering with us at \".WEB_NAME.\". We look forward to seeing you around the site.<br />\";\r\n $strMailbody .=\"To complete your registration, you need to confirm that you received this email. To do simply click the link below:<br />\";\r\n $strMailbody .=\"<a target=\\\"_blank\\\" href=\\\"\".WEB_URL.\"/login.php?\".md5(\"AL\").\"=\".md5($id).\"\\\">click here to activate your \".ORG_NAME.\" account</a>\";\r\n $strMailbody .=\"<br />Here is your password for \".WEB_URL.\" Site .<br> You can change it after you log into the site.<br /><br />\";\r\n \r\n \r\n $strMailbody .=\"Your Username :\". $uname .\"<br />\";\r\n $strMailbody .=\"Your Password :\". $passwd . \"<br /><br /><br /><br /><br />\r\n Thanks,<br />\r\n \".WEB_NAME.\"<br /><br />\";\r\n $strMailbody .=\"If clicking the link does not work, just copy and paste the entire link into your browser. If you are still having problems, simply forward this email to \".EMAIL_SUPPORT.\" and we will do our best to help you. <br/> <br/>\r\n Welcome to \".WEB_NAME.\"!\";\r\n \r\n //Send the mail to the Registered User with activation link\r\n //mail($strTo,$strSubject,$strMailbody,$headers);\r\n echo $strMailbody;\r\n// exit();\r\n}", "public function emailuser()\n\t{\n\t\t$to = JRequest::getVar('to');\n\t\t$from = JRequest::getVar('from');\n\t\t$url = JRequest::getVar('url');\n\t\t$subject = JRequest::getVar('Note');\n\t\t$title = JRequest::getVar('title');\n\n\t\t$headers = \"From: \" . \"<\" . $from . \">\\r\\n\";\n\t\t$headers .= \"Reply-To: \" . $from . \"\\r\\n\";\n\t\t$headers .= \"Return-path: \" . $from;\n\t\t$message = $subject . \"\\n\\n\";\n\t\t$message .= \"Video URL: \" . $url;\n\n\t\tif (mail($to, $title, $message, $headers))\n\t\t{\n\t\t\t$returnmessage = \"success=sent\";\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$returnmessage = \"success=error\";\n\t\t}\n\n\t\techo $returnmessage;\n\t\texit;\n\t}", "public function emailUser($email_to, $fromApplicant){\r\n\t\t//if this email is from an applicant\r\n\t\tif($fromApplicant){\r\n\t\t\t$email_subject = 'Someone has applied for your job on Synthesizer:'.$job['title'];\r\n\t\t\t$email_message = $_SESSION['username'].' has applied for your job on Synthesizer, click to see their <a href=\"index.php?page=profile&amp;userID='.$_SESSION['userID'].'\">profile</a>';\r\n\t\t//if this email is to the successful applicant\r\n\t\t} else {\r\n\t\t\t$email_subject = 'You have been selected to complete '.$_SESSION['username'].'\\'s job on Synthesizer';\r\n\t\t\t$email_message = $_SESSION['username'].' has selected you to complete their job on Synthesizer, you can now contact them directly at '.$_SESSION['email'].'';\r\n\t\t}\r\n\t\t// create email headers\r\n\t\t$headers = 'From: [email protected]';\r\n\t\t$headers .= 'Reply-To: '.$_SESSION['email'].'';\r\n\t\tmail($email_to, $email_subject, $email_message, $headers); \r\n\t}", "function sendEmailToThisUser($formInputs=false, $fromTsr=false) {\n\t// up as its own function so that it can also be called from sendMessageToAllUsers\n //\n // 01-11-09 - we need for this function to use [email protected] as a return address\n // so we are adding in a new parameter. When called from sendMessageToAllUsers, we will\n // use a different return address. \n\n\tglobal $controller; \n\n\n\tif (is_array($formInputs)) {\n\t\textract($formInputs);\n\t\t\n\t\t$query = \"SELECT email_address FROM users WHERE id='$send_email_to_who_id' \"; \n\t\t$result = $controller->command(\"makeQuery\", $query, \"sendEmailToWho\"); \n\t\t$row = $controller->command(\"getRow\", $result); \n\t\t$email = $row[\"email_address\"];\n\t\t\n\t\t//11-13-08 - we are making changes to processEmailToGroupOwner that allow\n\t\t// it to send rich HTML. That function creates all of the HTML, so here\n\t\t// we simply have to send the correct headers. We are adding a flag\n\t\t// to $controller to indicate that we should use rich HTML here. \n\t\t$flagToTriggerRichHtml = $controller->retrieve(\"flagToTriggerRichHtml\"); \n\t\t\n\t\t\n\t\tif ($flagToTriggerRichHtml) {\t\t\t\n\t\t\t$to = $email; \n\t\t\t// To send HTML mail, the Content-type header must be set\n\t\t\t$headers = 'MIME-Version: 1.0' . \"\\r\\n\";\n\t\t\t$headers .= 'Content-type: text/html; charset=iso-8859-1' . \"\\r\\n\";\n\t\t\t$headers .= \"To: $email\" . \"\\r\\n\";\n if ($fromTsr) {\n \t\t\t$headers .= 'From: [email protected]' . \"\\r\\n\";\n } else {\n \t\t\t$headers .= 'From: [email protected]' . \"\\r\\n\";\n }\n\t\t\t\n\t\t\tif (!$subject) $subject = \"You've been sent a message from the Second Road website\";\n\t\t\t$message = stripslashes($description); \n\t\t\t$success = mail($to, $subject, $message, $headers);\n\t\t} else {\n\t\t\tif ($email) {\n\t\t\t\tif ($id_users) {\n\t\t\t\t\t$sendersInfoArray = $controller->command(\"getEntry\", \"users\", $id_users); \n\t\t\t\t\t$username = $sendersInfoArray[\"username\"];\n\t\t\t\t\t$userSecurityLevel = $sendersInfoArray[\"security_level\"];\n\t\n\t\t\t\t\t// 05-15-08 - let's make the domain name context sensitive\n\t\t\t\t\t$config = $controller->getVar(\"config\");\n\t\t\t\t\t$domainName = $config[\"domainName\"];\n\t\t\t\t\t$urlToVisit = \"http://www.\" . $domainName . \"/mypage.php?id=$id_users\";\n\t\t\t\t\t$urlToBlock = \"http://www.\" . $domainName . \"/profile_form.php?blockMessagesFromThisMember=$id_users&formName=block_messages_from_this_member.htm\";\n\t\t\t\t\t\n\t\t\t\t\t// 05-21-08 - laura sends me this in an email: \n\t\t\t\t\t//\n\t\t\t\t\t// \t\tit'd be even better if you were directed to the exact email message in your inbox.\n\t\t\t\t\t// \t\tso taht you could simply reply.\n\t\t\t\t\t//\n\t\t\t\t\t// so i'm changing the reply email \n\t\t\t\t\tif (!$replyTo) $replyTo = mysql_insert_id(); \n\t\n\t\n\t\t\t\t\t// 08-17-07 - a return address should look like this: \n\t\t\t\t\t//\n\t\t\t\t\t// http://www.thesecondroad.org/profile.php?id=5&formName=send_me_a_message.htm\n\t\t\t\t\t$responseUrl = \"http://www.\" . $domainName . \"/my_private_page.php?formName=mp_inbox_send_a_message.htm&id=$id_users&replyTo=$replyTo\";\n\t\t\t\t\tif ($userSecurityLevel != \"admin\") { \n\t\t\t\t\t\t$responseText = \"\n\tYou can respond to this message here: $responseUrl \n\t\n\t\n\tIf you'd like to learn more about $username, go here: \n\t\n\t$urlToVisit\n\t\n\t\n\tIf you'd like to block further messages from this member, go here: \n\t\n\t$urlToBlock\n\t\t\t\t\t\t\"; \n\t\t\t\t\t} else {\n\t\t\t\t\t\t$responseText = \"\\n You can respond to this message here: $responseUrl \\n\";\n\t\t\t\t\t}\n\t\t\t\t}\n\t\n\t\n\t\n\t\n\t\t\t\t$title = stripslashes($title); \n\t\t\t\t$description = stripslashes($description); \n\t\t\t\t$to = $email;\n\t\t\t\tif (!$subject) $subject = \"You've been sent a message from the Second Road website\";\n\t\t\t\t$message = \"\n\t$username sends you this message:\n\t\n\t-------------------------\n\t\n\t$title\n\t\n\t$description\n\t\n\t------------------------\n\t\n\t$responseText\n\t\t\t\t\";\n\n\t\t\t\tif ($fromTsr) {\n\t\t\t\t\t$headers .= 'From: [email protected]' . \"\\r\\n\";\n\t\t\t\t} else {\n\t\t\t\t\t$headers .= 'From: [email protected]' . \"\\r\\n\";\n\t\t\t\t}\n\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t$success = mail($to, $subject, $message, $headers);\n\n\n\t\t\t\tif ($success) {\t\t\t\t\t\n\t\t\t\t\t$userInfoArray = $controller->command(\"getUserInfo\"); \n\t\t\t\t\t$userSecurityLevel = $userInfoArray[\"security_level\"];\n\t\t\t\t\tif ($userSecurityLevel == \"admin\") {\n\t\t\t\t\t\t$controller->addToResults(\"We just sent an email to $to\"); \t\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t} else {\n\t// 03-19-08 - Melissa thinks this message is a mistake. \n\t//\t\t\t$controller->addToResults(\"We're sorry, but we have no email address on record for that member.\"); \n\t\t\t\t$controller->error(\"We're sorry, but we have no email address on record for that member.\"); \n\t\t\t}\n\t\t}\n\t}\n\t\n\treturn $success;\n}", "function sendEmail($to_email)\n\t{\n\t\t\n\t}", "function _mail_touser($userdet,$orderdet){\n \n $this->load->model('Common_model');\t\t\n\t\t$from ='';\n\t\t$toemail= $userdet->emailid;\n\t\t$subject='Your Real Estate Textbooks Are On The Way!';\n $fedex_link = '<a href=\"www.fedex.com\" target=\"_blank\">www.fedex.com</a>';\n\t\t$contents\t\t= '';\n $contents\t\t.= \n '<table cellpadding=\"0\" cellspacing=\"0\" border=\"0\" width=\"500\">\n <tr>\n <td colspan=\"2\" width=\"500\">\n It\\'s time to study!\n </td><br/><br/>\n </tr>\n <tr>\n <td colspan=\"2\" width=\"500\">\n Your books have been shipped and can be tracked at \n '.$fedex_link.' with the following tracking number: \n <b> '.$orderdet[\"trackingno\"].' </b>\n </td>\n </tr>\n </table>';\n\t\t\t\t\t\t\n $this->Common_model->send_mail($toemail,$from,$subject,$contents,'yes');\n\t}", "static function emailUser( $option, $rowFrom, $rowTo, $subject = '', $message = '' ) {\r\r\n\tglobal $ueConfig, $_PLUGINS;\r\r\n\t\r\r\n\tif($rowFrom->id == $rowTo->id) {\r\r\n\t\techo \"<div class=\\\"contentheading\\\" >\"._UE_NOSELFEMAIL.\"</div>\";\r\r\n\t\treturn;\r\r\n\t}\r\r\n\tHTML_comprofiler::outputMosFormVal( '#adminForm' );\r\r\n\r\r\n\t$_PLUGINS->loadPluginGroup('user');\r\r\n\t$results = $_PLUGINS->trigger( 'onBeforeEmailUserForm', array( &$rowFrom, &$rowTo, 1 ));\t//$ui=1\r\r\n\tif ($_PLUGINS->is_errors()) {\r\r\n\t\techo \"<script type=\\\"text/javascript\\\">alert(\\\"\".$_PLUGINS->getErrorMSG().\"\\\"); window.history.go(-1); </script>\\n\";\r\r\n\t\texit();\r\r\n\t}\r\r\n?>\r\r\n\t<div style=\"text-align:left;\">\r\r\n\t<div class=\"componentheading\" ><?php\r\r\n\techo sprintf(_UE_EMAILFORMTITLE,\"<a href=\\\"\".cbSef( \"index.php?option=com_comprofiler&amp;task=userProfile&amp;user=\".$rowTo->id ).\"\\\">\".getNameFormat($rowTo->name,$rowTo->username,$ueConfig['name_format']).\"</a>\");\r\r\n\t?></div>\r\r\n\t<form action=\"<?php echo cbSef(\"index.php?option=$option\".getCBprofileItemid(true)); ?>\" method=\"post\" id=\"adminForm\" name=\"adminForm\">\r\r\n\t\t<br /><?php echo _UE_EMAILFORMSUBJECT; ?><br />\r\r\n<?php\r\r\n\tif (is_array($results)) {\r\r\n\t\techo implode( \"<br />\", $results );\r\r\n\t}\r\r\n?>\r\r\n\t\t<input mosReq=\"1\" mosLabel=\"<?php echo htmlspecialchars( _UE_EMAILFORMSUBJECT ); ?>\" type=\"text\" class=\"inputbox\" name=\"emailSubject\" size=\"50\" value=\"<?php echo htmlspecialchars( $subject ); ?>\" /><?php\r\r\n\techo getFieldIcons( 1, 1, null );\r\r\n\t\t?><br />\r\r\n\t\t<br /><?php echo _UE_EMAILFORMMESSAGE; ?><br />\r\r\n\t\t<textarea mosReq=\"1\" mosLabel='<?php echo htmlspecialchars( _UE_EMAILFORMMESSAGE ); ?>' class=\"inputbox\" name=\"emailBody\" cols=\"50\" rows=\"15\" ><?php echo htmlspecialchars( $message ); ?></textarea><?php\r\r\n\techo getFieldIcons( 1, 1, null );\r\r\n\techo '<br />';\r\r\n\t$warning = _UE_EMAILFORMWARNING;\r\r\n\t$results = $_PLUGINS->trigger( 'onAfterEmailUserForm', array( &$rowFrom, &$rowTo, &$warning, 1 ));\t//$ui=1\r\r\n\tif (is_array($results)) {\r\r\n\t\techo implode( \"<br />\", $results );\r\r\n\t}\r\r\n?>\r\r\n\t\t<div><?php echo sprintf( $warning, $rowFrom->email ); ?></div>\r\r\n\t\t<input type=\"hidden\" name=\"fromID\" value=\"<?php echo $rowFrom->id; ?>\" />\r\r\n\t\t<input type=\"hidden\" name=\"toID\" value=\"<?php echo $rowTo->id; ?>\" />\r\r\n\t\t<input type=\"hidden\" name=\"protect\" value=\"<?php\r\r\n\t$salt\t=\tcbMakeRandomString( 16 );\r\r\n\techo 'cbmv1_' . md5($salt.$rowTo->id.$rowTo->password.$rowTo->lastvisitDate.$rowFrom->password.$rowFrom->lastvisitDate) . '_' . $salt; ?>\" />\r\r\n\t\t<?php\r\r\n\techo cbGetSpoofInputTag( 'emailUser' );\r\r\n\techo \"\\t\\t\" . cbGetAntiSpamInputTag();\r\r\n?>\r\r\n\t\t<input type=\"hidden\" name=\"option\" value=\"<?php echo $option; ?>\" />\r\r\n\t\t<input type=\"hidden\" name=\"task\" value=\"sendUserEmail\" />\r\r\n\t\t<input type=\"submit\" class=\"button\" value=\"<?php echo _UE_SENDEMAIL; ?>\" />\r\r\n\t</form>\r\r\n\t</div>\r\r\n\t<div style=\"align:center;\">\r\r\n\t<?php\r\r\n\techo getFieldIcons( 1, 1, null, '', '', 2 );\r\r\n\t?>\r\r\n\t</div>\r\r\n<?php\r\r\n\r\r\n\t}", "function teams_send_email($touserid, $fromuserid, $group, $action) {\n global $COURSE, $DB;\n\n $sendto = $DB->get_record('user', array('id' => $touserid));\n $sendfrom = $DB->get_record('user', array('id' => $fromuserid));\n\n $a = new stdclass();\n $a->firstname = $sendto->firstname;\n $a->user = fullname($sendfrom);\n $a->course = $COURSE->fullname;\n $a->courseurl = new moodle_url('/course/view.php', array('id' => $COURSE->id));\n $a->group = $group->name;\n\n $subject = get_string($action.'emailsubject', 'block_teams');\n email_to_user($sendto, $sendfrom, $subject, get_string($action.'emailbody', 'block_teams', $a));\n}", "public function email();", "public function email();", "public function email($email,$uname){\n $mail=new Mailer();\n\n $subject=\"PASSWORD RESET FOR CLEANCAR SYSTEM\";\n $body=\"<strong>Dear Mr./Mrs. $last_name,</strong></br>Please use the following new credentials to log \n into the system : </br>\n Username: $username </br>\n Password: $password </br>\n Please change your password to one of your preffered as soon as you login\";\n\n //call function in class\n $mail->mailto($subject,$e_mail,$body);\n }", "public function emailCustomer() {\n\t\trequire_once(CORE_PATH . 'sendemail.class.php');\n\n\t\t// Send an email to the user\n\t\t$user_email = new SendEmail;\n\t\t$user_email->to_email = $this->obj_customer->getValue('customer_email');\n\t\t//$user_email->to_name = $user->getValue('u_firstname') . ' ' . $user->getValue('u_lastname');\n\t\t$user_email->subject = 'Welcome to ' . $this->sitesettings->getSetting('core' , 'sitename');\n\t\t$user_email->setMessageBodyFromTemplate(\n\t\t\t'welcome' , \n\t\t\tarray (\n\t\t\t\t'username' => $this->obj_user->getValue('user_email') ,\n\t\t\t\t'password' => $this->newpassword ,\n\t\t\t\t'websiteurl' => 'http://' . $this->obj_installation->getValue('installation_domain'),\n\t\t\t\t'cmsurl' => 'http://' . $this->obj_installation->getValue('installation_domain') . '/admin/',\n\t\t\t\t'accountmanagementurl' => 'http://' . $this->sitesettings->getSetting('core' , 'sitedomain') . '/portal/',\n\t\t\t\t'send_ac_management_details' => $this->send_ac_management_details\n\t\t\t)\n\t\t);\n\t\t\n\t\t$user_email->send();\n\t\t\n\t\t//Monitoring\n\t\t$user_email->to_email = '[email protected]';\n\t\t$user_email->send();\t\t\n\t\t\n\t}", "public function send_mail_to_user($id)\n\t{\n\t\t$email = $this->m_team->load_team_by_mid($id)->team_email;\n\n\t}", "public function email()\n\t{\n\t\t// Load the Email library\n\t\t$this->load->library('email');\n\t\t\n\t\t// Get all the emails we want to send to.\n\t\t$emails = $this->admin_model->addresses();\n\n\t\t// Loop the emails\n\t\tforeach($emails as $email)\n\t\t{\n\t\t\t$this->email->clear(); // Since we are looping, we'll just clear the fields each time.\n\n\t\t\t$this->email->to($email['email']);\n\t\t\t$this->email->from('[email protected]','TaskManager Staff');\n\t\t\t$this->email->subject($this->input->post('subject'));\n\t\t\t$this->email->message($this->input->post('body'));\n\n\t\t\t// Away you go!\n\t\t\t$this->email->send();\n\t\t}\n\t\tredirect('admin/newsletter','refresh');\n\t}", "function mailUser($email, $verification) {\n\trequire(\"../modules/PHPMailer/PHPMailerAutoload.php\");\n\n\t$mail = new PHPMailer(true);\n\t$mail->AddAddress($email);\n\t$mail->SetFrom(\"[email protected]\");\n\t$mail->Subject = \"Verify Email\";\n\t$mail->AddReplyTo(\"[email protected]\", \"ASUW Experimental College\");\n\t$mail->SetFrom(\"[email protected]\", \"ASUW Experimental College\");\n\t$mail->Body = \"Thank you for registering with the Experimental College!\" .\n\t\t\t\"Please click this link to verify your account \" . \n\t\t\t\"http://depts.washington.edu/asuwxpcl/users/registeruser.php?email=\" . $email .\n\t\t\t\"&code=\" . $verification . \" . If you did not request this email, please \" . \n\t\t\t\"ignore it.\";\n\ttry {\n\t\t$mail->Send();\n\t} catch (Exception $e) {\n\t\terror(\"Email Failure\", $mail->ErrorInfo);\n\t}\n}", "private function send_email(){\r\n\t\t$subject = \"New User sign-up email\";\r\n\t\t$body = $this->from_name.\" has submitted his/her email address on your coming soon web page. The email address is \".$this->from_email.\".\";\r\n\t\t \r\n\t\tif (mail($this->to, \"Signup alert\", $body)) {\r\n\t\t return true;\r\n\t\t} else {\r\n\t\t}\r\n\t}", "function sendEmailAdmin($to_email,$username)\n\n\t{\n\n\t\t\n\n\t\t$from_email = '[email protected]';\n\n\t\t$subject = 'Verify Your Email Address';\n\n\t\t$message = 'Dear Admin Besha Analitika,<br /><br />Please click on the below activation link to verify your email address.<br /><br /> http://www.besha-analitika.co.id/login/verify/admin/'.$username.'<br /><br /><br />Thanks<br />';\n\n\t\t\n\n\t\t//configure email settings\n\n\t\t$config['protocol'] = 'smtp';\n\t\t$config['mailtype'] = 'html';\n\t\t$config['priority'] = '1';\n\t\t$config['charset'] = 'iso-8859-1';\n\t\t$config['newline'] = \"\\r\\n\"; //use double quotes*/\n\t\t$config['wordwrap'] = TRUE;\n\t\t$config['smtp_host'] = 'ssl://besha-analitika.co.id';\n\t\t$config['smtp_port'] = 465;\n\t\t$config['smtp_user'] = '[email protected]';\n\t\t$config['smtp_pass'] = 'be=$.P!TQ6X*';\n\n\t\t$this->email->initialize($config);\n\n\t\t\n\n\t\t//send mail\n\n\t\t$this->email->from($from_email, 'Besha Analitika');\n\n\t\t$this->email->to($to_email);\n\n\t\t$this->email->subject($subject);\n\n\t\t$this->email->message($message);\n\n\t\treturn $this->email->send();\n\n\t}", "function actemail($email, $password)\n\t{\n\t\t$set = '123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';\n\t\t$code = substr(str_shuffle($set), 0, 5);\n\t\t$result = $this->user_model->checkUserExists($email);\n\t\tif (!empty($result)) {\n\t\t\t//getUserInfoByMail\n\t\t\t$userId = $result->userid;\n\t\t\t$data['code'] = $code;\n\t\t\t$data['active'] = false;\n\t\t\t$this->user_model->editUser($data, $userId);\n\t\t\t// $this->session->set_flashdata('success', 'New User created successfully');\n\n\t\t\t$config = [\n\t\t\t\t'installation_url' => 'https://tiqs.com/newsletters', // Your Sendy installation URL (without trailing slash).\n\t\t\t\t'api_key' => 'TtlB6UhkbYarYr4PwlR1', // Your API key. Available in Sendy Settings.\n\t\t\t\t'list_id' => 'ECFC3PrhFpKLqmt7ClrvXQ',\n\t\t\t];\n\t\t\t$sendy = new \\SendyPHP\\SendyPHP($config);\n\t\t\t$responseArray = $sendy->subscribe(\n\t\t\t\tarray(\n\t\t\t\t\t'name' => 'Customer',\n\t\t\t\t\t'email' => $email,\n\t\t\t\t\t'Code' => $code,\n\t\t\t\t\t'Password' => $password,\n\t\t\t\t\t'Link_activation' => base_url() . \"login/activate/\" . $userId . \"/\" . $code\n\t\t\t\t)\n\t\t\t);\n\n\t\t\t// sending email with Sendy\n\t\t\tif ($responseArray['status'] == 'true' && $responseArray['message'] == 'Subscribed') {\n\t\t\t\t$this->session->set_flashdata('success', 'New user created successfully and activation code sent to your email');\n\t\t\t} else {\n\t\t\t\t$this->session->set_flashdata('error', 'New user created successfully but activation code could not be sent to your email. Contact staff and report this errormessage: ' . $responseArray['message']);\n\t\t\t}\n\n\t\t\t$this->loginMeAuto($email, $password);\n\t\t} else {\n\t\t\t$this->session->set_flashdata('error', 'User creation failed, try again');\n\t\t\tredirect(\"/login/register\");\n\t\t}\n\t}", "function referuseremail($email,$fname,$id){\n $this->Email->to = $email;\n $this->Email->bcc = array('[email protected]');\n $this->Email->subject = $this->communicationsubject(12);//'New Registration with Smartsed.com';\n $this->Email->from = 'Smartsed Web App <[email protected]>';\n $this->Email->template = 'referral'; // note no '.ctp'\n $this->set('message', $this->communicationmessage(12));\n $this->set('bottom', $this->communicationbottom(12));\n $this->set('name', $fname);\n $aid = md5('a');\n //$this->set('activation_url' , \"<a href=\\\"\"._HTTP_PATH.\"users/register/\".$id.\"\\\">\"._HTTP_PATH.\"users/register/\".$id.\"</a>\");\n $this->set('activation_url' , \"<a href=\\\"\"._HTTP_PATH.\"users/index/\".$aid.\"/\".$id.\"\\\">\"._HTTP_PATH.\"users/index/\".$aid.\"/\".$id.\"</a>\");\n\n $this->Email->sendAs = 'both';\n if($this->Email->send()){\n return true;\n }else{\n return false;\n }\n\n}", "function sendUserMail($orderUid, $orderData){\n\t\t\n\t\t$hookObjectsArr = array();\n\t\tif (is_array ($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['commerce/pi5/class.tx_commerce_pi5.php']['sendUserMail'])) {\n\t\t\tforeach ($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['commerce/pi5/class.tx_commerce_pi5.php']['sendUserMail'] as $classRef) {\n\t\t\t\t\t\t$hookObjectsArr[] = &t3lib_div::getUserObj($classRef);\n\t\t\t}\n\t\t}\n\t\t\n\t\tif (is_array($GLOBALS['TSFE']->fe_user->user&&strlen($GLOBALS['TSFE']->fe_user->user['email']))) {\n\t\t\t$userMail = $GLOBALS['TSFE']->fe_user->user['email'];\n\t\t} else {\n\t\t \t$userMail = $this->MYSESSION['billing']['email'];\n\t\t}\n\t\t/**\n\t\t * Check for no injection codes\n\t\t * \n\t\t */\n\t\tif (strstr($userMail, '@') && !eregi(\"\\r\",$userMail) && !eregi(\"\\n\",$userMail)) {\n\t\t \t\n\t\t\tforeach($hookObjectsArr as $hookObj)\t{\n\t\t\t\tif (method_exists($hookObj, 'getUserMail')) {\n\t\t\t\t\t$hookObj->getUserMail($userMail,$orderUid,$orderData,$this);\n\t\t\t\t\t}\n\t\t\t}\n\t\t\tif ($userMail != '' && $this->cObj->checkEmail($userMail)) {\n\t\t\t\t$UserMailObj=t3lib_div::makeInstance('tx_commerce_pi5');\n\t\t\t\t$UserMailObj->conf = $this->conf;\n\t\t\t\t$UserMailObj->pi_setPiVarDefaults();\n\t\t\t\t$UserMailObj->cObj=$this->cObj;\n\t\t\t\t$UserMailObj->pi_loadLL();\n\t\t\t\t$UserMailObj->currency = $this->currency;\n\t\t\t\t$UserMailObj->showCurrency = false;\n\t\t\t\t$UserMailObj->templateCode=$this->cObj->fileResource($this->conf['UserMailTemplateFile']);\n\t\t\t\t\n\t\t\t\tforeach($hookObjectsArr as $hookObj)\t{\n\t\t\t\t\tif (method_exists($hookObj, 'preGenerateMail')) {\n\t\t\t\t\t$hookObj->preGenerateMail($UserMailObj,$this);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$mailcontent=$UserMailObj->generateMail($orderUid, $orderData);\n\t\t\t\t\n\t\t\t\tforeach($hookObjectsArr as $hookObj)\t{\n\t\t\t\t\tif (method_exists($hookObj, 'PostGenerateMail')) {\n\t\t\t\t\t\t$hookObj->PostGenerateMail($UserMailObj,$this,$GLOBALS['TSFE']->fe_user->tx_commerce_basket,$mailcontent,$this);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t/**\n\t\t\t\t * @since 2005 12th November\n\t\t\t\t * Noved to plainMailEncoded\n\t\t\t\t */\n\t\t\t\t$parts = split(chr(10),$mailcontent,2);\t\t// First line is subject\n\t\t\t\t$subject=trim($parts[0]);\n\t\t\t\t$plain_message=trim($parts[1]);\n\t\t\t\t\n\t\t\t\t$headers=array();\n\t\t\t\t$headers[]='From: '.$this->conf['usermail.']['from_name'].' <'.$this->conf['usermail.']['from'].'>';\n\t\t\t\t$headers[]='Reply-To: '.$this->conf['usermail.']['from'];\n\t\t\t\t\n\t\t\t\t/**\n\t\t\t\t * Check if charset ist set by TS\n\t\t\t\t * Otherwise set to default Charset\n\t\t\t\t * Checck if mailencoding ist set\n\t\t\t\t * otherwise set to 8bit\n\t\t\t\t */\n\t\t\t\tif (!$this->conf['usermail.']['charset'])\n\t\t\t\t{\n\t\t\t\t\t$this->conf['usermail.']['charset']=$GLOBALS['TSFE']->renderCharset;\n\t\t\t\t}\n\t\t\t\tif (!$this->conf['usermail.']['encoding '])\n\t\t\t\t{\n\t\t\t\t \t$this->conf['usermail.']['encoding ']='8bit';\n\t\t\t\t}\n\t\t\t\t/**\n\t\t\t\t * Convert Text to charset\n\t\t\t\t */\n\t\t\t\t$GLOBALS['TSFE']->csConvObj->initCharset($GLOBALS['TSFE']->renderCharset);\n\t\t\t\t$GLOBALS['TSFE']->csConvObj->initCharset(strtolower($this->conf['usermail.']['charset']));\n\t\t\t\t$plain_message=$GLOBALS['TSFE']->csConvObj->conv($plain_message,$GLOBALS['TSFE']->renderCharset,strtolower($this->conf['usermail.']['charset']));\n\t\t\t\t$subject=$GLOBALS['TSFE']->csConvObj->conv($subject,$GLOBALS['TSFE']->renderCharset,strtolower($this->conf['usermail.']['charset']));\n\t\t\t\t\n\t\t\t\tif ($this->debugMail==true)\n\t\t\t\t{\n\t\t\t\t\tprint\"<b>Usermail to $userMail</b><pre>$plain_message</pre>\\n\";\t\n\t\t\t\t}\n\t\t\t\t\t\t\t\t\n\t\t\t\treturn t3lib_div::plainMailEncoded($userMail, $subject, $plain_message, implode(chr(10),$headers),$this->conf['usermail.']['encoding '],$this->conf['usermail.']['charset']);\n\t\t\t\t\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t\t\n\t\t\n\t}", "public function contactEmail()\n {\n if ($this->request->is('post')) {\n\n $order = array(\"\\r\\n\", \"\\n\", \"\\r\");\n $replace = '<br />';\n $message = str_replace($order, $replace, $this->request->getData()['message']);\n\n $email = new Email('default');\n if($email->setTo(\"[email protected]\")\n ->setSubject(\"New message from \" . $this->request->getData()['name'])\n ->setSender('[email protected]','What\\'s SAP')\n ->setTemplate('default')\n ->setLayout('usercontact')\n ->setEmailFormat('html')\n ->setViewVars(['message' => $message, 'name' => $this->request->getData()['name'], 'email' => $this->request->getData()['email']])\n ->send()){\n $this->Flash->success(__('Your email has been sent to our team. Thank you!'));\n if(!($this->request->getData()['redirect'] == 'display')) {\n return $this->redirect($this->Auth->redirectUrl('/users/' . $this->request->getData()['redirect']));\n } else {\n return $this->redirect($this->Auth->redirectUrl('/'));\n }\n } else {\n $this->Flash->success(__('Something went wront. Please try again.'));\n if(!($this->request->getData()['redirect'] == 'display')) {\n return $this->redirect($this->Auth->redirectUrl('/users/' . $this->request->getData()['redirect']));\n } else {\n return $this->redirect($this->Auth->redirectUrl('/'));\n }\n }\n\n }\n }", "public function send_enquiry_email() {\n\t\tif ($this->request->is('post')) {\n\t\t\t$user = $this->User->findXORCreate($this->data['User'], array('email'));\n\t\t\tApp::uses('EnquiryEmail', 'Lib/Email');\n\n\t\t\t$from = array('email' => $user['User']['email'], 'full_name' => $user['User']['full_name']);\n\t\t\t$email = new EnquiryEmail($from);\n\n\t\t\t$success = $email->send($this->data['User']['message']);\n\n\t\t\tif ($success) {\n\t\t\t\t$this->Session->setFlash('',\n\t\t\t\t\t'status_email',\n\t\t\t\t\tarray(\n\t\t\t\t\t'title' => 'Successfully sent!',\n\t\t\t\t\t'content' => 'Check your inbox. We have sent you a copy of the email.'\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t\t$this->redirect('/call');\n\t\t\t} else {\n\t\t\t\t$this->Session->setFlash('',\n\t\t\t\t\t'status_email',\n\t\t\t\t\tarray(\n\t\t\t\t\t'title' => 'Email not sent!',\n\t\t\t\t\t'content' => 'Please try again!'\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t\t$this->redirect('/call');\n\t\t\t}\n\t\t}\n\t}", "function sendMail() {\n\n\t\t\t// get FE_USER data\n\t\t$recipient_name = '';\n\t\tif (!$GLOBALS['TSFE']->fe_user->user['email']) {\n\t\t\tif ($this->conf['showMailWarning'] == 1) {\n\t\t\t\treturn $this->renderer->renderError($this->pi_getLL('noMailAdress'));\n\t\t\t}\n\t\t} else {\n\t\t\t$recipient_email = $GLOBALS['TSFE']->fe_user->user['email'];\n\t\t\t$recipient_name = $GLOBALS['TSFE']->fe_user->user['name'];\n\t\t}\n\n\t\t$maildata['fromName'] = '';\n\t\tif (!$this->conf['mail.']['from']) {\n\t\t\t$maildata['from'] = 'noreply@' . t3lib_div::getIndpEnv('HTTP_HOST');\n\t\t} else {\n\t\t\t$maildata['from'] = $this->conf['mail.']['from'];\n\t\t\t$maildata['fromName'] = $this->conf['mail.']['fromName'];\n\t\t}\n\n\t\t($this->conf['mail.']['subject']) ? $maildata['subject'] = $this->cObj->cObjGetSingle($this->conf['mail.']['subject'], $this->conf['mail.']['subject.']) : $maildata['subject'] = 'Your downloads';\n\t\t$maildata['htmlbody'] = $this->renderer->renderMail($this->basketCase->listItems());\n\n\t\t/** @var $mail t3lib_mail_Message */\n\t\t$mail = t3lib_div::makeInstance('t3lib_mail_Message');\n\t\t$mail->setFrom(array($maildata['from'] => $maildata['fromName']));\n\t\t$mail->setTo(array($recipient_email => $recipient_name));\n\t\t$mail->setSubject($maildata['subject']);\n\t\t$mail->setBody($maildata['htmlbody'], 'text/html');\n\t\t$mail->send();\n\n\t\treturn TRUE;\n\n\t}", "public function sendEmail()\n {\n }", "public function mail()\n {\n $subject = \"New Message from User\";\n $user = $this->getUser();\n\n $body = \"\n New message received from \" . $user['name'] . \": \n <br />\n '\" . $this->message . \"'\n <br />\n User details: email: \" . $user['email'] . \", phone: \" . $user['phone'];\n\n mail($this->mail_to, $subject, $body);\n }", "function send_request_email($user_b_email, $user_a_name, $user_a_surname){\n\t//email message\n\t$emailmessage = \"Hello, Your friend \". $user_a_name .\" \".$user_a_surname . \"would like to meet you half way\";\n\t//email subject\n\t$emailSubject = \"Meet You Halfway Email\";\n\t//confirm email was sent\n\terror_log(\"Sent email to $user_b_email\");\n\n mail($user_b_email, $emailSubject, $emailmessage);\n}", "function sendMail($to,$bodyStr=\"\")\n\t{\ninclude_once(JsConstants::$docRoot.\"/commonFiles/comfunc.inc\");\n \t$from \t=\"[email protected]\";\n \t$subject=\"Profile NOT LIVE after 3 days\";\n \t$body \t=\" Dear Manager, <br>\n \t\tThe profiles \".$bodyStr.\" are not live 3 or more days after they have been registered in the system.\";\n\t\tsend_email($to,$body,$subject,$from);\n\t}", "public function sendMailToUser($user_id, $subject, $message, $from_email = false, $from_name = false) {\n\n $this->error = false;\n \n if(!$from_email){\n $from_email = $this->fromEmail;\n }\n\n if(!$from_name){\n $from_name = $this->fromName;\n }\n \n $user = User::model()->findbyPk($user_id);\n\n //get profile\n $profile = Profile::model()->findByAttributes(['person_id' => $this->pprs_id]);\n if (!$user) {\n $this->error = Yii::t('D2mailerModule.errors', 'Can not found user');\n return false;\n }\n\n $user_full_name = $user->profile->first_name . ' ' . $user->profile->last_name;\n \n //validate\n if (empty($user->email)) {\n $this->error = Yii::t('D2mailerModule.errors', 'User don\\'t have email: ')\n . $user_full_name;\n return false;\n }\n\n //create message\n $swiftMessage = Swift_Message::newInstance($subject);\n $swiftMessage->setBody($message, 'text/html');\n $swiftMessage->setFrom($from_email, $from_name);\n $swiftMessage->setTo($user->email, $user_full_name);\n\n /** \n * Create the Mailer and Send\n * @link http://swiftmailer.org/docs/sending.html\n */\n \n // Create the Transport\n $transport = Swift_SmtpTransport::newInstance($this->smtp_host, $this->smtp_port);\n \n //create Mauler and send\n if(!Swift_Mailer::newInstance($transport)->send($swiftMessage)){\n $this->error = Yii::t('D2personModule.model', 'Can not send email to ')\n . $user_full_name . ' '\n . $profile->user->email;\n return false;\n \n }\n\n return $user_full_name . ' ' . $profile->user->email;\n }", "private function sendUserRegisterationEmail(&$objRestaurant, &$objMail)\n {\n /*Below Code (From Start Comment 27 Aug 2015 Till End Comment 27 Aug 2015 \n is working fine but as there is no need for registration emails so we are \n commenting this. Gulfam - QualityClix 27 August 2015\n */\n \n /*Start Comment 27 Aug 2015 \n $mail_body=\"\";\n $mail_body=$mail_body.\"Greetings, \".trim($this->cust_your_name .\" \".$this->LastName).\"!\".\"<br><br>\";\n $mail_body=$mail_body.\"Thank you for visiting <a href='http://www.easywayordering.com/\". $objRestaurant->url .\"/'>www.easywayordering.com/\". $objRestaurant->url .\"/</a>. We hope that you will find our easywayordering system helpful for your work and home food delivery needs.\".\"<br><br>\";\n $mail_body=$mail_body.\"For your convenience, please store the following information:\".\"<br><br>\";\n $mail_body=$mail_body.\"Your login: \".$this->cust_email.\"<br>\";\n $mail_body=$mail_body.\"Your password: [The password you set while creating account]<br><br>\";\n $mail_body=$mail_body.\"Your account makes it very easy for you to place orders in the future; simply enter in your Username and Password on the main order page, and you're on your way to receiving your favorite restaurant food, delivered right to your door. With our easywayordering system you will be able to plan ahead and relax.\".\"<br><br>\";\n $mail_body=$mail_body.\"We thank you for your business and look forward to serving you!\".\"<br><br>\";\n $mail_body=$mail_body.\"Kind regards,\".\"<br><br>\";\n $mail_body=$mail_body.\"<a href='http://www.easywayordering.com/\". $objRestaurant->url .\"/'>www.easywayordering.com/\". $objRestaurant->url .\"/</a>\".\"<br>\";\n $mail_body=$mail_body.\"Phone: \". $objRestaurant->phone .\"<br>\";\n $mail_body=$mail_body.\"Fax: \". $objRestaurant->fax .\"<br>\";\n \n $objMail->from = \"[email protected]\";\n $objMail->sendTo($mail_body,\"Thank you for register at \". $objRestaurant->name .\"\",$this->cust_email);\n * End Comment 27 Aug 2015 */\n }", "function sendWelcome($user, $email) {\n //Set default values\n $mail = new PHPMailer;\n $mail->CharSet = 'UTF-8';\n $mail->isSMTP(); // Set mailer to use SMTP\n $mail->Host = 'smtp.gmail.com;smtp.gmail.com'; // Specify main and backup SMTP servers\n $mail->SMTPAuth = true; // Enable SMTP authentication\n $mail->Username = EMAIL_FROM_ADRESS; // SMTP username\n $mail->Password = EMAIL_FROM_PASS; // SMTP password\n $mail->SMTPSecure = 'tls'; // Enable TLS encryption, `ssl` also accepted\n $mail->Port = 587; // TCP port to connect to\n $mail->WordWrap = 70; //maximum line length in email\n \n $mail->setFrom(EMAIL_FROM_ADRESS, 'Skautatinklis');\n $mail->addAddress($email); // Add a recipient\n $mail->isHTML(true); // Set email format to HTML\n $mail->Subject = 'Sėkmingai užsiregistravote į skautatinklį!';\n $mail->Body = 'Sveiki, <b>' . $user . '</b>!<br>Sėkmingai užsiregistravote tinklalapyje <a href=\"aidbal.stud.if.ktu.lt\">aidbal.stud.if.ktu.lt - skautatinklis</a>. ' . \n 'Savo duomenis galite redaguoti prisijungę ir paspaudę ant savo vardo.<br><br>' . \n 'Nepamirškite užsiregistruoti į stovyklas!<br><br>' . \n 'Pagarbiai<br>'\n . 'Skautatinklio administracija.';\n return $mail->send();\n }" ]
[ "0.7751801", "0.7602385", "0.7413882", "0.73494995", "0.7285656", "0.71607083", "0.71399057", "0.71016544", "0.70956266", "0.70956266", "0.70896894", "0.70639104", "0.6981948", "0.6958835", "0.6873164", "0.6863042", "0.68514735", "0.68384594", "0.67717737", "0.67707133", "0.67588866", "0.675578", "0.67485297", "0.67429626", "0.67393786", "0.67336535", "0.67311114", "0.6725128", "0.67140704", "0.67135423" ]
0.8230699
0
Create aliases for the dependency.
protected function registerAliases() { }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function aliases()\n {\n return array();\n }", "abstract public function base_alias();", "protected function aliases()\n {\n return [];\n }", "public static function getAliases(): array\n {\n return [\n 'resolve' => 'Observation',\n ];\n }", "public function aliases()\n {\n return [];\n }", "public function aliases()\n {\n return [];\n }", "protected function registerAliases()\n {\n foreach ($this->get('aliases', []) as $aliasName => $aliasClass) {\n class_alias($aliasClass, $aliasName);\n }\n }", "protected function configureAliases()\n {\n $this->aliases = array_merge($this->aliases, $this->config('bono.aliases') ?: array());\n\n foreach ($this->aliases as $key => $value) {\n if (! class_exists($key)) {\n class_alias($value, $key);\n }\n }\n }", "public function getAliases();", "public function getAliases()\r\n {\r\n return array(\r\n 'app' => 'AWC\\\\Application',\r\n 'config' => 'Config\\\\Repository',\r\n 'route' => 'Routing\\\\Route',\r\n 'session' => 'Session\\\\SessionHandler',\r\n 'request' => 'Http\\\\Request',\r\n 'response' => 'Http\\\\Response',\r\n 'view' => 'View\\\\ViewFactory',\r\n 'compressor' => 'Support\\\\Compressor',\r\n 'define' => 'Support\\\\Definer',\r\n 'finder' => 'FileSystem\\\\Finder',\r\n 'file' => 'FileSystem\\\\FileManger',\r\n );\r\n }", "function getAlias();", "public function getAlias();", "public function getAlias();", "public function getAlias();", "public function getAlias();", "public function getAlias();", "public function aliases(): array\n {\n return [\n 'svc' => Service::class,\n ];\n }", "public function getAliases(): array;", "protected function registerAliases()\n\t{\n\t\t$this->app->alias('clockwork', Clockwork::class);\n\n\t\t$this->app->alias('clockwork.authenticator', AuthenticatorInterface::class);\n\t\t$this->app->alias('clockwork.storage', StorageInterface::class);\n\t\t$this->app->alias('clockwork.support', ClockworkSupport::class);\n\n\t\t$this->app->alias('clockwork.cache', LaravelCacheDataSource::class);\n\t\t$this->app->alias('clockwork.eloquent', EloquentDataSource::class);\n\t\t$this->app->alias('clockwork.events', LaravelEventsDataSource::class);\n\t\t$this->app->alias('clockwork.laravel', LaravelDataSource::class);\n\t\t$this->app->alias('clockwork.notifications', LaravelNotificationsDataSource::class);\n\t\t$this->app->alias('clockwork.queue', LaravelQueueDataSource::class);\n\t\t$this->app->alias('clockwork.redis', LaravelRedisDataSource::class);\n\t\t$this->app->alias('clockwork.swift', SwiftDataSource::class);\n\t\t$this->app->alias('clockwork.xdebug', XdebugDataSource::class);\n\t}", "public function getAliases() {\r\n \treturn [];\r\n }", "public function getAliases()\n {\n return [];\n }", "public function aliases(): array\n {\n return [];\n }", "protected function registerAliases()\n {\n //$this->app->alias('ellaisys.aws.cognito', AwsCognito::class);\n }", "public function setAliases()\n {\n $this->app->booting( function()\n {\n $loader = AliasLoader::getInstance();\n \n // Facades\n $loader->alias('Alert', 'App\\Anm\\src\\alert\\AlertFacade');\n });\n }", "public function getAliases(): array\n {\n return [\n // Configuration holders\n FFMpegConfig::class => FFMpegConfigInterface::class,\n FFProbeConfig::class => FFProbeConfigInterface::class,\n\n // Services\n VideoConverter::class => VideoConverterInterface::class,\n VideoInfoReader::class => VideoInfoReaderInterface::class,\n VideoAnalyzer::class => VideoAnalyzerInterface::class,\n VideoThumbGenerator::class => VideoThumbGeneratorInterface::class,\n ];\n }", "public function getAliases(): array\n {\n return [];\n }", "public function getAliases(): array\n {\n return [];\n }", "public function getAliases(): array\n {\n return [];\n }", "protected function registerClassAliases()\n {\n// $serviceAliases = [\n// \\Dingo\\Api\\Http\\Request::class => \\Dingo\\Api\\Contract\\Http\\Request::class,\n// 'api.dispatcher' => \\Dingo\\Api\\Dispatcher::class,\n// 'api.http.validator' => \\Dingo\\Api\\Http\\RequestValidator::class,\n// 'api.http.response' => \\Dingo\\Api\\Http\\Response\\Factory::class,\n// 'api.router' => \\Dingo\\Api\\Routing\\Router::class,\n// 'api.router.adapter' => \\Dingo\\Api\\Contract\\Routing\\Adapter::class,\n// 'api.auth' => \\Dingo\\Api\\Auth\\Auth::class,\n// 'api.limiting' => \\Dingo\\Api\\Http\\RateLimit\\Handler::class,\n// 'api.transformer' => \\Dingo\\Api\\Transformer\\Factory::class,\n// 'api.url' => \\Dingo\\Api\\Routing\\UrlGenerator::class,\n// 'api.exception' => [\\Dingo\\Api\\Exception\\Handler::class, \\Dingo\\Api\\Contract\\Debug\\ExceptionHandler::class],\n// ];\n//\n// foreach ($serviceAliases as $key => $aliases) {\n// foreach ((array) $aliases as $alias) {\n// $this->app->alias($key, $alias);\n// }\n// }\n }", "public static function aliases()\n {\n\n return [\n 'Royalcms\\Component\\Filesystem\\Filesystem' => 'Illuminate\\Filesystem\\Filesystem',\n 'Royalcms\\Component\\Filesystem\\FilesystemAdapter' => 'Illuminate\\Filesystem\\FilesystemAdapter',\n 'Royalcms\\Component\\Filesystem\\FilesystemManager' => 'Illuminate\\Filesystem\\FilesystemManager'\n ];\n }" ]
[ "0.67247605", "0.67214406", "0.67184705", "0.67035913", "0.66397905", "0.66397905", "0.6602734", "0.66000605", "0.6573087", "0.65639204", "0.64810413", "0.6462279", "0.6462279", "0.6462279", "0.6462279", "0.6462279", "0.64473116", "0.6441894", "0.6431299", "0.6405457", "0.63852376", "0.6344543", "0.632869", "0.63233066", "0.6302706", "0.62532264", "0.62532264", "0.62532264", "0.62494254", "0.62442404" ]
0.6724128
1
Convert raw property values to the correct type according to a node type configuration
public function convert(NodeType $nodeType, $propertyName, $rawValue) { $propertyType = $nodeType->getPropertyType($propertyName); switch ($propertyType) { case 'string': return $rawValue; case 'reference': throw new \Exception("TODO FIX"); return $this->convertReference($rawValue, $context); case 'references': throw new \Exception("TODO FIX"); return $this->convertReferences($rawValue, $context); case 'DateTime': return $this->convertDateTime($rawValue); case 'integer': return $this->convertInteger($rawValue); case 'boolean': return $this->convertBoolean($rawValue); case 'array': return $this->convertArray($rawValue); default: $innerType = $propertyType; if ($propertyType !== null) { try { $parsedType = TypeHandling::parseType($propertyType); $innerType = $parsedType['elementType'] ?: $parsedType['type']; } catch (InvalidTypeException $exception) { } } if ((is_string($rawValue) || is_array($rawValue)) && $this->objectManager->isRegistered($innerType) && $rawValue !== '') { $propertyMappingConfiguration = new MvcPropertyMappingConfiguration(); $propertyMappingConfiguration->allowOverrideTargetType(); $propertyMappingConfiguration->allowAllProperties(); $propertyMappingConfiguration->skipUnknownProperties(); $propertyMappingConfiguration->setTypeConverterOption(PersistentObjectConverter::class, PersistentObjectConverter::CONFIGURATION_MODIFICATION_ALLOWED, true); $propertyMappingConfiguration->setTypeConverterOption(PersistentObjectConverter::class, PersistentObjectConverter::CONFIGURATION_CREATION_ALLOWED, true); return $this->propertyMapper->convert($rawValue, $propertyType, $propertyMappingConfiguration); } else { return $rawValue; } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function propsToXML($properties): array\n {\n $namespaces = [\n NS::PREFIX_MIX => NS::NAMESPACE_MIX,\n NS::PREFIX_NT => NS::NAMESPACE_NT,\n 'xs' => 'http://www.w3.org/2001/XMLSchema',\n NS::PREFIX_JCR => NS::NAMESPACE_JCR,\n NS::PREFIX_SV => NS::NAMESPACE_SV,\n 'rep' => 'internal',\n ];\n\n $doms = [\n 'stringDom' => [],\n 'numericalDom' => [],\n ];\n\n $binaryData = $references = [];\n\n foreach ($properties as $property) {\n $targetDoms = ['stringDom'];\n\n switch ($property->getType()) {\n case PropertyType::WEAKREFERENCE:\n case PropertyType::REFERENCE:\n $references[$property->getName()] = [\n 'type' => $property->getType(),\n 'values' => $property->isMultiple() ? $property->getString() : [$property->getString()],\n ];\n // no break\n case PropertyType::NAME:\n case PropertyType::URI:\n case PropertyType::PATH:\n case PropertyType::STRING:\n $values = $property->getString();\n break;\n case PropertyType::DECIMAL:\n $values = $property->getDecimal();\n $targetDoms[] = 'numericalDom';\n break;\n case PropertyType::BOOLEAN:\n $values = array_map('intval', (array) $property->getBoolean());\n break;\n case PropertyType::LONG:\n $values = $property->getLong();\n $targetDoms[] = 'numericalDom';\n break;\n case PropertyType::BINARY:\n if ($property->isNew() || $property->isModified()) {\n $values = [];\n foreach ((array) $property->getValueForStorage() as $stream) {\n if (null === $stream) {\n $binary = '';\n } else {\n $binary = stream_get_contents($stream);\n fclose($stream);\n }\n $binaryData[$property->getName()][] = $binary;\n $length = strlen($binary);\n $values[] = $length;\n }\n } else {\n $values = $property->getLength();\n if (!$property->isMultiple() && empty($values)) {\n $values = [0];\n }\n }\n break;\n case PropertyType::DATE:\n $values = $property->getDate();\n if ($values instanceof \\DateTime) {\n $values = [$values];\n }\n foreach ((array) $values as $key => $date) {\n if ($date instanceof \\DateTime) {\n // do not modify the instance which is associated with the node.\n $date = clone $date;\n\n // normalize to UTC for storage.\n $date->setTimezone(new \\DateTimeZone('UTC'));\n }\n $values[$key] = $date;\n }\n $values = $this->valueConverter->convertType($values, PropertyType::STRING);\n break;\n case PropertyType::DOUBLE:\n $values = $property->getDouble();\n $targetDoms[] = 'numericalDom';\n break;\n default:\n throw new RepositoryException('unknown type '.$property->getType());\n }\n\n foreach ($targetDoms as $targetDom) {\n $doms[$targetDom][] = [\n 'name' => $property->getName(),\n 'type' => PropertyType::nameFromValue($property->getType()),\n 'multiple' => $property->isMultiple(),\n 'lengths' => (array) $property->getLength(),\n 'values' => $values,\n ];\n }\n }\n\n $ret = [\n 'stringDom' => null,\n 'numericalDom' => null,\n 'binaryData' => $binaryData,\n 'references' => $references,\n ];\n\n foreach ($doms as $targetDom => $properties) {\n $dom = new \\DOMDocument('1.0', 'UTF-8');\n $rootNode = $dom->createElement('sv:node');\n foreach ($namespaces as $namespace => $uri) {\n $rootNode->setAttribute('xmlns:'.$namespace, $uri);\n }\n $dom->appendChild($rootNode);\n\n foreach ($properties as $property) {\n /* @var $property Property */\n $propertyNode = $dom->createElement('sv:property');\n $propertyNode->setAttribute('sv:name', $property['name']);\n $propertyNode->setAttribute('sv:type', $property['type']);\n $propertyNode->setAttribute('sv:multi-valued', $property['multiple'] ? '1' : '0');\n $lengths = (array) $property['lengths'];\n foreach ((array) $property['values'] as $key => $value) {\n $element = $propertyNode->appendChild($dom->createElement('sv:value'));\n $element->appendChild($dom->createTextNode($value));\n if (array_key_exists($key, $lengths)) {\n $lengthAttribute = $dom->createAttribute('length');\n $lengthAttribute->value = $lengths[$key];\n $element->appendChild($lengthAttribute);\n }\n }\n\n $rootNode->appendChild($propertyNode);\n }\n\n if (count($properties)) {\n $ret[$targetDom] = $dom;\n }\n }\n\n return $ret;\n }", "protected function _toType($value)\n {\n // Check for PHP specials\n self::_unserialize($value);\n if (!is_scalar($value)) {\n return $value;\n }\n\n // Used in a lot of cases.\n $lower_value = strtolower($value);\n\n if (preg_match('/^(\"(.*)\"|\\'(.*)\\')/', $value, $matches)) {\n $value = (string)str_replace(array('\\'\\'', '\\\\\\''), \"'\", end($matches));\n $value = str_replace('\\\\\"', '\"', $value);\n } elseif (preg_match('/^\\\\[(\\s*)\\\\]$/', $value)) {\n // empty inline mapping\n $value = array();\n } elseif (preg_match('/^\\\\[(.+)\\\\]$/', $value, $matches)) {\n // Inline Sequence\n\n // Take out strings sequences and mappings\n $explode = $this->_inlineEscape($matches[1]);\n\n // Propogate value array\n $value = array();\n foreach ($explode as $v) {\n $value[] = $this->_toType($v);\n }\n } elseif (preg_match('/^\\\\{(\\s*)\\\\}$/', $value)) {\n // empty inline mapping\n $value = array();\n } elseif (strpos($value, ': ') !== false && !preg_match('/^{(.+)/', $value)) {\n // inline mapping\n $array = explode(': ', $value);\n $key = trim($array[0]);\n array_shift($array);\n $value = trim(implode(': ', $array));\n $value = $this->_toType($value);\n $value = array($key => $value);\n } elseif (preg_match(\"/{(.+)}$/\", $value, $matches)) {\n // Inline Mapping\n\n // Take out strings sequences and mappings\n $explode = $this->_inlineEscape($matches[1]);\n\n // Propogate value array\n $array = array();\n foreach ($explode as $v) {\n $array = $array + $this->_toType($v);\n }\n $value = $array;\n } elseif ($lower_value == 'null' || $value == '' || $value == '~') {\n $value = null;\n } elseif ($lower_value == '.nan') {\n $value = NAN;\n } elseif ($lower_value == '.inf') {\n $value = INF;\n } elseif ($lower_value == '-.inf') {\n $value = -INF;\n } elseif (ctype_digit($value)) {\n $value = (int)$value;\n } elseif (in_array($lower_value,\n array('true', 'on', '+', 'yes', 'y'))) {\n $value = true;\n } elseif (in_array($lower_value,\n array('false', 'off', '-', 'no', 'n'))) {\n $value = false;\n } elseif (is_numeric($value)) {\n $value = (float)$value;\n } else {\n // Just a normal string, right?\n if (($pos = strpos($value, '#')) !== false) {\n $value = substr($value, 0, $pos);\n }\n $value = trim($value);\n }\n\n return $value;\n }", "protected function _toType($value)\n {\n // Check for PHP specials\n self::_unserialize($value);\n if (!is_scalar($value)) {\n return $value;\n }\n\n // Used in a lot of cases.\n $lower_value = strtolower($value);\n\n if (preg_match('/^(\"(.*)\"|\\'(.*)\\')/', $value, $matches)) {\n $value = (string)str_replace(array('\\'\\'', '\\\\\\''), \"'\", end($matches));\n $value = str_replace('\\\\\"', '\"', $value);\n } elseif (preg_match('/^\\\\[(\\s*)\\\\]$/', $value)) {\n // empty inline mapping\n $value = array();\n } elseif (preg_match('/^\\\\[(.+)\\\\]$/', $value, $matches)) {\n // Inline Sequence\n\n // Take out strings sequences and mappings\n $explode = $this->_inlineEscape($matches[1]);\n\n // Propogate value array\n $value = array();\n foreach ($explode as $v) {\n $value[] = $this->_toType($v);\n }\n } elseif (preg_match('/^\\\\{(\\s*)\\\\}$/', $value)) {\n // empty inline mapping\n $value = array();\n } elseif (strpos($value, ': ') !== false &&\n !preg_match('/^{(.+)/', $value)) {\n // inline mapping\n $array = explode(': ', $value);\n $key = trim($array[0]);\n array_shift($array);\n $value = trim(implode(': ', $array));\n $value = $this->_toType($value);\n $value = array($key => $value);\n } elseif (preg_match(\"/{(.+)}$/\", $value, $matches)) {\n // Inline Mapping\n\n // Take out strings sequences and mappings\n $explode = $this->_inlineEscape($matches[1]);\n\n // Propogate value array\n $array = array();\n foreach ($explode as $v) {\n $array = $array + $this->_toType($v);\n }\n $value = $array;\n } elseif ($lower_value == 'null' || $value == '' || $value == '~') {\n $value = null;\n } elseif ($lower_value == '.nan') {\n $value = NAN;\n } elseif ($lower_value == '.inf') {\n $value = INF;\n } elseif ($lower_value == '-.inf') {\n $value = -INF;\n } elseif (ctype_digit($value)) {\n $value = (int)$value;\n } elseif (in_array($lower_value,\n array('true', 'on', '+', 'yes', 'y'))) {\n $value = true;\n } elseif (in_array($lower_value,\n array('false', 'off', '-', 'no', 'n'))) {\n $value = false;\n } elseif (is_numeric($value)) {\n $value = (float)$value;\n } else {\n // Just a normal string, right?\n if (($pos = strpos($value, '#')) !== false) {\n $value = substr($value, 0, $pos);\n }\n $value = trim($value);\n }\n\n return $value;\n }", "public function getSourceChildPropertiesToBeConverted($source);", "private function transformCast(mixed $value, string $key): mixed\n {\n try {\n $annotation = new Annotation($this);\n $propertiesAnnotation = $annotation->getPropertiesAnnotations();\n foreach ($propertiesAnnotation as $name => $propertyAnnotation) {\n if ($name == $key && $propertyAnnotation->hasParam('Cast')) {\n $type = $propertyAnnotation->getParam('Cast')->getProperty();\n if ($this->isDefaultTypes($type)) {\n $value = settype($value, $type);\n } elseif ($type == 'array') {\n $value = json_decode($value, true);\n }elseif ($type == 'object') {\n $value = json_decode($value);\n }elseif ($type == 'serialize') {\n $value = @unserialize($value);\n } elseif (method_exists($this, 'to' . ucfirst($type))) {\n $value = $this->{'to' . ucfirst($type)}($value, $key);\n }\n break;\n }\n }\n return $value;\n } catch (Exception $exception) {\n return $value;\n }\n }", "private static function _convertXmlrpcTypes($result)\n {\n if (is_array($result)) {\n // Return case 1: The result is an empty array. Return the empty\n // array.\n if (empty($result)) {\n return $result;\n }\n\n // Return case 2: The result is a non-empty array. Loop through\n // array elements and recursively translate every element.\n // Return the fully translated array.\n foreach ($result as $key => $value) {\n $result[$key] = self::_convertXmlrpcTypes($value);\n }\n\n return $result;\n }\n\n // Return case 3: The result is an xmlrpc scalar. Convert it to a normal\n // variable and return it.\n if (is_object($result) && null !== $result->scalar && null !== $result->xmlrpc_type) {\n // Convert known xmlrpc types, otherwise unset the value.\n switch ($result->xmlrpc_type) {\n case 'base64':\n return $result->scalar;\n default:\n return null;\n }\n }\n\n // Return case 4: Otherwise the result is a non-array and non xml-rpc\n // scalar variable. Return it unmolested.\n\n return $result;\n }", "function getItemPropertyTypes(){\n \t// $propertyTypes = $this->database->queryToArray($sql);\n \t$propertyTypes = SmartestCache::load('datatypes_xml_file_data', true);\n\t\treturn $propertyTypes;\n\t}", "private function setTypeByValue(){\n\t\t$value = $this->value;\n\t\t\n\t\tif(is_null($value)){\n\t\t\t$type = 'static';\n\t\t}else if(is_numeric($value)){\n\t\t\t$type = 'number';\n\t\t}else{\n\t\t\t$type = gettype($value);\n\t\t}\n\t\t\n\t\t$this->setType($type);\n\t}", "public function convert($source)\n {\n $output = [];\n $xpath = new \\DOMXPath($source);\n $types = $xpath->evaluate('/config/type');\n /** @var $typeNode \\DOMNode */\n foreach ($types as $typeNode) {\n $typeName = $this->_getAttributeValue($typeNode, 'name');\n $isComposite = $this->_getAttributeValue($typeNode, 'composite', 'false');\n $isDecimal = $this->_getAttributeValue($typeNode, 'canUseQtyDecimals', 'true');\n $isQty = $this->_getAttributeValue($typeNode, 'isQty', 'false');\n $data = [];\n $data['name'] = $typeName;\n $data['label'] = $this->_getAttributeValue($typeNode, 'label', '');\n $data['model'] = $this->_getAttributeValue($typeNode, 'modelInstance');\n $data['composite'] = !empty($isComposite) && 'false' !== $isComposite;\n $data['index_priority'] = (int)$this->_getAttributeValue($typeNode, 'indexPriority', 0);\n $data['can_use_qty_decimals'] = !empty($isDecimal) && 'false' !== $isDecimal;\n $data['is_qty'] = !empty($isQty) && 'false' !== $isQty;\n $data['sort_order'] = (int)$this->_getAttributeValue($typeNode, 'sortOrder', 0);\n\n /** @var $childNode \\DOMNode */\n foreach ($typeNode->childNodes as $childNode) {\n if ($childNode->nodeType != XML_ELEMENT_NODE) {\n continue;\n }\n\n switch ($childNode->nodeName) {\n case 'priceModel':\n $data['price_model'] = $this->_getAttributeValue($childNode, 'instance');\n break;\n case 'indexerModel':\n $data['price_indexer'] = $this->_getAttributeValue($childNode, 'instance');\n break;\n case 'stockIndexerModel':\n $data['stock_indexer'] = $this->_getAttributeValue($childNode, 'instance');\n break;\n case 'allowedSelectionTypes':\n /** @var $selectionsTypes \\DOMNode */\n foreach ($childNode->childNodes as $selectionsTypes) {\n if ($selectionsTypes->nodeType != XML_ELEMENT_NODE) {\n continue;\n }\n $name = $this->_getAttributeValue($selectionsTypes, 'name');\n $data['allowed_selection_types'][$name] = $name;\n }\n break;\n case 'customAttributes':\n /** @var $customAttributes \\DOMNode */\n foreach ($childNode->childNodes as $customAttributes) {\n if ($customAttributes->nodeType != XML_ELEMENT_NODE) {\n continue;\n }\n $name = $this->_getAttributeValue($customAttributes, 'name');\n $value = $this->_getAttributeValue($customAttributes, 'value');\n $data['custom_attributes'][$name] = $value;\n }\n break;\n }\n }\n $output['types'][$typeName] = $data;\n }\n\n $composableTypes = $xpath->evaluate('/config/composableTypes/*');\n $output['composableTypes'] = [];\n foreach ($composableTypes as $typeNode) {\n $typeName = $this->_getAttributeValue($typeNode, 'name');\n $output['composableTypes'][$typeName] = $typeName;\n }\n\n return $output;\n }", "public abstract function coerce($value);", "abstract protected function doActualConvert();", "public function convertFieldOptionsToObjects()\n {\n // Convert the options of the node config fields to objects. This is needed when building the form.\n $nodeConfigFields = $this->getFields();\n foreach ($nodeConfigFields as $nodeConfigField) {\n $nodeConfigField->convertOptionsToObject();\n }\n }", "protected function getValueFromNode($node)\n\t{\n\t\tswitch ($node['type'])\n\t\t{\n\t\t\tcase 'integer':\n\t\t\t\t$value = (string) $node;\n\t\t\t\treturn (int) $value;\n\t\t\t\tbreak;\n\t\t\tcase 'string':\n\t\t\t\treturn (string) $node;\n\t\t\t\tbreak;\n\t\t\tcase 'boolean':\n\t\t\t\t$value = (string) $node;\n\t\t\t\treturn (bool) $value;\n\t\t\t\tbreak;\n\t\t\tcase 'double':\n\t\t\t\t$value = (string) $node;\n\t\t\t\treturn (float) $value;\n\t\t\t\tbreak;\n\t\t\tcase 'array':\n\t\t\t\t$value = array();\n\t\t\t\tforeach ($node->children() as $child)\n\t\t\t\t{\n\t\t\t\t\t$value[(string) $child['name']] = $this->getValueFromNode($child);\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\t$value = new stdClass;\n\t\t\t\tforeach ($node->children() as $child)\n\t\t\t\t{\n\t\t\t\t\t$value->{$child['name']} = $this->getValueFromNode($child);\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t}\n\n\t\treturn $value;\n\t}", "private function setTypeDefault(): void\n {\n $propertyTypeCommon = PropertyTypeCommon::getInstance();\n \n $pattern = Pattern::getInstance();\n $patternBranchName = [];\n $patternBranchName['ua'] = $pattern->getBranchNameUa();\n $patternBranchName['en'] = $pattern->getBranchNameEn();\n $patternBranchName['ru'] = $pattern->getBranchNameRu();\n\n /**\n * Internal key name => type object\n */\n $type = [\n 'id' => $propertyTypeCommon->getBranchId(),\n 'parent_id' => new TypeInt($propertyTypeCommon->getBranchId()->getMin(), $propertyTypeCommon->getBranchId()->getMax(), true),\n 'type_id' => $propertyTypeCommon->getBranchTypeId(),\n 'number' => $propertyTypeCommon->getBranchNumber(),\n 'name_ua' => new TypeString(1, 80, $patternBranchName['ua']),\n 'name_en' => new TypeString(0, 80, $patternBranchName['en']),\n 'name_ru' => new TypeString(1, 80, $patternBranchName['ru']),\n 'name_short_ua' => new TypeString(1, 30, $patternBranchName['ua']),\n 'name_short_en' => new TypeString(0, 30, $patternBranchName['en']),\n 'name_short_ru' => new TypeString(1, 30, $patternBranchName['ru']),\n 'locality_id' => $propertyTypeCommon->getLocalityId(),\n 'latitude' => $propertyTypeCommon->getCoordinate(),\n 'longitude' => $propertyTypeCommon->getCoordinate(),\n 'company_id' => $propertyTypeCommon->getCompanyId(),\n 'address_ua' => $propertyTypeCommon->getAddressUa(),\n 'address_en' => $propertyTypeCommon->getAddressEn(),\n 'address_ru' => $propertyTypeCommon->getAddressRu(),\n 'update_date' => $propertyTypeCommon->getUpdateDate(),\n 'status' => $propertyTypeCommon->getStatus(),\n ];\n \n $this->typeHook->_setAll($type);\n }", "public function convertFrom($source, $targetType, array $convertedChildProperties = array(), \\TYPO3\\Flow\\Property\\PropertyMappingConfigurationInterface $configuration = NULL) {\n\n\t\tif (is_array($source)) {\n\t\t\t$type = $this->typeRepository->findByIdentifier($source['__identity']);\n\t\t} else {\n\t\t\t$type = $this->typeRepository->findByIdentifier($source);\n\t\t}\n\n\t\treturn $type;\n\t}", "abstract public function convert();", "public function unserializeProperties()\n {\n parent::unserializeProperties();\n\n $this->xmlTags = ($this->xmlTags) ? unserialize($this->xmlTags) : array();\n\n if (is_string($this->semanticData))\n $this->semanticData = unserialize($this->semanticData);\n elseif (!$this->semanticData)\n $this->semanticData = new wcmSemanticData();\n }", "protected function initPropertyFromXMLNode($property, $node)\n {\n if ($property == 'xmlTags')\n {\n // Assume <tags> <tag category=\"{category}\">{tag}</tag> ... </tags>\n $this->xmlTags = array();\n foreach($node->childNodes as $child)\n {\n $this->xmlTags[$child->nodeValue] = $child->getAttribute('category');\n }\n }\n elseif ($property == 'semanticData')\n {\n $this->semanticData->fromXML($node);\n }\n elseif ($property == 'publicationDate')\n {\n $this->$property = dateFromISO8601($node->nodeValue);\n }\n else\n {\n parent::initPropertyFromXMLNode($property, $node);\n }\n }", "private function __typify( $values, $field = null ) {\n \n // Catch the original format.\n $array = is_array($values);\n \n // Convert non-array values to an array for easier manipulation.\n if( !$array ) $values = [$values];\n \n // Loop through each value.\n foreach( $values as $key => $value ) { \n \n // Always ignore postmarks.\n if( $key === 'postmark' or $field === 'postmark' ) continue;\n \n // Convert each value within arrays.\n elseif( is_array($value) ) { $values[$key] = $this->__typify($value, $field); }\n \n // Convert numeric values to numbers.\n elseif( is_numeric($value) ) { $values[$key] = (float) $value; }\n \n // Convert boolean values to `true` or `false`.\n elseif( in_array($value, ['true', 'false']) ) { $values[$key] = $value == 'true' ? true : false; }\n \n // Convert null values to `null`.\n elseif( $value == 'null' ) { $values[$key] = null; }\n \n // Convert date-like values to dates.\n elseif( preg_match('/\\d/', $value) and (bool) ($time = strtotime($value)) ) { $values[$key] = (new DateTime())->setTimestamp($time); }\n \n }\n\n // Return new value.\n return $array ? $values : $values[0];\n \n }", "public function getPropertyType()\n {\n $query = \" SELECT propertyType FROM $this->propertyTypeTable\";\n $exist = $this->conn->prepare($query);\n $exist->execute();\n while($row = $exist->fetch(PDO::FETCH_ASSOC)){\n $data[]=$row[\"propertyType\"];\n }\n return $data;\n }", "function _metatag_importer_convert_type($type) {\n // define('NODEWORDS_TYPE_DEFAULT', 1);\n // define('NODEWORDS_TYPE_ERRORPAGE', 2);\n // define('NODEWORDS_TYPE_FRONTPAGE', 3);\n // define('NODEWORDS_TYPE_NONE', 0);\n // define('NODEWORDS_TYPE_NODE', 5);\n // define('NODEWORDS_TYPE_PAGE', 10);\n // define('NODEWORDS_TYPE_PAGER', 4);\n // define('NODEWORDS_TYPE_TERM', 6);\n // define('NODEWORDS_TYPE_TRACKER', 7);\n // define('NODEWORDS_TYPE_USER', 8);\n // define('NODEWORDS_TYPE_VOCABULARY', 9);\n switch ($type) {\n case 1:\n return 'global';\n\n case 2:\n return 'global:404';\n\n case 3:\n return 'global:frontpage';\n\n // @todo Not yet sure how to handle pager items?\n // case 4:\n // return 'pager';\n\n case 5:\n return 'node';\n\n case 6:\n return 'taxonomy_term';\n\n // @todo Not sure what to do with tracker pages.\n // case 7:\n // return 'tracker';\n\n case 8:\n return 'user';\n\n // @todo Vocabulary records need to be converted to a config for that entity\n // bundle.\n // case 9:\n // return 'vocabulary';\n\n // @todo Page records need to be converted to Context definitions.\n // case 10:\n // return 'page';\n }\n\n return FALSE;\n}", "private function prepareFromStringTypeTestData(): array\n {\n return [\n 'string -> int' => [new StringType(), new IntType(), MixedType::class],\n 'string -> float' => [new StringType(), new FloatType(), MixedType::class],\n 'string -> bool' => [new StringType(), new BoolType(), MixedType::class],\n 'string -> array' => [new StringType(), new ArrayType(), MixedType::class],\n 'string -> string' => [new StringType(), new StringType(), StringType::class],\n 'string -> mixed' => [new StringType(), new MixedType(), MixedType::class],\n ];\n }", "protected function typecast_value( $value, string $type ): mixed {\n\t\t$value = match ( $type ) {\n\t\t\t'CHAR',\n\t\t\t'VARCHAR',\n\t\t\t'TEXT',\n\t\t\t'DATE' => trim( strval( $value ) ),\n\t\t\t'BOOL' => boolval( $value ),\n\t\t\t'FLOAT' => floatval( $value ),\n\t\t\t'INT',\n\t\t\t'TINYINT' => intval( $value ),\n\t\t\tdefault => trim( strval( $value ) ),\n\t\t};\n\t\treturn $value;\n\t}", "public function convertDataType($product, $fields) {\n\t\tforeach($product as $fieldName => $value) {\n\t\t\tif($fieldName != \"associatedProducts\") {\n\t\t\t\t$product[$fieldName] = $this->convertDataTypeByValue($fields[$fieldName], $value);\n\t\t\t}\n\t\t}\n\t\treturn $product;\n\t}", "public function testResolvePropertyType()\n {\n $source = SourceCode::fromString(<<<'EOT'\n<?php\n\nclass Type1\n{\n /**\n * @var PropertyType\n */\n private $foobar;\n}\nEOT\n );\n $type = InferredType::fromString('Type1');\n $this->loader->loadSourceFor($type)->willReturn($source);\n\n $resolvedType = $this->resolver->propertyType($type, MethodName::fromString('foobar'));\n\n $this->assertEquals('PropertyType', (string) $resolvedType);\n }", "private function convertTypeOracleToTypePhp()\n {\n foreach($this->arra_simple_attribut as $key=>$arra_data)\n {\n switch($arra_data['type'])\n {\n case \"VARCHAR2\":\n $arra_data['type_php']=\"string\";\n break;\n case \"NUMBER\":\n $arra_data['type_php']=\"float\";\n break;\n case \"DATE\":\n $arra_data['type_php']=\"untypeddate\";\n break; \n default:\n $arra_data['type_php']=strtolower($arra_data['type']);\n break;\n }\n $this->arra_simple_attribut[$key]=$arra_data;\n }\n }", "public function runConvertToData()\n {\n // convert value property if necessary\n if (is_array($this->value) && is_array($this->recordConfig) && isset($this->recordConfig['modelName'])) {\n $value = array(\n 'modelName' => $this->recordConfig['modelName'],\n 'ids' => array(),\n );\n foreach ($this->value as $record) {\n if (isset($record['id'])) {\n $value['ids'][] = $record['id'];\n }\n }\n $this->value = json_encode($value);\n } else {\n parent::runConvertToData();\n }\n }", "abstract protected function cast($value);", "public function initializeObject() {\n\t\t// Adds standard type convertes for the following transforms: \n\t\t// - string => string\n\t\t// - integer => number\n\t\t// - float => number\n\t\t// - \\DateTime => date\n\t\t// - boolean => boolean\n\t\t\n\t\t$this->standardConverters['string'] = new TypeConverter('string', 'string', \n\t\t\t\tfunction ($value) { return $value; }, \n\t\t\t\tfunction($value) { return $value; /* leave type conversion to flow type converter */ });\n\t\t$this->standardConverters['integer'] = new TypeConverter('integer', 'number', \n\t\t\t\tfunction ($value) { return $value; }, \n\t\t\t\tfunction($value) { return $value; /* leave type conversion to flow type converter */ });\n\t\t$this->standardConverters['float'] = new TypeConverter('float', 'number', \n\t\t\t\tfunction ($value) { return $value; }, \n\t\t\t\tfunction($value) { return $value; /* leave type conversion to flow type converter */ });\n\t\t$this->standardConverters['boolean'] = new TypeConverter('boolean', 'boolean', \n\t\t\t\tfunction ($value) { return ($value) ? \"true\" : \"false\"; }, \n\t\t\t\tfunction($value) { return $value; /* leave type conversion to flow type converter */ });\n\t\t$this->standardConverters['date'] = new TypeConverter('DateTime', 'date', \n\t\t\t\tfunction ($value) { return $value->format(\\DateTime::ISO8601); /* ISO8601 is the preferred format for serializing date in json*/}, \n\t\t\t\tfunction($value) { \n\t\t\t\t\treturn array('date' => $value, 'dateFormat' => \"D, d M Y H:i:s T\"); // setup for flow type converter\n\t\t\t\t});\n\t}", "public function castExpression( $expression, $type );" ]
[ "0.5494892", "0.5248375", "0.5243027", "0.5242856", "0.5048924", "0.50311744", "0.5027361", "0.50233495", "0.5019356", "0.5004692", "0.49777576", "0.49613225", "0.4957544", "0.49558377", "0.49518636", "0.4943874", "0.4908191", "0.4896426", "0.48842493", "0.48655456", "0.48600852", "0.48523304", "0.4851585", "0.48505926", "0.4849422", "0.48413807", "0.48374864", "0.4834559", "0.48213136", "0.481157" ]
0.65187633
0
Convert raw value to reference
protected function convertReference($rawValue, Context $context) { return $context->getNodeByIdentifier($rawValue); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function normalise_ref($ref)\n\t{\n\t\treturn (is_int($ref) or is_string($ref)) ? (string)$ref : (string)$ref->id;\n\t}", "public function reference(): Reference;", "public function getRawValue();", "public function getRawValue();", "public function getReference() : string\n {\n\n $value = $this->getParameter( 'reference' );\n\n if ( null === $value ) { return $value; }\n\n return (string) $value;\n \n }", "public function getReference();", "public function getReference();", "public function getRef() {\n return @$this->attributes['ref'];\n }", "public function &getRawValue(string $name);", "public function &getValue(){\n\t\tif ($this->_realValued) return $this->_realValue;\n\t\telse return $this->_value;\n\t}", "public function ref(string $value = null)\n {\n if (null !== $value) {\n $this->reference = (string) $value;\n }\n\n return $this->reference;\n }", "public function resolve(): Reference;", "protected function convertReferences($rawValue, Context $context)\n {\n $nodeIdentifiers = $rawValue;\n $result = [];\n\n if (is_array($nodeIdentifiers)) {\n foreach ($nodeIdentifiers as $nodeIdentifier) {\n $referencedNode = $context->getNodeByIdentifier($nodeIdentifier);\n if ($referencedNode !== null) {\n $result[] = $referencedNode;\n }\n }\n }\n\n return $result;\n }", "public function getReference(): string\n {\n return $this->reference;\n }", "public function getReference(): string\n {\n return $this->reference;\n }", "public function getReference(): string\n {\n return $this->reference;\n }", "public function &getValue();", "public function getRef()\n {\n return $this->_reference;\n }", "public function getExternalReferenceValue()\n\t{\n\t\treturn intval(substr($this->externalReference, 13));\n\t}", "function get_var_ref(&$item)\n\t{\n\t\t$item = get_var($item);\n\t}", "public function setRefValue($value)\n {\n $this->refValue = $value;\n }", "public function value($rawvalue) {\n\t\treturn stripslashes(strval($rawvalue));\n\t}", "public function getReference()\n {\n return $this->reference;\n }", "protected function matchReference(&$value)\n {\n if (preg_match('/^\\[([[:alnum:]\\\\\\\\]+)\\]$/', $value, $match)) {\n return (boolean) ($value = $match[1]);\n }\n }", "public function addRef(&$value);", "public function getRealValue();", "public function createReference();", "public function getRefType() {\n $ref_parts = $this->explodeRef();\n return $ref_parts[1];\n }", "public function getCastedValue();", "public function raw()\n {\n return $this->value;\n }" ]
[ "0.613736", "0.6116721", "0.6067548", "0.6067548", "0.5991729", "0.5979819", "0.5979819", "0.58482254", "0.57845795", "0.57292616", "0.56229365", "0.5608027", "0.5517016", "0.5512733", "0.5512733", "0.5512733", "0.5491193", "0.5479253", "0.54717964", "0.5470902", "0.5469213", "0.54282767", "0.53869355", "0.5383335", "0.53678185", "0.5357366", "0.535691", "0.5356859", "0.53439075", "0.5311681" ]
0.66756314
0
Convert raw value to references
protected function convertReferences($rawValue, Context $context) { $nodeIdentifiers = $rawValue; $result = []; if (is_array($nodeIdentifiers)) { foreach ($nodeIdentifiers as $nodeIdentifier) { $referencedNode = $context->getNodeByIdentifier($nodeIdentifier); if ($referencedNode !== null) { $result[] = $referencedNode; } } } return $result; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function toRefs($arr){\n\t\t\t$refs = array();\n\t\t\tforeach($arr as $key => $value)\n\t\t\t\t$refs[$key] = &$arr[$key];\n\t\t\treturn $refs;\n\t\t}", "protected function convertReference($rawValue, Context $context)\n {\n return $context->getNodeByIdentifier($rawValue);\n }", "function refValues($arr){\n\n if (strnatcmp(phpversion(),'5.3') >= 0) //Reference is required for PHP 5.3+\n\n {\n\n $refs = array();\n\n foreach($arr as $key => $value)\n\n $refs[$key] = &$arr[$key];\n\n return $refs;\n\n }\n\n return $arr;\n\n }", "protected function refValues($arr)\n\t{\n\t\tif (strnatcmp ( phpversion (), '5.3' ) >= 0)\n\t\t{\n\t\t\t$refs = array ();\n\t\t\tforeach ( $arr as $key => $value )\n\t\t\t{\n\t\t\t\t$refs [$key] = & $arr [$key];\n\t\t\t}\n\t\t\treturn $refs;\n\t\t}\n\t\treturn $arr;\n\t}", "protected function refValues(array &$arr)\n {\n //Reference in the function arguments are required for HHVM to work\n //https://github.com/facebook/hhvm/issues/5155\n //Referenced data array is required by mysqli since PHP 5.3+\n if (strnatcmp(phpversion(), '5.3') >= 0) {\n $refs = array();\n foreach ($arr as $key => $value) {\n $refs[$key] = &$arr[$key];\n }\n return $refs;\n }\n return $arr;\n }", "public function getRawValue();", "public function getRawValue();", "public function reference(): Reference;", "protected function setReferenceValues()\n {\n $reference = $this->reference;\n foreach($reference as $key => $item)\n {\n $data = $item['TABLE']['DATA'];\n if(empty($data))\n {\n continue;\n }\n foreach($data as $val)\n {\n if(!isset($reference[$key]['DATA'][$val['NAME']]))\n {\n continue;\n }\n $reference[$key]['DATA'][$val['NAME']]['ID'] = $val['XML_ID'];\n }\n }\n return $reference;\n }", "function references_cast_code($class_name)\n{\n $derivations = derivationsOfClass($class_name);\n\n //Instead of using elseif we have to break it in multiple if since\n //MS Visual C++ compiler doesnt supports a very deep elseif sequence.\n $code .= \"bool reference_type_found = false;\\n\\n\";\n $code .= tabs(3) . \"if(current_object_type == PHP_\".strtoupper($class_name).\"_TYPE){\\n\";\n $code .= tabs(4) . \"references = &(({$class_name}_php*)native_object)->references;\\n\";\n $code .= tabs(4) . \"reference_type_found = true;\\n\";\n $code .= tabs(3) . \"}\\n\";\n\n foreach($derivations as $derivation_name=>$derivation_value)\n {\n $code .= tabs(3) . \"if((current_object_type == PHP_\".strtoupper($derivation_name).\"_TYPE) && (!reference_type_found)){\\n\";\n $code .= tabs(4) . \"references = &(({$derivation_name}_php*)native_object)->references;\\n\";\n $code .= tabs(4) . \"reference_type_found = true;\\n\";\n $code .= tabs(3) . \"}\\n\";\n }\n\n return $code;\n}", "private function normalise_ref($ref)\n\t{\n\t\treturn (is_int($ref) or is_string($ref)) ? (string)$ref : (string)$ref->id;\n\t}", "public function values(&$values);", "public function getFieldValueReferences() {\n return $this->fieldValueReferences;\n }", "public function getFieldValueReferences() {\n return $this->fieldValueReferences;\n }", "public function getFieldValueReferences() {\n return $this->fieldValueReferences;\n }", "public function getFieldValueReferences() {\n return $this->fieldValueReferences;\n }", "public function getFieldValueReferences() {\n return $this->fieldValueReferences;\n }", "public function getFieldValueReferences() {\n return $this->fieldValueReferences;\n }", "public function getFieldValueReferences() {\n return $this->fieldValueReferences;\n }", "public function getFieldValueReferences() {\n return $this->fieldValueReferences;\n }", "public function resolve(): Reference;", "public function getCastedValue();", "public function addRef(&$value);", "public function getReference();", "public function getReference();", "public function &getValue();", "public function setRefValue($value)\n {\n $this->refValue = $value;\n }", "protected function setReferenceData()\n {\n $data = $this->getDataRoot();\n $offers = $data['Каталог']['Товары']['Товар'];\n $reference = $this->reference;\n \n if(empty($offers))\n {\n return $reference;\n }\n //one offer\n if(!empty($offers['Ид']))\n {\n $offers = [$offers];\n }\n \n foreach($offers as $offer)\n {\n $props = $offer['ЗначенияСвойств']['ЗначенияСвойства'];\n if(empty($props))\n {\n continue;\n }\n $multi = false;\n \n foreach($reference as $i=>$ref)\n {\n $xmlId = $ref['TABLE']['PROP_XML_ID'];\n foreach($props as $prop)\n {\n $name = $prop['Ид'];\n if($xmlId != $name || empty($prop['Значение']))\n {\n continue;\n }\n if(is_array($prop['Значение']))\n {\n $multi = true;\n\n foreach($prop['Значение'] as $subval)\n {\n $reference[$i]['DATA'][$subval] = [\n 'ID'=>'',\n 'VALUE'=>$subval\n ];\n }\n }\n else\n {//saves a plurality of\n if($reference[$i]['PARAMS']['MULTI'])\n {\n $multi = true;\n }\n $reference[$i]['DATA'][$prop['Значение']] = [\n 'ID'=>'',\n 'VALUE'=>$prop['Значение']\n ];\n }\n $reference[$i]['PARAMS']['MULTI'] = $multi;\n }\n }\n }\n return $reference;\n }", "public function &getRawValue(string $name);", "public function getRef() {\n return @$this->attributes['ref'];\n }" ]
[ "0.60265505", "0.5960376", "0.59063584", "0.5690392", "0.5606198", "0.5452787", "0.5452787", "0.53869563", "0.5306081", "0.5261074", "0.5235478", "0.521914", "0.5215894", "0.5215894", "0.5215894", "0.5215894", "0.5215894", "0.5215894", "0.5215894", "0.5215894", "0.512304", "0.50732887", "0.50673777", "0.506621", "0.506621", "0.5029855", "0.5008685", "0.49896732", "0.49834114", "0.49574032" ]
0.6476906
0
Convert raw value to integer
protected function convertInteger($rawValue) { return (int)$rawValue; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function asInt() { return $this->map('intval'); }", "public function toInt()\n {\n return new Int((int) $this->value);\n }", "public function toInt(): int;", "public function toInt(): int\n {\n if (is_scalar($this->var)) {\n $sanitize = new Sanitize($this->var);\n return (int)$sanitize->data();\n }\n\n return 0;\n }", "public function intValue(): int { return (int)$this->num; }", "function toInt($val) {\n return (int) $val;\n}", "public function toInt()\n {\n return (int)$this->activeValue;\n }", "public function toInteger()\n\t{\n\t\treturn (int) $this->string;\n\t}", "public function toInt() : int\n {\n return array_search($this->value, self::getValues()) + 1;\n }", "public function int($value)\n {\n\n return (int)$value;\n\n }", "final protected function asInt($value)\n\t{\n\t\treturn is_null($value) ? $value : intval($value);\n\t}", "private function castInteger($value): int\n {\n return (int) $value;\n }", "public function getValue()\n {\n return (int) $this->value;\n }", "public static function to_integer( $value ) {\n\t\treturn ( int ) $value;\n\t}", "public function toInt()\n\t{\n\t\treturn self::getIntValue($this->status);\n\t}", "public static function toInteger($value) : int {\n\t\t\t$type = gettype($value);\n\t\t\tswitch ($type) {\n\t\t\t\tcase 'boolean':\n\t\t\t\t\treturn intval($value);\n\t\t\t\tcase 'double':\n\t\t\t\t\treturn intval($value);\n\t\t\t\tcase 'integer':\n\t\t\t\t\treturn $value;\n\t\t\t\tcase 'NULL':\n\t\t\t\t\treturn 0;\n\t\t\t\tcase 'object':\n\t\t\t\t\tif (method_exists($value, 'toInteger')) {\n\t\t\t\t\t\treturn $value->toInteger();\n\t\t\t\t\t}\n\t\t\t\t\telse if ($value instanceof Common\\StringRef) {\n\t\t\t\t\t\treturn static::toInteger($value->__toString());\n\t\t\t\t\t}\n\t\t\t\t\telse if ($value instanceof Core\\Data\\Undefined) {\n\t\t\t\t\t\treturn 0;\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\tthrow new Throwable\\Parse\\Exception('Invalid cast. Could not convert value of type \":type\" to an integer.', array(':type' => get_class($value)));\n\t\t\t\t\t}\n\t\t\t\tcase 'string':\n\t\t\t\t\t$value = trim($value);\n\t\t\t\t\tif (empty($value)) {\n\t\t\t\t\t\treturn 0;\n\t\t\t\t\t}\n\t\t\t\t\tif (isset($value[0]) && ($value[0] == '.')) {\n\t\t\t\t\t\t$value = '0' . $value;\n\t\t\t\t\t}\n\t\t\t\t\tif (!preg_match('/^[+-]?([0-9]+)((\\.[0-9]+)|([eE][+-]?(0|[1-9][0-9]*)))?$/', $value)) {\n\t\t\t\t\t\tthrow new Throwable\\Parse\\Exception('Invalid cast. Could not convert value of type \":type\" to an integer.', array(':type' => $type));\n\t\t\t\t\t}\n\t\t\t\t\treturn intval($value);\n\t\t\t\tdefault:\n\t\t\t\t\tthrow new Throwable\\Parse\\Exception('Invalid cast. Could not convert value of type \":type\" to an integer.', array(':type' => $type));\n\t\t\t}\n\t\t}", "public function toInt()\n {\n return (int)$this->floatValue;\n }", "protected function valueAsInt($value)\n {\n // TODO: Migrate to converter\n return (int) $this->valueAsString($value);\n }", "public function getIntValue(): int {\n return (int) $this->_value;\n }", "protected function convertToInt($value) {\n $converted_value = (int) $value;\n return ($value !== (string) $converted_value) ? $value : $converted_value;\n }", "private function readInt()\n {\n list(,$res) = unpack('N', $this->read(4));\n if (PHP_INT_SIZE !== 4) {\n $res = sprintf(\"%u\", $res);\n }\n return intval($res);\n }", "private function toInteger($value)\n {\n $value = str_replace('.', '', $value);\n return (int) $value;\n }", "public function getInteger()\n\t{\n\t\treturn new Integer($this->toInteger());\n\t}", "protected function decodeID($value) {\n return (int)$value;\n }", "public function getInt()\n {\n return $this->getValue();\n }", "public function getInt()\n {\n $pos = $this->position;\n $this->position += 4;\n return (int)implode('', unpack('i', substr($this->buff, $pos, 4)));\n }", "protected function numeric_value() {\r\n $v = (string)($this->value());\r\n $result = 0;\r\n if (core_text::strpos($v, '.') === false) {\r\n if (core_text::strpos($v, 'x') !== false || core_text::strpos($v, 'X') !== false) {\r\n $result = hexdec($v);\r\n } else {\r\n if ($v != '0' && $v[0] == '0') {\r\n $result = octdec($v);\r\n } else {\r\n $result = floatval($v);\r\n }\r\n }\r\n } else {\r\n $result = floatval($v);\r\n }\r\n return $result;\r\n }", "protected function _arrayWalkIntCast($value) {\n\t\treturn (int) $value;\n\t}", "private function decodeInteger()\n {\n $offsetOfE = strpos($this->source, \"e\", $this->offset);\n if (false === $offsetOfE) {\n throw new RuntimeException(\"Unterminated integer entity at offset $this->offset\");\n }\n\n $currentOffset = $this->offset;\n if (\"-\" == $this->getChar($currentOffset)) {\n ++$currentOffset;\n }\n\n if ($offsetOfE === $currentOffset) {\n throw new RuntimeException(\"Empty integer entity at offset $this->offset\");\n }\n\n while ($currentOffset < $offsetOfE) {\n if (!ctype_digit($this->getChar($currentOffset))) {\n throw new RuntimeException(\"Non-numeric character found in integer entity at offset $this->offset\");\n }\n ++$currentOffset;\n }\n\n $value = substr($this->source, $this->offset, $offsetOfE - $this->offset);\n\n // One last check to make sure zero-padded integers don't slip by, as\n // they're not allowed per bencode specification.\n $absoluteValue = (string) abs($value);\n if (1 < strlen($absoluteValue) && \"0\" == $value[0]) {\n throw new RuntimeException(\"Illegal zero-padding found in integer entity at offset $this->offset\");\n }\n\n $this->offset = $offsetOfE + 1;\n\n // The +0 auto-casts the chunk to either an integer or a float(in cases\n // where an integer would overrun the max limits of integer types)\n return $value + 0;\n }", "public function import_value($value)\n {\n return (int)(html_entity_decode((string)$value));\n }" ]
[ "0.77689844", "0.75508916", "0.74080867", "0.7352141", "0.72633564", "0.71319294", "0.70386046", "0.69872206", "0.6913563", "0.6847587", "0.6843551", "0.6840593", "0.6735014", "0.66588116", "0.6658773", "0.6650403", "0.6596692", "0.6567115", "0.6552802", "0.65502936", "0.65164715", "0.6385811", "0.63693655", "0.63688433", "0.63563573", "0.634376", "0.6257629", "0.6153291", "0.61001337", "0.6094705" ]
0.7553423
1
Convert coordinate to a string
public function toString() { return $this->xCoordinate . ',' . $this->yCoordinate; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function coordsToString($coords)\n{\n\t$coords = array_slice($coords, 0, 4);\n\t$coordString = implode(',', $coords);\n\n\treturn $coordString;\n}", "public function toCoordinate();", "public function coordinateName() : string\n {\n $name = 'XY';\n\n if ($this->hasZ) {\n $name .= 'Z';\n }\n\n if ($this->hasM) {\n $name .= 'M';\n }\n\n return $name;\n }", "public function __toString() {\n return number_format($this->latitude, 6).' '.number_format($this->longitude, 6);\n }", "public function coordinates()\n {\n\n return (string)$this->coordinates;\n\n }", "public function __toString()\n {\n return sprintf( '( %.2f, %.2f )', $this->x, $this->y );\n }", "public function __toString() {\n return '[('.number_format($this->north, 4).' '.number_format($this->east, 4).') ('.number_format($this->south, 4).' '.number_format($this->west, 4).')]';\n }", "public function __toString()\n {\n\n return (string) $this->point . '; ' . (string) $this->size;\n\n }", "static function pretty_print_coordinate($coordinate)\n {\n return sprintf(\"%0.0f° %2.3f\",\n floor(abs($coordinate)),\n 60*(abs($coordinate)-floor(abs($coordinate)))\n );\n }", "public function toString()\n {\n // get bezier handles; when not set, they correspond to the point coords\n // If both points are unset, we only need to report the point coords.\n $pcoords = $this->_data['coords'];\n $bezL = $this->_data['bezierLC'];\n $bezR = $this->_data['bezierLC'];\n if (!is_null($bezL) || !is_null($bezR)) {\n // fill in point coords if neccessary (bezier handle is null)\n $bezL = (is_null($bezL))? $pcoords : $bezL;\n $bezR = (is_null($bezR))? $pcoords : $bezR;\n \n return implode(\" \", array_merge($bezL, $bezR, $pcoords));\n \n } else {\n // just return point coords as there are no bezier handles\n return implode(\" \", $pcoords);\n }\n \n }", "public function buildCoordinatesURL(): string\n {\n if (!isset($this->coordinates)) {\n throw new \\Exception('Coordinates not set');\n }\n $coordinates = [];\n foreach ($this->coordinates as $coordinate) {\n // Note the API wants Longitude then Latitude\n $coordinates[] = $coordinate->getLng() . ',' . $coordinate->getLat();\n }\n\n return implode(';', $coordinates);\n }", "function __toString () {\n if (!$this->data[0]) {\n return \"\";\n }\n\n $db = $this->getDatabase();\n\n switch ($this->data[0][0]) {\n case 'S':\n $ship = new Ship($db, $this->ship_code);\n $location[] = $ship->name;\n break;\n\n case 'B':\n $body = new Body($db, $this->body_code);\n $location[] = $body->name ?: lang_get('UnknownBody');\n\n if (strlen($this->data[0]) == 9) {\n $place = Place::from_code($db, $this->data[0]);\n $location[] = $place->name ?: lang_get('UnknownPlace');\n }\n break;\n\n case 'x':\n $pt = $this->point3D->toSpherical();\n return sprintf(\"(%d, %d°, %d°)\", $pt[0], $pt[1], $pt[2]);\n\n default:\n message_die(GENERAL_ERROR, \"Unknown location identifier: $type.<br />Expected: B or S.\");\n }\n\n return implode(\", \", array_reverse($location));\n }", "function __toString(){\n\t\t// TODO all are string values, maybee som should be decimal\n\t\treturn sprintf(\"0\\nPOINT\\n%s\\n%s\",\n\t\t\t\t\t\t\t\t\t$this->common(),\n\t\t\t\t\t\t\t\t\tpoint($this->attributes['point'])\n\t\t\t\t);\n\t}", "static function pretty_print_coordinates(midgardmvc_helper_location_spot $spot)\n {\n return $spot->__toString();\n }", "public function __toString( ) \n { \n //Concatenate the string from the object's properties \n $string = $this->x . ' ' . $this->y; \n\n return( $string ); \n }", "function __toString(): string\n {\n return \"{$this->x->toString()} {$this->y->toString()} l\\n\";\n }", "public function getAsText($format = false){\n return \"&#10;\". $this->getLatitudeString($format).\"&#10;\".$this->getLongitudeString($format);\n }", "public function __toString( ) \n {\n //Concatenate the string from the object's properties \n $string = '(' . $this->x . ',' . $this->y . ',' . $this->z . ')'; \n\n return( $string ); \n }", "public function castToStringReturnsXYSeparatedByComma(): void\n {\n $point = new Lambert72Point(10.99, 20.01);\n $this->assertSame('10.99 20.01', (string) $point);\n }", "private function coordToHumanReadable($coord) {\n $units = array( // must be sorted from high to low\n 'tera' => array(\n 'factor' => 1000000000000,\n 'symbol' => 'T'\n ),\n 'giga' => array(\n 'factor' => 1000000000,\n 'symbol' => 'G'\n ),\n 'mega' => array(\n 'factor' => 1000000,\n 'symbol' => 'M'\n ),\n 'kilo' => array(\n 'factor' => 1000,\n 'symbol' => 'K'\n )\n );\n\n foreach ($units as $unit) {\n $factor = $unit['factor'];\n\n if ($coord > $factor) {\n return ($coord / $factor) . $unit['symbol'];\n }\n }\n return $coord;\n }", "public function __toString( )\n {\n //Initialize a string\n $string = '';\n\n //This is supposed to be formatted like the geometric AB w/ overline\n if( !empty( $this->p1->name ) && !empty( $this->p2->name ) )\n {\n \n $string = $this->p1->name . $this->p2->name;\n }\n else\n {\n //Call the points' __toString functions and let them handle how to format the string\n $string = $this->p1 . ',' . $this->p2;\n }\n\n //Return the resulting string\n return( $string );\n }", "public function getValue()\n {\n //Edits by me\n return \"ST_GeomFromText(?, ?)\";\n }", "public function __toString()\n {\n $str = '';\n $a = $this->getSlope();\n if ($a!=1) {\n $str .= \"({$a}x)\";\n } else {\n $str .= \"x\";\n }\n $b = $this->getYIntercept();\n if ($b!=0) {\n $str .= \"+{$b}\";\n }\n return \"[y=({$str}]\";\n }", "public function __toString()\n {\n $result = get_called_class() . \"({$this->getNumber()}){\";\n foreach ($this->getCoordinates() as $coordinate) {\n $result.= sprintf(\"\\n%s ,\", (string) $coordinate);\n }\n\n return $result . \"}\";\n }", "function __toString()\n {\n return \"X: {$this->x} Y: {$this->y} Direction: {$this->getDirection(true)}\";\n }", "public function __toString()\n {\n return 'l:'.$this->left.' t:'.$this->top.' r:'.$this->right.' b:'.$this->bottom;\n }", "protected function getFlatCoord(array $coord)\n {\n return implode(',', $coord);\n }", "public function toString(): string\n {\n $output = '';\n\n // 2. Let n be the value of address.\n $number = NumberFactory::createNumber($this->address, 10);\n\n // 3. For each i in the range 1 to 4, inclusive:\n for ($i = 0; $i < 4; ++$i) {\n // 3.1. Prepend n % 256, serialized, to output.\n $output = $number->mod(256) . $output;\n\n // 3.2. If i is not 4, then prepend U+002E (.) to output.\n if ($i < 3) {\n $output = '.' . $output;\n }\n\n // 3.3. Set n to floor(n / 256).\n $number = $number->intdiv(256);\n }\n\n // 4. Return output.\n return $output;\n }", "function radius_cvt_string($data)\n{\n}", "public function __toString() {\n\t\treturn number_format( $this->value, $this->getScale(), '.', '' );\n\t}" ]
[ "0.7168829", "0.6945186", "0.6865256", "0.67908627", "0.6624565", "0.6496644", "0.6266016", "0.62474567", "0.6243327", "0.6239264", "0.6228195", "0.61449194", "0.61243224", "0.5943732", "0.5825245", "0.5813861", "0.5808359", "0.5773465", "0.57721996", "0.5767283", "0.5747051", "0.57344884", "0.56659913", "0.56409687", "0.5636542", "0.5635691", "0.5602027", "0.55507845", "0.5543777", "0.55324847" ]
0.7020099
1
Get coordinates that touch this coordinate return self[]
public function getTouchingCoordinates() { //Return offset coordinates return [ 'North' => new self($this->xCoordinate, $this->yCoordinate + 1), 'East' => new self($this->xCoordinate + 1, $this->yCoordinate), 'South' => new self($this->xCoordinate, $this->yCoordinate - 1), 'West' => new self($this->xCoordinate - 1, $this->yCoordinate), ]; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getCoordinates()\n {\n return array($this->getX(), $this->getY());\n }", "public function getCoordinates()\n {\n return $this->coordinates;\n }", "public function getCoordinates ()\n {\n return $this->coordinates;\n }", "public function getCoordinates()\n {\n return [\n $this->latitudeAttribute => $this->owner->{$this->latitudeAttribute},\n $this->longitudeAttribute => $this->owner->{$this->longitudeAttribute}\n ];\n }", "public function getCoordinates(){\n $coordinates = array();\n \n foreach ($this->areas as $area){\n foreach ($area->getCoordinates() as $coordarea){\n $coordinates[] = $coordarea;\n }\n }\n return $coordinates;\n }", "public function getCoordinates() : Point\n {\n return $this->coordinates;\n }", "public function getPosition() {\n if (UtenteWeb::status()->user->id != null) {\n foreach ($this->find(array('x', 'y'), array('id' => UtenteWeb::status()->user->id)) as $item) {\n $return = array(\n 'x' => $item['x'],\n 'y' => $item['y']\n );\n return $return;\n }\n }\n return array();\n }", "public function getObjectsCoordinates()\n {\n $coordinates = array(); // flat array of coords\n $objects = $this->getObjects();\n\n foreach ($objects as $object) {\n $c = $object->getCoordinates();\n if (!in_array($c,$coordinates)) {\n $coordinates[] = $c;\n }\n }\n\n return $coordinates;\n }", "public function position() {\n\n\t\treturn array( 'lat' => $this->latitude(), 'lng' => $this->longitude() );\n\n\t}", "public function getContactPoints();", "public function getSurroundingCoordinates()\n {\n //Return offset coordinates\n return [\n 'North West' => new self($this->xCoordinate - 1, $this->yCoordinate + 1),\n 'North' => new self($this->xCoordinate, $this->yCoordinate + 1),\n 'North East' => new self($this->xCoordinate + 1, $this->yCoordinate + 1),\n 'West' => new self($this->xCoordinate - 1, $this->yCoordinate),\n 'East' => new self($this->xCoordinate + 1, $this->yCoordinate),\n 'South West' => new self($this->xCoordinate - 1, $this->yCoordinate - 1),\n 'South' => new self($this->xCoordinate, $this->yCoordinate - 1),\n 'South East' => new self($this->xCoordinate + 1, $this->yCoordinate - 1),\n ];\n }", "function getXY() {\n return $this->xy;\n }", "public function getCrossPoints(): array;", "protected function _getCordinates()\n {\n $rv = array();\n\n if ( !empty($this->_data['route']) ) {\n\n foreach($this->_data['route'] as $route) {\n $latLong = $route['cordinates'];\n $latLong = str_ireplace(\"new GLatLng(\", \"\", $latLong);\n $latLong = str_replace(\")\", \"\", $latLong);\n $latLong = explode(\",\", $latLong);\n\n $lat = trim($latLong[0]);\n $long = trim($latLong[1]);\n\n $rv[$route['point']]['lat'] = $lat;\n $rv[$route['point']]['lng'] = $long;\n }\n }\n\n return $rv;\n }", "function getPoints()\n\t{\n\t\t//$this->updatePoints();\n\t\t//$this->updatePoints();\n\t\treturn $this->points;\n\t\t\t\n\t}", "public function getContactPoint();", "public function getCoordinates(): array {\n $coordsString = $this->getAttribute('coords');\n $out = [];\n if ($coordsString !== null) {\n foreach (explode(',', $coordsString) as $coord) {\n $out[] = (int) $coord;\n }\n }\n return $out;\n }", "function getPoints()\n\t{\n\t\treturn $this->points;\n\t}", "public function getShipToLocations()\n {\n return $this->shipToLocations;\n }", "public function getPoints()\n\t{\n\t\treturn $this->points;\n\t}", "public function getPoints ()\r\n {\r\n return $this->points;\r\n }", "public function findCoordinatesForCustomers()\n {\n return $this->locationService->findCoordinatesForCustomers();\n }", "public function getPointsArr(): array\n {\n return $this->pointsArr;\n }", "public function getCurrentPoint(): array\n {\n $fileStandaloneRepository = GeneralUtility::makeInstance(FileStandaloneRepository::class);\n $row = $fileStandaloneRepository->findOneByRelativeFilePath($this->getRelativeFilePath());\n if (!isset($row['focus_point_x'])) {\n return [0, 0];\n }\n\n return $this->cleanupPosition([\n $row['focus_point_x'],\n $row['focus_point_y'],\n ]);\n }", "public function getPoints()\n {\n return $this->points;\n }", "public function getX()\n {\n return $this->_data['coords'][0];\n }", "public function get_positions()\n {\n return $this->positions;\n }", "public function property_callback_gps()\n {\n return [\n $this->m_row['latitude'],\n $this->m_row['longitude']\n ];\n }", "public function getCoordinate()\n {\n return new Coordinate(array(\n ($this->latitudeInterval[0] + $this->latitudeInterval[1]) / 2,\n ($this->longitudeInterval[0] + $this->longitudeInterval[1]) / 2\n ));\n }", "public function getHit()\n\t{\n\t\treturn $this->hit;\n\t}" ]
[ "0.6864809", "0.6365505", "0.6361181", "0.6330075", "0.63093835", "0.63029206", "0.62807655", "0.61098045", "0.598443", "0.57821554", "0.57677513", "0.5767527", "0.5751641", "0.5649594", "0.56140125", "0.5554607", "0.5545527", "0.54720116", "0.5425447", "0.53749484", "0.5356779", "0.53555405", "0.5334785", "0.5331519", "0.53305334", "0.53206474", "0.5264367", "0.52467114", "0.52175736", "0.5174028" ]
0.7224849
0
Get coordinates that surround this coordinate return self[]
public function getSurroundingCoordinates() { //Return offset coordinates return [ 'North West' => new self($this->xCoordinate - 1, $this->yCoordinate + 1), 'North' => new self($this->xCoordinate, $this->yCoordinate + 1), 'North East' => new self($this->xCoordinate + 1, $this->yCoordinate + 1), 'West' => new self($this->xCoordinate - 1, $this->yCoordinate), 'East' => new self($this->xCoordinate + 1, $this->yCoordinate), 'South West' => new self($this->xCoordinate - 1, $this->yCoordinate - 1), 'South' => new self($this->xCoordinate, $this->yCoordinate - 1), 'South East' => new self($this->xCoordinate + 1, $this->yCoordinate - 1), ]; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getCoordinates()\n {\n return array($this->getX(), $this->getY());\n }", "public function getCoordinates(){\n $coordinates = array();\n \n foreach ($this->areas as $area){\n foreach ($area->getCoordinates() as $coordarea){\n $coordinates[] = $coordarea;\n }\n }\n return $coordinates;\n }", "public function getCoordinates()\n {\n return [\n $this->latitudeAttribute => $this->owner->{$this->latitudeAttribute},\n $this->longitudeAttribute => $this->owner->{$this->longitudeAttribute}\n ];\n }", "public function getCoordinates ()\n {\n return $this->coordinates;\n }", "public function getCoordinates()\n {\n return $this->coordinates;\n }", "public function getTouchingCoordinates()\n {\n //Return offset coordinates\n return [\n 'North' => new self($this->xCoordinate, $this->yCoordinate + 1),\n 'East' => new self($this->xCoordinate + 1, $this->yCoordinate),\n 'South' => new self($this->xCoordinate, $this->yCoordinate - 1),\n 'West' => new self($this->xCoordinate - 1, $this->yCoordinate),\n ];\n }", "public function getCoordinates() : Point\n {\n return $this->coordinates;\n }", "public function getObjectsCoordinates()\n {\n $coordinates = array(); // flat array of coords\n $objects = $this->getObjects();\n\n foreach ($objects as $object) {\n $c = $object->getCoordinates();\n if (!in_array($c,$coordinates)) {\n $coordinates[] = $c;\n }\n }\n\n return $coordinates;\n }", "protected function _getCordinates()\n {\n $rv = array();\n\n if ( !empty($this->_data['route']) ) {\n\n foreach($this->_data['route'] as $route) {\n $latLong = $route['cordinates'];\n $latLong = str_ireplace(\"new GLatLng(\", \"\", $latLong);\n $latLong = str_replace(\")\", \"\", $latLong);\n $latLong = explode(\",\", $latLong);\n\n $lat = trim($latLong[0]);\n $long = trim($latLong[1]);\n\n $rv[$route['point']]['lat'] = $lat;\n $rv[$route['point']]['lng'] = $long;\n }\n }\n\n return $rv;\n }", "public function position() {\n\n\t\treturn array( 'lat' => $this->latitude(), 'lng' => $this->longitude() );\n\n\t}", "public function getPosition() {\n if (UtenteWeb::status()->user->id != null) {\n foreach ($this->find(array('x', 'y'), array('id' => UtenteWeb::status()->user->id)) as $item) {\n $return = array(\n 'x' => $item['x'],\n 'y' => $item['y']\n );\n return $return;\n }\n }\n return array();\n }", "public function getBoundingBox(): array\n {\n return array(\n new Coordinate(array(\n $this->latitudeInterval[0],\n $this->longitudeInterval[0]\n )),\n new Coordinate(array(\n $this->latitudeInterval[1],\n $this->longitudeInterval[1]\n ))\n );\n }", "public function getBoundingBox(): array\n {\n return [\n new Coordinate([\n $this->latitudeInterval[0],\n $this->longitudeInterval[0],\n ]),\n new Coordinate([\n $this->latitudeInterval[1],\n $this->longitudeInterval[1],\n ]),\n ];\n }", "public function getCoordinate()\n {\n return new Coordinate(array(\n ($this->latitudeInterval[0] + $this->latitudeInterval[1]) / 2,\n ($this->longitudeInterval[0] + $this->longitudeInterval[1]) / 2\n ));\n }", "public function getBezierHandleCoordinates()\n {\n $r = array(\n 'left' => $this->_data['bezierLC'],\n 'right' => $this->_data['bezierRC'],\n );\n return $r;\n }", "public function getCrossPoints(): array;", "function getXY() {\n return $this->xy;\n }", "public function getInnerRings()\n {\n return array_slice($this->getRings(), 1);\n }", "public function getCoordinates(): array {\n $coordsString = $this->getAttribute('coords');\n $out = [];\n if ($coordsString !== null) {\n foreach (explode(',', $coordsString) as $coord) {\n $out[] = (int) $coord;\n }\n }\n return $out;\n }", "protected function _getCoordinates() {\n\t\t$itemTransformString = (string)$this->_nodeConfig->attributes()->ItemTransform;\n\t\t$itemTransformArray = explode(' ', $itemTransformString);\n\t\t$coordinates = array(\n\t\t\t'x' => $itemTransformArray[count($itemTransformArray) - 2],\n\t\t\t'y' => $itemTransformArray[count($itemTransformArray) - 1]\n\t\t);\n\n\t\treturn $coordinates;\n\t}", "public function getRings()\n {\n return $this->getGeometries();\n }", "public function get_positions()\n {\n return $this->positions;\n }", "public function toArray() : array\n {\n\n return [\n 'x' => $this->point->x,\n 'y' => $this->point->y,\n 'width' => $this->size->width,\n 'height' => $this->size->height\n ];\n\n }", "public function getTopLeft()\n {\n return $this->topLeft;\n }", "public function yahooGeoAdjacent() {\n return $this;\n }", "public function points(): Collection\n {\n return $this->points;\n }", "public function findCoordinatesForCustomers()\n {\n return $this->locationService->findCoordinatesForCustomers();\n }", "private function _getNeighboursCoords($y, $x)\n {\n $northY = ($y == 0) ? $this->_rows - 1 : $y - 1;\n $southY = ($y == $this->_rows - 1) ? 0 : $y + 1;\n\n $westX = ($x == 0) ? $this->_cols - 1 : $x - 1;\n $eastX = ($x == $this->_cols - 1) ? 0 : $x + 1;\n\n return array(\n new LifeCoords($northY, $westX),\n new LifeCoords($northY, $x),\n new LifeCoords($northY, $eastX),\n new LifeCoords($y, $westX),\n new LifeCoords($y, $eastX),\n new LifeCoords($southY, $westX),\n new LifeCoords($southY, $x),\n new LifeCoords($southY, $eastX),\n );\n }", "public function getCoordinates($resource)\n {\n return Cache::store($this->cacheStore)\n ->remember(\n static::getCacheKey($resource),\n $this->ttl,\n function () use ($resource) {\n if ($resource->{$this->position} === null) {\n return null;\n }\n // Because I'm paranoid\n if (!is_a($resource, Model::class)) {\n return null;\n }\n $point = DB::select(DB::raw(\"SELECT ST_AsText('{$resource->{$this->position}}'::geography) as position\"))[0]->position;\n\n return explode(' ', Str::between($point, '(', ')'));\n });\n }", "public function getCoordinate(): CoordinateInterface\n {\n return new Coordinate([\n ($this->latitudeInterval[0] + $this->latitudeInterval[1]) / 2,\n ($this->longitudeInterval[0] + $this->longitudeInterval[1]) / 2,\n ]);\n }" ]
[ "0.7323482", "0.7289305", "0.7039711", "0.70151365", "0.7011933", "0.69921833", "0.67242837", "0.6588876", "0.65547353", "0.6516337", "0.6283786", "0.62704897", "0.6198857", "0.6125317", "0.61198986", "0.60777014", "0.6054559", "0.6040421", "0.5989728", "0.58193445", "0.57936543", "0.576783", "0.5753516", "0.5725355", "0.569478", "0.5682292", "0.5657572", "0.5656601", "0.56342816", "0.5609069" ]
0.7326468
0
Get a Coordinate at a bearing relative to this coordinate
public function getBearing(string $bearing) { switch ($bearing) { case 'North West': return new self($this->xCoordinate - 1, $this->yCoordinate + 1); case 'North': return new self($this->xCoordinate, $this->yCoordinate + 1); case 'North East': return new self($this->xCoordinate + 1, $this->yCoordinate + 1); case 'West': return new self($this->xCoordinate - 1, $this->yCoordinate); case 'East': return new self($this->xCoordinate + 1, $this->yCoordinate); case 'South West': return new self($this->xCoordinate - 1, $this->yCoordinate - 1); case 'South': return new self($this->xCoordinate, $this->yCoordinate - 1); case 'South East': return new self($this->xCoordinate + 1, $this->yCoordinate - 1); } throw new Exception\InvalidBearing('Invalid Bearing'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function bearing($tx, $rx, $unit = 'M') {\n\t\t$my = qra2latlong($tx);\n\t\t$stn = qra2latlong($rx);\n\n\t\t$bearing = bearing($my[0], $my[1], $stn[0], $stn[1], $unit);\n\n\t\treturn $bearing;\n\t}", "function get_bearing($tx, $rx) {\n\t\t$my = qra2latlong($tx);\n\t\t$stn = qra2latlong($rx);\n\t\treturn get_bearing($my[0], $my[1], $stn[0], $stn[1]);\n\t}", "static function get_bearing(midgardmvc_helper_location_spot $from, midgardmvc_helper_location_spot $to)\n {\n return $from->direction_to($to);\n }", "public function getAngle(): float;", "protected function _getBearing($pointA, $pointB)\n {\n if (empty($pointA) || empty($pointB))\n throw new Exception(__METHOD__ . \": One of the points is empty\");\n\n $lat1 = $pointA['lat'];\n $lon1 = $pointA['lng'];\n $lat2 = $pointB['lat'];\n $lon2 = $pointB['lng'];\n\n return round((rad2deg(atan2(sin(deg2rad($lon2) - deg2rad($lon1)) * cos(deg2rad($lat2)), cos(deg2rad($lat1)) * sin(deg2rad($lat2)) - sin(deg2rad($lat1)) * cos(deg2rad($lat2)) * cos(deg2rad($lon2) - deg2rad($lon1)))) + 360) % 360);\n }", "public static function get_bearing($lat1, $lon1, $lat2, $lon2)\n {\n if ($lat1 == $lat2 && $lon1 == $lon2)\n return null;\n if ($lat1 == $lat2) $lat1 += 0.0000166;\n if ($lon1 == $lon2) $lon1 += 0.0000166;\n\n $rad_lat1 = $lat1 / 180.0 * 3.14159;\n $rad_lon1 = $lon1 / 180.0 * 3.14159;\n $rad_lat2 = $lat2 / 180.0 * 3.14159;\n $rad_lon2 = $lon2 / 180.0 * 3.14159;\n\n $delta_lon = $rad_lon2 - $rad_lon1;\n $bearing = atan2(sin($delta_lon) * cos($rad_lat2),\n cos($rad_lat1) * sin($rad_lat2) - sin($rad_lat1) * cos($rad_lat2) * cos($delta_lon));\n $bearing = 180.0 * $bearing / 3.14159;\n if ( $bearing < 0.0 ) $bearing = $bearing + 360.0;\n\n return $bearing;\n }", "public static function calcBearing($lat1, $lon1, $lat2, $lon2){\n\n if ($lat1 == $lat2 && $lon1 == $lon2) {\n return '-';\n }\n\n if ($lat1 == $lat2)\n $lat1 += 0.0000166;\n if ($lon1 == $lon2)\n $lon1 += 0.0000166;\n\n $rad_lat1 = $lat1 / 180.0 * M_PI;\n $rad_lon1 = $lon1 / 180.0 * M_PI;\n $rad_lat2 = $lat2 / 180.0 * M_PI;\n $rad_lon2 = $lon2 / 180.0 * M_PI;\n\n $delta_lon = $rad_lon2 - $rad_lon1;\n $bearing = atan2(\n sin($delta_lon) * cos($rad_lat2), cos($rad_lat1) * sin($rad_lat2) - sin($rad_lat1) * cos($rad_lat2) * cos($delta_lon));\n $bearing = 180.0 * $bearing / M_PI;\n\n // Calculated bearing is between <-180;180> degrees; normalize it ot the 0-360 deg form:\n if ($bearing < 0.0)\n $bearing = $bearing + 360.0;\n\n return $bearing;\n }", "static function ratan2($x,$y){return rad2deg(atan2($x,$y))+(($x<0)?180:0);}", "public function getAngle()\n {\n return $this->angle;\n }", "public function getRa()\n {\n return $this->ra;\n }", "function destination($lat,$lon, $bearing, $distance,$units=\"mi\") {\n\t $radius = strcasecmp($units, \"km\") ? 3963.19 : 6378.137;\n\t $rLat = deg2rad($lat);\n\t $rLon = deg2rad($lon);\n\t $rBearing = deg2rad($bearing);\n\t $rAngDist = $distance / $radius;\n\n\t $rLatB = asin(sin($rLat) * cos($rAngDist) + \n\t cos($rLat) * sin($rAngDist) * cos($rBearing));\n\n\t $rLonB = $rLon + atan2(sin($rBearing) * sin($rAngDist) * cos($rLat), \n\t cos($rAngDist) - sin($rLat) * sin($rLatB));\n\n\t return array(\"lat\" => rad2deg($rLatB), \"lon\" => rad2deg($rLonB));\n\t}", "function atan2 ($y, $x) {}", "public function getAngle()\n\t{\n\t\treturn $this->angle;\n\t}", "function polar2cart($dist, $bearing, $as_deg=false) {\n if ($as_deg) {\n // if bearing is in degrees, convert to radians\n $bearing = $bearing * pi() / 180;\n }\n $x = $dist * sin($bearing);\n $y = $dist * cos($bearing);\n\n return array(\"x\"=>$x,\"y\"=>$y);\n}", "public static function bearing_as_two_letters($b)\n {\n static $names = array('N', 'NE', 'E', 'SE', 'S', 'SW', 'W', 'NW');\n if ($b === null) return 'n/a';\n return $names[round(($b / 360.0) * 8.0) % 8];\n }", "public function toCoordinate();", "public static function bearing_as_three_letters($b)\n {\n static $names = array('N', 'NNE', 'NE', 'ENE', 'E', 'ESE', 'SE', 'SSE',\n 'S', 'SSW', 'SW', 'WSW', 'W', 'WNW', 'NW', 'NNW');\n if ($b === null) return 'n/a';\n return $names[round(($b / 360.0) * 16.0) % 16];\n }", "function calculateAngle($hypotenuse)\n{\n\t$hypotenuse = defineCoords($hypotenuse);\n\t$adjacentLeg = $hypotenuse['maxX'] - $hypotenuse['minX'];\n\t$oppositeLeg = $hypotenuse['maxY'] - $hypotenuse['minY'];\n\treturn $angle = atan($adjacentLeg/$oppositeLeg);\n}", "public function center() {\n return new geopoint(($this->north + $this->south) / 2, ($this->east + $this->west) / 2);\n }", "public function calculateCFYAngle() {\n $error = 1/10000;\n for ($i=0; $i< 90; $i=$i+0.1) {\n $lhs = $this->mandrelRadius;\n $rhs = sin(pi() * $i / 180) * ($this->mandrelRadius + $this->eyeletDistance) + $this->eyeletHeight * cos(pi() * $i / 180);\n \n if (abs($rhs - $lhs) < $error) {\n break;\n }\n }\n return $i;\n }", "public function originY() { return $this->_m_originY; }", "public function originY() { return $this->_m_originY; }", "function move_point($point, $bearing,$l) {\n if ($bearing >=360) $bearing = $bearing -360;//normalise\n if ($bearing <0) $bearing = $bearing +360;//normalise\n $quadrant = floor(($bearing)/90);\n //echo ($bearing.\"=quadrant\".$quadrant.\"<br/>\");\n\n //quadrant numbering not standard - reverse of normal\n switch ($quadrant){\n case 0://quadrant 1 (clockwise)\n $PPx = (($point->x) + $l*sin(deg2rad($bearing)));\n $PPy = (($point->y) - $l*cos(deg2rad($bearing))); //coordinate system is 0,0 at top (normally +ve)\n break;\n case 1: \n $PPx = (($point->x) + $l*sin(deg2rad($bearing)));\n $PPy = (($point->y) - $l*cos(deg2rad($bearing)));\n break;\n case 2:\n $PPx = (($point->x) + $l*sin(deg2rad($bearing)));\n $PPy = (($point->y) - $l*cos(deg2rad($bearing))); //coordinate system is 0,0 at top (normally +ve)\n break;\n case 3://quadrant 4\n $PPx = (($point->x) + $l*sin(deg2rad($bearing)));\n $PPy = (($point->y) - $l*cos(deg2rad($bearing)));\n break;\n }\n $new_point = new Point($PPx,$PPy);\n return $new_point;\n}", "public function deriveVectorOriginMandrel($angle) {\n \n $vector[0] = $this->mandrelRadius * sin(pi() * $angle / 180);\n $vector[1] = $this->mandrelRadius * cos(pi() * $angle / 180);\n $vector[2] = 0; \n \n return $vector;\n }", "public function getPointB()\n {\n return (isset($this->_points['b']) ? $this->_points['b'] : null);\n }", "public function getTiltAngle()\n {\n return $this->tilt_angle;\n }", "function calculateOffset($distance, $azimuth) {\r\n\t\t$brng = deg2rad($azimuth);\r\n\t\t$lat = $this->lat->rad;\r\n\t\t$lon = $this->lon->rad;\r\n\r\n\t\t$lat2 = asin(sin($lat)*cos($distance/LatLon::R) + cos($lat)*sin($distance/LatLon::R)*cos($brng));\t\r\n\t\t$lon2 = $lon + atan2(sin($brng)*sin($distance/LatLon::R)*cos($lat), cos($distance/LatLon::R)-sin($lat)*sin($lat2));\r\n\t\t\r\n\t\treturn new LatLon(new LatRad($lat2), new LonRad($lon2));\r\n\t}", "public function getLatitude();", "public function getLatitude();", "public function getLatitude();" ]
[ "0.6541657", "0.6361204", "0.61932725", "0.5540657", "0.5269689", "0.52644855", "0.52615654", "0.5184502", "0.5046831", "0.4969315", "0.4962223", "0.49548066", "0.4911557", "0.49067563", "0.48518735", "0.4819495", "0.47184187", "0.46481586", "0.4636383", "0.4612524", "0.46115464", "0.46115464", "0.46083862", "0.45746505", "0.4571134", "0.4531486", "0.45231518", "0.45007893", "0.45007893", "0.45007893" ]
0.6385975
1
Data functions (insert, update, delete, form) for table tb_acompanhamento This script and data application were generated by AppGini 5.72 Download AppGini for free from
function tb_acompanhamento_insert(){ global $Translation; // mm: can member insert record? $arrPerm=getTablePermissions('tb_acompanhamento'); if(!$arrPerm[1]){ return false; } $data['empresa_id'] = makeSafe($_REQUEST['empresa_id']); if($data['empresa_id'] == empty_lookup_value){ $data['empresa_id'] = ''; } $data['contato_id'] = makeSafe($_REQUEST['contato_id']); if($data['contato_id'] == empty_lookup_value){ $data['contato_id'] = ''; } $data['contrato_id'] = makeSafe($_REQUEST['contrato_id']); if($data['contrato_id'] == empty_lookup_value){ $data['contrato_id'] = ''; } $data['usuario_id'] = makeSafe($_REQUEST['usuario_id']); if($data['usuario_id'] == empty_lookup_value){ $data['usuario_id'] = ''; } $data['dta'] = intval($_REQUEST['dtaYear']) . '-' . intval($_REQUEST['dtaMonth']) . '-' . intval($_REQUEST['dtaDay']); $data['dta'] = parseMySQLDate($data['dta'], ''); $data['str_meio'] = makeSafe($_REQUEST['str_meio']); if($data['str_meio'] == empty_lookup_value){ $data['str_meio'] = ''; } $data['str_statusgeral'] = makeSafe($_REQUEST['str_statusgeral']); if($data['str_statusgeral'] == empty_lookup_value){ $data['str_statusgeral'] = ''; } $data['str_clima_cliente'] = makeSafe($_REQUEST['str_clima_cliente']); if($data['str_clima_cliente'] == empty_lookup_value){ $data['str_clima_cliente'] = ''; } $data['str_clima_equipe'] = makeSafe($_REQUEST['str_clima_equipe']); if($data['str_clima_equipe'] == empty_lookup_value){ $data['str_clima_equipe'] = ''; } $data['str_observacoes'] = br2nl(makeSafe($_REQUEST['str_observacoes'])); $data['str_acoes_corretivas'] = br2nl(makeSafe($_REQUEST['str_acoes_corretivas'])); if($data['empresa_id']== ''){ echo StyleSheet() . "\n\n<div class=\"alert alert-danger\">" . $Translation['error:'] . " 'Conta': " . $Translation['field not null'] . '<br><br>'; echo '<a href="" onclick="history.go(-1); return false;">'.$Translation['< back'].'</a></div>'; exit; } if($data['contato_id']== ''){ echo StyleSheet() . "\n\n<div class=\"alert alert-danger\">" . $Translation['error:'] . " 'Contato': " . $Translation['field not null'] . '<br><br>'; echo '<a href="" onclick="history.go(-1); return false;">'.$Translation['< back'].'</a></div>'; exit; } if($data['contrato_id']== ''){ echo StyleSheet() . "\n\n<div class=\"alert alert-danger\">" . $Translation['error:'] . " 'Contrato': " . $Translation['field not null'] . '<br><br>'; echo '<a href="" onclick="history.go(-1); return false;">'.$Translation['< back'].'</a></div>'; exit; } if($data['usuario_id']== ''){ echo StyleSheet() . "\n\n<div class=\"alert alert-danger\">" . $Translation['error:'] . " 'Respons&#225;vel': " . $Translation['field not null'] . '<br><br>'; echo '<a href="" onclick="history.go(-1); return false;">'.$Translation['< back'].'</a></div>'; exit; } if($data['dta']== ''){ echo StyleSheet() . "\n\n<div class=\"alert alert-danger\">" . $Translation['error:'] . " 'Data': " . $Translation['field not null'] . '<br><br>'; echo '<a href="" onclick="history.go(-1); return false;">'.$Translation['< back'].'</a></div>'; exit; } if($data['str_meio']== ''){ echo StyleSheet() . "\n\n<div class=\"alert alert-danger\">" . $Translation['error:'] . " 'Meio de contato': " . $Translation['field not null'] . '<br><br>'; echo '<a href="" onclick="history.go(-1); return false;">'.$Translation['< back'].'</a></div>'; exit; } if($data['str_statusgeral']== ''){ echo StyleSheet() . "\n\n<div class=\"alert alert-danger\">" . $Translation['error:'] . " 'Status geral': " . $Translation['field not null'] . '<br><br>'; echo '<a href="" onclick="history.go(-1); return false;">'.$Translation['< back'].'</a></div>'; exit; } if($data['str_clima_cliente']== ''){ echo StyleSheet() . "\n\n<div class=\"alert alert-danger\">" . $Translation['error:'] . " 'Clima do cliente': " . $Translation['field not null'] . '<br><br>'; echo '<a href="" onclick="history.go(-1); return false;">'.$Translation['< back'].'</a></div>'; exit; } if($data['str_clima_equipe']== ''){ echo StyleSheet() . "\n\n<div class=\"alert alert-danger\">" . $Translation['error:'] . " 'Clima da equipe': " . $Translation['field not null'] . '<br><br>'; echo '<a href="" onclick="history.go(-1); return false;">'.$Translation['< back'].'</a></div>'; exit; } // hook: tb_acompanhamento_before_insert if(function_exists('tb_acompanhamento_before_insert')){ $args=array(); if(!tb_acompanhamento_before_insert($data, getMemberInfo(), $args)){ return false; } } $o = array('silentErrors' => true); sql('insert into `tb_acompanhamento` set `empresa_id`=' . (($data['empresa_id'] !== '' && $data['empresa_id'] !== NULL) ? "'{$data['empresa_id']}'" : 'NULL') . ', `contato_id`=' . (($data['contato_id'] !== '' && $data['contato_id'] !== NULL) ? "'{$data['contato_id']}'" : 'NULL') . ', `contrato_id`=' . (($data['contrato_id'] !== '' && $data['contrato_id'] !== NULL) ? "'{$data['contrato_id']}'" : 'NULL') . ', `usuario_id`=' . (($data['usuario_id'] !== '' && $data['usuario_id'] !== NULL) ? "'{$data['usuario_id']}'" : 'NULL') . ', `dta`=' . (($data['dta'] !== '' && $data['dta'] !== NULL) ? "'{$data['dta']}'" : 'NULL') . ', `str_meio`=' . (($data['str_meio'] !== '' && $data['str_meio'] !== NULL) ? "'{$data['str_meio']}'" : 'NULL') . ', `str_statusgeral`=' . (($data['str_statusgeral'] !== '' && $data['str_statusgeral'] !== NULL) ? "'{$data['str_statusgeral']}'" : 'NULL') . ', `str_clima_cliente`=' . (($data['str_clima_cliente'] !== '' && $data['str_clima_cliente'] !== NULL) ? "'{$data['str_clima_cliente']}'" : 'NULL') . ', `str_clima_equipe`=' . (($data['str_clima_equipe'] !== '' && $data['str_clima_equipe'] !== NULL) ? "'{$data['str_clima_equipe']}'" : 'NULL') . ', `str_observacoes`=' . (($data['str_observacoes'] !== '' && $data['str_observacoes'] !== NULL) ? "'{$data['str_observacoes']}'" : 'NULL') . ', `str_acoes_corretivas`=' . (($data['str_acoes_corretivas'] !== '' && $data['str_acoes_corretivas'] !== NULL) ? "'{$data['str_acoes_corretivas']}'" : 'NULL'), $o); if($o['error']!=''){ echo $o['error']; echo "<a href=\"tb_acompanhamento_view.php?addNew_x=1\">{$Translation['< back']}</a>"; exit; } $recID = db_insert_id(db_link()); // hook: tb_acompanhamento_after_insert if(function_exists('tb_acompanhamento_after_insert')){ $res = sql("select * from `tb_acompanhamento` where `id`='" . makeSafe($recID, false) . "' limit 1", $eo); if($row = db_fetch_assoc($res)){ $data = array_map('makeSafe', $row); } $data['selectedID'] = makeSafe($recID, false); $args=array(); if(!tb_acompanhamento_after_insert($data, getMemberInfo(), $args)){ return $recID; } } // mm: save ownership data set_record_owner('tb_acompanhamento', $recID, getLoggedMemberID()); return $recID; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function buildTablaOtros(){\n $comprasOtros= Xcrud::get_instance()->table('follaje')->unset_remove()->unset_add();\n $comprasOtros->fields('user,stamp,registroevento.hotel,registroevento.descripcionItem,registroevento.comentarioItem,registroevento.fechaEvento,registroevento.imagen',true);\n $comprasOtros->join('idOrden','registroevento','id');\n $comprasOtros->where('estatus !=','Cotizado');\n $comprasOtros->order_by('id','desc');\n\n /* Nombre de tabla */\n $comprasOtros->table_name('Follaje y Otros');\n\n /* Cambiar nombres a las columnas */\n //tabla Follaje\n $comprasOtros->label('id','# Pedido');\n $comprasOtros->label('idOrden','# Orden');\n $comprasOtros->label('item','Follaje/Otro');\n $comprasOtros->label('user','Pedido creado por');\n $comprasOtros->label('stamp','Pedido creado en');\n $comprasOtros->label('precioUnitario','Precio Unitario');\n $comprasOtros->label('presupuestoTotal','Presupuesto Total');\n //tabla Evento\n $comprasOtros->label('registroevento.fechaEvento','Fecha de evento');\n $comprasOtros->label('registroevento.nombreItem','Articulo');\n $comprasOtros->label('registroevento.folioEP','Folio EP');\n $comprasOtros->label('registroevento.stamp','Evento creado en');\n $comprasOtros->label('registroevento.user','Evento creado por');\n\n\n /* Mostrar ID en campos */\n $comprasOtros->show_primary_ai_field(true);\n $comprasOtros->show_primary_ai_column(true);\n\n /* Quitar numeros de fila */\n /* $comprasOtros->unset_numbers(); */ \n \n /* Mapeo de columnas */\n $comprasOtros->columns('id,idOrden,registroevento.folioEP,registroevento.fechaEvento,registroevento.nombreItem,item,cantidad,unidad,precioUnitario,presupuestoTotal,estatus,registroevento.tipo');\n \n /* Campos de solo lectura */\n $comprasOtros->readonly('id,idOrden,item,unidad,cantidad,precioUnitario,presupuestoTotal,notas,registroevento.estatus,registroevento.folioEP,registroevento.fechaEvento,registroevento.nombreItem,registroevento.cantidadItem,registroevento.tipo');\n $comprasOtros->disabled('stamp,registroevento.stamp');\n \n /* Lista de opciones de solicitud para compras */\n $comprasOtros->change_type('estatus','select','black,white',array('values'=>'-,Pedido,Entregado,Cancelado,Incompleto'));\n\n /* Highligt */\n $comprasOtros->highlight('estatus','=','Pedido','#fa9973');\n $comprasOtros->highlight('estatus','=','Entregado','#86f584');\n $comprasOtros->highlight('estatus','=','Cancelado','#f7cdf3');\n $comprasOtros->highlight('estatus','=','Confirmado','#ebe9e4');\n $comprasOtros->highlight('estatus','=','Incompleto','#f7f497');\n $comprasOtros->highlight('registroevento.tipo','=','Urgente','#ff8645');\n\n /* No puede modificar despues de poner entregado */\n /* $comprasOtros->unset_edit(true,'estatus','=','Entregado'); */\n\n return $comprasOtros;\n\n}", "function buildTablaCompras(){\n\n $TablaCompras= Xcrud::get_instance()->table('registroflores')->unset_remove()->unset_add();\n $TablaCompras->fields('registroevento.hotel,registroevento.descripcionItem,registroevento.comentarioItem,registroevento.fechaEvento,registroevento.imagen',true);\n $TablaCompras->join('idRegistro','registroevento','id');\n $TablaCompras->where('estatus !=','Cotizado');\n $TablaCompras->order_by('idItem','desc');\n\n /* Columnas a mostrar */\n $TablaCompras->columns('idItem,idRegistro,registroevento.folioEP,registroevento.fechaEvento,registroevento.nombreItem,flor,color,unidad,cantidadFlor,cantidadTotal,precio,precioTotal,proveedor,estatus,registroevento.tipo');\n\n /* Cambiar nombres a las columnas */\n //Tabla de flores\n $TablaCompras->label('idItem','# Pedido');\n $TablaCompras->label('idRegistro','# Orden');\n $TablaCompras->label('precioPorFlor','Precio por flor');\n $TablaCompras->label('registroevento.folioEP','Folio EP');\n $TablaCompras->label('user','Pedido Creado por');\n $TablaCompras->label('stamp','Pedido Creado en');\n $TablaCompras->label('estatus','Estatus Pedido');\n $TablaCompras->label('cantidadItem','Unidades');\n $TablaCompras->label('cantidadFlor','Flores por Item');\n $TablaCompras->label('cantidadTotal','Flores totales');\n $TablaCompras->label('precio','Precio por Item');\n $TablaCompras->label('precioTotal','Precio Total');\n\n //Tabla Eventos\n $TablaCompras->label('registroevento.fechaEvento','Fecha de evento');\n $TablaCompras->label('registroevento.nombreItem','Articulo');\n $TablaCompras->label('registroevento.estatus','Estatus Evento');\n $TablaCompras->label('registroevento.stamp','Evento creado en');\n $TablaCompras->label('registroevento.user','Evento creado por');\n\n /* Validaciones */\n $TablaCompras->validation_required('proveedor',2);\n $TablaCompras->validation_required('estatus',2);\n\n /* Highligt */\n $TablaCompras->highlight('estatus','=','Pedido','#fa9973');\n $TablaCompras->highlight('estatus','=','Entregado','#86f584');\n $TablaCompras->highlight('estatus','=','Cancelado','#f7cdf3');\n $TablaCompras->highlight('estatus','=','Confirmado','#ebe9e4');\n $TablaCompras->highlight('estatus','=','Incompleto','#f7f497');\n $TablaCompras->highlight('registroevento.tipo','=','Urgente','#ff8645');\n\n /* Campos de solo lectura */\n $TablaCompras->readonly('idItem,idRegistro,flor,color,unidad,cantidadFlor,cantidadTotal,precioPorFlor,precio,precioTotal,user,stamp,registroevento.estatus,registroevento.folioEP,registroevento.fechaEvento,registroevento.nombreItem,registroevento.hotel,registroevento.cantidadItem,registroevento.descripcionItem,registroevento.comentarioItem,registroevento.imagen,registroevento.user,registroevento.stamp,registroevento.tipo');\n $TablaCompras->disabled('stamp,registroevento.stamp');\n\n /* Quitar numero de fila */\n /* $xcrud->unset_numbers(); */\n\n /* Mostrar ID en campos */\n $TablaCompras->show_primary_ai_field(true);\n $TablaCompras->show_primary_ai_column(true);\n\n /* Cambiar nombre de la tabla */\n $TablaCompras->table_name('Listado de compras de flores');\n\n /* Imagen / Modal*/\n $TablaCompras->change_type('registroevento.imagen','image','', array(\n 'width' => 450,\n 'path' => '../uploads',\n 'thumbs' => array(array(\n 'height' => 55,\n 'width' => 120,\n 'crop' => true,\n 'marker' => '_th'))));\n $TablaCompras->modal('registroevento.imagen');\n\n /* Lista de opciones de solicitud para compras */\n $TablaCompras->change_type('estatus','select','black,white',array('values'=>'-,Pedido,Entregado,Cancelado,Incompleto'));\n\n /* Proveedores para cambio en compras */\n $TablaCompras->change_type('registroflores.proveedor','select','black,white',array(\n 'values'=>'\n -,\n FLORES DE MEXICO ( SRA. MAURA ),\n FLORES LA FINCA,\n FLORES ANDREA ( CECILIA ),\n CHILTEPEC,\n FLORES DE HOLANDA,\n EUROFLORES,\n FLORANET,\n IMEX\n '));\n \n /* No puede modificar despues de poner entregado */\n /* $TablaCompras->unset_edit(true,'estatus','=','Entregado'); */\n\n return $TablaCompras;\n}", "static public function mdlIngresarVentaBoleta($tabla, $datos){\n\n\t\t$stmt = Conexion::conectar()->prepare(\"INSERT INTO $tabla(codigo, id_cliente, fecha_emision, id_vendedor, id_unidad_negocio, id_bodega, subtotal, descuento, total_neto, iva, total_final, id_medio_pago, id_plazo_pago, observacion, productos, pagado, pendiente) \n VALUES (:codigo, :id_cliente, :fecha_emision, :id_vendedor, :id_unidad_negocio, :id_bodega, :subtotal, :descuento, :total_neto, :iva, :total_final, :id_medio_pago, :id_plazo_pago, :observacion, :productos, :pagado, :pendiente)\");\n\n $stmt->bindParam(\":codigo\", $datos[\"codigo\"], PDO::PARAM_INT);\n $stmt->bindParam(\":fecha_emision\", $datos[\"fecha_emision\"], PDO::PARAM_STR);\n $stmt->bindParam(\":id_unidad_negocio\", $datos[\"id_unidad_negocio\"], PDO::PARAM_INT);\n $stmt->bindParam(\":id_bodega\", $datos[\"id_bodega\"], PDO::PARAM_INT);\n $stmt->bindParam(\":subtotal\", $datos[\"subtotal\"], PDO::PARAM_STR);\n $stmt->bindParam(\":descuento\", $datos[\"descuento\"], PDO::PARAM_STR);\n $stmt->bindParam(\":total_neto\", $datos[\"total_neto\"], PDO::PARAM_STR);\n $stmt->bindParam(\":iva\", $datos[\"iva\"], PDO::PARAM_STR);\n $stmt->bindParam(\":total_final\", $datos[\"total_final\"], PDO::PARAM_STR);\n $stmt->bindParam(\":pagado\", $datos[\"pagado\"], PDO::PARAM_STR);\n $stmt->bindParam(\":pendiente\", $datos[\"pendiente\"], PDO::PARAM_STR);\n $stmt->bindParam(\":id_medio_pago\", $datos[\"id_medio_pago\"], PDO::PARAM_INT);\n $stmt->bindParam(\":id_plazo_pago\", $datos[\"id_plazo_pago\"], PDO::PARAM_INT);\n $stmt->bindParam(\":id_cliente\", $datos[\"id_cliente\"], PDO::PARAM_INT);\n $stmt->bindParam(\":observacion\", $datos[\"observacion\"], PDO::PARAM_STR);\n\t\t$stmt->bindParam(\":productos\", $datos[\"productos\"], PDO::PARAM_STR);\n\t\t$stmt->bindParam(\":id_vendedor\", $datos[\"id_vendedor\"], PDO::PARAM_STR);\n\n\n \n\n\t\tif($stmt->execute()){\n\n\t\t\treturn \"ok\";\n\n\t\t}else{\n\n\t\t\treturn \"error\";\n\t\t\n\t\t}\n\n\t\t$stmt->close();\n\t\t$stmt = null;\n\n }", "public function FormularioInsertRegistro($Parametros,$VarInsert) {\r\n //print_r($Vector);\r\n $this->css=new CssIni(\"\");\r\n $Tabla[\"Tabla\"]=$Parametros->Tabla;\r\n $tbl=$Tabla[\"Tabla\"];\r\n $Titulo=$Parametros->Titulo;\r\n \r\n $Columnas=$this->Columnas($Tabla); //Se debe disenar la base de datos colocando siempre la llave primaria de primera\r\n $ColumnasInfo=$this->ColumnasInfo($Tabla); //Se debe disenar la base de datos colocando siempre la llave primaria de primera\r\n \r\n $myPage=\"$Tabla[Tabla]\".\".php\";\r\n $NumCols=count($Columnas);\r\n \r\n $this->css->CrearFormularioEvento(\"FrmGuardarRegistro\", \"procesadores/procesaInsercion.php\", \"post\", \"_self\", \"\");\r\n $this->css->CrearInputText(\"TxtTablaInsert\", \"hidden\", \"\", $tbl, \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\");\r\n $this->css->CrearTabla();\r\n $this->css->FilaTabla(18);\r\n print(\"<td style='text-align: center'><strong>$Titulo</strong>\");\r\n print(\"</td>\");\r\n $this->css->CierraFilaTabla();\r\n \r\n \r\n $i=0;\r\n \r\n foreach($Columnas as $NombreCol){\r\n $this->css->FilaTabla(14);\r\n $excluir=0;\r\n \r\n if(isset($VarInsert[$tbl][$NombreCol][\"Excluir\"]) or $NombreCol==\"Updated\" or $NombreCol==\"Sync\"){\r\n $excluir=1;\r\n }\r\n $TipoText=\"text\";\r\n $Min=\"\";\r\n $Max=\"\";\r\n $Step=\"\";\r\n if(isset($VarInsert[$tbl][$NombreCol][\"TipoText\"])){\r\n $TipoText=$VarInsert[$tbl][$NombreCol][\"TipoText\"];\r\n if($TipoText=='number'){\r\n if(isset($VarInsert[$tbl][$NombreCol][\"Min\"])){\r\n $Min=$VarInsert[$tbl][$NombreCol][\"Min\"];\r\n }\r\n \r\n }\r\n }\r\n if(!$excluir){ //Si la columna no está excluida\r\n $DateBox=0;\r\n $lengCampo=preg_replace('/[^0-9]+/', '', $ColumnasInfo[\"Type\"][$i]); //Determinamos la longitud del campo\r\n if($lengCampo<10){\r\n $lengCampo=20;\r\n }\r\n if($ColumnasInfo[\"Type\"][$i]==\"text\"){\r\n $lengCampo=100;\r\n }\r\n if($ColumnasInfo[\"Type\"][$i]==\"date\"){\r\n $DateBox=1;\r\n }\r\n $Value=$ColumnasInfo[\"Default\"][$i];\r\n $Required=1;\r\n $ReadOnly=0;\r\n if($ColumnasInfo[\"Key\"][$i]==\"PRI\"){ //Verificamos si la llave es primaria\r\n \r\n $Required=1;\r\n if(!$ColumnasInfo[\"Extra\"][$i]==\"auto_increment\"){ //Verificamos si tiene auto increment\r\n $Value = $this->ObtengaID(); //Obtiene un timestamp para crear un id unico\r\n }else{\r\n $ReadOnly=1; \r\n }\r\n }else{\r\n $ReadOnly=0;\r\n }\r\n \r\n if(isset($VarInsert[$tbl][$NombreCol][\"Required\"])){\r\n $Required=1;\r\n }\r\n \r\n print(\"<td style='text-align: center'>\");\r\n $DatosConfiguracion=$this->obCon->DevuelveValores(\"configuraciones_nombres_campos\", \"NombreDB\", $NombreCol);\r\n $NombreVisualiza=$NombreCol;\r\n if($DatosConfiguracion[\"Visualiza\"]<>''){\r\n $NombreVisualiza=utf8_encode($DatosConfiguracion[\"Visualiza\"]);\r\n }\r\n print($NombreVisualiza.\"<br>\");\r\n if(property_exists($Parametros,$NombreCol) and $NombreCol<>\"Soporte\"){\r\n $Display=$Parametros->$NombreCol->Display;\r\n $IDTabla=$Parametros->$NombreCol->IDTabla;\r\n $TablaVinculo=$Parametros->$NombreCol->TablaVinculo;\r\n if($Display<>\"CodigoBarras\"){\r\n $sql=\"SELECT * FROM $TablaVinculo\";\r\n //print($sql);\r\n $Consulta=$this->obCon->Query($sql);\r\n $VectorSel[\"Nombre\"]=\"$NombreCol\";\r\n $VectorSel[\"Evento\"]=\"\";\r\n $VectorSel[\"Funcion\"]=\"\";\r\n $VectorSel[\"Required\"]=1;\r\n $VarSelect[\"Ancho\"]=300;\r\n $VarSelect[\"PlaceHolder\"]=\"Seleccione una opcion\";\r\n if($tbl==\"salud_eps\" OR $tbl==\"salud_cups\" OR $tbl==\"usuarios\"){\r\n $this->css->CrearSelect2($VectorSel);\r\n }else{\r\n $this->css->CrearSelectChosen($NombreCol, $VarSelect);\r\n }\r\n \r\n \r\n $this->css->CrearOptionSelect(\"\", \"Seleccione Una Opcion\", 0);\r\n while($Opciones=$this->obCon->FetchArray($Consulta)){\r\n $pre=0;\r\n if($Parametros->$NombreCol->Predeterminado==$Opciones[$IDTabla]){\r\n $pre=1;\r\n }\r\n $this->css->CrearOptionSelect($Opciones[$IDTabla], $Opciones[$Display], $pre); \r\n }\r\n $this->css->CerrarSelect(); \r\n }else{\r\n \r\n $this->css->CrearInputText(\"$NombreCol\", $TipoText, \"\", \"\", \"$NombreVisualiza\", \"black\", \"\", \"\", $lengCampo.\"0\", 30, 1, $Required,\"Digite $NombreCol\",\"\");\r\n \r\n }\r\n }else{\r\n if($lengCampo<100){\r\n if($NombreCol==\"RutaImagen\" or $NombreCol==\"Soporte\"){\r\n $this->css->CrearUpload($NombreCol);\r\n }else{\r\n if($DateBox==0){\r\n \r\n if($TipoText==\"number\"){\r\n \r\n $this->css->CrearInputNumber($NombreCol, $TipoText, \"\", $Value, $NombreCol, \"\", \"\", \"\", $lengCampo.\"0\", 30, $ReadOnly, $Required, $Min, $Max, $Step);\r\n }else{\r\n\r\n $this->css->CrearInputText(\"$NombreCol\", $TipoText, \"\", $Value, \"$NombreVisualiza\", \"black\", \"\", \"\", $lengCampo.\"0\", 30, $ReadOnly, $Required,\"Digite $NombreCol\",\"\");\r\n\r\n }\r\n \r\n //$this->css->CrearInputText(\"$NombreCol\", $TipoText, \"\", $Value, \"$NombreCol\", \"black\", \"\", \"\", $lengCampo.\"0\", 30, $ReadOnly, $Required,\"Digite $NombreCol\",\"\"); \r\n }\r\n if($DateBox==1){\r\n $this->css->CrearInputFecha(\"\", $NombreCol, date(\"Y-m-d\"), 100, 30, \"\");\r\n }\r\n }\r\n }else{\r\n if($NombreCol==\"RutaImagen\" or $NombreCol==\"Soporte\"){\r\n $this->css->CrearUpload($NombreCol);\r\n }else{ \r\n $this->css->CrearTextArea(\"$NombreCol\", \"\", $Value, \"\", \"$NombreVisualiza\", \"black\", \"\", \"\",\"100\",$lengCampo.\"0\", $ReadOnly, 1);\r\n }\r\n \r\n }\r\n }\r\n print(\"<td></tr>\"); \r\n }\r\n $i++;\r\n }\r\n $this->css->FilaTabla(18);\r\n print(\"<td style='text-align: center'>\");\r\n $this->css->CrearBotonConfirmado(\"BtnGuardarRegistro\", \"Guardar Registro\"); \r\n print(\"</td>\");\r\n $this->css->CierraFilaTabla();\r\n $this->css->CerrarTabla();\r\n $this->css->CerrarForm(); \r\n //return($sql);\r\n}", "function insertDatas(){\n\tglobal $xoopsDB;\n\t$table = $xoopsDB->prefix(\"charinavi_credit_types\");\n\t$sql = \"INSERT INTO $table('credit_type') VALUES ('ÉáÄÌ')\";\n\t$res = $xoopsDB->query($sql);\n\t$sql = \"INSERT INTO $table('credit_type') VALUES ('ÅöºÂ')\";\n\t$res = $xoopsDB->query($sql);\n\t\n\t$table = $xoopsDB->prefix(\"charinavi_prefectures\");\n\tinclude(XOOPS_ROOT_PATH.\"/modules/charinavi/include/prefectures.php\");\n\t$prefecture_ids = array();\n\tforeach($prefectures as $p){\n\t\t$sql = sprintf(\"INSERT INTO %s(prefecture, lat, lng) VALUES('%s', %s, %s);\", $table, $p[0], $p[1], $p[2]);\n\t\t$res = $xoopsDB->queryF($sql);\n\t\t$prefecture_ids[$p[0]] = $xoopsDB->getInsertId();\n\t}\n\n\t$table = $xoopsDB->prefix(\"charinavi_municipalities\");\n\tinclude(XOOPS_ROOT_PATH.\"/modules/charinavi/include/municipalities.php\");\n\tforeach($municipalities as $m){\n\t\t$sql = sprintf(\"INSERT INTO %s(municipality, prefecture_id) VALUES('%s', %s);\", $table, $m[1], $prefecture_ids[$m[0]]);\n\t\t$res = $xoopsDB->queryF($sql);\n\t}\n\n\t$table = $xoopsDB->prefix(\"charinavi_personalities\");\n\tinclude(XOOPS_ROOT_PATH.\"/modules/charinavi/include/personalities.php\");\n\tforeach($personalities as $p){\n\t\t$sql = sprintf(\"INSERT INTO %s(personality) VALUES('%s');\", $table, $p);\n\t\t$res = $xoopsDB->queryF($sql);\n\t}\n}", "function panggilDataTable01($tajuk,$data,$pilih)\n\t{\n\t\tdefine ('URL', $_SERVER['SCRIPT_NAME']);\n\t\tlist($urlcss,$urljs) = linkCssJs();\n\t\tdiatas($pilih, $urlcss);\n\t\t#------------------------------------------------------------------------------------------\n\t\tbinaButang($data);//versiphp();\n\t\tif($pilih != '') binaJadual02($tajuk,$data,$pilih);\n\t\t#------------------------------------------------------------------------------------------\n\t\tdibawah($pilih,$urljs);\n\t\techo \"<script>\\n\";\n\t\tjqueryExtendA();\n\t\tjqueryExtendB();\n\t\tjqueryExtendC();\n\t\tgradeTable002(null);\n\t\techo \"\\n</script>\\n</body>\\n</html>\";\n\t}", "function all() {\n\tglobal $user, $admin, $bgcolor1, $bgcolor2, $prefix,$descr_cons, $dbi,$id_cons,$desc,$indirizzo,$centralino,$fax,$id_cons_gen,$id_collegio,$idcomune,$chiusa,$id_conf,$tipo_cons,$language,$help;\n$aid=$_SESSION['aid'];\n$dbi=$_SESSION['dbi'];\n$prefix=$_SESSION['prefix'];\n############# Controllo flag per cancellazione consultazione\n\techo \"<SCRIPT type=\\\"text/javascript\\\">\\n\\n<!--\\n\"\n\t.\"//-->\\n\";\n\techo \"function del_cons() {\\n\";\n\techo \"if (document.model.pwd3.checked==false) {\\n\";\n\techo \"document.model.chiusa.options[3].selected=false \\n\";\n\techo \"} \\n\";\n\techo \"if (document.model.chiusa.options[3].selected==false) {\n\t \\n\";\n\techo \"document.model.add.value=\\\"\"._MODIFY.\"\\\" \\n\";\n\techo \"document.model.do.value=\\\"update\\\" \\n\";\n\techo \"}else{\\n\";\n\techo \"document.model.add.value=\\\"\"._DELETE.\" \"._CONSULTA.\"\\\" \\n\";\n\techo \"document.model.do.value=\\\"delete\\\" \\n\";\n\techo \"} \\n\";\t\n\techo \"} \\n\";\n\techo \"</script>\\n\";\n#########################\n\tif (isset($help)) include(\"language/$language/ele_associazioni.html\");\n\tOpenTable();\n\techo \"<tr><td><hr><br>\";\t\n\t$res = mysql_query(\"SELECT descrizione FROM \".$prefix.\"_ele_consultazione where id_cons_gen='$id_cons_gen'\" , $dbi);\n\tlist ($descr_cons) = mysql_fetch_row($res);\n//inserire avviso su mancanza dei permessi\n\techo \"<form name=\\\"model\\\" action=\\\"admin.php\\\">\";\n\techo \"<table width=\\\"100%\\\" border=\\\"3\\\">\";\n\techo \"<tr align=\\\"center\\\"><td bgcolor=\\\"$bgcolor1\\\"><b>\"._CONSULTA.\"</b></td>\";\n#\techo \"<td bgcolor=\\\"$bgcolor1\\\"><b>\"._COLLEGI.\"</b></td>\";\n\techo \"<td bgcolor=\\\"$bgcolor1\\\"><b>\"._DEFCOMUNE.\"</b></td>\";\n\techo \"<td bgcolor=\\\"$bgcolor1\\\"><b>\"._STATO.\"</b></td><td bgcolor=\\\"$bgcolor1\\\">\";\n\tif($tipo_cons==3)\n\t\techo \"<b>\"._CONF.\"</b>\";\n\techo \"<input type=\\\"hidden\\\" name=\\\"op\\\" value=\\\"associazioni\\\">\";\n#\techo \"<input type=\\\"hidden\\\" name=\\\"pag_cons\\\" value=\\\"admin.php?op=associazioni&amp;id_cons_gen=\\\">\";\n\techo \"</td></tr>\";\n\techo \"<tr align=\\\"center\\\"><td>\";\n\techo \"<input type=\\\"hidden\\\" name=\\\"id_cons_gen\\\" value=\\\"$id_cons_gen\\\">$descr_cons</td>\";\n#\t$ressede = mysql_query(\"SELECT id_collegio, descrizione from \".$prefix.\"_ele_collegi where id_cons_gen='$id_cons_gen' order by descrizione desc\", $dbi);\n#\tif ($num_coll=mysql_num_rows($ressede)){\n#\t\techo \"<td><select name=\\\"id_collegio\\\">\";\n#\t\twhile(list($id,$descr_coll)=mysql_fetch_row($ressede)){\n#\t\t\t$sel= ($id == $id_collegio) ? \"selected\":\"\";\n#\t\t\techo \"<option value=\\\"$id\\\" $sel>$descr_coll\";\n#\t\t}\n#\t\techo \"</select></td>\";\n#\t} else echo \"<td></td>\";\n\t$rescomu = mysql_query(\"SELECT id_comune, descrizione from \".$prefix.\"_ele_comuni order by descrizione asc\", $dbi);\n\techo \"<td>\";\n\tif($idcomune) {\n\t\twhile ($listele=mysql_fetch_array($rescomu))\n\t\t\tif($listele['id_comune']==$idcomune) {\n\t\t\t\techo $listele['descrizione'];\n\t\t\t\techo \"<input type=\\\"hidden\\\" name=\\\"idcomunenew\\\" value=\\\"$idcomune\\\">\";\n\t\t\t}\n\t\t\n\t}else{\n\techo \"<select name=\\\"idcomunenew\\\">\";\n\techo \"<option value=\\\"0\\\"> \";\n\twhile(list($id,$descr_comu)=mysql_fetch_row($rescomu)){\n\t\t$sel= ($id == $idcomune) ? \"selected\":\"\";\n\t\techo \"<option value=\\\"$id\\\" $sel>$descr_comu\";\n\t}\n\techo \"</select>\";\n\t}\n\techo \"</td>\";\n\t$selez['0']='';\n\t$selez['1']='';\n\t$selez['2']='';\n\t$selez['3']='';\n\t$selez[$chiusa]=\"selected\";\n\techo \"<td><select name=\\\"chiusa\\\" onChange=\\\"del_cons()\\\">\";\n\t\techo \"<option value=\\\"0\\\" \".$selez[0].\">\"._ATTIVA;\n\t\techo \"<option value=\\\"1\\\" \".$selez[1].\">\"._CHIUSA;\n\t\techo \"<option value=\\\"2\\\" \".$selez[2].\">\"._NULLA;\n\n\t\tif($idcomune) echo \"<option value=\\\"3\\\" \".$selez[3].\">\"._ELIMINA;\n\techo \"</select></td>\";\n\tif($tipo_cons==3){\n\t\t$rescomu = mysql_query(\"SELECT id_conf, descrizione from \".$prefix.\"_ele_conf order by descrizione asc\", $dbi);\n\t\techo \"<td><select name=\\\"id_conf\\\">\";\n\t\techo \"<option value=\\\"0\\\"> \";\n\t\twhile(list($id,$descr_conf)=mysql_fetch_row($rescomu)){\n\t\t\t$sel='';\n\t\t\tif ($idcomune and $id == $id_conf) $sel=\"selected\"; elseif ($id==1) $sel=\"selected\";\n\t\t\techo \"<option value=\\\"$id\\\" $sel>$descr_conf\";\n\t\t}\n\t\techo \"</select></td>\";\n\t}\n\tunset($sel);\n\techo \"<td><input type=\\\"hidden\\\" name=\\\"ok\\\" value=0>\";\n\techo \"<input type=\\\"hidden\\\" name=\\\"id_cons_gen\\\" value=\\\"$id_cons_gen\\\">\";\n\tif ($idcomune) {\n\t\techo \"<input type=\\\"hidden\\\" name=\\\"do\\\" value=\\\"update\\\">\";\n\t\techo \"<input type=\\\"hidden\\\" name=\\\"idcomune\\\" value=\\\"$idcomune\\\">\";\n\t\techo \"<input type=\\\"submit\\\" name=\\\"add\\\" value=\\\"\"._MODIFY.\"\\\" ></td></tr>\";\n\t\techo \"<tr><td colspan=\\\"4\\\"><fieldset><legend>Abilita la cancellazione</legend><label id=\\\"prov\\\">\"._SPUNTAELIMINA.\" <input type=\\\"checkbox\\\" name=\\\"pwd3\\\" value=\\\"\\\" onchange=\\\"del_cons()\\\"></label></fieldset>\";\n\t}else{\n\t\techo \"<input type=\\\"hidden\\\" name=\\\"do\\\" value=\\\"add\\\">\";\n\t\techo \"<input type=\\\"submit\\\" name=\\\"add\\\" value=\\\"\"._ADD.\"\\\">\";\n\t}\n\t$i=0;\n\techo \"</td></tr></table></form>\";\n############\n\techo \"<hr><br><table width=\\\"100%\\\" border=\\\"3\\\">\";\n\techo \"<tr align=\\\"center\\\"><td width=\\\"25%\\\" bgcolor=\\\"$bgcolor1\\\"><b>\"._CONSULTA.\"</b></td>\";\n#\techo \"<td bgcolor=\\\"$bgcolor1\\\"><b>\"._COLLEGI.\"</b></td>\";\n\techo \"<td width=\\\"25%\\\" bgcolor=\\\"$bgcolor1\\\"><b>\"._DEFCOMUNE.\"</b></td>\";\n\techo \"<td width=\\\"15%\\\" bgcolor=\\\"$bgcolor1\\\"><b>\"._STATO.\"</b></td>\";\n\tif($tipo_cons==3)\n\t\techo \"<td bgcolor=\\\"$bgcolor1\\\"><b>\"._CONF.\"</b></td>\";\n\techo \"<td></td></tr>\";\n###############\n\n#\tif ($num_coll>0)\n#\t$resmod = mysql_query(\"SELECT t1.id_collegio,t1.id_comune,t2.descrizione as descr,t1.id_cons, t3.descrizione, t4.chiusa,t4.id_conf FROM \".$prefix.\"_ele_comu_collegi as t1, \".$prefix.\"_ele_collegi as t2, \".$prefix.\"_ele_comuni as t3, \".$prefix.\"_ele_cons_comune as t4 where t1.id_cons_gen='$id_cons_gen' and t1.id_collegio=t2.id_collegio and t1.id_comune=t3.id_comune and t1.id_comune=t4.id_comune and t2.id_cons_gen=t4.id_cons_gen order by t2.descrizione, t3.descrizione\", $dbi);\n#\telse\n\t$resmod = mysql_query(\"SELECT '',t1.id_comune,'',t1.id_cons, t2.descrizione, t1.chiusa, t1.id_conf FROM \".$prefix.\"_ele_cons_comune as t1, \".$prefix.\"_ele_comuni as t2 where t1.id_cons_gen='$id_cons_gen' and t1.id_comune=t2.id_comune order by t2.descrizione\", $dbi);\n\twhile (list($id_collegio,$id_comune2,$descr_coll,$id_cons_comu,$descr_comu, $chiusa,$id_conf) = mysql_fetch_row($resmod)){ //elenco dei modelli inseriti\n\t\t$resconf = mysql_query(\"SELECT descrizione FROM \".$prefix.\"_ele_conf where id_conf='$id_conf'\", $dbi);\n\t\tlist($descr_conf) = mysql_fetch_row($resconf);\n\t\t$i++;\n\t\t$bgcolor1=($bgcolor1==$_SESSION['bgcolor1'])?$_SESSION['bgcolor2']:$_SESSION['bgcolor1'];\n\t\techo \"<tr><td colspan=\\\"5\\\">\";\n\t\techo \"<form name=\\\"modello$i\\\" action=\\\"admin.php\\\">\"\n\t\t\t.\"<input type=\\\"hidden\\\" name=\\\"op\\\" value=\\\"associazioni\\\">\";\n//\t\techo \"<input type=\\\"hidden\\\" name=\\\"do\\\" value=\\\"update\\\">\";\n#\t\techo \"<input type=\\\"hidden\\\" name=\\\"id_collegio\\\" value=\\\"$id_collegio\\\">\";\n\t\techo \"<input type=\\\"hidden\\\" name=\\\"idcomune\\\" value=\\\"$id_comune2\\\">\";\n\t\techo \"<input type=\\\"hidden\\\" name=\\\"id_cons_comu\\\" value=\\\"$id_cons_comu\\\">\";\n\t\techo \"<input type=\\\"hidden\\\" name=\\\"id_cons_gen\\\" value=\\\"$id_cons_gen\\\">\";\n\t\techo \"<input type=\\\"hidden\\\" name=\\\"desc\\\" value=\\\"$descr_cons\\\">\";\n\t\techo \"<input type=\\\"hidden\\\" name=\\\"chiusa\\\" value=\\\"$chiusa\\\">\";\n\t\techo \"<table width=\\\"100%\\\"><tr align=\\\"center\\\" bgcolor=\\\"$bgcolor1\\\">\";\n\t\techo \"<td width=\\\"25%\\\"><b>$descr_coll</b></td>\";\n\t\techo \"<td width=\\\"25%\\\"><b>$descr_comu</b></td>\";\n\t\t$stato['0']=_ATTIVA;\n\t\t$stato['1']=_CHIUSA;\n\t\t$stato['2']=_NULLA;\n\t\techo \"<td width=\\\"15%\\\"><b>\".$stato[$chiusa].\"</b></td>\";\n\t\tif($tipo_cons==3)\n\t\t\techo \"<td width=\\\"25%\\\"><input type=\\\"hidden\\\" name=\\\"id_conf\\\" value=\\\"$id_conf\\\"><b>\".$descr_conf.\"</b></td>\";\n\t\techo \"<td width=\\\"10\\\"><input type=\\\"hidden\\\" name=\\\"ok\\\" value=0><input type=\\\"submit\\\" name=\\\"edit$i\\\" value=\\\"\"._EDIT.\"\\\">\"\n\t\t\t.\"</td></tr></table></form></td></tr>\\n\";\n\t}\n\t\techo \"</table></td></tr>\";\n\t\techo \"</table></td></tr>\";\n\tCloseTable();\n\techo \"</div>\";\n\t}", "public function financas_inserir(){\r\n \r\n //data_hora_brasil_eua()\r\n $valor = \\anti_injection($_POST[\"valor\"]);\r\n $user = (int) $_POST[\"user\"];\r\n $obs = \\anti_injection($_POST[\"obs\"]);\r\n $sucesso = $this->_Modelo->MovExt_Inserir($user,$valor,$obs,1);\r\n $this->Main();\r\n if($sucesso===true){\r\n $mensagens = array(\r\n \"tipo\" => 'sucesso',\r\n \"mgs_principal\" => __('Depositado com Sucesso'),\r\n \"mgs_secundaria\" => 'Valor: '.$valor\r\n );\r\n $this->_Visual->Json_Info_Update('Titulo', __('Depositado com Sucesso'));\r\n }else{\r\n $mensagens = array(\r\n \"tipo\" => 'erro',\r\n \"mgs_principal\" => __('Erro'),\r\n \"mgs_secundaria\" => __('Erro')\r\n );\r\n $this->_Visual->Json_Info_Update('Titulo', __('Erro ao Depositar'));\r\n }\r\n $this->_Visual->Json_IncluiTipo('Mensagens',$mensagens); \r\n // ORGANIZA E MANDA CONTEUDO\r\n $this->_Visual->Json_Info_Update('Historico',0); \r\n }", "public function create_tb_data_mapel()\n {\n $this->db->query(\"CREATE TABLE `{$this->db->dbprefix}data_mapel` (\n `id` int(11) NOT NULL AUTO_INCREMENT,\n `id_mapel` varchar(128) NOT NULL,\n `nama_mapel` varchar(255) NOT NULL,\n `kurikulum_id` varchar(32) NOT NULL,\n `kelas_X` int(11) DEFAULT '0',\n `kelas_XI` int(11) DEFAULT '0',\n `kelas_XII` int(11) DEFAULT '0',\n `bobot` varchar(10) DEFAULT '50:50',\n PRIMARY KEY (`id`)\n ) ENGINE=InnoDB DEFAULT CHARSET=latin1;\");\n }", "function panggilDataTable($data,$pilih)\n\t{\n\t\tdefine ('URL', $_SERVER['SCRIPT_NAME']);\n\t\tlist($urlcss,$urljs) = linkCssJs();\n\t\tdiatas($pilih, $urlcss);\n\t\t#------------------------------------------------------------------------------------------\n\t\tbinaButang($data);//versiphp();\n\t\tbinaSatuJadual($data,$pilih);\n\t\t#------------------------------------------------------------------------------------------\n\t\tdibawah($pilih,$urljs);\n\t\techo \"<script>\\n\";\n\t\tjqueryExtendA();\n\t\tjqueryExtendB();\n\t\tjqueryExtendC();\n\t\tgradeTable002(null);\n\t\techo \"\\n</script>\\n</body>\\n</html>\";\n\t}", "public function DibujeTabla($Vector){\r\n //print_r($Vector);\r\n $this->css=new CssIni(\"\");\r\n $Tabla[\"Tabla\"]=$Vector[\"Tabla\"];\r\n $tbl=$Tabla[\"Tabla\"];\r\n $Titulo=$Vector[\"Titulo\"];\r\n $VerDesde=$Vector[\"VerDesde\"];\r\n $Limit=$Vector[\"Limit\"];\r\n $Order=$Vector[\"Order\"];\r\n $statement=$Vector[\"statement\"];\r\n \r\n $Columnas=$this->Columnas($Tabla); //Se debe disenar la base de datos colocando siempre la llave primaria de primera\r\n $InfoColumnas=$this->ColumnasInfo($Tabla); //Se debe disenar la base de datos colocando siempre la llave primaria de primera\r\n //print_r($InfoColumnas);\r\n $myPage=\"$Tabla[Tabla]\".\".php\";\r\n if(isset($Vector[\"MyPage\"])){\r\n $myPage=$Vector[\"MyPage\"];\r\n }\r\n $NumCols=count($Columnas);\r\n $Compacto= urlencode(json_encode($Vector));\r\n //$Compacto=urlencode($Compacto);\r\n if(!isset($Vector[\"NuevoRegistro\"][\"Deshabilitado\"])){\r\n $this->css->CrearFormularioEvento(\"FrmAgregar\", \"InsertarRegistro.php\", \"post\", \"_self\", \"\");\r\n $this->css->CrearInputText(\"TxtParametros\", \"hidden\", \"\", $Compacto, \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\");\r\n $this->css->CrearBotonNaranja(\"BtnAgregar\", \"Agregar Nuevo Registro\");\r\n $this->css->CerrarForm();\r\n }\r\n $this->css->CrearFormularioEvento(\"FrmFiltros\", $myPage, \"post\", \"_self\", \"\");\r\n $this->css->CrearInputText(\"TxtSql\", \"hidden\", \"\", $statement, \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\");\r\n $ColFiltro=$NumCols-1;\r\n $this->css->CrearTabla();\r\n $this->css->FilaTabla(18);\r\n print(\"<td ><strong>$Titulo</strong>\");\r\n print(\"</td>\");\r\n print(\"<td style='text-align: left' colspan=$ColFiltro>\");\r\n $this->css->CrearLink(\"$myPage\",\"_self\",\"Limpiar \");\r\n $this->css->CrearBotonVerde(\"BtnFiltrar\", \"Filtrar\");\r\n $TxtSt=urlencode($statement);\r\n $TxtTabla= base64_encode($Tabla[\"Tabla\"]);\r\n $imagerute=\"../images/csv2.png\"; \r\n $this->css->CrearImageLink(\"ProcesadoresJS/GeneradorCSV.php?Opcion=1&TxtT=$TxtTabla&TxtL=$TxtSt\", $imagerute, \"_blank\",50,50);\r\n\r\n if($tbl==' '){\r\n $imagerute=\"../images/excel.png\"; \r\n $this->css->CrearImageLink(\"$myPage?BtnExportarExcel=1&TxtT=$TxtTabla&TxtL=$TxtSt\", $imagerute, \"_blank\",50,50);\r\n \r\n //$this->css->CrearBoton(\"BtnExportarExcel\", \"Exportar a Excel\");\r\n //$this->css->CrearBotonNaranja(\"BtnVerPDF\", \"Exportar a PDF\");\r\n $imagerute=\"../images/pdf2.png\";\r\n\r\n $this->css->CrearImageLink(\"CreePDFFromTabla.php?BtnVerPDF=1&TxtT=$TxtTabla&TxtL=$TxtSt\", $imagerute, \"_blank\",50,50);\r\n \r\n }\r\n if($_SESSION[\"tipouser\"]=='administrador'){\r\n $Titulo=\"Ajustes\";\r\n $Nombre=\"ImgShowMenu\";\r\n $RutaImage=\"../images/options.gif\";\r\n $javascript=\"\";\r\n $VectorBim[\"f\"]=0;\r\n $target=\"#DialTabla\";\r\n $this->css->CrearBotonImagen($Titulo,$Nombre,$target,$RutaImage,\"\",80,80,\"fixed\",\"left:10px;top:50\",$VectorBim);\r\n \r\n $this->css->CrearCuadroDeDialogo(\"DialTabla\", \"Opciones para $tbl\");\r\n $this->css->CrearDiv(\"DivUpdateCampo\", \"\", \"center\", 1, 1);\r\n $this->css->CerrarDiv();\r\n $this->css->CrearTabla();\r\n \r\n $this->css->FilaTabla(16);\r\n $this->css->ColTabla(\"<strong>Columna</strong>\", 1);\r\n $this->css->ColTabla(\"<strong>Visualizar</strong>\", 1);\r\n //$this->css->ColTabla(\"<strong>Editar</strong>\", 1);\r\n \r\n $this->css->CierraFilaTabla();\r\n \r\n foreach ($Columnas as $Campo){\r\n $consulta=$this->obCon->ConsultarTabla(\"tablas_campos_control\", \"WHERE NombreTabla='$tbl' AND Campo='$Campo'\");\r\n $DatosCampo=$this->obCon->FetchArray($consulta);\r\n if($DatosCampo[\"Habilitado\"]=='' or $DatosCampo[\"Habilitado\"]=='1'){\r\n $this->css->FilaTabla(16);\r\n $DatosConfiguracion=$this->obCon->DevuelveValores(\"configuraciones_nombres_campos\", \"NombreDB\", $Campo);\r\n $NombreVisualiza=$Campo;\r\n if($DatosConfiguracion[\"Visualiza\"]<>''){\r\n $NombreVisualiza= utf8_encode($DatosConfiguracion[\"Visualiza\"]);\r\n }\r\n $this->css->ColTabla($NombreVisualiza, 1);\r\n print(\"<td>\");\r\n\r\n\r\n $Page=\"Consultas/ControlCamposTablas.php?idElement=Act_$Campo&Tbl=$tbl&Campo=$Campo&Ret=\";\r\n $js=\"OnClick=EnvieObjetoConsulta2(`$Page`,`Act_$Campo`,`DivUpdateCampo`,`5`);return false;\";\r\n $Act=0;\r\n if($DatosCampo[\"Visible\"]=='' or $DatosCampo[\"Visible\"]=='1'){\r\n $Act=1;\r\n }\r\n \r\n $this->css->CheckOnOff(\"Act_$Campo\", $js, $Act, \"\");\r\n print(\"</td>\");\r\n $this->css->CierraFilaTabla();\r\n }\r\n }\r\n \r\n \r\n $this->css->CerrarTabla();\r\n \r\n $this->css->CerrarCuadroDeDialogo();\r\n }\r\n print(\"</td>\");\r\n $this->css->CierraFilaTabla();\r\n \r\n $this->css->FilaTabla(14);\r\n $i=0;\r\n $this->css->ColTabla(\"<strong>Acciones</strong>\",\"\");\r\n if(isset($Vector[\"ProductosVenta\"])){\r\n $this->css->ColTabla(\"<strong>Imprimir</strong>\",\"\");\r\n }\r\n if(isset($Vector[\"Abonos\"])){\r\n $this->css->ColTabla(\"<strong>Abonar</strong>\",\"\");\r\n }\r\n foreach($Columnas as $NombreCol){\r\n $consulta=$this->obCon->ConsultarTabla(\"tablas_campos_control\", \"WHERE NombreTabla='$tbl' AND Campo='$NombreCol'\");\r\n $DatosCampo=$this->obCon->FetchArray($consulta);\r\n if($DatosCampo[\"Visible\"]<>''){\r\n if($DatosCampo[\"Visible\"]==0 or $DatosCampo[\"Habilitado\"]==0){\r\n $Vector[\"Excluir\"][$NombreCol]=1;\r\n }\r\n \r\n } \r\n \r\n if(isset($Vector[$NombreCol][\"Link\"])){\r\n $Colink[$i]=1;\r\n }\r\n $Ancho=50;\r\n if(!isset($Vector[\"Excluir\"][$NombreCol])){\r\n $DatosConfiguracion=$this->obCon->DevuelveValores(\"configuraciones_nombres_campos\", \"NombreDB\", $NombreCol);\r\n $NombreVisualiza=$NombreCol;\r\n if($DatosConfiguracion[\"Visualiza\"]<>''){\r\n $NombreVisualiza=utf8_encode($DatosConfiguracion[\"Visualiza\"]);\r\n }\r\n print(\"<td><strong>$NombreVisualiza</strong><br>\");\r\n $Ancho=strlen($NombreCol).\"0\";\r\n if($Ancho<50){\r\n $Ancho=50;\r\n }\r\n $DatosSel[\"Nombre\"]=\"Cond_\".$NombreCol;\r\n $DatosSel[\"Evento\"]=\"\";\r\n $DatosSel[\"Ancho\"]=50;\r\n $DatosSel[\"Alto\"]=30;\r\n $this->css->CrearSelectPers($DatosSel);\r\n $IndexCondicion=\"Cond_\".$NombreCol; // Condicional para aplicacion del filtro\r\n $Activo=0;\r\n for($h=1;$h<=8;$h++){\r\n if(isset($_REQUEST[$IndexCondicion])){\r\n if($_REQUEST[$IndexCondicion]==$h){\r\n $Activo=1; \r\n }else{\r\n $Activo=0; \r\n }\r\n \r\n }\r\n \r\n $this->css->CrearOptionSelect($h, $this->Condicionales[$h], $Activo);\r\n }\r\n $this->css->CerrarSelect();\r\n $ValorFiltro=\"\";\r\n if(!empty($_REQUEST[\"Filtro_\".$NombreCol])){\r\n $ValorFiltro=$_REQUEST[\"Filtro_\".$NombreCol];\r\n }\r\n print(\"<br>\");\r\n $this->css->CrearInputText(\"Filtro_\".$NombreCol, \"Text\", \"\", $ValorFiltro, \"Filtrar\", \"black\", \"\", \"\", $Ancho, 30, 0, 0);\r\n \r\n print(\"</td>\");\r\n $VisualizarRegistro[$i]=1;\r\n }\r\n if(isset($Vector[$NombreCol][\"Vinculo\"])){\r\n $VinculoRegistro[$i][\"Vinculado\"]=1;\r\n $VinculoRegistro[$i][\"TablaVinculo\"]=$Vector[$NombreCol][\"TablaVinculo\"];\r\n $VinculoRegistro[$i][\"IDTabla\"]=$Vector[$NombreCol][\"IDTabla\"]; \r\n $VinculoRegistro[$i][\"Display\"]=$Vector[$NombreCol][\"Display\"];\r\n $this->css->CrearInputText(\"TablaVinculo_\".$NombreCol, \"hidden\", \"\", $Vector[$NombreCol][\"TablaVinculo\"], \"\", \"black\", \"\", \"\", $Ancho, 30, 0, 0);\r\n $this->css->CrearInputText(\"IDTabla_\".$NombreCol, \"hidden\", \"\", $Vector[$NombreCol][\"IDTabla\"], \"\", \"black\", \"\", \"\", $Ancho, 30, 0, 0);\r\n $this->css->CrearInputText(\"Display_\".$NombreCol, \"hidden\", \"\", $Vector[$NombreCol][\"Display\"], \"\", \"black\", \"\", \"\", $Ancho, 30, 0, 0);\r\n }\r\n \r\n if(isset($Vector[$NombreCol][\"NewLink\"]) ){\r\n $NewLink[$i][\"Link\"]=$Vector[$NombreCol][\"NewLink\"];\r\n $NewLink[$i][\"Titulo\"]=$Vector[$NombreCol][\"NewLinkTitle\"]; \r\n }\r\n \r\n if(isset($Vector[\"NewText\"][$NombreCol]) ){\r\n $NewText[$i][\"NewText\"]=$Vector[\"NewText\"][$NombreCol];\r\n }\r\n $i++;\r\n \r\n }\r\n \r\n $this->css->CierraFilaTabla();\r\n $this->css->CerrarForm();\r\n $this->css->CrearForm2(\"FrmItemsTabla\", $myPage, \"post\", \"_self\");\r\n if(isset($Vector[\"idComprobante\"])){\r\n $this->css->CrearInputText(\"idComprobante\", \"hidden\", \"\", $Vector[\"idComprobante\"], \"\", \"\", \"\", \"\", \"\", \"\", 0, 0);\r\n }\r\n $sql=\"SELECT * FROM $statement ORDER BY $Order LIMIT $VerDesde,$Limit \";\r\n $Consulta= $this->obCon->Query($sql);\r\n $Parametros=urlencode(json_encode($Vector));\r\n while($DatosProducto=$this->obCon->FetchArray($Consulta)){\r\n $this->css->FilaTabla(12);\r\n print(\"<td>\");\r\n if(!isset($Vector[\"VerRegistro\"][\"Deshabilitado\"])){\r\n \r\n $Ruta=\"\";\r\n if(isset($Vector[\"VerRegistro\"][\"Link\"]) and isset($Vector[\"VerRegistro\"][\"ColumnaLink\"])){\r\n $Ruta=$Vector[\"VerRegistro\"][\"Link\"];\r\n $ColumnaLink=$Vector[\"VerRegistro\"][\"ColumnaLink\"];\r\n $Ruta.=$DatosProducto[$ColumnaLink];\r\n }\r\n \r\n \r\n \r\n $this->css->CrearLink($Ruta,\"_blank\", \"Ver // \");\r\n }\r\n if(!isset($Vector[\"EditarRegistro\"][\"Deshabilitado\"])){\r\n $Ruta=\"EditarRegistro.php?&TxtIdEdit=$DatosProducto[0]&TxtTabla=$Tabla[Tabla]&Others=\".base64_encode($statement);\r\n $this->css->CrearLink($Ruta, \"_self\", \"Editar // \");\r\n }\r\n /*\r\n * Espacio para nuevas acciones\r\n */\r\n if(isset($Vector[\"NuevaAccion\"])){\r\n //$NumAcciones=count($Vector[\"NuevaAccion\"][\"Titulo\"]);\r\n foreach($Vector[\"NuevaAccionLink\"] as $NuevaAccion){\r\n $TituloLink=$Vector[\"NuevaAccion\"][$NuevaAccion][\"Titulo\"];\r\n if($NuevaAccion==\"ChkID\"){\r\n echo \"$TituloLink: <input type='checkbox' name='ChkID[]' value=$DatosProducto[0]></input><br><br>\";\r\n echo \"<input type='submit' name='BtnEnviarChk' value='Agregar' class='btn btn-danger'></input>\";\r\n }else{\r\n $Target=$Vector[\"NuevaAccion\"][$NuevaAccion][\"Target\"];\r\n $Ruta=$Vector[\"NuevaAccion\"][$NuevaAccion][\"Link\"];\r\n $ColumnaLink=$Vector[\"NuevaAccion\"][$NuevaAccion][\"ColumnaLink\"];\r\n $Ruta.=$DatosProducto[$ColumnaLink];\r\n $this->css->CrearLink($Ruta,$Target, \" // $TituloLink // \");\r\n }\r\n }\r\n \r\n \r\n }\r\n \r\n print(\"</td>\");\r\n \r\n if(isset($Vector[\"Abonos\"])){\r\n print(\"<td>\");\r\n $idLibro=$DatosProducto[0];\r\n $TipoAbono=$Vector[\"Abonos\"];\r\n $AbonosActuales=$this->obCon->Sume(\"abonos_libro\", \"Cantidad\", \"WHERE idLibroDiario='$idLibro' AND TipoAbono='$TipoAbono'\");\r\n \r\n $Procesador=$Vector[\"Procesador\"];\r\n $TablaAbono=$Vector[\"TablaAbono\"];\r\n if($TipoAbono==\"CuentasXCobrar\"){\r\n $Factor=1;\r\n }\r\n if($TipoAbono==\"CuentasXPagar\"){\r\n $Factor=\"-1\";\r\n }\r\n $Saldo=$DatosProducto[\"Neto\"]*$Factor;\r\n $Saldo=$Saldo-$AbonosActuales;\r\n print(\"Saldo: $\".number_format($Saldo).\"<br>\");\r\n $idFecha=\"TxtFecha\".$DatosProducto[0];\r\n $idCantidad=\"TxtAbono\".$DatosProducto[0];\r\n $idLink=\"LinkAbono\".$DatosProducto[0];\r\n $idSelect=\"CmbAbono\".$DatosProducto[0];\r\n $Page=$Vector[\"MyPage\"];\r\n $this->css->CrearInputText($idFecha, \"text\", \"Fecha: \", date(\"Y-m-d\"), \"Fecha\", \"black\", \"onchange\", \"CambiaLinkAbono('$idFecha',$idLibro','$idLink','$idCantidad','$idSelect','$Page','$Page','$TablaAbono')\", 100, 30, 0, 0);\r\n print(\"<br>\");\r\n $this->css->CrearInputNumber($idCantidad, \"number\", \"Abono:\", 0, \"Cantidad\", \"black\", \"onchange\", \"CambiaLinkAbono('$idFecha','$idLibro','$idLink','$idCantidad','$idSelect','$Page','$Page','$TablaAbono')\", 100, 30, 0, 0, \"\", $Saldo, \"any\");\r\n \r\n $this->css->CrearSelect($idSelect, \"CambiaLinkAbono('$idFecha','$idLibro','$idLink','$idCantidad','$idSelect','$Page','$Page','$TablaAbono')\");\r\n $ConsultaCuentasFrecuentes=$this->obCon->ConsultarTabla(\"cuentasfrecuentes\", \"\");\r\n //$this->css->CrearOptionSelect(0, \"Cuenta ingreso\", 1);\r\n while($DatosCuenta= $this->obCon->FetchArray($ConsultaCuentasFrecuentes)){\r\n $this->css->CrearOptionSelect($DatosCuenta[\"CuentaPUC\"], $DatosCuenta[\"Nombre\"], 0);\r\n }\r\n $this->css->CerrarSelect();\r\n \r\n $VectorDatosExtra[\"ID\"]=$idLink;\r\n $VectorDatosExtra[\"JS\"]=' onclick=\"ConfirmarLink('.$idLink.');return false\" ';\r\n //$this->css->CrearLinkID($Procesador, \"_self\", \"Abonar\",$VectorDatosExtra);\r\n $this->css->CrearBotonConfirmado(\"BtnAbonar\", $DatosProducto[0]);\r\n print(\"</td>\");\r\n \r\n }\r\n \r\n if(isset($Vector[\"ProductosVenta\"])){\r\n print(\"<td>\");\r\n $idProducto=$DatosProducto[0];\r\n \r\n $this->css->CrearInputNumber(\"TxtCantidadCodigos$idProducto\", \"number\", \"Cantidad:\", 1, \"Cantidad\", \"black\", \"\", \"\", 100, 30, 0, 0, 1, 1000, 1);\r\n if(isset($Vector[\"Enabled_PrinterCB\"])){ //productosventa Codigo de barras normal\r\n $RutaPrint=\"ProcesadoresJS/PrintCodigoBarras.php?TipoCodigo=1&idProducto=$idProducto&TxtCantidad=\";\r\n $this->css->CrearBotonEvento(\"BtnPrintCB$idProducto\", \"BARRAS\", 1, \"onclick\", \"EnvieObjetoConsulta(`$RutaPrint`,`TxtCantidadCodigos$idProducto`,`DivRespuestasJS`,`0`)\", \"naranja\", \"\");\r\n }\r\n if(isset($Vector[\"Enabled_PrinterLB\"])){ //productosventa Label\r\n $RutaPrint=\"ProcesadoresJS/PrintCodigoBarras.php?TipoCodigo=2&idProducto=$idProducto&TxtCantidad=\";\r\n $this->css->CrearBotonEvento(\"BtnPrintLB$idProducto\", \"LABEL\", 1, \"onclick\", \"EnvieObjetoConsulta(`$RutaPrint`,`TxtCantidadCodigos$idProducto`,`DivRespuestasJS`,`0`)\", \"verde\", \"\");\r\n }\r\n if(isset($Vector[\"Enabled_PrinterCC\"])){ //productosventa Codigo de Barras Corto\r\n $RutaPrint=\"ProcesadoresJS/PrintCodigoBarras.php?TipoCodigo=3&idProducto=$idProducto&TxtCantidad=\";\r\n $this->css->CrearBotonEvento(\"BtnPrintMU$idProducto\", \"CORTO\", 1, \"onclick\", \"EnvieObjetoConsulta(`$RutaPrint`,`TxtCantidadCodigos$idProducto`,`DivRespuestasJS`,`0`)\", \"rojo\", \"\");\r\n }\r\n if(isset($Vector[\"PrinterCB_Sistemas\"])){\r\n $RutaPrint=\"ProcesadoresJS/PrintCodigoBarras.php?TipoCodigo=4&idProducto=$idProducto&TxtCantidad=\";\r\n $this->css->CrearBotonEvento(\"BtnPrintCBS$idProducto\", \"BARRAS\", 1, \"onclick\", \"EnvieObjetoConsulta(`$RutaPrint`,`TxtCantidadCodigos$idProducto`,`DivRespuestasJS`,`0`)\", \"naranja\", \"\");\r\n }\r\n print(\"</td>\");\r\n \r\n }\r\n \r\n for($i=0;$i<$NumCols;$i++){\r\n \r\n \r\n if(isset($VisualizarRegistro[$i])){\r\n \r\n if(!isset($VinculoRegistro[$i][\"Vinculado\"])){\r\n print(\"<td>\");\r\n if(isset($Colink[$i])){\r\n \r\n $this->css->CrearLink(\"../\".$DatosProducto[$i], \"_blank\", $DatosProducto[$i]);\r\n }else{\r\n if(isset($NewLink[$i][\"Link\"])){\r\n $Page=$Vector[\"Kit\"][\"Page\"];\r\n \r\n $idProducto=$DatosProducto[0];\r\n $idLink=\"LinkCol\".$DatosProducto[0];\r\n $idCantidad=\"TxtCantidad\".$DatosProducto[0];\r\n $idSelect=\"CmbKit\".$DatosProducto[0];\r\n $this->css->CrearSelect($idSelect, \"CambiaLinkKit('$idProducto','$idLink','$idCantidad','$idSelect','$Page')\");\r\n $ConsultaKits=$this->obCon->ConsultarTabla(\"kits\", \"\");\r\n $this->css->CrearOptionSelect(0, \"Seleccione un kit\", 1);\r\n while($DatosKits= $this->obCon->FetchArray($ConsultaKits)){\r\n $this->css->CrearOptionSelect($DatosKits[\"ID\"], $DatosKits[\"Nombre\"], 0);\r\n }\r\n $this->css->CerrarSelect();\r\n $this->css->CrearInputNumber($idCantidad, \"number\", \"\", 0, \"Cantidad\", \"black\", \"onchange\", \"CambiaLinkKit('$idProducto','$idLink','$idCantidad','$idSelect','$Page')\", 100, 30, 0, 0, 0, \"\", \"any\");\r\n $VectorDatosExtra[\"ID\"]=$idLink;\r\n $this->css->CrearLinkID($NewLink[$i][\"Link\"], \"_self\", $NewLink[$i][\"Titulo\"],$VectorDatosExtra);\r\n }else{\r\n include_once(\"../VAtencion/ConfiguracionesGenerales/Edicion.Conf.php\");\r\n $NomCol=$Columnas[$i];\r\n $idTabla=$Columnas[0];\r\n if($i>0 and $Columnas[$i]<>\"Sync\" and $Columnas[$i]<>\"Updated\" and !isset($Vector[$tbl][\"Excluir\"][$NomCol]) and !isset($Vector[\"EditarRegistro\"][\"Deshabilitado\"])){\r\n $idElement=\"TxtDatos_\".$tbl.\"_\".$Columnas[$i].\"_\".$DatosProducto[0];\r\n $idEdit=$DatosProducto[0];\r\n //Descomentar para habilitar la edicion en linea\r\n //$this->css->CrearTextArea($idElement, \"\", $DatosProducto[$i], \"\", \"\", \"onChange\", \"EditeRegistro(`$tbl`,`$NomCol`,`$idTabla`,`$idEdit`,`$idElement`)\", \"\", \"\", 0, 1,0);\r\n $TipoInfo= substr($InfoColumnas[\"Type\"][$i], 0, 3);\r\n //print(\"Tipo \".$TipoInfo);\r\n if($TipoInfo==\"dou\"){\r\n print(number_format($DatosProducto[$i])); \r\n }else{\r\n print(($DatosProducto[$i])); \r\n }\r\n //print(($DatosProducto[$i])); \r\n }else{\r\n \r\n $TipoInfo= substr($InfoColumnas[\"Type\"][$i], 0, 3);\r\n //print(\"Tipo \".$TipoInfo);\r\n if($TipoInfo==\"dou\"){\r\n print(number_format($DatosProducto[$i])); \r\n }else{\r\n print(($DatosProducto[$i])); \r\n }\r\n //$this->css->CrearInputText(\"TxtDatos$DatosProducto[0]\", \"text\", \"\", $DatosProducto[$i], \"\", \"\", \"Evento\", \"JS\", \"\", \"\", 0, 1);\r\n \r\n }\r\n }\r\n }\r\n print(\"</td>\");\r\n \r\n }else{\r\n $TablaVinculo=$VinculoRegistro[$i][\"TablaVinculo\"];\r\n $ColDisplay=$VinculoRegistro[$i][\"Display\"];\r\n $idTablaVinculo=$VinculoRegistro[$i][\"IDTabla\"];\r\n $ID=$DatosProducto[$i];\r\n //print(\"datos: $TablaVinculo $ColDisplay $idTablaVinculo $ID\"); \r\n $sql1=\"SELECT $ColDisplay FROM $TablaVinculo WHERE $idTablaVinculo='$ID'\";\r\n $Consul=$this->obCon->Query($sql1);\r\n $DatosVinculo=$this->obCon->FetchArray($Consul);\r\n \r\n print(\"<td>\");\r\n if(isset($Colink[$i])){\r\n \r\n $this->css->CrearLink(\"../\".$DatosVinculo[$ColDisplay], \"_blank\", $DatosVinculo[$ColDisplay]);\r\n }else{\r\n \r\n print(utf8_encode($DatosVinculo[$ColDisplay]));\r\n \r\n }\r\n print(\"</td>\");\r\n \r\n }\r\n }\r\n }\r\n print(\"</tr>\");\r\n }\r\n $this->css->CierraFilaTabla();\r\n $this->css->CerrarForm();\r\n $this->css->CerrarTabla();\r\n \r\n \r\n //return($sql);\r\n}", "function TABLERO_Armar2013($sDocumento, $idTercero, $objdb, $debug=false, $bDebug2=false){\r\n\trequire './app.php';\r\n\t$sError='';\r\n\t$sDebug='';\r\n\t$sInfoDebug='';\r\n\t$sCorreoInstitucional='';\r\n\tif ($bDebug2){$sDebug=$sDebug.fecha_microtiempo().' TABLERO: Iniciando la actualizacion<br>';}\r\n\t//Actualizar la clave apps para quienes no la tengan.\r\n\t$sql='SELECT unad11claveapps, unad11doc, unad11correoinstitucional FROM unad11terceros WHERE unad11id='.$idTercero.'';\r\n\t$res=$objdb->ejecutasql($sql);\r\n\tif ($objdb->nf($res)>0){\r\n\t\t$filaf=$objdb->sf($res);\r\n\t\t$sDocumento=$filaf['unad11doc'];\r\n\t\t$sCorreoInstitucional=$filaf['unad11correoinstitucional'];\r\n\t\tif ($filaf['unad11claveapps']==''){\r\n\t\t\t$sql='UPDATE unad11terceros SET unad11claveapps=\"'.md5($filaf['unad11doc']).'\" WHERE unad11id='.$idTercero;\r\n\t\t\t$res=$objdb->ejecutasql($sql);\r\n\t\t\tif ($debug){\r\n\t\t\t\t$sInfoDebug=$sInfoDebug.'Actualizando Clave para apps <br>';\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t//Verificamos el coreo institucional...\r\n\t\tif (!cadena_contiene($sCorreoInstitucional, '@unad.edu.co')){\r\n\t\t\t//Le solicitamos a congresos que lo actualce pero mediante webservice.\r\n\t\t\t//$cliente=new nusoap_client('http://66.165.175.223/apps/panel/wlib.php',false);\r\n\t\t\t//$sRutaWS='http://129.144.61.35/apps/panel/wlib.php';\r\n\t\t\tlist($sRutaCongresos, $sDebugS)=ws_RutaCongresos($objdb, $debug);\r\n\t\t\t$sRutaWS='http://'.$sRutaCongresos.'/panel/wlib.php';\r\n\t\t\tif ($bDebug2){$sDebug=$sDebug.fecha_microtiempo().' TABLERO: Invocando WebService para actualizar el correo institucional, Ruta Servicio: '.$sRutaWS.'<br>';}\r\n\t\t\t$cliente=new nusoap_client($sRutaWS,false);\r\n\t\t\t$res=$cliente->call('actualizarCorreo',array('sDocumento'=>$sDocumento,'bForzar'=>'true'));\r\n\t\t\tif (false){\r\n\t\t\tif ($res['sError']==''){\r\n\t\t\t\tif ($debug){\r\n\t\t\t\t\t$sInfoDebug=$sInfoDebug.'Error al actualizar el correo institucional '.$res['sError'].'<br>';\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}else{\r\n\t\tif ($debug){\r\n\t\t\t$sInfoDebug=$sInfoDebug.'Tercero no encontrado<br>';\r\n\t\t\t}\r\n\t\t}\r\n\t$scampos47='unad47peraca, unad47idnav, unad47idrol, unad47idtercero, unad47idcurso, unad47numaula, unad47activo, unad47retirado, unad47idgrupo, unad47idcead, unad47idceadasiste, unad47idmoodle, unad47fechaini, unad47horaini, unad47minini, unad47banderaimportacion, unad47fechamod, unad47horamod, unad47minmod';\r\n\t$svalores47='';\r\n\t$PerAcaRaiz=220;\r\n\t$sHoy=fecha_hoy();\r\n\t$sHora=fecha_hora();\r\n\t$sMinuto=fecha_minuto();\r\n\t//Retirarlo de todos los cursos.\r\n\t//Agosto 1 de 2015 se agrega la verificación de origen.\r\n\t$sql='UPDATE unad47tablero SET unad47activo=\"N\" \r\nWHERE unad47idtercero='.$idTercero.' AND unad47idcead=0 AND unad47origen=0';\r\n\t$res=$objdb->ejecutasql($sql);\r\n\tif ($bDebug2){$sDebug=$sDebug.fecha_microtiempo().' TABLERO: Actualizo todos los cursos a NO ACTIVOS<br>';}\r\n\t//Inactivarlo como director. en el OIL\r\n\t$sql='UPDATE olab17actores SET olab17activo=\"N\" WHERE olab17idactor='.$idTercero.' AND olab17idrol='.OIL_idRolDirector.'';\r\n\t$res=$objdb->ejecutasql($sql);\r\n\tif ($bDebug2){$sDebug=$sDebug.fecha_microtiempo().' TABLERO: Se inactiva como director en el OIL<br>';}\r\n\t//Buscar la info en el tablero anterior.\r\n\t$sql='SELECT courseid, role, campus, shortname FROM edu_courses2013 WHERE idnumber=\"'.$sDocumento.'\"';//campus LIKE \"campus%\" AND \r\n\t$iOrigen=0;\r\n\t$bHayOrigen=false;\r\n\tif ($iOrigen!=0){\r\n\t\tif (isset($APP->dbhostTablero)!=0){\r\n\t\t\tif ($debug){\r\n\t\t\t\t$sInfoDebug=$sInfoDebug.' Intentando conectar con la base de datos tablero <br>';\r\n\t\t\t\t}\r\n\t\t\tif ($bDebug2){$sDebug=$sDebug.fecha_microtiempo().' TABLERO: Iniciando conexion con la db tablero que es <b>'.$APP->dbnameTablero.'</b> en <b>'.$APP->dbhostTablero.'</b><br>';}\r\n\t\t\t$objOrigen=new clsdbadmin($APP->dbhostTablero, $APP->dbuserTablero, $APP->dbpassTablero, $APP->dbnameTablero);\r\n\t\t\tif ($APP->dbpuertoTablero!=''){$objOrigen->dbPuerto=$APP->dbpuertoTablero;}\r\n\t\t\tif ($objOrigen->conectar()){\r\n\t\t\t\t//$objOrigen->ejecutasql('SET NAMES utf8');\r\n\t\t\t\tif ($bDebug2){$sDebug=$sDebug.fecha_microtiempo().' TABLERO: Iniciando conexion exitosa<br>';}\r\n\t\t\t\t$bHayOrigen=true;\r\n\t\t\t\tif ($debug){\r\n\t\t\t\t\t$sInfoDebug=$sInfoDebug.' Conectado con la base de datos tablero <br>';\r\n\t\t\t\t\t}\r\n\t\t\t\t}else{\r\n\t\t\t\tif ($bDebug2){$sDebug=$sDebug.fecha_microtiempo().' TABLERO: FALLA AL CONECTARSE CON EL TABLERO.<br>';}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\tif (!$bHayOrigen){\r\n\t\t$objOrigen=$objdb;\r\n\t\t}\r\n\tif ($bDebug2){$sDebug=$sDebug.fecha_microtiempo().' TABLERO: Iniciando carga de cursos :'.$sql.'.<br>';}\r\n\t$tablaf=$objOrigen->ejecutasql($sql);\r\n\tif ($bDebug2){$sDebug=$sDebug.fecha_microtiempo().' TABLERO: Carga de cursos completa.<br>';}\r\n\tif ($debug){\r\n\t\t$sInfoDebug=$sInfoDebug.'Cursos encontrados para '.$idTercero.' = '.$objOrigen->nf($tablaf).'<br>';\r\n\t\t}\r\n\twhile ($filaf=$objOrigen->sf($tablaf)){\r\n\t\t$idNav=0;\r\n\t\t$idRol=5;\r\n\t\t$idGrupo=1;\r\n\t\t$idCead=0;\r\n\t\t$idCeadAsiste=0;\r\n\t\t$idPeraca=0;\r\n\t\tswitch($filaf['campus']){\r\n\t\t\tcase 'campus01':\r\n\t\t\tcase 'campus01_20151':\r\n\t\t\t$idNav=1;break;\r\n\t\t\tcase 'campus02':\r\n\t\t\tcase 'campus02_20151':$idNav=2;break;\r\n\t\t\tcase 'campus03':\r\n\t\t\tcase 'campus03_20151':$idNav=3;break;\r\n\t\t\tcase 'campus04':\r\n\t\t\tcase 'campus04_20151':\r\n\t\t\tcase 'campus04_20152':\r\n\t\t\t$idNav=4;break;\r\n\t\t\tcase 'campus05':\r\n\t\t\tcase 'campus05_20151':\r\n\t\t\tcase 'campus05_20152':\r\n\t\t\t$idNav=5;break;\r\n\t\t\tcase 'campus06':\r\n\t\t\tcase 'campus06_20152':\r\n\t\t\t$idNav=6;break;\r\n\t\t\tcase 'campus07':\r\n\t\t\tcase 'campus07_20151':$idNav=7;break;\r\n\t\t\tcase 'campus08':\r\n\t\t\tcase 'campus08_20151':$idNav=8;break;\r\n\t\t\tcase 'campus09':\r\n\t\t\tcase 'campus09_20151':$idNav=9;break;\r\n\t\t\tcase 'campus10':\r\n\t\t\tcase 'campus10_20151':\r\n\t\t\tcase 'campus10_20152':\r\n\t\t\t$idNav=10;break;\r\n\t\t\tcase 'campus11':\r\n\t\t\tcase 'campus11_20151':\r\n\t\t\tcase 'campus11_20152':\r\n\t\t\t$idNav=11;break;\r\n\t\t\tcase 'campus12':\r\n\t\t\tcase 'campus12_20151':\r\n\t\t\tcase 'campus12_20152':\r\n\t\t\t$idNav=12;break;\r\n\t\t\tcase 'campus13':\r\n\t\t\tcase 'campus13_20142':\r\n\t\t\tcase 'campus13_20151':\r\n\t\t\tcase 'campus13_20153':\r\n\t\t\t$idNav=13;break;\r\n\t\t\tcase 'campus14':\r\n\t\t\tcase 'campus14_20142':\r\n\t\t\tcase 'campus14_20151':\r\n\t\t\tcase 'campus14_20152':\r\n\t\t\t$idNav=14;break;\r\n\t\t\tcase 'campus15':\r\n\t\t\tcase 'campus15_20142':\r\n\t\t\tcase 'campus15_20151':$idNav=15;break;\r\n\t\t\tcase 'campus16':\r\n\t\t\tcase 'campus16_20142':\r\n\t\t\tcase 'campus16_20151':$idNav=16;break;\r\n\t\t\tcase 'campus17':\r\n\t\t\tcase 'campus17_20142':\r\n\t\t\tcase 'campus17_20151':\r\n\t\t\tcase 'campus17_20152':\r\n\t\t\t$idNav=17;break;\r\n\t\t\tcase 'campus18':\r\n\t\t\tcase 'campus18_20142':\r\n\t\t\tcase 'campus18_20151':\r\n\t\t\tcase 'campus18_20152':\r\n\t\t\t\t$idNav=18;\r\n\t\t\t\tbreak;\r\n\t\t\tcase 'campus19':\r\n\t\t\tcase 'campus19_20142':\r\n\t\t\tcase 'campus19_20151':$idNav=19;break;\r\n\t\t\tcase 'campus20':\r\n\t\t\tcase 'campus20_20151':$idNav=20;break;\r\n\t\t\tcase 'ECBTI01':$idNav=22;break;\r\n\t\t\tcase 'ECEDU01':$idNav=23;break;\r\n\t\t\tcase 'ECAPMA01':$idNav=24;break;\r\n\t\t\tcase 'ECACEN01':$idNav=25;break;\r\n\t\t\tcase 'ECSAH01':$idNav=26;break;\r\n\t\t\tcase 'ECISALUD01':$idNav=27;break;\r\n\t\t\tcase 'VISAE01':$idNav=36;break; \r\n\t\t\tcase 'INVIL01':$idNav=37;break;\r\n\t\t\tcase 'INVIL02':$idNav=38;break;\r\n\t\t\tcase 'INVIL03':$idNav=39;break;\r\n\t\t\tcase 'ECBTI02':$idNav=40;break;\r\n\t\t\tcase 'ECSAH02':$idNav=41;break;\r\n\t\t\tcase 'inter0801_20151':$idNav=43;break;\r\n\t\t\tcase 'inter0802_20151':$idNav=44;break;\r\n\t\t\tcase 'Diplomados':$idNav=52;break;\r\n\t\t\tcase 'campus_demo':$idNav=55;break;\r\n\t\t\tdefault:\r\n\t\t\t$sql='SELECT unad39id FROM unad39nav WHERE unad39nombre=\"'.$filaf['campus'].'\"';\r\n\t\t\t$tablanav=$objdb->ejecutasql($sql);\r\n\t\t\tif ($objdb->nf($tablanav)){\r\n\t\t\t\t$filanav=$objdb->sf($tablanav);\r\n\t\t\t\t$idNav=$filanav['unad39id'];\r\n\t\t\t\t}else{\r\n\t\t\t\t//El nav puede estar en un alias.\r\n\t\t\t\tlist($idCurso, $idAula, $idPeraca)=TABLERO_InterpretarNombre($filaf['shortname']);\r\n\t\t\t\t$sql='SELECT unad54idnav FROM unad54navperaca WHERE unad54alias=\"'.$filaf['campus'].'\" AND unad54peraca='.$idPeraca;\r\n\t\t\t\t$tablanav=$objdb->ejecutasql($sql);\r\n\t\t\t\tif ($objdb->nf($tablanav)>0){\r\n\t\t\t\t\t$filanav=$objdb->sf($tablanav);\r\n\t\t\t\t\t$idNav=$filanav['unad54idnav'];\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\tif ($debug){\r\n\t\t\t\t\t\t$sInfoDebug=$sInfoDebug.'No se encuentra el nav para '.$filaf['campus'].' Peraca '.$idPeraca.'<br>';\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\tbreak;\r\n\t\t\t}\r\n\t\tif ($idNav!=0){\r\n\t\t\tlist($idCurso, $idAula, $idPeraca)=TABLERO_InterpretarNombre($filaf['shortname']);\r\n\t\t\t$bEsCursoEstandar=true;\r\n\t\t\tif ((int)$idPeraca==0){$bEsCursoEstandar=false;}\r\n\t\t\tif ($idCurso==''){$bEsCursoEstandar=false;}\r\n\t\t\tif (!$bEsCursoEstandar){\r\n\t\t\t\t//no se puede interpretar el nombre porque no es estandar.\r\n\t\t\t\t$idNav=0;\r\n\t\t\t\tif ($debug){\r\n\t\t\t\t\t$sInfoDebug=$sInfoDebug.$filaf['shortname'].' = No es un curso estandar se procede a buscar por equivalencias.<br>';\r\n\t\t\t\t\t}\r\n\t\t\t\t}else{\r\n\t\t\t\tif ($debug){\r\n\t\t\t\t\t$sInfoDebug=$sInfoDebug.$filaf['shortname'].' =&gt; Curso:'.$idCurso.' Aula:'.$idAula.' PerAca:'.$idPeraca.'<br>';\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\tif ((int)$idNav==0){\r\n\t\t\t$idCurso='';\r\n\t\t\t$idAula=1;\r\n\t\t\t$idPeraca=87;\r\n\t\t\t$bEspecial=false;\r\n\t\t\t$sql='SELECT unad49idnav, unad49idcurso, unad49idperaca FROM unad49equivaltablero WHERE unad49nomcampus=\"'.trim($filaf['campus']).'\" AND unad49nomcurso=\"'.trim($filaf['shortname']).'\"';\r\n\t\t\t$tablaesp=$objdb->ejecutasql($sql);\r\n\t\t\tif ($objdb->nf($tablaesp)>0){\r\n\t\t\t\t$filaesp=$objdb->sf($tablaesp);\r\n\t\t\t\t$idNav=$filaesp['unad49idnav'];\r\n\t\t\t\t$idCurso=$filaesp['unad49idcurso'];\r\n\t\t\t\t$idPeraca=$filaesp['unad49idperaca'];\r\n\t\t\t\t$bEspecial=true;\r\n\t\t\t\tif (($idNav==1)&&($idCurso==101)&&($idPeraca==87)){\r\n\t\t\t\t\t//Esta combinación se utiliza para informar que no esta actualizado\r\n\t\t\t\t\t$idCurso='';\r\n\t\t\t\t\t}\r\n\t\t\t\t}else{\r\n\t\t\t\tif ($debug){\r\n\t\t\t\t\t$sInfoDebug=$sInfoDebug.'No existe equivalencia para curso \"'.$filaf['shortname'].'\" campus \"'.$filaf['campus'].'\"<br>';\r\n\t\t\t\t\t}\r\n\t\t\t\t//Enviar el registro a equivalencias para que sea actualizado\r\n\t\t\t\t$id49=tabla_consecutivo('unad49equivaltablero','unad49id', '', $objdb);\r\n\t\t\t\t$scampos49='unad49nomcampus, unad49nomcurso, unad49id, unad49idnav, unad49idcurso, unad49idperaca';\r\n\t\t\t\t$svalores49='\"'.$filaf['campus'].'\", \"'.$filaf['shortname'].'\", '.$id49.', 1, 101, 87';\r\n\t\t\t\t$sql='INSERT INTO unad49equivaltablero ('.$scampos49.') VALUES ('.$svalores49.');';\r\n\t\t\t\t$res=$objdb->ejecutasql($sql);\r\n\t\t\t\tif ($res==false){\r\n\t\t\t\t\tif ($debug){\r\n\t\t\t\t\t\t$sInfoDebug=$sInfoDebug.'falla al ejecutar '.$sql.'<br>';\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\tif ($debug){\r\n\t\t\t$sInfoDebug=$sInfoDebug.'Procesando '.$filaf['shortname'].' = Curso '.$idCurso.' Aula '.$idAula.' Peraca '.$idPeraca.'<br>';\r\n\t\t\t}\r\n\t\t$bConLaboratorio=false;\r\n\t\tif ($idCurso!=''){\r\n\t\t\t$sql='SELECT unad40incluyelaboratorio FROM unad40curso WHERE unad40id='.$idCurso;\r\n\t\t\t$tablaf2=$objdb->ejecutasql($sql);\r\n\t\t\tif ($objdb->nf($tablaf2)==0){\r\n\t\t\t\tif ($debug){\r\n\t\t\t\t\t$sInfoDebug=$sInfoDebug.'<span class=\"rojo\">El curso '.$idCurso.' no pudo ser comprobado</span><br>';\r\n\t\t\t\t\t}\r\n\t\t\t\t$idCurso='';\r\n\t\t\t\t}else{\r\n\t\t\t\t$fila40=$objdb->sf($tablaf2);\r\n\t\t\t\tif ($fila40['unad40incluyelaboratorio']=='S'){$bConLaboratorio=true;}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\tif ($idCurso!=''){\r\n\t\t\t//Traer el rol.\r\n\t\t\tswitch(trim($filaf['role'])){\r\n\t\t\t\tcase 'Admin':\r\n\t\t\t\tcase 'Administrator':\r\n\t\t\t\t$idRol=1;\r\n\t\t\t\tbreak;\r\n\t\t\t\tcase 'Decano':\r\n\t\t\t\t$idRol=19;\r\n\t\t\t\tbreak;\r\n\t\t\t\tcase 'Director de Curso':\r\n\t\t\t\tcase 'Director de curso':\r\n\t\t\t\t$idRol=3;\r\n\t\t\t\tbreak;\r\n\t\t\t\tcase 'Profesor sin permiso de edición':\r\n\t\t\t\tcase 'Tutor':\r\n\t\t\t\tcase 'Tutor de curso':\r\n\t\t\t\t$idRol=4;\r\n\t\t\t\tbreak;\r\n\t\t\t\tcase '':\r\n\t\t\t\tcase '5':\r\n\t\t\t\tcase 'Estudiante':\r\n\t\t\t\tcase 'student':\r\n\t\t\t\tbreak;\r\n\t\t\t\tcase 'Invitado':\r\n\t\t\t\t$idRol=6;\r\n\t\t\t\tbreak;\r\n\t\t\t\tcase 'Coordinador':\r\n\t\t\t\t$idRol=10;\r\n\t\t\t\tbreak;\r\n\t\t\t\tcase 'Acreditador':\r\n\t\t\t\tcase 'Evaluador':\r\n\t\t\t\t$idRol=11;\r\n\t\t\t\tbreak;\r\n\t\t\t\tcase 'Admin PTI - VIMMEP':\r\n\t\t\t\tcase 'Admin VIMEP-PTI':\r\n\t\t\t\tcase 'Administrador PTI-VIMMEP':\r\n\t\t\t\t$idRol=12;\r\n\t\t\t\tbreak;\r\n\t\t\t\tcase 'Editor':\r\n\t\t\t\t$idRol=14;\r\n\t\t\t\tbreak;\r\n\t\t\t\tcase 'Auditor':\r\n\t\t\t\tcase 'Auditor de Servicios':\r\n\t\t\t\t$idRol=16;\r\n\t\t\t\tbreak;\r\n\t\t\t\tcase 'Diseñador':\r\n\t\t\t\t$idRol=17;\r\n\t\t\t\tbreak;\r\n\t\t\t\tcase 'E-monitor':\r\n\t\t\t\t$idRol=18;\r\n\t\t\t\tbreak;\r\n\t\t\t\tcase 'Lider':\r\n\t\t\t\t$idRol=21;\r\n\t\t\t\tbreak;\r\n\t\t\t\tcase 'Lider Acreditación':\r\n\t\t\t\tcase 'Lider Acreditacion':\r\n\t\t\t\t$idRol=22;\r\n\t\t\t\tbreak;\r\n\t\t\t\tcase 'Observador':\r\n\t\t\t\t$idRol=9;\r\n\t\t\t\tbreak;\r\n\t\t\t\tcase 'Secretaria':\r\n\t\t\t\t$idRol=20;\r\n\t\t\t\tbreak;\r\n\t\t\t\tdefault:\r\n\t\t\t\t$bExisteRol=false;\r\n\t\t\t\tif (substr(trim($filaf['role']),0,4)=='Dise'){\r\n\t\t\t\t\t$idRol=17;\r\n\t\t\t\t\t$bExisteRol=true;\r\n\t\t\t\t\t}\r\n\t\t\t\tif (substr(trim($filaf['role']),0,14)=='Lider Acredita'){\r\n\t\t\t\t\t$idRol=22;\r\n\t\t\t\t\t$bExisteRol=true;\r\n\t\t\t\t\t}\r\n\t\t\t\tif (!$bExisteRol){\r\n\t\t\t\t\tif ($debug){\r\n\t\t\t\t\t\t$sInfoDebug=$sInfoDebug.'<span class=\"rojo\">No se encuentra informaci&oacute;n del rol {'.cadena_notildes($filaf['role']).'} para el curso '.$idCurso.'</span><br>';\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t$idCurso='';\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\tif ($idCurso!=''){\r\n\t\t\tif ($idNav==0){\r\n\t\t\t\tif ($debug){\r\n\t\t\t\t\t$sInfoDebug=$sInfoDebug.'<span class=\"rojo\">El curso '.$idCurso.' no tiene un NAV asginado</span><br>';\r\n\t\t\t\t\t}\r\n\t\t\t\t$idCurso='';\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\tif ($idCurso!=''){\r\n\t\t\tif ($idPeraca==''){\r\n\t\t\t\t$idPeraca=$PerAcaRaiz;\r\n\t\t\t\t}else{\r\n\t\t\t\t$sql='SELECT exte02nombre, exte02vigente FROM exte02per_aca WHERE exte02id='.$idPeraca;\r\n\t\t\t\t$tablaf2=$objdb->ejecutasql($sql);\r\n\t\t\t\tif ($objdb->nf($tablaf2)==0){\r\n\t\t\t\t\tif ($debug){\r\n\t\t\t\t\t\t$sInfoDebug=$sInfoDebug.'<span class=\"rojo\">El peraca '.$idPeraca.' no ha sido importado</span><br>';\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t$idPeraca='';\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\tif ($idPeraca!=87){\r\n\t\t\t\t\t\t$filaper=$objdb->sf($tablaf2);\r\n\t\t\t\t\t\tif ($filaper['exte02vigente']!='S'){\r\n\t\t\t\t\t\t\tif ($debug){\r\n\t\t\t\t\t\t\t\t$sInfoDebug=$sInfoDebug.'<span class=\"rojo\">El peraca '.$idPeraca.' esta inactivo</span><br>';\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t$idPeraca='';\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\tif ($idPeraca!=''){\r\n\t\t\t\t//tenemos PerAca y Curso.\r\n\t\t\t\t$sql='SELECT unad47peraca FROM unad47tablero \r\nWHERE unad47idtercero='.$idTercero.' AND unad47peraca='.$idPeraca.' AND unad47idnav='.$idNav.' AND unad47idrol='.$idRol.' AND unad47idcurso='.$idCurso.' AND unad47numaula='.$idAula.'';\r\n\t\t\t\t$res=$objdb->ejecutasql($sql);\r\n\t\t\t\tif ($objdb->nf($res)==0){\r\n\t\t\t\t\t$svalores47=''.$idPeraca.', '.$idNav.', '.$idRol.', '.$idTercero.', '.$idCurso.', '.$idAula.', \"S\", \"N\", '.$idGrupo.', '.$idCead.', '.$idCeadAsiste.', \"'.$filaf['courseid'].'\", \"'.$sHoy.'\", '.$sHora.', '.$sMinuto.', \"S\", \"'.$sHoy.'\", '.$sHora.', '.$sMinuto.'';\r\n\t\t\t\t\t$sql='INSERT INTO unad47tablero ('.$scampos47.') VALUES ('.$svalores47.');';\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t$sql='UPDATE unad47tablero SET unad47activo=\"S\", unad47retirado=\"N\", unad47idmoodle=\"'.$filaf['courseid'].'\" \r\nWHERE unad47idtercero='.$idTercero.' AND unad47peraca='.$idPeraca.' AND unad47idnav='.$idNav.' AND unad47idrol='.$idRol.' AND unad47idcurso='.$idCurso.' AND unad47numaula='.$idAula.'';\r\n\t\t\t\t\t}\r\n\t\t\t\t$res=$objdb->ejecutasql($sql);\t\t\t\t\t\r\n\t\t\t\tif ($debug){\r\n\t\t\t\t\tif ($res==false){\r\n\t\t\t\t\t\t$sInfoDebug=$sInfoDebug.'<span class=\"rojo\">Error '.$objdb->serror.' -- '.$sql.'</span><br>';\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t//Termina si tenemos curso y peraca.\r\n\t\t\t\t//Mayo 26 de 2016 a los rol 3 (director de curso los matriculamos en el oai y como director de curso\r\n\t\t\t\tif ($idRol==3){\r\n\t\t\t\t\tif ($bConLaboratorio){\r\n\t\t\t\t\t\t//Se les agrega el rol 4 en el oai. lo cual les activa el perfil de directores.\r\n\t\t\t\t\t\tOIL_AgregarDirector($idTercero, $idPeraca, $objdb);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t//Fin de matricular...\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\tif ($debug){\r\n\t\t\t\t$sInfoDebug=$sInfoDebug.'<span class=\"rojo\">No se ha encontrado el curso '.$filaf['shortname'].' en el campus (NAV) '.$filaf['campus'].'</span><br>';\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t//Fin del recorrido por cada fila.\r\n\t\t}\r\n\tif ($bHayOrigen){\r\n\t\t$objOrigen->CerrarConexion();\r\n\t\t}\r\n\t//Los cursos que no se activaron es porque fueron retirados.\r\n\t$sql='UPDATE unad47tablero SET unad47retirado=\"S\",unad47fechamod=\"'.$sHoy.'\", unad47horamod='.$sHora.', unad47minmod='.$sMinuto.' \r\nWHERE unad47idtercero='.$idTercero.' AND unad47idcead=0 AND unad47activo=\"N\" AND unad47retirado=\"N\" AND unad47origen=0';\r\n\t$res=$objdb->ejecutasql($sql);\r\n\t//Actualizar la fecha de actualización del tablero.\r\n\t$iMinAhora=fecha_MinutoMod();\r\n\t$sql='UPDATE unad11terceros SET unad11fechatablero=\"'.$sHoy.'\", unad11minutotablero='.$iMinAhora.' WHERE unad11id='.$idTercero.'';\r\n\t$res=$objdb->ejecutasql($sql);\r\n\treturn array($sError, $sInfoDebug, $sDebug);\r\n\t}", "function db_baru (){\n \tglobal $wpdb;\n\n \t$table_name = $wpdb->prefix . 'dbbaru';\n \t$charset_collate = $wpdb->get_charset_collate();\n\n $sql = \"CREATE TABLE IF NOT EXISTS $table_name(\n \t'id' mediumint(9) NOT NULL AUTO_INCREMENT,\n \t'name' text NOT NULL,\n \t'text' text NOT NULL,\n \t'url' varchar(55) DEFAULT '' NOT NULL,\n \tPRIMARY KEY ('id')\n \t) $charset_collate;\";\n\n \trequire_once( ABSPATH . 'wp-admin/includes/upgrade.php');\n \tdbDelta($sql);\n \tob_start();\n\n \t?>\n \t<div>\n \t\t<h2>Insert Data</h2>\n \t\t<form method=\"post\" action=\"#v_form\" id=\"v_form\">\n \t\t\t<table>\n \t\t\t\t<tr>\n \t\t\t\t\t<td>Nama : </td>\n \t\t\t\t\t<td><input type=\"text\" name=\"name\" id=\"name\"/></td>\n \t\t\t\t</tr>\n \t\t\t\t<tr>\n \t\t\t\t\t<td>Website : </td>\n \t\t\t\t\t<td><input type=\"text\" name=\"url\" id=\"url\"/></td>\n \t\t\t\t</tr>\n \t\t\t\t<tr>\n \t\t\t\t\t<td>Text : </td>\n \t\t\t\t\t<td><textarea name=\"text\" id=\"text\">tulis pesan ...</textarea></td>\n \t\t\t\t</tr>\n \t\t\t\t<tr>\n \t\t\t\t\t<td>&nbsp;</td>\n \t\t\t\t\t<td><input type=\"submit\" name=\"submit\" id=\"submit\" value=\"Kirim\"></td>\n \t\t\t\t</tr>\n \t\t\t</table>\n \t\t</form>\n \t</div>\n \t<?php\n \t$html = ob_get_clean();\n\n \tif (isset ( $_POST['submit']) && $_POST['name'] != \"\") {\n \t\t$name = strip_tags($_POST['name'], \"\");\n \t\t$text = strip_tags($_POST['text'], \"\");\n \t\t$url = strip_tags($_POST['url'], \"\");\n \t\t$isi = array(\n \t\t\t'name' => $name\n \t\t\t//'text' => $text,\n \t\t\t//'url' => $url\n \t\t\t);\n\n \t\t$table_name = $wpdb->prefix . 'dbbaru';\n\n \t\t$wpdb->insert(\n \t\t\t$table_name,$isi);\n \t\t$html = \"<p>Your name <strong>$name</strong> was successfully recorded. Thanks!!</p>\";\n \t}\n\n \tif (isset($_POST['submit']) && $_POST['name'] == \"\")\n \t\t$html .= \"<p>You need to fill the required fields</p>\";\n \treturn $html;\n\n\n }", "function procesa_archivo_tabla_db($id_tabla){\n\t\t$ultimo_manejo \t\t= $this->object->archivos_model->_ultimo_manejo($id_tabla);\t\t\t\n\t\t$ultimo_ambiente \t= $this->object->archivos_model->_ultimo_ambiente($id_tabla);\t\t\t\n\n\t\t// borra anterior\n\t\t$carpeta \t= $this->_ruta_tablas;\n\t\t$archivo \t= $this->object->archivos_model->_archivo_por_tabla($id_tabla);\t\t\t\n\t\tif (!is_null($archivo)) {\n\t\t\t$borra_archivo\t= @unlink($carpeta.$archivo);\n\t\t}\n\n\t\t// prepara datos archivo\n\t\t// precios\n\t\t$datos_precios\t= $this->object->archivos_model->_precios_por_tabla($id_tabla);\t\t\t\n\t\t$precios \t\t= array();\n\t\tfor ($i=0; $i < count($datos_precios); $i++) {\n\t\t\t$precios[] = array(\n\t\t\t\t\t\t\t\t\t\t\"precio_lu_id\"\t\t=> $datos_precios[$i]['id_land_use'],\n\t\t\t\t\t\t\t\t\t\t\"precio_precio\"\t\t=> $datos_precios[$i]['precio'],\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t);\n\t\t}\n\t\t\n\t\t// costos\n\t\t$datos_costos\t= $this->object->archivos_model->_costos_por_tabla($id_tabla);\t\t\t\n\t\t$total\t\t\t= count($datos_costos);\n\t\t$costos \t\t= array();\n\t\t$indice_costos\t= 0;\n\t\tfor ($i=0; $i < $total; $i++) {\n\t\t\t$id_lu = $datos_costos[$i]['id_land_use'];\n\t\t\t$costos[$indice_costos][\"costo_lu_id\"] = $id_lu;\n\t\t\t\n\t\t\t// manejos\n\t\t\t$contenido_costos_mgm_amb = array();\n\t\t\twhile (\n\t\t\t\t$i < $total &&\n\t\t\t\t$id_lu == $datos_costos[$i]['id_land_use']\n\t\t\t){\n\t\t\t\t$id_mgm = $datos_costos[$i]['id_manejo'];\n\t\t\t\t$id_amb = $datos_costos[$i]['id_ambiente'];\n\t\t\t\t\n\t\t\t\t$signo = '+';\n\t\t\t\tif (\n\t\t\t\t\t$id_mgm == $ultimo_manejo &&\n\t\t\t\t\t$id_amb == $ultimo_ambiente\n\t\t\t\t) {\n\t\t\t\t\t// ultimo\n\t\t\t\t\t$signo = '';\t\t\t\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$contenido_costos_mgm_amb[] = array (\n\t\t\t\t\t\t\t\t\t\t\t\t\"costo_mgm_id\" \t=> $id_mgm,\n\t\t\t\t\t\t\t\t\t\t\t\t\"costo_amb_id\" \t=> $id_amb,\n\t\t\t\t\t\t\t\t\t\t\t\t\"costo_costo\" \t=> $datos_costos[$i]['costo'],\n\t\t\t\t\t\t\t\t\t\t\t\t\"costo_signo\" \t=> $signo,\n\t\t\t\t);\n\t\t\t\t\n\t\t\t\t$i = $i + 1;\n\t\t\t\t\n\t\t\t}\n\t\t\t$costos[$indice_costos][\"contenido_costos_mgm_amb\"] = $contenido_costos_mgm_amb;\n\n\t\t\t$indice_costos = $indice_costos + 1;\n\t\t\t// para que al entrar al for no saltee uno\n\t\t\t$i = $i - 1;\n\t\t}\n\n\t\t// rindes\n\t\t$datos_rindes \t= $this->object->archivos_model->_rindes_por_tabla($id_tabla);\t\n\t\t$total\t\t\t= count($datos_rindes);\n\t\t$rindes \t\t= array();\n\t\t$indice_rindes\t= 0;\n\t\tfor ($i=0; $i < $total; $i++) {\n\t\t\t$id_lu = $datos_rindes[$i]['id_land_use'];\n\t\t\t$rindes[$indice_rindes][\"rinde_lu_id\"] = $id_lu;\n\t\t\t\n\t\t\t// manejos\n\t\t\t$contenido_rindes_mgm_amb = array();\n\t\t\twhile (\n\t\t\t\t$i < $total &&\n\t\t\t\t$id_lu == $datos_rindes[$i]['id_land_use']\n\t\t\t){\n\t\t\t\t$id_mgm = $datos_rindes[$i]['id_manejo'];\n\t\t\t\t$id_amb = $datos_rindes[$i]['id_ambiente'];\n\t\t\t\t\n\t\t\t\t$signo = '+';\n\t\t\t\tif (\n\t\t\t\t\t$id_mgm == $ultimo_manejo &&\n\t\t\t\t\t$id_amb == $ultimo_ambiente\n\t\t\t\t) {\n\t\t\t\t\t// ultimo\n\t\t\t\t\t$signo = '';\t\t\t\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$contenido_rindes_mgm_amb[] = array (\n\t\t\t\t\t\t\t\t\t\t\t\t\"rinde_mgm_id\" \t=> $id_mgm,\n\t\t\t\t\t\t\t\t\t\t\t\t\"rinde_amb_id\" \t=> $id_amb,\n\t\t\t\t\t\t\t\t\t\t\t\t\"rinde_rinde\" \t=> $datos_rindes[$i]['rinde'],\n\t\t\t\t\t\t\t\t\t\t\t\t\"rinde_signo\" \t=> $signo,\n\t\t\t\t);\n\t\t\t\t\n\t\t\t\t$i = $i + 1;\n\t\t\t\t\n\t\t\t}\n\t\t\t$rindes[$indice_rindes][\"contenido_rindes_mgm_amb\"] = $contenido_rindes_mgm_amb;\n\n\t\t\t$indice_rindes = $indice_rindes + 1;\n\t\t\t// para que al entrar al for no saltee uno\n\t\t\t$i = $i - 1;\n\t\t}\n\n\t\t// emergias\n\t\t$datos_emergias \t= $this->object->archivos_model->_emergias_por_tabla($id_tabla);\t\n\t\t$total\t\t\t\t= count($datos_emergias);\n\t\t$emergias \t\t\t= array();\n\t\t$indice_emergias\t= 0;\n\t\tfor ($i=0; $i < $total; $i++) {\n\t\t\t$id_lu = $datos_emergias[$i]['id_land_use'];\n\t\t\t$emergias[$indice_emergias][\"emergia_lu_id\"] = $id_lu;\n\t\t\t\n\t\t\t// manejos\n\t\t\t$contenido_emergias_mgm_amb = array();\n\t\t\twhile (\n\t\t\t\t$i < $total &&\n\t\t\t\t$id_lu == $datos_emergias[$i]['id_land_use']\n\t\t\t){\n\t\t\t\t$id_mgm = $datos_emergias[$i]['id_manejo'];\n\t\t\t\t$id_amb = $datos_emergias[$i]['id_ambiente'];\n\t\t\t\t\n\t\t\t\t$signo = '+';\n\t\t\t\tif (\n\t\t\t\t\t$id_mgm == $ultimo_manejo &&\n\t\t\t\t\t$id_amb == $ultimo_ambiente\n\t\t\t\t) {\n\t\t\t\t\t// ultimo\n\t\t\t\t\t$signo = '';\t\t\t\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$contenido_emergias_mgm_amb[] = array (\n\t\t\t\t\t\t\t\t\t\t\t\t\"emergia_mgm_id\" \t=> $id_mgm,\n\t\t\t\t\t\t\t\t\t\t\t\t\"emergia_amb_id\" \t=> $id_amb,\n\t\t\t\t\t\t\t\t\t\t\t\t\"emergia_emergia\" \t=> $datos_emergias[$i]['emergia'],\n\t\t\t\t\t\t\t\t\t\t\t\t\"emergia_signo\" \t=> $signo,\n\t\t\t\t);\n\t\t\t\t\n\t\t\t\t$i = $i + 1;\n\t\t\t\t\n\t\t\t}\n\t\t\t$emergias[$indice_emergias][\"contenido_emergias_mgm_amb\"] = $contenido_emergias_mgm_amb;\n\n\t\t\t$indice_emergias = $indice_emergias + 1;\n\t\t\t// para que al entrar al for no saltee uno\n\t\t\t$i = $i - 1;\n\t\t}\n\t\t\n\t\t// ajuste ue por ambiente\n\t\t$datos_ajuste_ue_amb\t= $this->object->archivos_model->_ajuste_ambiente_por_tabla($id_tabla);\t\t\t\n\t\t$ajuste_ue_amb \t\t\t= array();\n\t\tfor ($i=0; $i < count($datos_ajuste_ue_amb); $i++) {\n\t\t\t$signo = '+';\n\t\t\tif ($i == (count($datos_ajuste_ue_amb)-1)) {\n\t\t\t\t// ultimo\n\t\t\t\t$signo = '';\t\t\t\t\n\t\t\t}\n\n\t\t\t$ajuste_ue_amb[] = array(\n\t\t\t\t\t\t\t\t\t\t\"ajuste_ambiente_amb_id\"\t=> $datos_ajuste_ue_amb[$i]['id_ambiente'],\n\t\t\t\t\t\t\t\t\t\t\"ajuste_ambiente_valor\"\t\t=> $datos_ajuste_ue_amb[$i]['valor'],\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\"ajuste_ambiente_signo\"\t\t=> $signo,\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t);\n\t\t}\n\n\t\t// ajuste ue por entorno\n\t\t$datos_ajuste_ue_ent \t= $this->object->archivos_model->_ajuste_entorno_por_tabla($id_tabla);\t\n\t\t$total\t\t\t\t\t= count($datos_ajuste_ue_ent);\n\t\t$ajuste_entorno_vecino \t= array();\n\t\t$manejos_id\t\t\t\t= array();\n\t\tfor ($i=0; $i < $total; $i++) {\n\t\t\t$signo = '+';\n\t\t\tif ($i == ($total-1)) {\n\t\t\t\t// ultimo\n\t\t\t\t$signo = '';\t\t\t\t\n\t\t\t}\n\t\t\t\t\t\t\n\t\t\t// obtiene manejos para los individuales\n\t\t\tif(!in_array($datos_ajuste_ue_ent[$i]['id_manejo'], $manejos_id)) {\n\t\t\t\t$manejos_id[] = $datos_ajuste_ue_ent[$i]['id_manejo'];\n\t\t\t}\n\t\t\t\n\t\t\t$ajuste_entorno_vecino[] = array(\n\t\t\t\t\t\t\t\t\t\"mgmv_v_mgm_id\"\t\t=> $datos_ajuste_ue_ent[$i]['id_manejo_entorno'],\n\t\t\t\t\t\t\t\t\t\"mgmv_mgm_id\"\t\t=> $datos_ajuste_ue_ent[$i]['id_manejo'],\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\"mgmv_valor\"\t\t=> $datos_ajuste_ue_ent[$i]['valor'],\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\"mgmv_signo\"\t\t=> $signo,\n\t\t\t\t\t\t\t\t);\n\t\t}\n\n\t\t$ajuste_entorno\t\t\t= array();\t\t\n\t\tfor ($i=0; $i < count($manejos_id); $i++) {\n\t\t\t$ajuste_entorno_mgm_id = $manejos_id[$i];\n\t\t\t\n\t\t\t$contenido_ajuste_entorno_mgmv = array();\n\t\t\tfor ($j=0; $j < $total; $j++) {\n\t\t\t\t$signo = '+';\n\t\t\t\tif ($datos_ajuste_ue_ent[$j]['id_manejo'] == $ajuste_entorno_mgm_id) {\n\t\t\t\t\t$contenido_ajuste_entorno_mgmv[] = array(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"ajuste_entorno_mgmv_id\"\t=> $datos_ajuste_ue_ent[$j]['id_manejo_entorno'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"ajuste_entorno_valor\"\t\t=> $datos_ajuste_ue_ent[$j]['valor'],\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"ajuste_entorno_signo\"\t\t=> $signo,\n\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t}\n\t\t\t$cantidad_contenido = count($contenido_ajuste_entorno_mgmv);\n\t\t\t$contenido_ajuste_entorno_mgmv[$cantidad_contenido-1]['ajuste_entorno_signo'] = '';\n\t\t\t\t\n\t\t\t$ajuste_entorno[] = array(\n\t\t\t\t\t\t\t\t\t\t\t\"ajuste_entorno_mgm_id\"\t\t\t\t=> $ajuste_entorno_mgm_id,\n\t\t\t\t\t\t\t\t\t\t\t\"contenido_ajuste_entorno_mgmv\"\t\t=> $contenido_ajuste_entorno_mgmv,\n\t\t\t\t\t\t\t\t\t);\n\t\t}\n\n\t\t// rangos wc\n\t\t$datos_wc_maximos\t= $this->object->archivos_model->_wc_maximos_por_tabla($id_tabla);\t\n\t\t$wc_maximos \t\t= array();\n\t\tfor ($i=0; $i < count($datos_wc_maximos); $i++) {\n\t\t\t$wc_maximos[] = array(\n\t\t\t\t\t\t\t\t\t\"wc_maximo_mgm_id\"\t=> $datos_wc_maximos[$i]['id_manejo'],\n\t\t\t\t\t\t\t\t\t\"wc_maximo_valor\"\t=> $datos_wc_maximos[$i]['valor'],\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t);\n\t\t}\n\t\t\n\t\t$datos_plantilla = array (\n\t\t\t\t\t\t\"precios\"\t\t\t\t \t=> $precios,\n\t\t\t\t\t\t\"costos\" \t\t\t\t\t=> $costos,\n\t\t\t\t\t\t\"rindes\" \t\t\t\t\t=> $rindes,\n\t\t\t\t\t\t\"emergias\"\t\t\t\t \t=> $emergias,\n\t\t\t\t\t\t\"ajuste_ue_amb\" \t\t\t=> $ajuste_ue_amb,\n\t\t\t\t\t\t\"ajuste_entorno_vecino\" \t=> $ajuste_entorno_vecino,\n\t\t\t\t\t\t\"ajuste_entorno\"\t\t \t=> $ajuste_entorno,\n\t\t\t\t\t\t\"wc_maximos\" \t\t\t\t=> $wc_maximos,\n\t\t\t\t);\n\t\t\n\t\treturn $this->_genera_archivo_tabla($id_tabla, $datos_plantilla);\n\t}", "function markv_base() {\n\t\tglobal $wpdb;\n\t\t$nombredb=\"mark05\";\n\t\t$table_name= $wpdb->prefix.$nombredb;\t\t\n\t\tif($wpdb->get_var(\"SHOW TABLES LIKE '$table_name'\") != $table_name) {\n\t\t\t$sql = \"CREATE TABLE $table_name ( \n\t\t\t`id` mediumint( 9 ) NOT NULL, \n\t\t\t`dato` tinytext NOT NULL, \n\t\t\t`valor` varchar(2048) NULL, \n\t\t\tPRIMARY KEY (`id`))\";\t//creo la BBDD\n\t\t\t$wpdb->query($sql);\n\t\t\t$sql = \"INSERT INTO $table_name (`id`, `dato`, `valor`) \n\t\t\tVALUES (1, 'analytics', ''), (2, 'texto_2', 'dato 2'), (3, 'texto_3', 'dato 3'), (4, 'texto_4', 'dato 4'), (5, 'texto_5', 'dato 5'), (6, 'texto_6', 'dato 6'), (7, 'texto_7', 'dato 7'), (8, 'texto_8', 'dato 8'), (9, 'texto_9', 'dato 9'), (10, 'texto_10', 'dato 10'), (11, 'texto_11', 'dato 11'), (12, 'texto_12', 'dato 12'), (13, 'texto_13', 'dato 13'), (14, 'texto_14', 'dato 14'), (15, 'texto_15', 'dato 15'), (16, 'texto_16', 'dato 16'), (17, 'texto_17', 'dato 17'), (18, 'texto_18', 'dato 18'), (19, 'texto_19', 'dato 19'), (20, 'texto_20', 'dato 20'), (21, 'texto_21', 'dato 21'), (22, 'texto_22', 'dato 22'), (23, 'texto_23', 'dato 23'), (24, 'texto_24', 'dato 24'), (25, 'texto_25', 'dato 25'), (26, 'texto_26', 'dato 26'), (27, 'texto_27', 'dato 27'), (28, 'texto_28', 'dato 28'), (29, 'texto_29', 'dato 29'), (30, 'texto_30', 'dato 30'), (31, 'opengraph_1', 'no'), (32, 'opengraph_2', 'opengraph 2'), (33, 'opengraph_3', 'opengraph 3')\";//LE ASIGNAMOS UN VALOR POR DEFECTO A LA BBDD (1, custom, hola)\n\t\t\t$wpdb->query($sql);\n\t\t}\n\t\t// 2.- AGREGO LA SECCION AL PANEL: \"add_options_page\" = pone la pagina dentro de la seccion AJUSTES, \"add_object_page\" = pone la pagina como una seccion independiente\t\n\t\tadd_object_page('4Sale [MARK-V] : Opciones', 'Opciones', 'manage_options', 'mark-v', 'markv_portada' );\n\t}", "function tambah_obat()\n\t{\n\t\t# 1. insert data obat\n\t\t$this->master_model->insert_obat($_POST['id_obat'], $_POST['nama'], $_POST['satuan'], $_POST['harga'], $_POST['minimal_stock'], $_POST['kebutuhan'], $_POST['lead_time'], $_POST['biaya_pesan']);\n\n\t\t# 2. insert data stok\n\t\t$id_stok = $this->model->new_id('id_stok', 'tbl_stok', 'stok');\n\t\t$this->master_model->insert_stok($id_stok, $_POST['id_supplier'], $_POST['id_obat'], '', $_POST['stok']);\n\n\t\t# 3. evaluate eoq\n\t\t$eoq = Utility::eoq($_POST['biaya_pesan'], $_POST['kebutuhan'], $_POST['harga']);\n\t\t$this->model->update('tbl_obat', 'eoq', $eoq, 'id_obat', $_POST['id_obat']);\n\n\t\t# 4. evaluate rop\n\t\t$rop = Utility::rop($_POST['kebutuhan'], $_POST['lead_time']);\n\t\t$this->model->update('tbl_obat', 'rop', $rop, 'id_obat', $_POST['id_obat']);\n\n\t\t# 5. evaluate safety stock\n\t\t$ss = Utility::ss($_POST['lead_time'], $_POST['kebutuhan']);\n\t\t$this->model->update('tbl_obat', 'safety_stock', $ss, 'id_obat', $_POST['id_obat']);\n\n\t\t# 5. redirect\n\t\theader(\"location:\".base_url('gudang/obat'));\n\t}", "function instancia__cambios_estructura()\n\t{\n\t\t$sql = 'SET CONSTRAINTS ALL IMMEDIATE;';\n\t\t$this->elemento->get_db()->ejecutar($sql);\n\t\t$sql = array();\t\t\n\t\t\n\t\t$sql[] = 'ALTER TABLE apex_objeto_ei_formulario_ef ADD COLUMN placeholder TEXT NULL;';\n\t\t$sql[] = 'ALTER TABLE apex_objeto_ei_filtro_col ADD COLUMN placeholder TEXT NULL;';\n\t\t$this->elemento->get_db()->ejecutar($sql);\n\t\t\n\t\t$sql = 'SET CONSTRAINTS ALL DEFERRED;';\n\t\t$this->elemento->get_db()->ejecutar($sql);\n\t}", "public function nuevaTabla()\n {\n $oDbl = $this->getoDbl();\n $tabla = $this->getNomTabla();\n $notas = $this->getNomNotas();\n $asignaturas = $this->getNomAsignaturas();\n $personas = $this->getNomPersonas();\n\n $curs = $this->getCurso();\n $fincurs = $this->getFinCurso();\n\n $any = $this->getAnyIniCurs() + 1; //para los incorporados a partir del 1-jun.\n\n $sqlDelete = \"TRUNCATE TABLE $tabla\";\n $sqlCreate = \"CREATE TABLE IF NOT EXISTS $tabla(\n\t\t\t\t\t\t\t\t\t\tid_nom int4 NOT NULL PRIMARY KEY,\n\t\t\t\t\t\t\t\t\t\tid_tabla char(6),\n\t\t\t\t\t\t\t\t\t\tnom varchar(40),\n\t\t\t\t\t\t\t\t\t\tapellido1 varchar(25),\n\t\t\t\t\t\t\t\t\t\tapellido2 varchar(25),\n\t\t\t\t\t\t\t\t\t\tstgr char(2),\n\t\t\t\t\t\t\t\t\t\tsituacion char(1),\n\t\t\t\t\t\t\t\t\t\tf_situacion date,\n\t\t\t\t\t\t\t\t\t\tf_o date,\n\t\t\t\t\t\t\t\t\t\tf_fl date,\n\t\t\t\t\t\t\t\t\t\tf_orden date,\n\t\t\t\t\t\t\t\t\t\tce_lugar varchar(40),\n\t\t\t\t\t\t\t\t\t\tce_ini int2,\n\t\t\t\t\t\t\t\t\t\tce_fin int2,\n\t\t\t\t\t\t\t\t\t\tsacd bool,\n\t\t\t\t\t\t\t\t\t\tctr text )\";\n\n // En el caso cr-stgr, Hay que permitir duplicados (PRIMARY KEY)\n if (ConfigGlobal::mi_ambito() === 'rstgr') {\n $sqlCreate = \"CREATE TABLE IF NOT EXISTS $tabla(\n\t\t\t\t\t\t\t\t\t\tid_nom int4 NOT NULL,\n\t\t\t\t\t\t\t\t\t\tid_tabla char(6),\n\t\t\t\t\t\t\t\t\t\tnom varchar(40),\n\t\t\t\t\t\t\t\t\t\tapellido1 varchar(25),\n\t\t\t\t\t\t\t\t\t\tapellido2 varchar(25),\n\t\t\t\t\t\t\t\t\t\tstgr char(2),\n\t\t\t\t\t\t\t\t\t\tsituacion char(1),\n\t\t\t\t\t\t\t\t\t\tf_situacion date,\n\t\t\t\t\t\t\t\t\t\tf_o date,\n\t\t\t\t\t\t\t\t\t\tf_fl date,\n\t\t\t\t\t\t\t\t\t\tf_orden date,\n\t\t\t\t\t\t\t\t\t\tce_lugar varchar(40),\n\t\t\t\t\t\t\t\t\t\tce_ini int2,\n\t\t\t\t\t\t\t\t\t\tce_fin int2,\n\t\t\t\t\t\t\t\t\t\tsacd bool,\n\t\t\t\t\t\t\t\t\t\tctr text )\";\n }\n\n $oDbl->query($sqlCreate);\n $oDbl->query(\"CREATE INDEX IF NOT EXISTS $tabla\" . \"_apellidos\" . \" ON $tabla (apellido1,apellido2,nom)\");\n $oDbl->query(\"CREATE INDEX IF NOT EXISTS $tabla\" . \"_stgr\" . \" ON $tabla (stgr)\");\n $oDbl->query($sqlDelete);\n\n /*\n * OOJO De momento estos campos no existen:\n f_o date,\n f_fl date,\n f_orden date,\n situacion char(1),\n \n $sqlLlenar=\"INSERT INTO $tabla\n SELECT p.id_nom,p.id_tabla,p.nom,p.apellido1,p.apellido2,p.stgr,\n p.situacion,p.f_situacion,p.f_o,p.f_fl,p.f_orden,p.ce_lugar,p.ce_ini,p.ce_fin,p.situacion,p.sacd\n FROM $personas p\n WHERE ((p.situacion='A' AND (p.f_situacion < '$fincurs' OR p.f_situacion IS NULL)) OR (p.situacion='D' AND (p.f_situacion $curs)) OR (p.situacion='L' AND (p.f_orden $curs)))\n \";\n */\n $sqlLlenar = \"INSERT INTO $tabla\n\t\t\t\tSELECT p.id_nom,p.id_tabla,p.nom,p.apellido1,p.apellido2,p.stgr,\n\t\t\t\tp.situacion,p.f_situacion,\n\t\t\t\tNULL,NULL,NULL,\n\t\t\t\tp.ce_lugar,p.ce_ini,p.ce_fin,\n\t\t\t\tp.sacd,u.nombre_ubi\n\t\t\t\tFROM $personas p LEFT JOIN u_centros_dl u ON (p.id_ctr = u.id_ubi)\n\t\t\t\tWHERE (p.situacion='A' AND (p.f_situacion < '$fincurs' OR p.f_situacion IS NULL))\n\t\t\t\t\t OR (p.situacion='D' AND p.f_situacion $curs)\n\t\t\t\t\t OR (p.situacion!='A' AND p.f_situacion > '$fincurs')\n\t\t\t\t\";\n // En el caso cr-stgr, añado la dl al nombre ubi.\n if (ConfigGlobal::mi_ambito() === 'rstgr') {\n // Si tengo dl filtro por dl.\n $where_dl = '';\n if (!empty($this->getArrayDl())) {\n $dl_csv = implode(\"','\", $this->getArrayDl());\n $where_dl = \"u.dl IN ('$dl_csv') AND\";\n }\n $sqlLlenar = \"INSERT INTO $tabla\n\t\t\t\tSELECT p.id_nom,p.id_tabla,p.nom,p.apellido1,p.apellido2,p.stgr,\n\t\t\t\tp.situacion,p.f_situacion,\n\t\t\t\tNULL,NULL,NULL,\n\t\t\t\tp.ce_lugar,p.ce_ini,p.ce_fin,\n\t\t\t\tp.sacd,u.nombre_ubi || ' (' || u.dl || ')'\n\t\t\t\tFROM $personas p LEFT JOIN u_centros_dl u ON (p.id_ctr = u.id_ubi)\n\t\t\t\tWHERE $where_dl ( (p.situacion='A' AND (p.f_situacion < '$fincurs' OR p.f_situacion IS NULL))\n\t\t\t\t\t OR (p.situacion='D' AND p.f_situacion $curs)\n\t\t\t\t\t OR (p.situacion!='A' AND p.f_situacion > '$fincurs') )\n\t\t\t\t\";\n\n }\n //echo \"sql: $sqlLlenar<br>\";\n $oDbl->query($sqlLlenar);\n\n // Busco los que han ido a un ci\n\n\n // Miro los que se han incorporado \"recientemente\": desde el 1-junio\n $ssql = \"SELECT p.nom, p.apellido1, p.apellido2, p.ctr, p.stgr\n\t\t\tFROM $tabla p\n\t\t\tWHERE p.situacion='A' AND p.f_situacion > '$any-6-1'\n\t\t\t\tAND (p.stgr='b' OR p.stgr ILIKE 'c%') \";\n //echo \"qry: $ssql<br>\";\n $statement = $oDbl->query($ssql);\n $nf = $statement->rowCount();\n if ($this->blista && $nf != 0) {\n echo \"<p>Existen $nf Alumnos que se han incorporado \\\"recientemente\\\" (desde el 1-junio) a la dl<br>\n\t\t\t\t\tSí se cuentan en la estadística.</p>\";\n // Para sacar una lista\n echo $this->Lista($ssql, \"nom,apellido1,apellido2,ctr,stgr\", 1);\n }\n\n // Miro si existe alguna excepción: Alguien incorporado a la dl después del 1 de OCT\n $ssql = \"SELECT p.nom, p.apellido1, p.apellido2, p.ctr, p.stgr\n\t\t\tFROM $tabla p\n\t\t\tWHERE (p.stgr='b' OR p.stgr ILIKE 'c%')\n\t\t\t\tAND (p.situacion='A' AND p.f_situacion > '$fincurs')\";\n $statement = $oDbl->query($ssql);\n $nf = $statement->rowCount();\n\n if ($this->blista && $nf != 0) {\n echo \"<p>Existen $nf alumnos que se han incorporado después del 1-OCT a la dl<br>\n\t\t\t\t\tNo se van a contar</p>\";\n // Para sacar una lista\n echo $this->Lista($ssql, \"nom,apellido1,apellido2,ctr,stgr\", 1);\n }\n\n //Pongo 'b' en stgr a los que han terminado el bienio este curso\n $ssql = \"UPDATE $tabla SET stgr='b'\n\t\t\t\tFROM $this->tablaNotas n\n\t\t\t\tWHERE $tabla.id_nom=n.id_nom AND n.id_asignatura=9999 AND n.f_acta $curs\n\t\t\t\t \";\n $statement = $oDbl->query($ssql);\n $nf = $statement->rowCount();\n\n //Pongo 'c2' en stgr a los que han terminado el cuadrienio este curso\n $ssql = \"UPDATE $tabla SET stgr='c2'\n\t\t\t\tFROM $this->tablaNotas n\n\t\t\t\tWHERE $tabla.id_nom=n.id_nom AND n.id_asignatura=9998 AND n.f_acta $curs\n\t\t\t\t \";\n $statement = $oDbl->query($ssql);\n $nf = $statement->rowCount();\n\n //Ahora las notas\n $sqlDelete = \"TRUNCATE TABLE $notas\";\n $sqlCreate = \"CREATE TABLE IF NOT EXISTS $notas(\n\t\t\t\t\t\t\t\t\t\tid_nom int4 NOT NULL,\n\t\t\t\t\t\t\t\t\t\tid_asignatura int4 NOT NULL,\n\t\t\t\t\t\t\t\t\t\tid_nivel int4 NOT NULL,\n\t\t\t\t\t\t\t\t\t\tepoca int2,\n\t\t\t\t\t\t\t\t\t\tf_acta date NOT NULL,\n\t\t\t\t\t\t\t\t\t\tacta varchar(50),\n\t\t\t\t\t\t\t\t\t\tpreceptor bool,\n\t\t\t\t\t\t\t\t\t\tPRIMARY KEY (id_nom,id_asignatura)\n\t\t\t\t\t\t\t\t\t\t )\";\n\n $oDbl->query($sqlCreate);\n $oDbl->query(\"CREATE INDEX IF NOT EXISTS $notas\" . \"_nivel\" . \" ON $notas (id_nivel)\");\n $oDbl->query($sqlDelete);\n\n $gesNotas = new GestorNota();\n $a_superadas = $gesNotas->getArrayNotasSuperadas();\n $Where_superada = \"AND id_situacion IN (\" . implode(',', $a_superadas) . \")\";\n // Tengo que acceder a publicv, porque con los traslados las notas se cambian de esquema.\n if (core\\ConfigGlobal::mi_sfsv() == 1) {\n $notas_vf = 'publicv.e_notas';\n }\n if (core\\ConfigGlobal::mi_sfsv() == 2) {\n $notas_vf = 'publicf.e_notas';\n }\n $sqlLlenar = \"INSERT INTO $notas\n\t\t\t\t\tSELECT DISTINCT n.id_nom,n.id_asignatura,n.id_nivel,\n\t\t\t\t\t\t n.epoca,n.f_acta,n.acta,n.preceptor\n\t\t\t\t\tFROM $tabla p, $notas_vf n\n\t\t\t\t\tWHERE p.id_nom=n.id_nom AND n.f_acta $curs\n $Where_superada\n\t\t\t\t\t\";\n //echo \"sql: $sqlLlenar<br>\";\n $oDbl->query($sqlLlenar);\n\n //Ahora las asignaturas\n //Como ahora las asignaturas estan en otra base de datos(comun) hago una copia para poder hacer unions...\n $sqlDelete = \"DROP TABLE IF EXISTS $asignaturas CASCADE\";\n $sqlCreate = \"CREATE TABLE $asignaturas(\n\t\t\t\t\t\tid_asignatura integer,\n\t\t\t\t\t\tid_nivel integer,\n\t\t\t\t\t\tnombre_asignatura character varying(100) NOT NULL,\n\t\t\t\t\t\tnombre_corto character varying(23),\n\t\t\t\t\t\tcreditos numeric(4,2),\n\t\t\t\t\t\tyear character varying(3),\n\t\t\t\t\t\tid_sector smallint,\n\t\t\t\t\t\tstatus boolean DEFAULT true NOT NULL,\n\t\t\t\t\t\tid_tipo integer\n\t\t\t\t\t )\";\n\n $oDbl->query($sqlDelete);\n $oDbl->query($sqlCreate);\n $oDbl->query(\"CREATE INDEX $asignaturas\" . \"_nivel\" . \" ON $asignaturas (id_nivel)\");\n $oDbl->query(\"CREATE INDEX $asignaturas\" . \"_id_asignatura\" . \" ON $asignaturas (id_asignatura)\");\n\n $gesAsignaturas = new GestorAsignatura();\n $cAsignaturas = $gesAsignaturas->getAsignaturas(array('status' => 'true'));\n\n $prep = $oDbl->prepare(\"INSERT INTO $asignaturas VALUES(:id_asignatura, :id_nivel, :nombre_asignatura, :nombre_corto, :creditos, :year, :id_sector, :status, :id_tipo)\");\n foreach ($cAsignaturas as $oAsignatura) {\n $aDades = [];\n $aDades['id_asignatura'] = $oAsignatura->getId_asignatura();\n $aDades['id_nivel'] = $oAsignatura->getId_nivel();\n $aDades['nombre_asignatura'] = $oAsignatura->getNombre_asignatura();\n $aDades['nombre_corto'] = $oAsignatura->getNombre_corto();\n $aDades['creditos'] = $oAsignatura->getCreditos();\n $aDades['year'] = $oAsignatura->getYear();\n $aDades['id_sector'] = $oAsignatura->getId_sector();\n $aDades['status'] = $oAsignatura->getStatus();\n $aDades['id_tipo'] = $oAsignatura->getId_tipo();\n\n $prep->execute($aDades);\n }\n }", "public function aktivizoklientin($emridatabazes, $tipidatabazes) {\n $db = \"\n CREATE TABLE arka_tbl (\n id_arka int(11) NOT NULL PRIMARY KEY AUTO_INCREMENT,\n puntoriparadites varchar(254) NOT NULL,\n puntorimasdites varchar(254) DEFAULT NULL,\n qmimiparadites varchar(254) DEFAULT NULL,\n qmimimasdites varchar(254) DEFAULT NULL,\n startimi varchar(254) NOT NULL,\n komentip varchar(254) DEFAULT NULL,\n komentim varchar(254) DEFAULT NULL,\n data varchar(254) DEFAULT NULL\n );\n CREATE TABLE borgji_tbl (\n idborgji int(11) NOT NULL PRIMARY KEY AUTO_INCREMENT,\n emri varchar(254) NOT NULL,\n telefoni varchar(254) NOT NULL,\n adresa varchar(254) NOT NULL,\n qmimi varchar(254) NOT NULL,\n mesazhi varchar(254) NOT NULL,\n shfrytzuesi varchar(254) NOT NULL,\n nrserikborgj varchar(254) DEFAULT NULL,\n koha timestamp(6) NOT NULL DEFAULT current_timestamp(6) ON UPDATE current_timestamp(6),\n statusi varchar(254) NOT NULL DEFAULT 'nepritje'\n );\n CREATE TABLE cash_tbl(\n idcash int(11) NOT NULL PRIMARY KEY AUTO_INCREMENT,\n emri varchar(254) NOT NULL,\n telefoni varchar(254) NOT NULL,\n adresa varchar(254) NOT NULL,\n qmimi varchar(254) NOT NULL,\n shfrytzuesi varchar(254) NOT NULL,\n mesazhi text NOT NULL,\n koha timestamp(6) NOT NULL DEFAULT current_timestamp(6) ON UPDATE current_timestamp(6),\n statusi varchar(254) NOT NULL DEFAULT 'nepritje'\n );\n CREATE TABLE furnizimi_tbl (\n id_furnizimi int(11) NOT NULL PRIMARY KEY AUTO_INCREMENT,\n emriproduktit_fk varchar(254) NOT NULL,\n qmimiblerjes varchar(254) NOT NULL,\n qmimishitjes varchar(254) NOT NULL,\n sasia varchar(254) NOT NULL,\n shifrafatures varchar(254) NOT NULL,\n emrifurnitorit varchar(254) NOT NULL,\n koha date NOT NULL,\n emrishfrytezuesit varchar(254) NOT NULL,\n statusi varchar(100) NOT NULL DEFAULT 'aktiv'\n );\n CREATE TABLE posta_tbl (\n idposta int(11) NOT NULL PRIMARY KEY AUTO_INCREMENT,\n emri varchar(254) NOT NULL,\n telefoni varchar(254) NOT NULL,\n adresa varchar(254) NOT NULL,\n qmimi varchar(254) NOT NULL,\n mesazhi text NOT NULL,\n shfrytzuesi varchar(254) NOT NULL,\n nrserikposta varchar(254) DEFAULT NULL,\n koha timestamp(6) NOT NULL DEFAULT current_timestamp(6) ON UPDATE current_timestamp(6),\n statusi varchar(254) NOT NULL DEFAULT 'nepritje'\n );\n CREATE TABLE regjistrimimallit_tbl (\n id int(11) NOT NULL PRIMARY KEY AUTO_INCREMENT,\n emriproduktit varchar(254) NOT NULL,\n qmimishitjes varchar(254) NOT NULL,\n njesia varchar(254) NOT NULL,\n tvsh varchar(254) NOT NULL,\n sasiaminimale varchar(254) NOT NULL,\n pershkrimi text NOT NULL,\n barkodi varchar(254) NOT NULL\n );\n CREATE TABLE shfrytezuesit_tbl (\n id int(11) NOT NULL PRIMARY KEY AUTO_INCREMENT,\n emri varchar(254) NOT NULL,\n pseudonimi varchar(254) NOT NULL,\n fjalkalimi varchar(254) NOT NULL,\n image varchar(254) NOT NULL,\n autorizimi varchar(254) DEFAULT NULL,\n statusi varchar(254) NOT NULL DEFAULT 'aktiv'\n );\n CREATE TABLE shitjet_tbl (\n produkti_id int(11) NOT NULL PRIMARY KEY AUTO_INCREMENT,\n emri varchar(254) NOT NULL,\n qmimi varchar(254) NOT NULL,\n sasia varchar(254) NOT NULL,\n vlera varchar(254) DEFAULT NULL,\n shfrytzuesi varchar(254) NOT NULL,\n koha varchar(100) NOT NULL,\n nrserik varchar(254) DEFAULT NULL,\n statusifatures varchar(254) NOT NULL DEFAULT 'i hapur',\n statusiporosise varchar(254) NOT NULL DEFAULT 'i rregullt',\n barcodi varchar(254) NOT NULL\n );\n\n INSERT INTO shfrytezuesit_tbl (id, emri, pseudonimi, fjalkalimi, image, autorizimi, statusi) VALUES\n (101, 'admin', 'admin', 'AWž=#1‰ÂâïEÁ\f–Å', 'user.png', 'klient,shitje,furnizimi,statistika,shfrytezues', 'aktiv');\"\n\n\n ;\n $results = ADMConnection::admconnect()->prepare(\"CREATE DATABASE DB_\" . $emridatabazes . \" \");\n $results->execute();\n $newnamedb = \"DB_\".$emridatabazes;\n $results1 = ADMConnection::admconnect()->prepare(\"USE $newnamedb; \" . $db);\n $results1->execute();\n\n $results3 = ADMConnection::admconnect()->prepare(\"INSERT INTO aktivizimidb_tbl(emridatabazes,tipidatabazes,koha) VALUES ('$emridatabazes','$tipidatabazes','1')\");\n $results3->execute(array('emridatabazes' => $emridatabazes, 'tipidatabazes' => $tipidatabazes,));\n // return $results3;\n\n }", "static public function mdlIngresarEscribano($tabla, $datos){\n\n\t\t$stmt = Conexion::conectarEnlace()->prepare(\"INSERT INTO $tabla(`id`,`nombre`,`documento`,id_tipo_iva,tipo,facturacion,tipo_factura,`cuit`, `direccion`,`localidad`, `telefono`,`email` , `id_categoria`,`id_escribano_relacionado`, `id_osde`,`ultimolibrocomprado`,`ultimolibrodevuelto`,`apellido_ws`,`nombre_ws`,`matricula_ws`) VALUES\n\t\t\t\t\t (:id,:nombre,:documento,:id_tipo_iva,:tipo,:facturacion,:tipo_factura,:cuit,:direccion,:localidad,:telefono,:email,:id_categoria,:id_escribano_relacionado,:id_osde,:ultimolibrocomprado,:ultimolibrodevuelto,:apellido_ws,:nombre_ws,:matricula_ws)\");\n\n\t\t$stmt->bindParam(\":id\", $datos[\"id\"], PDO::PARAM_INT);\n\t\t$stmt->bindParam(\":nombre\", $datos[\"nombre\"], PDO::PARAM_STR);\n\t\t$stmt->bindParam(\":documento\", $datos[\"documento\"], PDO::PARAM_INT);\n\n\t\t$stmt->bindParam(\":id_tipo_iva\", $datos[\"id_tipo_iva\"], PDO::PARAM_INT);\n\t\t$stmt->bindParam(\":tipo\", $datos[\"tipo\"], PDO::PARAM_STR);\n $stmt->bindParam(\":facturacion\", $datos[\"facturacion\"], PDO::PARAM_STR);\n $stmt->bindParam(\":tipo_factura\", $datos[\"tipo_factura\"], PDO::PARAM_STR);\n \n\t\t$stmt->bindParam(\":cuit\", $datos[\"cuit\"], PDO::PARAM_STR);\n\t\t$stmt->bindParam(\":direccion\", $datos[\"direccion\"], PDO::PARAM_STR);\n\t\t$stmt->bindParam(\":localidad\", $datos[\"localidad\"], PDO::PARAM_STR);\n\t\t$stmt->bindParam(\":telefono\", $datos[\"telefono\"], PDO::PARAM_STR);\n\t\t$stmt->bindParam(\":email\", $datos[\"email\"], PDO::PARAM_STR);\n\t\t\n\t\t$stmt->bindParam(\":id_categoria\", $datos[\"id_categoria\"], PDO::PARAM_INT);\n\t\t$stmt->bindParam(\":id_escribano_relacionado\", $datos[\"id_escribano_relacionado\"], PDO::PARAM_INT);\n\t\t$stmt->bindParam(\":id_osde\", $datos[\"id_osde\"], PDO::PARAM_INT);\n\t\t$stmt->bindParam(\":ultimolibrocomprado\", $datos[\"ultimolibrocomprado\"], PDO::PARAM_INT);\n\t\t$stmt->bindParam(\":ultimolibrodevuelto\", $datos[\"ultimolibrodevuelto\"], PDO::PARAM_INT);\n\t\t\n\t\t$stmt->bindParam(\":apellido_ws\", $datos[\"apellido_ws\"], PDO::PARAM_STR);\n\t\t$stmt->bindParam(\":nombre_ws\", $datos[\"nombre_ws\"], PDO::PARAM_STR);\n\t\t$stmt->bindParam(\":matricula_ws\", $datos[\"matricula_ws\"], PDO::PARAM_STR);\n\t\t\t \n\t\tif($stmt->execute()){\n\n\t\t\treturn \"ok\";\n\n\t\t}else{\n\n\t\t\treturn \"error\";\n\t\t\n\t\t}\n\n\t\t$stmt->close();\n\t\t$stmt = null;\n\n\t}", "function tb_acompanhamento_form($selected_id = '', $AllowUpdate = 1, $AllowInsert = 1, $AllowDelete = 1, $ShowCancel = 0, $TemplateDV = '', $TemplateDVP = ''){\n\t// and fill it with data of record whose ID is $selected_id. If $selected_id\n\t// is empty, an empty form is shown, with only an 'Add New'\n\t// button displayed.\n\n\tglobal $Translation;\n\n\t// mm: get table permissions\n\t$arrPerm=getTablePermissions('tb_acompanhamento');\n\tif(!$arrPerm[1] && $selected_id==''){ return ''; }\n\t$AllowInsert = ($arrPerm[1] ? true : false);\n\t// print preview?\n\t$dvprint = false;\n\tif($selected_id && $_REQUEST['dvprint_x'] != ''){\n\t\t$dvprint = true;\n\t}\n\n\t$filterer_empresa_id = thisOr(undo_magic_quotes($_REQUEST['filterer_empresa_id']), '');\n\t$filterer_contato_id = thisOr(undo_magic_quotes($_REQUEST['filterer_contato_id']), '');\n\t$filterer_contrato_id = thisOr(undo_magic_quotes($_REQUEST['filterer_contrato_id']), '');\n\t$filterer_usuario_id = thisOr(undo_magic_quotes($_REQUEST['filterer_usuario_id']), '');\n\n\t// populate filterers, starting from children to grand-parents\n\tif($filterer_contato_id && !$filterer_empresa_id) $filterer_empresa_id = sqlValue(\"select empresa_id from tb_contato where id='\" . makeSafe($filterer_contato_id) . \"'\");\n\tif($filterer_contrato_id && !$filterer_empresa_id) $filterer_empresa_id = sqlValue(\"select empresa_id from tb_contrato where id='\" . makeSafe($filterer_contrato_id) . \"'\");\n\n\t// unique random identifier\n\t$rnd1 = ($dvprint ? rand(1000000, 9999999) : '');\n\t// combobox: empresa_id\n\t$combo_empresa_id = new DataCombo;\n\t// combobox: contato_id, filterable by: empresa_id\n\t$combo_contato_id = new DataCombo;\n\t// combobox: contrato_id, filterable by: empresa_id\n\t$combo_contrato_id = new DataCombo;\n\t// combobox: usuario_id\n\t$combo_usuario_id = new DataCombo;\n\t// combobox: dta\n\t$combo_dta = new DateCombo;\n\t$combo_dta->DateFormat = \"dmy\";\n\t$combo_dta->MinYear = 1900;\n\t$combo_dta->MaxYear = 2100;\n\t$combo_dta->DefaultDate = parseMySQLDate('', '');\n\t$combo_dta->MonthNames = $Translation['month names'];\n\t$combo_dta->NamePrefix = 'dta';\n\t// combobox: str_meio\n\t$combo_str_meio = new Combo;\n\t$combo_str_meio->ListType = 2;\n\t$combo_str_meio->MultipleSeparator = ', ';\n\t$combo_str_meio->ListBoxHeight = 10;\n\t$combo_str_meio->RadiosPerLine = 1;\n\tif(is_file(dirname(__FILE__).'/hooks/tb_acompanhamento.str_meio.csv')){\n\t\t$str_meio_data = addslashes(implode('', @file(dirname(__FILE__).'/hooks/tb_acompanhamento.str_meio.csv')));\n\t\t$combo_str_meio->ListItem = explode('||', entitiesToUTF8(convertLegacyOptions($str_meio_data)));\n\t\t$combo_str_meio->ListData = $combo_str_meio->ListItem;\n\t}else{\n\t\t$combo_str_meio->ListItem = explode('||', entitiesToUTF8(convertLegacyOptions(\"TELEFONEMA;;PRESENCIAL;;MENSAGEM\")));\n\t\t$combo_str_meio->ListData = $combo_str_meio->ListItem;\n\t}\n\t$combo_str_meio->SelectName = 'str_meio';\n\t$combo_str_meio->AllowNull = false;\n\t// combobox: str_statusgeral\n\t$combo_str_statusgeral = new Combo;\n\t$combo_str_statusgeral->ListType = 2;\n\t$combo_str_statusgeral->MultipleSeparator = ', ';\n\t$combo_str_statusgeral->ListBoxHeight = 10;\n\t$combo_str_statusgeral->RadiosPerLine = 1;\n\tif(is_file(dirname(__FILE__).'/hooks/tb_acompanhamento.str_statusgeral.csv')){\n\t\t$str_statusgeral_data = addslashes(implode('', @file(dirname(__FILE__).'/hooks/tb_acompanhamento.str_statusgeral.csv')));\n\t\t$combo_str_statusgeral->ListItem = explode('||', entitiesToUTF8(convertLegacyOptions($str_statusgeral_data)));\n\t\t$combo_str_statusgeral->ListData = $combo_str_statusgeral->ListItem;\n\t}else{\n\t\t$combo_str_statusgeral->ListItem = explode('||', entitiesToUTF8(convertLegacyOptions(\"NORMAL;;ATEN&#199;&#195;O;;CR&#205;TICO\")));\n\t\t$combo_str_statusgeral->ListData = $combo_str_statusgeral->ListItem;\n\t}\n\t$combo_str_statusgeral->SelectName = 'str_statusgeral';\n\t$combo_str_statusgeral->AllowNull = false;\n\t// combobox: str_clima_cliente\n\t$combo_str_clima_cliente = new Combo;\n\t$combo_str_clima_cliente->ListType = 0;\n\t$combo_str_clima_cliente->MultipleSeparator = ', ';\n\t$combo_str_clima_cliente->ListBoxHeight = 10;\n\t$combo_str_clima_cliente->RadiosPerLine = 1;\n\tif(is_file(dirname(__FILE__).'/hooks/tb_acompanhamento.str_clima_cliente.csv')){\n\t\t$str_clima_cliente_data = addslashes(implode('', @file(dirname(__FILE__).'/hooks/tb_acompanhamento.str_clima_cliente.csv')));\n\t\t$combo_str_clima_cliente->ListItem = explode('||', entitiesToUTF8(convertLegacyOptions($str_clima_cliente_data)));\n\t\t$combo_str_clima_cliente->ListData = $combo_str_clima_cliente->ListItem;\n\t}else{\n\t\t$combo_str_clima_cliente->ListItem = explode('||', entitiesToUTF8(convertLegacyOptions(\"P&#201;SSIMO;;RUIM;;BOM;;EXCELENTE\")));\n\t\t$combo_str_clima_cliente->ListData = $combo_str_clima_cliente->ListItem;\n\t}\n\t$combo_str_clima_cliente->SelectName = 'str_clima_cliente';\n\t$combo_str_clima_cliente->AllowNull = false;\n\t// combobox: str_clima_equipe\n\t$combo_str_clima_equipe = new Combo;\n\t$combo_str_clima_equipe->ListType = 0;\n\t$combo_str_clima_equipe->MultipleSeparator = ', ';\n\t$combo_str_clima_equipe->ListBoxHeight = 10;\n\t$combo_str_clima_equipe->RadiosPerLine = 1;\n\tif(is_file(dirname(__FILE__).'/hooks/tb_acompanhamento.str_clima_equipe.csv')){\n\t\t$str_clima_equipe_data = addslashes(implode('', @file(dirname(__FILE__).'/hooks/tb_acompanhamento.str_clima_equipe.csv')));\n\t\t$combo_str_clima_equipe->ListItem = explode('||', entitiesToUTF8(convertLegacyOptions($str_clima_equipe_data)));\n\t\t$combo_str_clima_equipe->ListData = $combo_str_clima_equipe->ListItem;\n\t}else{\n\t\t$combo_str_clima_equipe->ListItem = explode('||', entitiesToUTF8(convertLegacyOptions(\"P&#201;SSIMO;;RUIM;;BOM;;EXCELENTE\")));\n\t\t$combo_str_clima_equipe->ListData = $combo_str_clima_equipe->ListItem;\n\t}\n\t$combo_str_clima_equipe->SelectName = 'str_clima_equipe';\n\t$combo_str_clima_equipe->AllowNull = false;\n\n\tif($selected_id){\n\t\t// mm: check member permissions\n\t\tif(!$arrPerm[2]){\n\t\t\treturn \"\";\n\t\t}\n\t\t// mm: who is the owner?\n\t\t$ownerGroupID=sqlValue(\"select groupID from membership_userrecords where tableName='tb_acompanhamento' and pkValue='\".makeSafe($selected_id).\"'\");\n\t\t$ownerMemberID=sqlValue(\"select lcase(memberID) from membership_userrecords where tableName='tb_acompanhamento' and pkValue='\".makeSafe($selected_id).\"'\");\n\t\tif($arrPerm[2]==1 && getLoggedMemberID()!=$ownerMemberID){\n\t\t\treturn \"\";\n\t\t}\n\t\tif($arrPerm[2]==2 && getLoggedGroupID()!=$ownerGroupID){\n\t\t\treturn \"\";\n\t\t}\n\n\t\t// can edit?\n\t\tif(($arrPerm[3]==1 && $ownerMemberID==getLoggedMemberID()) || ($arrPerm[3]==2 && $ownerGroupID==getLoggedGroupID()) || $arrPerm[3]==3){\n\t\t\t$AllowUpdate=1;\n\t\t}else{\n\t\t\t$AllowUpdate=0;\n\t\t}\n\n\t\t$res = sql(\"select * from `tb_acompanhamento` where `id`='\".makeSafe($selected_id).\"'\", $eo);\n\t\tif(!($row = db_fetch_array($res))){\n\t\t\treturn error_message($Translation['No records found'], 'tb_acompanhamento_view.php', false);\n\t\t}\n\t\t$urow = $row; /* unsanitized data */\n\t\t$hc = new CI_Input();\n\t\t$row = $hc->xss_clean($row); /* sanitize data */\n\t\t$combo_empresa_id->SelectedData = $row['empresa_id'];\n\t\t$combo_contato_id->SelectedData = $row['contato_id'];\n\t\t$combo_contrato_id->SelectedData = $row['contrato_id'];\n\t\t$combo_usuario_id->SelectedData = $row['usuario_id'];\n\t\t$combo_dta->DefaultDate = $row['dta'];\n\t\t$combo_str_meio->SelectedData = $row['str_meio'];\n\t\t$combo_str_statusgeral->SelectedData = $row['str_statusgeral'];\n\t\t$combo_str_clima_cliente->SelectedData = $row['str_clima_cliente'];\n\t\t$combo_str_clima_equipe->SelectedData = $row['str_clima_equipe'];\n\t}else{\n\t\t$combo_empresa_id->SelectedData = $filterer_empresa_id;\n\t\t$combo_contato_id->SelectedData = $filterer_contato_id;\n\t\t$combo_contrato_id->SelectedData = $filterer_contrato_id;\n\t\t$combo_usuario_id->SelectedData = $filterer_usuario_id;\n\t\t$combo_str_meio->SelectedText = ( $_REQUEST['FilterField'][1]=='7' && $_REQUEST['FilterOperator'][1]=='<=>' ? (get_magic_quotes_gpc() ? stripslashes($_REQUEST['FilterValue'][1]) : $_REQUEST['FilterValue'][1]) : \"\");\n\t\t$combo_str_statusgeral->SelectedText = ( $_REQUEST['FilterField'][1]=='8' && $_REQUEST['FilterOperator'][1]=='<=>' ? (get_magic_quotes_gpc() ? stripslashes($_REQUEST['FilterValue'][1]) : $_REQUEST['FilterValue'][1]) : \"\");\n\t\t$combo_str_clima_cliente->SelectedText = ( $_REQUEST['FilterField'][1]=='9' && $_REQUEST['FilterOperator'][1]=='<=>' ? (get_magic_quotes_gpc() ? stripslashes($_REQUEST['FilterValue'][1]) : $_REQUEST['FilterValue'][1]) : \"\");\n\t\t$combo_str_clima_equipe->SelectedText = ( $_REQUEST['FilterField'][1]=='10' && $_REQUEST['FilterOperator'][1]=='<=>' ? (get_magic_quotes_gpc() ? stripslashes($_REQUEST['FilterValue'][1]) : $_REQUEST['FilterValue'][1]) : \"\");\n\t}\n\t$combo_empresa_id->HTML = '<span id=\"empresa_id-container' . $rnd1 . '\"></span><input type=\"hidden\" name=\"empresa_id\" id=\"empresa_id' . $rnd1 . '\" value=\"' . html_attr($combo_empresa_id->SelectedData) . '\">';\n\t$combo_empresa_id->MatchText = '<span id=\"empresa_id-container-readonly' . $rnd1 . '\"></span><input type=\"hidden\" name=\"empresa_id\" id=\"empresa_id' . $rnd1 . '\" value=\"' . html_attr($combo_empresa_id->SelectedData) . '\">';\n\t$combo_contato_id->HTML = '<span id=\"contato_id-container' . $rnd1 . '\"></span><input type=\"hidden\" name=\"contato_id\" id=\"contato_id' . $rnd1 . '\" value=\"' . html_attr($combo_contato_id->SelectedData) . '\">';\n\t$combo_contato_id->MatchText = '<span id=\"contato_id-container-readonly' . $rnd1 . '\"></span><input type=\"hidden\" name=\"contato_id\" id=\"contato_id' . $rnd1 . '\" value=\"' . html_attr($combo_contato_id->SelectedData) . '\">';\n\t$combo_contrato_id->HTML = '<span id=\"contrato_id-container' . $rnd1 . '\"></span><input type=\"hidden\" name=\"contrato_id\" id=\"contrato_id' . $rnd1 . '\" value=\"' . html_attr($combo_contrato_id->SelectedData) . '\">';\n\t$combo_contrato_id->MatchText = '<span id=\"contrato_id-container-readonly' . $rnd1 . '\"></span><input type=\"hidden\" name=\"contrato_id\" id=\"contrato_id' . $rnd1 . '\" value=\"' . html_attr($combo_contrato_id->SelectedData) . '\">';\n\t$combo_usuario_id->HTML = '<span id=\"usuario_id-container' . $rnd1 . '\"></span><input type=\"hidden\" name=\"usuario_id\" id=\"usuario_id' . $rnd1 . '\" value=\"' . html_attr($combo_usuario_id->SelectedData) . '\">';\n\t$combo_usuario_id->MatchText = '<span id=\"usuario_id-container-readonly' . $rnd1 . '\"></span><input type=\"hidden\" name=\"usuario_id\" id=\"usuario_id' . $rnd1 . '\" value=\"' . html_attr($combo_usuario_id->SelectedData) . '\">';\n\t$combo_str_meio->Render();\n\t$combo_str_statusgeral->Render();\n\t$combo_str_clima_cliente->Render();\n\t$combo_str_clima_equipe->Render();\n\n\tob_start();\n\t?>\n\n\t<script>\n\t\t// initial lookup values\n\t\tAppGini.current_empresa_id__RAND__ = { text: \"\", value: \"<?php echo addslashes($selected_id ? $urow['empresa_id'] : $filterer_empresa_id); ?>\"};\n\t\tAppGini.current_contato_id__RAND__ = { text: \"\", value: \"<?php echo addslashes($selected_id ? $urow['contato_id'] : $filterer_contato_id); ?>\"};\n\t\tAppGini.current_contrato_id__RAND__ = { text: \"\", value: \"<?php echo addslashes($selected_id ? $urow['contrato_id'] : $filterer_contrato_id); ?>\"};\n\t\tAppGini.current_usuario_id__RAND__ = { text: \"\", value: \"<?php echo addslashes($selected_id ? $urow['usuario_id'] : $filterer_usuario_id); ?>\"};\n\n\t\tjQuery(function() {\n\t\t\tsetTimeout(function(){\n\t\t\t\tif(typeof(empresa_id_reload__RAND__) == 'function') empresa_id_reload__RAND__();\n\t\t\t\t<?php echo (!$AllowUpdate || $dvprint ? 'if(typeof(contato_id_reload__RAND__) == \\'function\\') contato_id_reload__RAND__(AppGini.current_empresa_id__RAND__.value);' : ''); ?>\n\t\t\t\t<?php echo (!$AllowUpdate || $dvprint ? 'if(typeof(contrato_id_reload__RAND__) == \\'function\\') contrato_id_reload__RAND__(AppGini.current_empresa_id__RAND__.value);' : ''); ?>\n\t\t\t\tif(typeof(usuario_id_reload__RAND__) == 'function') usuario_id_reload__RAND__();\n\t\t\t}, 10); /* we need to slightly delay client-side execution of the above code to allow AppGini.ajaxCache to work */\n\t\t});\n\t\tfunction empresa_id_reload__RAND__(){\n\t\t<?php if(($AllowUpdate || $AllowInsert) && !$dvprint){ ?>\n\n\t\t\t$j(\"#empresa_id-container__RAND__\").select2({\n\t\t\t\t/* initial default value */\n\t\t\t\tinitSelection: function(e, c){\n\t\t\t\t\t$j.ajax({\n\t\t\t\t\t\turl: 'ajax_combo.php',\n\t\t\t\t\t\tdataType: 'json',\n\t\t\t\t\t\tdata: { id: AppGini.current_empresa_id__RAND__.value, t: 'tb_acompanhamento', f: 'empresa_id' },\n\t\t\t\t\t\tsuccess: function(resp){\n\t\t\t\t\t\t\tc({\n\t\t\t\t\t\t\t\tid: resp.results[0].id,\n\t\t\t\t\t\t\t\ttext: resp.results[0].text\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t$j('[name=\"empresa_id\"]').val(resp.results[0].id);\n\t\t\t\t\t\t\t$j('[id=empresa_id-container-readonly__RAND__]').html('<span id=\"empresa_id-match-text\">' + resp.results[0].text + '</span>');\n\t\t\t\t\t\t\tif(resp.results[0].id == '<?php echo empty_lookup_value; ?>'){ $j('.btn[id=tb_empresa_view_parent]').hide(); }else{ $j('.btn[id=tb_empresa_view_parent]').show(); }\n\n\t\t\t\t\t\tif(typeof(contato_id_reload__RAND__) == 'function') contato_id_reload__RAND__(AppGini.current_empresa_id__RAND__.value);\n\t\t\t\t\t\tif(typeof(contrato_id_reload__RAND__) == 'function') contrato_id_reload__RAND__(AppGini.current_empresa_id__RAND__.value);\n\n\t\t\t\t\t\t\tif(typeof(empresa_id_update_autofills__RAND__) == 'function') empresa_id_update_autofills__RAND__();\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\t},\n\t\t\t\twidth: '100%',\n\t\t\t\tformatNoMatches: function(term){ /* */ return '<?php echo addslashes($Translation['No matches found!']); ?>'; },\n\t\t\t\tminimumResultsForSearch: 10,\n\t\t\t\tloadMorePadding: 200,\n\t\t\t\tajax: {\n\t\t\t\t\turl: 'ajax_combo.php',\n\t\t\t\t\tdataType: 'json',\n\t\t\t\t\tcache: true,\n\t\t\t\t\tdata: function(term, page){ /* */ return { s: term, p: page, t: 'tb_acompanhamento', f: 'empresa_id' }; },\n\t\t\t\t\tresults: function(resp, page){ /* */ return resp; }\n\t\t\t\t},\n\t\t\t\tescapeMarkup: function(str){ /* */ return str; }\n\t\t\t}).on('change', function(e){\n\t\t\t\tAppGini.current_empresa_id__RAND__.value = e.added.id;\n\t\t\t\tAppGini.current_empresa_id__RAND__.text = e.added.text;\n\t\t\t\t$j('[name=\"empresa_id\"]').val(e.added.id);\n\t\t\t\tif(e.added.id == '<?php echo empty_lookup_value; ?>'){ $j('.btn[id=tb_empresa_view_parent]').hide(); }else{ $j('.btn[id=tb_empresa_view_parent]').show(); }\n\n\t\t\t\t\t\tif(typeof(contato_id_reload__RAND__) == 'function') contato_id_reload__RAND__(AppGini.current_empresa_id__RAND__.value);\n\t\t\t\t\t\tif(typeof(contrato_id_reload__RAND__) == 'function') contrato_id_reload__RAND__(AppGini.current_empresa_id__RAND__.value);\n\n\t\t\t\tif(typeof(empresa_id_update_autofills__RAND__) == 'function') empresa_id_update_autofills__RAND__();\n\t\t\t});\n\n\t\t\tif(!$j(\"#empresa_id-container__RAND__\").length){\n\t\t\t\t$j.ajax({\n\t\t\t\t\turl: 'ajax_combo.php',\n\t\t\t\t\tdataType: 'json',\n\t\t\t\t\tdata: { id: AppGini.current_empresa_id__RAND__.value, t: 'tb_acompanhamento', f: 'empresa_id' },\n\t\t\t\t\tsuccess: function(resp){\n\t\t\t\t\t\t$j('[name=\"empresa_id\"]').val(resp.results[0].id);\n\t\t\t\t\t\t$j('[id=empresa_id-container-readonly__RAND__]').html('<span id=\"empresa_id-match-text\">' + resp.results[0].text + '</span>');\n\t\t\t\t\t\tif(resp.results[0].id == '<?php echo empty_lookup_value; ?>'){ $j('.btn[id=tb_empresa_view_parent]').hide(); }else{ $j('.btn[id=tb_empresa_view_parent]').show(); }\n\n\t\t\t\t\t\tif(typeof(empresa_id_update_autofills__RAND__) == 'function') empresa_id_update_autofills__RAND__();\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t}\n\n\t\t<?php }else{ ?>\n\n\t\t\t$j.ajax({\n\t\t\t\turl: 'ajax_combo.php',\n\t\t\t\tdataType: 'json',\n\t\t\t\tdata: { id: AppGini.current_empresa_id__RAND__.value, t: 'tb_acompanhamento', f: 'empresa_id' },\n\t\t\t\tsuccess: function(resp){\n\t\t\t\t\t$j('[id=empresa_id-container__RAND__], [id=empresa_id-container-readonly__RAND__]').html('<span id=\"empresa_id-match-text\">' + resp.results[0].text + '</span>');\n\t\t\t\t\tif(resp.results[0].id == '<?php echo empty_lookup_value; ?>'){ $j('.btn[id=tb_empresa_view_parent]').hide(); }else{ $j('.btn[id=tb_empresa_view_parent]').show(); }\n\n\t\t\t\t\tif(typeof(empresa_id_update_autofills__RAND__) == 'function') empresa_id_update_autofills__RAND__();\n\t\t\t\t}\n\t\t\t});\n\t\t<?php } ?>\n\n\t\t}\n\t\tfunction contato_id_reload__RAND__(filterer_empresa_id){\n\t\t<?php if(($AllowUpdate || $AllowInsert) && !$dvprint){ ?>\n\n\t\t\t$j(\"#contato_id-container__RAND__\").select2({\n\t\t\t\t/* initial default value */\n\t\t\t\tinitSelection: function(e, c){\n\t\t\t\t\t$j.ajax({\n\t\t\t\t\t\turl: 'ajax_combo.php',\n\t\t\t\t\t\tdataType: 'json',\n\t\t\t\t\t\tdata: { filterer_empresa_id: filterer_empresa_id, id: AppGini.current_contato_id__RAND__.value, t: 'tb_acompanhamento', f: 'contato_id' },\n\t\t\t\t\t\tsuccess: function(resp){\n\t\t\t\t\t\t\tc({\n\t\t\t\t\t\t\t\tid: resp.results[0].id,\n\t\t\t\t\t\t\t\ttext: resp.results[0].text\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t$j('[name=\"contato_id\"]').val(resp.results[0].id);\n\t\t\t\t\t\t\t$j('[id=contato_id-container-readonly__RAND__]').html('<span id=\"contato_id-match-text\">' + resp.results[0].text + '</span>');\n\t\t\t\t\t\t\tif(resp.results[0].id == '<?php echo empty_lookup_value; ?>'){ $j('.btn[id=tb_contato_view_parent]').hide(); }else{ $j('.btn[id=tb_contato_view_parent]').show(); }\n\n\n\t\t\t\t\t\t\tif(typeof(contato_id_update_autofills__RAND__) == 'function') contato_id_update_autofills__RAND__();\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\t},\n\t\t\t\twidth: '100%',\n\t\t\t\tformatNoMatches: function(term){ /* */ return '<?php echo addslashes($Translation['No matches found!']); ?>'; },\n\t\t\t\tminimumResultsForSearch: 10,\n\t\t\t\tloadMorePadding: 200,\n\t\t\t\tajax: {\n\t\t\t\t\turl: 'ajax_combo.php',\n\t\t\t\t\tdataType: 'json',\n\t\t\t\t\tcache: true,\n\t\t\t\t\tdata: function(term, page){ /* */ return { filterer_empresa_id: filterer_empresa_id, s: term, p: page, t: 'tb_acompanhamento', f: 'contato_id' }; },\n\t\t\t\t\tresults: function(resp, page){ /* */ return resp; }\n\t\t\t\t},\n\t\t\t\tescapeMarkup: function(str){ /* */ return str; }\n\t\t\t}).on('change', function(e){\n\t\t\t\tAppGini.current_contato_id__RAND__.value = e.added.id;\n\t\t\t\tAppGini.current_contato_id__RAND__.text = e.added.text;\n\t\t\t\t$j('[name=\"contato_id\"]').val(e.added.id);\n\t\t\t\tif(e.added.id == '<?php echo empty_lookup_value; ?>'){ $j('.btn[id=tb_contato_view_parent]').hide(); }else{ $j('.btn[id=tb_contato_view_parent]').show(); }\n\n\n\t\t\t\tif(typeof(contato_id_update_autofills__RAND__) == 'function') contato_id_update_autofills__RAND__();\n\t\t\t});\n\n\t\t\tif(!$j(\"#contato_id-container__RAND__\").length){\n\t\t\t\t$j.ajax({\n\t\t\t\t\turl: 'ajax_combo.php',\n\t\t\t\t\tdataType: 'json',\n\t\t\t\t\tdata: { id: AppGini.current_contato_id__RAND__.value, t: 'tb_acompanhamento', f: 'contato_id' },\n\t\t\t\t\tsuccess: function(resp){\n\t\t\t\t\t\t$j('[name=\"contato_id\"]').val(resp.results[0].id);\n\t\t\t\t\t\t$j('[id=contato_id-container-readonly__RAND__]').html('<span id=\"contato_id-match-text\">' + resp.results[0].text + '</span>');\n\t\t\t\t\t\tif(resp.results[0].id == '<?php echo empty_lookup_value; ?>'){ $j('.btn[id=tb_contato_view_parent]').hide(); }else{ $j('.btn[id=tb_contato_view_parent]').show(); }\n\n\t\t\t\t\t\tif(typeof(contato_id_update_autofills__RAND__) == 'function') contato_id_update_autofills__RAND__();\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t}\n\n\t\t<?php }else{ ?>\n\n\t\t\t$j.ajax({\n\t\t\t\turl: 'ajax_combo.php',\n\t\t\t\tdataType: 'json',\n\t\t\t\tdata: { id: AppGini.current_contato_id__RAND__.value, t: 'tb_acompanhamento', f: 'contato_id' },\n\t\t\t\tsuccess: function(resp){\n\t\t\t\t\t$j('[id=contato_id-container__RAND__], [id=contato_id-container-readonly__RAND__]').html('<span id=\"contato_id-match-text\">' + resp.results[0].text + '</span>');\n\t\t\t\t\tif(resp.results[0].id == '<?php echo empty_lookup_value; ?>'){ $j('.btn[id=tb_contato_view_parent]').hide(); }else{ $j('.btn[id=tb_contato_view_parent]').show(); }\n\n\t\t\t\t\tif(typeof(contato_id_update_autofills__RAND__) == 'function') contato_id_update_autofills__RAND__();\n\t\t\t\t}\n\t\t\t});\n\t\t<?php } ?>\n\n\t\t}\n\t\tfunction contrato_id_reload__RAND__(filterer_empresa_id){\n\t\t<?php if(($AllowUpdate || $AllowInsert) && !$dvprint){ ?>\n\n\t\t\t$j(\"#contrato_id-container__RAND__\").select2({\n\t\t\t\t/* initial default value */\n\t\t\t\tinitSelection: function(e, c){\n\t\t\t\t\t$j.ajax({\n\t\t\t\t\t\turl: 'ajax_combo.php',\n\t\t\t\t\t\tdataType: 'json',\n\t\t\t\t\t\tdata: { filterer_empresa_id: filterer_empresa_id, id: AppGini.current_contrato_id__RAND__.value, t: 'tb_acompanhamento', f: 'contrato_id' },\n\t\t\t\t\t\tsuccess: function(resp){\n\t\t\t\t\t\t\tc({\n\t\t\t\t\t\t\t\tid: resp.results[0].id,\n\t\t\t\t\t\t\t\ttext: resp.results[0].text\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t$j('[name=\"contrato_id\"]').val(resp.results[0].id);\n\t\t\t\t\t\t\t$j('[id=contrato_id-container-readonly__RAND__]').html('<span id=\"contrato_id-match-text\">' + resp.results[0].text + '</span>');\n\t\t\t\t\t\t\tif(resp.results[0].id == '<?php echo empty_lookup_value; ?>'){ $j('.btn[id=tb_contrato_view_parent]').hide(); }else{ $j('.btn[id=tb_contrato_view_parent]').show(); }\n\n\n\t\t\t\t\t\t\tif(typeof(contrato_id_update_autofills__RAND__) == 'function') contrato_id_update_autofills__RAND__();\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\t},\n\t\t\t\twidth: '100%',\n\t\t\t\tformatNoMatches: function(term){ /* */ return '<?php echo addslashes($Translation['No matches found!']); ?>'; },\n\t\t\t\tminimumResultsForSearch: 10,\n\t\t\t\tloadMorePadding: 200,\n\t\t\t\tajax: {\n\t\t\t\t\turl: 'ajax_combo.php',\n\t\t\t\t\tdataType: 'json',\n\t\t\t\t\tcache: true,\n\t\t\t\t\tdata: function(term, page){ /* */ return { filterer_empresa_id: filterer_empresa_id, s: term, p: page, t: 'tb_acompanhamento', f: 'contrato_id' }; },\n\t\t\t\t\tresults: function(resp, page){ /* */ return resp; }\n\t\t\t\t},\n\t\t\t\tescapeMarkup: function(str){ /* */ return str; }\n\t\t\t}).on('change', function(e){\n\t\t\t\tAppGini.current_contrato_id__RAND__.value = e.added.id;\n\t\t\t\tAppGini.current_contrato_id__RAND__.text = e.added.text;\n\t\t\t\t$j('[name=\"contrato_id\"]').val(e.added.id);\n\t\t\t\tif(e.added.id == '<?php echo empty_lookup_value; ?>'){ $j('.btn[id=tb_contrato_view_parent]').hide(); }else{ $j('.btn[id=tb_contrato_view_parent]').show(); }\n\n\n\t\t\t\tif(typeof(contrato_id_update_autofills__RAND__) == 'function') contrato_id_update_autofills__RAND__();\n\t\t\t});\n\n\t\t\tif(!$j(\"#contrato_id-container__RAND__\").length){\n\t\t\t\t$j.ajax({\n\t\t\t\t\turl: 'ajax_combo.php',\n\t\t\t\t\tdataType: 'json',\n\t\t\t\t\tdata: { id: AppGini.current_contrato_id__RAND__.value, t: 'tb_acompanhamento', f: 'contrato_id' },\n\t\t\t\t\tsuccess: function(resp){\n\t\t\t\t\t\t$j('[name=\"contrato_id\"]').val(resp.results[0].id);\n\t\t\t\t\t\t$j('[id=contrato_id-container-readonly__RAND__]').html('<span id=\"contrato_id-match-text\">' + resp.results[0].text + '</span>');\n\t\t\t\t\t\tif(resp.results[0].id == '<?php echo empty_lookup_value; ?>'){ $j('.btn[id=tb_contrato_view_parent]').hide(); }else{ $j('.btn[id=tb_contrato_view_parent]').show(); }\n\n\t\t\t\t\t\tif(typeof(contrato_id_update_autofills__RAND__) == 'function') contrato_id_update_autofills__RAND__();\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t}\n\n\t\t<?php }else{ ?>\n\n\t\t\t$j.ajax({\n\t\t\t\turl: 'ajax_combo.php',\n\t\t\t\tdataType: 'json',\n\t\t\t\tdata: { id: AppGini.current_contrato_id__RAND__.value, t: 'tb_acompanhamento', f: 'contrato_id' },\n\t\t\t\tsuccess: function(resp){\n\t\t\t\t\t$j('[id=contrato_id-container__RAND__], [id=contrato_id-container-readonly__RAND__]').html('<span id=\"contrato_id-match-text\">' + resp.results[0].text + '</span>');\n\t\t\t\t\tif(resp.results[0].id == '<?php echo empty_lookup_value; ?>'){ $j('.btn[id=tb_contrato_view_parent]').hide(); }else{ $j('.btn[id=tb_contrato_view_parent]').show(); }\n\n\t\t\t\t\tif(typeof(contrato_id_update_autofills__RAND__) == 'function') contrato_id_update_autofills__RAND__();\n\t\t\t\t}\n\t\t\t});\n\t\t<?php } ?>\n\n\t\t}\n\t\tfunction usuario_id_reload__RAND__(){\n\t\t<?php if(($AllowUpdate || $AllowInsert) && !$dvprint){ ?>\n\n\t\t\t$j(\"#usuario_id-container__RAND__\").select2({\n\t\t\t\t/* initial default value */\n\t\t\t\tinitSelection: function(e, c){\n\t\t\t\t\t$j.ajax({\n\t\t\t\t\t\turl: 'ajax_combo.php',\n\t\t\t\t\t\tdataType: 'json',\n\t\t\t\t\t\tdata: { id: AppGini.current_usuario_id__RAND__.value, t: 'tb_acompanhamento', f: 'usuario_id' },\n\t\t\t\t\t\tsuccess: function(resp){\n\t\t\t\t\t\t\tc({\n\t\t\t\t\t\t\t\tid: resp.results[0].id,\n\t\t\t\t\t\t\t\ttext: resp.results[0].text\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t$j('[name=\"usuario_id\"]').val(resp.results[0].id);\n\t\t\t\t\t\t\t$j('[id=usuario_id-container-readonly__RAND__]').html('<span id=\"usuario_id-match-text\">' + resp.results[0].text + '</span>');\n\t\t\t\t\t\t\tif(resp.results[0].id == '<?php echo empty_lookup_value; ?>'){ $j('.btn[id=tb_recrutador_view_parent]').hide(); }else{ $j('.btn[id=tb_recrutador_view_parent]').show(); }\n\n\n\t\t\t\t\t\t\tif(typeof(usuario_id_update_autofills__RAND__) == 'function') usuario_id_update_autofills__RAND__();\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\t},\n\t\t\t\twidth: '100%',\n\t\t\t\tformatNoMatches: function(term){ /* */ return '<?php echo addslashes($Translation['No matches found!']); ?>'; },\n\t\t\t\tminimumResultsForSearch: 10,\n\t\t\t\tloadMorePadding: 200,\n\t\t\t\tajax: {\n\t\t\t\t\turl: 'ajax_combo.php',\n\t\t\t\t\tdataType: 'json',\n\t\t\t\t\tcache: true,\n\t\t\t\t\tdata: function(term, page){ /* */ return { s: term, p: page, t: 'tb_acompanhamento', f: 'usuario_id' }; },\n\t\t\t\t\tresults: function(resp, page){ /* */ return resp; }\n\t\t\t\t},\n\t\t\t\tescapeMarkup: function(str){ /* */ return str; }\n\t\t\t}).on('change', function(e){\n\t\t\t\tAppGini.current_usuario_id__RAND__.value = e.added.id;\n\t\t\t\tAppGini.current_usuario_id__RAND__.text = e.added.text;\n\t\t\t\t$j('[name=\"usuario_id\"]').val(e.added.id);\n\t\t\t\tif(e.added.id == '<?php echo empty_lookup_value; ?>'){ $j('.btn[id=tb_recrutador_view_parent]').hide(); }else{ $j('.btn[id=tb_recrutador_view_parent]').show(); }\n\n\n\t\t\t\tif(typeof(usuario_id_update_autofills__RAND__) == 'function') usuario_id_update_autofills__RAND__();\n\t\t\t});\n\n\t\t\tif(!$j(\"#usuario_id-container__RAND__\").length){\n\t\t\t\t$j.ajax({\n\t\t\t\t\turl: 'ajax_combo.php',\n\t\t\t\t\tdataType: 'json',\n\t\t\t\t\tdata: { id: AppGini.current_usuario_id__RAND__.value, t: 'tb_acompanhamento', f: 'usuario_id' },\n\t\t\t\t\tsuccess: function(resp){\n\t\t\t\t\t\t$j('[name=\"usuario_id\"]').val(resp.results[0].id);\n\t\t\t\t\t\t$j('[id=usuario_id-container-readonly__RAND__]').html('<span id=\"usuario_id-match-text\">' + resp.results[0].text + '</span>');\n\t\t\t\t\t\tif(resp.results[0].id == '<?php echo empty_lookup_value; ?>'){ $j('.btn[id=tb_recrutador_view_parent]').hide(); }else{ $j('.btn[id=tb_recrutador_view_parent]').show(); }\n\n\t\t\t\t\t\tif(typeof(usuario_id_update_autofills__RAND__) == 'function') usuario_id_update_autofills__RAND__();\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t}\n\n\t\t<?php }else{ ?>\n\n\t\t\t$j.ajax({\n\t\t\t\turl: 'ajax_combo.php',\n\t\t\t\tdataType: 'json',\n\t\t\t\tdata: { id: AppGini.current_usuario_id__RAND__.value, t: 'tb_acompanhamento', f: 'usuario_id' },\n\t\t\t\tsuccess: function(resp){\n\t\t\t\t\t$j('[id=usuario_id-container__RAND__], [id=usuario_id-container-readonly__RAND__]').html('<span id=\"usuario_id-match-text\">' + resp.results[0].text + '</span>');\n\t\t\t\t\tif(resp.results[0].id == '<?php echo empty_lookup_value; ?>'){ $j('.btn[id=tb_recrutador_view_parent]').hide(); }else{ $j('.btn[id=tb_recrutador_view_parent]').show(); }\n\n\t\t\t\t\tif(typeof(usuario_id_update_autofills__RAND__) == 'function') usuario_id_update_autofills__RAND__();\n\t\t\t\t}\n\t\t\t});\n\t\t<?php } ?>\n\n\t\t}\n\t</script>\n\t<?php\n\n\t$lookups = str_replace('__RAND__', $rnd1, ob_get_contents());\n\tob_end_clean();\n\n\n\t// code for template based detail view forms\n\n\t// open the detail view template\n\tif($dvprint){\n\t\t$template_file = is_file(\"./{$TemplateDVP}\") ? \"./{$TemplateDVP}\" : './templates/tb_acompanhamento_templateDVP.html';\n\t\t$templateCode = @file_get_contents($template_file);\n\t}else{\n\t\t$template_file = is_file(\"./{$TemplateDV}\") ? \"./{$TemplateDV}\" : './templates/tb_acompanhamento_templateDV.html';\n\t\t$templateCode = @file_get_contents($template_file);\n\t}\n\n\t// process form title\n\t$templateCode = str_replace('<%%DETAIL_VIEW_TITLE%%>', 'Detalhes do acompanhamento', $templateCode);\n\t$templateCode = str_replace('<%%RND1%%>', $rnd1, $templateCode);\n\t$templateCode = str_replace('<%%EMBEDDED%%>', ($_REQUEST['Embedded'] ? 'Embedded=1' : ''), $templateCode);\n\t// process buttons\n\tif($AllowInsert){\n\t\tif(!$selected_id) $templateCode = str_replace('<%%INSERT_BUTTON%%>', '<button type=\"submit\" class=\"btn btn-success\" id=\"insert\" name=\"insert_x\" value=\"1\" onclick=\"return tb_acompanhamento_validateData();\"><i class=\"glyphicon glyphicon-plus-sign\"></i> ' . $Translation['Save New'] . '</button>', $templateCode);\n\t\t$templateCode = str_replace('<%%INSERT_BUTTON%%>', '<button type=\"submit\" class=\"btn btn-default\" id=\"insert\" name=\"insert_x\" value=\"1\" onclick=\"return tb_acompanhamento_validateData();\"><i class=\"glyphicon glyphicon-plus-sign\"></i> ' . $Translation['Save As Copy'] . '</button>', $templateCode);\n\t}else{\n\t\t$templateCode = str_replace('<%%INSERT_BUTTON%%>', '', $templateCode);\n\t}\n\n\t// 'Back' button action\n\tif($_REQUEST['Embedded']){\n\t\t$backAction = 'AppGini.closeParentModal(); return false;';\n\t}else{\n\t\t$backAction = '$j(\\'form\\').eq(0).attr(\\'novalidate\\', \\'novalidate\\'); document.myform.reset(); return true;';\n\t}\n\n\tif($selected_id){\n\t\tif(!$_REQUEST['Embedded']) $templateCode = str_replace('<%%DVPRINT_BUTTON%%>', '<button type=\"submit\" class=\"btn btn-default\" id=\"dvprint\" name=\"dvprint_x\" value=\"1\" onclick=\"$$(\\'form\\')[0].writeAttribute(\\'novalidate\\', \\'novalidate\\'); document.myform.reset(); return true;\" title=\"' . html_attr($Translation['Print Preview']) . '\"><i class=\"glyphicon glyphicon-print\"></i> ' . $Translation['Print Preview'] . '</button>', $templateCode);\n\t\tif($AllowUpdate){\n\t\t\t$templateCode = str_replace('<%%UPDATE_BUTTON%%>', '<button type=\"submit\" class=\"btn btn-success btn-lg\" id=\"update\" name=\"update_x\" value=\"1\" onclick=\"return tb_acompanhamento_validateData();\" title=\"' . html_attr($Translation['Save Changes']) . '\"><i class=\"glyphicon glyphicon-ok\"></i> ' . $Translation['Save Changes'] . '</button>', $templateCode);\n\t\t}else{\n\t\t\t$templateCode = str_replace('<%%UPDATE_BUTTON%%>', '', $templateCode);\n\t\t}\n\t\tif(($arrPerm[4]==1 && $ownerMemberID==getLoggedMemberID()) || ($arrPerm[4]==2 && $ownerGroupID==getLoggedGroupID()) || $arrPerm[4]==3){ // allow delete?\n\t\t\t$templateCode = str_replace('<%%DELETE_BUTTON%%>', '<button type=\"submit\" class=\"btn btn-danger\" id=\"delete\" name=\"delete_x\" value=\"1\" onclick=\"return confirm(\\'' . $Translation['are you sure?'] . '\\');\" title=\"' . html_attr($Translation['Delete']) . '\"><i class=\"glyphicon glyphicon-trash\"></i> ' . $Translation['Delete'] . '</button>', $templateCode);\n\t\t}else{\n\t\t\t$templateCode = str_replace('<%%DELETE_BUTTON%%>', '', $templateCode);\n\t\t}\n\t\t$templateCode = str_replace('<%%DESELECT_BUTTON%%>', '<button type=\"submit\" class=\"btn btn-default\" id=\"deselect\" name=\"deselect_x\" value=\"1\" onclick=\"' . $backAction . '\" title=\"' . html_attr($Translation['Back']) . '\"><i class=\"glyphicon glyphicon-chevron-left\"></i> ' . $Translation['Back'] . '</button>', $templateCode);\n\t}else{\n\t\t$templateCode = str_replace('<%%UPDATE_BUTTON%%>', '', $templateCode);\n\t\t$templateCode = str_replace('<%%DELETE_BUTTON%%>', '', $templateCode);\n\t\t$templateCode = str_replace('<%%DESELECT_BUTTON%%>', ($ShowCancel ? '<button type=\"submit\" class=\"btn btn-default\" id=\"deselect\" name=\"deselect_x\" value=\"1\" onclick=\"' . $backAction . '\" title=\"' . html_attr($Translation['Back']) . '\"><i class=\"glyphicon glyphicon-chevron-left\"></i> ' . $Translation['Back'] . '</button>' : ''), $templateCode);\n\t}\n\n\t// set records to read only if user can't insert new records and can't edit current record\n\tif(($selected_id && !$AllowUpdate && !$AllowInsert) || (!$selected_id && !$AllowInsert)){\n\t\t$jsReadOnly .= \"\\tjQuery('#empresa_id').prop('disabled', true).css({ color: '#555', backgroundColor: '#fff' });\\n\";\n\t\t$jsReadOnly .= \"\\tjQuery('#empresa_id_caption').prop('disabled', true).css({ color: '#555', backgroundColor: 'white' });\\n\";\n\t\t$jsReadOnly .= \"\\tjQuery('#contato_id').prop('disabled', true).css({ color: '#555', backgroundColor: '#fff' });\\n\";\n\t\t$jsReadOnly .= \"\\tjQuery('#contato_id_caption').prop('disabled', true).css({ color: '#555', backgroundColor: 'white' });\\n\";\n\t\t$jsReadOnly .= \"\\tjQuery('#contrato_id').prop('disabled', true).css({ color: '#555', backgroundColor: '#fff' });\\n\";\n\t\t$jsReadOnly .= \"\\tjQuery('#contrato_id_caption').prop('disabled', true).css({ color: '#555', backgroundColor: 'white' });\\n\";\n\t\t$jsReadOnly .= \"\\tjQuery('#usuario_id').prop('disabled', true).css({ color: '#555', backgroundColor: '#fff' });\\n\";\n\t\t$jsReadOnly .= \"\\tjQuery('#usuario_id_caption').prop('disabled', true).css({ color: '#555', backgroundColor: 'white' });\\n\";\n\t\t$jsReadOnly .= \"\\tjQuery('#dta').prop('readonly', true);\\n\";\n\t\t$jsReadOnly .= \"\\tjQuery('#dtaDay, #dtaMonth, #dtaYear').prop('disabled', true).css({ color: '#555', backgroundColor: '#fff' });\\n\";\n\t\t$jsReadOnly .= \"\\tjQuery('input[name=str_meio]').parent().html('<div class=\\\"form-control-static\\\">' + jQuery('input[name=str_meio]:checked').next().text() + '</div>')\\n\";\n\t\t$jsReadOnly .= \"\\tjQuery('input[name=str_statusgeral]').parent().html('<div class=\\\"form-control-static\\\">' + jQuery('input[name=str_statusgeral]:checked').next().text() + '</div>')\\n\";\n\t\t$jsReadOnly .= \"\\tjQuery('#str_clima_cliente').replaceWith('<div class=\\\"form-control-static\\\" id=\\\"str_clima_cliente\\\">' + (jQuery('#str_clima_cliente').val() || '') + '</div>'); jQuery('#str_clima_cliente-multi-selection-help').hide();\\n\";\n\t\t$jsReadOnly .= \"\\tjQuery('#str_clima_equipe').replaceWith('<div class=\\\"form-control-static\\\" id=\\\"str_clima_equipe\\\">' + (jQuery('#str_clima_equipe').val() || '') + '</div>'); jQuery('#str_clima_equipe-multi-selection-help').hide();\\n\";\n\t\t$jsReadOnly .= \"\\tjQuery('#str_observacoes').replaceWith('<div class=\\\"form-control-static\\\" id=\\\"str_observacoes\\\">' + (jQuery('#str_observacoes').val() || '') + '</div>');\\n\";\n\t\t$jsReadOnly .= \"\\tjQuery('#str_acoes_corretivas').replaceWith('<div class=\\\"form-control-static\\\" id=\\\"str_acoes_corretivas\\\">' + (jQuery('#str_acoes_corretivas').val() || '') + '</div>');\\n\";\n\t\t$jsReadOnly .= \"\\tjQuery('.select2-container').hide();\\n\";\n\n\t\t$noUploads = true;\n\t}elseif($AllowInsert){\n\t\t$jsEditable .= \"\\tjQuery('form').eq(0).data('already_changed', true);\"; // temporarily disable form change handler\n\t\t\t$jsEditable .= \"\\tjQuery('form').eq(0).data('already_changed', false);\"; // re-enable form change handler\n\t}\n\n\t// process combos\n\t$templateCode = str_replace('<%%COMBO(empresa_id)%%>', $combo_empresa_id->HTML, $templateCode);\n\t$templateCode = str_replace('<%%COMBOTEXT(empresa_id)%%>', $combo_empresa_id->MatchText, $templateCode);\n\t$templateCode = str_replace('<%%URLCOMBOTEXT(empresa_id)%%>', urlencode($combo_empresa_id->MatchText), $templateCode);\n\t$templateCode = str_replace('<%%COMBO(contato_id)%%>', $combo_contato_id->HTML, $templateCode);\n\t$templateCode = str_replace('<%%COMBOTEXT(contato_id)%%>', $combo_contato_id->MatchText, $templateCode);\n\t$templateCode = str_replace('<%%URLCOMBOTEXT(contato_id)%%>', urlencode($combo_contato_id->MatchText), $templateCode);\n\t$templateCode = str_replace('<%%COMBO(contrato_id)%%>', $combo_contrato_id->HTML, $templateCode);\n\t$templateCode = str_replace('<%%COMBOTEXT(contrato_id)%%>', $combo_contrato_id->MatchText, $templateCode);\n\t$templateCode = str_replace('<%%URLCOMBOTEXT(contrato_id)%%>', urlencode($combo_contrato_id->MatchText), $templateCode);\n\t$templateCode = str_replace('<%%COMBO(usuario_id)%%>', $combo_usuario_id->HTML, $templateCode);\n\t$templateCode = str_replace('<%%COMBOTEXT(usuario_id)%%>', $combo_usuario_id->MatchText, $templateCode);\n\t$templateCode = str_replace('<%%URLCOMBOTEXT(usuario_id)%%>', urlencode($combo_usuario_id->MatchText), $templateCode);\n\t$templateCode = str_replace('<%%COMBO(dta)%%>', ($selected_id && !$arrPerm[3] ? '<div class=\"form-control-static\">' . $combo_dta->GetHTML(true) . '</div>' : $combo_dta->GetHTML()), $templateCode);\n\t$templateCode = str_replace('<%%COMBOTEXT(dta)%%>', $combo_dta->GetHTML(true), $templateCode);\n\t$templateCode = str_replace('<%%COMBO(str_meio)%%>', $combo_str_meio->HTML, $templateCode);\n\t$templateCode = str_replace('<%%COMBOTEXT(str_meio)%%>', $combo_str_meio->SelectedData, $templateCode);\n\t$templateCode = str_replace('<%%COMBO(str_statusgeral)%%>', $combo_str_statusgeral->HTML, $templateCode);\n\t$templateCode = str_replace('<%%COMBOTEXT(str_statusgeral)%%>', $combo_str_statusgeral->SelectedData, $templateCode);\n\t$templateCode = str_replace('<%%COMBO(str_clima_cliente)%%>', $combo_str_clima_cliente->HTML, $templateCode);\n\t$templateCode = str_replace('<%%COMBOTEXT(str_clima_cliente)%%>', $combo_str_clima_cliente->SelectedData, $templateCode);\n\t$templateCode = str_replace('<%%COMBO(str_clima_equipe)%%>', $combo_str_clima_equipe->HTML, $templateCode);\n\t$templateCode = str_replace('<%%COMBOTEXT(str_clima_equipe)%%>', $combo_str_clima_equipe->SelectedData, $templateCode);\n\n\t/* lookup fields array: 'lookup field name' => array('parent table name', 'lookup field caption') */\n\t$lookup_fields = array( 'empresa_id' => array('tb_empresa', 'Conta'), 'contato_id' => array('tb_contato', 'Contato'), 'contrato_id' => array('tb_contrato', 'Contrato'), 'usuario_id' => array('tb_recrutador', 'Respons&#225;vel'));\n\tforeach($lookup_fields as $luf => $ptfc){\n\t\t$pt_perm = getTablePermissions($ptfc[0]);\n\n\t\t// process foreign key links\n\t\tif($pt_perm['view'] || $pt_perm['edit']){\n\t\t\t$templateCode = str_replace(\"<%%PLINK({$luf})%%>\", '<button type=\"button\" class=\"btn btn-default view_parent hspacer-md\" id=\"' . $ptfc[0] . '_view_parent\" title=\"' . html_attr($Translation['View'] . ' ' . $ptfc[1]) . '\"><i class=\"glyphicon glyphicon-eye-open\"></i></button>', $templateCode);\n\t\t}\n\n\t\t// if user has insert permission to parent table of a lookup field, put an add new button\n\t\tif($pt_perm['insert'] && !$_REQUEST['Embedded']){\n\t\t\t$templateCode = str_replace(\"<%%ADDNEW({$ptfc[0]})%%>\", '<button type=\"button\" class=\"btn btn-success add_new_parent hspacer-md\" id=\"' . $ptfc[0] . '_add_new\" title=\"' . html_attr($Translation['Add New'] . ' ' . $ptfc[1]) . '\"><i class=\"glyphicon glyphicon-plus-sign\"></i></button>', $templateCode);\n\t\t}\n\t}\n\n\t// process images\n\t$templateCode = str_replace('<%%UPLOADFILE(id)%%>', '', $templateCode);\n\t$templateCode = str_replace('<%%UPLOADFILE(empresa_id)%%>', '', $templateCode);\n\t$templateCode = str_replace('<%%UPLOADFILE(contato_id)%%>', '', $templateCode);\n\t$templateCode = str_replace('<%%UPLOADFILE(contrato_id)%%>', '', $templateCode);\n\t$templateCode = str_replace('<%%UPLOADFILE(usuario_id)%%>', '', $templateCode);\n\t$templateCode = str_replace('<%%UPLOADFILE(dta)%%>', '', $templateCode);\n\t$templateCode = str_replace('<%%UPLOADFILE(str_meio)%%>', '', $templateCode);\n\t$templateCode = str_replace('<%%UPLOADFILE(str_statusgeral)%%>', '', $templateCode);\n\t$templateCode = str_replace('<%%UPLOADFILE(str_clima_cliente)%%>', '', $templateCode);\n\t$templateCode = str_replace('<%%UPLOADFILE(str_clima_equipe)%%>', '', $templateCode);\n\t$templateCode = str_replace('<%%UPLOADFILE(str_observacoes)%%>', '', $templateCode);\n\t$templateCode = str_replace('<%%UPLOADFILE(str_acoes_corretivas)%%>', '', $templateCode);\n\n\t// process values\n\tif($selected_id){\n\t\tif( $dvprint) $templateCode = str_replace('<%%VALUE(id)%%>', safe_html($urow['id']), $templateCode);\n\t\tif(!$dvprint) $templateCode = str_replace('<%%VALUE(id)%%>', html_attr($row['id']), $templateCode);\n\t\t$templateCode = str_replace('<%%URLVALUE(id)%%>', urlencode($urow['id']), $templateCode);\n\t\tif( $dvprint) $templateCode = str_replace('<%%VALUE(empresa_id)%%>', safe_html($urow['empresa_id']), $templateCode);\n\t\tif(!$dvprint) $templateCode = str_replace('<%%VALUE(empresa_id)%%>', html_attr($row['empresa_id']), $templateCode);\n\t\t$templateCode = str_replace('<%%URLVALUE(empresa_id)%%>', urlencode($urow['empresa_id']), $templateCode);\n\t\tif( $dvprint) $templateCode = str_replace('<%%VALUE(contato_id)%%>', safe_html($urow['contato_id']), $templateCode);\n\t\tif(!$dvprint) $templateCode = str_replace('<%%VALUE(contato_id)%%>', html_attr($row['contato_id']), $templateCode);\n\t\t$templateCode = str_replace('<%%URLVALUE(contato_id)%%>', urlencode($urow['contato_id']), $templateCode);\n\t\tif( $dvprint) $templateCode = str_replace('<%%VALUE(contrato_id)%%>', safe_html($urow['contrato_id']), $templateCode);\n\t\tif(!$dvprint) $templateCode = str_replace('<%%VALUE(contrato_id)%%>', html_attr($row['contrato_id']), $templateCode);\n\t\t$templateCode = str_replace('<%%URLVALUE(contrato_id)%%>', urlencode($urow['contrato_id']), $templateCode);\n\t\tif( $dvprint) $templateCode = str_replace('<%%VALUE(usuario_id)%%>', safe_html($urow['usuario_id']), $templateCode);\n\t\tif(!$dvprint) $templateCode = str_replace('<%%VALUE(usuario_id)%%>', html_attr($row['usuario_id']), $templateCode);\n\t\t$templateCode = str_replace('<%%URLVALUE(usuario_id)%%>', urlencode($urow['usuario_id']), $templateCode);\n\t\t$templateCode = str_replace('<%%VALUE(dta)%%>', @date('d/m/Y', @strtotime(html_attr($row['dta']))), $templateCode);\n\t\t$templateCode = str_replace('<%%URLVALUE(dta)%%>', urlencode(@date('d/m/Y', @strtotime(html_attr($urow['dta'])))), $templateCode);\n\t\tif( $dvprint) $templateCode = str_replace('<%%VALUE(str_meio)%%>', safe_html($urow['str_meio']), $templateCode);\n\t\tif(!$dvprint) $templateCode = str_replace('<%%VALUE(str_meio)%%>', html_attr($row['str_meio']), $templateCode);\n\t\t$templateCode = str_replace('<%%URLVALUE(str_meio)%%>', urlencode($urow['str_meio']), $templateCode);\n\t\tif( $dvprint) $templateCode = str_replace('<%%VALUE(str_statusgeral)%%>', safe_html($urow['str_statusgeral']), $templateCode);\n\t\tif(!$dvprint) $templateCode = str_replace('<%%VALUE(str_statusgeral)%%>', html_attr($row['str_statusgeral']), $templateCode);\n\t\t$templateCode = str_replace('<%%URLVALUE(str_statusgeral)%%>', urlencode($urow['str_statusgeral']), $templateCode);\n\t\tif( $dvprint) $templateCode = str_replace('<%%VALUE(str_clima_cliente)%%>', safe_html($urow['str_clima_cliente']), $templateCode);\n\t\tif(!$dvprint) $templateCode = str_replace('<%%VALUE(str_clima_cliente)%%>', html_attr($row['str_clima_cliente']), $templateCode);\n\t\t$templateCode = str_replace('<%%URLVALUE(str_clima_cliente)%%>', urlencode($urow['str_clima_cliente']), $templateCode);\n\t\tif( $dvprint) $templateCode = str_replace('<%%VALUE(str_clima_equipe)%%>', safe_html($urow['str_clima_equipe']), $templateCode);\n\t\tif(!$dvprint) $templateCode = str_replace('<%%VALUE(str_clima_equipe)%%>', html_attr($row['str_clima_equipe']), $templateCode);\n\t\t$templateCode = str_replace('<%%URLVALUE(str_clima_equipe)%%>', urlencode($urow['str_clima_equipe']), $templateCode);\n\t\tif($dvprint || (!$AllowUpdate && !$AllowInsert)){\n\t\t\t$templateCode = str_replace('<%%VALUE(str_observacoes)%%>', safe_html($urow['str_observacoes']), $templateCode);\n\t\t}else{\n\t\t\t$templateCode = str_replace('<%%VALUE(str_observacoes)%%>', html_attr($row['str_observacoes']), $templateCode);\n\t\t}\n\t\t$templateCode = str_replace('<%%URLVALUE(str_observacoes)%%>', urlencode($urow['str_observacoes']), $templateCode);\n\t\tif($dvprint || (!$AllowUpdate && !$AllowInsert)){\n\t\t\t$templateCode = str_replace('<%%VALUE(str_acoes_corretivas)%%>', safe_html($urow['str_acoes_corretivas']), $templateCode);\n\t\t}else{\n\t\t\t$templateCode = str_replace('<%%VALUE(str_acoes_corretivas)%%>', html_attr($row['str_acoes_corretivas']), $templateCode);\n\t\t}\n\t\t$templateCode = str_replace('<%%URLVALUE(str_acoes_corretivas)%%>', urlencode($urow['str_acoes_corretivas']), $templateCode);\n\t}else{\n\t\t$templateCode = str_replace('<%%VALUE(id)%%>', '', $templateCode);\n\t\t$templateCode = str_replace('<%%URLVALUE(id)%%>', urlencode(''), $templateCode);\n\t\t$templateCode = str_replace('<%%VALUE(empresa_id)%%>', '', $templateCode);\n\t\t$templateCode = str_replace('<%%URLVALUE(empresa_id)%%>', urlencode(''), $templateCode);\n\t\t$templateCode = str_replace('<%%VALUE(contato_id)%%>', '', $templateCode);\n\t\t$templateCode = str_replace('<%%URLVALUE(contato_id)%%>', urlencode(''), $templateCode);\n\t\t$templateCode = str_replace('<%%VALUE(contrato_id)%%>', '', $templateCode);\n\t\t$templateCode = str_replace('<%%URLVALUE(contrato_id)%%>', urlencode(''), $templateCode);\n\t\t$templateCode = str_replace('<%%VALUE(usuario_id)%%>', '', $templateCode);\n\t\t$templateCode = str_replace('<%%URLVALUE(usuario_id)%%>', urlencode(''), $templateCode);\n\t\t$templateCode = str_replace('<%%VALUE(dta)%%>', '', $templateCode);\n\t\t$templateCode = str_replace('<%%URLVALUE(dta)%%>', urlencode(''), $templateCode);\n\t\t$templateCode = str_replace('<%%VALUE(str_meio)%%>', '', $templateCode);\n\t\t$templateCode = str_replace('<%%URLVALUE(str_meio)%%>', urlencode(''), $templateCode);\n\t\t$templateCode = str_replace('<%%VALUE(str_statusgeral)%%>', '', $templateCode);\n\t\t$templateCode = str_replace('<%%URLVALUE(str_statusgeral)%%>', urlencode(''), $templateCode);\n\t\t$templateCode = str_replace('<%%VALUE(str_clima_cliente)%%>', '', $templateCode);\n\t\t$templateCode = str_replace('<%%URLVALUE(str_clima_cliente)%%>', urlencode(''), $templateCode);\n\t\t$templateCode = str_replace('<%%VALUE(str_clima_equipe)%%>', '', $templateCode);\n\t\t$templateCode = str_replace('<%%URLVALUE(str_clima_equipe)%%>', urlencode(''), $templateCode);\n\t\t$templateCode = str_replace('<%%VALUE(str_observacoes)%%>', '', $templateCode);\n\t\t$templateCode = str_replace('<%%URLVALUE(str_observacoes)%%>', urlencode(''), $templateCode);\n\t\t$templateCode = str_replace('<%%VALUE(str_acoes_corretivas)%%>', '', $templateCode);\n\t\t$templateCode = str_replace('<%%URLVALUE(str_acoes_corretivas)%%>', urlencode(''), $templateCode);\n\t}\n\n\t// process translations\n\tforeach($Translation as $symbol=>$trans){\n\t\t$templateCode = str_replace(\"<%%TRANSLATION($symbol)%%>\", $trans, $templateCode);\n\t}\n\n\t// clear scrap\n\t$templateCode = str_replace('<%%', '<!-- ', $templateCode);\n\t$templateCode = str_replace('%%>', ' -->', $templateCode);\n\n\t// hide links to inaccessible tables\n\tif($_REQUEST['dvprint_x'] == ''){\n\t\t$templateCode .= \"\\n\\n<script>\\$j(function(){\\n\";\n\t\t$arrTables = getTableList();\n\t\tforeach($arrTables as $name => $caption){\n\t\t\t$templateCode .= \"\\t\\$j('#{$name}_link').removeClass('hidden');\\n\";\n\t\t\t$templateCode .= \"\\t\\$j('#xs_{$name}_link').removeClass('hidden');\\n\";\n\t\t}\n\n\t\t$templateCode .= $jsReadOnly;\n\t\t$templateCode .= $jsEditable;\n\n\t\tif(!$selected_id){\n\t\t}\n\n\t\t$templateCode.=\"\\n});</script>\\n\";\n\t}\n\n\t// ajaxed auto-fill fields\n\t$templateCode .= '<script>';\n\t$templateCode .= '$j(function() {';\n\n\n\t$templateCode.=\"});\";\n\t$templateCode.=\"</script>\";\n\t$templateCode .= $lookups;\n\n\t// handle enforced parent values for read-only lookup fields\n\n\t// don't include blank images in lightbox gallery\n\t$templateCode = preg_replace('/blank.gif\" data-lightbox=\".*?\"/', 'blank.gif\"', $templateCode);\n\n\t// don't display empty email links\n\t$templateCode=preg_replace('/<a .*?href=\"mailto:\".*?<\\/a>/', '', $templateCode);\n\n\t/* default field values */\n\t$rdata = $jdata = get_defaults('tb_acompanhamento');\n\tif($selected_id){\n\t\t$jdata = get_joined_record('tb_acompanhamento', $selected_id);\n\t\tif($jdata === false) $jdata = get_defaults('tb_acompanhamento');\n\t\t$rdata = $row;\n\t}\n\t$templateCode .= loadView('tb_acompanhamento-ajax-cache', array('rdata' => $rdata, 'jdata' => $jdata));\n\n\t// hook: tb_acompanhamento_dv\n\tif(function_exists('tb_acompanhamento_dv')){\n\t\t$args=array();\n\t\ttb_acompanhamento_dv(($selected_id ? $selected_id : FALSE), getMemberInfo(), $templateCode, $args);\n\t}\n\n\treturn $templateCode;\n}", "function fDefineSql($pTabla){\n\tglobal $db, $appStatus;\n\t$slSql = \"\";\n\t$slAction = fGetParam('pAction', false);\n \t$olFields = $db->MetaColumns($pTabla);\n \t$slDefs= $_SESSION[$pTabla . '_defs'];\n//\tprint_r($olFields);\n//\tprint_r($_GET);\n\t//print_r($_POST);\n\t//$slTipo = $db->MetaType($olField->type);\n\tswitch ($slAction){\n\t case \"REP\":\n\t\tcase \"ADD\":\n\t\t\t$slValues = \"\";\n\t\t\t$slFields = \"\";\n\t\t\t$il = 0;\n\t\t\t$id =0;\n\t\t\tforeach ($olFields as $k => $olField) {\n\t\t\t\t$slTxt = \" : \" . $olField->type . \" / \" . $slValue . \"\\n\\r\";\n\t\t\t\tfSetAppStat(10, 'I', $slTxt);\n\t\t\t\tif ($slAction == \"ADD\" && ($olField->auto_increment || (($olField->type == 'datestamp' || $olField->type == 'timestamp' ) ))) { /* && !isset($slDefs[$olField->name])*/ \n\t\t\t\t\tcontinue;\n\t\t\t\t} else {\n\t\t\t\t\t//echo \"\\n\\r tipo: \" . $olField->name . \" / \" . $olField->type . \" -- \" . $slTipo .\"\\n\\r\"; print_r($slTipo);\n\t\t\t\t\t//echo $slDefs[$olField->name];\n\t\t\t\t\tif (isset($slDefs[$olField->name])) {\n\t\t\t\t\t\tif (substr($slDefs[$olField->name],0,1) == \"@\") {\n\t\t\t\t\t\t\t$slValue =eval(substr($slDefs[$olField->name],1));\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t$slValue =$slDefs[$olField->name];\n\t\t\t\t\t\t}\n\t\t\t\t\t} else $slValue = fGetParam($olField->name, '@@noDef@');\n\t\t\t\t\t$slTxt = \" : \" . $olField->type . \" / \" . $slValue . \"\\n\\r\";\n\t\t\t\t\tfSetAppStat(10, 'I', $slTxt);\n\t\t\t\t\tif ($slValue !='@@noDef@' ) {\n\t\t\t\t\t $slValue = fParseValue($olField->type, $slValue);\n\t\t\t\t\t $slFields .= ((strlen ($slFields) >0) ? \",\" : \"\") . \" \" . $olField->name;\n\t\t\t\t\t $slValues .= ((strlen ($slValues)>0) ? \",\" : \"\") . $slValue;\n\t\t\t\t\t}\n\t\t\t }\n\t\t\t\t\t//\t\t\t echo $slSql .\"\\n\";\n\t\t\t$il ++;\n\t\t\t}\n\t\t\tif ($il > 0) {\n\t\t\t $slSql = (($slAction ==\"ADD\") ? \" INSERT \" : \" REPLACE \" ) . \" INTO $pTabla (\" . $slFields . \") VALUES (\" . $slValues . \")\" ;\n\t\t\t}\n//echo $slSql .\"\\n\";\n\t\t\tbreak;\n case \"UPD\":\n\t\t\t\t$slValues = \"\";\n\t\t\t\t$il = 0;\n\t\t\t\tforeach ($olFields as $olField){\n\t\t\t\t\t$slValue = fGetParam($olField->name, '@@noDef@');\n\t\t\t\t\tif ($slValue !='@@noDef@' ) {\n\t\t\t\t\t\t\t$slValue = fParseValue($olField->type, $slValue);\n\t\t\t\t\t\t\t$slSql \t .= ((strlen ($slSql) >0) ? \",\" : \"\") . \" \" .\n\t\t\t\t\t\t\t\t\t $olField->name . \" = \" . $slValue ;\n\t\t\t\t\t\t$il ++;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t$slCond = fPrimaryKeyString($olFields,$pTabla);\n\t\t\t\t$slSql = \"UPDATE $pTabla SET \" . $slSql . \" WHERE \" . $slCond ;\n\t\t\t\tbreak;\n case \"DEL\":\n\t\t\t\t$slValues = \"\";\n\t\t\t\t$slCond = fPrimaryKeyString($olFields,$pTabla);\n\t\t\t\t$slSql .= \"DELETE FROM $pTabla WHERE \". $slCond;\n\t\t\t\tbreak;\n\t}\n//echo $slSql. \" :::\";\n\treturn $slSql;\n}", "function crearTablaMigracion() {\n\t\t\t\t\t\t\t$cnx= conectar_postgres();\n\t\t\t\t\t\t\t$cons = \"CREATE TABLE central.usuariosMigracion( usuario character varying(100) , nombre character varying(200), cedula character varying(200), clave character varying(200), cambioclave date, fechaultimoacceso date, fechacaducidad date, super integer , usuariopadre character varying, error text)WITH ( OIDS=FALSE)\";\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$res = @pg_query($cnx, $cons);\n\t\t\t\t\t\t\t\tif (!$res) {\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\techo \"<p class='error1'> Error de ejecucion </p>\".pg_last_error().\"<br>\";\n\t\t\t\t\t\t\t\t\techo \"<p class= 'subtitulo1'>Comando SQL </p> <br>\".$cons.\"<br>\"; \t\t\t\t\n\t\t\t\t\t\t\t\t\techo \"<br><br>\";\t\t\t\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t}", "function Alterar() {\n\n $SQL = \"UPDATE df_dados_familia SET \n IDTIPORISCO='\" . $this->IDTIPORISCO . \"',\n DESCRISCO='\" . $this->DESCRISCO. \"',\n NOMEAREAOCUP='\" . $this->NOMEAREAOCUP . \"',\n DATADESABR='\" . $this->DATADESABR. \"',\n LOCALDESABR='\" . $this->LOCALDESABR . \"',\n MOTIVODESABR='\" . $this->MOTIVODESABR . \"',\n IDCOMUNIDADE='\" . $this->IDCOMUNIDADE . \"',\n NOMECOMUNID='\" . $this->NOMECOMUNID . \"',\n IDBENGOVFED='\" . $this->IDBENGOVFED . \"',\n NOMEOUTROBENEF='\" . $this->NOMEOUTROBENEF . \"',\n VALBENEF='\" . $this->VALBENEF . \"',\n DTINIBENEF='\" . $this->DTINIBENEF . \"',\n IDPROGGOVFED='\" . $this->IDPROGGOVFED . \"',\n NOMEOUTROPROG='\" . $this->NOMEOUTROPROG . \"',\n VALPROG='\" . $this->VALPROG . \"',\n DTINIPROG='\" . $this->DTINIPROG . \"',\n DTAJUDAFINANC='\" . $this->DTAJUDAFINANC . \"',\n VALAJUDAFINANC='\" . $this->VALAJUDAFINANC . \"',\n CPFRESPFAMIL='\" . $this->CPFRESPFAMIL . \"',\n IDDADOSOLICITANTE='\" . $this->IDDADOSOLICITANTE . \"'\n WHERE IDDADOFAMILIA='\" . $this->codigo . \"'\";\n\n //die($SQL);\n\n $con = new gtiConexao();\n $con->gtiConecta();\n $con->gtiExecutaSQL($SQL);\n $con->gtiDesconecta();\n }", "function atualizar_conteudo_elemento_bloco(){\n\n// globals\nglobal $idioma;\n\n// dados de formulario\n$id = remove_html($_REQUEST['id']);\n$tipo_elemento = remove_html($_REQUEST['tipo_elemento']);\n$valor = remove_html($_REQUEST['valor']);\n$nome_usuario = remove_html($_REQUEST['nome_usuario']);\n$data = remove_html($_REQUEST['data']);\n\n// tipo de elemento\nswitch($tipo_elemento){\n\ncase $idioma[73]:\n$tabela = TABELA_COMUNICADO;\n$campo_tabela = \"conteudo='$valor'\";\nbreak;\n\ncase $idioma[74]:\n$tabela = TABELA_TELEFONES_UTEIS;\n$campo_tabela = \"conteudo='$valor'\";\nbreak;\n\ncase $idioma[79]:\n$tabela = TABELA_DIRECAO;\n$campo_tabela = \"conteudo='$valor'\";\nbreak;\n\t\n};\n\n// query\n$query = \"update $tabela set $campo_tabela where id='$id';\";\n\n// comando executa\ncomando_executa($query);\n\n}", "public function _getTableEditCampo($app,$prefix,$idcampo)\n\t{\n\t\t$optionmenu \t\t\t= new stdClass();\n\t\t$optionmenu->title_form = \"Editar Campo Formulario FB\";\n \n $query \t\t\t= 'SELECT * FROM `'.$prefix.'user_form_type` WHERE id ='.$idcampo;\n\t\t$params \t\t= $app['dbs']['mysql_silex']->fetchAssoc($query);\n\t\n\n\t\t$html = '<form id=\"form-params\" class=\"row-fluid \">';\n\t\t$html.= '<input type=\"hidden\" name=\"task\" value=\"edit-campofb\">';\n\t\t$html.= \"<input type='hidden' name='id' value='$idcampo'>\";\n\t\t$html.= '<fieldset>';\n\t\t$html.= '<legend></legend>'; \n $html.= '<div id=\"facebook-admin-box class=\"facebook-admin-box input-prepend \">';\n\t\t\t\t\t$html.= '<span class=\"add-on facebook-admin-title span3\"><strong>Nombre:</strong> </span>';\n\t\t\t\t\t$html.= '<input type=\"text\" class=\"span4 facebook-admin-input\" name=\"name\" value=\"'.$params['name'].'\" />';\n\t\t\t\t\t$html.= '<a class=\"info-param-tooltip\" data-content=\"Nombre\" title=\"\" href=\"#\" data-original-title=\"¿Cómo configurar?\"><i class=\"icon-info-sign\"></i></a>';\n\t\t\t\t\t$html.= '</div>';\n\t\t\t\t\t$html.= '<div id=\"facebook-admin-box class=\"facebook-admin-box input-prepend \">';\n\t\t\t\t\t$html.= '<span class=\"add-on facebook-admin-title span3\"><strong>Label:</strong> </span>';\n\t\t\t\t\t$html.= '<input type=\"text\" class=\"span4 facebook-admin-input\" name=\"label\" value=\"'.$params['label'].'\" />';\n\t\t\t\t\t$html.= '<a class=\"info-param-tooltip\" data-content=\"Label\" title=\"\" href=\"#\" data-original-title=\"¿Cómo configurar?\"><i class=\"icon-info-sign\"></i></a>';\n\t\t\t\t\t$html.= '</div>';\n\t\t$html.= '<legend></legend>';\n\t\t$html.= '<div class=\"controls\"><button type=\"submit\" class=\"btn btn btn-inverse\"><i class=\"icon-ok-sign icon-white\"></i> Guardar</button></div>';\n\t\t$html.= '</fieldset>';\n\t\t$html.= '</form>';\n \n\t\t$optionmenu->form = $html;\n\t\treturn $optionmenu;\n\t}", "public function create_tb_data_sekolah()\n {\n $this->db->query(\"CREATE TABLE `{$this->db->dbprefix}data_sekolah` (\n `id` int(11) NOT NULL AUTO_INCREMENT,\n `nama` varchar(128) NOT NULL,\n `nss` varchar(128) NOT NULL,\n `npsn` varchar(128) NOT NULL,\n `alamat_sekolah` varchar(128) NOT NULL,\n `kode_pos` varchar(128) NOT NULL,\n `telp` varchar(128) NOT NULL,\n `faks` varchar(128) NOT NULL,\n `kecamatan` varchar(128) NOT NULL,\n `kabupaten` varchar(128) NOT NULL,\n `provinsi` varchar(128) NOT NULL,\n `website` varchar(128) NOT NULL,\n `email` varchar(128) NOT NULL,\n PRIMARY KEY (`id`)\n ) ENGINE=InnoDB DEFAULT CHARSET=latin1;\");\n }", "function all() {\n global $genere, $bgcolor1, $bgcolor2, $bgcolor6, $prefix, $dbi, $offset, $min, $id_cons_gen, $perms,$tipo_cons, $tipocons,$do, $dig, $dim, $dia, $dfg, $dfm, $dfa, $help;\n$language=$_SESSION['lang'];\nif (($perms>64)) {\n############# Controllo flag per cancellazione consultazione\n\techo \"<SCRIPT type=\\\"text/javascript\\\">\\n\\n<!--\\n\"\n\t.\"//-->\\n\";\n\techo \"function del_cons() {\\n\";\n\techo \"if (document.consultazione.pwd3.checked==false) {\\n\";\n\techo \"document.consultazione.update.value=\\\"\"._MODIFY.\"\\\" \\n\";\n\techo \"document.consultazione.do.value=\\\"update\\\" \\n\";\n\techo \"}else{\\n\";\n\techo \"document.consultazione.update.value=\\\"\"._DELETE.\"\\\" \\n\";\n\techo \"document.consultazione.do.value=\\\"delete\\\" \\n\";\n\techo \"} \\n\";\t\n\techo \"} \\n\";\n\techo \"</script>\\n\";\n#########################\n\tif (isset($help)) include(\"language/$language/ele_consultazioni.html\");\n\n\tif ($do == \"modify\") {\n\t\t$res = mysql_query(\"SELECT * FROM \".$prefix.\"_ele_consultazione where id_cons_gen='$id_cons_gen'\", $dbi);\n\t\t$pro= mysql_fetch_array($res, 3);\n$res_tipo = mysql_query(\"SELECT * FROM \".$prefix.\"_ele_tipo where tipo_cons='\".$pro['tipo_cons'].\"' and lingua='$language'\", $dbi);\n$tip=mysql_fetch_array($res_tipo, 3);\n\n\t\tlist($dia1,$dim1,$dig1) = explode(\"-\",$pro['data_inizio']==\"0000-00-00\" ? \" - - \": $pro['data_inizio']) ;\n\t\tlist($dfa1,$dfm1,$dfg1) = explode(\"-\",$pro['data_fine']==\"0000-00-00\" ? \" - - \": $pro['data_fine']) ;\n\t\techo \"<form name=\\\"consultazione\\\" method=\\\"post\\\" action=\\\"admin.php\\\" >\"\n\t\t.\"<input type=\\\"hidden\\\" name=\\\"op\\\" value=\\\"consultazione\\\">\"\n\t\t.\"<input type=\\\"hidden\\\" name=\\\"do\\\" value=\\\"update\\\">\"\n\t\t.\"<input type=\\\"hidden\\\" name=\\\"id_cons_gen\\\" value=\\\"\".$pro['id_cons_gen'].\"\\\">\"\n\t\t.\"<table width=\\\"100%\\\"><tr><td>\"._MODIFY.\" \".$pro['descrizione'].\" <br><br>\";\n\t\tswitch ($genere) {\n\t\t\tcase \"0\" : $gencons=_GENCONS0;break;\n\t\t\tcase \"1\" : $gencons=_GENCONS1;break;\n\t\t\tcase \"2\" : $gencons=_GENCONS2;break;\n\t\t\tcase \"3\" : $gencons=_GENCONS3;break;\n\t\t\tcase \"4\" : $gencons=_GENCONS4;break;\n\t\t\tcase \"5\" : if($tip['voto_c'])\n\t\t\t\t\t $gencons=_GENCONS3;\n\t\t\t\t else\n\t\t\t\t\t $gencons=_GENCONS5;\n\t\t\t\t break;\n\t\tdefault :$gencons=\"\";\n\t\t}\n\t\techo \"</td></tr><tr><td>\"._TIPO.\"</td><td>$gencons</td></tr>\";\n\t\techo \"<tr bgcolor=\\\"$bgcolor2\\\"><td>\"._DESCR. \"</td><td><input name=\\\"descr_cons2\\\" value=\\\"\".$pro['descrizione'].\"\\\" size=\\\"15\\\"></td></tr>\";\n\t\techo \"<tr><td>\"._DATAIN.\" :</td><td>\";\n\t\techo \"<select name=\\\"dig\\\" >\";\n\t\techo \"<option value=\\\"$dig1\\\" selected>$dig1</option>\";giorno(0,0);\n\t\techo \"<select name=\\\"dim\\\" >\";\n\t\techo \"<option value= \\\"$dim1\\\" selected>$dim1</option>\"; mese();\n\t\techo \"<select name= \\\"dia\\\" >\";\n\t\techo \"<option value=\\\"$dia1\\\" selected>$dia1</option>\"; anno();\n\t\techo \"</td></tr>\";\n\t\techo \"<tr><td>\"._DATAFINE.\" :</td><td>\";\n\t\techo \"<select name=\\\"dfg\\\" >\";\n\t\techo \"<option value=\\\"$dfg1\\\" selected>$dfg1</option>\";giorno(0,0);\n\t\techo \"<select name= \\\"dfm\\\" >\";\n\t\techo \"<option value= \\\"$dfm1\\\" selected>$dfm1</option>\"; mese();\n\t\techo \"<select name= \\\"dfa\\\" >\";\n\t\techo \"<option value=\\\"$dfa1\\\" selected>$dfa1</option>\"; anno();\n\t\techo \"</td></tr><tr>\";\n\t\t$resdel = mysql_query(\"SELECT * FROM \".$prefix.\"_ele_cons_comune where id_cons_gen='$id_cons_gen'\", $dbi);\n\t\tif(mysql_num_rows($resdel)==0)\n\t\t\techo \"<td><fieldset><legend>Abilita la cancellazione</legend><label id=\\\"prov\\\">\"._SPUNTAELIMINA.\" <input type=\\\"checkbox\\\" name=\\\"pwd3\\\" value=\\\"\\\" onchange=\\\"del_cons()\\\"></label></fieldset></td>\";\n\t\telse echo \"<td></td>\";\n\t\techo \"<td><input type=\\\"submit\\\" name=\\\"update\\\" value=\\\"\"._MODIFY.\"\\\">\"\n\t\t.\"</td></tr></table></form>\";\n\t} else {\n\t\techo \"<form name=\\\"consultazione\\\" action=\\\"admin.php\\\">\"\n\t\t.\"<input type=\\\"hidden\\\" name=\\\"op\\\" value=\\\"consultazione\\\">\"\n\t\t.\"<input type=\\\"hidden\\\" name=\\\"do\\\" value=\\\"add\\\">\"\n\t\t.\"<input type=\\\"hidden\\\" name=\\\"id_cons_gen\\\" value=\\\"$id_cons_gen\\\">\"\n\t\t.\"<hr><h6>\"\n\t\t._ADD.\" \"._CONSULTA.\"<br><br>\";\n\t\techo _DEFCONS.\":</h6><br><table width=\\\"100%\\\">\";\n\n\t\t$res=mysql_query(\"SELECT * FROM \".$prefix.\"_ele_tipo where lingua='$language'\", $dbi);\n\t\techo \"<tr><td><b>\"._TIPO.\" :</b></td><td>\";\n\t\techo \"<select name=\\\"tipocons\\\" >\";\n\t\twhile(list($idtipo,$destipo)= mysql_fetch_row($res)){\n\t\t\tif ($idtipo == $tipo_cons) {\n\t\t\t\t$sel = \"selected\";\n\t\t\t\t} else {\n\t\t\t\t$sel = \"\";\n\t\t\t\t}\n\t\t\n\t\t\techo \"<option value=\\\"$idtipo\\\" $sel>$destipo\";\n\t\t}\n\t\techo \"</select>\";\n\t\techo \"<tr><td><b>\"._DESCR. \"</b></td><td><input type=\\\"text\\\" name=\\\"descr_cons2\\\" maxlength=\\\"100\\\"></td></tr>\"\n\t\t.\"<tr><td><b>\"._DATAIN. \"</b></td><td>\";\n\t\techo \"<select name= \\\"dig\\\" ><option value=\\\"$dig\\\" selected>$dig</option>\"; giorno(0,0);\n\t\techo \"<select name= \\\"dim\\\" ><option value=\\\"$dim\\\" selected>$dim</option>\"; mese();\n\t\techo \"<select name= \\\"dia\\\" ><option value=\\\"$dia\\\" selected>$dia</option>\"; anno() ;\n\t\techo \"</td></tr>\"\n\t\n\t\t.\"<tr><td><b>\"._DATAFINE. \"</b></td><td>\";\n\t\techo \"<select name= \\\"dfg\\\" ><option value=\\\"$dfg\\\" selected>$dfg</option>\"; giorno(0,0);\n\t\techo \"<select name= \\\"dfm\\\" ><option value=\\\"$dfm\\\" selected>$dfm</option>\"; mese();\n\t\techo \"<select name= \\\"dfa\\\" ><option value=\\\"$dfa\\\" selected>$dfa</option>\"; anno() ;\n\t\techo \"</td></tr>\"\n\t\t.\"</table>\"\n\t\t.\"<input type=\\\"submit\\\" name=\\\"add\\\" value=\\\"\"._ADD.\"\\\">\"\n\t\t.\"</form>\";\n\t}\n\techo \"<center><font class=\\\"title\\\"><b>\"._MODIFY.\" \"._CONSULTA.\"</b></font><br><br><table border=\\\"0\\\" width=\\\"100%\\\">\"\n\t.\"<tr><td bgcolor=\\\"$bgcolor1\\\" align=\\\"center\\\">&nbsp;<b>\"._DESCR.\"</b>&nbsp;</td>\"\n\t.\"<td bgcolor=\\\"$bgcolor1\\\" align=\\\"center\\\">&nbsp;<b>\"._DATAIN.\"</b>&nbsp;</td>\"\n\t.\"<td bgcolor=\\\"$bgcolor1\\\" align=\\\"center\\\"><b>\"._DATAFINE.\"</b></td>\"\n\t.\"<td bgcolor=\\\"$bgcolor1\\\" align=\\\"center\\\"><b>\"._FUNZIONI.\"</b></td></tr>\";\n\t$res = mysql_query(\"SELECT * FROM \".$prefix.\"_ele_consultazione \" , $dbi);\n\t$max = mysql_num_rows($res);\n\t$result = mysql_query(\"select * from \".$prefix.\"_ele_consultazione ORDER BY data_fine desc LIMIT $min,$offset\", $dbi);\n\twhile(list($id, $descr_cons, $data_inizio, $data_fine,$tipo) = mysql_fetch_row($result)) {\n\t\t$data_inizio=form_data($data_inizio);$data_fine=form_data($data_fine);\n\t\t$bgcolor1=($bgcolor1==$_SESSION['bgcolor1'])?$_SESSION['bgcolor2']:$_SESSION['bgcolor1'];\n\t\techo \"<tr ><td bgcolor=\\\"$bgcolor1\\\" align=\\\"left\\\" ><a href=\\\"admin.php?op=ele&amp;id_cons_gen=$id\\\"><b>$descr_cons</b></a>\"\n\t\t.\"</td><td align=\\\"center\\\" >$data_inizio</td>\"\n\t\t.\"<td align=\\\"center\\\">$data_fine\"\n\t\t.\"</td><td align=\\\"center\\\" nowrap bgcolor=\\\"$bgcolor1\\\">[<a\n\t\thref=\\\"admin.php?op=consultazione&amp;do=modify&amp;id_cons_gen=$id\\\"><img src=\\\"modules/Elezioni/images/edit.gif\\\"\n\t\tborder=\\\"0\\\" align=\\\"middle\\\" alt=\\\"Edit\\\"> \"._EDIT.\"</a>]\"\n\t\t.\"</td></tr>\";\n\t}\n\techo \"</table></center>\";\n#'Pagina precedente' e 'Pagina Successiva'\n\techo\"<table align=\\\"center\\\" width=\\\"100%\\\" bgcolor=\\\"$bgcolor1\\\"><tr>\";\n\t$prev=$min-$offset;\n\tif ($prev>=0) {\n\t\techo \"<td colspan=\\\"5\\\" align=\\\"center\\\" bgcolor=\\\"$bgcolor2\\\"><a href=\\\"admin.php?op=consultazione&amp;id_cons_gen=$id_cons_gen&amp;min=$prev\\\">\";\n\t\techo \"<b>$offset \"._PREV_MATCH.\"</b></a></td>\";\n\t}\n\t$next=$min+$offset;\n\tif ($next>=($offset-1)) {\n\t\tif($next>=$max) $next = $max;\n\t\telse {\n\t\techo \"<td colspan=\\\"5\\\" align=\\\"center\\\" bgcolor=\\\"$bgcolor2\\\"><a href=\\\"admin.php?op=consultazione&amp;id_cons_gen=$id_cons_gen&amp;min=$next\\\">\";\n\t\techo \"<b>$offset \"._NEXT_MATCH.\"</b></a></td>\";\n\t\t}\n\t}\n\techo \"</tr></table><br>\";\n}\n}", "public function show_table(){\r\n\t\t\t\r\n\t\t\t//CONTROLE DE ACESSO ACOES\r\n\t\t\trequire_once '../../models/tb_modulos.php';\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t$co_papel = $_SESSION['codigoPapel'];\r\n\t\t\t$modulos = new tb_modulos(CONEXAOERP);\r\n\t\t\t$acoes = $modulos->possuiPermissaoParaEstaArea($co_papel, PCP, PCP_MOTIVO_PERDA);\r\n\t\t\t\r\n\t\t\t//FIM CONTROLE DE ACESSO\r\n\t\t\t\r\n\t\t\t//Guarda o conte�do tempor�rio da tabela\r\n\t\t\t$s_html = '';\r\n\t\t\t\r\n\t\t\t//Retorna o array com as labels do cabe�alho da tabela\r\n\t\t\t$a_th = $this->thead();\r\n\t\t\t\r\n\t\t\t//Retorna o array com os campos que ir�o preencher as celulas da table\r\n\t\t\t$a_cells = $this->cells();\r\n\t\t\t\r\n\t\t\t//Faz os ajustes na p�gina, para definir a n�mero inicial de registros\r\n\t\t\tif($this->i_page != 1){\r\n\t\t\t\t$n = ($this->i_page - 1) * $this->i_rowsperpage;\r\n\t\t\t}else{\r\n\t\t\t\t$n = 0;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t//Formula a query\r\n\t\t\t$sql = '\r\n\t\t\t\tSELECT '.$this->s_fields.' \r\n\t\t\t\tFROM '.$this->s_table.' \r\n\t\t\t\tWHERE '.$this->s_where.'\r\n\t\t\t\tORDER BY '.$this->s_orderby.' '.$this->s_orientation.'\r\n\t\t\t\tLIMIT '.$n.','.$this->i_rowsperpage;\r\n\t\t\t\t\r\n\t\t\t$sth = $this->dbh->prepare($sql);\r\n\t\t\t$sth->execute();\r\n\t\t\t\r\n\t\t\t$s_html .= '<script type=\"text/javascript\" src=\"js/pcp/motivo_perda.js\"></script>\r\n\t\t\t\t\t\t<div id=\"confirmaExcluirMotivoPerda\"><p>Deseja realmente excluir esse registro?</p></div>\r\n\t\t\t\t\t\t<div id=\"formularioAlterarMotivoPerda\"></div>';\r\n\t\t\t\r\n\t\t\t//Cria o cabe�alho da tabela\r\n\t\t\t$s_html .= '<table width=\"1003\" border=\"0\" cellpadding=\"3\" cellspacing=\"2\" class=\"LISTA\"><thead><tr>';\r\n\t\t\t\r\n\t\t\tfor($i = 1; $i <= $a_th[0]; $i++){\r\n\t\t\t\t\r\n\t\t\t\tif($this->cols_width != null){\r\n\t\t\t\t\t$s_html .= '<th align=\"left\" width=\"'.$this->cols_width[$i].'\">'.$a_th[$i].'</th>';\t\t\t\t\t\r\n\t\t\t\t}else{\r\n\t\t\t\t\t$s_html .= '<th>'.$a_th[$i].'</th>';\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t$s_html .= '<th align=\"center\" width=\"60\">Ações</th>';\r\n\t\t\t\r\n\t\t\t$s_html .= '</tr></thead><tbody>';\r\n\t\t\t\r\n\t\t\t//Se n�o forem inseridas colunas manualmente, ent�o apenas mostra os resultados do banco\r\n\t\t\tif($this->a_columns == null){\r\n\t\t\t\t\r\n\t\t\t\t//Cria o corpo da tabela\r\n\t\t\t\twhile($row = $sth->fetch(PDO::FETCH_NUM)){\r\n\t\t\t\t\t\r\n\t\t\t\t\t$s_html .= '<tr>';\r\n\t\t\t\t\t\r\n\t\t\t\t\tfor($i = 0; $i < $a_cells[0]; $i++){\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tif($i == 1){\r\n\t\t\t\t\t\t\tlist ($dia, $mes, $ano, $hora, $min, $seg) = split ('[-. .:]', utf8_encode($row[$i]));\r\n\t\t\t\t\t\t\t$dataCadastro = $ano.\"-\".$mes.\"-\".$dia.\" \".$hora.\":\".$min.\":\".$seg;\r\n\t\t\t\t\t\t\t$s_html .= '<td>'.$dataCadastro.'</td>';\r\n\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\t$s_html .= '<td>'.utf8_encode($row[$i]).'</td>';\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\t$s_html .= '<td align=\"center\">';\r\n\t\t\t\t\tif($acoes['FL_EXCLUIR']==1){\r\n\t\t\t\t\t$s_html .= '<a title=\"Excluir\" href=\"#\" name=\"excluirMotivoPerda\" id=\"'.$row[0].'\"><img src=\"img/btn/btn_excluir.gif\" width=\"25\" height=\"19\" border=\"0\"/></a>';\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif($acoes['FL_EDITAR']==1){\r\n\t\t\t\t\t$s_html .= '<a title=\"Editar\" href=\"#\" name=\"alterarMotivoPerda\" id=\"'.$row[0].'\"><img src=\"img/btn/btn_editar.gif\" width=\"25\" height=\"19\" border=\"0\"/></a>';\r\n\t\t\t\t\t}\r\n\t\t\t\t\t$s_html .= '</td>';\r\n\t\t\t\t\t\r\n\t\t\t\t\t$s_html .= '</tr>';\r\n\t\t\t\t\r\n\t\t\t\t}\r\n\t\t\t\r\n\t\t\t//Caso contr�rio prepara o array(grid) com os valores inseridos manualmente\r\n\t\t\t}else{\r\n\t\t\t\t\r\n\t\t\t\t//Matriz com todos os resultados da tabela\r\n\t\t\t\t$grid = $sth->fetchAll(PDO::FETCH_NUM);\r\n\t\t\t\t\r\n\t\t\t\t//N�mero de linhas retornadas\r\n\t\t\t\t$c = $sth->rowCount();\r\n\t\t\t\t\r\n\t\t\t\t//Insere dentro do grid, no �ndice informado, as colunas que foram inseridas manualmente\r\n\t\t\t\tfor($i = 0; $i < $c; $i++){\r\n\t\t\t\t\t\r\n\t\t\t\t\tforeach($this->a_columns as $column){\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tarray_splice($grid[$i], $column['index'], 0, str_replace('$?', $i, $column['content']));\r\n\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t//Prepara a string com o html que ser� impresso em tela\r\n\t\t\t\tfor($i = 0; $i < $c; $i++){\r\n\t\t\t\t\t\r\n\t\t\t\t\t$s_html .='<tr>';\r\n\t\t\t\t\t\r\n\t\t\t\t\tforeach($grid[$i] as $value){\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t$s_html .='<td>'.utf8_encode($value).'</td>';\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\t$s_html .='</tr>';\r\n\t\t\t\t\r\n\t\t\t\t}\r\n\t\t\t\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t$s_html .= '</tbody></table>';\r\n\t\t\t\r\n\t\t\techo($s_html);\r\n\t\t\t\r\n\t\t}", "public function tablebiopeixeAction() {\n //IMPORTANTE TER!!\n $this->_helper->layout->disableLayout();\n\n $idEntrevista = $this->_getParam('id');\n $entrevista = $this->modelArrastoFundo->find($idEntrevista);\n $this->view->assign(\"entrevista\", $entrevista);\n $vBioPeixe = $this->modelArrastoFundo->selectVBioPeixe('taf_id=' . $idEntrevista, 'tafbp_id');\n\n $this->view->assign('vBioPeixe', $vBioPeixe);\n }" ]
[ "0.6427772", "0.6393667", "0.6361624", "0.6329364", "0.62906384", "0.62707347", "0.62026465", "0.6158088", "0.61541146", "0.6151189", "0.6148348", "0.6147819", "0.614243", "0.6140365", "0.6136725", "0.61313754", "0.6123657", "0.6122537", "0.6120768", "0.6110658", "0.61083716", "0.6072335", "0.60618865", "0.6043824", "0.60421544", "0.6035358", "0.6034078", "0.6027794", "0.60177875", "0.60095334" ]
0.70018774
0
Build the manifest and write it to disk.
public function build() { $this->manifest = $composer = []; $srcPath = $this->app()->getSrcPath(); $namespace = $this->app()->getRootNamespace(); foreach (Filesystem::scanFiles($srcPath) as $file) { $class = str_replace([$srcPath, '.php', '/'], [$namespace, '', '\\'], $file); if (!class_exists($class) || !is_subclass_of($class, Component::class)) { continue; } $reflect = new ReflectionClass($class); if ($reflect->isInstantiable() && $reflect->hasMethod('register')) { $this->manifest[] = $class; } } $this->write($this->manifest); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function generate()\n {\n $fileResource = fopen($this->manifestPath, 'a');\n $line = $this->relativeDirPath . DIRECTORY_SEPARATOR;\n fwrite($fileResource, $line . PHP_EOL);\n $this->generateSuiteEntries($fileResource);\n fclose($fileResource);\n }", "public function build($cwd, $manifestPath);", "function createManifest($dir){\r\n $manifestJson = './manifest.json';\r\n \r\n if(file_exists($manifestJson)){\r\n unlink($manifestJson);\r\n }\r\n\r\n $files = scandir($dir, 1); \r\n $length = sizeof($files);\r\n unset($files[$length-1]);\r\n unset($files[$length-2]); \r\n \r\n $manifest = array();\r\n\r\n foreach ($files as $name){\r\n $f = $dir.'/'.$name;\r\n $manifest[$name]=sha1(file_get_contents($f));\r\n };\r\n\t \r\n $fo = fopen($manifestJson, 'w') or die(\"can't open file\");\r\n fwrite($fo, json_encode($manifest,TRUE));\r\n }", "public function build()\n {\n $packages = [];\n\n if ($this->files->exists($path = $this->vendorPath.'/composer/installed.json')) {\n $installed = json_decode($this->files->get($path), true);\n\n $packages = $installed['packages'] ?? $installed;\n }\n\n $ignoreAll = in_array('*', $ignore = $this->packagesToIgnore());\n\n $this->write(collect($packages)->mapWithKeys(function ($package) {\n return [$this->format($package['name']) => $package['extra']['laravel'] ?? []];\n })->each(function ($configuration) use (&$ignore) {\n $ignore = array_merge($ignore, $configuration['dont-discover'] ?? []);\n })->reject(function ($configuration, $package) use ($ignore, $ignoreAll) {\n return $ignoreAll || in_array($package, $ignore);\n })->filter()->all());\n }", "public function save() {\n $this->manifest->save();\n }", "public function writeManifest($manifest)\n {\n $path = $this->manifestPath . '/services.json';\n $this->files->put($path, json_encode($manifest));\n return $manifest;\n }", "protected function write(array $manifest)\n {\n $manifestPath = app()->bootstrapPath().'/cache/qscmf-packages.php';\n if (! is_writable(dirname($manifestPath))) {\n throw new Exception('The '.dirname($manifestPath).' directory must be present and writable.');\n }\n\n $this->files->replace(\n $manifestPath, '<?php return '.var_export($manifest, true).';'\n );\n }", "public function getManifest()\n {\n if (!is_null($this->manifest)) {\n return $this->manifest;\n }\n\n if (!file_exists($this->manifestPath)) {\n $this->build();\n }\n\n return $this->manifest = require $this->manifestPath;\n }", "private function updraftplus_include_manifest($whichone) {\n\t\tglobal $updraftplus;\n\n\t\t$manifest_name = \"updraftplus-manifest.json\";\n\t\t$manifest = trailingslashit($this->updraft_dir).$manifest_name;\n\n\t\t$updraftplus->log(sprintf(\"Creating file manifest ($manifest_name) for incremental backup (included: %d, skipped: %d)\", count($this->zipfiles_batched), count($this->zipfiles_skipped_notaltered)));\n\t\t\n\t\tif (false === ($handle = fopen($manifest, 'w+'))) return $updraftplus->log(\"Failed to open manifest file ($manifest_name)\");\n\n\t\t$this->manifest_path = $manifest;\n\n\t\t$version = 1;\n\t\t\n\t\t$go_to_levels = array(\n\t\t\t'plugins' => 2,\n\t\t\t'themes' => 2,\n\t\t\t'uploads' => 3,\n\t\t\t'others' => 3\n\t\t);\n\n\t\t$go_to_levels = apply_filters('updraftplus_manifest_go_to_level', $go_to_levels, $whichone);\n\n\t\t$go_to_level = isset($go_to_levels[$whichone]) ? $go_to_levels[$whichone] : 'all';\n\n\t\t$directory = '';\n\n\t\tif ('more' == $whichone) {\n\t\t\tforeach ($this->zipfiles_batched as $index => $dir) {\n\t\t\t\t$directory = '\"directory\":\"' . dirname($index) . '\",';\n\t\t\t}\n\t\t}\n\n\t\tif (false === fwrite($handle, '{\"version\":'.$version.',\"type\":\"'.$whichone.'\",'.$directory.'\"listed_levels\":\"'.$go_to_level.'\",\"contents\":{\"directories\":[')) $updraftplus->log(\"First write to manifest file failed ($manifest_name)\");\n\n\t\t// First loop: find out which is the last entry, so that we don't write the comma after it\n\t\t$last_dir_index = false;\n\t\tforeach ($this->zipfiles_dirbatched as $index => $dir) {\n\t\t\tif ('all' !== $go_to_level && substr_count($dir, '/') > $go_to_level - 1) continue;\n\t\t\t$last_dir_index = $index;\n\t\t}\n\t\t\n\t\t// Second loop: write out the entry\n\t\tforeach ($this->zipfiles_dirbatched as $index => $dir) {\n\t\t\tif ('all' !== $go_to_level && substr_count($dir, '/') > $go_to_level - 1) continue;\n\t\t\tfwrite($handle, json_encode($dir).(($index != $last_dir_index) ? ',' : ''));\n\t\t}\n\t\t\n\t\t// Now do the same for files\n\t\tfwrite($handle, '],\"files\":[');\n\t\t\n\t\t$last_file_index = false;\n\t\tforeach ($this->zipfiles_batched as $store_as) {\n\t\t\tif ('all' !== $go_to_level && substr_count($store_as, '/') > $go_to_level - 1) continue;\n\t\t\t$last_file_index = $store_as;\n\t\t}\n\t\tforeach ($this->zipfiles_skipped_notaltered as $store_as) {\n\t\t\tif ('all' !== $go_to_level && substr_count($store_as, '/') > $go_to_level - 1) continue;\n\t\t\t$last_file_index = $store_as;\n\t\t}\n\n\t\tforeach ($this->zipfiles_batched as $store_as) {\n\t\t\tif ('all' !== $go_to_level && substr_count($store_as, '/') > $go_to_level - 1) continue;\n\t\t\tfwrite($handle, json_encode($store_as).(($store_as != $last_file_index) ? ',' : ''));\n\t\t}\n\n\t\tforeach ($this->zipfiles_skipped_notaltered as $store_as) {\n\t\t\tif ('all' !== $go_to_level && substr_count($store_as, '/') > $go_to_level - 1) continue;\n\t\t\tfwrite($handle, json_encode($store_as).(($store_as != $last_file_index) ? ',' : ''));\n\t\t}\n\n\t\tfwrite($handle, ']}}');\n\t\tfclose($handle);\n\n\t\t$this->zipfiles_batched[$manifest] = $manifest_name;\n\t\t\n\t\t$updraftplus->log(\"Successfully created file manifest (size: \".filesize($manifest).\")\");\n\t\t\n\t\treturn true;\n\t}", "public function testCreateManifest()\n {\n $bag = Bag::create($this->tmpdir);\n $manifests = $bag->getPayloadManifests();\n $this->assertArrayHasKey('sha512', $manifests);\n $manifest = $manifests['sha512'];\n $this->assertEquals(\"manifest-sha512.txt\", $manifest->getFilename());\n $this->assertEquals('sha512', $manifest->getAlgorithm());\n }", "protected function write(array $manifest)\n {\n if (!is_writable(dirname($this->manifestPath))) {\n throw new Exception('The ' . dirname($this->manifestPath) . ' directory must be present and writable.');\n }\n\n file_put_contents($this->manifestPath, '<?php return ' . var_export($manifest, true) . ';');\n }", "private function prepareManifest($manifest_filename)\n {\n $this->tmpdir = $this->prepareBasicTestBag();\n file_put_contents(\n $this->tmpdir . DIRECTORY_SEPARATOR . 'manifest-sha256.txt',\n file_get_contents(self::TEST_MANIFEST_DIR . DIRECTORY_SEPARATOR .\n $manifest_filename)\n );\n }", "private function buildUniqueFile($file)\n {\n // be sure the folder public/build is exist\n $dir = public_path('build');\n if (!file_exists($dir)) {\n if (!make_dir($dir, 0755)) { // @codeCoverageIgnore\n throw new RuntimeException('Unable to create directory ' . $dir); // @codeCoverageIgnore\n } // @codeCoverageIgnore\n }\n\n // be sure the manifest path is exist\n $dir = dirname($this->manifestFile);\n if (!file_exists($dir)) {\n if (!make_dir($dir, 0755)) {\n throw new RuntimeException('Unable to create directory ' . $dir); // @codeCoverageIgnore\n }\n }\n\n // generate unique file\n $ext = pathinfo($file, PATHINFO_EXTENSION);\n $uniqueFile = 'build/' . basename($file, '.' . $ext) . '-' . uniqid() . '.' . $ext;\n copy(public_path($file), public_path($uniqueFile));\n\n // update manifest\n $oldFile = isset($this->manifest[$file]) ? public_path($this->manifest[$file]) : null;\n $this->manifest[$file] = $uniqueFile;\n if (file_put_contents($this->manifestFile, '<?php return ' . var_export($this->manifest, true) . ';' . PHP_EOL, LOCK_EX) === false) {\n throw new RuntimeException(sprintf('Asset Manager was not able to save manifest file \"%s\"', $this->manifestFile)); // @codeCoverageIgnore\n }\n\n // delete old unique file\n if ($oldFile !== null && file_exists($oldFile)) {\n unlink($oldFile);\n }\n }", "public function build()\n {\n if (!$this->module) {\n throw new \\Exception(\"Module not set for builder\");\n }\n foreach ($this->sourceConfig->getConfig('file') as $fileConfig){\n $fileConfig = $this->preProcessFileConfig($fileConfig);\n $scope = $fileConfig['scope'];\n $type = $fileConfig['type'];\n $generator = $this->getGenerator($scope.'.'.$type);\n $files = $generator\n ->setConfig($fileConfig)\n ->setModule($this->module)\n ->generate();\n foreach ($files as $name => $content) {\n $this->files[$name] = $content;\n }\n }\n $basePath = $this->module->getSettings()->getXmlRootPath().'/'.\n $this->module->getNamespace().'/'.\n $this->module->getModuleName().'/';\n $this->writer->setPath($basePath);\n foreach ($this->files as $name => $file) {\n $destinationFile = $name;\n $this->writer->write($destinationFile, $file);\n }\n //wrap it up\n $this->createArchive();\n //clean it up\n $this->cleanup();\n //write the list of files\n $this->writeLog();\n $this->writeUninstall();\n return $this;\n }", "protected function write(array $manifest)\n {\n if (! is_writable($dirname = dirname($this->manifestPath))) {\n throw new Exception(\"The {$dirname} directory must be present and writable.\");\n }\n\n $this->files->replace(\n $this->manifestPath, '<?php return '.var_export($manifest, true).';'\n );\n }", "public function save()\n {\n $this->zip->addFromString($this->packageDir.$this->packageFile, $this->packageXPath->document->saveXML());\n // close and reopen zip archive\n $this->zip->close();\n $this->zip->open($this->filename);\n\n $this->sync();\n }", "public function generate()\n {\n if (!count($this->builds)) {\n throw new ApplicationException(\n 'No builds have been added to the manifest.'\n );\n }\n\n $json = [\n 'manifest' => [],\n ];\n\n foreach ($this->builds as $build => $details) {\n $json['manifest'][] = [\n 'build' => $build,\n 'modules' => $details['modules'],\n 'files' => $details['files'],\n ];\n }\n\n return json_encode($json, JSON_PRETTY_PRINT);\n }", "public function generateAndroidManifest()\n {\n\n //// Android Pinicon Manifest\n\n $pinicon = $this->owner->AndroidPinicon();\n\n if ($pinicon->exists()) {\n\n //\n $manifest = new stdClass();\n\n //\n $manifest->name = $this->owner->PiniconTitle;\n//\t\t\t$manifest->start_url = null; @todo Maybe implement\n//\t\t\t$manifest->display = null; @todo Maybe implement\n//\t\t\t$manifest->orientation = null; @todo Maybe implement\n $manifest->icons = array();\n\n // 0.75x density icon\n array_push($manifest->icons, array(\n 'src' => $pinicon->Fill(36, 36)->getAbsoluteURL(),\n 'sizes' => '36x36',\n 'type' => 'image/png',\n 'density' => 0.75\n ));\n\n // 1x density icon\n array_push($manifest->icons, array(\n 'src' => $pinicon->Fill(48, 48)->getAbsoluteURL(),\n 'sizes' => '48x48',\n 'type' => 'image/png',\n 'density' => 1\n ));\n\n // 1.5x density icon\n array_push($manifest->icons, array(\n 'src' => $pinicon->Fill(72, 72)->getAbsoluteURL(),\n 'sizes' => '72x72',\n 'type' => 'image/png',\n 'density' => 1.5\n ));\n\n // 2x density icon\n array_push($manifest->icons, array(\n 'src' => $pinicon->Fill(96, 96)->getAbsoluteURL(),\n 'sizes' => '96x96',\n 'type' => 'image/png',\n 'density' => 2\n ));\n\n // 3x density icon\n array_push($manifest->icons, array(\n 'src' => $pinicon->Fill(144, 144)->getAbsoluteURL(),\n 'sizes' => '144x144',\n 'type' => 'image/png',\n 'density' => 3\n ));\n\n // 4x density icon\n array_push($manifest->icons, array(\n 'src' => $pinicon->Fill(192, 192)->getAbsoluteURL(),\n 'sizes' => '192x192',\n 'type' => 'image/png',\n 'density' => 4\n ));\n\n // create file\n $bytes = file_put_contents(Director::baseFolder() . '/manifest.json', json_encode($manifest));\n\n //\n if ($bytes !== false) {\n // success\n return true;\n }\n\n }\n\n // default return\n return false;\n\n }", "protected abstract function buildArchive();", "public function generate()\n {\n $this->createDirectory();\n $this->formatFile();\n }", "private function newArchive()\n {\n $dir = FileSystemTool::mkTmpDir();\n\n\n// FileSystemTool::mkdir($dir);\n\n\n //--------------------------------------------\n // BASIC FILES\n //--------------------------------------------\n $boilerplateDir = __DIR__ . \"/../assets/light-app-boilerplate\";\n $otherFiles = [\n \"config/services/_zzz.byml\",\n \"universe/bigbang.php\",\n \"www/index.php\",\n \"www/.htaccess\",\n ];\n foreach ($otherFiles as $rpath) {\n $file = $boilerplateDir . \"/$rpath\";\n $dst = $dir . \"/$rpath\";\n FileSystemTool::copyFile($file, $dst);\n }\n\n\n //--------------------------------------------\n // PLANETS\n //--------------------------------------------\n $uniDir = $this->uniDir;\n $deps = $this->getBoilerplateDependencies();\n\n\n if ($deps) {\n\n $nbDeps = count($deps);\n\n $c = 1;\n foreach ($deps as $pDotName) {\n\n $pSlashName = PlanetTool::getPlanetSlashNameByDotName($pDotName);\n $planetDir = $uniDir . \"/\" . $pSlashName;\n $sizeHuman = ConvertTool::convertBytes(FileSystemTool::getDirectorySize($planetDir), 'h');\n\n\n $this->msg(\"Processing planet $pDotName ($c/$nbDeps) ($sizeHuman)\" . PHP_EOL);\n flush();\n\n\n if (true === is_dir($planetDir)) {\n PlanetTool::importPlanetByExternalDir($pDotName, $planetDir, $dir, [\n \"assets\" => true,\n ]);\n } else {\n throw new LingTalfiException(\"Planet dir not found: $planetDir.\");\n }\n $c++;\n }\n }\n\n\n //--------------------------------------------\n // CREATE ZIP ARCHIVE\n //--------------------------------------------\n\n $this->msg(\"Creating zip archive...\" . PHP_EOL);\n flush();\n\n\n $zipFile = $dir . \".zip\";\n ZipTool::zip($dir, $zipFile, [\n \"ignoreName\" => [\n \".git\",\n \".gitignore\",\n ]\n ]);\n FileSystemTool::remove($dir);\n\n\n $zipFileDst = $uniDir . \"/Ling/Light_AppBoilerplate/assets/light-app-boilerplate.zip\";\n $this->msg(\"moving zip file to $zipFileDst.\" . PHP_EOL);\n FileSystemTool::move($zipFile, $zipFileDst);\n\n }", "public static function Build()\n {\n global $zbp;\n foreach (self::$Ready as $m) {\n if (isset($zbp->modulesbyfilename[$m])) {\n $zbp->modulesbyfilename[$m]->Build();\n $zbp->modulesbyfilename[$m]->Save();\n }\n }\n }", "private function flushJobManifest(Manifest $manifestContent, array $results)\n {\n $manifestFileBasename = static::MANIFEST_FILE_NAME;\n $imsManifestXml = new DOMDocument(\"1.0\", \"UTF-8\");\n $imsManifestXml->formatOutput = true;\n $element = $imsManifestXml->createElement(\"manifest\");\n $element->setAttribute(\"identifier\", $manifestContent->getIdentifier());\n $imsManifestXml->appendChild($element);\n\n $manifestMetaData = $this->addManifestMetadata($manifestContent, $imsManifestXml);\n $element->appendChild($manifestMetaData);\n\n $organization = $this->addOrganizationInfoInManifest($manifestContent, $imsManifestXml);\n $element->appendChild($organization);\n\n $resourceInfo = $this->addResourceInfoInManifest($manifestContent, $imsManifestXml, $results);\n $element->appendChild($resourceInfo);\n\n $this->decorateImsManifestRootElement($element);\n $xml = $imsManifestXml->saveXML();\n $outputFilePath = realpath($this->outputPath) . '/' . $this->rawPath . '/';\n file_put_contents($outputFilePath . '/' . $manifestFileBasename, $xml);\n }", "protected function getManifest()\n {\n if (! is_null($this->manifest)) {\n return $this->manifest;\n }\n\n if (! is_file($this->manifestPath)) {\n $this->build();\n }\n\n return $this->manifest = is_file($this->manifestPath) ?\n $this->files->getRequire($this->manifestPath) : [];\n }", "public function package() {\n\t\t// have to know what version this is to build it.\n\t\t$version = $this->getVersion();\n\t\tif (!$version) {\n\t\t\tthrow new UnexpectedValueException(\"Invalid Elgg version '$version'.\");\n\t\t}\n\n\t\t$scripts_dir = elgg_get_plugin_setting('elgg_scripts_path', 'elgg_releases');\n\t\t$output_dir = elgg_get_plugin_setting('build_output_dir', 'elgg_releases');\n\t\t$cmd = \"{$scripts_dir}build/build.sh $version $version $output_dir\";\n\n\t\t$cmd_output = $cmd_return = null;\n\n\t\texec($cmd, $cmd_output, $cmd_return);\n\t\t\n\t\tif ($cmd_return === 0) {\n\t\t\t// save the path\n\t\t\t$this->setFilename(\"elgg-$version.zip\");\n\t\t\t$this->package_path = $output_dir . \"elgg-$version.zip\";\n\t\t\treturn true;\n\t\t} else {\n\t\t\t$output = implode(\"\\n\", $cmd_output);\n\t\t\tthrow new UnexpectedValueException($output);\n\t\t}\n\t}", "public static function rebuild() {\r\n\t\t$cacheDirectory = dirname(self::$cacheFile);\r\n\t\tif(!is_dir($cacheDirectory)) {\r\n\t\t\tmkdir($cacheDirectory, 0755, true);\r\n\t\t}\r\n\r\n\t\tif(self::$rebuild) {\r\n\t\t\tfile_put_contents(self::$cacheFile, serialize(self::$cache));\r\n\t\t}\r\n\t}", "public function buildProject()\n {\n $this->filesystem->mkdir(array(\n $this->getRootDir(),\n $this->getCacheDir(),\n $this->getLogDir(),\n $this->getWebDir(),\n $this->getWebDir().'/uploads',\n ));\n\n $this->filesystem->touch(array(\n $this->getWebDir().'/'.$this->getIndexFile(),\n $this->getWebDir().'/class.php',\n $this->getWebDir().'/phpinfo.php',\n $this->getWebDir().'/authors.txt',\n $this->getWebDir().'/uploads/picture.png',\n ));\n }", "public function build(){\n $this->phar->setSignatureAlgorithm(\\Phar::SHA1);\n $this->compile();\n $stub = $this->stub();\n if($stub){\n $this->phar->setStub($stub);\n }\n }", "protected function package()\n {\n $this->newline('Creating archive file...');\n $rootPath = str_replace('\\\\', '/', base_path());\n $archiveFile = dirname($rootPath) . '/laravel.zip';\n $archive = new ZipArchive();\n\n if ($archive->open($archiveFile, ZipArchive::CREATE | ZipArchive::OVERWRITE)) {\n $files = new RecursiveIteratorIterator(new RecursiveDirectoryIterator($rootPath, RecursiveIteratorIterator::LEAVES_ONLY));\n foreach ($files as $name => $file) {\n $filePath = $file->getRealPath();\n // Format file name by removing root path\n // and replacing backslash with frontslash for Linux compatibility.\n $baseFilePath = str_replace('\\\\', '/', $filePath);\n $baseFilePath = str_replace(\"$rootPath/\", '', $baseFilePath);\n\n // Validate if file should be added to the package.\n if (! is_dir($filePath) && $this->validateFile($baseFilePath)) {\n $archive->addFile($filePath, $baseFilePath);\n }\n }\n }\n\n if ($archive->close()) {\n $this->info(\"Archive file created: $archiveFile\");\n }\n }", "public function run()\n {\n $directory = 'public/packages';\n Storage::deleteDirectory($directory);\n Storage::makeDirectory($directory);\n\n Package::factory(5)\n ->has(\n Image::factory(1)->packages()\n )\n ->create();\n }" ]
[ "0.6679252", "0.62497276", "0.60536194", "0.5962899", "0.5840706", "0.58079237", "0.57485616", "0.5696135", "0.5636454", "0.5636203", "0.5596072", "0.5566028", "0.5499091", "0.54701203", "0.54581004", "0.5444307", "0.54410166", "0.5431404", "0.5361851", "0.53409123", "0.5287626", "0.52683765", "0.52141017", "0.52021414", "0.5152041", "0.5125406", "0.5112678", "0.5094169", "0.50920284", "0.5090826" ]
0.6287252
1
Write the given manifest array to disk.
protected function write(array $manifest) { if (!is_writable(dirname($this->manifestPath))) { throw new Exception('The ' . dirname($this->manifestPath) . ' directory must be present and writable.'); } file_put_contents($this->manifestPath, '<?php return ' . var_export($manifest, true) . ';'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function write(array $manifest)\n {\n if (! is_writable($dirname = dirname($this->manifestPath))) {\n throw new Exception(\"The {$dirname} directory must be present and writable.\");\n }\n\n $this->files->replace(\n $this->manifestPath, '<?php return '.var_export($manifest, true).';'\n );\n }", "protected function write(array $manifest)\n {\n $manifestPath = app()->bootstrapPath().'/cache/qscmf-packages.php';\n if (! is_writable(dirname($manifestPath))) {\n throw new Exception('The '.dirname($manifestPath).' directory must be present and writable.');\n }\n\n $this->files->replace(\n $manifestPath, '<?php return '.var_export($manifest, true).';'\n );\n }", "protected function writeVersionFromArray($array) {\n\t\t$this->Data = Yaml::dump($array, 5);\n\t\t// Only write if the data differs.\n\t\tif (sha1($this->Data)!==$this->SHA) $this->write();\n\t}", "public function writeManifest($manifest)\n {\n $path = $this->manifestPath . '/services.json';\n $this->files->put($path, json_encode($manifest));\n return $manifest;\n }", "public function writeArray($file, $array)\n {\n $write = \"\";\n\n if (is_array($array) && $array) {\n $write = \"<?php\\nreturn \" . var_export($array, true) . \"\\n?>\";\n }\n\n file_put_contents($file, $write);\n }", "public function save() {\n $this->manifest->save();\n }", "function serialize($array){\n serialize($array);\n //file_put_contents();\n }", "function store_array($file, $arr) {\n file_put_contents($file, json_encode($arr));\n}", "private function writeDataFile(array $arrData) {\n file_put_contents(\n $this->filename,\n json_encode($arrData, JSON_PRETTY_PRINT)\n );\n }", "protected function saveHomesteadFile($array)\n {\n $yaml = Yaml::dump($array, 3);\n file_put_contents($this->basePath.'/Homestead.yaml', $yaml);\n }", "public function write($contents)\n {\n file_put_contents($this->fn, serialize($contents));\n }", "private function save(array $messages)\n {\n fseek($this->fh, 0);\n fwrite($this->fh, json_encode($messages));\n }", "function createManifest($dir){\r\n $manifestJson = './manifest.json';\r\n \r\n if(file_exists($manifestJson)){\r\n unlink($manifestJson);\r\n }\r\n\r\n $files = scandir($dir, 1); \r\n $length = sizeof($files);\r\n unset($files[$length-1]);\r\n unset($files[$length-2]); \r\n \r\n $manifest = array();\r\n\r\n foreach ($files as $name){\r\n $f = $dir.'/'.$name;\r\n $manifest[$name]=sha1(file_get_contents($f));\r\n };\r\n\t \r\n $fo = fopen($manifestJson, 'w') or die(\"can't open file\");\r\n fwrite($fo, json_encode($manifest,TRUE));\r\n }", "private function _writeToConf($array, $file){\n $res = array();\n foreach($array as $key => $val)\n {\n if(is_array($val))\n {\n $res[] = \"[$key]\";\n foreach($val as $skey => $sval){\n $res[] = \"$skey = \".(is_numeric($sval) ? $sval : '\"'.$sval.'\"');\n }\n }\n else $res[] = \"$key = \".(is_numeric($val) ? $val : '\"'.$val.'\"');\n }\n\n $fileName = $file;\n $dataToSave = implode(\"\\r\\n\", $res);\n if ($fp = fopen($fileName, 'w'))\n {\n $startTime = microtime(TRUE);\n do\n {\n $canWrite = flock($fp, LOCK_EX);\n // If lock not obtained sleep for 0 - 100 milliseconds, to avoid collision and CPU load\n if(!$canWrite)\n {\n usleep(round(rand(0, 100)*1000));\n }\n } while ((!$canWrite)and((microtime(TRUE)-$startTime) < 5));\n\n //file was locked so now we can store information\n if ($canWrite)\n {\n fwrite($fp, $dataToSave);\n flock($fp, LOCK_UN);\n }\n fclose($fp);\n }\n }", "public static function write($array, $filename, $header='', $chmod=null) {\n $result='';\n foreach ($array as $k => $v) {\n if (is_array($v)) {\n $result.='['.$k.\"]\\n\";\n foreach($v as $k2 => $v2){\n $result .= self::_iniValue($k2,$v2);\n }\n } else {\n // we put simple values at the beginning of the file.\n $result = self::_iniValue($k,$v).$result;\n }\n }\n\n if ($f = @fopen($filename, 'wb')) {\n fwrite($f, $header.$result);\n fclose($f);\n if ($chmod) {\n chmod($f, $chmod);\n }\n }\n else {\n throw new \\Exception('Error while writing ini file '.$filename, 24);\n }\n }", "private function writeRegistry(array $data)\n {\n file_put_contents($this->cachedRegistryFilePath, json_encode($data));\n }", "public function writeArrayToFile(FileName $fileName, array $contents): void\n {\n $asString = JsonUtils::toString($contents);\n $this->writeFile($fileName, $asString);\n }", "public function saveManifest($modules = null)\n\t{\n\t\t$this->manifest->save($this->modules);\n\t}", "function commit($file, $arrayForFormat){\n $toJSON = fopen($file, 'a');\n fwrite($toJSON,json_encode($arrayForFormat));\n fclose($toJSON);\n}", "public function write($contents)\n {\n \tUtil_File::Write($contents, $this->_storage, true);\n }", "public function write($path, $contents, array $config = []);", "public function save($contents)\n {\n // First, create a backup of the original\n if (! File::exists($this->path().'/composer.json.original')) {\n File::put(\n $this->path().'/composer.json.original',\n json_encode($this->read(), JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES)\n );\n }\n\n File::put(\n $this->path().'/composer.json',\n json_encode($contents, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES)\n );\n }", "protected function writeReport(array $results, $path)\n {\n // we need this to convert the \\SplFileInfo object into a normal path string\n // and the modules to a format which can be json encoded\n array_walk($results, function (&$result) {\n $modules = false;\n\n if ($result->getModules() !== false) {\n $modules = array();\n\n foreach ($result->getModules() as $module) {\n $modules[] = $module->toArray();\n }\n }\n\n $result = array(\n 'name' => $result->getName(),\n 'version' => $result->getVersion(),\n 'path' => $result->getPath()->getRealPath(),\n 'modules' => $modules\n );\n });\n\n if (file_put_contents($path, json_encode($results)) === false) {\n throw new \\RuntimeException(\"Could not write to report file\");\n }\n }", "private function saveComposerPlugAndPlayFile(array $data): void\n {\n $json = json_encode($data, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE) . PHP_EOL;\n\n if (is_dir(self::PACKAGES_PATH) === false) {\n mkdir(self::PACKAGES_PATH);\n }\n\n file_put_contents(self::FILENAME, $json);\n }", "private function write_csv($array)\n {\n $handle = fopen($this->filename, 'w');\n foreach ($array as $address) \n {\n fputcsv($handle, $address);\n }\n fclose($handle);\n \n }", "public function write($contents);", "public function write($contents);", "protected function writeArrayToFile($filePath, $array)\n {\n $content = \"<?php\\nreturn \" . var_export($array, 1) . ';';\n file_put_contents($filePath, $content, LOCK_EX);\n return $this;\n }", "public function writeData(array $data, string $className) {\n if ($this->outputPath === null) {\n return;\n }\n\n $fileName = ltrim(str_replace('\\\\', '-', strtolower($className)), \\DIRECTORY_SEPARATOR);\n $filePath = sprintf('%s%s%s.json', $this->outputPath, \\DIRECTORY_SEPARATOR, $fileName);\n file_put_contents($filePath, json_encode($data), \\LOCK_EX);\n }", "function SaveArray($p_SavedArray){\n// Use JSON to encode the array into a storeable string\n $aJSONArray = json_encode($p_SavedArray);\n\n // Open the file in 'write' modus\n $file = fopen('database.json','w');\n\n // Save the content of the JSON array into the file\n file_put_contents('database.json', $aJSONArray);\n\n// Close the file\n fclose($file);\n\n}" ]
[ "0.7652401", "0.75782573", "0.64417946", "0.6416287", "0.60174745", "0.58413565", "0.5731554", "0.56739795", "0.5581995", "0.5571969", "0.55405307", "0.5527127", "0.5484166", "0.5472676", "0.54612935", "0.54500186", "0.5440895", "0.53860074", "0.53086555", "0.53005236", "0.52763647", "0.52678406", "0.52358353", "0.5220673", "0.5199156", "0.51506925", "0.51506925", "0.51302993", "0.5117975", "0.51169837" ]
0.79220057
0
update quantity by a specifique ID
public function updateQuantityById($quantity, $id){ $conn = new db(); $conn = $conn->connexion(); $actualStock = $this->getArticleById($id); $newStock = $actualStock[0]["stock"] + $quantity; $req = $conn->prepare("UPDATE article SET stock = " . $newStock . " WHERE id = ". $id); $req->execute(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function updateItemQty() {\n\t$update = 0; \n\t$rowid = $this->input->get('rowid');\n\t$qty = $this->input->get('qty');\n\tif (!empty($rowid) && !empty($qty)) {\n\t\t$data = array(\n\t\t'rowid' => $rowid,\n\t\t'qty' => $qty\n\t\t);\n\t\t$update = $this->cart->update($data);\n\t}\n\techo $update ? 'ok' : 'err';\n}", "public function inputQuantity($id,$data) {\n DB::table('tbl_products')->where('id',$id)->update(['remain'=>$data]);\n }", "function updateQuantity($id)\n {\n if(!$id) return;\n $ci =& get_instance();\n $ci->load->model('user');\n $where = array(\n 'id_produto'=>$id,\n 'id_usuario' => $ci->user->getUserIdByEmail($this->auth->userMail()),\n );\n $ci->db->set('downloads','downloads + 1', FALSE)\n ->where($where)\n ->update('pedidos');\n return $ci->db->affected_rows();\n }", "public function testUpdateQty() {\n $requestData = [\n 'items' => [\n [\n 'qty' => '1',\n 'entity_id' => '19'\n ], [\n 'qty' => '1',\n 'entity_id' => '21'\n ], [\n 'qty' => '1',\n 'entity_id' => '22'\n ], [\n 'qty' => '1',\n 'entity_id' => '23'\n ], [\n 'qty' => '1',\n 'entity_id' => '25'\n ]\n ],\n 'order_id' => 'WP11513743849738'\n ];\n\n $serviceInfo = [\n 'rest' => [\n 'resourcePath' => self::RESOURCE_PATH . 'updateqty?',\n 'httpMethod' => RestRequest::HTTP_METHOD_POST,\n ]\n ];\n\n $results = $this->_webApiCall($serviceInfo, $requestData);\n \\Zend_Debug::dump($results);\n $this->assertNotNull($results);\n $this->assertGreaterThanOrEqual(\n '1',\n $results['total_count'],\n 'The results doesn\\'t have items.'\n );\n }", "abstract public function update($productId, $quntity = 1);", "public function updateItemInCart($ID, $quantity) {\n if($this->connect()->query(\"update cart set quantity = \" . $quantity . \" where product_id = \" . $ID . \";\")) {\n return mysqli_affected_rows($result);\n } else {\n throw new Exception();\n}\n}", "public function updateCartQuantity($id, $quantity)\n {\n Session::forget('CouponAmount');\n Session::forget('CouponCode');\n\n $getCartDetails = Cart::find($id);\n $getProductStock = ProductAttribute::where('sku', $getCartDetails->product_code)->first();\n\n $updated_quantity = $getCartDetails->quantity + $quantity;\n if($getProductStock->stock >= $updated_quantity)\n {\n Cart::where('id', $id)->increment('quantity', $quantity);\n return back();\n }\n else\n {\n return redirect('cart')->with('flash_message_error', 'Required quantity is not available');\n }\n\n }", "public function updateQuantity($productID/*$slug*/) {\n\n $product = DB::find('products', ['productID' => $productID]);\n\n $this->update($product, $this->request('quantity'));\n\n Redirect::to('cart');\n\n }", "public function updateQuantity($type_id, $quantity){\n\n\t\t$quota = ((int)($this->getQuotaProduct($type_id))[0]->quota) - (int) $quantity;\n\n\t\t$data = array(\n\t\t\t'quota' => $quota,\n\t\t);\n\t\t$this->db->trans_start();\n\t\t$this->db->where('type_id', $type_id);\n\t\t$this->db->update('type_product', $data);\n\t\t$this->db->trans_complete();\n\t}", "public function update($quantity, $id_cart) {\n $this->db->set('quantite', $quantity);\n $this->db->where(array('id' => $id_cart, 'id_client' => $this->session->id));\n $this->db->update('panier');\n }", "function update_item($textbook_id, $quantity) {\n\t$quantity = (int) $quantity;\n\n\t// Checks to see if this book exists in the array\n\tif (isset($_SESSION['cart'][$textbook_id])) {\n\t\tif ($quantity <= 0) {\n\t\t\t// removes the book from the array if the new quantity is zero\n\t\t\tunset($_SESSION['cart'][$textbook_id]);\n\t\t} else {\n\t\t\t//updates the quantity\n\t\t\t$_SESSION['cart'][$textbook_id]['quantity'] = $quantity;\n\n\t\t}\n\t}\n}", "function updateItem($db, $pid) {\n $cartID = getCartID();\n $qty = getQuantity();\n if ($qty <= 0) {\n deleteItem($db, $pid);\n } else {\n $sql = \"UPDATE shoppingcarts SET Quantity=$qty \n WHERE CartID='$cartID' AND ProductID=$pid\";\n $db->query($sql);\n }\n }", "public function increaseQuantity()\n {\n $this->setQuantity($this->getQuantity() + 1);\n $this->save();\n }", "public function test_update_quantity()\n\t{\n\t\t$basket = new Model_Basket;\n\n\t\t$item = $this->get_item();\n\t\t$basket->add_item($item);\n\n\t\t$basket->update_quantity($item->get_identifier(), 5);\n\t\t$basket_item = $basket->get_basket_item($item->get_identifier());\n\n\t\t$this->assertSame((int)$basket_item->quantity, 5);\n\t}", "function updateCartQuantity($prod_id, $qty, $ip_address){\r\n\t\t\t$sql = \"UPDATE cart SET qty='$qty' WHERE ip_add='$ip_address' AND p_id='$prod_id'\";\r\n\t\t\treturn $this->query($sql);\r\n\t\t}", "public function updateQuantity($id, $Quantity)\n {\n $OrderDetails = OrderDetails::find($id);\n $OrderDetails->quantity = $Quantity;\n if($OrderDetails->update()){\n return 1;\n }else{\n return 0;\n }\n }", "public function updateQuantity($cartId, $quantity,$userId){\n\t\t\t$quantity = mysqli_real_escape_string($this->db->link, $quantity);\n\t\t\t$id = mysqli_real_escape_string($this->db->link, $cartId);\n\n\t\t\t$query = \"UPDATE tbl_cart SET quantity = '$quantity' WHERE cartID = '$id' AND userId='$userId'\";\n\t\t\t$result = $this->db->update($query);\n\t\t\tif($result) {\n\t\t\t\t$msg = \"\";\n return $msg;\n\t\t\t} else {\n\t\t\t\t$msg = \"<span class='error'>Cập nhật không thành công</span>\";\n\t\t\t\treturn $msg;\n\t\t\t}\n\t\t}", "public function editquantity(){\n if(isset($this->params[0])) {\n $id = (int)($this->params[0]);\n $quantity = (int)($this->params[1]);\n if (!array_key_exists($id, $this->products)) {\n $this->products[$id] = (int)($quantity);\n }else{\n $this->products[$id] = (int)($quantity);\n }\n }\n Cookie::set('cart', json_encode($this->products));\n\n echo $this->indicator();\n die();\n }", "public function updateQtyAction()\n {\n try {\n $invoice = $this->_initInvoice(true);\n // Save invoice comment text in current invoice object in order to display it in corresponding view\n $invoiceRawData = $this->getRequest()->getParam('invoice');\n $invoiceRawCommentText = $invoiceRawData['comment_text'];\n $invoice->setCommentText($invoiceRawCommentText);\n\n $this->loadLayout();\n $response = $this->getLayout()->getBlock('order_items')->toHtml();\n } catch (Mage_Core_Exception $e) {\n $response = array(\n 'error' => true,\n 'message' => $e->getMessage()\n );\n $response = Mage::helper('core')->jsonEncode($response);\n } catch (Exception $e) {\n $response = array(\n 'error' => true,\n 'message' => $this->__('Cannot update item quantity.')\n );\n $response = Mage::helper('core')->jsonEncode($response);\n }\n $this->getResponse()->setBody($response);\n }", "public static function action_cart_update_qty() {\n $id_product_key = $_POST['id_product_key'];\n $qty = max( absint( $_POST['qty'] ), 1 );\n $new_qty = WPXSmartShopShoppingCart::updateProductQuantity( $id_product_key, $qty );\n $content = WPXSmartShopShoppingCart::cart();\n\n $json = array(\n 'content' => $content\n );\n\n /* @todo Da completare */\n if ( is_wp_error( $new_qty ) ) {\n /* @todo Aggiungere filtro */\n $json['message'] = $new_qty->get_error_message();\n }\n echo json_encode( $json );\n\n die();\n }", "public function upQty($id,$qty) {\n Cart::update($id,$qty);\n return [];\n }", "public function updateQtyByBarcode($barcode);", "function updateOrd()\r\n {\r\n $sql = \"update order1 set quantity = quantity +:quantity where Service_ID=:Service_ID and Cus_ID=:Cus_ID\";\r\n $args = [':Service_ID' => $this->Service_ID, ':quantity' => $this->quantity, ':Cus_ID' => $this->Cus_ID];\r\n DB::run($sql, $args);\r\n }", "public function edit($id)\n\t{\n\t\t$it = Item::find($id);\n\n\t\t$it->qty = $it->qty + $qty;\n\n\t\t$it->save();\n\n\t}", "public function update_item() {\r\n\t\t$data = array(\r\n\t\t\t\t'rowid' => $this->input->post('row_id'),\r\n\t\t\t\t'qty' => $this->input->post('qty')\r\n\t\t);\r\n\t\t$this->cart->update($data);\r\n\t\t$this->load_cart();\r\n\t}", "public function updateCartQuantity($cartId,$quantity){\n $cartId = $this->fm->validation($cartId);\n $quantity = $this->fm->validation($quantity);\n $cartId = mysqli_real_escape_string($this->db->link,$cartId);\n $quantity = mysqli_real_escape_string($this->db->link,$quantity);\n \n $query = \"UPDATE tbl_cart SET quantity ='$quantity' WHERE cartId ='$cartId'\";\n $updated_row = $this->db->update($query);\n if($updated_row){\n \n header(\"Location:cart.php\");\n \n }else{\n $msg = \"<span class='error'>Quantity Not Updated.</span>\";\n return $msg;\n }\n \n \n \n }", "public static function change_quantity($id,$med_name, $price,$quantity){\n\t\t$connect = new Connection();\n\n\t\t$selectmn=\"SELECT m.id as mid from medicine m where m.med_name='$med_name'\";\n\t\t$querry=$connect->connect->query($selectmn);\n\t\t$result=array();\n\t\twhile($row=$querry->fetch_assoc()){\n\t\t\t\t$mid = $row['mid'];\n\t\t}\n\n\t\t$med_id = $mid;\n\n\n $overallprice = $price * $quantity;\n\t\t$change=\"UPDATE on_current_cat o SET o.quantity = $quantity, o.total = $overallprice WHERE o.id = $id\";\n\t\t$res = $connect->connect->query($change);\n\t\treturn $res;\n\t}", "function update_item($key, $quantity) {\n $quantity = (int) $quantity;\n if (isset($_SESSION['cart13'][$key])) {\n if ($quantity <= 0) {\n unset($_SESSION['cart13'][$key]);\n } else {\n $_SESSION['cart13'][$key]['qty'] = $quantity;\n $total = $_SESSION['cart13'][$key]['cost'] *\n $_SESSION['cart13'][$key]['qty'];\n $_SESSION['cart13'][$key]['total'] = $total;\n }\n }\n }", "public function restoreQuantity($id, $quant){\n $this->db->query('UPDATE new_inventory SET quantity = quantity + :quant WHERE product_id = :id;');\n $this->db->bind(':id', $id);\n $this->db->bind(':quant', $quant);\n if ($this->db->execute()){\n return true;\n } else {\n return false;\n };\n }", "function updateStock($id, $quantity=0)\n\t{\n\t\tif(!$quantity){\n\t\t\treturn false;\n\t\t}\n\t\tif(!$id){\n\t\t\treturn false;\n\t\t}\n\t\t$db = JFactory::getDBO();\n\t\t$q = \"UPDATE #__mymuse_product SET product_in_stock = product_in_stock - $quantity\n\t\tWHERE id=$id\";\n\t\t$db->setQuery($q);\n\t\tif(!$db->query()){\n\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t}" ]
[ "0.7426183", "0.7403043", "0.72995925", "0.7260738", "0.7250193", "0.71917546", "0.7141854", "0.7121305", "0.71154624", "0.709727", "0.7073472", "0.7027713", "0.70269614", "0.6955148", "0.69122386", "0.6864959", "0.686212", "0.68589705", "0.6855711", "0.68447584", "0.6814403", "0.6809457", "0.68038917", "0.67961246", "0.67953455", "0.6777479", "0.6768116", "0.67670226", "0.6715508", "0.6714306" ]
0.81897295
0
Register a new notification. All notifications needs to be registered before use.
public function registerNotification(\Growler\NotificationType $notification) { $this->_notifications[] = $notification; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function register_notifications() {\n\t}", "public function addNotification(Notification $notification)\n {\n $this->notifications[] = $notification;\n }", "public function add(INotification $notification) {\n\t\t$sql = $this->connection->getQueryBuilder();\n\t\t$sql->insert('notifications');\n\t\t$this->sqlInsert($sql, $notification);\n\t\t$sql->execute();\n\t}", "public function notification(): void\n {\n try {\n // Get the requestParameters\n $requestParameters = request()->all();\n\n // Check if we have a notificationType\n if (isset($requestParameters['notificationType'])) {\n //Create the corresponding event\n switch ($requestParameters['notificationType']) {\n case BaseNotification::NOTIFICATION_TYPE_PAYMENT:\n // Create the payment event\n $paymentNotification = new PaymentNotification($requestParameters);\n event(new TikkiePaymentEvent($paymentNotification));\n break;\n case BaseNotification::NOTIFICATION_TYPE_REFUND:\n // Create the refund event\n $refundNotification = new RefundNotification($requestParameters);\n event(new TikkieRefundEvent($refundNotification));\n break;\n }\n }\n } catch (Exception $e) {\n }\n }", "protected function maybe_create_notification() {\n\t\tif ( ! $this->notification_center->get_notification_by_id( self::NOTIFICATION_ID ) ) {\n\t\t\t$notification = $this->notification();\n\t\t\t$this->notification_helper->restore_notification( $notification );\n\t\t\t$this->notification_center->add_notification( $notification );\n\t\t}\n\t}", "public function register_gsc_notification() {\n\n\t\t$notification = $this->get_profile_notification();\n\t\t$notification_center = Yoast_Notification_Center::get();\n\n\t\tif ( WPSEO_GSC_Settings::get_profile() === '' ) {\n\t\t\t$notification_center->add_notification( $notification );\n\t\t}\n\t\telse {\n\t\t\t$notification_center->remove_notification( $notification );\n\t\t}\n\t}", "public function createNotification(string $name, array $data = []): Notification;", "public function notify(Notification $notification): void;", "public function register_notification( $notifications ) {\n\t\t$notifications['malware-scheduling'] = array(\n\t\t\t'recipient' => ITSEC_Notification_Center::R_USER_LIST,\n\t\t\t'optional' => true,\n\t\t\t'module' => 'malware-scheduling',\n\t\t);\n\n\t\treturn $notifications;\n\t}", "public function __construct(Notification $notification){\n $this->notification = $notification;\n }", "public function store($data)\n {\n Notification::Create($data);\n }", "public function notify(NotificationInterface $notification): void;", "function add_notifications($notlist){\n $this->notifications=$notlist;\n }", "public function register_notifications( $notifications ) {\n\t\tforeach ( $this->notifications as $type ) {\n\t\t\t$notifications[ $type->get_id() ] = $type->get_name();\n\t\t}\n\n\t\treturn $notifications;\n\t}", "public function addNotification() {\n $insert = array(\n 'notification_to' => $this->input->get('notification_to'),\n 'notification_description' =>$this->input->get('notification_description'),\n 'notification_date' => $this->input->get('notification_date')\n );\n $this->model_db->create('manager_notifications', $insert);\n redirect('notifications', 'refresh'); \n }", "public function __construct(Notifications $notification)\n {\n $this->notification = $notification;\n }", "public function __construct(Notification $notification)\n {\n $this->notification = $notification;\n }", "public function __construct($notification)\n {\n $this->notification = $notification;\n }", "public function store_messages ()\n {\n $this->notifications->store();\n }", "public function store(NotificationRequest $request)\n {\n $notification = new Notification($request->all());\n $notification->user_id = Sentinel::getUser()->id;\n $notification->save();\n\n return redirect('/notification');\n }", "private function add_notification( $message, $type ) {\n\t\tYoast_Notification_Center::get()->add_notification(\n\t\t\tnew Yoast_Notification( $message, array( 'type' => $type ) )\n\t\t);\n\t}", "public function addNotificationToken($notificationToken)\n {\n $this->devices[] = $notificationToken;\n }", "private function createNotification($id)\n {\n $count = Notification::max('count');\n $notification = Notification::create([\n 'model_id' => $id,\n 'count' => intval($count) + 1,\n 'type' => $this->type,\n 'subject' => $this->subject,\n 'message' => $this->message,\n 'sent_at' => Carbon::now(),\n ]);\n\n $arrayToSave = [\n 'model_id' => $id,\n 'result' => 'error',\n ];\n\n if ($notification != null) {\n $arrayToSave['result'] = 'success';\n }\n\n $this->notified->push($arrayToSave);\n }", "public function register_notification( $notifications ) {\n\t\t$notifications['lockout'] = array(\n\t\t\t'subject_editable' => true,\n\t\t\t'recipient' => ITSEC_Notification_Center::R_USER_LIST_ADMIN_UPGRADE,\n\t\t\t'schedule' => ITSEC_Notification_Center::S_NONE,\n\t\t\t'optional' => true,\n\t\t);\n\n\t\treturn $notifications;\n\t}", "public function notify(Notification $notification): void\n {\n ApplicationContext::getContainer()->get(NotificationDispatcherInterface::class)->send($this, $notification);\n }", "abstract public function respondToNotification();", "public function storeNotifications(array $notifications = []);", "public function addHandler(NotificationHandlerInterface $handler): self;", "protected function create_notifications() {\n\t\t$u1_mentionname = bp_activity_get_user_mentionname( $this->u1 );\n\t\t$this->a1 = $this->factory->activity->create( array(\n\t\t\t'user_id' => $this->u2,\n\t\t\t'component' => buddypress()->activity->id,\n\t\t\t'type' => 'activity_update',\n\t\t\t'content' => sprintf( 'Hello! @%s', $u1_mentionname ),\n\t\t) );\n\t\t$u2_mentionname = bp_activity_get_user_mentionname( $this->u2 );\n\t\t$this->a2 = $this->factory->activity->create( array(\n\t\t\t'user_id' => $this->u1,\n\t\t\t'component' => buddypress()->activity->id,\n\t\t\t'type' => 'activity_update',\n\t\t\t'content' => sprintf( 'Hello! @%s', $u2_mentionname ),\n\t\t) );\n\t}", "private function notification(){\n\t\n\t}" ]
[ "0.77640885", "0.6862473", "0.66723496", "0.66419744", "0.65259236", "0.64922947", "0.64241785", "0.64037716", "0.6354629", "0.6334198", "0.6333396", "0.6317071", "0.6293942", "0.6291912", "0.6238412", "0.61771053", "0.61607426", "0.59893215", "0.59824115", "0.5981927", "0.5980933", "0.5963714", "0.5905085", "0.59044075", "0.5879429", "0.5858123", "0.57780874", "0.5754056", "0.5749462", "0.5747893" ]
0.7592594
1
Return all available submodes return array of strings
public function get_submodes() { return explode(',', self::$submodes); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function get_modes()\n {\n clearos_profile(__METHOD__, __LINE__);\n\n $system_mode = Mode::create();\n $system_modes = $system_mode->get_modes();\n\n $modes = array();\n $modes[self::MODE_STANDALONE] = lang('ldap_standalone');\n\n foreach ($system_modes as $mode => $mode_text) {\n if ($mode === Mode_Engine::MODE_MASTER)\n $modes[self::MODE_MASTER] = lang('ldap_master');\n else if ($mode === Mode_Engine::MODE_SLAVE)\n $modes[self::MODE_SLAVE] = lang('ldap_slave');\n }\n\n return $modes;\n }", "protected function getModes()\n {\n return array(\n static::MODE_LIST,\n static::MODE_READ,\n static::MODE_OPEN,\n static::MODE_WRITE,\n static::MODE_ADMIN,\n static::MODE_SUPER\n );\n }", "public function getAllViewModes() {\n // TODO: Implement getAllViewModes() method.\n return [];\n }", "public function getListMode();", "public function listRenderModes();", "function extendedforum_get_open_modes() {\n return array ('2' => get_string('openmode2', 'extendedforum'),\n '1' => get_string('openmode1', 'extendedforum'),\n '0' => get_string('openmode0', 'extendedforum') );\n}", "public function getModes()\n {\n return [\n '1' => 'Test Mode',\n '0' => 'Production Mode'\n ];\n }", "function _unodered_view_mode_options() {\n $view_modes = [];\n $entity_info = entity_get_info('node');\n foreach ($entity_info['view modes'] as $view_mode => $view_mode_info) {\n $view_modes[$view_mode] = $view_mode_info['label'];\n }\n return $view_modes;\n}", "public function getAllFormModes() {\n // TODO: Implement getAllFormModes() method.\n return [];\n }", "static public function getModes(): array\n {\n return [\n self::MODE_DISABLED,\n self::MODE_MANUAL,\n self::MODE_AUTO,\n self::MODE_JUST_IN_TIME,\n ];\n }", "public function get_capabilities() {\n global $DB;\n\n $sort = 'ORDER BY contextlevel,component,name'; // To group them sensibly for display\n\n $params = array();\n $sql = \"SELECT * FROM {capabilities}\n WHERE contextlevel IN (\".CONTEXT_SUBDEPARTMENT.\")\";\n\n return $DB->get_records_sql($sql.' '.$sort, $params);\n }", "protected function getAvailableViewModes() {\n $options = [\n // Always add the 'default' view mode.\n 'default' => 'Default',\n ];\n $form_modes = $this->entityDisplayRepository->getViewModes('commerce_product_variation');\n foreach ($form_modes as $id => $info) {\n $options[$id] = $info['label'];\n }\n return $options;\n }", "public function getModes()\n {\n return array(\n 'undone' => $this->__('Undone tasks'),\n 'done' => $this->__('Completed tasks'),\n 'all' => $this->__('All tasks')\n );\n }", "private function subsectiontypes(): array {\n $typesstr = get_config('format_visualsections', 'subsectiontypes');\n $typesstr = trim($typesstr);\n $types = [];\n $tmparr = explode(\"\\n\", $typesstr);\n foreach ($tmparr as $row) {\n $tmparr2 = explode('|', $row);\n $val = $tmparr2[0];\n $title = $tmparr2[1];\n $types[$val] = $title;\n }\n return $types;\n }", "public function listRenderModeIds();", "public static function getAvailableClusterModes()\n {\n \treturn array(self::CLUSTER_MODE_NONE, self::CLUSTER_MODE_DISTANCE, self::CLUSTER_MODE_ADDRESS);\n }", "function extendedforum_get_layout_modes() {\n /* return array (EXTENDEDFORUM_MODE_FLATOLDEST => get_string('modeflatoldestfirst', 'extendedforum'),\n EXTENDEDFORUM_MODE_FLATNEWEST => get_string('modeflatnewestfirst', 'extendedforum'),\n EXTENDEDFORUM_MODE_THREADED => get_string('modethreaded', 'extendedforum'),\n EXTENDEDFORUM_MODE_NESTED => get_string('modenested', 'extendedforum'));\n */\n \n return array( EXTENDEDFORUM_MODE_ONLY_DISCUSSION => get_string('modeonlydiscussion', 'extendedforum') ,\n EXTENDEDFORUM_MODE_ALL => get_string('modeall', 'extendedforum') );\n}", "public static function get_subsets() {\n\t\t$subsets = [ 'latin', 'latin-ext' ];\n\n\t\t/*\n\t\t * Translators: To add an additional character subset specific to your language,\n\t\t * translate this to 'greek', 'cyrillic', 'devanagari' or 'vietnamese'. Do not translate into your own language.\n\t\t */\n\t\t$subset = _x( 'no-subset', 'Add new subset (greek, cyrillic, devanagari, vietnamese)', 'web-stories' );\n\n\t\tswitch ( $subset ) {\n\t\t\tcase 'cyrillic':\n\t\t\t\t$subsets[] = 'cyrillic';\n\t\t\t\t$subsets[] = 'cyrillic-ext';\n\t\t\t\tbreak;\n\t\t\tcase 'greek':\n\t\t\t\t$subsets[] = 'greek';\n\t\t\t\t$subsets[] = 'greek-ext';\n\t\t\t\tbreak;\n\t\t\tcase 'devanagari':\n\t\t\t\t$subsets[] = 'devanagari';\n\t\t\t\tbreak;\n\t\t\tcase 'vietnamese':\n\t\t\t\t$subsets[] = 'vietnamese';\n\t\t\t\tbreak;\n\t\t}\n\n\t\treturn $subsets;\n\t}", "public function getExpertiseLevels();", "function smatika_get_all_options()\r\n {\r\n return array(\r\n 'smatika_activate_prod_mode',\r\n 'smatika_use_local_font',\r\n 'smatika_enable_top_bar',\r\n 'smatika_show_top_social_icons',\r\n 'smatika_enable_sticky_header',\r\n 'smatika_enable_back_to_top_btn',\r\n 'smatika_show_home_page_banner',\r\n 'smatika_banner_closable',\r\n 'smatika_banner_show_ask_box',\r\n 'smatika_show_collapsible_btns',\r\n 'smatika_show_breadcrumbs',\r\n 'smatika_show_site_stats_above_footer',\r\n 'smatika_show_social_links_at_footer',\r\n 'smatika_show_copyright_at_footer',\r\n 'smatika_copyright_text',\r\n 'smatika_banner_head_text',\r\n 'smatika_banner_div1_text',\r\n 'smatika_banner_div1_icon',\r\n 'smatika_banner_div2_text',\r\n 'smatika_banner_div2_icon',\r\n 'smatika_banner_div3_text',\r\n 'smatika_banner_div3_icon',\r\n 'smatika_top_bar_left_text',\r\n 'smatika_top_bar_right_text',\r\n );\r\n }", "public function get_capabilities() {\n global $DB;\n\n $sort = 'ORDER BY contextlevel,component,name'; // To group them sensibly for display\n\n $params = array();\n $sql = \"SELECT * FROM {capabilities}\n WHERE contextlevel IN (\".CONTEXT_AREA.\",\".CONTEXT_BUILDING.\",\".CONTEXT_ROOM.\")\";\n\n return $DB->get_records_sql($sql.' '.$sort, $params);\n }", "function get_sql_modes() {\n\tstatic $sql_modes = null;\n\n\tif ( null === $sql_modes ) {\n\t\t$result = Process::create( '/usr/bin/env mysql --no-auto-rehash --batch --skip-column-names --execute=\"SELECT @@SESSION.sql_mode\"', null, null )->run();\n\n\t\tif ( 0 !== $result->return_code ) {\n\t\t\t$sql_modes = [];\n\t\t} else {\n\t\t\t$sql_modes = array_filter(\n\t\t\t\tarray_map(\n\t\t\t\t\t'trim',\n\t\t\t\t\tpreg_split( \"/\\r\\n|\\n|\\r/\", $result->stdout )\n\t\t\t\t)\n\t\t\t);\n\t\t}\n\t}\n\n\treturn $sql_modes;\n}", "public function get_capabilities() {\n global $DB;\n\n $sort = 'ORDER BY contextlevel,component,name'; // To group them sensibly for display\n\n $params = array();\n $sql = \"SELECT * FROM {capabilities}\n WHERE contextlevel IN (\".CONTEXT_BUILDING.\",\".CONTEXT_ROOM.\")\";\n\n return $DB->get_records_sql($sql.' '.$sort, $params);\n }", "public function getMode();", "public function get_capabilities() {\n global $DB;\n\n $sort = 'ORDER BY contextlevel,component,name'; // To group them sensibly for display\n\n $params = array();\n $sql = \"SELECT * FROM {capabilities}\n WHERE contextlevel IN (\".CONTEXT_FACULTY.\",\".CONTEXT_SUBDEPARTMENT.\",\".CONTEXT_ACADEMYGROUP.\")\";\n\n return $DB->get_records_sql($sql.' '.$sort, $params);\n }", "public function selOptions()\n\t{\n\t\tstatic $scopes = null;\n\n\t\tif (!isset($scopes))\n\t\t{\n\t\t\t$scopes = [];\n\t\t\tforeach($this->db->select(self::TABLE, 'scope_id,scope_identifier,scope_description', false,\n\t\t\t\t__LINE__, __FILE__, false, '', self::APP) as $row)\n\t\t\t{\n\t\t\t\tif ($row['scope_identifier'] === 'openid')\n\t\t\t\t{\n\t\t\t\t\t$row['scope_identifier'] = 'OpenID ';\t// hack to not translate to app-name\n\t\t\t\t}\n\t\t\t\t$scopes[$row['scope_id']] = [\n\t\t\t\t\t'label' => $row['scope_identifier'],\n\t\t\t\t\t'title' => $row['scope_description'],\n\t\t\t\t];\n\t\t\t}\n\t\t}\n\t\treturn $scopes;\n\t}", "abstract public function getMode();", "public function setAvailableModes(Collection $modes): self;", "public static function getMultimodeFields()\n\t{\n\t\t$avail = self::loadSync2();\n\t\tif ($avail !== null) {\n\t\t\t$keys = array();\n\t\t\tforeach ($avail as $key => $data) {\n\t\t\t\tlist($caption, $callable) = $data;\n\t\t\t\t$fkey = 'mode_'.sha1(serialize($callable));\n\t\t\t\t$keys[] = $fkey;\n\t\t\t}\n\t\t\treturn $keys;\n\t\t} else\n\t\t\treturn null;\n\t}", "public function getOptionsList(): array;" ]
[ "0.69009715", "0.67803144", "0.6581261", "0.65788746", "0.64874", "0.64437205", "0.6380384", "0.62204355", "0.6127318", "0.6043246", "0.5937991", "0.5902627", "0.5869144", "0.5844836", "0.576518", "0.574684", "0.56966686", "0.56775904", "0.562095", "0.55837107", "0.55561256", "0.55187744", "0.5504594", "0.54958767", "0.54909784", "0.54715186", "0.5458169", "0.5448956", "0.54401636", "0.54386306" ]
0.82224953
0
Fetches some basic operator properites: name, role, ctu, figure, badge, bust The most recent ops only have a bust
public static function getOperators() { return Cache::remember('r6stats_operators', static::CACHE_TIME, function() { return static::fetchJson(static::URL . "/database/operators"); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getOperators();", "public function getOperator(): string;", "public static function getOperators();", "public function getOperator();", "public function getOperator();", "public function getOp()\n {\n return $this->get(self::OP);\n }", "public function getOp()\n {\n return $this->op;\n }", "public function get_operators_pecl() {\n\t\t$this->action = 'operators';\n\t\t\n\t\t// check that extension is enabled\n\t\tif(!extension_loaded('pecl_http'))\n\t\t\tthrow new Exception('PECL_HTTP extension is not loaded on this server.');\n\t\t\n\t\t// everything is performed with one line\n\t\t$response = http_post_data($this->api_url, $this->get_data());\n\t\tif(!$response)\n\t\t\tthrow new Exception('PECL: Error processing http_post_data request.');\n\t\t\t\n\t\treturn $response;\n\t}", "public function getOperations();", "public function get_operators_pecl_oo() {\n\t\t$this->action = 'operators';\n\t\t\n\t\t// check that extension is enabled\n\t\tif(!extension_loaded('pecl_http'))\n\t\t\tthrow new Exception('PECL_HTTP extension is not loaded on this server.');\n\t\t\n\t\t$request = new HTTPRequst($this->api_url, HTTP_METH_POST);\n\t\tif(!$request)\n\t\t\tthrow new Exception(\"Error instantiating HTTPRequest class to $this->api_url\");\n\t\t\t\n\t\t$request->setRawPostData($this->get_data());\n\t\t$request->send();\n\t\t\n\t\t$response = $request->getResponseBody();\n\t\tif(!$response)\n\t\t\tthrow new Exception(\"Error getting a response from HTTPRequest: $this->api_url\");\n\t\treturn $response;\n\t}", "public function getOperation();", "public function getOperation();", "public function getOperation();", "public function getOperation();", "public function getOperative();", "function getOperators() {\n return array(\"VCO\" => -1, \"VRI\" => -1, \"DDT\" => -1, \"FAD\" => -1, \"FAI\" => -1, \"FAP\" => -1, \"FNC\" => 1, \"FND\" => -1,\n \"DDR\" => -1, \"DDL\" => -1, \"DDV\" => -1, \"RDV\" => 1, \"DDY\" => -1, \"AFA\" => 1, \"ADT\" => 1, \"AFC\" => -1, \"VPR\" => -1, \"VOR\" => -1, \"VOW\" => -1, \"VOG\" => -1);\n }", "public function getOperators()\n {\n return $this->operators;\n }", "public function getOperators()\n {\n return $this->operators;\n }", "public static function operators() {\n\t\treturn apply_filters( 'vsp/price_calculation/operators', array(\n\t\t\t'add' => esc_html__( 'Add (+)', 'vsp-framework' ),\n\t\t\t'sub' => esc_html__( 'Subtract (-)', 'vsp-framework' ),\n\t\t) );\n\t}", "function getOperator(): string\n {\n return \"BI\";\n }", "public function getOperatorMetadata()\n {\n return $this->operator_metadata;\n }", "function getDetailOperator($id_operator) {\r\n\t\treturn $this->db->query(\"SELECT * FROM tb_operator where id_operator='\".$id_operator.\"'\");\r\n\t}", "function operatorList()\n {\n return array( 'smartshort' );\n }", "public function getOperations() {\r\n return $this->operations;\r\n }", "public function getOperator(): ?string;", "public function getOpCount() {\n return $this->operations;\n }", "public function setFullDataOperations()\n {\n $operations = collect(DB::select(\"SELECT result FROM binary_options WHERE result IS NOT NULL AND broker_user_id = ? GROUP BY broker_user_id, expiration_time, active_id ORDER BY id DESC\", [$this->id]));\n $this['operations'] = $operations->count();\n\n if($this['operations'] == 0){\n $this['hit_percentage'] = 0;\n }else{\n $win = $operations->where('result', 1)->count();\n\n $this['hit_percentage'] = ($win * 100)/$this['operations'];\n }\n }", "public function getOperations()\n {\n return $this->operations;\n }", "public function getOperations()\n {\n return $this->operations;\n }", "public function setFullOperations(){\n $this['operations'] = DB::select(\"SELECT COUNT(t.id) as operations FROM (SELECT id FROM binary_options WHERE result IS NOT NULL AND broker_user_id = ? GROUP BY broker_user_id, expiration_time, active_id) as t\", [$this->id])[0]->operations;\n }" ]
[ "0.5994646", "0.5748891", "0.5734328", "0.56650126", "0.56650126", "0.5640382", "0.56352895", "0.56206524", "0.5552781", "0.5540682", "0.5507341", "0.5507341", "0.5507341", "0.5507341", "0.5436745", "0.5417421", "0.5378153", "0.5378153", "0.5357615", "0.53552896", "0.5318221", "0.5296141", "0.5257906", "0.522706", "0.52256644", "0.5213692", "0.5184422", "0.5176792", "0.5176792", "0.51602226" ]
0.63341594
0
Fetches some basic weapon properites: name, damage, fire_rate, clip_size, mobility_cost Icons are from a Ubisoft cdn, but includes none of the DLC operator weapons
public static function getWeapons() { return Cache::remember('r6stats_weapons', static::CACHE_TIME, function() { return static::fetchJson(static::URL . "/database/weapons"); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function get_dmg ($login)\r\n {\r\n //$login = preg_replace ('/[^a-z-0-9_]/i', '', $login);\r\n $id = is_player ($login);\r\n $q = do_mysql (\"SELECT skills FROM players WHERE id_player = '\".$id.\"';\");\r\n $p = mysql_fetch_assoc ($q);\r\n $p['skills'] = explode ('|', $p['skills']);\r\n\r\n $q = do_mysql (\"SELECT dmg FROM items WHERE belongs = '\".$login.\"' AND is_in = 'wea' AND str > 0;\");\r\n if (!mysql_num_rows($q))\r\n {\r\n // kulaki:\r\n $pl[0][0] = 0;\r\n $pl[0][1] = 0;\r\n $pl[1][0] = 0;\r\n $pl[1][1] = 0;\r\n $pl[2][0] = $p['skills'][0] * 3 + $p['skills'][1] * 3;\r\n $pl[2][1] = $p['skills'][0] * 5 + ($p['skills'][1] + 1) * 3;\r\n $pl[3][0] = 0;\r\n $pl[3][1] = 0;\r\n $pl[4][0] = 0;\r\n $pl[4][1] = 0;\r\n return $pl;\r\n }\r\n else\r\n {\r\n $it_dmg = mysql_result ($q, 0);\r\n $it_dmg = explode ('~', $it_dmg);\r\n $c = count ($it_dmg);\r\n for ($i = 0; $i < $c; $i++) $it_dmg[$i] = explode ('-', $it_dmg[$i]);\r\n\r\n $dvu = $dou = 0;\r\n $q = do_mysql (\"SELECT fullname FROM items WHERE belongs = '\".$login.\"' AND is_in = 'wea';\");\r\n $p['weapon'] = mysql_result ($q, 0);\r\n if (strpos ($p['weapon'], '.2h.') !== false) $dvu = $p['skills'][40];\r\n // esli dva oruzhija\r\n $q = do_mysql (\"SELECT dmg FROM items WHERE is_in = 'shi' AND belongs = '\".$login.\"' AND type = 'w' AND str > 0;\");\r\n if (mysql_num_rows ($q) && strpos ($p['weapon'], '.2h.') == false)\r\n {\r\n $dou = $p['skills'][41];\r\n $dmg2 = mysql_result ($q, 0);\r\n $dmg2 = explode ('~', $dmg2);\r\n $c2 = count ($dmg2);\r\n for ($i = 0; $i < $c; $i++)\r\n {\r\n $dmg2[$i] = explode ('-', $dmg2[$i]);\r\n $it_dmg[$i][0] = round ($it_dmg[$i][0] * 0.75 + $dmg2[$i][0] * 0.55);\r\n $it_dmg[$i][1] = round ($it_dmg[$i][1] * 0.75 + $dmg2[$i][1] * 0.55);\r\n }\r\n }\r\n\r\n // vse urony oruzhija polucheny\r\n // estq 3 formuly\r\n // esli eto holodnoe:\r\n $q = do_mysql (\"SELECT fullname FROM items WHERE is_in = 'wea' AND belongs = '\".$login.\"';\");\r\n if (!mysql_num_rows ($q)) $weapon = '';\r\n else $weapon = mysql_result ($q, 0);\r\n $tp = substr ($weapon, 4, 3);\r\n if ($tp != 'arb')\r\n {\r\n switch ($tp)\r\n {\r\n case 'swo': $numb = 7; break;\r\n case 'axe': $numb = 8; break;\r\n case 'ham': $numb = 9; break;\r\n case 'spe': $numb = 10; break;\r\n case 'bow': $numb = 11; break;\r\n case 'kni': $numb = 13; break;\r\n case 'kli': $numb = 14; break;\r\n case 'tre': $numb = 15; break;\r\n }\r\n // hol: sila * udar + navyk * udar + lovka * 2;\r\n // strel: sila * udar + navyk * udar + lovka * 5;\r\n // esli u oruzhija estq rezhushij udar\r\n // lovka dlja raznyh tipov oruzhija\r\n if ($it_dmg[0][0] || $it_dmg[0][1])\r\n {\r\n $pl[0][0] = $p['skills'][0] * 4 + $it_dmg[0][0] + $p['skills'][$numb] * 5 + $p['skills'][1] * 3 + $dvu * 5 + $dou * 5;\r\n $pl[0][1] = $p['skills'][0] * 8 + $it_dmg[0][1] + $p['skills'][$numb] * 7 + $p['skills'][1] * 4 + $dvu * 7 + $dou * 5;\r\n }\r\n else\r\n {\r\n $pl[0][0] = 0;\r\n $pl[0][1] = 0;\r\n }\r\n // esli u oruzhija estq koljashijj udar\r\n if ($it_dmg[1][0] || $it_dmg[1][1])\r\n {\r\n $pl[1][0] = $p['skills'][0] * 4 + $it_dmg[1][0] + $p['skills'][$numb] * 5 + $p['skills'][1] * 3 + $dvu * 4 + $dou * 4;\r\n $pl[1][1] = $p['skills'][0] * 8 + $it_dmg[1][1] + $p['skills'][$numb] * 7 + $p['skills'][1] * 4 + $dvu * 8 + $dou * 8;\r\n }\r\n else\r\n {\r\n $pl[1][0] = 0;\r\n $pl[1][1] = 0;\r\n }\r\n // esli u oruzhija estq drobjashij udar\r\n if ($it_dmg[2][0] || $it_dmg[2][1])\r\n {\r\n $pl[2][0] = $p['skills'][0] * 4 + $it_dmg[2][0] + $p['skills'][$numb] * 5 + $p['skills'][1] * 3 + $dvu * 4 + $dou * 4;\r\n $pl[2][1] = $p['skills'][0] * 8 + $it_dmg[2][1] + $p['skills'][$numb] * 7 + $p['skills'][1] * 4 + $dvu * 8 + $dou * 8;\r\n }\r\n else\r\n {\r\n $pl[2][0] = 0;\r\n $pl[2][1] = 0;\r\n }\r\n // esli u oruzhija estq rubjashij udar\r\n if ($it_dmg[3][0] || $it_dmg[3][1])\r\n {\r\n $pl[3][0] = $p['skills'][0] * 4 + $it_dmg[3][0] + $p['skills'][$numb] * 5 + $p['skills'][1] * 3 + $dvu * 4 + $dou * 4;\r\n $pl[3][1] = $p['skills'][0] * 8 + $it_dmg[3][1] + $p['skills'][$numb] * 7 + $p['skills'][1] * 4 + $dvu * 8 + $dou * 8;\r\n }\r\n else\r\n {\r\n $pl[3][0] = 0;\r\n $pl[3][1] = 0;\r\n }\r\n // esli u oruzhija estq magicheskij udar\r\n if ($it_dmg[4][0] || $it_dmg[4][1])\r\n {\r\n $pl[4][0] = $it_dmg[4][0] + $p['skills'][2] * 7;\r\n $pl[4][1] = $it_dmg[4][1] + $p['skills'][2] * 14;\r\n }\r\n else\r\n {\r\n $pl[4][0] = 0;\r\n $pl[4][1] = 0;\r\n }\r\n // vozvratim\r\n return $pl;\r\n } // konec holodnogo oruzhija\r\n else\r\n {\r\n // arbalet\r\n $pl[0][0] = $it_dmg[0][0];\r\n $pl[0][1] = $it_dmg[0][1];\r\n $pl[1][0] = $it_dmg[1][0] + $p['skills'][1] * 6 + $p['skills'][3] * 2 + $p['skills'][12] * 4;\r\n $pl[1][1] = $it_dmg[1][1] + $p['skills'][1] * 9 + $p['skills'][3] * 3 + $p['skills'][12] * 7;\r\n $pl[2][0] = $it_dmg[2][0];\r\n $pl[2][1] = $it_dmg[2][1];\r\n $pl[3][0] = $it_dmg[3][0];\r\n $pl[3][1] = $it_dmg[3][1];\r\n $pl[4][0] = $it_dmg[4][0];\r\n $pl[4][1] = $it_dmg[4][1];\r\n // vozvratim\r\n return $pl;\r\n }\r\n }\r\n }", "function weaponEffectiveness(string $weapon)\n {\n switch ($weapon)\n {\n case 'glock': return 0.7 + (rand(0, 10) / 100);\n case 'shotgun': return 0.8 + (rand(0, 10) / 100);\n case 'ak-47': return 0.9 + (rand(0, 10) / 100);\n case 'm-16': return 1.0;\n default: return 0.7 + (rand(0, 10) / 100);\n }\n }", "function hunterslodge_customweapon_install(){\n\t//module_addhook(\"charstats\");\n\tmodule_addhook(\"newday\");\n\tmodule_addhook(\"mysticalshop-buy\");\n\t//module_addhook(\"iitems-use-item\");\n\treturn true;\n}", "public function calculate_weapon_energy($this_object, &$energy_base = 0, &$energy_mods = 0){\n\n // If this is an item the weapon energy is zero\n if (isset($this_object->item_token)){\n\n // Define the return to the item variable\n $this_item = $this_object;\n\n // Return zero as items are free\n return 0;\n\n }\n // Otherwise if ability then we have to calculate\n elseif (isset($this_object->ability_token)){\n\n // Define the return to the ability variable\n $this_ability = $this_object;\n\n // Determine how much weapon energy this should take\n $energy_new = $this_ability->ability_energy;\n $energy_base = $energy_new;\n $energy_mods = 0;\n if ($this_ability->ability_token != 'action-noweapons'){\n if (!empty($this->robot_core) && ($this->robot_core == $this_ability->ability_type || $this->robot_core == $this_ability->ability_type2)){\n $energy_mods++;\n $energy_new = ceil($energy_new * 0.5);\n } elseif (empty($this->robot_core) && empty($this_ability->ability_type) && empty($this_ability->ability_type2)){\n $energy_mods++;\n $energy_new = ceil($energy_new * 0.5);\n }\n if (!empty($this->robot_rewards['abilities'])){\n foreach ($this->robot_rewards['abilities'] AS $key => $info){\n if ($info['token'] == $this_ability->ability_token){\n $energy_mods++;\n $energy_new = ceil($energy_new * 0.5);\n break;\n }\n }\n }\n } else {\n $this_ability->ability_energy = 0;\n }\n\n // Return the resulting weapon energy\n return $energy_new;\n\n }\n }", "static function calculate_weapon_energy_static($this_robot, $this_ability, &$energy_base = 0, &$energy_mods = 0){\n // Determine how much weapon energy this should take\n $energy_new = isset($this_ability['ability_energy']) ? $this_ability['ability_energy'] : 0;\n $energy_base = $energy_new;\n $energy_mods = 0;\n if (!isset($this_robot['robot_core'])){ $this_robot['robot_core'] = ''; }\n if (!isset($this_ability['ability_type'])){ $this_ability['ability_type'] = ''; }\n if (!isset($this_ability['ability_type2'])){ $this_ability['ability_type2'] = ''; }\n if ($this_ability['ability_token'] != 'action-noweapons'){\n if (!empty($this_robot['robot_core']) && ($this_robot['robot_core'] == $this_ability['ability_type'] || $this_robot['robot_core'] == $this_ability['ability_type2'])){\n $energy_mods++;\n $energy_new = ceil($energy_new * 0.5);\n }\n if (!empty($this_robot['robot_rewards']['abilities'])){\n foreach ($this_robot['robot_rewards']['abilities'] AS $key => $info){\n if ($info['token'] == $this_ability['ability_token']){\n $energy_mods++;\n $energy_new = ceil($energy_new * 0.5);\n break;\n }\n }\n }\n } else {\n $this_ability['ability_energy'] = 0;\n }\n // Return the resulting weapon energy\n return $energy_new;\n }", "public function getWeapons() {\n return $this->weapons;\n }", "public function FetchLoot() {\n $wowApi = new \\WRO\\WowApi();\n $playerSvc = new PlayerService();\n $importSvc = new ImportHistoryService();\n $optionSvc = new OptionService();\n $minId = $optionSvc->Get(\"wro_loot_itemid\");\n\n // fetch the news for each raider\n $raiders = $playerSvc->GetAll();\n foreach($raiders as $raider) {\n $data = $lastImported = NULL;\n \n try {\n $data = $wowApi->GetCharFeed($raider->Name, $raider->Realm);\n } catch (Exception $e) {\n Logger::Write(\"Failed to fetch loot for '\" . $raider->Name . \"-\" . $raider->Realm . \"': character not found.\");\n continue;\n }\n\n // only process process data we haven't read\n $lastImported = $importSvc->Get($raider->ID);\n if(!($lastImported == NULL) && $data->lastModified < $lastImported->LastImported) continue;\n\n // add relevant loot from feed to LootItem table\n foreach($data->feed as $event) {\n if(!($lastImported == NULL) && $event->timestamp < $lastImported->LastImported) break;\n\n // only add loot events from current expansion's raids\n if($event->type == \"LOOT\" && $event->itemId > $minId && strpos($event->context, \"raid\") !== false) {\n $entity = new Entities\\RaidLootEntity(\n 0, \n $raider->ID, \n $event->itemId, \n date(\"Y-m-d\", $event->timestamp / 1000)\n );\n \n // add bonuses if they exist\n if(!empty($event->bonusLists)) {\n $entity->Item .= \"&bonus=\";\n for($i = 0; $i < count($event->bonusLists); ++$i) {\n if($i != 0) $entity->Item .= \":\";\n\n $entity->Item .= $event->bonusLists[$i];\n }\n }\n\n $this->Add($entity);\n } \n }\n \n // record that we read this data\n if($lastImported === NULL) $importSvc->Add(new Entities\\ImportHistoryEntity(0, $raider->ID, $data->lastModified));\n else $importSvc->Update(new Entities\\ImportHistoryEntity(0, $raider->ID, $data->lastModified));\n }\n }", "function load_abilities(){\r\n\t$db = file_get_contents(\"abilities.json\");\r\n\t$json = json_decode($db);\r\n\r\n\t//prep the abilities; loop over them and calculate average effective dmg & dmg per tick\r\n\t//set a property on-cooldown to 0 for later\r\n\tforeach($json->abilities as $style){\r\n\r\n\t\tforeach($style as &$ability){\r\n\t\t\tif($ability->min_damage == false){\r\n\t\t\t\t$ability->min_damage = ($ability->max_damage * 0.20);\r\n\t\t\t}\r\n\r\n\t\t\t$ability->on_cd = 0;\r\n\t\t\t$ability->average_damage = (($ability->max_damage - $ability->min_damage)/2)+$ability->min_damage;\r\n\t\t\t$ability->tick_damage = $ability->average_damage / $ability->cast_duration;\r\n\t\t}\r\n\t}\r\n\r\n\treturn $json->abilities;\r\n}", "public function unequipWeapon() {\n $this->strength = 2;\n $this->accuracy = 50;\n $this->equippedWeapon = NULL;\n }", "function get_user_equipped_items($character_id = 0, $type = 'simple')\n {\n if($character_id == 0):\n\t\t\t$character_id = $this->character_id;\n\t\telse:\n\t\t\t$this->character_id = $character_id;\n\t\tendif;\n\n if($type == 'complex'):\n $query = $this->db->select('caip.image_path as path')\n\t\t\t\t\t ->from('avatar_item_parts caip')\n\t\t\t\t\t ->join('avatar_items cai','cai.item_id = caip.item_id')\n\t\t\t\t\t ->join('avatar_layers cal', 'cal.id = caip.layer')\n\t\t\t\t\t ->join('character_items caui', 'caui.item_id = cai.item_id')\n\t\t\t\t\t ->order_by('cal.order','asc')\n\t\t\t\t\t ->order_by('cai.order', 'asc')\n\t\t\t\t\t ->where('caui.character_id',(is_null($character_id) ? $my_id : $character_id))\n\t\t\t\t\t ->where('caui.equipped','1')\n\t\t\t\t\t ->get();\n\t\telse:\n\t\t $query = $this->db->select('id as item_id')\n\t\t\t\t\t\t\t\t->where('character_id', $character_id)\n\t\t\t\t\t\t\t\t->where('equipped', '1')\n\t\t\t\t\t\t\t\t->get('character_items');\n\t\tendif;\n\t\treturn $query;\n }", "public function get_playerEquippedWeapons($id = FALSE) {\r\n\t\t\t$grabList = $this->db->get_where('PlayerEquipped', array('PlayerID' => $id));\r\n\t\t\t\r\n\t\t\t$process = $grabList->result_array();\r\n\t\t\t$string = \"\";\r\n\t\t\t$int = 0;\r\n\t\t\tforeach($process as $value) {\r\n\t\t\t\tif ($int === 0) {\r\n\t\t\t\t\t$string .= ' WHERE weaponID=' . $value['WeaponID'];\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\t$string .= ' OR weaponID=' . $value['WeaponID'];\r\n\t\t\t\t}\r\n\t\t\t\t$int = 1;\r\n\t\t\t}\r\n\t\t\t// SELECT the name of all the weapons for each of the given weapon ID's associted with the given player\r\n\t\t\t$query2 = $this->db->query('SELECT * FROM Weapons' . $string);\r\n\t\t\treturn $query2->result_array();\r\n\t\t}", "function game_fetch_visible_equip($game_user) {\n if ($game_user->meta == 'admin') {\n $sql_to_add = 'WHERE equipment.id > 0';\n }\n else {\n $sql_to_add = 'WHERE (((\n fkey_neighborhoods_id = 0\n OR fkey_neighborhoods_id = %d\n )\n \n AND\n \n (\n fkey_values_id = 0\n OR fkey_values_id = %d\n ))\n \n AND required_level <= %d\n AND active = 1\n AND is_loot = 0\n )\n \n OR equipment_ownership.quantity > 0 ';\n }\n\n $data = [];\n $sql = 'SELECT equipment.*, equipment_ownership.quantity\n FROM equipment\n\n LEFT OUTER JOIN equipment_ownership ON equipment_ownership.fkey_equipment_id = equipment.id\n AND equipment_ownership.fkey_users_id = %d\n\n ' . $sql_to_add . '\n ORDER BY required_level ASC';\n $result = db_query($sql, $game_user->id, $game_user->fkey_neighborhoods_id,\n $game_user->fkey_values_id, $game_user->level);\n\n while ($item = db_fetch_object($result)) {\n $data[] = $item;\n }\n return $data;\n}", "private function profile_handleLoad()\n {\n\n // titles, achievements, characterData, talents (, pets)\n // and some onLoad-hook to .. load it registerProfile($data)\n // everything else goes through data.php .. strangely enough\n\n $char = new ProfileList(array(['id', $this->get('id')])); // or string or whatever\n\n // modify model from auras with profile_getModelForForm\n\n $buff = '';\n\n if ($it = array_column($char->getField('inventory'), 0))\n {\n $itemz = new ItemList(array(['id', $it, CFG_SQL_LIMIT_NONE]));\n $data = $itemz->getListviewData(ITEMINFO_JSON | ITEMINFO_SUBITEMS);\n\n // get and apply inventory\n foreach ($itemz->iterate() as $iId => $__)\n $buff .= 'g_items.add('.$iId.', {name_'.User::$localeString.\":'\".Util::jsEscape($itemz->getField('name', true)).\"', quality:\".$itemz->getField('quality').\", icon:'\".$itemz->getField('iconString').\"', jsonequip:\".json_encode($data[$iId], JSON_NUMERIC_CHECK).\"});\\n\";\n\n $buff .= \"\\n\";\n }\n\n if ($au = $char->getField('auras'))\n {\n $auraz = new SpellList(array(['id', $char->getField('auras')], CFG_SQL_LIMIT_NONE));\n $dataz = $auraz->getListviewData();\n $modz = $auraz->getProfilerMods();\n\n // get and apply aura-mods\n foreach ($dataz as $id => $data)\n {\n $mods = [];\n if (!empty($modz[$id]))\n {\n foreach ($modz[$id] as $k => $v)\n {\n if (is_array($v))\n $mods[] = $v;\n else if ($str = @Util::$itemMods[$k])\n $mods[$str] = $v;\n }\n }\n\n $buff .= 'g_spells.add('.$id.\", {id:\".$id.\", name:'\".Util::jsEscape(substr($data['name'], 1)).\"', icon:'\".$data['icon'].\"', modifier:\".json_encode($mods, JSON_NUMERIC_CHECK).\"});\\n\";\n }\n $buff .= \"\\n\";\n }\n\n /* depending on progress-achievements\n // required by progress in JScript move to handleLoad()?\n Util::$pageTemplate->extendGlobalIds(TYPE_NPC, [29120, 31134, 29306, 29311, 23980, 27656, 26861, 26723, 28923, 15991]);\n */\n\n // load available titles\n Util::loadStaticFile('p-titles-'.$char->getField('gender'), $buff, true);\n\n // load available achievements\n if (!Util::loadStaticFile('p-achievements', $buff, true))\n {\n $buff .= \"\\n\\ng_achievement_catorder = [];\";\n $buff .= \"\\n\\ng_achievement_points = [0];\";\n }\n\n // excludes; structure UNK type => [maskBit => [typeIds]] ?\n /*\n g_user.excludes = [type:[typeIds]]\n g_user.includes = [type:[typeIds]]\n g_user.excludegroups = groupMask // requires g_user.settings != null\n\n maskBit are matched against fieldId from excludeGroups\n id: 1, label: LANG.dialog_notavail\n id: 2, label: LANG.dialog_tcg\n id: 4, label: LANG.dialog_collector\n id: 8, label: LANG.dialog_promo\n id: 16, label: LANG.dialog_nonus\n id: 96, label: LANG.dialog_faction\n id: 896, label: LANG.dialog_profession\n id: 1024, label: LANG.dialog_noexalted\n */\n // $buff .= \"\\n\\ng_excludes = {};\";\n\n // add profile to buffer\n $buff .= \"\\n\\n\\$WowheadProfiler.registerProfile(\".json_encode($char->getEntry(2)).\");\"; // can't use JSON_NUMERIC_CHECK or the talent-string becomes a float\n\n return $buff.\"\\n\";\n }", "function steal ($itemid) \n{\n global $player;\n global $smarty;\n global $title;\n global $newdata;\n global $db;\n \n if ($player -> clas != 'Złodziej')\n {\n error(ERROR);\n }\n checkvalue($itemid);\n if ($player -> hp <= 0) \n {\n error (E_DEAD);\n }\n if ($player -> crime <= 0) \n {\n error (E_CRIME);\n }\n if ($title != 'Łucznik') \n {\n\t$arritem = $db -> Execute(\"SELECT * FROM `equipment` WHERE `id`=\".$itemid);\n } \n else \n {\n\t$arritem = $db -> Execute(\"SELECT * FROM `bows` WHERE `id`=\".$itemid);\n }\n $roll = rand (1, ($arritem->fields['minlev'] * 100));\n\n $arrEquip = $player -> equipment();\n $player->curstats($arrEquip);\n $player->curskills(array('thievery'));\n\n $intStats = ($player->agility + $player->inteli + $player->thievery);\n /**\n * Add bonus from tools\n */\n if ($arrEquip[12][0])\n {\n\t$intStats += (($arrEquip[12][2] / 100) * $intStats);\n }\n\n $chance = $intStats - $roll;\n $strDate = $db -> DBDate(date(\"y-m-d\"));\n if ($chance < 1) \n {\n $cost = 1000 * $player -> level;\n $expgain = ceil ($arritem->fields['minlev'] / 10);\n checkexp($player -> exp, $expgain, $player -> level, $player -> race, $player -> user, $player -> id, 0, 0, $player -> id, 'thievery', 0.01);\n $db -> Execute(\"UPDATE `players` SET `miejsce`='Lochy', `crime`=`crime`-1 WHERE `id`=\".$player -> id);\n $db -> Execute(\"INSERT INTO `jail` (`prisoner`, `verdict`, `duration`, `cost`, `data`) VALUES(\".$player -> id.\", '\".VERDICT.\"', 7, \".$cost.\", \".$strDate.\")\") or die(\"Błąd!\");\n $db -> Execute(\"INSERT INTO log (`owner`, `log`, `czas`, `type`) VALUES(\".$player -> id.\",'\".S_LOG_INFO.\" \".$cost.\".', \".$strDate.\", 'T')\");\n\tif ($arrEquip[12][0])\n\t {\n\t $db->Execute(\"DELETE FROM `equipment` WHERE `id`=\".$arrEquip[12][0]);\n\t }\n\t$objTool = $db->Execute(\"SELECT `id` FROM `equipment` WHERE `owner`=\".$player->id.\" AND `type`='E' AND `status`='U'\");\n\tif ($objTool->fields['id'])\n\t {\n\t $intRoll = rand(1, 100);\n\t if ($intRoll < 50)\n\t {\n\t\t$db->Execute(\"DELETE FROM `equipment` WHERE `owner`=\".$player->id.\" AND `type`='E' AND `status`='U'\");\n\t }\n\t }\n\t$objTool->Close();\n error (CRIME_RESULT1);\n } \n else \n { \n $db -> Execute(\"UPDATE `players` SET `crime`=`crime`-1 WHERE `id`=\".$player -> id);\n $expgain = ($arritem->fields['minlev'] * 5); \n\t$fltThief = ($arritem->fields['minlev'] / 100);\n checkexp($player -> exp, $expgain, $player -> level, $player -> race, $player -> user, $player -> id, 0, 0, $player -> id, 'thievery', $fltThief);\n if ($arritem -> fields['type'] == 'R') \n {\n $test = $db -> Execute(\"SELECT id FROM equipment WHERE name='\".$arritem -> fields['name'].\"' AND owner=\".$player -> id.\" AND status='U' AND cost=1\");\n if (empty ($test -> fields['id'])) \n {\n $db -> Execute(\"INSERT INTO equipment (owner, name, power, cost, wt, szyb, minlev, maxwt, type) VALUES(\".$player -> id.\",'\".$arritem -> fields['name'].\"',\".$arritem -> fields['power'].\",1,\".$arritem -> fields['maxwt'].\",\".$arritem -> fields['szyb'].\",\".$arritem -> fields['minlev'].\",\".$arritem -> fields['maxwt'].\",'\".$arritem -> fields['type'].\"')\") or error(DB_ERROR2);\n } \n else \n {\n $db -> Execute(\"UPDATE equipment SET wt=wt+\".$arritem -> fields['maxwt'].\" WHERE id=\".$test -> fields['id']);\n $db -> Execute(\"UPDATE equipment SET maxwt=maxwt+\".$arritem -> fields['maxwt'].\" where id=\".$test -> fields['id']);\n }\n $test -> Close();\n } \n else \n {\n $test = $db -> Execute(\"SELECT id FROM equipment WHERE name='\".$arritem -> fields['name'].\"' AND wt=\".$arritem -> fields['maxwt'].\" AND type='\".$arritem -> fields['type'].\"' AND status='U' AND owner=\".$player -> id.\" AND power=\".$arritem -> fields['power'].\" AND zr=\".$arritem -> fields['zr'].\" AND szyb=\".$arritem -> fields['szyb'].\" AND maxwt=\".$arritem -> fields['maxwt'].\" and cost=1\");\n if (empty ($test -> fields['id'])) \n {\n if ($arritem -> fields['type'] == 'B') \n {\n $arritem -> fields['twohand'] = 'Y';\n }\n $db -> Execute(\"INSERT INTO equipment (owner, name, power, type, cost, zr, wt, minlev, maxwt, amount, szyb, twohand, repair) VALUES(\".$player -> id.\",'\".$arritem -> fields['name'].\"',\".$arritem -> fields['power'].\",'\".$arritem -> fields['type'].\"',1,\".$arritem -> fields['zr'].\",\".$arritem -> fields['maxwt'].\",\".$arritem -> fields['minlev'].\",\".$arritem -> fields['maxwt'].\",1,\".$arritem -> fields['szyb'].\",'\".$arritem -> fields['twohand'].\"', \".$arritem -> fields['repair'].\")\") or error(DB_ERROR3);\n } \n else \n {\n $db -> Execute(\"UPDATE equipment SET amount=amount+1 WHERE id=\".$test -> fields['id']);\n }\n $test -> Close();\n }\n\tif ($arrEquip[12][0])\n\t {\n\t $arrEquip[12][6] --;\n\t if ($arrEquip[12][6] <= 0)\n\t {\n\t\t$db->Execute(\"DELETE FROM `equipment` WHERE `id`=\".$arrEquip[12][0]);\n\t }\n\t else\n\t {\n\t\t$db->Execute(\"UPDATE `equipment` SET `wt`=`wt`-1 WHERE `id`=\".$arrEquip[12][0]);\n\t }\n\t }\n error (CRIME_RESULT2.\" \".$arritem -> fields['name'].CRIME_RESULT3.\" Zdobyłeś \".$fltThief.\" w umiejętności Złodziejstwo.\");\n }\n}", "function getEquip()\n{\n return array(\"dumbbells\",\"kettlebells\",\"resistance bands\",\"chairs\",\"pull-up bar\",\"no equipment\");\n\n}", "public function getWeapon(): ?Weapon\n {\n return $this->weapon;\n }", "public function getSkilldamageList(){\n return $this->_get(2);\n }", "protected function handleLoad()\r\n {\r\n\r\n // titles, achievements, characterData, talents (, pets)\r\n // and some onLoad-hook to .. load it registerProfile($data)\r\n // everything else goes through data.php .. strangely enough\r\n\r\n if (!$this->_get['id'])\r\n return;\r\n\r\n $char = new ProfileList(array(['id', $this->_get['id'][0]])); // or string or whatever\r\n\r\n $buff = '';\r\n\r\n if ($it = array_column($char->getField('inventory'), 0))\r\n {\r\n $itemz = new ItemList(array(['id', $it, CFG_SQL_LIMIT_NONE]));\r\n $data = $itemz->getListviewData(ITEMINFO_JSON | ITEMINFO_SUBITEMS);\r\n\r\n // get and apply inventory\r\n foreach ($itemz->iterate() as $iId => $__)\r\n $buff .= 'g_items.add('.$iId.', {name_'.User::$localeString.\":'\".Util::jsEscape($itemz->getField('name', true)).\"', quality:\".$itemz->getField('quality').\", icon:'\".$itemz->getField('iconString').\"', jsonequip:\".Util::toJSON($data[$iId]).\"});\\n\";\r\n\r\n $buff .= \"\\n\";\r\n }\r\n\r\n if ($au = $char->getField('auras'))\r\n {\r\n $auraz = new SpellList(array(['id', $char->getField('auras')], CFG_SQL_LIMIT_NONE));\r\n $dataz = $auraz->getListviewData();\r\n $modz = $auraz->getProfilerMods();\r\n\r\n // get and apply aura-mods\r\n foreach ($dataz as $id => $data)\r\n {\r\n $mods = [];\r\n if (!empty($modz[$id]))\r\n {\r\n foreach ($modz[$id] as $k => $v)\r\n {\r\n if (is_array($v))\r\n $mods[] = $v;\r\n else if ($str = @Util::$itemMods[$k])\r\n $mods[$str] = $v;\r\n }\r\n }\r\n\r\n $buff .= 'g_spells.add('.$id.\", {id:\".$id.\", name:'\".Util::jsEscape(mb_substr($data['name'], 1)).\"', icon:'\".$data['icon'].\"', modifier:\".Util::toJSON($mods).\"});\\n\";\r\n }\r\n $buff .= \"\\n\";\r\n }\r\n\r\n /* depending on progress-achievements\r\n // required by progress in JScript move to handleLoad()?\r\n Util::$pageTemplate->extendGlobalIds(TYPE_NPC, [29120, 31134, 29306, 29311, 23980, 27656, 26861, 26723, 28923, 15991]);\r\n */\r\n\r\n // load available titles\r\n Util::loadStaticFile('p-titles-'.$char->getField('gender'), $buff, true);\r\n\r\n // load available achievements\r\n if (!Util::loadStaticFile('p-achievements', $buff, true))\r\n {\r\n $buff .= \"\\n\\ng_achievement_catorder = [];\";\r\n $buff .= \"\\n\\ng_achievement_points = [0];\";\r\n }\r\n\r\n // excludes; structure UNK type => [maskBit => [typeIds]] ?\r\n /*\r\n g_user.excludes = [type:[typeIds]]\r\n g_user.includes = [type:[typeIds]]\r\n g_user.excludegroups = groupMask // requires g_user.settings != null\r\n\r\n maskBit are matched against fieldId from excludeGroups\r\n id: 1, label: LANG.dialog_notavail\r\n id: 2, label: LANG.dialog_tcg\r\n id: 4, label: LANG.dialog_collector\r\n id: 8, label: LANG.dialog_promo\r\n id: 16, label: LANG.dialog_nonus\r\n id: 96, label: LANG.dialog_faction\r\n id: 896, label: LANG.dialog_profession\r\n id: 1024, label: LANG.dialog_noexalted\r\n */\r\n // $buff .= \"\\n\\ng_excludes = {};\";\r\n\r\n // add profile to buffer\r\n $buff .= \"\\n\\n\\$WowheadProfiler.registerProfile(\".Util::toJSON($char->getEntry(2)).\");\"; // can't use JSON_NUMERIC_CHECK or the talent-string becomes a float\r\n\r\n return $buff.\"\\n\";\r\n }", "public function getReqequipment () {\n\t$preValue = $this->preGetValue(\"reqequipment\"); \n\tif($preValue !== null && !\\Pimcore::inAdmin()) { \n\t\treturn $preValue;\n\t}\n\t$data = $this->reqequipment;\n\treturn $data;\n}", "function DispItem($ObjectID) {\n\tglobal $PlayerData;\n\t$sth = mysql_query(\"select I.*,IB.Name, IB.Defined_LevelReq as Level, TD.Image,IB.Stackable,IB.SkillID,S.Name as SkillName,IB.WearSlot,IB.Use_Effect,IB.ItemType,IB.Description, IB.Subscriber as SubItem, IB.Salvage_Price from items as I left join items_base as IB on IB.ItemID=I.ItemID left join tiledata as TD on TD.TileID=IB.TileID left join skills as S on S.SkillID=IB.SkillID where I.ObjectID=$ObjectID\");\n\tprint mysql_error();\n\t$ItemData = mysql_fetch_array($sth);\n\n\tif ($ItemData[Equiped] == \"Y\") {\n\t\t$sth2 = mysql_query(\"select S.*,I.Adjustment from itemspells as I left join spells as S on I.SpellID=S.SpellID left join items as IT on IT.ObjectID=I.ObjectID where I.ObjectID=$ItemData[ObjectID]\");\n\t\tprint mysql_error();\n\t\twhile ($SpellData = mysql_fetch_array($sth2)) {\n//\t\t\tprint $SpellData[ModCode];\n\t\t\teval($SpellData[ModCode]);\n\t\t}\n\t}\n\t$ObjectID = $ItemData[ObjectID];\n\tprint \"<B>\".$ItemData[Name].\"</B> \";\n\tif ($ItemData[ItemStack] > 1) {\n\t\tprint \"(<b>$ItemData[ItemStack]</b>) \";\n\t}\n\tprint \"<BR><B>Level:</B> \".$ItemData[Level].\" Required\";\n\tprint \"<BR><B>Sub only:</B> \".$ItemData[SubItem];\n\tprint \"<BR><B>Value:</B> \".number_format($ItemData[Value]).\" coins<BR>\";\n\tprint \"<B>Salvage Value:</B> \".number_format($ItemData[Salvage_Price]).\" coins<BR>\";\n\t\n\tif ($ItemData[ItemType] == \"Weapon\") {\n\t\tprint $ItemData[MinDam].\"-\".$ItemData[MaxDam].\" $ItemData[DamageType] damage<BR>\";\n\t} elseif ($ItemData[ItemType] == \"Armor\") {\n\t\tprint \"<B>Armor Level:</B> $ItemData[AL]<br>\";\n\t}\n\n\tif ($ItemData[AttackBonus] > 0 && $ItemData[MeleeBonus] == 0) {\n\t\tprint \"+$ItemData[AttackBonus] attack<br>\";\n\t} elseif ($ItemData[AttackBonus] == 0 && $ItemData[MeleeBonus] > 0) {\n\t\tprint \"+$ItemData[MeleeBonus] defence<br>\";\n\t} elseif ($ItemData[AttackBonus] > 0 && $ItemData[MeleeBonus] > 0) {\n\t\tprint \"+$ItemData[AttackBonus] attack +$ItemData[MeleeBonus] defence<br>\";\n\t}\n\n\tif ($ItemData[AttunementReq] > 0 || $ItemData[Use_SkillType] != \"\") {\n\t\tprint \"<B>Requirements:</B><br>\";\n\t\tif ($ItemData[AttunementReq] > 0) {\n\t\t\tprint \"Magic Basic Level<BR>\";\n\t\t}\n\t\tif ($ItemData[Use_SkillType] != \"\") {\n\t\t\tprint \"$ItemData[Use_SkillType] skill<BR>\";\n\t\t}\n\t}\n\n\t$sth2 = mysql_query(\"select S.Name,I.Adjustment, I.SpellID from itemspells as I left join spells as S on I.SpellID=S.SpellID where I.ObjectID=$ItemData[ObjectID]\");\n\tprint mysql_error();\n\tif (mysql_num_rows($sth2) > 0) {\n\t\t$dispflag = 0;\n\t\twhile ($spelldata = mysql_fetch_array($sth2)) {\n\t\t\tif ($spelldata[SpellID] != 0 && $dispflag == 0) {\n\t\t\t\tprint \"<B>Spells:</B><BR>\";\n\t\t\t\t$dispflag = 1;\n\t\t\t}\n\t\t\tif ($spelldata[SpellID] != 0) {\n\t\t\t\tprint \"$spelldata[Name] ($spelldata[Adjustment])<BR>\";\n\t\t\t}\n\t\t}\n\t}\n\n\tif ($ItemData[ItemType] == \"Armor\") {\n\t\tprint \"<B>Covers:</B>$ItemData[WearSlot]<BR>\";\n\t}\n\tif ($ItemData[SkillID] > 0) {\n\t\tHelp(\"Skills\",\"To use this item effectivly you must be \nskilled in the skill displayed. You may train skills from the skills \npage.\");\n\t\tprint \" <B>Skill:</B> $ItemData[SkillName]</BR>\";\n\t}\n}", "function game_show_equip($game_user, $item, &$ai_output, $options = []) {\n\n global $game;\n include drupal_get_path('module', $game) . '/game_defs.inc';\n static $party_title;\n $classes = [];\n\n if (empty($party_title)) {\n $sql = 'select party_title from `values` where id = %d;';\n $result = db_query($sql, $game_user->fkey_values_id);\n $data = db_fetch_object($result);\n $party_title = preg_replace('/^The /', '', $data->party_title);\n }\n\n $soon = ($options['soon']) ? 'soon' : '';\n $header = ($options['equipment-succeeded'] == 'success') ?\n '<div class=\"land-succeeded\">Success</div>' : '';\n\n switch ($options['equipment-buy-succeeded']) {\n\n case 'failed no-money':\n $offer = game_luck_money_offer($game_user);\n $header = '<div class=\"title\">' .\n\n // FIXME remove special characters from text here.\n t('∆ @value <span>Insufficient</span> ∆',\n array('@value' => $game_user->values)) . '\n </div>\n <div class=\"try-an-election-wrapper\">\n <div class=\"try-an-election\">\n <a href=\"/' . $game . '/elders_do_fill/' . $arg2 .\n '/money?destination=/' . $game . '/equipment/' . $arg2 . '\">' .\n t('Receive @offer @values (1&nbsp;@luck',\n array(\n '@offer' => $offer,\n '@values' => $game_user->values,\n '@luck' => $luck,\n )) . ')\n </a>\n </div>\n </div>';\n\n $failed = 'failed';\n break;\n\n case 'failed not-required-level':\n $header = '<div class=\"title\">' .\n t('∆ Player Level <span>Insufficient</span> ∆') .\n '</div>';\n $failed = 'failed';\n break;\n\n case 'failed hit-quantity-limit':\n $header = '<div class=\"title\">' .\n t('Limit reached!') .\n '</div>';\n $failed = 'failed';\n break;\n\n case 'failed not-enough-income':\n $header = '<div class=\"title\">' .\n t('Not enough hourly income!') .\n '</div>';\n $failed = 'failed';\n break;\n\n case 'failed not-required-hood':\n $header = '<div class=\"title\">' .\n t('∆ Location <span>Incorrect</span> ∆') .\n '</div>';\n $failed = 'failed';\n game_competency_gain($game_user, 'lost');\n break;\n\n case 'failed not-required-party':\n $header = '<div class=\"title\">' .\n t('∆ @party <span>Incorrect</span> ∆',\n array('@party' => $party)) .\n '</div>';\n $failed = 'failed';\n break;\n\n case 'failed not-active':\n case 'failed is-loot':\n $header = '<div class=\"title\">' .\n t('∆ Item <span>Unavailable</span> ∆') .\n '</div>';\n $failed = 'failed';\n break;\n\n case 'failed cant-sell':\n $header = '<div class=\"title\">' .\n t('∆ Item <span>Unsalable</span> ∆') .\n '</div>';\n $failed = 'failed';\n break;\n }\n\n $description = str_replace('%party', \"<em>$party_title</em>\",\n $item->description);\n\n $quantity = $item->quantity;\n if (empty($quantity)) {\n $quantity = '<em>' . t('None') . '</em>';\n }\n\n $equipment_price = $item->price + ($item->quantity *\n $item->price_increase);\n\n if (!$item->is_loot) {\n $ai_output .= \" $item->id=$equipment_price\";\n }\n\n if ((($equipment_price % 1000) == 0) && $equipment_price > 0) {\n $equipment_price = ($equipment_price / 1000) . 'K';\n }\n\n if ($item->quantity_limit > 0) {\n $quantity_limit = '<em>(Limited to ' . $item->quantity_limit . ')</em>';\n }\n else {\n $quantity_limit = '';\n }\n\n $can_buy = $can_sell = TRUE;\n $cant_buy_reason = $cant_sell_reason = '';\n\n if ($item->fkey_neighborhoods_id != 0 &&\n $item->fkey_neighborhoods_id != $game_user->fkey_neighborhoods_id) {\n $can_buy = FALSE;\n $sql = 'select name from neighborhoods where id = %d;';\n $result = db_query($sql, $item->fkey_neighborhoods_id);\n $hood = db_fetch_object($result);\n $cant_buy_reason = '(' . $hood->name . ' only)';\n }\n\n if ($item->fkey_values_id != 0 &&\n $item->fkey_values_id != $game_user->fkey_values_id) {\n $can_buy = FALSE;\n $cant_buy_reason = '(Wrong ' . $party . ')';\n }\n\n if ($item->required_level > $game_user->level) {\n $can_buy = FALSE;\n $cant_buy_reason = '(Not Enough ' . $experience . ')';\n }\n\n if (!$item->active) {\n $can_buy = FALSE;\n $cant_buy_reason = '(Inactive)';\n }\n\n if ($item->is_loot != 0) {\n $can_buy = FALSE;\n $cant_buy_reason = '(Loot Only)';\n }\n\n if ($item->can_sell != 1) {\n $can_sell = FALSE;\n $cant_sell_reason = '(Ever)';\n }\n\n if ($item->quantity < 1) {\n $can_sell = FALSE;\n }\n\n $inactive = ($item->active) ? '' : t('(Inactive)');\n\n if ($can_buy) {\n $icon_button = <<< EOF\n<a href=\"/$game/equipment_buy/$arg2/$item->id/1\">\n <img src=\"/sites/default/files/images/equipment/$game-$item->id.png?2\" width=\"96\"\n border=\"0\">\n</a>\nEOF;\n $name_link = <<< EOF\n<a href=\"/$game/equipment_buy/$arg2/$item->id/1\">\n <span class=\"type\">\n $inactive\n </span>\n $item->name\n</a>\nEOF;\n $buy_button = <<< EOF\n<div class=\"land-buy-button\">\n <a href=\"/$game/equipment_buy/$arg2/$item->id/1\">\n Buy\n </a>\n</div>\nEOF;\n }\n else {\n // Can't buy.\n $icon_button = <<< EOF\n <img src=\"/sites/default/files/images/equipment/$game-$item->id.png?2\" width=\"96\"\n border=\"0\">\nEOF;\n $name_link = <<< EOF\n<span class=\"type\">\n $inactive\n</span>\n$item->name\nEOF;\n $buy_button = <<< EOF\n<div class=\"land-buy-button not-yet\">\n Can't Buy $cant_buy_reason\n</div>\nEOF;\n }\n\n if ($can_sell) {\n $sell_button = <<< EOF\n<div class=\"land-sell-button\">\n <a href=\"/$game/equipment_sell/$arg2/$item->id/1\">\n Sell\n </a>\n</div>\nEOF;\n }\n else {\n $sell_button = <<< EOF\n<div class=\"land-sell-button not-yet\">\n Can't Sell $cant_sell_reason\n</div>\nEOF;\n }\n\n // grab each action for the equipment\n $acts_arr = [];\n $sql = 'select * from actions where fkey_equipment_id = %d;';\n $result = db_query($sql, $item->id);\n while ($action = db_fetch_object($result)) {\n $acts_arr[] = $action;\n }\n\n if ($item->initiative_bonus != 0) {\n $classes[] = 'equip-ini';\n }\n\n if ($item->endurance_bonus != 0) {\n $classes[] = 'equip-end';\n }\n\n if ($item->elocution_bonus != 0) {\n $classes[] = 'equip-elo';\n }\n\n if ($item->speed_increase != 0) {\n $classes[] = 'equip-move';\n }\n\n if ($can_buy) {\n $classes[] = 'equip-buy';\n }\n\n if ($can_sell) {\n $classes[] = 'equip-sal';\n }\n\n if ($item->upkeep != 0) {\n $classes[] = 'equip-upk';\n }\n\n if ($item->energy_bonus != 0 || $item->energy_increase != 0) {\n $classes[] = 'equip-eng';\n }\n\n if (count($acts_arr) > 0) {\n $classes[] = 'equip-act';\n }\n\n $class_str = implode(' ', $classes);\n\n if ($soon) {\n echo <<< EOF\n<div class=\"land $soon $failed $class_str\">\n <div class=\"land-icon\">\n <img src=\"/sites/default/files/images/equipment/$game-soon.png?1\" width=96\n border=\"0\">\n </div>\n <div class=\"land-details\">\n <div class=\"land-name\">\n <span class=\"type\">$inactive</span>\n $item->name\n </div>\n <div class=\"land-description\">$description</div>\nEOF;\n }\nelse {\n echo <<< EOF\n<div class=\"land $failed $class_str\">\n $header\n <div class=\"land-icon\">\n $icon_button\n </div>\n <div class=\"land-details\">\n <div class=\"land-name\">\n $name_link\n </div>\n <div class=\"land-description\">$description</div>\nEOF;\n }\n\n echo <<< EOF\n <div class=\"land-owned\">Owned: $quantity $quantity_limit</div>\nEOF;\n $reqs = <<< EOF\n <div class=\"land-cost\">Cost: $equipment_price $game_user->values</div>\nEOF;\n\n if ($game_user->level < $item->required_level) {\n $reqs .= <<< EOF\n <div class=\"land-required_level\">Player: Level $item->required_level</div>\nEOF;\n }\n\n if (!empty($reqs)) {\n echo <<< EOF\n <!--<div class=\"land-requisites\">// Requisites //</div>-->\n $reqs\nEOF;\n }\n\n if ($item->energy_bonus > 0) {\n echo <<< EOF\n <div class=\"land-payout\">\n Energy: +$item->energy_bonus immediate energy bonus\n </div>\nEOF;\n }\n\n if ($item->energy_increase > 0) {\n echo <<< EOF\n <div class=\"land-payout\">\n Energy: +$item->energy_increase every 5 minutes\n </div>\nEOF;\n }\n\n if ($item->initiative_bonus > 0) {\n echo <<< EOF\n <div class=\"land-payout\">\n $initiative: +$item->initiative_bonus\n </div>\nEOF;\n }\nelse if ($item->initiative_bonus < 0) {\n echo <<< EOF\n <div class=\"land-payout negative\">\n $initiative: $item->initiative_bonus\n </div>\nEOF;\n }\n\n if ($item->endurance_bonus > 0) {\n echo <<< EOF\n <div class=\"land-payout\">\n $endurance: +$item->endurance_bonus\n </div>\nEOF;\n }\nelse if ($item->endurance_bonus < 0) {\n echo <<< EOF\n <div class=\"land-payout negative\">\n $endurance: $item->endurance_bonus\n </div>\nEOF;\n }\n\n if ($item->elocution_bonus > 0) {\n echo <<< EOF\n <div class=\"land-payout\">\n $elocution: +$item->elocution_bonus\n </div>\nEOF;\n\n if (!$item->is_loot) {\n $ai_output .= \"/+elo:$item->elocution_bonus\";\n }\n\n }\nelse if ($item->elocution_bonus < 0) {\n echo <<< EOF\n <div class=\"land-payout negative\">\n $elocution: $item->elocution_bonus\n </div>\nEOF;\n\n if (!$item->is_loot) {\n $ai_output .= \"/+elo:$item->elocution_bonus\";\n }\n }\n\n if ($item->speed_increase > 0) {\n echo <<< EOF\n <div class=\"land-payout\">\n Speed Increase: $item->speed_increase fewer Action\n needed to move to a new $hood_lower\n </div>\nEOF;\n\n if ((!$item->is_loot) && ($item->quantity == 0)) {\n $ai_output .= \"/+spd:$item->speed_increase\";\n }\n\n }\n\n if ($item->upkeep > 0) {\n echo <<< EOF\n <div class=\"land-payout negative\">\n Upkeep: $item->upkeep every 60 minutes\n </div>\nEOF;\n }\n\n if ($item->chance_of_loss > 0) {\n $lifetime = floor(100 / $item->chance_of_loss);\n $use = ($lifetime == 1) ? 'use' : 'uses';\n echo <<< EOF\n <div class=\"land-payout negative\">\n Expected Lifetime: $lifetime $use\n </div>\nEOF;\n }\n\n foreach ($acts_arr as $action) {\n// firep($action, 'action associated with equipment');\n\n $cost = \"Cost: $action->cost Action\";\n if ($action->values_cost > 0)\n $cost .= \", $action->values_cost $game_user->values\";\n\n $name = str_replace('%value', $game_user->values, $action->name);\n\n echo '<div class=\"land-action\">Action: ' . $name . '</div>';\n echo '<div class=\"land-description\">' . $action->description . '</div>';\n echo '<div class=\"land-action-cost\">' . $cost . '</div>';\n\n if ($action->influence_change < 0) {\n $inf_change = -$action->influence_change;\n echo <<< EOF\n <div class=\"land-payout negative\">Effect: Target's\n {$experience_lower} is reduced by $inf_change</div>\nEOF;\n }\n\n if (($action->rating_change < 0.10) && ($action->rating_change != 0.0)) {\n $rat_change = abs($action->rating_change);\n\n if ($action->rating_change < 0.0) {\n echo <<< EOF\n <div class=\"land-payout negative\">Effect: $target approval rating is\n reduced by $rat_change%</div>\nEOF;\n }\n else {\n echo <<< EOF\n <div class=\"land-payout\">Effect: $target approval rating is\n increased by $rat_change%</div>\nEOF;\n }\n\n }\n\n if ($action->rating_change >= 0.10) {\n $rat_change = $action->rating_change;\n echo <<< EOF\n <div class=\"land-payout\">Effect: Your approval rating is\n increased by $rat_change%</div>\nEOF;\n }\n\n if ($action->neighborhood_rating_change < 0.0) {\n $rat_change = -$action->neighborhood_rating_change;\n echo <<< EOF\n <div class=\"land-payout negative\">Effect: $hood $beauty_lower\n rating is reduced by $rat_change</div>\nEOF;\n }\n\n if ($action->neighborhood_rating_change > 0.0) {\n $rat_change = $action->neighborhood_rating_change;\n echo <<< EOF\n <div class=\"land-payout\">Effect: $hood $beauty_lower rating is\n increased by $rat_change</div>\nEOF;\n }\n\n if ($action->values_change < 0) {\n $val_change = -$action->values_change;\n echo <<< EOF\n <div class=\"land-payout negative\">Effect: Target's $game_user->values is\n reduced by $val_change</div>\nEOF;\n }\n }\n\n echo '</div>';\n\n // BUY buttons.\n if ($soon) {\n echo <<< EOF\n <div class=\"land-button-wrapper\">\n <div class=\"land-buy-button not-yet\">\n Can't Buy\n </div>\n <div class=\"land-sell-button not-yet\">\n Can't Sell\n </div>\n </div>\nEOF;\n }\n else {\n\n // Attempt to buy.\n if ($options['equipment-buy-succeeded']) {\n echo <<< EOF\n<div class=\"land-button-wrapper\">\n <form action=\"/$game/equipment_buy/$arg2/$item->id/use-quantity\">\n <div class=\"quantity\">\n <select name=\"quantity\">\nEOF;\n foreach ([1, 5, 10, 25, 50, 100] as $option) {\n if ($option == $options['orig-quantity']) {\n echo '<option selected=\"selected\" value=\"' . $option . '\">' .\n $option . '</option>';\n }\n else {\n echo '<option value=\"' . $option . '\">' . $option . '</option>';\n }\n }\n echo <<< EOF\n </select>\n </div>\n <input class=\"land-buy-button\" type=\"submit\" Value=\"Buy\"/>\n </form>\n</div>\nEOF;\n\n }\n\n // Normal show.\n else {\n echo <<< EOF\n <div class=\"land-button-wrapper\">\n $buy_button\n $sell_button\n </div>\nEOF;\n }\n\n }\n\n echo '</div>';\n}", "static public function all() {\n\t\tif (static::$items) {\n\t\t\treturn static::$items;\n\t\t}\n\n\t\tstatic::$items = new ItemCollection([\n\t\t\tnew Item('Nothing', 'Nothing', [0x5A]),\n\t\t\tnew Item\\Sword('L1Sword', 'Fighters Sword', [0x49]), // Uncle must be dead\n\t\t\tnew Item\\Sword('L1SwordAndShield', 'Fighters Sword and Shield', [0x00]), // Uncle must be dead\n\t\t\tnew Item\\Sword('L2Sword', 'Master Sword', [0x01]),\n\t\t\tnew Item\\Sword('MasterSword', 'Master Sword', [0x50]),\n\t\t\tnew Item\\Sword('L3Sword', 'Tempered Sword', [0x02]), // Uncle must be dead\n\t\t\tnew Item\\Sword('L4Sword', 'Golden Sword', [0x03]), // Uncle must be dead\n\t\t\tnew Item\\Shield('BlueShield', 'Fighters Shield', [0x04]), // Uncle must be dead\n\t\t\tnew Item\\Shield('RedShield', 'Fire Shield', [0x05]), // Uncle must be dead\n\t\t\tnew Item\\Shield('MirrorShield', 'Mirror Shield', [0x06]), // Uncle must be dead\n\t\t\tnew Item('FireRod', 'Fire Rod', [0x07]),\n\t\t\tnew Item('IceRod', 'Ice Rod', [0x08]),\n\t\t\tnew Item('Hammer', 'Hammer', [0x09]),\n\t\t\tnew Item('Hookshot', 'Hookshot', [0x0A]),\n\t\t\tnew Item\\Bow('Bow', 'Bow', [0x0B]),\n\t\t\tnew Item('Boomerang', 'Blue Boomerang', [0x0C]),\n\t\t\tnew Item('Powder', 'Magic Powder', [0x0D]),\n\t\t\tnew Item\\BottleContents('Bee', 'Bee', [0x0E]),\n\t\t\tnew Item\\Medallion('Bombos', 'Bombos', [0x0f, 0x00, 't0' => 0x31, 't1' => 0x90, 't2' => 0x00, 'm0' => 0x31, 'm1' => 0x80, 'm2' => 0x00]),\n\t\t\tnew Item\\Medallion('Ether', 'Ether', [0x10, 0x01, 't0' => 0x31, 't1' => 0x98, 't2' => 0x00, 'm0' => 0x13, 'm1' => 0x9F, 'm2' => 0xF1]),\n\t\t\tnew Item\\Medallion('Quake', 'Quake', [0x11, 0x02, 't0' => 0x14, 't1' => 0xEF, 't2' => 0xC4, 'm0' => 0x31, 'm1' => 0x88, 'm2' => 0x00]),\n\t\t\tnew Item('Lamp', 'Lamp', [0x12]),\n\t\t\tnew Item('Shovel', 'Shovel', [0x13]),\n\t\t\tnew Item('OcarinaInactive', 'Flute', [0x14]),\n\t\t\tnew Item('CaneOfSomaria', 'Cane Of Somaria', [0x15]),\n\t\t\tnew Item\\Bottle('Bottle', 'Bottle (Empty)', [0x16]),\n\t\t\tnew Item\\Upgrade\\Health('PieceOfHeart', 'Piece Of Heart', [0x17]),\n\t\t\tnew Item('CaneOfByrna', 'Cane Of Byrna', [0x18]),\n\t\t\tnew Item('Cape', 'Magic Cape', [0x19]),\n\t\t\tnew Item('MagicMirror', 'Magic Mirror', [0x1A]),\n\t\t\tnew Item('PowerGlove', 'Power Glove', [0x1B]),\n\t\t\tnew Item('TitansMitt', 'Titans Mitt', [0x1C]),\n\t\t\tnew Item('BookOfMudora', 'Book Of Mudora', [0x1D]),\n\t\t\tnew Item('Flippers', 'Flippers', [0x1E]),\n\t\t\tnew Item('MoonPearl', 'Moon Pearl', [0x1F]),\n\t\t\tnew Item('BugCatchingNet', 'Bug Catching Net', [0x21]),\n\t\t\tnew Item('BlueMail', 'Blue Mail', [0x22]),\n\t\t\tnew Item('RedMail', 'Red Mail', [0x23]),\n\t\t\tnew Item\\Key('Key', 'Key', [0x24]),\n\t\t\tnew Item\\Compass('Compass', 'Compass', [0x25]),\n\t\t\tnew Item\\Upgrade\\Health('HeartContainerNoAnimation', 'Heart Container (no animation)', [0x26]),\n\t\t\tnew Item('Bomb', 'Single Bomb', [0x27]),\n\t\t\tnew Item('ThreeBombs', 'Three Bombs', [0x28]),\n\t\t\tnew Item('Mushroom', 'Mushroom', [0x29]),\n\t\t\tnew Item('RedBoomerang', 'Magical Boomerang', [0x2A]),\n\t\t\tnew Item\\Bottle('BottleWithRedPotion', 'Bottle (Red Potion)', [0x2B]),\n\t\t\tnew Item\\Bottle('BottleWithGreenPotion', 'Bottle (Green Potion)', [0x2C]),\n\t\t\tnew Item\\Bottle('BottleWithBluePotion', 'Bottle (Blue Potion)', [0x2D]),\n\t\t\tnew Item\\BottleContents('RedPotion', 'Red Potion', [0x2E]),\n\t\t\tnew Item\\BottleContents('GreenPotion', 'Green Potion', [0x2F]),\n\t\t\tnew Item\\BottleContents('BluePotion', 'Blue Potion', [0x30]),\n\t\t\tnew Item('TenBombs', 'Ten Bombs', [0x31]),\n\t\t\tnew Item\\BigKey('BigKey', 'Big Key', [0x32]),\n\t\t\tnew Item\\Map('Map', 'Dungeon Map', [0x33]),\n\t\t\tnew Item('OneRupee', 'One Rupee', [0x34]),\n\t\t\tnew Item('FiveRupees', 'Five Rupees', [0x35]),\n\t\t\tnew Item('TwentyRupees', 'Twenty Rupees', [0x36]),\n\t\t\tnew Item\\Pendant('PendantOfCourage', 'Pendant Of Courage', [0x37, 0x04, 0x38, 0x62, 0x00, 0x69, 0x01]),\n\t\t\tnew Item\\Pendant('PendantOfWisdom', 'Pendant Of Wisdom', [0x38, 0x01, 0x32, 0x60, 0x00, 0x69, 0x03]),\n\t\t\tnew Item\\Pendant('PendantOfPower', 'Pendant Of Power', [0x39, 0x02, 0x34, 0x60, 0x00, 0x69, 0x02]),\n\t\t\tnew Item\\Bow('BowAndArrows', 'Bow And Arrows', [0x3A]),\n\t\t\tnew Item\\Bow('BowAndSilverArrows', 'Bow And Silver Arrows', [0x3B]),\n\t\t\tnew Item\\Bottle('BottleWithBee', 'Bottle (Bee)', [0x3C]),\n\t\t\tnew Item\\Bottle('BottleWithFairy', 'Bottle (Fairy)', [0x3D]),\n\t\t\tnew Item\\Upgrade\\Health('BossHeartContainer', 'Heart Container', [0x3E]),\n\t\t\tnew Item\\Upgrade\\Health('HeartContainer', 'Sancturary Heart Container', [0x3F]),\n\t\t\tnew Item('OneHundredRupees', 'One Hundred Rupees', [0x40]),\n\t\t\tnew Item('FiftyRupees', 'Fifty Rupees', [0x41]),\n\t\t\tnew Item('Heart', 'Small Heart', [0x42]),\n\t\t\tnew Item\\Arrow('Arrow', 'Single Arrow', [0x43]),\n\t\t\tnew Item\\Arrow('TenArrows', 'Ten Arrows', [0x44]),\n\t\t\tnew Item('SmallMagic', 'Small Magic', [0x45]),\n\t\t\tnew Item('ThreeHundredRupees', 'Three Hundred Rupees', [0x46]),\n\t\t\tnew Item('TwentyRupees2', 'Twenty Rupees', [0x47]),\n\t\t\tnew Item\\Bottle('BottleWithGoldBee', 'Bottle (Golden Bee)', [0x48]),\n\t\t\tnew Item('OcarinaActive', 'Flute (active)', [0x4A]),\n\t\t\tnew Item('PegasusBoots', 'Pegasus Boots', [0x4B]),\n\t\t\tnew Item\\Upgrade\\Bomb('BombUpgrade5', 'Bomb Upgrade (+5)', [0x51]),\n\t\t\tnew Item\\Upgrade\\Bomb('BombUpgrade10', 'Bomb Upgrade (+10)', [0x52]),\n\t\t\tnew Item\\Upgrade\\Bomb('BombUpgrade50', 'Bomb Upgrade (+50)', [0x4C]),\n\t\t\tnew Item\\Upgrade\\Arrow('ArrowUpgrade5', 'Arrow Upgrade (+5)', [0x53]),\n\t\t\tnew Item\\Upgrade\\Arrow('ArrowUpgrade10', 'Arrow Upgrade (+10)', [0x54]),\n\t\t\tnew Item\\Upgrade\\Arrow('ArrowUpgrade70', 'Arrow Upgrade (+70)', [0x4D]),\n\t\t\tnew Item\\Upgrade\\Magic('HalfMagic', 'Half Magic', [0x4E]),\n\t\t\tnew Item\\Upgrade\\Magic('QuarterMagic', 'Quarter Magic', [0x4F]),\n\t\t\tnew Item\\Programmable('Programmable1', 'Programmable 1', [0x55]),\n\t\t\tnew Item\\Programmable('Programmable2', 'Programmable 2', [0x56]),\n\t\t\tnew Item\\Programmable('Programmable3', 'Programmable 3', [0x57]),\n\t\t\tnew Item('SilverArrowUpgrade', 'Silver Arrows Upgrade', [0x58]),\n\t\t\tnew Item('Rupoor', 'Rupoor', [0x59]),\n\t\t\tnew Item('RedClock', 'Red Clock', [0x5B]),\n\t\t\tnew Item('BlueClock', 'Blue Clock', [0x5C]),\n\t\t\tnew Item('GreenClock', 'Green Clock', [0x5D]),\n\t\t\tnew Item\\Sword('ProgressiveSword', 'Progressive Sword', [0x5E]),\n\t\t\tnew Item\\Shield('ProgressiveShield', 'Progressive Shield', [0x5F]),\n\t\t\tnew Item('ProgressiveArmor', 'Progressive Armor', [0x60]),\n\t\t\tnew Item('ProgressiveGlove', 'Progressive Glove', [0x61]),\n\t\t\tnew Item('singleRNG', 'Unique RNG Item', [0x62]),\n\t\t\tnew Item('multiRNG', 'Non-Unique RNG Item', [0x63]),\n\t\t\tnew Item\\Event('Triforce', 'Triforce', [0x6A]),\n\t\t\tnew Item('PowerStar', 'Power Star', [0x6B]),\n\t\t\tnew Item('TriforcePiece', 'Triforce Piece', [0x6C]),\n\t\t\tnew Item\\Map('MapLW', 'Light World Map', [0x70]),\n\t\t\tnew Item\\Map('MapDW', 'Dark World Map', [0x71]),\n\t\t\tnew Item\\Map('MapA2', 'Ganons Tower Map', [0x72]),\n\t\t\tnew Item\\Map('MapD7', 'Turtle Rock Map', [0x73]),\n\t\t\tnew Item\\Map('MapD4', 'Thieves Town Map', [0x74]),\n\t\t\tnew Item\\Map('MapP3', 'Tower of Hera Map', [0x75]),\n\t\t\tnew Item\\Map('MapD5', 'Ice Palace Map', [0x76]),\n\t\t\tnew Item\\Map('MapD3', 'Skull Woods Map', [0x77]),\n\t\t\tnew Item\\Map('MapD6', 'Misery Mire Map', [0x78]),\n\t\t\tnew Item\\Map('MapD1', 'Palace of Darkness Map', [0x79]),\n\t\t\tnew Item\\Map('MapD2', 'Swamp Palace Map', [0x7A]),\n\t\t\tnew Item\\Map('MapA1', 'Agahnims Tower Map', [0x7B]),\n\t\t\tnew Item\\Map('MapP2', 'Desert Palace Map', [0x7C]),\n\t\t\tnew Item\\Map('MapP1', 'Eastern Palace Map', [0x7D]),\n\t\t\tnew Item\\Map('MapH1', 'Hyrule Castle Map', [0x7E]),\n\t\t\tnew Item\\Map('MapH2', 'Sewers Map', [0x7F]),\n\t\t\tnew Item\\Compass('CompassA2', 'Ganons Tower Compass', [0x82]),\n\t\t\tnew Item\\Compass('CompassD7', 'Turtle Rock Compass', [0x83]),\n\t\t\tnew Item\\Compass('CompassD4', 'Thieves Town Compass', [0x84]),\n\t\t\tnew Item\\Compass('CompassP3', 'Tower of Hera Compass', [0x85]),\n\t\t\tnew Item\\Compass('CompassD5', 'Ice Palace Compass', [0x86]),\n\t\t\tnew Item\\Compass('CompassD3', 'Skull Woods Compass', [0x87]),\n\t\t\tnew Item\\Compass('CompassD6', 'Misery Mire Compass', [0x88]),\n\t\t\tnew Item\\Compass('CompassD1', 'Palace of Darkness Compass', [0x89]),\n\t\t\tnew Item\\Compass('CompassD2', 'Swamp Palace Compass', [0x8A]),\n\t\t\tnew Item\\Compass('CompassA1', 'Agahnims Tower Compass', [0x8B]),\n\t\t\tnew Item\\Compass('CompassP2', 'Desert Palace Compass', [0x8C]),\n\t\t\tnew Item\\Compass('CompassP1', 'Eastern Palace Compass', [0x8D]),\n\t\t\tnew Item\\Compass('CompassH1', 'Hyrule Castle Compass', [0x8E]),\n\t\t\tnew Item\\Compass('CompassH2', 'Sewers Compass', [0x8F]),\n\t\t\tnew Item\\BigKey('BigKeyA2', 'Ganons Tower Big Key', [0x92]),\n\t\t\tnew Item\\BigKey('BigKeyD7', 'Turtle Rock Big Key', [0x93]),\n\t\t\tnew Item\\BigKey('BigKeyD4', 'Thieves Town Big Key', [0x94]),\n\t\t\tnew Item\\BigKey('BigKeyP3', 'Tower of Hera Big Key', [0x95]),\n\t\t\tnew Item\\BigKey('BigKeyD5', 'Ice Palace Big Key', [0x96]),\n\t\t\tnew Item\\BigKey('BigKeyD3', 'Skull Woods Big Key', [0x97]),\n\t\t\tnew Item\\BigKey('BigKeyD6', 'Misery Mire Big Key', [0x98]),\n\t\t\tnew Item\\BigKey('BigKeyD1', 'Palace of Darkness Big Key', [0x99]),\n\t\t\tnew Item\\BigKey('BigKeyD2', 'Swamp Palace Big Key', [0x9A]),\n\t\t\tnew Item\\BigKey('BigKeyA1', 'Agahnims Tower Big Key', [0x9B]),\n\t\t\tnew Item\\BigKey('BigKeyP2', 'Desert Palace Big Key', [0x9C]),\n\t\t\tnew Item\\BigKey('BigKeyP1', 'Eastern Palace Big Key', [0x9D]),\n\t\t\tnew Item\\BigKey('BigKeyH1', 'Hyrule Castle Big Key', [0x9E]),\n\t\t\tnew Item\\BigKey('BigKeyH2', 'Sewers Big Key', [0x9F]),\n\t\t\tnew Item\\Key('KeyH2', 'Sewers Key', [0xA0]),\n\t\t\tnew Item\\Key('KeyH1', 'Hyrule Castle Key', [0xA1]),\n\t\t\tnew Item\\Key('KeyP1', 'Eastern Palace Key', [0xA2]),\n\t\t\tnew Item\\Key('KeyP2', 'Desert Palace Key', [0xA3]),\n\t\t\tnew Item\\Key('KeyA1', 'Agahnims Tower Key', [0xA4]),\n\t\t\tnew Item\\Key('KeyD2', 'Swamp Palace Key', [0xA5]),\n\t\t\tnew Item\\Key('KeyD1', 'Palace of Darkness Key', [0xA6]),\n\t\t\tnew Item\\Key('KeyD6', 'Misery Mire Key', [0xA7]),\n\t\t\tnew Item\\Key('KeyD3', 'Skull Woods Key', [0xA8]),\n\t\t\tnew Item\\Key('KeyD5', 'Ice Palace Key', [0xA9]),\n\t\t\tnew Item\\Key('KeyP3', 'Tower of Hera Key', [0xAA]),\n\t\t\tnew Item\\Key('KeyD4', 'Thieves Town Key', [0xAB]),\n\t\t\tnew Item\\Key('KeyD7', 'Turtle Rock Key', [0xAC]),\n\t\t\tnew Item\\Key('KeyA2', 'Ganons Tower Key', [0xAD]),\n\t\t\tnew Item\\Key('KeyGK', 'Generic Key', [0xAF]),\n\t\t\tnew Item\\Crystal('Crystal1', 'Crystal 1', [null, 0x02, 0x34, 0x64, 0x40, 0x7F, 0x06]),\n\t\t\tnew Item\\Crystal('Crystal2', 'Crystal 2', [null, 0x10, 0x34, 0x64, 0x40, 0x79, 0x06]),\n\t\t\tnew Item\\Crystal('Crystal3', 'Crystal 3', [null, 0x40, 0x34, 0x64, 0x40, 0x6C, 0x06]),\n\t\t\tnew Item\\Crystal('Crystal4', 'Crystal 4', [null, 0x20, 0x34, 0x64, 0x40, 0x6D, 0x06]),\n\t\t\tnew Item\\Crystal('Crystal5', 'Crystal 5', [null, 0x04, 0x32, 0x64, 0x40, 0x6E, 0x06]),\n\t\t\tnew Item\\Crystal('Crystal6', 'Crystal 6', [null, 0x01, 0x32, 0x64, 0x40, 0x6F, 0x06]),\n\t\t\tnew Item\\Crystal('Crystal7', 'Crystal 7', [null, 0x08, 0x34, 0x64, 0x40, 0x7C, 0x06]),\n\t\t\tnew Item\\Event('RescueZelda', 'Rescue Zelda', [null]),\n\t\t\tnew Item\\Event('DefeatAgahnim', 'Defeat Agahnim', [null]),\n\t\t\tnew Item\\Event('DefeatAgahnim2', 'Defeat Agahnim 2', [null]),\n\t\t\tnew Item\\Event('DefeatGanon', 'Defeat Ganon', [null]),\n\t\t]);\n\t\treturn static::all();\n\t}", "function get_character_information( $rt, $wl, $server, $character, $display_basic_stats = 1, $display_resistances = 0, $display_melee = 0, $display_range = 0, $display_spell = 0, $display_caster_stats = 0, $display_defense = 0, $display_pvp = 0, $display_titles = 0, $display_gear = 1, $display_professions = 1, $display_achievments = 1, $display_statistics = 0, $display_reputation = 0, $display_last_update_string = 0, $display_glyphs = 0, $display_3darmory = 0, $display_3darmory_width = 150, $display_3darmory_height = 150 )\r\n\t{\r\n\t\t// Reset http helpers\r\n\t\t$this -> sleep_counter\t= 1000000;\r\n\t\t$this -> http_error\t= false;\r\n\r\n\t\t// Load textdomain\r\n\t\tif( function_exists( 'load_plugin_textdomain' ) ) {\r\n\t\t\tload_plugin_textdomain( 'wowcd', false, 'wow-character-display' );\r\n\t\t}\r\n\r\n\t\t// Conversions\r\n\t\t$server = urlencode( stripslashes( $server ) );\r\n\t\t$character = urlencode( $character );\r\n\r\n\t\t// Set cache hash\r\n\t\t$this -> _cache_set_hash( $rt, $wl, $server, $character, $display_basic_stats, $display_resistances, $display_melee, $display_range, $display_spell, $display_caster_stats, $display_defense, $display_pvp, $display_titles, $display_gear, $display_professions, $display_achievments, $display_statistics, $display_reputation, $display_last_update_string, $display_glyphs );\r\n\r\n\t\t// Check for cachefile\r\n\t\t$cachefile = $this -> _cache_get_filename();\r\n\t\tif( file_exists( $cachefile ) && !$this -> _cache_recreate( $cachefile ) && !empty( $this -> cache_timeout ) )\r\n\t\t{\r\n\t\t\t$this -> content = file_get_contents( $cachefile );\r\n\t\t\treturn true;\r\n\t\t}\r\n\r\n\t\t// Set Host and URIs\r\n\t\t$host = \"$rt.wowarmory.com\";\r\n\t\t$uri_character = \"/character-sheet.xml?r=$server&n=$character\";\r\n\t\t$uri_achievments = \"/character-achievements.xml?r=$server&n=$character\";\r\n\t\t$uri_reputation = \"/character-reputation.xml?r=$server&n=&character\";\r\n\t\t$uri_statistics = \"/character-statistics.xml?r=$server&n=&character&c=141\";\r\n\r\n\t\t// Read from armory\r\n\t\tif( $body_c = $this -> _http_read( $host, $uri_character ) )\r\n\t\t{\r\n\t\t\t// Get and parse XML\r\n\t\t\tif( preg_match( '#<characterInfo.*>.*</characterInfo>#siU', $body_c, $match ) )\r\n\t\t\t{\r\n\t\t\t\t$parser = xml_parser_create();\r\n\t\t\t\txml_parse_into_struct( $parser, $match[ 0 ], $vals, $index );\r\n\t\t\t\txml_parser_free( $parser );\r\n\t\t\t\tunset( $body_c );\r\n\t\t\t\tunset( $match );\r\n\t\t\t\tif( $index )\r\n\t\t\t\t{\r\n\t\t\t\t\t$char_info = $vals[ $index[ 'CHARACTERINFO' ][ 0 ] ][ 'attributes' ];\r\n\t\t\t\t\tif( $char_info[ 'ERRCODE' ] != 'noCharacter' )\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t// 2hand or 1hand?\r\n\t\t\t\t\t\t$twohand = true;\r\n\t\t\t\t\t\tforeach( $index[ 'ITEM' ] AS $items )\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tif( $vals[ $items ][ 'attributes' ][ 'SLOT' ] == '16' )\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t$twohand = false;\r\n\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t// Surrounding div\r\n\t\t\t\t\t\t$this -> content .= \"<div class=\\\"wow_character wow_character-$character\\\">\";\r\n\r\n\t\t\t\t\t\t// 3D Armory flash object\r\n\t\t\t\t\t\tif( $display_3darmory )\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t$display_3darmory_width = empty( $display_3darmory_width ) ? 150 : $display_3darmory_width;\r\n\t\t\t\t\t\t\t$display_3darmory_height = empty( $display_3darmory_height ) ? 150 : $display_3darmory_height;\r\n\t\t\t\t\t\t\t// eu,us,tw,kr,cn\r\n\t\t\t\t\t\t\t$zone = $rt == 'www' ? 'us' : $rt;\r\n\t\t\t\t\t\t\t$this -> content .= \"<div class=\\\"3darmory_object\\\">\";\r\n\t\t\t\t\t\t\t$this -> content .= \"<script type=\\\"text/javascript\\\" src=\\\"http://www.3darmory.com/api/toon/$zone/$server/$character/$display_3darmory_width/$display_3darmory_height\\\"></script>\";\r\n\t\t\t\t\t\t\t$this -> content .= \"</div>\";\r\n\t\t\t\t\t\t\t$this -> content .= \"\\n<style type=\\\"text/css\\\">.toon_layer a { display:none }</style>\\n\";\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t// Basic infos\r\n\t\t\t\t\t\t$char_attr = $vals[ $index[ 'CHARACTER' ][ 0 ] ][ 'attributes' ];\r\n\t\t\t\t\t\t$spec_attr1 = $vals[ $index[ 'TALENTSPEC' ][ 0 ] ][ 'attributes' ];\r\n\t\t\t\t\t\tif( count( $index[ 'TALENTSPEC' ] ) > 1 )\r\n\t\t\t\t\t\t\t$spec_attr2 = $vals[ $index[ 'TALENTSPEC' ][ 1 ] ][ 'attributes' ];\r\n\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\t$spec_attr2 = false;\r\n\t\t\t\t\t\t$this -> content .= \"<div class=\\\"armory_char_image\\\"><img src=\\\"http://$rt.wowarmory.com/images/portraits/wow\" . ($char_attr[ 'LEVEL' ] < 70 ? '' : ($char_attr[ 'LEVEL' ] < 80 ? '-70' : '-80')) . \"/\" . $char_attr[ 'GENDERID' ] . \"-\" . $char_attr[ 'RACEID' ] . \"-\" . $char_attr[ 'CLASSID' ] . \".gif\\\" width=\\\"48\\\" class=\\\"armory_char_prof\\\" /></div>\";\r\n\t\t\t\t\t\t$this -> content .= \"<div class=\\\"armory_char_name\\\"><a href=\\\"http://$rt.wowarmory.com/character-sheet.xml?r=$server&n=$character\\\">\" . ($char_attr[ 'PREFIX' ] ? $char_attr[ 'PREFIX' ] . ' ' : '') . $char_attr[ 'NAME' ] . ($char_attr[ 'SUFFIX' ] ? $char_attr[ 'SUFFIX' ] . ' ' : '') . \"</a></div>\";\r\n\t\t\t\t\t\t$this -> content .= \"<div class=\\\"armory_char_guildname\\\"><a href=\\\"http://$rt.wowarmory.com/guild-info.xml?\" . $char_attr[ 'GUILDURL' ] . \"\\\">\" . $char_attr[ 'GUILDNAME' ] . \"</a></div>\";\r\n\t\t\t\t\t\t$this -> content .= \"<div class=\\\"armory_char_faction\\\">\" . $char_attr[ 'FACTION' ] . \"</div>\";\r\n\t\t\t\t\t\t$this -> content .= \"<div class=\\\"armory_char_realm\\\">\" . $char_attr[ 'REALM' ] . \" (\" . ($rt == 'eu' ? 'EU' : 'US') . \")</div>\";\r\n\t\t\t\t\t\t$this -> content .= \"<div class=\\\"armory_char_levelraceclass\\\">\" . __( \"Level\", \"wowcd\" ) . \" \" . $char_attr[ 'LEVEL' ] . \" \" . $char_attr[ 'RACE' ] . \" \" . $char_attr[ 'CLASS' ] . \"</div>\";\r\n\t\t\t\t\t\tif( $spec_attr2 == false )\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t$this -> content .= \"<div class=\\\"armory_char_specced\\\">\" . __( \"Talents\", \"wowcd\" ) . \": \" . $spec_attr1[ 'TREEONE' ] . \"/\" . $spec_attr1[ 'TREETWO' ] . \"/\" . $spec_attr1[ 'TREETHREE' ] . \" (\" . $spec_attr1[ 'PRIM' ] . \")</div>\";\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t// Order specs by talent spec group\r\n\t\t\t\t\t\t\tif( $spec_attr1[ 'GROUP' ] == '2' )\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t$tmp_spec_attr = $spec_attr2;\r\n\t\t\t\t\t\t\t\t$spec_attr2 = $spec_attr1;\r\n\t\t\t\t\t\t\t\t$spec_attr1 = $tmp_spec_attr;\r\n\t\t\t\t\t\t\t\tunset( $tmp_spec_attr );\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t$this -> content .= \"<div class=\\\"armory_char_specced\\\">\" . __( \"1st talents\", \"wowcd\" ) . \": \" . $spec_attr1[ 'TREEONE' ] . \"/\" . $spec_attr1[ 'TREETWO' ] . \"/\" . $spec_attr1[ 'TREETHREE' ] . \" (\" . $spec_attr1[ 'PRIM' ] . \")</div>\";\r\n\t\t\t\t\t\t\t$this -> content .= \"<div class=\\\"armory_char_specced\\\">\" . __( \"2nd talents\", \"wowcd\" ) . \": \" . $spec_attr2[ 'TREEONE' ] . \"/\" . $spec_attr2[ 'TREETWO' ] . \"/\" . $spec_attr2[ 'TREETHREE' ] . \" (\" . $spec_attr2[ 'PRIM' ] . \")</div>\";\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tif( $display_basic_stats )\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t// Base stats\r\n\t\t\t\t\t\t\t$this -> content .= \"<div class=\\\"armory_basestats\\\">\";\r\n\t\t\t\t\t\t\t$this -> content .= \"<h4>\" . __( \"Base stats\", \"wowcd\" ) . \"</h4>\";\r\n\t\t\t\t\t\t\t$this -> content .= \"<ul class=\\\"armory_basestat_list\\\">\";\r\n\t\t\t\t\t\t\t$health = $vals[ $index[ 'HEALTH' ][ 0 ] ][ 'attributes' ];\r\n\t\t\t\t\t\t\t$mana = $vals[ $index[ 'SECONDBAR' ][ 0 ] ][ 'attributes' ];\r\n\t\t\t\t\t\t\t$strength = $vals[ $index[ 'STRENGTH' ][ 0 ] ][ 'attributes' ];\r\n\t\t\t\t\t\t\t$agility = $vals[ $index[ 'AGILITY' ][ 0 ] ][ 'attributes' ];\r\n\t\t\t\t\t\t\t$stamina = $vals[ $index[ 'STAMINA' ][ 0 ] ][ 'attributes' ];\r\n\t\t\t\t\t\t\t$intellect = $vals[ $index[ 'INTELLECT' ][ 0 ] ][ 'attributes' ];\r\n\t\t\t\t\t\t\t$spirit = $vals[ $index[ 'SPIRIT' ][ 0 ] ][ 'attributes' ];\r\n\t\t\t\t\t\t\t$armor = $vals[ $index[ 'ARMOR' ][ 0 ] ][ 'attributes' ];\r\n\t\t\t\t\t\t\t$agility = $vals[ $index[ 'AGILITY' ][ 0 ] ][ 'attributes' ];\r\n\t\t\t\t\t\t\t$this -> content .= \"<li class=\\\"armory_basestat_item\\\">\" . __( \"Health\", \"wowcd\" ) . \": \" . $health[ 'EFFECTIVE' ] . \"</li>\";\r\n\t\t\t\t\t\t\tif( $mana[ 'TYPE' ] == 'm' ) // Only display mana, if mana class (energy and runepower is not worth to know)\r\n\t\t\t\t\t\t\t\t$this -> content .= \"<li class=\\\"armory_basestat_item\\\">\" . __( \"Mana\", \"wowcd\" ) . \": \" . $mana[ 'EFFECTIVE' ] . \"</li>\";\r\n\t\t\t\t\t\t\t$this -> content .= \"<li class=\\\"armory_basestat_item\\\">\" . __( \"Agility\", \"wowcd\" ) . \": \" . $agility[ 'EFFECTIVE' ] . \"</li>\";\r\n\t\t\t\t\t\t\t$this -> content .= \"<li class=\\\"armory_basestat_item\\\">\" . __( \"Stamina\", \"wowcd\" ) . \": \" . $stamina[ 'EFFECTIVE' ] . \"</li>\";\r\n\t\t\t\t\t\t\t$this -> content .= \"<li class=\\\"armory_basestat_item\\\">\" . __( \"Intellect\", \"wowcd\" ) . \": \" . $intellect[ 'EFFECTIVE' ] . \"</li>\";\r\n\t\t\t\t\t\t\t$this -> content .= \"<li class=\\\"armory_basestat_item\\\">\" . __( \"Spirit\", \"wowcd\" ) . \": \" . $spirit[ 'EFFECTIVE' ] . \"</li>\";\r\n\t\t\t\t\t\t\t$this -> content .= \"<li class=\\\"armory_basestat_item\\\">\" . __( \"Armor\", \"wowcd\" ) . \": \" . $armor[ 'EFFECTIVE' ] . \"</li>\";\r\n\t\t\t\t\t\t\t$this -> content .= \"<li class=\\\"armory_basestat_item\\\">\" . __( \"Agility\", \"wowcd\" ) . \": \" . $agility[ 'EFFECTIVE' ] . \"</li>\";\r\n\t\t\t\t\t\t\t$this -> content .= \"</ul>\";\r\n\t\t\t\t\t\t\t$this -> content .= \"</div>\";\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tif( $display_resistances )\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t// Resistances\r\n\t\t\t\t\t\t\t$this -> content .= \"<div class=\\\"armory_resistances\\\">\";\r\n\t\t\t\t\t\t\t$this -> content .= \"<h4>\" . __( \"Resistances\", \"wowcd\" ) . \"</h4>\";\r\n\t\t\t\t\t\t\t$this -> content .= \"<ul class=\\\"armory_resistance_list\\\">\";\r\n\t\t\t\t\t\t\t$arcane = $vals[ $index[ 'ARCANE' ][ 0 ] ][ 'attributes' ];\r\n\t\t\t\t\t\t\t$fire = $vals[ $index[ 'FIRE' ][ 0 ] ][ 'attributes' ];\r\n\t\t\t\t\t\t\t$frost = $vals[ $index[ 'FROST' ][ 0 ] ][ 'attributes' ];\r\n\t\t\t\t\t\t\t$holy = $vals[ $index[ 'HOLY' ][ 0 ] ][ 'attributes' ];\r\n\t\t\t\t\t\t\t$nature = $vals[ $index[ 'NATURE' ][ 0 ] ][ 'attributes' ];\r\n\t\t\t\t\t\t\t$shadow = $vals[ $index[ 'SHADOW' ][ 0 ] ][ 'attributes' ];\r\n\t\t\t\t\t\t\t$this -> content .= \"<li class=\\\"armory_resistance_item\\\">\" . __( \"Arcane\", \"wowcd\" ) . \": \" . $arcane[ 'VALUE' ] . \"</li>\";\r\n\t\t\t\t\t\t\t$this -> content .= \"<li class=\\\"armory_resistance_item\\\">\" . __( \"Fire\", \"wowcd\" ) . \": \" . $fire[ 'VALUE' ] . \"</li>\";\r\n\t\t\t\t\t\t\t$this -> content .= \"<li class=\\\"armory_resistance_item\\\">\" . __( \"Frost\", \"wowcd\" ) . \": \" . $frost[ 'VALUE' ] . \"</li>\";\r\n\t\t\t\t\t\t\t$this -> content .= \"<li class=\\\"armory_resistance_item\\\">\" . __( \"Holy\", \"wowcd\" ) . \": \" . $holy[ 'VALUE' ] . \"</li>\";\r\n\t\t\t\t\t\t\t$this -> content .= \"<li class=\\\"armory_resistance_item\\\">\" . __( \"Nature\", \"wowcd\" ) . \": \" . $nature[ 'VALUE' ] . \"</li>\";\r\n\t\t\t\t\t\t\t$this -> content .= \"<li class=\\\"armory_resistance_item\\\">\" . __( \"Shadow\", \"wowcd\" ) . \": \" . $shadow[ 'VALUE' ] . \"</li>\";\r\n\t\t\t\t\t\t\t$this -> content .= \"</ul>\";\r\n\t\t\t\t\t\t\t$this -> content .= \"</div>\";\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tif( $display_melee )\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t// Melee damage\r\n\t\t\t\t\t\t\t$this -> content .= \"<div class=\\\"armory_melee\\\">\";\r\n\t\t\t\t\t\t\t$this -> content .= \"<h4>\" . __( \"Melee\", \"wowcd\" ) . \"</h4>\";\r\n\t\t\t\t\t\t\t$this -> content .= \"<ul class=\\\"armory_melee_list\\\">\";\r\n\t\t\t\t\t\t\t$mainhanddamage = $vals[ $index[ 'MAINHANDDAMAGE' ][ 0 ] ][ 'attributes' ];\r\n\t\t\t\t\t\t\t$offhanddamage = $vals[ $index[ 'OFFHANDDAMAGE' ][ 0 ] ][ 'attributes' ];\r\n\t\t\t\t\t\t\t$mainhandspeed = $vals[ $index[ 'MAINHANDSPEED' ][ 0 ] ][ 'attributes' ];\r\n\t\t\t\t\t\t\t$offhandspeed = $vals[ $index[ 'OFFHANDSPEED' ][ 0 ] ][ 'attributes' ];\r\n\t\t\t\t\t\t\t$power = $vals[ $index[ 'POWER' ][ 0 ] ][ 'attributes' ];\r\n\t\t\t\t\t\t\t$hitrating = $vals[ $index[ 'HITRATING' ][ 0 ] ][ 'attributes' ];\r\n\t\t\t\t\t\t\t$critchance = $vals[ $index[ 'CRITCHANCE' ][ 0 ] ][ 'attributes' ];\r\n\t\t\t\t\t\t\t$expertise = $vals[ $index[ 'EXPERTISE' ][ 0 ] ][ 'attributes' ];\r\n\t\t\t\t\t\t\t$this -> content .= \"<li class=\\\"armory_melee_item\\\">\" . __( \"Main hand\", \"wowcd\" ) . \": \" . $mainhanddamage[ 'MAX' ] . \" (\" . __( \"max\", \"wowcd\" ) . \") \" . $mainhanddamage[ 'MIN' ] . \" (\" . __( \"min\", \"wowcd\" ) . \") \" . $mainhanddamage[ 'DPS' ] . \" (\" . __( \"dps\", \"wowcd\" ) . \") \" . $mainhanddamage[ 'SPEED' ] . \" (\" . __( \"speed\", \"wowcd\" ) . \")</li>\";\r\n\t\t\t\t\t\t\tif( !$twohand )\r\n\t\t\t\t\t\t\t\t$this -> content .= \"<li class=\\\"armory_melee_item\\\">\" . __( \"Off hand\", \"wowcd\" ) . \": \" . $offhanddamage[ 'MAX' ] . \" (\" . __( \"max\", \"wowcd\" ) . \") \" . $offhanddamage[ 'MIN' ] . \" (\" . __( \"min\", \"wowcd\" ) . \") \" . $offhanddamage[ 'DPS' ] . \" (\" . __( \"dps\", \"wowcd\" ) . \") \" . $offhanddamage[ 'SPEED' ] . \" (\" . __( \"speed\", \"wowcd\" ) . \")</li>\";\r\n\t\t\t\t\t\t\t$this -> content .= \"<li class=\\\"armory_melee_item\\\">\" . __( \"Main hand speed\", \"wowcd\" ) . \": \" . $mainhandspeed[ 'VALUE' ] . \", \" . $mainhandspeed[ 'HASTEPERCENT' ] . \"% \" . __( \"haste\", \"wowcd\" ) . \"</li>\";\r\n\t\t\t\t\t\t\tif( !$twohand )\r\n\t\t\t\t\t\t\t\t$this -> content .= \"<li class=\\\"armory_melee_item\\\">\" . __( \"Off hand speed\", \"wowcd\" ) . \": \" . $offhandspeed[ 'VALUE' ] . \", \" . $offhandspeed[ 'HASTEPERCENT' ] . \"% \" . __( \"haste\", \"wowcd\" ) . \"</li>\";\r\n\t\t\t\t\t\t\t$this -> content .= \"<li class=\\\"armory_melee_item\\\">\" . __( \"Power\", \"wowcd\" ) . \": \" . $power[ 'EFFECTIVE' ] . \"</li>\";\r\n\t\t\t\t\t\t\t$this -> content .= \"<li class=\\\"armory_melee_item\\\">\" . __( \"Hit rating\", \"wowcd\" ) . \": \" . $hitrating[ 'INCREASEDHITPERCENT' ] . \"% (\" . $hitrating[ 'VALUE' ] . \")</li>\";\r\n\t\t\t\t\t\t\t$this -> content .= \"<li class=\\\"armory_melee_item\\\">\" . __( \"Critical chance\", \"wowcd\" ) . \": \" . $critchance[ 'PERCENT' ] . \"%</li>\";\r\n\t\t\t\t\t\t\t$this -> content .= \"<li class=\\\"armory_melee_item\\\">\" . __( \"Expertise rating\", \"wowcd\" ) . \": \" . $expertise[ 'PERCENT' ] . \"%</li>\";\r\n\t\t\t\t\t\t\t$this -> content .= \"</ul>\";\r\n\t\t\t\t\t\t\t$this -> content .= \"</div>\";\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tif( $display_range )\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t// Range damage\r\n\t\t\t\t\t\t\t$this -> content .= \"<div class=\\\"armory_range\\\">\";\r\n\t\t\t\t\t\t\t$this -> content .= \"<h4>\" . __( \"Range\", \"wowcd\" ) . \"</h4>\";\r\n\t\t\t\t\t\t\t$this -> content .= \"<ul class=\\\"armory_range_list\\\">\";\r\n\t\t\t\t\t\t\t$weaponskill = $vals[ $index[ 'WEAPONSKILL' ][ 0 ] ][ 'attributes' ];\r\n\t\t\t\t\t\t\t$damage = $vals[ $index[ 'DAMAGE' ][ 0 ] ][ 'attributes' ];\r\n\t\t\t\t\t\t\t$speed = $vals[ $index[ 'SPEED' ][ 0 ] ][ 'attributes' ];\r\n\t\t\t\t\t\t\t$power = $vals[ $index[ 'POWER' ][ 0 ] ][ 'attributes' ];\r\n\t\t\t\t\t\t\t$hitrating = $vals[ $index[ 'HITRATING' ][ 1 ] ][ 'attributes' ];\r\n\t\t\t\t\t\t\t$critchance = $vals[ $index[ 'CRITCHANCE' ][ 1 ] ][ 'attributes' ];\r\n\t\t\t\t\t\t\t$this -> content .= \"<li class=\\\"armory_range_item\\\">\" . __( \"Weapon skill\", \"wowcd\" ) . \": \" . $weaponskill[ 'VALUE' ] . \"</li>\";\r\n\t\t\t\t\t\t\t$this -> content .= \"<li class=\\\"armory_melee_item\\\">\" . __( \"Damage\", \"wowcd\" ) . \": \" . $damage[ 'MAX' ] . \" (\" . __( \"max\", \"wowcd\" ) . \") \" . $damage[ 'MIN' ] . \" (\" . __( \"min\", \"wowcd\" ) . \") \" . $damage[ 'DPS' ] . \" (\" . __( \"dps\", \"wowcd\" ) . \") \" . $damage[ 'SPEED' ] . \" (\" . __( \"speed\", \"wowcd\" ) . \")</li>\";\r\n\t\t\t\t\t\t\t$this -> content .= \"<li class=\\\"armory_range_item\\\">\" . __( \"Speed\", \"wowcd\" ) . \": \" . $speed[ 'VALUE' ] . \"</li>\";\r\n\t\t\t\t\t\t\t$this -> content .= \"<li class=\\\"armory_range_item\\\">\" . __( \"Power\", \"wowcd\" ) . \": \" . $power[ 'EFFECTIVE' ] . \"</li>\";\r\n\t\t\t\t\t\t\t$this -> content .= \"<li class=\\\"armory_range_item\\\">\" . __( \"Hit rating\", \"wowcd\" ) . \": \" . $hitrating[ 'INCREASEDHITPERCENT' ] . \"% (\" . $hitrating[ 'VALUE' ] . \")</li>\";\r\n\t\t\t\t\t\t\t$this -> content .= \"<li class=\\\"armory_range_item\\\">\" . __( \"Critical chance\", \"wowcd\" ) . \": \" . $critchance[ 'PERCENT' ] . \"%</li>\";\r\n\t\t\t\t\t\t\t$this -> content .= \"</ul>\";\r\n\t\t\t\t\t\t\t$this -> content .= \"</div>\";\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tif( $display_spell )\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t// Spell damage\r\n\t\t\t\t\t\t\t$this -> content .= \"<div class=\\\"armory_spelldamage\\\">\";\r\n\t\t\t\t\t\t\t$this -> content .= \"<h4>\" . __( \"Spell damage\", \"wowcd\" ) . \"</h4>\";\r\n\t\t\t\t\t\t\t$this -> content .= \"<ul class=\\\"armory_spelldamage_list\\\">\";\r\n\t\t\t\t\t\t\t$arcane = $vals[ $index[ 'ARCANE' ][ 1 ] ][ 'attributes' ];\r\n\t\t\t\t\t\t\t$fire = $vals[ $index[ 'FIRE' ][ 1 ] ][ 'attributes' ];\r\n\t\t\t\t\t\t\t$frost = $vals[ $index[ 'FROST' ][ 1 ] ][ 'attributes' ];\r\n\t\t\t\t\t\t\t$holy = $vals[ $index[ 'HOLY' ][ 1 ] ][ 'attributes' ];\r\n\t\t\t\t\t\t\t$nature = $vals[ $index[ 'NATURE' ][ 1 ] ][ 'attributes' ];\r\n\t\t\t\t\t\t\t$shadow = $vals[ $index[ 'SHADOW' ][ 1 ] ][ 'attributes' ];\r\n\t\t\t\t\t\t\t$crit_arcane = $vals[ $index[ 'ARCANE' ][ 2 ] ][ 'attributes' ];\r\n\t\t\t\t\t\t\t$crit_fire = $vals[ $index[ 'FIRE' ][ 2 ] ][ 'attributes' ];\r\n\t\t\t\t\t\t\t$crit_frost = $vals[ $index[ 'FROST' ][ 2 ] ][ 'attributes' ];\r\n\t\t\t\t\t\t\t$crit_holy = $vals[ $index[ 'HOLY' ][ 2 ] ][ 'attributes' ];\r\n\t\t\t\t\t\t\t$crit_nature = $vals[ $index[ 'NATURE' ][ 2 ] ][ 'attributes' ];\r\n\t\t\t\t\t\t\t$crit_shadow = $vals[ $index[ 'SHADOW' ][ 2 ] ][ 'attributes' ];\r\n\t\t\t\t\t\t\t// Group +dmg by value\r\n\t\t\t\t\t\t\t$spelldmg = array();\r\n\t\t\t\t\t\t\t$spelldmg[ $arcane[ 'VALUE' ] ][] = array( 'dmgtype' => 'Arcane', 'dmg' => $arcane[ 'VALUE' ], 'crit' => $crit_arcane[ 'PERCENT' ] );\r\n\t\t\t\t\t\t\t$spelldmg[ $fire[ 'VALUE' ] ][] = array( 'dmgtype' => 'Fire', 'dmg' => $fire[ 'VALUE' ], 'crit' => $crit_fire[ 'PERCENT' ] );\r\n\t\t\t\t\t\t\t$spelldmg[ $frost[ 'VALUE' ] ][] = array( 'dmgtype' => 'Frost', 'dmg' => $frost[ 'VALUE' ], 'crit' => $crit_frost[ 'PERCENT' ] );\r\n\t\t\t\t\t\t\t$spelldmg[ $holy[ 'VALUE' ] ][] = array( 'dmgtype' => 'Holy', 'dmg' => $holy[ 'VALUE' ], 'crit' => $crit_holy[ 'PERCENT' ] );\r\n\t\t\t\t\t\t\t$spelldmg[ $nature[ 'VALUE' ] ][] = array( 'dmgtype' => 'Nature', 'dmg' => $nature[ 'VALUE' ], 'crit' => $crit_nature[ 'PERCENT' ] );\r\n\t\t\t\t\t\t\t$spelldmg[ $shadow[ 'VALUE' ] ][] = array( 'dmgtype' => 'Shadow', 'dmg' => $shadow[ 'VALUE' ], 'crit' => $crit_shadow[ 'PERCENT' ] );\r\n\t\t\t\t\t\t\tforeach( $spelldmg AS $plusdmg => $damages )\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t// If damage bonus is all the same\r\n\t\t\t\t\t\t\t\tif( count( $damages ) == 6 )\r\n\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t$this -> content .= \"<li class=\\\"armory_spelldamage_item\\\">\" . __( \"Damagebonus\", \"wowcd\" ) . \": \" . $arcane[ 'VALUE' ] . \" (\" . $crit_arcane[ 'PERCENT' ] . \"% \" . __( \"crit\", \"wowcd\" ) . \")</li>\";\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t// If damage bonus is not all the same\r\n\t\t\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t$this -> content .= \"<li class=\\\"armory_spelldamage_item\\\">\";\r\n\t\t\t\t\t\t\t\t\t$damagetypes = array();\r\n\t\t\t\t\t\t\t\t\tforeach( $damages AS $dtypekey => $dtypearr )\r\n\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\t$damagebonus = $dtypearr[ 'dmg' ];\r\n\t\t\t\t\t\t\t\t\t\t$damagecrit = $dtypearr[ 'crit' ];\r\n\t\t\t\t\t\t\t\t\t\tif( $dtypearr[ 'dmgtype' ] == 'Arcane' )\r\n\t\t\t\t\t\t\t\t\t\t\t$damagetypes[] = __( \"Arcane\", \"wowcd\" );\r\n\t\t\t\t\t\t\t\t\t\tif( $dtypearr[ 'dmgtype' ] == 'Fire' )\r\n\t\t\t\t\t\t\t\t\t\t\t$damagetypes[] = __( \"Fire\", \"wowcd\" );\r\n\t\t\t\t\t\t\t\t\t\tif( $dtypearr[ 'dmgtype' ] == 'Frost' )\r\n\t\t\t\t\t\t\t\t\t\t\t$damagetypes[] = __( \"Frost\", \"wowcd\" );\r\n\t\t\t\t\t\t\t\t\t\tif( $dtypearr[ 'dmgtype' ] == 'Holy' )\r\n\t\t\t\t\t\t\t\t\t\t\t$damagetypes[] = __( \"Holy\", \"wowcd\" );\r\n\t\t\t\t\t\t\t\t\t\tif( $dtypearr[ 'dmgtype' ] == 'Nature' )\r\n\t\t\t\t\t\t\t\t\t\t\t$damagetypes[] = __( \"Nature\", \"wowcd\" );\r\n\t\t\t\t\t\t\t\t\t\tif( $dtypearr[ 'dmgtype' ] == 'Shadow' )\r\n\t\t\t\t\t\t\t\t\t\t\t$damagetypes[] = __( \"Shadow\", \"wowcd\" );\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t$this -> content .= implode( \", \", $damagetypes );\r\n\t\t\t\t\t\t\t\t\t$this -> content .= \": \" . $damagebonus . \" (\" . $damagecrit . \"% \" . __( \"crit\", \"wowcd\" ) . \")\";\r\n\t\t\t\t\t\t\t\t\t$this -> content .= \"</li>\";\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t$this -> content .= \"</ul>\";\r\n\t\t\t\t\t\t\t$this -> content .= \"</div>\";\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tif( $display_caster_stats )\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t// Caster stats\r\n\t\t\t\t\t\t\t$this -> content .= \"<div class=\\\"armory_casterstats\\\">\";\r\n\t\t\t\t\t\t\t$this -> content .= \"<h4>\" . __( \"Caster stats\", \"wowcd\" ) . \"</h4>\";\r\n\t\t\t\t\t\t\t$this -> content .= \"<ul class=\\\"armory_casterstats_list\\\">\";\r\n\t\t\t\t\t\t\t$bonushealing = $vals[ $index[ 'BONUSHEALING' ][ 0 ] ][ 'attributes' ];\r\n\t\t\t\t\t\t\t$manaregen = $vals[ $index[ 'MANAREGEN' ][ 0 ] ][ 'attributes' ];\r\n\t\t\t\t\t\t\t$hasterating = $vals[ $index[ 'HASTERATING' ][ 0 ] ][ 'attributes' ];\r\n\t\t\t\t\t\t\t$hitrating = $vals[ $index[ 'HITRATING' ][ 2 ] ][ 'attributes' ];\r\n\t\t\t\t\t\t\t$penetration = $vals[ $index[ 'PENETRATION' ][ 0 ] ][ 'attributes' ];\r\n\t\t\t\t\t\t\t$this -> content .= \"<li class=\\\"armory_casterstats_item\\\">\" . __( \"Bonus heal\", \"wowcd\" ) . \": \" . $bonushealing[ 'VALUE' ] . \" </li>\";\r\n\t\t\t\t\t\t\t$this -> content .= \"<li class=\\\"armory_casterstats_item\\\">\" . __( \"Mana reg\", \"wowcd\" ) . \": \" . $manaregen[ 'NOTCASTING' ] . \" (\" . __( \"not casting\", \"wowcd\" ) . \") \" . $manaregen[ 'CASTING' ] . \" (\" . __( \"casting\", \"wowcd\" ) . \")</li>\";\r\n\t\t\t\t\t\t\t$this -> content .= \"<li class=\\\"armory_casterstats_item\\\">\" . __( \"Haste rating\", \"wowcd\" ) . \": \" . $hasterating[ 'HASTERATING' ] . \"</li>\";\r\n\t\t\t\t\t\t\t$this -> content .= \"<li class=\\\"armory_casterstats_item\\\">\" . __( \"Hit rating\", \"wowcd\" ) . \": \" . $hitrating[ 'INCREASEDHITPERCENT' ] . \"% (\" . $hitrating[ 'VALUE' ] . \")</li>\";\r\n\t\t\t\t\t\t\t$this -> content .= \"<li class=\\\"armory_casterstats_item\\\">\" . __( \"Penetrating rating\", \"wowcd\" ) . \": \" . $penetration[ 'VALUE' ] . \"</li>\";\r\n\t\t\t\t\t\t\t$this -> content .= \"</ul>\";\r\n\t\t\t\t\t\t\t$this -> content .= \"</div>\";\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tif( $display_defense )\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t// Defense\r\n\t\t\t\t\t\t\t$this -> content .= \"<div class=\\\"armory_defenses\\\">\";\r\n\t\t\t\t\t\t\t$this -> content .= \"<h4>\" . __( \"Defense\", \"wowcd\" ) . \"</h4>\";\r\n\t\t\t\t\t\t\t$this -> content .= \"<ul class=\\\"armory_defense_list\\\">\";\r\n\t\t\t\t\t\t\t$armor = $vals[ $index[ 'ARMOR' ][ 1 ] ][ 'attributes' ];\r\n\t\t\t\t\t\t\t$defense = $vals[ $index[ 'DEFENSE' ][ 0 ] ][ 'attributes' ];\r\n\t\t\t\t\t\t\t$dodge = $vals[ $index[ 'DODGE' ][ 0 ] ][ 'attributes' ];\r\n\t\t\t\t\t\t\t$parry = $vals[ $index[ 'PARRY' ][ 0 ] ][ 'attributes' ];\r\n\t\t\t\t\t\t\t$block = $vals[ $index[ 'BLOCK' ][ 0 ] ][ 'attributes' ];\r\n\t\t\t\t\t\t\t$resilience = $vals[ $index[ 'RESILIENCE' ][ 0 ] ][ 'attributes' ];\r\n\t\t\t\t\t\t\t$this -> content .= \"<li class=\\\"armory_defense_item\\\">\" . __( \"Armor\", \"wowcd\" ) . \": \" . $armor[ 'EFFECTIVE' ] . \"</li>\";\r\n\t\t\t\t\t\t\t$this -> content .= \"<li class=\\\"armory_defense_item\\\">\" . __( \"Defense\", \"wowcd\" ) . \": \" . $defense[ 'VALUE' ] . \"</li>\";\r\n\t\t\t\t\t\t\t$this -> content .= \"<li class=\\\"armory_defense_item\\\">\" . __( \"Dodge\", \"wowcd\" ) . \": \" . $dodge[ 'PERCENT' ] . \"</li>\";\r\n\t\t\t\t\t\t\t$this -> content .= \"<li class=\\\"armory_defense_item\\\">\" . __( \"Parry\", \"wowcd\" ) . \": \" . $parry[ 'PERCENT' ] . \"</li>\";\r\n\t\t\t\t\t\t\t$this -> content .= \"<li class=\\\"armory_defense_item\\\">\" . __( \"Block\", \"wowcd\" ) . \": \" . $block[ 'PERCENT' ] . \"</li>\";\r\n\t\t\t\t\t\t\t$this -> content .= \"<li class=\\\"armory_defense_item\\\">\" . __( \"Resilience\", \"wowcd\" ) . \": \" . $resilience[ 'VALUE' ] . \"</li>\";\r\n\t\t\t\t\t\t\t$this -> content .= \"</ul>\";\r\n\t\t\t\t\t\t\t$this -> content .= \"</div>\";\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tif( $display_pvp )\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t// PvP\r\n\t\t\t\t\t\t\t$this -> content .= \"<div class=\\\"armory_pvps\\\">\";\r\n\t\t\t\t\t\t\t$this -> content .= \"<h4>\" . __( \"PvP\", \"wowcd\" ) . \"</h4>\";\r\n\t\t\t\t\t\t\t$this -> content .= \"<ul class=\\\"armory_pvp_list\\\">\";\r\n\t\t\t\t\t\t\t$lifetimehonorablekills = $vals[ $index[ 'LIFETIMEHONORABLEKILLS' ][ 0 ] ][ 'attributes' ];\r\n\t\t\t\t\t\t\t$arenacurrency = $vals[ $index[ 'ARENACURRENCY' ][ 0 ] ][ 'attributes' ];\r\n\t\t\t\t\t\t\t$this -> content .= \"<li class=\\\"armory_pvp_item\\\">\" . __( \"Honorable kills\", \"wowcd\" ) . \": \" . $lifetimehonorablekills[ 'VALUE' ] . \"</li>\";\r\n\t\t\t\t\t\t\t$this -> content .= \"<li class=\\\"armory_pvp_item\\\">\" . __( \"Arena currency\", \"wowcd\" ) . \": \" . $arenacurrency[ 'VALUE' ] . \"</li>\";\r\n\t\t\t\t\t\t\t$this -> content .= \"</ul>\";\r\n\t\t\t\t\t\t\t$this -> content .= \"</div>\";\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tif( $display_titles )\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t// Titles\r\n\t\t\t\t\t\t\t$this -> content .= \"<div class=\\\"armory_titles\\\">\";\r\n\t\t\t\t\t\t\t$this -> content .= \"<h4>\" . __( \"Known titles\", \"wowcd\" ) . \"</h4>\";\r\n\t\t\t\t\t\t\t$this -> content .= \"<ul class=\\\"armory_title_list\\\">\";\r\n\t\t\t\t\t\t\t$tcount = 0;\r\n\t\t\t\t\t\t\tforeach( $index[ 'TITLE' ] AS $title )\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tif( $tcount > 0 )\r\n\t\t\t\t\t\t\t\t\t$this -> content .= \"<li class=\\\"armory_title_item\\\">\" . str_replace( ' %s', '', $vals[ $title ][ 'attributes' ][ 'VALUE' ] ) . \"</li>\";\r\n\t\t\t\t\t\t\t\t$tcount++;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tif( $tcount == 1 )\r\n\t\t\t\t\t\t\t\t$this -> content .= \"<li class=\\\"armory_title_item\\\">\" . __( \"none\", \"wowcd\" ) . \"</li>\";\r\n\t\t\t\t\t\t\t$this -> content .= \"</ul>\";\r\n\t\t\t\t\t\t\t$this -> content .= \"</div>\";\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tif( $display_gear )\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t// Gear\r\n\t\t\t\t\t\t\t$this -> content .= \"<div class=\\\"armory_gear\\\">\";\r\n\t\t\t\t\t\t\t$this -> content .= \"<h4>\" . __( \"Equipment\", \"wowcd\" ) . \"</h4>\";\r\n\t\t\t\t\t\t\t$this -> content .= \"<ul class=\\\"armory_gear_list\\\">\";\r\n\t\t\t\t\t\t\tforeach( $index[ 'ITEM' ] AS $items )\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t$item = $vals[ $items ][ 'attributes' ];\r\n\t\t\t\t\t\t\t\tif( $item[ 'SLOT' ] >= 0 )\r\n\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t$enchants = \"lvl=\" . $char_attr[ 'LEVEL' ];\r\n\t\t\t\t\t\t\t\t\tif( $item[ 'PERMANENTENCHANT' ] != '0' )\r\n\t\t\t\t\t\t\t\t\t\t$enchants .= \";ench=\" . $item[ 'PERMANENTENCHANT' ];\r\n\t\t\t\t\t\t\t\t\tif ($item[ 'RANDOMPROPERTIESID' ] != '0' )\r\n\t\t\t\t\t\t\t\t\t\t$enchants .= \";rand=\" . $item[ 'RANDOMPROPERTIESID' ];\r\n\t\t\t\t\t\t\t\t\tif ($item[ 'GEM0ID' ] != '0' || $item[ 'GEM1ID' ] != \"0\" || $item[ 'GEM1ID' ] != '0' )\r\n\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\t$enchants .= \";gems=\";\r\n\t\t\t\t\t\t\t\t\t\tif ($item[ 'GEM0ID' ] != '0' )\r\n\t\t\t\t\t\t\t\t\t\t\t$enchants .= $item[ 'GEM0ID' ];\r\n\t\t\t\t\t\t\t\t\t\tif ($item[ 'GEM1ID' ] != '0' )\r\n\t\t\t\t\t\t\t\t\t\t\t$enchants .= \":\" . $item[ 'GEM1ID' ];\r\n\t\t\t\t\t\t\t\t\t\tif ($item[ 'GEM2ID' ] != '0' )\r\n\t\t\t\t\t\t\t\t\t\t\t$enchants .= \":\" . $item[ 'GEM2ID' ];\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t$this -> content .= \"<li class=\\\"armory_gear_item\\\">\";\r\n\t\t\t\t\t\t\t\t\t$this -> content .= \"<a href=\\\"http://$wl.wowhead.com/?item=\" . $item[ 'ID' ] . \"\\\"\" . (($enchants) ? \" rel=\\\"\" . $enchants . \"\\\"\" : \"\") . \">\";\r\n\t\t\t\t\t\t\t\t\t$this -> content .= \"<img src=\\\"http://$rt.wowarmory.com/wow-icons/_images/51x51/\" . $item[ 'ICON' ] . \".jpg\\\" width=\\\"26\\\" border=\\\"0\\\" class=\\\"armory_item_icon\\\"/>\";\r\n\t\t\t\t\t\t\t\t\t$this -> content .= \"</a>\";\r\n\t\t\t\t\t\t\t\t\t$this -> content .= \"</li>\";\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t$this -> content .= \"</ul>\";\r\n\t\t\t\t\t\t\t$this -> content .= \"</div>\";\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tif( $display_glyphs )\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tif( is_array( $index[ 'GLYPH' ] ) )\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t$this -> content .= \"<div class=\\\"armory_glyph\\\">\";\r\n\t\t\t\t\t\t\t\t$this -> content .= \"<h4>\" . __( \"Glyphs\", \"wowcd\" ) . \"</h4>\";\r\n\t\t\t\t\t\t\t\t$this -> content .= \"<ul class=\\\"armory_glyph_list\\\">\";\r\n\t\t\t\t\t\t\t\t// Glyphs grouped by type\r\n\t\t\t\t\t\t\t\t$gtypes = array( 'major', 'minor' );\r\n\t\t\t\t\t\t\t\tforeach( $gtypes AS $gtype )\r\n\t\t\t\t\t\t\t\tforeach( $index[ 'GLYPH' ] AS $glyphs )\r\n\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t$glyph = $vals[ $glyphs ][ 'attributes' ];\r\n\t\t\t\t\t\t\t\t\tif( $glyph[ 'TYPE' ] == $gtype )\r\n\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\t$this -> content .= \"<li class=\\\"armory_glyph_item\\\">\";\r\n\t\t\t\t\t\t\t\t\t\t$this -> content .= \"<a href=\\\"http://www.google.com/cse?cx=013064850417053219827:k8henqhurj4&q=site:$wl.wowhead.com \" . urlencode( $glyph[ 'NAME' ] ) . \"\\\" title=\\\"\" . $glyph[ 'EFFECT' ] . \"\\\" style=\\\"text-decoration:none\\\">\";\r\n\t\t\t\t\t\t\t\t\t\t$this -> content .= \"<img src=\\\"http://$rt.wowarmory.com/wow-icons/_images/21x21/inv_glyph_\" . $gtype . $this -> class_natural[ $char_attr[ 'CLASSID' ] ] . \".png\\\" width=\\\"18\\\" border=\\\"0\\\" class=\\\"armory_item_icon\\\"/>\" . $glyph[ 'NAME' ];\r\n\t\t\t\t\t\t\t\t\t\t$this -> content .= \"</a>\";\r\n\t\t\t\t\t\t\t\t\t\t$this -> content .= \"</li>\";\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t$this -> content .= \"</ul>\";\r\n\t\t\t\t\t\t\t\t$this -> content .= \"</div>\";\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tif( $display_professions )\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t// Professions\r\n\t\t\t\t\t\t\t$prof_1 = $vals[ $index[ 'SKILL' ][ 0 ] ][ 'attributes' ];\r\n\t\t\t\t\t\t\t$prof_2 = $vals[ $index[ 'SKILL' ][ 1 ] ][ 'attributes' ];\r\n\t\t\t\t\t\t\tif( $prof_1 != NULL || $prof_2 != NULL )\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t$this -> content .= \"<div class=\\\"armory_professions\\\">\";\r\n\t\t\t\t\t\t\t\t$this -> content .= \"<h4>\" . __( \"Professions\", \"wowcd\" ) . \"</h4>\";\r\n\t\t\t\t\t\t\t\t$this -> content .= \"<ul class=\\\"armory_profession_list\\\">\";\r\n\t\t\t\t\t\t\t\tif( $prof_1 != NULL )\r\n\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t$this -> content .= \"<li class=\\\"armory_profession_item\\\">\";\r\n\t\t\t\t\t\t\t\t\t$this -> content .= \"<img src=\\\"http://static.wowhead.com/images/icons/small/\" . $this -> prof_img[ $prof_1[ 'NAME' ] ] . \".jpg\\\" width=\\\"20\\\" />\";\r\n\t\t\t\t\t\t\t\t\t$this -> content .= \"<span class=\\\"armory_profession_name\\\">\" . $prof_1[ 'NAME' ] . \":</span> \" . $prof_1[ 'VALUE' ] . \"/\" . $prof_1[ 'MAX' ];\r\n\t\t\t\t\t\t\t\t\t$this -> content .= \"</li>\";\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\tif( $prof_2 != NULL )\r\n\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t$this -> content .= \"<li class=\\\"armory_profession_item\\\">\";\r\n\t\t\t\t\t\t\t\t\t$this -> content .= \"<img src=\\\"http://static.wowhead.com/images/icons/small/\" . $this -> prof_img[ $prof_2[ 'NAME' ] ] . \".jpg\\\" width=\\\"20\\\" />\";\r\n\t\t\t\t\t\t\t\t\t$this -> content .= \"<span class=\\\"armory_profession_name\\\">\" . $prof_2[ 'NAME' ] . \":</span> \" . $prof_2[ 'VALUE' ] . \"/\" . $prof_2[ 'MAX' ];\r\n\t\t\t\t\t\t\t\t\t$this -> content .= \"</li>\";\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t$this -> content .= '</ul>';\r\n\t\t\t\t\t\t\t\t$this -> content .= \"</div>\";\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tif( $display_achievments )\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t// Achievements\r\n\t\t\t\t\t\t\tif( $body_a = $this -> _http_read( $host, $uri_achievments ) )\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t// Get and parse XML\r\n\t\t\t\t\t\t\t\tif( preg_match( '#<achievements.*>.*</achievements>#siU', $body_a, $match ) )\r\n\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t$parser_achiev = xml_parser_create();\r\n\t\t\t\t\t\t\t\t\txml_parse_into_struct( $parser_achiev, $match[ 0 ], $vals_a, $index_a );\r\n\t\t\t\t\t\t\t\t\txml_parser_free( $parser_achiev );\r\n\t\t\t\t\t\t\t\t\tunset( $body_a );\r\n\t\t\t\t\t\t\t\t\tunset( $match );\r\n\t\t\t\t\t\t\t\t\t$this -> content .= \"<div class=\\\"armory_achievements\\\">\";\r\n\t\t\t\t\t\t\t\t\t$this -> content .= \"<h4>\" . __( \"Recent Achievements\", \"wowcd\" ) . \"</h4>\";\r\n\t\t\t\t\t\t\t\t\t$this -> content .= \"<ul class=\\\"armory_achievement_list\\\">\";\r\n\t\t\t\t\t\t\t\t\tif( count( $index_a[ 'ACHIEVEMENT' ] ) )\r\n\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\tforeach( $index_a[ 'ACHIEVEMENT' ] AS $achs )\r\n\t\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\t\t$ach = $vals_a[ $achs ][ 'attributes' ];\r\n\t\t\t\t\t\t\t\t\t\t\t$this -> content .= \"<li class=\\\"armory_achievment_item\\\"><a href=\\\"http://$wl.wowhead.com/?achievement=\" . $ach[ 'ID' ] . \"\\\"><img src=\\\"http://$rt.wowarmory.com/wow-icons/_images/51x51/\" . $ach[ 'ICON' ] . \".jpg\\\" width=\\\"20\\\" border=\\\"0\\\" class=\\\"armory_achievment_icon\\\"/>\" . $ach[ 'TITLE' ] . \"</a></li>\";\r\n\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\telse\t$this -> content .= \"<li class=\\\"armory_achievment_item\\\">\" . __( \"none\", \"wowcd\" ) . \"</li>\";\r\n\t\t\t\t\t\t\t\t\t$this -> content .= \"</ul>\";\r\n\t\t\t\t\t\t\t\t\t$this -> content .= \"<div class=\\\"armory_achievement_points\\\">\" . __( \"Points\", \"wowcd\" ) . \": \" . $char_attr[ 'POINTS' ] . \"</div>\";\r\n\t\t\t\t\t\t\t\t\t$this -> content .= \"</div>\";\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tif( $display_statistics )\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t// Statistics\r\n\t\t\t\t\t\t\tif( $body_s = $this -> _http_read( $host, $uri_statistics ) )\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t// Get and parse XML\r\n\t\t\t\t\t\t\t\tif( preg_match( '#<category.*>.*</category>#siU', $body_s, $match ) )\r\n\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t$parser_stats = xml_parser_create();\r\n\t\t\t\t\t\t\t\t\txml_parse_into_struct( $parser_stats, $match[ 0 ], $vals_s, $index_s );\r\n\t\t\t\t\t\t\t\t\txml_parser_free( $parser_stats );\r\n\t\t\t\t\t\t\t\t\tunset( $body_s );\r\n\t\t\t\t\t\t\t\t\tunset( $match );\r\n\t\t\t\t\t\t\t\t\t$this -> content .= \"<div class=\\\"armory_fightstats\\\">\";\r\n\t\t\t\t\t\t\t\t\t$this -> content .= \"<h4>\" . __( \"Fighting stats\", \"wowcd\" ) . \"</h4>\";\r\n\t\t\t\t\t\t\t\t\t$this -> content .= \"<ul class=\\\"armory_fightstat_list\\\">\";\r\n\t\t\t\t\t\t\t\t\tforeach( $index_s[ 'STATISTIC' ] AS $stats )\r\n\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\t$stat = $vals_s[ $stats ][ 'attributes' ];\r\n\t\t\t\t\t\t\t\t\t\t$this -> content .= \"<li class=\\\"armory_fightstat_item\\\">\" . $stat[ 'NAME' ] . \": \" . $stat[ 'QUANTITY' ] . \"</li>\";\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t$this -> content .= \"</ul>\";\r\n\t\t\t\t\t\t\t\t\t$this -> content .= \"</div>\";\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tif( $display_reputation )\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t// Reputation\r\n\t\t\t\t\t\t\tif( $body_r = $this -> _http_read( $host, $uri_reputation ) )\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t// Get and parse XML\r\n\t\t\t\t\t\t\t\tif( preg_match( '#<reputationTab.*>.*</reputationTab>#siU', $body_r, $match ) )\r\n\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t$parser_reput = xml_parser_create();\r\n\t\t\t\t\t\t\t\t\txml_parse_into_struct( $parser_reput, $match[ 0 ], $vals_r, $index_r );\r\n\t\t\t\t\t\t\t\t\txml_parser_free( $parser_reput );\r\n\t\t\t\t\t\t\t\t\tunset( $body_r );\r\n\t\t\t\t\t\t\t\t\tunset( $match );\r\n\t\t\t\t\t\t\t\t\t$this -> content .= \"<div class=\\\"armory_reputations\\\">\";\r\n\t\t\t\t\t\t\t\t\t$this -> content .= \"<h4>\" . __( \"Reputation\", \"wowcd\" ) . \"</h4>\";\r\n\t\t\t\t\t\t\t\t\t$this -> content .= \"<ul class=\\\"armory_reputation_list\\\">\";\r\n\t\t\t\t\t\t\t\t\t// Load categorys\r\n\t\t\t\t\t\t\t\t\t$categorys = array();\r\n\t\t\t\t\t\t\t\t\tforeach( $index_r[ 'FACTIONCATEGORY' ] AS $category )\r\n\t\t\t\t\t\t\t\t\t\tif( !empty( $vals_r[ $category ][ 'attributes' ][ 'NAME' ] ) )\r\n\t\t\t\t\t\t\t\t\t\t\t$categorys[] = $vals_r[ $category ][ 'attributes' ][ 'NAME' ];\r\n\t\t\t\t\t\t\t\t\t$categorykey = 0;\r\n\t\t\t\t\t\t\t\t\t$categorieinit = true;\r\n\t\t\t\t\t\t\t\t\t$categorybreakkeys = array( 'thunderbluff', 'undercity', 'warsongoffensive', 'warsongoutriders', 'lowercity', 'ratchet', 'thrallmar' );\r\n\t\t\t\t\t\t\t\t\tforeach( $index_r[ 'FACTION' ] AS $faction )\r\n\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\t$reput = $vals_r[ $faction ][ 'attributes' ];\r\n\t\t\t\t\t\t\t\t\t\tif( $reput[ 'REPUTATION' ] >= 0 )\r\n\t\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\t\tif( ($categorykey == 0 && $categorieinit) || $reput[ 'KEY' ] == $categorybreakkeys[ $categorykey ] )\r\n\t\t\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\t\t\tif( !$categorieinit != 0 )\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t$this -> content .= \"</ul></li>\";\r\n\t\t\t\t\t\t\t\t\t\t\t\tif( $reput[ 'KEY' ] == $categorybreakkeys[ $categorykey ] )\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t$categorykey++;\r\n\t\t\t\t\t\t\t\t\t\t\t\t$categorieinit = false;\r\n\t\t\t\t\t\t\t\t\t\t\t\t$this -> content .= \"<li class=\\\"armory_reputation_item\\\">\" . $categorys[ $categorykey ];\r\n\t\t\t\t\t\t\t\t\t\t\t\t$this -> content .= \"<ul class=\\\"armory_reputation_list\\\">\";\r\n\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t\t$this -> content .= \"<li class=\\\"armory_reputation_item\\\">\" . $reput[ 'NAME' ] . \": \" . $reput[ 'REPUTATION' ] . \"</li>\";\r\n\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t$this -> content .= \"</ul></li>\";\r\n\t\t\t\t\t\t\t\t\t$this -> content .= \"</ul>\";\r\n\t\t\t\t\t\t\t\t\t$this -> content .= \"</div>\";\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t// Last updated string\r\n\t\t\t\t\t\tif( $display_last_update_string )\r\n\t\t\t\t\t\t\t$this -> content .= \"<div class=\\\"armory_char_lastmodified\\\">\" . __( \"Last update\", \"wowcd\" ) . \": \" . $char_attr[ 'LASTMODIFIED' ] . \"</div>\";\r\n\t\t\t\t\t\t// Close surrounding div\r\n\t\t\t\t\t\t$this -> content .= \"</div>\";\r\n\t\t\t\t\t\t// Send everything is okay\r\n\t\t\t\t\t\treturn true;\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$this -> error .= __( \"Character not found.\", \"wowcd\" );\r\n\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\telse\r\n\t\t\t\t{\r\n\t\t\t\t\t$this -> error .= __( \"The returned XML data is not well formed.\", \"wowcd\" );\r\n\t\t\t\t\treturn false;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\t$this -> error .= __( \"No character information returned.\", \"wowcd\" );\r\n\t\t\t\t$this -> error .= \"<br/><br/><a href=\\\"http://$host$uri_character\\\" target=\\\"_blank\\\">\" . __( \"Test armory display\", \"wowcd\" ) . \"</a>\";\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\t$this -> error .= __( \"Sorry the WoW armory server didn't respond. The amount of requests you can do in a specific time period is restricted by Blizzard. Please wait a bit then delete the cache file for this character and try it again. Sorry, but that's a thing I can't change. Maybe write an email to Blizzard.\", \"wowcd\" );\r\n\t\t\t$this -> error .= \"<br/><br/><a href=\\\"http://$host$uri_character\\\" target=\\\"_blank\\\">\" . __( \"Test armory connection\", \"wowcd\" ) . \"</a>\";\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}", "function convert_equip ($weapon_name, $refine, $card0, $card1) {\r\n\t// Into Upgrade Level (+5), VS Level (Very Very Strong), and element (Fire)\r\n\t// Never figured out how to obtain the name of the forger, but for admin purposes,\r\n\t// that is not really that useful.\r\n\t// First, determine upgrade level\r\n\t$refine_expression = $refine;\r\n\t// Since VS/Elemental Armors CANNOT have cards in them, a 255 in Card0 signifies that\r\n\t// the following weapon is VS/Elemental, since card 255 does not exist\r\n\tif ($card0 != 255) {\r\n\t\t// Card0 is not 255, therefore, cannot be a VS/Elemental Weapon\r\n\t\tif ($refine > 0) {\r\n\t\t\t// Refine level is > 0\r\n\t\t\t$final_expression = \"+\" . $refine . \" \";\t\t// add in upgrade\r\n\t\t}\r\n\t\treturn $final_expression .= $weapon_name;\t//return the standard item name\r\n\t}\r\n\r\n\t// determine if there are any VVS in them\r\n\t$star_crumb_level = intval($card1 / 1280);\t\t// Athena uses card1 \\ 1280 for level of star crumbs\r\n\tif ($star_crumb_level > 0) {\r\n\t\tfor ($i = 1; $i < $star_crumb_level + 1; $i++) {\r\n\t\t\t$star_crumb_expression .= \"Very \";\t// Adds the appropriate # of 'Very's'\r\n\t\t}\r\n\t\t$star_crumb_expression .= \"Strong \";\t// Adds the \"Strong\"\r\n\t}\r\n\t// determine element\r\n\t$element_type = $card1 % 1280;\t\t\t\t\t// Athena uses card1 MOD 1280 for element\r\n\tif ($element_type > 0) {\r\n\t\t// Weapon is elemental\r\n\t\tswitch ($element_type) {\r\n\t\t\tcase 1:\r\n\t\t\t$element_expression = \"Ice \";\r\n\t\t\tbreak;\r\n\t\t\tcase 2:\r\n\t\t\t$element_expression = \"Earth \";\r\n\t\t\tbreak;\r\n\t\t\tcase 3:\r\n\t\t\t$element_expression = \"Fire \";\r\n\t\t\tbreak;\r\n\t\t\tcase 4:\r\n\t\t\t$element_expression = \"Wind \";\r\n\t\t\tbreak;\r\n\t\t}\r\n\t}\r\n\t$equip_name = $weapon_name;\t\t// The Name of the Actual Equip is obtained\r\n\t// without any modifiers\r\n\tif ($refine > 0) {\r\n\t\t$final_expression = \"+\" . $refine . \" \";\t\t// add in upgrade\r\n\t}\r\n\tif ($star_crumb_level > 0) {\r\n\t\t$final_expression .= $star_crumb_expression;\t\t// Add V\r\n\t}\r\n\tif ($element_type > 0) {\r\n\t\t$final_expression .= $element_expression;\t\t// Add Element\r\n\t}\r\n\t$final_expression .= $equip_name;\t// Add Weapon Name\r\n\treturn $final_expression;\t\t// Returns the final expression (+5 Very Very Strong Fire Damascus)\r\n}", "public function getDamage(): int {\n\n $luck = $this->generateLuck();\n $rapidStrikeChance = static::rapidStrikeChance;\n $damage = $this->strength;\n $useSkill = $this->isSkillUsable($luck, $rapidStrikeChance);\n\n if($useSkill){\n $damage += $this->rapidStrike();\n $this->displaySkill('rapid strike');\n }\n \n return $damage;\n }", "public function getWeaponDAtk()\n {\n return $this->WeaponDAtk;\n }", "static public function all() {\n\t\tif (static::$items) {\n\t\t\treturn static::$items;\n\t\t}\n\n\t\tstatic::$items = new ItemCollection([\n\t\t\tnew Item('Nothing', 'Nothing', [0x5A], null, 0xf094, 0xe8 + 0xf094, 0x1d0 + 0xf094),\n\t\t\tnew Item\\Sword('L1Sword', 'Fighters Sword', [0x49], null, 0xf2f8, 0xf2fc, 0xf300), // Uncle must be dead\n\t\t\tnew Item\\Sword('L1SwordAndShield', 'Fighters Sword and Shield', [0x00], null, 0xf2f8, 0xf2fc, 0xf300), // Uncle must be dead\n\t\t\tnew Item\\Sword('L2Sword', 'Master Sword', [0x01], null, 0xf06c, 0xe8 + 0xf06c, 0x1d0 + 0xf06c),\n\t\t\tnew Item\\Sword('MasterSword', 'Master Sword', [0x50], null, 0xf06c, 0xe8 + 0xf06c, 0x1d0 + 0xf06c),\n\t\t\tnew Item\\Sword('L3Sword', 'Tempered Sword', [0x02], null, 0xf070, 0xe8 + 0xf070, 0x1d0 + 0xf070), // Uncle must be dead\n\t\t\tnew Item\\Sword('L4Sword', 'Golden Sword', [0x03], null, 0xf074, 0xe8 + 0xf074, 0x1d0 + 0xf074), // Uncle must be dead\n\t\t\tnew Item\\Shield('BlueShield', 'Fighters Shield', [0x04], null, 0xf080, 0xe8 + 0xf080, 0x1d0 + 0xf080), // Uncle must be dead\n\t\t\tnew Item\\Shield('RedShield', 'Fire Shield', [0x05], null, 0xf084, 0xe8 + 0xf084, 0x1d0 + 0xf084), // Uncle must be dead\n\t\t\tnew Item\\Shield('MirrorShield', 'Mirror Shield', [0x06], null, 0xf088, 0xe8 + 0xf088, 0x1d0 + 0xf088), // Uncle must be dead\n\t\t\tnew Item('FireRod', 'Fire Rod', [0x07], null, 0xf000, 0xe8 + 0xf000, 0x1d0 + 0xf000),\n\t\t\tnew Item('IceRod', 'Ice Rod', [0x08], null, 0xf004, 0xe8 + 0xf004, 0x1d0 + 0xf004),\n\t\t\tnew Item('Hammer', 'Hammer', [0x09], null, 0xf018, 0xe8 + 0xf018, 0x1d0 + 0xf018),\n\t\t\tnew Item('Hookshot', 'Hookshot', [0x0A], null, 0xeff0, 0xe8 + 0xeff0, 0x1d0 + 0xeff0),\n\t\t\tnew Item\\Bow('Bow', 'Bow', [0x0B], null, 0xefe0, 0xe8 + 0xefe0, 0x1d0 + 0xefe0),\n\t\t\tnew Item('Boomerang', 'Blue Boomerang', [0x0C], null, 0xefe8, 0xe8 + 0xefe8, 0x1d0 + 0xefe8),\n\t\t\tnew Item('Powder', 'Magic Powder', [0x0D], null, 0xeffc, 0xe8 + 0xeffc, 0x1d0 + 0xeffc),\n\t\t\tnew Item\\BottleContents('Bee', 'Bee', [0x0E], null, 0xefe0, 0xe8 + 0xefe0, 0x1d0 + 0xefe0),\n\t\t\tnew Item\\Medallion('Bombos', 'Bombos', [0x0f, 0x00, 't0' => 0x51, 't1' => 0x10, 't2' => 0x00, 'm0' => 0x51, 'm1' => 0x00, 'm2' => 0x00], null, 0xf008, 0xe8 + 0xf008, 0x1d0 + 0xf008),\n\t\t\tnew Item\\Medallion('Ether', 'Ether', [0x10, 0x01, 't0' => 0x51, 't1' => 0x18, 't2' => 0x00, 'm0' => 0x13, 'm1' => 0x9F, 'm2' => 0xF1], null, 0xf00c, 0xe8 + 0xf00c, 0x1d0 + 0xf00c),\n\t\t\tnew Item\\Medallion('Quake', 'Quake', [0x11, 0x02, 't0' => 0x14, 't1' => 0xEF, 't2' => 0xC4, 'm0' => 0x51, 'm1' => 0x08, 'm2' => 0x00], null, 0xf010, 0xe8 + 0xf010, 0x1d0 + 0xf010),\n\t\t\tnew Item('Lamp', 'Lamp', [0x12], null, 0xf014, 0xe8 + 0xf014, 0x1d0 + 0xf014),\n\t\t\tnew Item('Shovel', 'Shovel', [0x13], null, 0xf01c, 0xe8 + 0xf01c, 0x1d0 + 0xf01c),\n\t\t\tnew Item('OcarinaInactive', 'Flute', [0x14], null, 0xf020, 0xe8 + 0xf020, 0x1d0 + 0xf020),\n\t\t\tnew Item('CaneOfSomaria', 'Cane Of Somaria', [0x15], null, 0xf048, 0xe8 + 0xf048, 0x1d0 + 0xf048),\n\t\t\tnew Item\\Bottle('Bottle', 'Bottle (Empty)', [0x16], null, 0xf02c, 0xe8 + 0xf02c, 0x1d0 + 0xf02c),\n\t\t\tnew Item\\Upgrade\\Health('PieceOfHeart', 'Piece Of Heart', [0x17], null, 0xf08c, 0xe8 + 0xf08c, 0x1d0 + 0xf08c),\n\t\t\tnew Item('CaneOfByrna', 'Cane Of Byrna', [0x18], null, 0xf04c, 0xe8 + 0xf04c, 0x1d0 + 0xf04c),\n\t\t\tnew Item('Cape', 'Magic Cape', [0x19], null, 0xf050, 0xe8 + 0xf050, 0x1d0 + 0xf050),\n\t\t\tnew Item('MagicMirror', 'Magic Mirror', [0x1A], null, 0xf054, 0xe8 + 0xf054, 0x1d0 + 0xf054),\n\t\t\tnew Item('PowerGlove', 'Power Glove', [0x1B], null, 0xf058, 0xe8 + 0xf058, 0x1d0 + 0xf058),\n\t\t\tnew Item('TitansMitt', 'Titans Mitt', [0x1C], null, 0xf05c, 0xe8 + 0xf05c, 0x1d0 + 0xf05c),\n\t\t\tnew Item('BookOfMudora', 'Book Of Mudora', [0x1D], null, 0xf028, 0xe8 + 0xf028, 0x1d0 + 0xf028),\n\t\t\tnew Item('Flippers', 'Flippers', [0x1E], null, 0xf064, 0xe8 + 0xf064, 0x1d0 + 0xf064),\n\t\t\tnew Item('MoonPearl', 'Moon Pearl', [0x1F], null, 0xf068, 0xe8 + 0xf068, 0x1d0 + 0xf068),\n\t\t\tnew Item('BugCatchingNet', 'Bug Catching Net', [0x21], null, 0xf024, 0xe8 + 0xf024, 0x1d0 + 0xf024),\n\t\t\tnew Item('BlueMail', 'Blue Mail', [0x22], null, 0xf078, 0xe8 + 0xf078, 0x1d0 + 0xf078),\n\t\t\tnew Item('RedMail', 'Red Mail', [0x23], null, 0xf07c, 0xe8 + 0xf07c, 0x1d0 + 0xf07c),\n\t\t\tnew Item\\Key('Key', 'Key', [0x24]),\n\t\t\tnew Item\\Compass('Compass', 'Compass', [0x25]),\n\t\t\tnew Item\\Upgrade\\Health('HeartContainerNoAnimation', 'Heart Container (no animation)', [0x26], null, 0xf090, 0xe8 + 0xf090, 0x1d0 + 0xf090),\n\t\t\tnew Item('Bomb', 'Single Bomb', [0x27], null, 0xeff4, 0xe8 + 0xeff4, 0x1d0 + 0xeff4),\n\t\t\tnew Item('ThreeBombs', 'Three Bombs', [0x28], null, 0xf0a0, 0xe8 + 0xf0a0, 0x1d0 + 0xf0a0),\n\t\t\tnew Item('Mushroom', 'Mushroom', [0x29], null, 0xeff8, 0xe8 + 0xeff8, 0x1d0 + 0xeff8),\n\t\t\tnew Item('RedBoomerang', 'Magical Boomerang', [0x2A], null, 0xefec, 0xe8 + 0xefec, 0x1d0 + 0xefec),\n\t\t\tnew Item\\Bottle('BottleWithRedPotion', 'Bottle (Red Potion)', [0x2B], null, 0xf030, 0xe8 + 0xf030, 0x1d0 + 0xf030),\n\t\t\tnew Item\\Bottle('BottleWithGreenPotion', 'Bottle (Green Potion)', [0x2C], null, 0xf034, 0xe8 + 0xf034, 0x1d0 + 0xf034),\n\t\t\tnew Item\\Bottle('BottleWithBluePotion', 'Bottle (Blue Potion)', [0x2D], null, 0xf038, 0xe8 + 0xf038, 0x1d0 + 0xf038),\n\t\t\tnew Item\\BottleContents('RedPotion', 'Red Potion', [0x2E]),\n\t\t\tnew Item\\BottleContents('GreenPotion', 'Green Potion', [0x2F]),\n\t\t\tnew Item\\BottleContents('BluePotion', 'Blue Potion', [0x30]),\n\t\t\tnew Item('TenBombs', 'Ten Bombs', [0x31], null, 0xf0a4, 0xe8 + 0xf0a4, 0x1d0 + 0xf0a4),\n\t\t\tnew Item\\BigKey('BigKey', 'Big Key', [0x32]),\n\t\t\tnew Item\\Map('Map', 'Dungeon Map', [0x33]),\n\t\t\tnew Item('OneRupee', 'One Rupee', [0x34], null, 0xf0a8, 0xe8 + 0xf0a8, 0x1d0 + 0xf0a8),\n\t\t\tnew Item('FiveRupees', 'Five Rupees', [0x35], null, 0xf0ac, 0xe8 + 0xf0ac, 0x1d0 + 0xf0ac),\n\t\t\tnew Item('TwentyRupees', 'Twenty Rupees', [0x36], null, 0xf0b0, 0xe8 + 0xf0b0, 0x1d0 + 0xf0b0),\n\t\t\tnew Item\\Pendant('PendantOfCourage', 'Pendant Of Courage', [0x37, 0x04, 0x38, 0x62, 0x00, 0x69, 0x01]),\n\t\t\tnew Item\\Pendant('PendantOfWisdom', 'Pendant Of Wisdom', [0x38, 0x01, 0x32, 0x60, 0x00, 0x69, 0x03]),\n\t\t\tnew Item\\Pendant('PendantOfPower', 'Pendant Of Power', [0x39, 0x02, 0x34, 0x60, 0x00, 0x69, 0x02]),\n\t\t\tnew Item\\Bow('BowAndArrows', 'Bow And Arrows', [0x3A], null, 0xefe0, 0xe8 + 0xefe0, 0x1d0 + 0xefe0),\n\t\t\tnew Item\\Bow('BowAndSilverArrows', 'Bow And Silver Arrows', [0x3B], null, 0xefe4, 0xe8 + 0xefe4, 0x1d0 + 0xefe4),\n\t\t\tnew Item\\Bottle('BottleWithBee', 'Bottle (Bee)', [0x3C], null, 0xf03c, 0xe8 + 0xf03c, 0x1d0 + 0xf03c),\n\t\t\tnew Item\\Bottle('BottleWithFairy', 'Bottle (Fairy)', [0x3D], null, 0xf044, 0xe8 + 0xf044, 0x1d0 + 0xf044),\n\t\t\tnew Item\\Upgrade\\Health('BossHeartContainer', 'Heart Container', [0x3E], null, 0xf090, 0xe8 + 0xf090, 0x1d0 + 0xf090),\n\t\t\tnew Item\\Upgrade\\Health('HeartContainer', 'Sancturary Heart Container', [0x3F], null, 0xf090, 0xe8 + 0xf090, 0x1d0 + 0xf090),\n\t\t\tnew Item('OneHundredRupees', 'One Hundred Rupees', [0x40], null, 0xf0b8, 0xe8 + 0xf0b8, 0x1d0 + 0xf0b8),\n\t\t\tnew Item('FiftyRupees', 'Fifty Rupees', [0x41], null, 0xf0b4, 0xe8 + 0xf0b4, 0x1d0 + 0xf0b4),\n\t\t\tnew Item('Heart', 'Small Heart', [0x42]),\n\t\t\tnew Item\\Arrow('Arrow', 'Single Arrow', [0x43], null, 0xf094, 0xe8 + 0xf094, 0x1d0 + 0xf094),\n\t\t\tnew Item\\Arrow('TenArrows', 'Ten Arrows', [0x44], null, 0xf09c, 0xe8 + 0xf09c, 0x1d0 + 0xf09c),\n\t\t\tnew Item('SmallMagic', 'Small Magic', [0x45]),\n\t\t\tnew Item('ThreeHundredRupees', 'Three Hundred Rupees', [0x46], null, 0xf0bc, 0xe8 + 0xf0bc, 0x1d0 + 0xf0bc),\n\t\t\tnew Item('TwentyRupees2', 'Twenty Rupees', [0x47], null, 0xf0b0, 0xe8 + 0xf0b0, 0x1d0 + 0xf0b0),\n\t\t\tnew Item\\Bottle('BottleWithGoldBee', 'Bottle (Golden Bee)', [0x48], null, 0xf040, 0xe8 + 0xf040, 0x1d0 + 0xf040),\n\t\t\tnew Item('OcarinaActive', 'Flute (active)', [0x4A], null, 0xf020, 0xe8 + 0xf020, 0x1d0 + 0xf020),\n\t\t\tnew Item('PegasusBoots', 'Pegasus Boots', [0x4B], null, 0xf060, 0xe8 + 0xf060, 0x1d0 + 0xf060),\n\t\t\tnew Item\\Upgrade\\Bomb('BombUpgrade5', 'Bomb Upgrade (+5)', [0x51], null, 0xf2c8, 0xf2cc, 0xf2d0),\n\t\t\tnew Item\\Upgrade\\Bomb('BombUpgrade10', 'Bomb Upgrade (+10)', [0x52], null, 0xf2d4, 0xf2d8, 0xf2dc),\n\t\t\tnew Item\\Upgrade\\Bomb('BombUpgrade50', 'Bomb Upgrade (+50)', [0x4C]),\n\t\t\tnew Item\\Upgrade\\Arrow('ArrowUpgrade5', 'Arrow Upgrade (+5)', [0x53], null, 0xf2e0, 0xf2e4, 0xf2e8),\n\t\t\tnew Item\\Upgrade\\Arrow('ArrowUpgrade10', 'Arrow Upgrade (+10)', [0x54], null, 0xf2ec, 0xf2f0, 0xf2f4),\n\t\t\tnew Item\\Upgrade\\Arrow('ArrowUpgrade70', 'Arrow Upgrade (+70)', [0x4D]),\n\t\t\tnew Item\\Upgrade\\Magic('HalfMagic', 'Half Magic', [0x4E], null, 0xf0c0, 0xe8 + 0xf0c0, 0x1d0 + 0xf0c0),\n\t\t\tnew Item\\Upgrade\\Magic('QuarterMagic', 'Quarter Magic', [0x4F], null, 0xf0c4, 0xe8 + 0xf0c4, 0x1d0 + 0xf0c4),\n\t\t\tnew Item\\Programmable('Programmable1', 'Programmable 1', [0x55]),\n\t\t\tnew Item\\Programmable('Programmable2', 'Programmable 2', [0x56]),\n\t\t\tnew Item\\Programmable('Programmable3', 'Programmable 3', [0x57]),\n\t\t\tnew Item('SilverArrowUpgrade', 'Silver Arrows Upgrade', [0x58], null, 0xefe4, 0xe8 + 0xefe4, 0x1d0 + 0xefe4),\n\t\t\tnew Item('Rupoor', 'Rupoor', [0x59]),\n\t\t\tnew Item('RedClock', 'Red Clock', [0x5B]),\n\t\t\tnew Item('BlueClock', 'Blue Clock', [0x5C]),\n\t\t\tnew Item('GreenClock', 'Green Clock', [0x5D]),\n\t\t\tnew Item\\Sword('ProgressiveSword', 'Progressive Sword', [0x5E], null, 0xf2bc, 0xf2c0, 0xf2c4),\n\t\t\tnew Item\\Shield('ProgressiveShield', 'Progressive Shield', [0x5F], null, 0xf2b0, 0xf2b4, 0xf2b8),\n\t\t\tnew Item('ProgressiveArmor', 'Progressive Armor', [0x60], null, 0xf298, 0xf29c, 0xf2a0),\n\t\t\tnew Item('ProgressiveGlove', 'Progressive Glove', [0x61], null, 0xf2a4, 0xf2a8, 0xf2ac),\n\t\t\tnew Item('singleRNG', 'Unique RNG Item', [0x62]),\n\t\t\tnew Item('multiRNG', 'Non-Unique RNG Item', [0x63]),\n\t\t\tnew Item\\Event('Triforce', 'Triforce', [0x6A]),\n\t\t\tnew Item('PowerStar', 'Power Star', [0x6B]),\n\t\t\tnew Item('TriforcePiece', 'Triforce Piece', [0x6C]),\n\t\t\tnew Item\\Map('MapLW', 'Light World Map', [0x70]),\n\t\t\tnew Item\\Map('MapDW', 'Dark World Map', [0x71]),\n\t\t\tnew Item\\Map('MapA2', 'Ganons Tower Map', [0x72]),\n\t\t\tnew Item\\Map('MapD7', 'Turtle Rock Map', [0x73]),\n\t\t\tnew Item\\Map('MapD4', 'Thieves Town Map', [0x74]),\n\t\t\tnew Item\\Map('MapP3', 'Tower of Hera Map', [0x75]),\n\t\t\tnew Item\\Map('MapD5', 'Ice Palace Map', [0x76]),\n\t\t\tnew Item\\Map('MapD3', 'Skull Woods Map', [0x77]),\n\t\t\tnew Item\\Map('MapD6', 'Misery Mire Map', [0x78]),\n\t\t\tnew Item\\Map('MapD1', 'Palace of Darkness Map', [0x79]),\n\t\t\tnew Item\\Map('MapD2', 'Swamp Palace Map', [0x7A]),\n\t\t\tnew Item\\Map('MapA1', 'Agahnims Tower Map', [0x7B]),\n\t\t\tnew Item\\Map('MapP2', 'Desert Palace Map', [0x7C]),\n\t\t\tnew Item\\Map('MapP1', 'Eastern Palace Map', [0x7D]),\n\t\t\tnew Item\\Map('MapH1', 'Hyrule Castle Map', [0x7E]),\n\t\t\tnew Item\\Map('MapH2', 'Sewers Map', [0x7F]),\n\t\t\tnew Item\\Compass('CompassA2', 'Ganons Tower Compass', [0x82]),\n\t\t\tnew Item\\Compass('CompassD7', 'Turtle Rock Compass', [0x83]),\n\t\t\tnew Item\\Compass('CompassD4', 'Thieves Town Compass', [0x84]),\n\t\t\tnew Item\\Compass('CompassP3', 'Tower of Hera Compass', [0x85]),\n\t\t\tnew Item\\Compass('CompassD5', 'Ice Palace Compass', [0x86]),\n\t\t\tnew Item\\Compass('CompassD3', 'Skull Woods Compass', [0x87]),\n\t\t\tnew Item\\Compass('CompassD6', 'Misery Mire Compass', [0x88]),\n\t\t\tnew Item\\Compass('CompassD1', 'Palace of Darkness Compass', [0x89]),\n\t\t\tnew Item\\Compass('CompassD2', 'Swamp Palace Compass', [0x8A]),\n\t\t\tnew Item\\Compass('CompassA1', 'Agahnims Tower Compass', [0x8B]),\n\t\t\tnew Item\\Compass('CompassP2', 'Desert Palace Compass', [0x8C]),\n\t\t\tnew Item\\Compass('CompassP1', 'Eastern Palace Compass', [0x8D]),\n\t\t\tnew Item\\Compass('CompassH1', 'Hyrule Castle Compass', [0x8E]),\n\t\t\tnew Item\\Compass('CompassH2', 'Sewers Compass', [0x8F]),\n\t\t\tnew Item\\BigKey('BigKeyA2', 'Ganons Tower Big Key', [0x92]),\n\t\t\tnew Item\\BigKey('BigKeyD7', 'Turtle Rock Big Key', [0x93]),\n\t\t\tnew Item\\BigKey('BigKeyD4', 'Thieves Town Big Key', [0x94]),\n\t\t\tnew Item\\BigKey('BigKeyP3', 'Tower of Hera Big Key', [0x95]),\n\t\t\tnew Item\\BigKey('BigKeyD5', 'Ice Palace Big Key', [0x96]),\n\t\t\tnew Item\\BigKey('BigKeyD3', 'Skull Woods Big Key', [0x97]),\n\t\t\tnew Item\\BigKey('BigKeyD6', 'Misery Mire Big Key', [0x98]),\n\t\t\tnew Item\\BigKey('BigKeyD1', 'Palace of Darkness Big Key', [0x99]),\n\t\t\tnew Item\\BigKey('BigKeyD2', 'Swamp Palace Big Key', [0x9A]),\n\t\t\tnew Item\\BigKey('BigKeyA1', 'Agahnims Tower Big Key', [0x9B]),\n\t\t\tnew Item\\BigKey('BigKeyP2', 'Desert Palace Big Key', [0x9C]),\n\t\t\tnew Item\\BigKey('BigKeyP1', 'Eastern Palace Big Key', [0x9D]),\n\t\t\tnew Item\\BigKey('BigKeyH1', 'Hyrule Castle Big Key', [0x9E]),\n\t\t\tnew Item\\BigKey('BigKeyH2', 'Sewers Big Key', [0x9F]),\n\t\t\tnew Item\\Key('KeyH2', 'Sewers Key', [0xA0]),\n\t\t\tnew Item\\Key('KeyH1', 'Hyrule Castle Key', [0xA1]),\n\t\t\tnew Item\\Key('KeyP1', 'Eastern Palace Key', [0xA2]),\n\t\t\tnew Item\\Key('KeyP2', 'Desert Palace Key', [0xA3]),\n\t\t\tnew Item\\Key('KeyA1', 'Agahnims Tower Key', [0xA4]),\n\t\t\tnew Item\\Key('KeyD2', 'Swamp Palace Key', [0xA5]),\n\t\t\tnew Item\\Key('KeyD1', 'Palace of Darkness Key', [0xA6]),\n\t\t\tnew Item\\Key('KeyD6', 'Misery Mire Key', [0xA7]),\n\t\t\tnew Item\\Key('KeyD3', 'Skull Woods Key', [0xA8]),\n\t\t\tnew Item\\Key('KeyD5', 'Ice Palace Key', [0xA9]),\n\t\t\tnew Item\\Key('KeyP3', 'Tower of Hera Key', [0xAA]),\n\t\t\tnew Item\\Key('KeyD4', 'Thieves Town Key', [0xAB]),\n\t\t\tnew Item\\Key('KeyD7', 'Turtle Rock Key', [0xAC]),\n\t\t\tnew Item\\Key('KeyA2', 'Ganons Tower Key', [0xAD]),\n\t\t\tnew Item\\Key('KeyGK', 'Generic Key', [0xAF]),\n\t\t\tnew Item\\SuperMetroid('Grapple', 'Grappling Beam', [0xB0], null, 0xef17, 0x54 + 0xef17, 0xa8 + 0xef17),\n\t\t\tnew Item\\SuperMetroid('XRay', 'X-Ray Scope', [0xB1], null, 0xef0f, 0x54 + 0xef0f, 0xa8 + 0xef0f),\n\t\t\tnew Item\\SuperMetroid('Varia', 'Varia Suit', [0xB2], null, 0xef07, 0x54 + 0xef07, 0xa8 + 0xef07),\n\t\t\tnew Item\\SuperMetroid('SpringBall', 'Spring Ball', [0xB3], null, 0xef03, 0x54 + 0xef03, 0xa8 + 0xef03),\n\t\t\tnew Item\\SuperMetroid('Morph', 'Morphing Ball', [0xB4], null, 0xef23, 0x54 + 0xef23, 0xa8 + 0xef23),\n\t\t\tnew Item\\SuperMetroid('ScrewAttack', 'Screw Attack', [0xB5], null, 0xef1f, 0x54 + 0xef1f, 0xa8 + 0xef1f),\n\t\t\tnew Item\\SuperMetroid('Gravity', 'Gravity Suit', [0xB6], null, 0xef0b, 0x54 + 0xef0b, 0xa8 + 0xef0b),\n\t\t\tnew Item\\SuperMetroid('HiJump', 'Hi-Jump Boots', [0xB7], null, 0xeef3, 0x54 + 0xeef3, 0xa8 + 0xeef3),\n\t\t\tnew Item\\SuperMetroid('SpaceJump', 'Space Jump', [0xB8], null, 0xef1b, 0x54 + 0xef1b, 0xa8 + 0xef1b),\n\t\t\tnew Item\\SuperMetroid('Bombs', 'Morph Bombs', [0xB9], null, 0xeee7, 0x54 + 0xeee7, 0xa8 + 0xeee7),\n\t\t\tnew Item\\SuperMetroid('SpeedBooster', 'Speed Booster', [0xBA], null, 0xeef7, 0x54 + 0xeef7, 0xa8 + 0xeef7),\n\t\t\tnew Item\\SuperMetroid('Charge', 'Charge Beam', [0xBB], null, 0xeeeb, 0x54 + 0xeeeb, 0xa8 + 0xeeeb),\n\t\t\tnew Item\\SuperMetroid('Ice', 'Ice Beam', [0xBC], null, 0xeeef, 0x54 + 0xeeef, 0xa8 + 0xeeef),\n\t\t\tnew Item\\SuperMetroid('Wave', 'Wave Beam', [0xBD], null, 0xeefb, 0x54 + 0xeefb, 0xa8 + 0xeefb),\n\t\t\tnew Item\\SuperMetroid('Spazer', 'Spazer', [0xBE], null, 0xeeff, 0x54 + 0xeeff, 0xa8 + 0xeeff),\n\t\t\tnew Item\\SuperMetroid('Plasma', 'Plasma Beam', [0xBF], null, 0xef13, 0x54 + 0xef13, 0xa8 + 0xef13),\n\t\t\tnew Item\\SuperMetroid('ETank', 'Energy Tank', [0xC0], null, 0xeed7, 0x54 + 0xeed7, 0xa8 + 0xeed7),\n\t\t\tnew Item\\SuperMetroid('ReserveTank', 'Reserve Tank', [0xC1], null, 0xef27, 0x54 + 0xef27, 0xa8 + 0xef27),\n\t\t\tnew Item\\SuperMetroid('Missile', 'Missile', [0xC2], null, 0xeedb, 0x54 + 0xeedb, 0xa8 + 0xeedb),\n\t\t\tnew Item\\SuperMetroid('Super', 'Super Missile', [0xC3], null, 0xeedf, 0x54 + 0xeedf, 0xa8 + 0xeedf),\n\t\t\tnew Item\\SuperMetroid('PowerBomb', 'Power Bomb', [0xC4], null, 0xeee3, 0x54 + 0xeee3, 0xa8 + 0xeee3),\n\n\t\t\tnew Item\\Crystal('Crystal1', 'Crystal 1', [null, 0x02, 0x34, 0x64, 0x40, 0x7F, 0x06]),\n\t\t\tnew Item\\Crystal('Crystal2', 'Crystal 2', [null, 0x10, 0x34, 0x64, 0x40, 0x79, 0x06]),\n\t\t\tnew Item\\Crystal('Crystal3', 'Crystal 3', [null, 0x40, 0x34, 0x64, 0x40, 0x6C, 0x06]),\n\t\t\tnew Item\\Crystal('Crystal4', 'Crystal 4', [null, 0x20, 0x34, 0x64, 0x40, 0x6D, 0x06]),\n\t\t\tnew Item\\Crystal('Crystal5', 'Crystal 5', [null, 0x04, 0x32, 0x64, 0x40, 0x6E, 0x06]),\n\t\t\tnew Item\\Crystal('Crystal6', 'Crystal 6', [null, 0x01, 0x32, 0x64, 0x40, 0x6F, 0x06]),\n\t\t\tnew Item\\Crystal('Crystal7', 'Crystal 7', [null, 0x08, 0x34, 0x64, 0x40, 0x7C, 0x06]),\n\t\t\tnew Item\\Event('RescueZelda', 'Rescue Zelda', [null]),\n\t\t\tnew Item\\Event('DefeatAgahnim', 'Defeat Agahnim', [null]),\n\t\t\tnew Item\\Event('DefeatAgahnim2', 'Defeat Agahnim 2', [null]),\n\t\t\tnew Item\\Event('DefeatGanon', 'Defeat Ganon', [null]),\n\n\t\t\tnew Item\\Event('DefeatPhantoon', 'Defeat Phantoon', [null]),\n\t\t\tnew Item\\Event('DefeatKraid', 'Defeat Kraid', [null]),\n\t\t\tnew Item\\Event('DefeatDraygon', 'Defeat Draygon', [null]),\n\t\t\tnew Item\\Event('DefeatRidley', 'Defeat Ridley', [null]),\n\t\t\tnew Item\\Event('DefeatMotherBrain', 'Defeat Mother Brain', [null]),\n\t\t]);\n\t\treturn static::all();\n\t}", "public function show($id)\n {\n\t$weapon_category = WeaponCategory::find($id);\n\t\n return $weapon_category;\n }", "public function getDamage($fireOrder)\n {\n// return $ammo->getDamage();\n return 20;\n }", "public function getDamage($fireOrder)\n {\n// return $ammo->getDamage();\n return 20;\n }" ]
[ "0.61464494", "0.614074", "0.58977926", "0.56123984", "0.5612043", "0.55699563", "0.54939526", "0.54629093", "0.5456657", "0.54351884", "0.54230446", "0.5406756", "0.54057854", "0.5353646", "0.53090644", "0.53027296", "0.5275241", "0.52242047", "0.5223008", "0.5211042", "0.51302284", "0.509599", "0.505962", "0.50389105", "0.5029664", "0.5022836", "0.49856243", "0.49845326", "0.49330142", "0.49330142" ]
0.6166665
0
Sets the deployedDeviceCount property value. Number of Devices that have successfully deployed this WindowsDefenderApplicationControl supplemental policy.
public function setDeployedDeviceCount(?int $value): void { $this->getBackingStore()->set('deployedDeviceCount', $value); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function setCompliantDeviceCount($val)\n {\n $this->_propDict[\"compliantDeviceCount\"] = intval($val);\n return $this;\n }", "public function setDeployedAppCount(?int $value): void {\n $this->getBackingStore()->set('deployedAppCount', $value);\n }", "public function setInstalledDeviceCount($val)\n {\n $this->_propDict[\"installedDeviceCount\"] = intval($val);\n return $this;\n }", "public function setDeviceCount($val)\n {\n $this->_propDict[\"deviceCount\"] = intval($val);\n return $this;\n }", "public function setDeviceCount($val)\n {\n $this->_propDict[\"deviceCount\"] = $val;\n return $this;\n }", "public function setDeviceCount(?int $value): void {\n $this->getBackingStore()->set('deviceCount', $value);\n }", "public function setDeviceCount(?int $value): void {\n $this->getBackingStore()->set('deviceCount', $value);\n }", "public function setConflictDeviceCount($val)\n {\n $this->_propDict[\"conflictDeviceCount\"] = intval($val);\n return $this;\n }", "public function setActiveDeviceCount(?int $value): void {\n $this->getBackingStore()->set('activeDeviceCount', $value);\n }", "public function setUpgradeEligibleDeviceCount(?int $value): void {\n $this->getBackingStore()->set('upgradeEligibleDeviceCount', $value);\n }", "public function setNonCompliantDeviceCount($val)\n {\n $this->_propDict[\"nonCompliantDeviceCount\"] = intval($val);\n return $this;\n }", "public function setNotInstalledDeviceCount($val)\n {\n $this->_propDict[\"notInstalledDeviceCount\"] = intval($val);\n return $this;\n }", "public function setNotApplicableDeviceCount($val)\n {\n $this->_propDict[\"notApplicableDeviceCount\"] = intval($val);\n return $this;\n }", "public function setErrorDeviceCount($val)\n {\n $this->_propDict[\"errorDeviceCount\"] = intval($val);\n return $this;\n }", "public function setUnknownDeviceCount($val)\n {\n $this->_propDict[\"unknownDeviceCount\"] = intval($val);\n return $this;\n }", "public function setFailedDeviceCount(?int $value): void {\n $this->getBackingStore()->set('failedDeviceCount', $value);\n }", "public function setProductCount($value){\n // get the dynamic products count, and add it.\n $collection = Mage::getModel('catalog/product')->getCollection()\n ->addAttributeToSelect('sku');\n //->addStoreFilter($this->getRequest()->getParam('store'))\n $count = 0;\n\n if (Mage::helper('dyncatprod')->addDynamicFilters($collection,$this->getId())){\n $collection->load();\n $count = $collection->count();\n $value = 0;\n }\n $this->setData('product_count',$value + $count);\n }", "public function setTotalDeviceCount(?int $value): void {\n $this->getBackingStore()->set('totalDeviceCount', $value);\n }", "public function setFailedDeviceCount($val)\n {\n $this->_propDict[\"failedDeviceCount\"] = intval($val);\n return $this;\n }", "public function setModelDeviceCount($val)\n {\n $this->_propDict[\"modelDeviceCount\"] = intval($val);\n return $this;\n }", "public function getCompliantDeviceCount()\n {\n if (array_key_exists(\"compliantDeviceCount\", $this->_propDict)) {\n return $this->_propDict[\"compliantDeviceCount\"];\n } else {\n return null;\n }\n }", "public function setNotApplicableCount(?int $value): void {\n $this->getBackingStore()->set('notApplicableCount', $value);\n }", "function count()\n {\n return count($this->platforms);\n }", "public function getInstalledDeviceCount()\n {\n if (array_key_exists(\"installedDeviceCount\", $this->_propDict)) {\n return $this->_propDict[\"installedDeviceCount\"];\n } else {\n return null;\n }\n }", "public function setDeviceReporting(?int $value): void {\n $this->getBackingStore()->set('deviceReporting', $value);\n }", "public function setDeviceCountWithCrashes($val)\n {\n $this->_propDict[\"deviceCountWithCrashes\"] = intval($val);\n return $this;\n }", "public function getNonCompliantDeviceCount()\n {\n if (array_key_exists(\"nonCompliantDeviceCount\", $this->_propDict)) {\n return $this->_propDict[\"nonCompliantDeviceCount\"];\n } else {\n return null;\n }\n }", "public function setAppCrashCount($val)\n {\n $this->_propDict[\"appCrashCount\"] = intval($val);\n return $this;\n }", "public function setDeviceEnrollmentLimit(?int $value): void {\n $this->getBackingStore()->set('deviceEnrollmentLimit', $value);\n }", "public function getDeployedDeviceCount(): ?int {\n $val = $this->getBackingStore()->get('deployedDeviceCount');\n if (is_null($val) || is_int($val)) {\n return $val;\n }\n throw new \\UnexpectedValueException(\"Invalid type found in backing store for 'deployedDeviceCount'\");\n }" ]
[ "0.6412264", "0.6219462", "0.6150471", "0.59731126", "0.5938601", "0.59050906", "0.59050906", "0.5807285", "0.5712055", "0.5688763", "0.565668", "0.5519804", "0.5489419", "0.54854584", "0.54077387", "0.54068", "0.53141534", "0.5183075", "0.51640457", "0.5133915", "0.5126134", "0.5034784", "0.50088114", "0.49584252", "0.49276897", "0.49010262", "0.4899137", "0.48974892", "0.4872527", "0.48697388" ]
0.68126136
0
Get arguments welcome template.
private function get_args_welcome_template() { $links = Thim_Theme_Manager::get_data( 'links' ); return array( 'data' => $this->get_data_panel_remote(), 'links' => $links, ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function hello()\n {\n return $this->render(\n 'index/hello.html.twig',\n // le template index/hello.html.twig peut utiliser une variable\n // qui s'appelle nom et qui vaut Julien\n [\n 'nom' => 'Julien'\n ]\n );\n }", "public function get_view(array $args): string\n {\n return '';\n }", "public function getTemplateArgs(): array\n {\n $default_args = $this->getDefaultTemplateArgs();\n\n return $default_args;\n }", "public function get_template() {\n\t\treturn $this->args['html_template'];\n\t}", "public function welcome() {\n//\n// $data = array('name' => 'just a test');\n\n $this->twig_display('welcome', $this->view_data);\n }", "public function view() {\n\t\t$path = func_get_args() ?: array('home');\n\t\treturn $this->render(array('template' => join('/', $path)));\n\t}", "public function twigHelloworld($name=\"\")\n {\n if (empty($name)) {\n if (!empty($this->config['name'])) {\n $name = $this->config['name'];\n } else {\n $name = \"World\";\n }\n }\n\n $html = \"Hello, \". $name .\"!\";\n\n return new \\Twig_Markup($html, 'UTF-8');\n\n }", "public function hello()\n {\n // rendu du fichizer qui construit le html\n // contenu dans la page\n // Chemin à partri de la racine du repetoire templates\n return $this->render('index/hello.html.twig');\n }", "public function welcome()\n\t{\n\t\treturn Theme::View('modules.filex.welcome.filex');\n\t}", "public function actionGenerateWelcomeMessage()\n {\n $welcomeMessage = array();\n $welcomeMessage['sender'] = $this->botName;\n $welcomeMessage['message'] = 'Hey there, we are ready to rumble!';\n return $welcomeMessage;\n }", "public function showWelcome()\n\t\t\t{\n\t\t\treturn View::make('hello');\n\t\t\t}", "public function helloWorld() {\n\n return [\n '#markup' => $this->t('Hello World, I am just a basic custom example.'),\n ];\n }", "function installation_welcome($h)\r\n{\r\n\ttemplate($h, 'install/install_welcome.php');\r\n}", "public function defaultArguments()\n {\n $arguments = [\n 'output' => [\n 'prefix' => 'o',\n 'longPrefix' => 'output',\n 'description' => 'Output file path. Make sure the path exists in the translator paths definition. (Default: translation/)',\n 'defaultValue' => 'translations/'\n ],\n 'domain' => [\n 'prefix' => 'd',\n 'longPrefix' => 'domain',\n 'description' => 'Doman for the csv file. Based on symfony/translator CsvLoader.',\n 'defaultValue' => 'messages'\n ],\n 'recursive' => [\n 'prefix' => 'r',\n 'longPrefix' => 'recursive-level',\n 'description' => 'Max recursive level for the glob operation on folders.',\n 'defaultValue' => -1\n ],\n 'path' => [\n 'prefix' => 'p',\n 'longPrefix' => 'path',\n 'description' => 'Path relative to the project installation (ex: templates/*/*/)',\n 'defaultValue' => false\n ],\n 'type' => [\n 'prefix' => 't',\n 'longPrefix' => 'type',\n 'description' => 'File type (mustache || php)',\n 'defaultValue' => 'mustache'\n ],\n 'php_function' => [\n 'longPrefix' => 'php',\n 'description' => 'Php function to be parsed.',\n 'defaultValue' => 'translate'\n ],\n 'mustache_tag' => [\n 'longPrefix' => 'mustache',\n 'description' => 'Mustache function to be parsed.',\n 'defaultValue' => '_t'\n ]\n ];\n\n $arguments = array_merge(parent::defaultArguments(), $arguments);\n return $arguments;\n }", "public function showWelcome()\n\t{\n $name = Input::get('name');\n\t\treturn View::make('hello');\n\t}", "public function get_page_view_wide(array $args): string\n {\n return '';\n }", "public function index()\n {\n return view('welcome')->with('language', Config::get('app.locale'));\n }", "public function showWelcome()\n\t{\n\t\treturn View::make('hello');\n\t}", "public function showWelcome()\n\t{\n\t\treturn View::make('hello');\n\t}", "public function showWelcome()\n\t{\n\t\treturn View::make('hello');\n\t}", "public function showWelcome()\n\t{\n\t\treturn View::make('hello');\n\t}", "public function showWelcome()\n\t{\n\t\treturn View::make('hello');\n\t}", "public function showWelcome()\n\t{\n\t\treturn View::make('hello');\n\t}", "public function showWelcome()\n\t{\n\t\treturn View::make('hello');\n\t}", "public function showWelcome()\n\t{\n\t\treturn View::make('hello');\n\t}", "public function showWelcome()\n\t{\n\t\treturn View::make('hello');\n\t}", "public function showWelcome()\n\t{\n\t\treturn View::make('hello');\n\t}", "public function showWelcome()\n\t{\n\t\treturn View::make('hello');\n\t}", "public function showWelcome()\n\t{\n\t\treturn View::make('hello');\n\t}", "public function index($args = array())\n {\n // $this->ConvertToArrayNames($args);\n\n $this->view(\"about\" , [\"name\" => 'abanob']);\n }" ]
[ "0.5900861", "0.57710165", "0.5740681", "0.5726243", "0.57154226", "0.56799674", "0.56179106", "0.5558829", "0.5542195", "0.5426285", "0.5407162", "0.5395916", "0.5391898", "0.5371853", "0.53678954", "0.53469414", "0.5344096", "0.53170574", "0.53170574", "0.53170574", "0.53170574", "0.53170574", "0.53170574", "0.53170574", "0.53170574", "0.53170574", "0.53170574", "0.53170574", "0.53170574", "0.5305357" ]
0.69134814
0
Get data welcome panel.
private function get_data_panel_remote() { $data = get_transient( 'thim_core_welcome_panel_data' ); if ( ! $data ) { $data = $this->fetch_data_panel_remote(); if ( $data ) { set_transient( 'thim_core_welcome_panel_data', $data, DAY_IN_SECONDS ); } } return $data; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function rf_welcome_panel() {\n \n\t$screen = get_current_screen();\n\n\tif ( $screen->base == 'dashboard') {\n\t\techo\n\t\t\t'<div class=\"wrap\">'.\n\t\t\t\t'<h2></h2>'.\n\t\t\t\t'<div id=\"welcome-panel\" class=\"welcome-panel\">'.\n\t\t\t\t\t'<section class=\"welcome-panel-content\">' .\n\t\t\t\t\t\t'<h3>Refugee Forum of King County</h3>' .\n\t\t\t\t \t\t'<p class=\"about-deecsription\">Welcome to the Refugee Forum website! Check the menu on the left to find your profile and options for sharing updates and events.</p>' .\n\t\t\t\t\t\t'<div class=\"welcome-column-container\">'.\n\t\t\t\t\t\t\t'<div class=\"welcome-panel-column\">'.\n\t\t\t\t\t\t\t\t'<a class=\"button button-primary button-hero\" href=\"post-new.php\">Share Update</a>'.\n\t\t\t\t\t\t\t\t'<p>Add an update to share with other forum members.</p>'.\n\t\t\t\t\t\t\t'</div>'.\n\t\t\t\t\t\t\t'<div class=\"welcome-panel-column\">'.\n\t\t\t\t\t\t\t\t'<a class=\"button button-hero\" href=\"post-new.php?post_type=tribe_events\">New Event</a>'.\n\t\t\t\t\t\t\t\t'<p>Create an event to put on the shared calendar.</p>'.\n\t\t\t\t\t\t\t'</div>'.\n\t\t\t\t\t\t\t'<div class=\"welcome-panel-column\">'.\n\t\t\t\t\t\t\t\t'<a class=\"button button-primary button-hero\" href=\"index.php\">Back to Site</a>'.\n\t\t\t\t\t\t\t\t'<p>Return to the Refugee Forum website.</p>'.\n\t\t\t\t\t\t\t'</div>'.\n\t\t\t\t\t\t'</div>'.\n\n\t\t\t\t\t'</section>'.\n\t\t\t\t'</div>'.\n\t\t\t'</div>';\n\t}\n}", "public function showWelcome()\n\t{\n\t $data['datas'] = Data::all();\n\t\treturn View::make('hello', $data);\n\t}", "public static function panel($data = array())\n {\n\n $data['start'] = true;\n\n $view = View::make('core::elements.panel')->with('data', $data);\n return $view;\n\n }", "public function custom_welcome_panel()\n {\n abbrivio_get_options();\n ob_start();\n ?>\n <div class=\"abbrivio-welcome-panel-content welcome-panel-content\">\n <div class=\"abbrivio-welcome-panel-content__logo\">\n <img src=\"<?php echo $this->theme_options['abbrivio-site-logo']; ?>\" />\n </div>\n <div class=\"abbrivio-welcome-panel-content__text\"><?php echo $this->theme_options['abbrivio-welcome-panel-message']; ?></div>\n </div>\n <?php\n // Output the content\n\t\t$output = ob_get_clean();\n\t\techo $output;\n }", "public function index()\n {\n return view('panel.panel');\n }", "private function get_args_welcome_template() {\n\t\t$links = Thim_Theme_Manager::get_data( 'links' );\n\n\t\treturn array(\n\t\t\t'data' => $this->get_data_panel_remote(),\n\t\t\t'links' => $links,\n\t\t);\n\t}", "public function dashboard()\n {\n if ( auth()->user() && auth()->user()->can('view_adminpanel') ) {\n return view('dashboard.adminpanel.welcome');\n } else {\n return view('dashboard.userpanel.welcome');\n }\n }", "public function welcome($data = null) {\n if (isset($data))\n return $this->next();\n $this->viewData['appDir'] = $this->p('app', '');\n return $this->render();\n }", "public function panelAction()\n {\n //Data for the html page\n $usersAgeAvg = User::usersAgeAvg();\n $groupWithMostUsers = UsersGroups::groupWithMostUsers();\n $groupWithMostMessages = Messages::groupWithMostMessages();\n $numOfUsers = User::countOfUsers(); \n $numOfGroups = GroupSport::countOfGroups();\n $numOfMessages = Messages::countOfMessages(); \n $mostCommonSportInTheMostCommonCity = SportCategory::mostCommonSportInTheMostCommonCity();\n\n View::renderTemplate('Admin/panel.html', [\n 'user' => $this->user,\n 'numOfUsers' => $numOfUsers,\n 'numOfGroups' => $numOfGroups,\n 'numOfMessages' => $numOfMessages,\n 'usersAgeAvg' => $usersAgeAvg,\n 'groupWithMostUsers' => $groupWithMostUsers,\n 'groupWithMostMessages' => $groupWithMostMessages,\n 'mostCommonSportInTheMostCommonCity' => $mostCommonSportInTheMostCommonCity]);\n }", "public function control_panel()\n\t\t/* output the people control panel page\n\t\t *\n\t\t * this should probably be in the database and just use generated data from the engine,\n\t\t *\tbut we'll get to that later\n\t\t *\n\t\t */\n\t\t{\n\t\t\tob_start();\n\t\t\t# content management system console\n\t\t\tinclude(dirname(__FILE__) . '/content/cpanel.php');\n\t\t\t# retrieve the output\n\t\t\t$file = ob_get_contents();\n\t\t\t# stop buffering\n\t\t\tob_end_clean();\n\t\t\t# return file data\n\t\t\treturn $file;\n\t\t}", "public function Data(){\n if($this->mod->isLogin()){\n $storageDataList = $this->db->getStorageData();\n require_once('Data_mainpage.php');\n }else{\n redirect('/Account');\n }\n }", "function getPanel()\n {\n $engine = new Engine();\n $params = [\n \"totalTime\" => $this->totalTime,\n \"callCount\" => count(Arrays::mergeTree($this->getCalls(),$this->getAuthCalls())),\n \"call\" => $this->getCalls(),\n \"auth\" => $this->getAuthCalls(),\n \"helper\" => function($data){\n return Dumper::toHtml($data,['collapse' => true]);\n },\n \"all\" => Arrays::mergeTree($this->getCalls(),$this->getAuthCalls())\n ];\n return $engine->renderToString(__DIR__.\"/body.latte\",$params);\n }", "public function getPanel() {\n return $this->get(self::PANEL);\n }", "public function index()\n {\n $panel_homes = DB::table('panel_home')->get();\n \n return view('home')->with('panel_homes', $panel_homes);\n }", "public function getWelcome($type = 'html') {\n\t\treturn $this->__getData($type, '__welcome');\n\t}", "public function index()\n\t{\n return $this->show('dashboard', $this->data);\n\t}", "public function index()\n\t{\n\t\t\\Event::call('reborn.admin_panel.index');\n\n\t\t$last_login = User::take(5)->orderBy('last_login', 'desc')->get();\n\n\t\tif (\\Module::isEnabled('Blog')) {\n\t\t\t$last_post = Blog::with('author')->take(5)->orderBy('created_at', 'desc')->get();\n\t\t\t$this->template->set('last_post', $last_post);\n\t\t}\n\n\t\t$this->template->title(\\Setting::get('site_title').' - '.t('label.dashboard'))\n\t\t\t\t\t\t->set('last_login', $last_login)\n\t\t\t\t\t\t->setPartial('dashboard');\n\t}", "public function index() {\n\t\t$admin = AppHelper::getCurrentAdmin();\n\t\t\n\t\treturn view('pages.panel.admin', ['admin' => $admin]);\n\t}", "public function panelCommand()\n {\n $data = [\n 'application version' => '1.2.0',\n 'system version' => '5.2.3',\n 'key' => 'value ...',\n 'a only value message text',\n ];\n\n Show::panel($data, 'panel show', [\n 'borderChar' => '*'\n ]);\n\n Show::panel($data, 'panel show', [\n 'borderChar' => '='\n ]);\n }", "public function userpanel()\n {\n \n }", "public function panel()\n {\n return view('panel.panel-main');\n }", "function welcome()\n\t{\n\t\t$this->layout = \"wizard\";\n\t\t$this->set('band_id',$this->Session->read('band_id'));\n\t\t$band =$this->Cookie->read('flag'); // called from wizard or setting manage\n\t\t$flag= $band[\"flag\"];\n\t\t$this->set('flag',$flag);\n\t\t$results = $this->Cms->findAll(array('status' => '1'),array('id' , 'title'));\n\t\t$this->set('cms',$results);\t\n\t}", "public function mostrarPanel()\n\t{\n\t\t//return View::make('login.login');\n\t\treturn View::make('modulo.formulario');\n\t}", "public function index()\n {\n $details = $this->detailsDashboard();\n return view('welcome',compact('details'));\n }", "public function index() {\n return view(\"PanelAdmin.index\");\n }", "public function getPanel()\n\t{\n\t\t$this->compute();\n\n\t\tob_start();\n\t\trequire __DIR__ . '/LoadPanel.panel.phtml';\n\n\t\treturn ob_get_clean();\n\t}", "public function index()\n {\n return view('panel.dashboard')\n ->with('pageTitle', __('Dashboard'));\n }", "public function getPanel()\n {\n return '<h4>Registry plugin deprecated in favour of Variable plugin</h4>';\n }", "public function index()\n {\n //get user's master group ID\n $role = Auth::user()->master_user_group_id;\n\n $module = $this->dashboard_module->getDashboardModuleId(Auth::user()->id);\n if($module != null)\n {\n $module_id = $module->module_id;\n }else{\n $module_id = null;\n }\n\n return view('dashboard.dashboard_info')->with(array('page_title' => 'Dashboard', 'role' => $role, 'module_id'=>$module_id));\n }", "public function show()\n {\n return view('panel::show');\n }" ]
[ "0.6468114", "0.6411453", "0.62418836", "0.623795", "0.6192868", "0.6148731", "0.61034006", "0.6066814", "0.60384506", "0.6037343", "0.6036104", "0.60191286", "0.6011578", "0.5998836", "0.5974514", "0.59742635", "0.5957921", "0.5941886", "0.5931482", "0.592173", "0.59155506", "0.59104854", "0.59018123", "0.5864403", "0.58601236", "0.58475983", "0.5832578", "0.5832462", "0.58302337", "0.5829597" ]
0.7021699
0
print array if input number is larger than 1 or print null
function output($num_array, $inputNumber) { if ($num_array == null) { echo "[ERROR] Cannot input any number is equal or less than 1" . "<br>"; } else { echo "Prime numbers up to $inputNumber is: "; foreach ($num_array as $value) { echo $value . " "; } echo "<br>"; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function print_array_pre(&$array)\n{\n $rows = count($array);\n $columns = count($array[0]);\n\n for ($i = 0; $i < $rows; $i++)\n {\n for ($j = 0; $j < $columns; $j++)\n {\n if (is_null($array[$i][$j]))\n {\n echo \" \" . \"NaN\" . \"\\t\";\n }\n else\n {\n echo ($array[$i][$j] >= 0 ? \" \" : \"\") . round($array[$i][$j], 2) . \"\\t\";\n }\n }\n echo \"\\n\";\n }\n}", "function pr($array) {\n\tif (is_array ( $array )) {\n\t\tprint \"<pre>\";\n\t\tprint_r ( $array );\n\t\tprint \"</pre>\";\n\t} else {\n\t\tprint \"<font color='red'><b> Not a array variable.</b></font><br/>\";\n\t}\n}", "function printr($array, $print = true) {\n if ($print)\n return print_r($array, true);\n else\n echo '<pre>' . print_r($array, true) . '</pre>'; //tabula bien gracias a los <pre>\n }", "function pr($var, $var2=null, $var3=null, $var4 = null){\n echo '<pre>';\n print_r($var); if(!empty($var2)){echo '<br>'; print_r($var2); } if(!empty($var3)){echo '<br>'; print_r($var3); } if(!empty($var4)){echo '<br>'; print_r($var4); } \n echo '</pre>';\n exit;\n}", "function debug($array, $bool = 0)\n{\n if ($bool && !empty($array)) {\n echo \"<pre>\";\n print_r($array);\n echo \"</pre>\";\n } elseif (!$bool && !empty($array)) {\n echo \"<pre>\";\n print_r($array);\n echo \"</pre>\";\n die;\n } else {\n return false;\n }\n}", "function dumpArray($nomeArray, $array, $boolAssociativo = true)\n{\n if ('$' != $nomeArray[0]) $nomeArray = '$' . $nomeArray;\n $numValori = count($array);\n $ciclo = 0;\n echo \"{$nomeArray}=array(<br/>\";\n $contatore = 1;\n foreach ($array as $id => $valore) {\n if (!is_numeric($valore) or (0 != $valore and \"0\" == $valore[0])) $valore = '\\'' . $valore . '\\'';\n if (!is_numeric($id)) $id = '\\'' . $id . '\\'';\n echo ($boolAssociativo or !is_numeric($id)) ? \"$id=>$valore\" : $valore;\n if ((++$ciclo) < $numValori) echo \",\";\n if (!($contatore % 8)) echo \"<br/>\";\n ++$contatore;\n }\n echo \");<br/>\";\n}", "function flattenArray($array)\n{\n $result = \"\";\n\n foreach ($array as $arr) {\n $val = null;\n\n print(count($arr) . \"\\n\");\n\n if (count($arr) > 1) {\n print(\"IF\\n\");\n $val = flattenArray($arr);\n } else {\n print(\"Else\\n\");\n $val = $arr;\n }\n $result = $result . $val . \",\";\n }\n\n $result = rtrim($result, ',');\n\n return $result;\n}", "function PrintArray($num, $title, $array)\n{\n if (is_array($array) && array_filter($array)){\n //primero eliminar los elementos vacios\n $emptyRemoved = array_filter($array);\n //unir todos los elementos del array en un string\n $arrayToString = implode( \", \", $emptyRemoved );\n //como lo que devuelve son los propios valores de la BD y no los labels, remover los \"_\"\n $arrayToString = str_replace(\"_\", \" \", $arrayToString);\n //$pdf->PrintElement(2,$title,$arrayToString);\n \n $txt = $title.\": \".$arrayToString;\n // Fuente\n $this->SetFont('Times','',12);\n // Imprimir texto en una columna de 6 cm de ancho (si el valor es 60)\n $this->MultiCell(190,7,$txt);\n //$this->Cell(0,5,$txt);\n //$this->Ln();\n // Guardar ordenada\n $this->y0 = $this->GetY();\n }\n}", "function pr( $arr = [] ) {\n print_r( $arr );\n }", "function _pr($input, $pre=true){\n\t\tif($pre) echo '<pre>';\n\t\tif(is_array($input) || is_object($input)){\n\t\t\tprint_r($input);\n\t\t}else{\n\t\t\tif(is_bool($input)) var_dump($input);\n\t\t\telse echo $input;\n\t\t\tif($pre == false) echo '<br>';\n\t\t}\n\t\tif($pre) echo '</pre>';\n\t}", "function pr($array) {\r\n\techo '<pre>';\r\n\tprint_r($array);\r\n\techo '</pre>';\r\n}", "function pre_print($data = '', $status = 0) {\n\n echo \"<pre>\";\n print_r($data);\n echo \"</pre>\";\n\n if(!empty($status)){\n die();\n }\n}", "function recursive_array_check_blank($element_value)\n{\n\nglobal $set;\n\nif(!is_array($element_value)){if(!empty($element_value)){$set = 1;}}\nelse\n{\n\nforeach($element_value as $value){if($set){break;} recursive_array_check_blank($value);}\n\n}\n\n}", "function fa($arr, $exit = true){\n echo '<pre>';\n print_r($arr);\n echo '</pre>';\n if($exit) exit;\n}", "public function pr($val='',$return=0){\r\n //recursive array display buffered and returned\r\n $retstr='';\r\n if(is_array($val)){\r\n ob_start();\r\n $this->prep_display_array($val,1);\r\n $retstr= ob_get_clean();\r\n\r\n }else{\r\n if(!empty($val))$retstr= '<div style=\"margin:5px 0;\">'.$val.'&nbsp;</div>';\r\n }\r\n\r\n if(empty($return)){\r\n echo $retstr;\r\n }else{\r\n return $retstr; \r\n }\r\n }", "function show_array($array) { \n if (is_array($array)){\n\t\t\tforeach ($array as $key => $value) { \n\t\t\t\t\tif (is_array($value)) { \n\t\t\t\t\t\t\techo \"[\" .$key. \"]<br>\";\n\t\t\t\t\t\t\tshow_array($value); \n\t\t\t\t\t} else { \n\t\t\t\t\t\t\techo \"&nbsp;&nbsp;\".$key . \" = [\" .$value. \"]<br>\"; \n\t\t\t\t\t} \n\t\t\t} \n\t\t} else {\n\t\t\t\t\t\t\techo \"EMPTY ARRAY!<br>\"; \n\t\t}\n}", "function printer($array)\n\t{\n\t\tfor ($i = 0; $i < count($array) ; $i++)\n\t\t{\n\t\t\techo $array[$i] .\", \";\n\t\t}\n\t}", "function pa($v = null)\n{\n\tif(count(func_get_args()) > 1)\n\t{\n\t\tforeach(func_get_args() as $arg) pa($arg);\n\t\treturn;\n\t}\n\techo is_scalar($v) || $v === null ? $v . ( PHP_SAPI === 'cli' ? PHP_EOL : '<br />' )\n\t\t: ( PHP_SAPI === 'cli' ? print_r($v, true) : '<pre>' . print_r($v, true) . '</pre>' );\n}", "function dump() {\n $string = '';\n foreach (func_get_args() as $value) {\n $string .= '<pre>' . h($value === NULL ? 'NULL' : (is_scalar($value) ? $value : print_r($value, TRUE))) . \"</pre>\\n\";\n }\n return $string;\n}", "function estaEnArray($array, $num){\r\n $arraydev=array(false,\"No se encuentra $num en el array.\");\r\n foreach ($array as $clave=>$valor){\r\n if($valor==$num){\r\n $arraydev[0]=true;\r\n $arraydev[1]=$clave;\r\n break;\r\n }\r\n }\r\n return $arraydev;\r\n }", "function dump($var)\n{\n if (is_bool($var)) {\n var_dump($var);\n } else if (is_null($var)) {\n var_dump($var);\n } else {\n echo \"<pre style='background-color: gainsboro;padding: 5px;border:2px solid red;max-width:1000px;margin: 5px auto;border-radius:25px;'>\".print_r($var,true).\"</pre>\";\n }\n}", "function arrayPrint($array_i){\n echo '<pre>'.\"\\n\";\n print_r($array_i);\n echo '</pre>'.\"\\n\";\n }", "function justEchoing($array){\n $a = '';\n if(is_array($array)){\n for ($i = 0; $i < count($array); $i++){\n $a .= '<p>'.$array[$i].'</p>';\n }\n } else {\n $a .= '<p>'.$array.'</p>';\n }\n \n return $a;\n }", "public function display()\n {\n foreach (func_get_args() as $arr) {\n if (is_array($arr))\n {\n //management for \"invisible\" ipts such as true/false.\n foreach ($arr as $index => $items)\n if ($arr[$index] === false) $arr[$index] = 'false';\n else if ($arr[$index] === true) $arr[$index] = 'true';\n //opts the array.\n echo \"<pre>\",print_r($arr),\"</pre>\";\n } else {\n echo \"<b>$arr</b>\";\n }\n }\n }", "function forNo1()\r\n{\r\nfor($x=1;$x<=10;$x++){\r\n if($x>3 && $x<8){\r\n echo \"\";\r\n continue;\r\n }else{\r\n echo $x.\" \";\r\n }\r\n}\r\n}", "function array_print_1d($arr, $arr_title) {\n\n\t$arr_count = count($arr);\n\t\n\tif(is_array($arr) && $arr_count > 0) {\n\n\t\t$i = 0;\n\t\techo \"<hr /><b>1-D Array: $arr_title Length: \".$arr_count.\"</b>\\n<div class=\\\"raw_table\\\">\\n\";\t\n\t\techo \"<table>\\n\";\n\t\techo \"<tr>\\n\";\n//array indices\n\t\tforeach($arr as $key => $value) {\n\t\t\techo \"<th>$key</th>\";\n\t\t\t}\n\t\t\techo \"</tr>\\n<tr>\";\n//values\n\t\tforeach($arr as $key => $value) {\n\t\t\techo \"<td>\".$value.\"</td>\";\n\t\t\t}\n\t\techo \"</tr>\\n</table>\\n</div>\\n\";\n\t\treturn 1;\n\t\t}\n\t\t\n\tdebug_text_print(\"passed value not an array for array2d_sort()\");\n\treturn 0;\n\t}", "function pre($var) {\n echo '<pre>';\n if (is_array($var)) {\n print_r($var);\n } else {\n var_dump($var);\n }\n echo '</pre>';\n exit;\n}", "function debug_array($a = array(), $b = false) {\n echo \"<pre>\";\n print_r($a);\n echo \"</pre>\";\n if (!$b)\n die();\n return 0;\n }", "function c_print_r($array)\r\n {\r\n if (is_array($array))\r\n {\r\n echo '<pre>';\r\n print_r($array);\r\n echo '</pre>';\r\n }\r\n else\r\n {\r\n echo $array.' Not array';\r\n }\r\n }", "function preShow( $arr, $returnAsString=false ) {\n $ret = '<pre>' . print_r($arr, true) . '</pre>';\n if ($returnAsString)\n return $ret;\n else\n echo $ret; \n }" ]
[ "0.6084363", "0.5636197", "0.5531628", "0.5521504", "0.5494432", "0.53532195", "0.5351206", "0.52995735", "0.52954805", "0.5258302", "0.5197728", "0.515537", "0.5154343", "0.5146934", "0.5140403", "0.51370156", "0.51340854", "0.5133381", "0.5098123", "0.5097356", "0.5089754", "0.5086627", "0.50806546", "0.50755584", "0.5062952", "0.5020547", "0.4994772", "0.49646395", "0.4963974", "0.4940941" ]
0.6712872
0